@linktr.ee/messaging-react 1.12.2-rc-1765320995 → 1.12.2-rc-1765326466

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
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as i, Fragment as Ce } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
2
2
  import p from "classnames";
3
3
  import P, { createContext as Ue, useContext as Oe, useCallback as D, useState as y, useRef as z, useEffect as G } from "react";
4
4
  import { StreamChatService as je } from "@linktr.ee/messaging-core";
5
- import { Chat as Ae, ChannelList as ze, useMessageComposer as Be, useStateStore as $e, MessageInput as Ge, useMessageInputContext as He, useMessageComposerHasSendableData as Ve, SimpleAttachmentSelector as We, QuotedMessagePreview as Ze, AttachmentPreviewList as qe, TextareaComposer as Ye, MessageTimestamp as Je, Channel as Qe, useChannelStateContext as ve, Window as Xe, MessageList as Ke } from "stream-chat-react";
6
- import { XIcon as ue, ArrowUpIcon as es, SpinnerGapIcon as Q, ArrowLeftIcon as he, DotsThreeIcon as fe, SignOutIcon as ss, ProhibitInsetIcon as ge, FlagIcon as ts, MagnifyingGlassIcon as ns, ChatCircleDotsIcon as xe } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as Ne } from "stream-chat";
8
- const we = Ue({
5
+ import { Chat as Ae, ChannelList as ze, useMessageComposer as Be, useStateStore as $e, MessageInput as Ge, useMessageInputContext as He, useMessageComposerHasSendableData as Ve, SimpleAttachmentSelector as We, QuotedMessagePreview as Ze, AttachmentPreviewList as qe, TextareaComposer as Ye, MessageTimestamp as Je, Channel as Qe, useChannelStateContext as we, Window as Xe, MessageList as Ke } from "stream-chat-react";
6
+ import { XIcon as ue, ArrowUpIcon as es, ArrowLeftIcon as fe, DotsThreeIcon as ge, SpinnerGapIcon as re, SignOutIcon as ss, ProhibitInsetIcon as xe, FlagIcon as ts, MagnifyingGlassIcon as ns, ChatCircleDotsIcon as Ne } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as be } from "stream-chat";
8
+ const ye = Ue({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,7 +15,7 @@ const we = Ue({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), ae = () => Oe(we), Ms = ({
18
+ }), ae = () => Oe(ye), Ms = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
@@ -206,7 +206,7 @@ const we = Ue({
206
206
  renderCount: k.current,
207
207
  willRenderChat: !!(g && f),
208
208
  contextValueReady: !!o
209
- }), /* @__PURE__ */ e(we.Provider, { value: o, children: g && f ? /* @__PURE__ */ e(
209
+ }), /* @__PURE__ */ e(ye.Provider, { value: o, children: g && f ? /* @__PURE__ */ e(
210
210
  Ae,
211
211
  {
212
212
  client: g,
@@ -236,7 +236,7 @@ const we = Ue({
236
236
  day: "numeric",
237
237
  year: "2-digit"
238
238
  });
239
- }, be = [
239
+ }, Ce = [
240
240
  "🍎",
241
241
  // Apple
242
242
  "🍌",
@@ -273,8 +273,8 @@ function os(t) {
273
273
  return Math.abs(s);
274
274
  }
275
275
  function is(t) {
276
- const n = os(t) % be.length;
277
- return be[n];
276
+ const n = os(t) % Ce.length;
277
+ return Ce[n];
278
278
  }
279
279
  const q = ({
280
280
  id: t,
@@ -316,7 +316,7 @@ const q = ({
316
316
  )
317
317
  }
318
318
  );
319
- }, ye = P.memo(
319
+ }, Ee = P.memo(
320
320
  ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
321
321
  var N, E, I, k, x, R;
322
322
  const d = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
@@ -385,8 +385,8 @@ const q = ({
385
385
  );
386
386
  }
387
387
  );
388
- ye.displayName = "CustomChannelPreview";
389
- const Ee = P.memo(
388
+ Ee.displayName = "CustomChannelPreview";
389
+ const Ie = P.memo(
390
390
  ({
391
391
  onChannelSelect: t,
392
392
  selectedChannel: s,
@@ -403,7 +403,7 @@ const Ee = P.memo(
403
403
  filters: n
404
404
  });
405
405
  const m = P.useMemo(() => (g) => /* @__PURE__ */ e(
406
- ye,
406
+ Ee,
407
407
  {
408
408
  ...g,
409
409
  selectedChannel: s,
@@ -433,8 +433,8 @@ const Ee = P.memo(
433
433
  );
434
434
  }
435
435
  );
436
- Ee.displayName = "ChannelList";
437
- const re = ({
436
+ Ie.displayName = "ChannelList";
437
+ const ne = ({
438
438
  variant: t = "default",
439
439
  className: s,
440
440
  children: n,
@@ -452,7 +452,7 @@ const re = ({
452
452
  children: n
453
453
  }
454
454
  );
455
- function Ie({ label: t, className: s, children: n, ...r }) {
455
+ function Se({ label: t, className: s, children: n, ...r }) {
456
456
  return /* @__PURE__ */ i(
457
457
  "button",
458
458
  {
@@ -473,12 +473,12 @@ function Ie({ label: t, className: s, children: n, ...r }) {
473
473
  }
474
474
  );
475
475
  }
476
- function Se({ onClick: t }) {
477
- return /* @__PURE__ */ e(Ie, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-stone", weight: "bold" }) });
476
+ function pe({ onClick: t }) {
477
+ return /* @__PURE__ */ e(Se, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-stone", weight: "bold" }) });
478
478
  }
479
479
  const cs = (t) => ({
480
480
  linkPreviews: Array.from(t.previews.values()).filter(
481
- (s) => Ne.previewIsLoaded(s) || Ne.previewIsLoading(s)
481
+ (s) => be.previewIsLoaded(s) || be.previewIsLoading(s)
482
482
  )
483
483
  }), ds = ({
484
484
  link: t,
@@ -537,7 +537,7 @@ const cs = (t) => ({
537
537
  )) }) : null;
538
538
  }, ms = () => {
539
539
  const { handleSubmit: t } = He(), s = Ve();
540
- return /* @__PURE__ */ i(Ce, { children: [
540
+ return /* @__PURE__ */ i(ve, { children: [
541
541
  /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(We, {}) }),
542
542
  /* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
543
543
  /* @__PURE__ */ e(Ze, {}),
@@ -581,9 +581,57 @@ const cs = (t) => ({
581
581
  ] }),
582
582
  !s && /* @__PURE__ */ e(Je, { message: t.message })
583
583
  ] });
584
- }, gs = () => null, xs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
584
+ }, gs = () => null, xs = ({ className: t, message: s }) => /* @__PURE__ */ i(
585
+ "div",
586
+ {
587
+ className: p("flex items-center justify-center h-full", t),
588
+ children: [
589
+ /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
590
+ /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
591
+ "animateTransform",
592
+ {
593
+ attributeName: "transform",
594
+ dur: "1s",
595
+ type: "translate",
596
+ values: "0 15 ; 0 -15; 0 15",
597
+ repeatCount: "indefinite",
598
+ begin: "0.1"
599
+ }
600
+ ) }),
601
+ /* @__PURE__ */ e("circle", { cx: "30", cy: "50", r: "6", children: /* @__PURE__ */ e(
602
+ "animateTransform",
603
+ {
604
+ attributeName: "transform",
605
+ dur: "1s",
606
+ type: "translate",
607
+ values: "0 10 ; 0 -10; 0 10",
608
+ repeatCount: "indefinite",
609
+ begin: "0.2"
610
+ }
611
+ ) }),
612
+ /* @__PURE__ */ e("circle", { cx: "54", cy: "50", r: "6", children: /* @__PURE__ */ e(
613
+ "animateTransform",
614
+ {
615
+ attributeName: "transform",
616
+ dur: "1s",
617
+ type: "translate",
618
+ values: "0 5 ; 0 -5; 0 5",
619
+ repeatCount: "indefinite",
620
+ begin: "0.3"
621
+ }
622
+ ) })
623
+ ] }),
624
+ s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
625
+ ]
626
+ }
627
+ ), me = P.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
628
+ /* @__PURE__ */ e(xs, { className: "w-6 h-6" }),
629
+ /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
630
+ ] }) }));
631
+ me.displayName = "LoadingState";
632
+ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
585
633
  var h, g, w, f, S;
586
- const { channel: a } = ve(), d = P.useMemo(() => Object.values(a.state.members || {}).find(
634
+ const { channel: a } = we(), d = P.useMemo(() => Object.values(a.state.members || {}).find(
587
635
  (v) => {
588
636
  var c;
589
637
  return ((c = v.user) == null ? void 0 : c.id) && v.user.id !== a._client.userID;
@@ -602,7 +650,7 @@ const cs = (t) => ({
602
650
  }),
603
651
  type: "button",
604
652
  "aria-label": "Back to conversations",
605
- children: /* @__PURE__ */ e(he, { className: "size-5 text-black/90" })
653
+ children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
606
654
  }
607
655
  ),
608
656
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
@@ -626,7 +674,7 @@ const cs = (t) => ({
626
674
  onClick: n,
627
675
  type: "button",
628
676
  "aria-label": "Show info",
629
- children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
677
+ children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
630
678
  }
631
679
  )
632
680
  ] }),
@@ -639,7 +687,7 @@ const cs = (t) => ({
639
687
  onClick: t,
640
688
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
641
689
  "aria-label": "Back to conversations",
642
- children: /* @__PURE__ */ e(he, { className: "size-5 text-black/90" })
690
+ children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
643
691
  }
644
692
  ),
645
693
  /* @__PURE__ */ e(
@@ -660,12 +708,12 @@ const cs = (t) => ({
660
708
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
661
709
  ),
662
710
  onClick: n,
663
- children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
711
+ children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
664
712
  }
665
713
  )
666
714
  ] })
667
715
  ] });
668
- }, Ns = ({
716
+ }, bs = ({
669
717
  dialogRef: t,
670
718
  onClose: s,
671
719
  participant: n,
@@ -678,15 +726,15 @@ const cs = (t) => ({
678
726
  onBlockParticipantClick: g,
679
727
  onReportParticipantClick: w
680
728
  }) => {
681
- var X, K, ie, O, H, J, $;
729
+ var Q, X, ie, O, H, J, $;
682
730
  const { service: f, debug: S } = ae(), [M, v] = y(!1), [c, N] = y(!1), [E, I] = y(!1), k = D(async () => {
683
731
  var _;
684
732
  if (!(!f || !((_ = n == null ? void 0 : n.user) != null && _.id)))
685
733
  try {
686
734
  const A = (await f.getBlockedUsers()).some(
687
735
  (V) => {
688
- var ee;
689
- return V.blocked_user_id === ((ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id);
736
+ var K;
737
+ return V.blocked_user_id === ((K = n == null ? void 0 : n.user) == null ? void 0 : K.id);
690
738
  }
691
739
  );
692
740
  v(A);
@@ -696,7 +744,7 @@ const cs = (t) => ({
696
744
  T
697
745
  );
698
746
  }
699
- }, [f, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
747
+ }, [f, (Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id]);
700
748
  G(() => {
701
749
  k();
702
750
  }, [k]);
@@ -745,7 +793,7 @@ const cs = (t) => ({
745
793
  );
746
794
  };
747
795
  if (!n) return null;
748
- const b = ((K = n.user) == null ? void 0 : K.name) || ((ie = n.user) == null ? void 0 : ie.id) || "Unknown member", B = (O = n.user) == null ? void 0 : O.image, j = (H = n.user) == null ? void 0 : H.email, W = (J = n.user) == null ? void 0 : J.username, Y = j || (W ? `linktr.ee/${W}` : void 0), oe = (($ = n.user) == null ? void 0 : $.id) || "unknown";
796
+ const b = ((X = n.user) == null ? void 0 : X.name) || ((ie = n.user) == null ? void 0 : ie.id) || "Unknown member", B = (O = n.user) == null ? void 0 : O.image, j = (H = n.user) == null ? void 0 : H.email, W = (J = n.user) == null ? void 0 : J.username, Y = j || (W ? `linktr.ee/${W}` : void 0), oe = (($ = n.user) == null ? void 0 : $.id) || "unknown";
749
797
  return (
750
798
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
751
799
  /* @__PURE__ */ e(
@@ -760,7 +808,7 @@ const cs = (t) => ({
760
808
  children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
761
809
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
762
810
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
763
- /* @__PURE__ */ e(Se, { onClick: s })
811
+ /* @__PURE__ */ e(pe, { onClick: s })
764
812
  ] }),
765
813
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
766
814
  /* @__PURE__ */ e(
@@ -802,41 +850,41 @@ const cs = (t) => ({
802
850
  ),
803
851
  /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
804
852
  m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
805
- re,
853
+ ne,
806
854
  {
807
855
  onClick: x,
808
856
  disabled: c,
809
857
  "aria-busy": c,
810
858
  children: [
811
- c ? /* @__PURE__ */ e(Q, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ss, { className: "h-5 w-5" }),
859
+ c ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ss, { className: "h-5 w-5" }),
812
860
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
813
861
  ]
814
862
  }
815
863
  ) }),
816
864
  /* @__PURE__ */ e("li", { children: M ? /* @__PURE__ */ i(
817
- re,
865
+ ne,
818
866
  {
819
867
  onClick: o,
820
868
  disabled: E,
821
869
  "aria-busy": E,
822
870
  children: [
823
- E ? /* @__PURE__ */ e(Q, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ge, { className: "h-5 w-5" }),
871
+ E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
824
872
  /* @__PURE__ */ e("span", { children: "Unblock" })
825
873
  ]
826
874
  }
827
875
  ) : /* @__PURE__ */ i(
828
- re,
876
+ ne,
829
877
  {
830
878
  onClick: R,
831
879
  disabled: E,
832
880
  "aria-busy": E,
833
881
  children: [
834
- E ? /* @__PURE__ */ e(Q, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ge, { className: "h-5 w-5" }),
882
+ E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
835
883
  /* @__PURE__ */ e("span", { children: "Block" })
836
884
  ]
837
885
  }
838
886
  ) }),
839
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(re, { variant: "danger", onClick: u, children: [
887
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ne, { variant: "danger", onClick: u, children: [
840
888
  /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
841
889
  /* @__PURE__ */ e("span", { children: "Report" })
842
890
  ] }) })
@@ -846,7 +894,7 @@ const cs = (t) => ({
846
894
  }
847
895
  )
848
896
  );
849
- }, bs = ({
897
+ }, Cs = ({
850
898
  onBack: t,
851
899
  showBackButton: s,
852
900
  renderMessageInputActions: n,
@@ -857,7 +905,7 @@ const cs = (t) => ({
857
905
  onBlockParticipantClick: m,
858
906
  onReportParticipantClick: h
859
907
  }) => {
860
- const { channel: g } = ve(), w = z(null), f = P.useMemo(() => Object.values(g.state.members || {}).find(
908
+ const { channel: g } = we(), w = z(null), f = P.useMemo(() => Object.values(g.state.members || {}).find(
861
909
  (N) => {
862
910
  var E;
863
911
  return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== g._client.userID;
@@ -875,10 +923,10 @@ const cs = (t) => ({
875
923
  var c;
876
924
  (c = w.current) == null || c.close();
877
925
  }, []);
878
- return /* @__PURE__ */ i(Ce, { children: [
926
+ return /* @__PURE__ */ i(ve, { children: [
879
927
  /* @__PURE__ */ i(Xe, { children: [
880
928
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
881
- xs,
929
+ Ns,
882
930
  {
883
931
  onBack: t,
884
932
  showBackButton: s,
@@ -902,7 +950,7 @@ const cs = (t) => ({
902
950
  )
903
951
  ] }),
904
952
  /* @__PURE__ */ e(
905
- Ns,
953
+ bs,
906
954
  {
907
955
  dialogRef: w,
908
956
  onClose: v,
@@ -918,7 +966,7 @@ const cs = (t) => ({
918
966
  }
919
967
  )
920
968
  ] });
921
- }, pe = P.memo(
969
+ }, ke = P.memo(
922
970
  ({
923
971
  channel: t,
924
972
  onBack: s,
@@ -945,12 +993,9 @@ const cs = (t) => ({
945
993
  channel: t,
946
994
  MessageSystem: fs,
947
995
  EmptyStateIndicator: m,
948
- LoadingIndicator: () => /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
949
- /* @__PURE__ */ e(Q, { className: "h-5 w-5 animate-spin text-stone" }),
950
- /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages..." })
951
- ] }) }),
996
+ LoadingIndicator: me,
952
997
  children: /* @__PURE__ */ e(
953
- bs,
998
+ Cs,
954
999
  {
955
1000
  onBack: s,
956
1001
  showBackButton: n,
@@ -969,8 +1014,8 @@ const cs = (t) => ({
969
1014
  }
970
1015
  )
971
1016
  );
972
- pe.displayName = "ChannelView";
973
- function Cs({
1017
+ ke.displayName = "ChannelView";
1018
+ function vs({
974
1019
  searchQuery: t,
975
1020
  setSearchQuery: s,
976
1021
  placeholder: n
@@ -996,7 +1041,7 @@ function Cs({
996
1041
  }
997
1042
  ),
998
1043
  t && /* @__PURE__ */ e(
999
- Ie,
1044
+ Se,
1000
1045
  {
1001
1046
  label: "Clear search",
1002
1047
  onClick: () => {
@@ -1009,7 +1054,7 @@ function Cs({
1009
1054
  )
1010
1055
  ] });
1011
1056
  }
1012
- const vs = ({
1057
+ const ws = ({
1013
1058
  participantSource: t,
1014
1059
  onSelectParticipant: s,
1015
1060
  onClose: n,
@@ -1073,7 +1118,7 @@ const vs = ({
1073
1118
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1074
1119
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1075
1120
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1076
- /* @__PURE__ */ e(Se, { onClick: n })
1121
+ /* @__PURE__ */ e(pe, { onClick: n })
1077
1122
  ] }),
1078
1123
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1079
1124
  "Select a ",
@@ -1084,7 +1129,7 @@ const vs = ({
1084
1129
  t.totalCount !== void 0 && ` • ${t.totalCount} ${a} total`
1085
1130
  ] }),
1086
1131
  /* @__PURE__ */ e(
1087
- Cs,
1132
+ vs,
1088
1133
  {
1089
1134
  searchQuery: h,
1090
1135
  setSearchQuery: g,
@@ -1106,7 +1151,7 @@ const vs = ({
1106
1151
  "..."
1107
1152
  ] })
1108
1153
  ] }) }) : k.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1109
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(xe, { className: "h-8 w-8 text-charcoal" }) }),
1154
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ne, { className: "h-8 w-8 text-charcoal" }) }),
1110
1155
  /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${a} found` : w.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1111
1156
  /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1112
1157
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
@@ -1135,7 +1180,7 @@ const vs = ({
1135
1180
  b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
1136
1181
  ] })
1137
1182
  ] }),
1138
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === o.id ? /* @__PURE__ */ e(Q, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5 text-stone" }) })
1183
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === o.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
1139
1184
  ] })
1140
1185
  }
1141
1186
  ) }, o.id);
@@ -1146,7 +1191,7 @@ const vs = ({
1146
1191
  ] }) })
1147
1192
  ] }) })
1148
1193
  ] });
1149
- }, ws = ({ className: t }) => /* @__PURE__ */ i(
1194
+ }, ys = ({ className: t }) => /* @__PURE__ */ i(
1150
1195
  "svg",
1151
1196
  {
1152
1197
  width: "140",
@@ -1280,16 +1325,16 @@ const vs = ({
1280
1325
  ] })
1281
1326
  ]
1282
1327
  }
1283
- ), ke = P.memo(
1328
+ ), Re = P.memo(
1284
1329
  ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1285
- /* @__PURE__ */ e(ws, {}),
1330
+ /* @__PURE__ */ e(ys, {}),
1286
1331
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1287
1332
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1288
1333
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1289
1334
  ] })
1290
1335
  ] }) })
1291
1336
  );
1292
- ke.displayName = "EmptyState";
1337
+ Re.displayName = "EmptyState";
1293
1338
  const le = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1294
1339
  /* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
1295
1340
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
@@ -1305,54 +1350,6 @@ const le = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1305
1350
  )
1306
1351
  ] }) }));
1307
1352
  le.displayName = "ErrorState";
1308
- const ys = ({ className: t, message: s }) => /* @__PURE__ */ i(
1309
- "div",
1310
- {
1311
- className: p("flex items-center justify-center h-full", t),
1312
- children: [
1313
- /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1314
- /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
1315
- "animateTransform",
1316
- {
1317
- attributeName: "transform",
1318
- dur: "1s",
1319
- type: "translate",
1320
- values: "0 15 ; 0 -15; 0 15",
1321
- repeatCount: "indefinite",
1322
- begin: "0.1"
1323
- }
1324
- ) }),
1325
- /* @__PURE__ */ e("circle", { cx: "30", cy: "50", r: "6", children: /* @__PURE__ */ e(
1326
- "animateTransform",
1327
- {
1328
- attributeName: "transform",
1329
- dur: "1s",
1330
- type: "translate",
1331
- values: "0 10 ; 0 -10; 0 10",
1332
- repeatCount: "indefinite",
1333
- begin: "0.2"
1334
- }
1335
- ) }),
1336
- /* @__PURE__ */ e("circle", { cx: "54", cy: "50", r: "6", children: /* @__PURE__ */ e(
1337
- "animateTransform",
1338
- {
1339
- attributeName: "transform",
1340
- dur: "1s",
1341
- type: "translate",
1342
- values: "0 5 ; 0 -5; 0 5",
1343
- repeatCount: "indefinite",
1344
- begin: "0.3"
1345
- }
1346
- ) })
1347
- ] }),
1348
- s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1349
- ]
1350
- }
1351
- ), Re = P.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1352
- /* @__PURE__ */ e(ys, { className: "w-6 h-6" }),
1353
- /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1354
- ] }) }));
1355
- Re.displayName = "LoadingState";
1356
1353
  const Fs = ({
1357
1354
  capabilities: t = {},
1358
1355
  className: s,
@@ -1377,11 +1374,11 @@ const Fs = ({
1377
1374
  error: I,
1378
1375
  refreshConnection: k,
1379
1376
  debug: x
1380
- } = rs(), [R, o] = y(null), [u, b] = y(!1), [B, j] = y(!1), [W, Y] = y(!1), [oe, X] = y(/* @__PURE__ */ new Set()), [K, ie] = y(0), [O, H] = y(!1), [J, $] = y(null), _ = z(null), {
1377
+ } = rs(), [R, o] = y(null), [u, b] = y(!1), [B, j] = y(!1), [W, Y] = y(!1), [oe, Q] = y(/* @__PURE__ */ new Set()), [X, ie] = y(0), [O, H] = y(!1), [J, $] = y(null), _ = z(null), {
1381
1378
  participantSource: T,
1382
1379
  participantLabel: A = "participants",
1383
1380
  showDeleteConversation: V = !0
1384
- } = t, ee = P.useMemo(() => {
1381
+ } = t, K = P.useMemo(() => {
1385
1382
  const C = c == null ? void 0 : c.userID;
1386
1383
  return {
1387
1384
  ...{
@@ -1394,7 +1391,7 @@ const Fs = ({
1394
1391
  },
1395
1392
  ...g
1396
1393
  };
1397
- }, [g, c == null ? void 0 : c.userID]), se = z(null), Z = D(async () => {
1394
+ }, [g, c == null ? void 0 : c.userID]), ee = z(null), Z = D(async () => {
1398
1395
  if (!c || !N) return;
1399
1396
  const C = c.userID;
1400
1397
  if (C)
@@ -1411,11 +1408,11 @@ const Fs = ({
1411
1408
  U.forEach((L) => {
1412
1409
  const ce = L.state.members;
1413
1410
  Object.values(ce).forEach((Pe) => {
1414
- var me;
1415
- const de = (me = Pe.user) == null ? void 0 : me.id;
1411
+ var he;
1412
+ const de = (he = Pe.user) == null ? void 0 : he.id;
1416
1413
  de && de !== C && F.add(de);
1417
1414
  });
1418
- }), X((L) => L.size === F.size && [...L].every((ce) => F.has(ce)) ? L : F), b(U.length > 0), j(!0), se.current = C, x && console.log("[MessagingShell] Channels synced successfully:", {
1415
+ }), Q((L) => L.size === F.size && [...L].every((ce) => F.has(ce)) ? L : F), b(U.length > 0), j(!0), ee.current = C, x && console.log("[MessagingShell] Channels synced successfully:", {
1419
1416
  channelCount: U.length,
1420
1417
  memberCount: F.size
1421
1418
  });
@@ -1426,7 +1423,7 @@ const Fs = ({
1426
1423
  G(() => {
1427
1424
  if (!c || !N) return;
1428
1425
  const C = c.userID;
1429
- C && se.current !== C && Z();
1426
+ C && ee.current !== C && Z();
1430
1427
  }, [c, N, Z]), G(() => {
1431
1428
  if (!d || !c || !N) return;
1432
1429
  (async () => {
@@ -1528,26 +1525,26 @@ const Fs = ({
1528
1525
  }
1529
1526
  },
1530
1527
  [v, a, x]
1531
- ), te = D(() => {
1528
+ ), se = D(() => {
1532
1529
  var C;
1533
1530
  Y(!1), (C = _.current) == null || C.close();
1534
1531
  }, []), Fe = D(
1535
1532
  (C) => {
1536
- C.target === _.current && te();
1533
+ C.target === _.current && se();
1537
1534
  },
1538
- [te]
1535
+ [se]
1539
1536
  ), Te = D(
1540
1537
  async (C) => {
1541
- x && console.log("[MessagingShell] Leaving conversation:", C.id), o(null), H(!1), se.current = null, await Z();
1538
+ x && console.log("[MessagingShell] Leaving conversation:", C.id), o(null), H(!1), ee.current = null, await Z();
1542
1539
  },
1543
1540
  [Z, x]
1544
1541
  ), Le = D(
1545
1542
  async (C) => {
1546
- x && console.log("[MessagingShell] Blocking participant:", C), o(null), H(!1), se.current = null, await Z();
1543
+ x && console.log("[MessagingShell] Blocking participant:", C), o(null), H(!1), ee.current = null, await Z();
1547
1544
  },
1548
1545
  [Z, x]
1549
- ), ne = !!R;
1550
- return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(Re, {}) }) : I ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: I, onBack: k }) }) : !N || !c ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
1546
+ ), te = !!R;
1547
+ return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(me, {}) }) : I ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: I, onBack: k }) }) : !N || !c ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
1551
1548
  le,
1552
1549
  {
1553
1550
  message: "Not connected to messaging service",
@@ -1570,17 +1567,17 @@ const Fs = ({
1570
1567
  {
1571
1568
  "!hidden": h === !1 || O,
1572
1569
  // Hide on mobile when channel selected, show on desktop with consistent narrow width
1573
- "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && ne,
1570
+ "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && te,
1574
1571
  // Show on mobile when no channel selected, use same narrow width on desktop
1575
- "flex flex-col w-full lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && !ne
1572
+ "flex flex-col w-full lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && !te
1576
1573
  }
1577
1574
  ),
1578
1575
  children: /* @__PURE__ */ e(
1579
- Ee,
1576
+ Ie,
1580
1577
  {
1581
1578
  onChannelSelect: _e,
1582
1579
  selectedChannel: R || void 0,
1583
- filters: ee,
1580
+ filters: K,
1584
1581
  customEmptyStateIndicator: w
1585
1582
  }
1586
1583
  )
@@ -1593,13 +1590,13 @@ const Fs = ({
1593
1590
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1594
1591
  {
1595
1592
  // In direct conversation mode, always show (full width)
1596
- flex: O || ne,
1593
+ flex: O || te,
1597
1594
  // Normal mode: hide on mobile when no channel selected
1598
- "hidden lg:flex": !O && !ne
1595
+ "hidden lg:flex": !O && !te
1599
1596
  }
1600
1597
  ),
1601
1598
  children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1602
- pe,
1599
+ ke,
1603
1600
  {
1604
1601
  channel: R,
1605
1602
  onBack: De,
@@ -1615,7 +1612,7 @@ const Fs = ({
1615
1612
  },
1616
1613
  R.id
1617
1614
  ) }) : /* @__PURE__ */ e(
1618
- ke,
1615
+ Re,
1619
1616
  {
1620
1617
  hasChannels: u,
1621
1618
  channelsLoaded: B
@@ -1631,18 +1628,18 @@ const Fs = ({
1631
1628
  ref: _,
1632
1629
  className: "mes-dialog",
1633
1630
  onClick: Fe,
1634
- onClose: te,
1631
+ onClose: se,
1635
1632
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1636
- vs,
1633
+ ws,
1637
1634
  {
1638
1635
  participantSource: T,
1639
1636
  onSelectParticipant: Me,
1640
- onClose: te,
1637
+ onClose: se,
1641
1638
  existingParticipantIds: oe,
1642
1639
  participantLabel: A,
1643
1640
  searchPlaceholder: `Search ${A}...`
1644
1641
  },
1645
- K
1642
+ X
1646
1643
  ) })
1647
1644
  }
1648
1645
  )
@@ -1756,13 +1753,13 @@ const Fs = ({
1756
1753
  export {
1757
1754
  q as Avatar,
1758
1755
  gs as ChannelEmptyState,
1759
- Ee as ChannelList,
1760
- pe as ChannelView,
1756
+ Ie as ChannelList,
1757
+ ke as ChannelView,
1761
1758
  Ts as FaqList,
1762
1759
  Es as FaqListItem,
1763
1760
  Ms as MessagingProvider,
1764
1761
  Fs as MessagingShell,
1765
- vs as ParticipantPicker,
1762
+ ws as ParticipantPicker,
1766
1763
  as as formatRelativeTime,
1767
1764
  rs as useMessaging,
1768
1765
  Ls as useParticipants