@ethora/chat-component 26.7.5 → 26.7.7

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.
Files changed (174) hide show
  1. package/README.md +72 -16
  2. package/dist/ChatProfileModal-DehQM4Bo.js +2135 -0
  3. package/dist/FilePreviewModal-BcZLtVAy.js +743 -0
  4. package/dist/ManageDataModal-DWabKhSC.js +178 -0
  5. package/dist/MarkdownBody-CSY3YKDh.js +16874 -0
  6. package/dist/SideDrawer-DewJ-iPn.js +270 -0
  7. package/dist/UserProfileModal-BHZ0TULc.js +574 -0
  8. package/dist/UserSettingsModal-BxwVWNKo.js +50 -0
  9. package/dist/{VideoCallOverlay-C4M2I9oV.js → VideoCallOverlay-D5SuimGP.js} +9 -10
  10. package/dist/VisibilityModal-Bd67b4EM.js +132 -0
  11. package/dist/assets/icons.d.ts +30 -0
  12. package/dist/components/ContextMenu/ContextMenuComponents.d.ts +1 -3
  13. package/dist/components/EmojiPicker/LazyEmojiPicker.d.ts +3 -0
  14. package/dist/components/ExampleComponents/CustomMessage.d.ts +3 -3
  15. package/dist/components/Files/FilesList.d.ts +12 -0
  16. package/dist/components/Files/FilesPanel.d.ts +3 -0
  17. package/dist/components/Files/fileCategory.d.ts +13 -0
  18. package/dist/components/InputComponents/AttachmentPreview.d.ts +17 -0
  19. package/dist/components/InputComponents/MentionDropdown.d.ts +13 -0
  20. package/dist/components/InputComponents/MentionPickerModal.d.ts +19 -0
  21. package/dist/components/MainComponents/AttachmentList.d.ts +7 -0
  22. package/dist/components/MainComponents/ChatErrorBoundary.d.ts +53 -0
  23. package/dist/components/MainComponents/ChatErrorScreen.d.ts +24 -0
  24. package/dist/components/MainComponents/ChatRoomOpeningPreview.d.ts +24 -0
  25. package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
  26. package/dist/components/MainComponents/ChooseChatMessage.d.ts +11 -1
  27. package/dist/components/MainComponents/HeaderLogo.d.ts +18 -0
  28. package/dist/components/MainComponents/MediaMessage.d.ts +5 -0
  29. package/dist/components/MainComponents/MessageContainer.d.ts +2 -2
  30. package/dist/components/MainComponents/ReduxWrapper.d.ts +1 -2
  31. package/dist/components/MainComponents/SystemMessage.d.ts +1 -2
  32. package/dist/components/MenuRoom/MenuRoom.d.ts +1 -0
  33. package/dist/components/MessageBubble/CustomDivider.d.ts +3 -3
  34. package/dist/components/MessageBubble/Message.d.ts +2 -2
  35. package/dist/components/MessageBubble/MessageTranslate.d.ts +28 -10
  36. package/dist/components/MessageBubble/QuickReplies.d.ts +6 -5
  37. package/dist/components/Modals/ChatProfileModal/ChatProfileMemberRow.d.ts +18 -0
  38. package/dist/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +17 -0
  39. package/dist/components/Modals/FilePreviewModal/ImageLightbox.d.ts +35 -0
  40. package/dist/components/Modals/FilePreviewModal/PdfView.d.ts +14 -3
  41. package/dist/components/Modals/Modal/Modal.d.ts +10 -0
  42. package/dist/components/Modals/Modal/ModalContent.d.ts +21 -0
  43. package/dist/components/Modals/ModalBox/ModalBox.d.ts +9 -0
  44. package/dist/components/Modals/ModalReportChat/ModalReportChat.d.ts +6 -1
  45. package/dist/components/Modals/ModalWrapper/ModalWrapper.d.ts +8 -0
  46. package/dist/components/Modals/NewChatModal/styledNewChatComponents.d.ts +12 -0
  47. package/dist/components/Modals/SettingsModals/SharedStyledComponents.d.ts +12 -0
  48. package/dist/components/Modals/SettingsModals/Visibility/StyledComponents.d.ts +1 -1
  49. package/dist/components/Modals/SideDrawer/DrawerProfileParts.d.ts +42 -0
  50. package/dist/components/Modals/SideDrawer/SideDrawer.d.ts +64 -0
  51. package/dist/components/Modals/SidePanel/SidePanel.d.ts +31 -0
  52. package/dist/components/Modals/UserProfileModal/EditUserModal.d.ts +5 -1
  53. package/dist/components/Modals/modalComponents.d.ts +6 -0
  54. package/dist/components/Modals/motionVariants.d.ts +37 -0
  55. package/dist/components/Modals/styledModalComponents.d.ts +13 -3
  56. package/dist/components/RoomComponents/ChatRoomItem.d.ts +0 -1
  57. package/dist/components/RoomComponents/OnlineUsersPopover.d.ts +0 -1
  58. package/dist/components/UsersList/StyledComponents.d.ts +5 -1
  59. package/dist/components/UsersList/UsersList.d.ts +23 -0
  60. package/dist/components/styled/Button.d.ts +11 -1
  61. package/dist/components/styled/ChatWrapperBox.d.ts +3 -1
  62. package/dist/components/styled/PdfMessage.d.ts +13 -0
  63. package/dist/components/styled/RoomListComponents/index.d.ts +22 -1
  64. package/dist/components/styled/SendInput.d.ts +19 -5
  65. package/dist/components/styled/StyledComponents.d.ts +1 -1
  66. package/dist/components/styled/StyledInputComponents/MediaComponents.d.ts +18 -0
  67. package/dist/components/styled/StyledInputComponents/StyledInputComponents.d.ts +21 -0
  68. package/dist/components/styled/TreadLabel.d.ts +2 -2
  69. package/dist/components/styled/UnsupportedType.d.ts +1 -1
  70. package/dist/context/ModalTransitionContext.d.ts +2 -0
  71. package/dist/examples/quiz/QuizDemo.d.ts +3 -0
  72. package/dist/examples/quiz/quizScript.d.ts +38 -0
  73. package/dist/examples/quiz/useDemoSession.d.ts +42 -0
  74. package/dist/examples/quiz/useQuizFlow.d.ts +47 -0
  75. package/dist/firebase-config.d.ts +2 -4
  76. package/dist/handleCopyClick-BoZWTBLC.js +108 -0
  77. package/dist/helpers/MarkdownBody.d.ts +7 -0
  78. package/dist/helpers/attachments.d.ts +33 -0
  79. package/dist/helpers/botMarkup.d.ts +30 -0
  80. package/dist/helpers/buildChatShareLink.d.ts +20 -0
  81. package/dist/helpers/cacheScope.d.ts +15 -1
  82. package/dist/helpers/constants/MODAL_TYPES.d.ts +13 -7
  83. package/dist/helpers/createRoomFromApi.d.ts +1 -1
  84. package/dist/helpers/ethoraLogger.d.ts +8 -0
  85. package/dist/helpers/fileKind.d.ts +17 -0
  86. package/dist/helpers/formatNumberWithCommas.d.ts +1 -1
  87. package/dist/helpers/hiddenRooms.d.ts +1 -1
  88. package/dist/helpers/historyPreloadScheduler.d.ts +1 -0
  89. package/dist/helpers/lazyEmoji.d.ts +3 -0
  90. package/dist/helpers/localStorageUser.d.ts +1 -1
  91. package/dist/helpers/markdownSanitizeSchema.d.ts +3 -0
  92. package/dist/helpers/mentions.d.ts +63 -0
  93. package/dist/helpers/parseMessageBody.d.ts +12 -2
  94. package/dist/helpers/pdf/loadPdfjs.d.ts +64 -0
  95. package/dist/helpers/remarkLineBreaks.d.ts +42 -0
  96. package/dist/helpers/resolveMessageTranslation.d.ts +34 -0
  97. package/dist/helpers/roomImageGallery.d.ts +53 -0
  98. package/dist/helpers/secureFileUrl.d.ts +8 -0
  99. package/dist/helpers/sendFailureWatchdog.d.ts +62 -0
  100. package/dist/helpers/transformTranslatations.d.ts +1 -2
  101. package/dist/hooks/pushSubscriptionSweep.d.ts +41 -0
  102. package/dist/hooks/useChatOpenPhase.d.ts +21 -0
  103. package/dist/hooks/useChatWrapperInit.d.ts +1 -0
  104. package/dist/hooks/useDelayedAction.d.ts +22 -0
  105. package/dist/hooks/useExclusiveRightPane.d.ts +25 -0
  106. package/dist/hooks/useExitTransition.d.ts +24 -0
  107. package/dist/hooks/useFilesEndpointSupport.d.ts +9 -0
  108. package/dist/hooks/useGetNewArchRoom.d.ts +3 -1
  109. package/dist/hooks/useInView.d.ts +17 -0
  110. package/dist/hooks/useMentionComposer.d.ts +45 -0
  111. package/dist/hooks/useMessageHeapState.d.ts +1 -1
  112. package/dist/hooks/useMessageTranslation.d.ts +4 -3
  113. package/dist/hooks/useModalDismiss.d.ts +27 -0
  114. package/dist/hooks/useMyFiles.d.ts +16 -0
  115. package/dist/hooks/usePdfThumbnail.d.ts +22 -0
  116. package/dist/hooks/useQRCodeChatHandler.d.ts +29 -1
  117. package/dist/hooks/useRoomMute.d.ts +19 -0
  118. package/dist/hooks/useRoomState.d.ts +1 -1
  119. package/dist/hooks/useSendMessage.d.ts +4 -3
  120. package/dist/hooks/useTypography.d.ts +1 -1
  121. package/dist/hooks/useUnreadMessagesCounter.d.ts +11 -2
  122. package/dist/index.esm-B-3fyDHY.js +28 -0
  123. package/dist/index.esm-CRM4VCRa.js +943 -0
  124. package/dist/index.esm-msbp26WN.js +3352 -0
  125. package/dist/index.esm2017-CL0mvq6y.js +1578 -0
  126. package/dist/main-C2FKeV6y.js +32375 -0
  127. package/dist/main.css +1 -1
  128. package/dist/main.d.ts +14 -0
  129. package/dist/main.js +18 -18
  130. package/dist/module-DGXkb0R_.js +2960 -0
  131. package/dist/native-CDi4YD_s.js +13 -0
  132. package/dist/networking/api-requests/files.api.d.ts +19 -0
  133. package/dist/networking/api-requests/rooms.api.d.ts +10 -2
  134. package/dist/networking/api-requests/translate.api.d.ts +15 -0
  135. package/dist/networking/api-requests/user.api.d.ts +2 -0
  136. package/dist/networking/sharedRequest.d.ts +4 -0
  137. package/dist/networking/xmpp/allRoomPresences.xmpp.d.ts +3 -1
  138. package/dist/networking/xmpp/createTimeoutPromise.xmpp.d.ts +14 -0
  139. package/dist/networking/xmpp/sendTextMessage.xmpp.d.ts +2 -1
  140. package/dist/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts +2 -1
  141. package/dist/networking/xmppClient.d.ts +12 -3
  142. package/dist/pdf-B5b7qHu6.js +17130 -0
  143. package/dist/pdf.worker.min-COYn-gId.js +24385 -0
  144. package/dist/roomStore/index.d.ts +20 -0
  145. package/dist/roomStore/persistEncryption.d.ts +51 -0
  146. package/dist/roomStore/roomsSlice.d.ts +49 -6
  147. package/dist/styles/classNames.d.ts +35 -0
  148. package/dist/styles/motion.d.ts +71 -0
  149. package/dist/styles/tokens.d.ts +27 -0
  150. package/dist/testIds.d.ts +1 -1
  151. package/dist/types/models/attachment.model.d.ts +33 -0
  152. package/dist/types/models/config.model.d.ts +160 -19
  153. package/dist/types/models/file.model.d.ts +20 -0
  154. package/dist/types/models/message.model.d.ts +15 -6
  155. package/dist/types/models/room.model.d.ts +40 -2
  156. package/dist/types/types.d.ts +3 -1
  157. package/dist/utils/resendMessage.d.ts +22 -1
  158. package/dist/utils/translateModePolicy.d.ts +1 -0
  159. package/dist/wavesurfer.esm-D_a19qBW.js +952 -0
  160. package/package.json +22 -2
  161. package/dist/VideoCallOverlay-C4M2I9oV.js.map +0 -1
  162. package/dist/components/MainComponents/VirtualList.d.ts +0 -10
  163. package/dist/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.d.ts +0 -6
  164. package/dist/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.d.ts +0 -6
  165. package/dist/components/Modals/SettingsModals/ManageDataModal/StyledComponents.d.ts +0 -0
  166. package/dist/components/Modals/SettingsModals/ProfileShares/ProfileShares.d.ts +0 -6
  167. package/dist/components/Modals/SettingsModals/Referrals/Referrals.d.ts +0 -6
  168. package/dist/hooks/useMessageQueue.d.ts +0 -4
  169. package/dist/main-DeiuFYsl.js +0 -55812
  170. package/dist/main-DeiuFYsl.js.map +0 -1
  171. package/dist/main.js.map +0 -1
  172. package/dist/networking/xmpp/getHistory.xmpp.d.ts +0 -3
  173. package/dist/networking/xmpp/listenerManager.d.ts +0 -17
  174. package/dist/utils/xmppMemoryMonitor.d.ts +0 -16
@@ -0,0 +1,574 @@
1
+ import { jsxs as f, Fragment as B, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as me, useState as D, useCallback as S, useImperativeHandle as he, useRef as ee, useMemo as H } from "react";
3
+ import { a as fe, n as J, p as ue, q as ge, t as ve, P as oe, I as M, v as I, w as be, x as ye, y as xe, z as ae, C as we, D as Ce, E as Se, F as De, u as q, G as Ie, J as Ne, L as Ue, K as ke, N as _, o as Q, O as Ae, Q as Pe, R as Re, s as ze, B as X, S as je, T as Fe, U as Be, W as Y, X as F, Y as $e, V as Oe, A as Ee, Z as Te, _ as Le, $ as He, a0 as Me } from "./main-C2FKeV6y.js";
4
+ import { D as $, a as W, b as Xe, e as We, f as Je, S as Ke } from "./SideDrawer-DewJ-iPn.js";
5
+ import { P as re, a as Ve, D as Ge, b as qe, h as _e } from "./handleCopyClick-BoZWTBLC.js";
6
+ const Qe = (c, s) => {
7
+ const i = atob(c.split(",")[1]), u = new ArrayBuffer(i.length), e = new Uint8Array(u);
8
+ for (let r = 0; r < i.length; r++)
9
+ e[r] = i.charCodeAt(r);
10
+ const l = new Blob([e], { type: "image/jpeg" });
11
+ return new File([l], s, { type: "image/jpeg" });
12
+ }, Ye = I.div`
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: var(--ethora-space-4, 16px);
16
+ width: 100%;
17
+ `, te = me(
18
+ ({ setIsEditing: c, modalUser: s, config: i }, u) => {
19
+ const e = fe(), l = J(), [r, t] = D(s?.firstName || ""), [h, k] = D(s?.lastName || ""), [b, w] = D(s?.description || ""), [g, y] = D(
20
+ s?.profileImage
21
+ ), x = S(async () => {
22
+ try {
23
+ let n = new FormData();
24
+ if (typeof g == "string" && g.startsWith("data:image/")) {
25
+ const U = Qe(g, "profileImage.jpg");
26
+ n.append("file", U);
27
+ } else g instanceof File && n.append("file", g);
28
+ n.append("firstName", r), n.append("lastName", h), n.append("description", b);
29
+ const { user: A } = await ue(n);
30
+ e(
31
+ ge({
32
+ updates: {
33
+ firstName: r,
34
+ lastName: h,
35
+ description: b,
36
+ profileImage: A?.profileImage
37
+ }
38
+ })
39
+ ), c(!1);
40
+ } catch (n) {
41
+ ve.log("error", n);
42
+ }
43
+ }, [
44
+ e,
45
+ b,
46
+ r,
47
+ h,
48
+ g,
49
+ c
50
+ ]);
51
+ he(u, () => ({ save: x }), [x]);
52
+ const C = (n) => {
53
+ y(n);
54
+ };
55
+ return /* @__PURE__ */ f(B, { children: [
56
+ /* @__PURE__ */ o(re, { children: /* @__PURE__ */ o(
57
+ oe,
58
+ {
59
+ icon: g,
60
+ name: `${r} ${h}`,
61
+ size: 96,
62
+ upload: {
63
+ onUpload: C,
64
+ active: !0
65
+ }
66
+ }
67
+ ) }),
68
+ /* @__PURE__ */ o($, { children: /* @__PURE__ */ f(Ye, { children: [
69
+ /* @__PURE__ */ o(
70
+ M,
71
+ {
72
+ color: i?.colors?.primary,
73
+ colorBg: i?.colors?.colorInput,
74
+ placeholder: l("field.firstName"),
75
+ label: l("field.firstName"),
76
+ value: r,
77
+ onChange: (n) => t(n.target.value)
78
+ }
79
+ ),
80
+ /* @__PURE__ */ o(
81
+ M,
82
+ {
83
+ color: i?.colors?.primary,
84
+ colorBg: i?.colors?.colorInput,
85
+ placeholder: l("field.lastName"),
86
+ label: l("field.lastName"),
87
+ value: h,
88
+ onChange: (n) => k(n.target.value)
89
+ }
90
+ ),
91
+ /* @__PURE__ */ o(
92
+ M,
93
+ {
94
+ color: i?.colors?.primary,
95
+ colorBg: i?.colors?.colorInput,
96
+ placeholder: l("modal.profile.about"),
97
+ label: l("modal.profile.about"),
98
+ value: b,
99
+ onChange: (n) => w(n.target.value)
100
+ }
101
+ )
102
+ ] }) })
103
+ ] });
104
+ }
105
+ );
106
+ te.displayName = "EditUserModal";
107
+ const Ze = ae`
108
+ from {
109
+ transform: rotate(0deg);
110
+ }
111
+ to {
112
+ transform: rotate(180deg);
113
+ }
114
+ `, eo = ae`
115
+ from {
116
+ transform: rotate(180deg);
117
+ }
118
+ to {
119
+ transform: rotate(0deg);
120
+ }
121
+ `, oo = I.div`
122
+ position: relative;
123
+ width: 100%;
124
+ `, ao = I.div`
125
+ border: 1px solid
126
+ ${({ $borderColor: c, $isOpen: s }) => s ? c || "var(--ethora-color-primary, #0052cd)" : c || "var(--ethora-color-border, #e6e8ec)"};
127
+ padding: 0 16px;
128
+ height: 48px;
129
+ box-sizing: border-box;
130
+ display: flex;
131
+ justify-content: space-between;
132
+ align-items: center;
133
+ cursor: pointer;
134
+ background-color: var(--ethora-color-bg, #fff);
135
+ color: var(--ethora-color-text, #141414);
136
+ font-size: var(--ethora-font-size, 16px);
137
+ border-radius: var(--ethora-radius-md, 16px);
138
+ transition:
139
+ border-color var(--ethora-motion-fast, 150ms) var(--ethora-motion-ease, ease),
140
+ box-shadow var(--ethora-motion-fast, 150ms) var(--ethora-motion-ease, ease);
141
+
142
+ ${({ $isOpen: c }) => c && ye`
143
+ outline: 2px solid var(--ethora-color-primary, #0052cd);
144
+ outline-offset: 1px;
145
+ `}
146
+
147
+ &:focus-visible {
148
+ outline: 2px solid var(--ethora-color-primary, #0052cd);
149
+ outline-offset: 1px;
150
+ }
151
+ `, ro = I.span`
152
+ color: var(--ethora-color-text-muted, #8c8c8c);
153
+ `, to = I.span`
154
+ margin-left: 10px;
155
+ display: inline-block;
156
+ color: var(--ethora-color-text-muted, #8c8c8c);
157
+ font-size: 12px;
158
+ animation: ${(c) => c.$isOpen ? Ze : eo} 0.3s ease
159
+ forwards;
160
+ `, no = I.div`
161
+ position: absolute;
162
+ top: 100%;
163
+ left: 0;
164
+ right: 0;
165
+ border: 1px solid var(--ethora-color-border, #e6e8ec);
166
+ background-color: var(--ethora-color-bg, #fff);
167
+ max-height: 200px;
168
+ overflow-y: auto;
169
+ margin-top: 4px;
170
+ border-radius: var(--ethora-radius-md, 16px);
171
+ box-shadow: var(--ethora-shadow-md, 0 4px 12px rgba(16, 24, 40, 0.1));
172
+ z-index: 100;
173
+ ${xe}
174
+ `, so = I.input`
175
+ width: 100%;
176
+ padding: 12px 16px;
177
+ border: none;
178
+ border-bottom: 1px solid var(--ethora-color-border, #e6e8ec);
179
+ outline: none;
180
+ box-sizing: border-box;
181
+ font-size: var(--ethora-font-size-sm, 14px);
182
+ background: transparent;
183
+ color: var(--ethora-color-text, #141414);
184
+
185
+ &::placeholder {
186
+ color: var(--ethora-color-text-muted, #8c8c8c);
187
+ }
188
+ `, Z = I.div`
189
+ padding: 12px 16px;
190
+ cursor: pointer;
191
+ font-size: var(--ethora-font-size-sm, 14px);
192
+ color: var(--ethora-color-text, #141414);
193
+ background-color: ${({ $selected: c }) => c ? "var(--ethora-color-primary-soft, #e7edf9)" : "transparent"};
194
+ transition: background-color var(--ethora-motion-fast, 150ms);
195
+
196
+ &:hover {
197
+ background-color: ${({ $selected: c }) => c ? "var(--ethora-color-primary-soft, #e7edf9)" : "var(--ethora-color-bg-hover, #f0f2f5)"};
198
+ }
199
+ `, io = ({
200
+ options: c,
201
+ placeholder: s,
202
+ onSelect: i,
203
+ accentColor: u,
204
+ selectedValue: e
205
+ }) => {
206
+ const l = J(), [r, t] = D(!1), [h, k] = D(
207
+ e
208
+ ), [b, w] = D(""), g = ee(null), y = () => t((a) => !a), x = (a) => {
209
+ k(a), i(a), t(!1), w("");
210
+ }, C = c.filter(
211
+ (a) => a.name.toLowerCase().includes(b.toLowerCase())
212
+ ), n = S(() => t(!1), []);
213
+ be({
214
+ enabled: r,
215
+ onClose: n,
216
+ kind: "menu",
217
+ insideRefs: [g],
218
+ closeOnOutsidePress: !0
219
+ });
220
+ const A = (a) => {
221
+ a.key === "Enter" || a.key === " " ? (a.preventDefault(), y()) : a.key === "Escape" && r && t(!1);
222
+ }, U = (a, P) => {
223
+ (a.key === "Enter" || a.key === " ") && (a.preventDefault(), x(P));
224
+ };
225
+ return /* @__PURE__ */ f(oo, { ref: g, children: [
226
+ /* @__PURE__ */ f(
227
+ ao,
228
+ {
229
+ $isOpen: r,
230
+ onClick: y,
231
+ onKeyDown: A,
232
+ $borderColor: u,
233
+ role: "button",
234
+ tabIndex: 0,
235
+ "aria-haspopup": "listbox",
236
+ "aria-expanded": r,
237
+ children: [
238
+ h ? /* @__PURE__ */ o("span", { children: h.name }) : /* @__PURE__ */ o(ro, { children: s }),
239
+ /* @__PURE__ */ o(to, { style: { color: u }, $isOpen: r, children: "▼" })
240
+ ]
241
+ }
242
+ ),
243
+ r && /* @__PURE__ */ f(no, { role: "listbox", children: [
244
+ /* @__PURE__ */ o(
245
+ so,
246
+ {
247
+ type: "text",
248
+ placeholder: l("search.placeholder"),
249
+ value: b,
250
+ onChange: (a) => w(a.target.value)
251
+ }
252
+ ),
253
+ C.length > 0 ? C.map((a) => /* @__PURE__ */ o(
254
+ Z,
255
+ {
256
+ onClick: () => x(a),
257
+ onKeyDown: (P) => U(P, a),
258
+ role: "option",
259
+ tabIndex: 0,
260
+ "aria-selected": h?.id === a.id,
261
+ $selected: h?.id === a.id,
262
+ children: a.name
263
+ },
264
+ a.id
265
+ )) : /* @__PURE__ */ o(Z, { children: l("select.noOptions") })
266
+ ] })
267
+ ] });
268
+ }, fo = ({
269
+ handleCloseModal: c
270
+ }) => {
271
+ const s = we(), { client: i } = Ce();
272
+ Se();
273
+ const { showToast: u } = De(), e = J(), { config: l, user: r, selectedUser: t, langSource: h } = q(
274
+ (d) => d.chatSettingStore
275
+ ), k = q((d) => d.call.phase), [b, w] = D(!1), g = ee(null), y = l?.videoCalls, x = y?.enabled === !0 && !!y?.livekitUrl?.trim() && (y?.allowedRoomTypes || ["private"]).includes("private"), C = x && y?.enableAudioCalls === !0, n = k !== "idle", A = S(() => {
276
+ s(Ie()), c();
277
+ }, []), U = S(() => {
278
+ Ne.performLogout();
279
+ }, []), a = H(
280
+ () => [
281
+ {
282
+ label: e("action.logOut"),
283
+ icon: /* @__PURE__ */ o(Ue, {}),
284
+ onClick: () => {
285
+ U();
286
+ },
287
+ styles: { color: "var(--ethora-color-danger, #D92D20)" }
288
+ }
289
+ ],
290
+ [U, e]
291
+ ), P = (d) => {
292
+ s(Me(d.id));
293
+ }, ne = S(() => {
294
+ w(!0);
295
+ }, []), se = async (d, p) => {
296
+ try {
297
+ const v = Te(
298
+ d,
299
+ l?.xmppSettings?.conference,
300
+ p
301
+ );
302
+ if (!v || !v.jid)
303
+ return console.error(
304
+ "handleRoomCreation: failed to normalize new private room",
305
+ d
306
+ ), u({
307
+ id: Date.now().toString(),
308
+ title: e("toast.error"),
309
+ message: e("toast.couldNotOpenPrivateChat"),
310
+ type: "error",
311
+ duration: 4e3
312
+ }), null;
313
+ if (s(
314
+ Le({
315
+ room: v,
316
+ xmpp: i
317
+ })
318
+ ), i && v.jid) {
319
+ try {
320
+ await i.presenceInRoomStanza(v.jid);
321
+ } catch (N) {
322
+ console.warn("presenceInRoomStanza failed (non-fatal):", N);
323
+ }
324
+ try {
325
+ i.getHistoryStanza(v.jid, 10);
326
+ } catch (N) {
327
+ console.warn("getHistoryStanza failed (non-fatal):", N);
328
+ }
329
+ }
330
+ return s(He({ roomJID: v.jid })), u({
331
+ id: Date.now().toString(),
332
+ title: e("toast.success"),
333
+ message: e("toast.roomCreatedSuccess"),
334
+ type: "success",
335
+ duration: 3e3
336
+ }), { jid: v.jid };
337
+ } catch (v) {
338
+ return console.error("Error handling room creation:", v), null;
339
+ }
340
+ }, z = S(async () => {
341
+ const d = String(
342
+ t?.name || `${t?.firstName || ""} ${t?.lastName || ""}`
343
+ ).trim() || "";
344
+ if (l?.newArch !== !1) {
345
+ const T = t?.xmppUsername || t?.userJID || t?.id;
346
+ if (!T)
347
+ return u({
348
+ id: Date.now().toString(),
349
+ title: e("toast.error"),
350
+ message: e("toast.couldNotResolveRecipient"),
351
+ type: "error",
352
+ duration: 4e3
353
+ }), null;
354
+ try {
355
+ const j = await ke(T), L = await se(j, 2);
356
+ return L?.jid ? {
357
+ jid: L.jid,
358
+ bareName: L.jid.split("@")[0],
359
+ peerXmppUsername: String(T).split("@")[0],
360
+ peerDisplay: d
361
+ } : null;
362
+ } catch (j) {
363
+ return console.error("postPrivateRoom failed:", j), u({
364
+ id: Date.now().toString(),
365
+ title: e("toast.error"),
366
+ message: j?.message || e("toast.failedToCreatePrivateChat"),
367
+ type: "error",
368
+ duration: 4e3
369
+ }), null;
370
+ }
371
+ }
372
+ const p = _(t.id), E = [_(r.defaultWallet.walletAddress), p].sort().join(".").toLowerCase(), G = [r.firstName, t.name?.split(" ")?.[0]].sort().join(" and "), R = await i.createPrivateRoomStanza(
373
+ G,
374
+ `Private chat ${G}`,
375
+ E
376
+ );
377
+ return R && (await i.inviteRoomRequestStanza(p, R), await i.getRoomsStanza()), R ? {
378
+ jid: R,
379
+ bareName: String(R).split("@")[0],
380
+ peerXmppUsername: p,
381
+ peerDisplay: d
382
+ } : null;
383
+ }, [t, l?.newArch, i, r]), K = S(async () => {
384
+ u({
385
+ id: Date.now().toString(),
386
+ title: e("toast.roomCreationTitle"),
387
+ message: e("toast.roomCreating"),
388
+ type: "info",
389
+ duration: 3e3
390
+ }), await z(), s(Q());
391
+ }, [z, s, u, e]), O = S(
392
+ async (d) => {
393
+ const p = await z();
394
+ if (!p) return;
395
+ const v = p.peerDisplay || p.bareName;
396
+ s(
397
+ Ae({
398
+ roomJid: p.jid,
399
+ roomName: v,
400
+ roomBareName: p.bareName,
401
+ kind: d,
402
+ peerXmppUsername: p.peerXmppUsername || null
403
+ })
404
+ ), p.peerXmppUsername && Pe(d, {
405
+ peerXmppUsername: p.peerXmppUsername,
406
+ roomBareName: p.bareName
407
+ }), s(Q());
408
+ try {
409
+ await Re(p.bareName, { kind: d });
410
+ } catch (N) {
411
+ const E = N instanceof Error ? N.message : e("toast.failedToCreateCall");
412
+ s(ze(E));
413
+ }
414
+ },
415
+ [z, s, e]
416
+ ), m = t ?? r, ie = () => {
417
+ if (h)
418
+ return Y.find((d) => d.id === h);
419
+ }, le = t ? void 0 : /* @__PURE__ */ f(B, { children: [
420
+ /* @__PURE__ */ o(X, { onClick: ne, "aria-label": e("action.editProfile"), children: /* @__PURE__ */ o(je, { color: "var(--ethora-color-text-muted, #8C8C8C)" }) }),
421
+ /* @__PURE__ */ o(
422
+ Fe,
423
+ {
424
+ options: a,
425
+ position: "left",
426
+ menuIcon: /* @__PURE__ */ o(Be, {})
427
+ }
428
+ )
429
+ ] }), ce = /* @__PURE__ */ f(B, { children: [
430
+ /* @__PURE__ */ o(
431
+ X,
432
+ {
433
+ variant: "ghost",
434
+ onClick: () => w(!1),
435
+ style: { width: "auto", padding: "0 var(--ethora-space-3, 12px)" },
436
+ children: e("action.cancel")
437
+ }
438
+ ),
439
+ /* @__PURE__ */ o(
440
+ X,
441
+ {
442
+ variant: "filled",
443
+ onClick: () => {
444
+ g.current?.save();
445
+ },
446
+ style: { width: "auto", padding: "0 var(--ethora-space-4, 16px)" },
447
+ children: e("action.save")
448
+ }
449
+ )
450
+ ] }), V = t && t.xmppUsername !== r.xmppUsername && !l?.disableProfilesInteractions, de = H(
451
+ () => /* @__PURE__ */ f(B, { children: [
452
+ /* @__PURE__ */ f(re, { children: [
453
+ /* @__PURE__ */ o(
454
+ oe,
455
+ {
456
+ icon: m?.profileImage ?? null,
457
+ name: m?.name ?? m?.firstName,
458
+ size: 96
459
+ }
460
+ ),
461
+ /* @__PURE__ */ o(Ve, { children: m?.name ? `${m?.name}` : `${m?.firstName} ${m?.lastName}` })
462
+ ] }),
463
+ /* @__PURE__ */ f($, { children: [
464
+ /* @__PURE__ */ o(W, { children: e("modal.profile.about") }),
465
+ /* @__PURE__ */ o(
466
+ Ge,
467
+ {
468
+ $empty: !(m?.description && m?.description?.length > 4),
469
+ children: m?.description && m?.description?.length > 4 ? m.description : e("modal.profile.noDescription")
470
+ }
471
+ )
472
+ ] }),
473
+ !t && l?.translates?.enabled && /* @__PURE__ */ f($, { children: [
474
+ /* @__PURE__ */ o(W, { children: e("modal.profile.preferences") }),
475
+ /* @__PURE__ */ o(Xe, { children: /* @__PURE__ */ f(We, { children: [
476
+ /* @__PURE__ */ o(Je, { children: e("modal.profile.languageHint") }),
477
+ /* @__PURE__ */ o(
478
+ io,
479
+ {
480
+ options: Y,
481
+ placeholder: e("language.select"),
482
+ onSelect: P,
483
+ accentColor: l?.colors?.primary,
484
+ selectedValue: ie()
485
+ }
486
+ )
487
+ ] }) })
488
+ ] }),
489
+ V && /* @__PURE__ */ f($, { children: [
490
+ /* @__PURE__ */ o(W, { children: e("modal.profile.actions") }),
491
+ /* @__PURE__ */ f(qe, { children: [
492
+ /* @__PURE__ */ o(
493
+ F,
494
+ {
495
+ StartIcon: /* @__PURE__ */ o($e, {}),
496
+ onClick: K,
497
+ variant: "filled",
498
+ children: e("action.message")
499
+ }
500
+ ),
501
+ x && /* @__PURE__ */ o(
502
+ F,
503
+ {
504
+ StartIcon: /* @__PURE__ */ o(Oe, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
505
+ onClick: () => {
506
+ O("video");
507
+ },
508
+ disabled: n,
509
+ variant: "filled",
510
+ children: e(C ? "action.videoCall" : "action.call")
511
+ }
512
+ ),
513
+ C && /* @__PURE__ */ o(
514
+ F,
515
+ {
516
+ StartIcon: /* @__PURE__ */ o(Ee, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
517
+ onClick: () => {
518
+ O("audio");
519
+ },
520
+ disabled: n,
521
+ variant: "filled",
522
+ children: e("action.audioCall")
523
+ }
524
+ ),
525
+ /* @__PURE__ */ o(
526
+ F,
527
+ {
528
+ onClick: () => _e(t.id),
529
+ variant: "outlined",
530
+ children: e("action.copyUserId")
531
+ }
532
+ )
533
+ ] })
534
+ ] })
535
+ ] }),
536
+ [
537
+ m,
538
+ x,
539
+ C,
540
+ n,
541
+ O,
542
+ K,
543
+ t,
544
+ V,
545
+ r,
546
+ l,
547
+ h,
548
+ e
549
+ ]
550
+ ), pe = H(
551
+ () => /* @__PURE__ */ o(
552
+ te,
553
+ {
554
+ ref: g,
555
+ setIsEditing: w,
556
+ modalUser: m,
557
+ config: l
558
+ }
559
+ ),
560
+ [m]
561
+ );
562
+ return /* @__PURE__ */ o(
563
+ Ke,
564
+ {
565
+ title: e("modal.profile.title"),
566
+ onClose: A,
567
+ headerActions: b ? ce : le,
568
+ children: b ? pe : de
569
+ }
570
+ );
571
+ };
572
+ export {
573
+ fo as default
574
+ };
@@ -0,0 +1,50 @@
1
+ import { jsx as i, jsxs as n } from "react/jsx-runtime";
2
+ import m, { useCallback as D, useMemo as h } from "react";
3
+ import { n as g, a as p, o as w, M as r } from "./main-C2FKeV6y.js";
4
+ import { S as b, D as u, a as k, b as y, c as S, d as f } from "./SideDrawer-DewJ-iPn.js";
5
+ const T = ({
6
+ handleCloseModal: l
7
+ }) => {
8
+ const t = g(), s = p(), o = D(
9
+ (e) => {
10
+ s(w(e));
11
+ },
12
+ [s]
13
+ ), c = h(
14
+ () => [
15
+ {
16
+ title: t("settings.section.privacy"),
17
+ rows: [
18
+ {
19
+ key: r.MANAGE_DATA,
20
+ label: t("settings.manageData.title"),
21
+ hint: t("settings.manageData.rowHint")
22
+ },
23
+ {
24
+ key: r.VISIBILITY,
25
+ label: t("settings.visibility.title"),
26
+ hint: t("settings.visibility.rowHint")
27
+ }
28
+ ]
29
+ }
30
+ ],
31
+ [t]
32
+ );
33
+ return /* @__PURE__ */ i(b, { title: t("settings.menu.title"), onClose: l, children: c.map((e) => /* @__PURE__ */ n(u, { children: [
34
+ /* @__PURE__ */ i(k, { children: e.title }),
35
+ /* @__PURE__ */ i(y, { children: e.rows.map((a, d) => /* @__PURE__ */ n(m.Fragment, { children: [
36
+ d > 0 && /* @__PURE__ */ i(S, {}),
37
+ /* @__PURE__ */ i(
38
+ f,
39
+ {
40
+ label: a.label,
41
+ hint: a.hint,
42
+ onClick: () => o(a.key)
43
+ }
44
+ )
45
+ ] }, a.key)) })
46
+ ] }, e.title)) });
47
+ };
48
+ export {
49
+ T as default
50
+ };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as z, jsx as M, Fragment as xi } from "react/jsx-runtime";
2
2
  import * as F from "react";
3
3
  import { useState as zt, useRef as be, useEffect as ge, useMemo as ln, useCallback as mi } from "react";
4
- import { u as Qi, P as Kn, H as Oi, a as Hd, b as zd, s as po, c as Kd, d as Gd, e as fo, f as Jd, g as Yd, h as $d, i as Xd, r as mo, j as Qd, k as Zd, A as go, V as vo, B as eu, l as bo } from "./main-DeiuFYsl.js";
4
+ import { u as Qi, P as Kn, H as Oi, a as Hd, b as zd, s as po, c as Kd, d as Gd, e as fo, f as Jd, g as Yd, h as mo, i as $d, j as Xd, r as go, k as Qd, l as Zd, A as vo, V as bo, B as eu } from "./main-C2FKeV6y.js";
5
5
  function tu(n, e) {
6
6
  return e.forEach(function(t) {
7
7
  t && typeof t != "string" && !Array.isArray(t) && Object.keys(t).forEach(function(i) {
@@ -22367,7 +22367,7 @@ const Nd = (n) => {
22367
22367
  position: "relative",
22368
22368
  width: "100%",
22369
22369
  height: "100%",
22370
- // Video stage stays dark — that's the convention for video tiles
22370
+ // Video stage stays dark - that's the convention for video tiles
22371
22371
  // (high contrast for skin tones), but the rest of the chrome
22372
22372
  // (top bar, controls tray) uses the chat's light tokens.
22373
22373
  background: "#0B1220"
@@ -23359,7 +23359,7 @@ const Nd = (n) => {
23359
23359
  fontSize: 14
23360
23360
  },
23361
23361
  children: [
23362
- i === "audio" ? /* @__PURE__ */ M(go, { color: pi }) : /* @__PURE__ */ M(vo, { color: pi }),
23362
+ i === "audio" ? /* @__PURE__ */ M(vo, { color: pi }) : /* @__PURE__ */ M(bo, { color: pi }),
23363
23363
  /* @__PURE__ */ M("span", { children: e })
23364
23364
  ]
23365
23365
  }
@@ -23414,7 +23414,7 @@ const Nd = (n) => {
23414
23414
  "aria-label": "Accept call",
23415
23415
  title: "Accept",
23416
23416
  style: Wr("#10B981"),
23417
- children: a?.accept ?? (i === "audio" ? /* @__PURE__ */ M(go, { color: "#FFFFFF" }) : /* @__PURE__ */ M(vo, { color: "#FFFFFF" }))
23417
+ children: a?.accept ?? (i === "audio" ? /* @__PURE__ */ M(vo, { color: "#FFFFFF" }) : /* @__PURE__ */ M(bo, { color: "#FFFFFF" }))
23418
23418
  }
23419
23419
  )
23420
23420
  ] }),
@@ -23449,7 +23449,7 @@ const Nd = (n) => {
23449
23449
  if (e.phase !== "requesting" || e.direction !== "outgoing")
23450
23450
  return;
23451
23451
  const P = window.setTimeout(() => {
23452
- n(po("No answer — call timed out"));
23452
+ n(po("No answer - call timed out"));
23453
23453
  }, Sv);
23454
23454
  return () => window.clearTimeout(P);
23455
23455
  }, [e.phase, e.direction, e.startedAt, n]);
@@ -23509,13 +23509,13 @@ const Nd = (n) => {
23509
23509
  })
23510
23510
  );
23511
23511
  }
23512
- bo(P), n($d());
23512
+ mo(P), n($d());
23513
23513
  },
23514
23514
  [n]
23515
23515
  ), y = mi(() => {
23516
- bo("declined"), n(Xd());
23516
+ mo("declined"), n(Xd());
23517
23517
  }, [n]), m = mi(() => {
23518
- e.direction === "incoming" && e.phase === "ringing-incoming" ? y() : e.phase === "error" ? n(mo()) : p(e.phase === "requesting" ? "cancelled" : "ended");
23518
+ e.direction === "incoming" && e.phase === "ringing-incoming" ? y() : e.phase === "error" ? n(go()) : p(e.phase === "requesting" ? "cancelled" : "ended");
23519
23519
  }, [e.direction, e.phase, y, p, n]), [S, k] = zt(!1), C = Nd(), x = be(null), f = be(null), g = !!e.token && (e.phase === "connecting" || e.phase === "in-call") && !!o, b = S && g;
23520
23520
  if (ge(() => {
23521
23521
  e.phase === "idle" && k(!1);
@@ -23622,7 +23622,7 @@ const Nd = (n) => {
23622
23622
  variant: "error",
23623
23623
  primaryColor: a,
23624
23624
  errorMessage: e.error || (o ? null : "Video calls unavailable: missing livekitUrl in config.videoCalls"),
23625
- onDismiss: () => n(mo())
23625
+ onDismiss: () => n(go())
23626
23626
  }
23627
23627
  ) : /* @__PURE__ */ M(
23628
23628
  Hr,
@@ -23644,4 +23644,3 @@ const Nd = (n) => {
23644
23644
  export {
23645
23645
  Mv as VideoCallOverlay
23646
23646
  };
23647
- //# sourceMappingURL=VideoCallOverlay-C4M2I9oV.js.map