@ethora/chat-component 26.8.1 → 26.9.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.
Files changed (48) hide show
  1. package/README.md +1 -0
  2. package/dist/{ChatProfileModal-DZVi2WRb.js → ChatProfileModal-DfXEnzJf.js} +6 -3
  3. package/dist/{FilePreviewModal-BelSYN5e.js → FilePreviewModal-Cs1tij9R.js} +35 -35
  4. package/dist/{ManageDataModal-Bs_0SHBL.js → ManageDataModal-BBOui09n.js} +3 -3
  5. package/dist/{MarkdownBody-BYUK4GVM.js → MarkdownBody-DttRXyAK.js} +3 -3
  6. package/dist/{SideDrawer-C_nWZRwH.js → SideDrawer-DLqEOqAi.js} +35 -35
  7. package/dist/UserProfileModal-DEtLQxkJ.js +594 -0
  8. package/dist/{UserSettingsModal-J7uJfki1.js → UserSettingsModal-Ddht5fc0.js} +9 -9
  9. package/dist/{VideoCallOverlay-BXHNEhdX.js → VideoCallOverlay-BJMarThf.js} +2673 -2662
  10. package/dist/VisibilityModal-CckTnGKB.js +138 -0
  11. package/dist/assets/icons.d.ts +8 -0
  12. package/dist/components/MainComponents/AttachmentList.d.ts +5 -0
  13. package/dist/components/MainComponents/SealedAttachmentList.d.ts +14 -0
  14. package/dist/components/RoomComponents/styled/LastMessageSealed.d.ts +14 -0
  15. package/dist/components/styled/AudioMessage.d.ts +38 -0
  16. package/dist/components/styled/MessageImage.d.ts +10 -0
  17. package/dist/e2ee/crypto.d.ts +32 -0
  18. package/dist/e2ee/fileEnvelope.d.ts +48 -0
  19. package/dist/e2ee/index.d.ts +53 -0
  20. package/dist/e2ee/omemo.d.ts +130 -0
  21. package/dist/e2ee/protobuf.d.ts +25 -0
  22. package/dist/e2ee/ratchet.d.ts +54 -0
  23. package/dist/e2ee/stanza.d.ts +24 -0
  24. package/dist/e2ee/store.d.ts +12 -0
  25. package/dist/{handleCopyClick-Bj2V_brV.js → handleCopyClick-CWw4UAlT.js} +2 -2
  26. package/dist/helpers/findMessagesForFile.d.ts +25 -0
  27. package/dist/helpers/sealedAttachments.d.ts +25 -0
  28. package/dist/helpers/xmppIdShape.d.ts +9 -0
  29. package/dist/helpers/xmppUsername.d.ts +1 -1
  30. package/dist/hooks/useChatWrapperInit.d.ts +5 -1
  31. package/dist/{main-DmtEeYji.js → main-BHtKhpBZ.js} +21004 -16820
  32. package/dist/main.d.ts +2 -0
  33. package/dist/main.js +23 -20
  34. package/dist/networking/api-requests/auth.api.d.ts +10 -1
  35. package/dist/networking/api-requests/rooms.api.d.ts +1 -1
  36. package/dist/networking/authRefresh.d.ts +6 -0
  37. package/dist/networking/xmpp/sendMediaMessage.xmpp.d.ts +12 -1
  38. package/dist/networking/xmpp/sendTextMessage.xmpp.d.ts +1 -1
  39. package/dist/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts +1 -1
  40. package/dist/networking/xmppClient.d.ts +39 -0
  41. package/dist/roomStore/storage.d.ts +2 -1
  42. package/dist/styles/tokens.d.ts +14 -4
  43. package/dist/types/models/config.model.d.ts +33 -0
  44. package/dist/types/models/message.model.d.ts +27 -0
  45. package/dist/types/models/room.model.d.ts +10 -0
  46. package/package.json +4 -1
  47. package/dist/UserProfileModal-CD2IB5SD.js +0 -574
  48. package/dist/VisibilityModal-4QJnWpAL.js +0 -132
package/README.md CHANGED
@@ -360,6 +360,7 @@ Below is a grouped reference for all `config` options.
360
360
  | `headerChatMenu` | `() => void` | Same for the chat header's room menu (the "more" button carrying Report and Leave). When set, that dropdown is not rendered and the button calls your handler. |
361
361
  | `colors` | `{ primary; secondary; icons?; ownMessageBackground?; otherMessageBackground?; inputBackground? }` | Theme colours. `primary` drives icon colours and the sender name. `icons` themes every accent icon/icon-button (attach, mic, active send, new-chat, header, empty-state) — defaults to `primary`, so set a *distinct* value to decouple. `ownMessageBackground`/`otherMessageBackground`/`inputBackground` recolour the message bubbles and input bar. |
362
362
  | `backgroundChat` | `{ color?; image? }` | Background colour and/or image for the messages area. (`image` as a string URL; pass an object URL for a `File`.) |
363
+ | `colorScheme` | `'light' \| 'dark' \| 'system'` | Light or dark UI. Default `'light'` (the chat as before). `'system'` follows the viewer's OS / browser setting and updates live. Scoped to the chat's own elements, so it never restyles the host page; a host with its own dark mode should pass its resolved choice. `colors.icons`, `colors.iconsBg`, the bubble/input colours and `backgroundChat` are used as given in both schemes. `colors.primary` is the one exception: in dark it is lightened slightly (about 20% toward white) so primary-coloured text and icons stay legible on the dark surface while buttons keep white text on them, and `--ethora-color-primary-text` carries a further-lifted variant for text-only uses such as links and sender names. Pass an already-dark-suitable `primary` if you need the exact brand value. |
363
364
  | `typography` | `TypographyConfig` | Font family + size for the chat UI: `fontFamily` (or just `googleFontsFamily`) is applied across all chat text incl. messages and sender names; `fontSize` (px) scales message text, sender names, timestamps, inputs, room names and badges. Plus loaders (`googleFontsUrl`/`fontFaces`) and weight tokens. |
364
365
  | `fallbackScreens` | `{ noUser?; noConnection?; noRoom?; error? }` | Replace the built-in screens (Ethora login form, "Connecting...", empty room state, crash screen) with your own text or React nodes. A plain string is rendered as centered text. `error` also accepts a function `({ error, componentStack, scope, reset }) => ReactNode`, see [Error handling](#error-handling-and-crash-containment). |
365
366
  | `hiddenRooms` | `{ titles?: string[]; jids?: string[] }` | Hide specific rooms from the room list and unread counters (e.g. `{ titles: ['Main chat'] }` to suppress the auto-created default room). |
@@ -1,8 +1,8 @@
1
1
  import { jsx as E, jsxs as j, Fragment as gt } from "react/jsx-runtime";
2
2
  import ke, { useRef as yt, useState as ee, useMemo as se } from "react";
3
- import { S as bt, f as qt, b as Tt, D as he, a as pe, e as Ft, g as zt, h as Fe, i as Qt, j as Ht, k as Yt, l as ze } from "./SideDrawer-C_nWZRwH.js";
4
- import { h as Wt, P as Gt, a as Kt, c as Xt, D as Jt, d as Vt, e as Qe, f as He } from "./handleCopyClick-Bj2V_brV.js";
5
- import { m as Zt, b as Et, n as de, a1 as er, B as te, v as W, a as Ne, u as fe, a2 as $e, D as Ct, w as wt, a3 as Rt, a4 as Pt, a5 as xt, a6 as tr, a7 as Be, a8 as rr, a9 as nr, $ as or, F as _t, X as ar, aa as ir, ab as Ie, ac as sr, ad as ye, ae as St, P as Mt, T as At, t as lr, af as ur, ag as cr, ah as fr, ai as dr, aj as hr, o as Ye, ak as pr, al as vr, am as mr, an as gr, ao as yr, ap as We, aq as br, ar as Tr, U as Er, as as Cr, at as wr, M as Rr, G as Pr, au as Ge } from "./main-DmtEeYji.js";
3
+ import { S as bt, f as qt, b as Tt, D as he, a as pe, e as Ft, g as zt, h as Fe, i as Qt, j as Ht, k as Yt, l as ze } from "./SideDrawer-DLqEOqAi.js";
4
+ import { h as Wt, P as Gt, a as Kt, c as Xt, D as Jt, d as Vt, e as Qe, f as He } from "./handleCopyClick-CWw4UAlT.js";
5
+ import { o as Zt, b as Et, p as de, a4 as er, B as te, x as W, a as Ne, u as fe, a5 as $e, F as Ct, y as wt, a6 as Rt, a7 as Pt, a8 as xt, a9 as tr, aa as Be, ab as rr, ac as nr, a2 as or, J as _t, Z as ar, ad as ir, ae as Ie, af as sr, ag as ye, ah as St, P as Mt, W as At, w as lr, ai as ur, aj as cr, ak as fr, al as dr, am as hr, q as Ye, an as pr, ao as vr, ap as mr, aq as gr, ar as yr, as as We, at as br, au as Tr, X as Er, av as Cr, aw as wr, M as Rr, K as Pr, ax as Ge } from "./main-BHtKhpBZ.js";
6
6
  var le = {}, ve = { exports: {} }, me = { exports: {} }, k = {};
7
7
  var Ke;
8
8
  function xr() {
@@ -1736,6 +1736,9 @@ const Ur = /* @__PURE__ */ Zt(jr), qr = "chatId", Fr = (n, h, a) => {
1736
1736
  font-size: var(--ethora-font-size-xs, 12px);
1737
1737
  font-weight: var(--ethora-font-weight-medium, 500);
1738
1738
  text-transform: capitalize;
1739
+ [data-ethora-color-scheme='dark'] & {
1740
+ ${({ $banned: n }) => n ? "background-color: rgba(242, 118, 107, 0.15);" : ""}
1741
+ }
1739
1742
  `, on = ({
1740
1743
  member: n,
1741
1744
  disableClick: h,
@@ -1,6 +1,6 @@
1
1
  import { jsx as l, jsxs as B } from "react/jsx-runtime";
2
2
  import te, { useState as H, useRef as z, useEffect as O, useMemo as $, useCallback as k } from "react";
3
- import { n as le, b as pe, aK as we, ab as ve, v as X, B as V, aL as xe, aM as be, av as ye, aN as Ee, aO as Le, aP as ue, aQ as ne, a as Ce, aG as Me, u as q, a2 as Re, aR as re, ap as Pe, al as J, aS as ke, aT as Se, aU as Te, aV as Ae, aW as Ie, aX as Xe, aY as Ye, aZ as ze, a_ as Oe, aw as De, a$ as Fe, b0 as Ne, au as Be, b1 as He, t as Ue } from "./main-DmtEeYji.js";
3
+ import { p as le, b as pe, aN as we, ae as ve, x as X, B as V, aO as xe, aP as be, ay as ye, aQ as Ee, aR as Le, aS as ue, aT as ne, a as Ce, aJ as Re, u as q, a5 as Me, aU as re, as as Pe, ao as J, aV as ke, aW as Se, aX as Te, aY as Ae, aZ as Ie, a_ as Xe, a$ as Ye, b0 as ze, b1 as Oe, az as De, b2 as Fe, b3 as Ne, ax as Be, b4 as He, w as Ue } from "./main-BHtKhpBZ.js";
4
4
  function oe(t, i) {
5
5
  let o;
6
6
  return (...E) => {
@@ -11,18 +11,18 @@ function _e({ debounce: t, scroll: i, polyfill: o, offsetSize: E } = { debounce:
11
11
  const L = o || (typeof window > "u" ? class {
12
12
  } : window.ResizeObserver);
13
13
  if (!L) throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
14
- const [u, C] = H({ left: 0, top: 0, width: 0, height: 0, bottom: 0, right: 0, x: 0, y: 0 }), n = z({ element: null, scrollContainers: null, resizeObserver: null, lastBounds: u, orientationHandler: null }), M = t ? typeof t == "number" ? t : t.scroll : null, p = t ? typeof t == "number" ? t : t.resize : null, T = z(!1);
14
+ const [u, C] = H({ left: 0, top: 0, width: 0, height: 0, bottom: 0, right: 0, x: 0, y: 0 }), n = z({ element: null, scrollContainers: null, resizeObserver: null, lastBounds: u, orientationHandler: null }), R = t ? typeof t == "number" ? t : t.scroll : null, p = t ? typeof t == "number" ? t : t.resize : null, T = z(!1);
15
15
  O(() => (T.current = !0, () => {
16
16
  T.current = !1;
17
17
  }));
18
18
  const [b, x, m] = $(() => {
19
19
  const r = () => {
20
20
  if (!n.current.element) return;
21
- const { left: g, top: w, width: v, height: N, bottom: S, right: R, x: f, y: h } = n.current.element.getBoundingClientRect(), A = { left: g, top: w, width: v, height: N, bottom: S, right: R, x: f, y: h };
21
+ const { left: g, top: w, width: v, height: N, bottom: S, right: M, x: f, y: h } = n.current.element.getBoundingClientRect(), A = { left: g, top: w, width: v, height: N, bottom: S, right: M, x: f, y: h };
22
22
  n.current.element instanceof HTMLElement && E && (A.height = n.current.element.offsetHeight, A.width = n.current.element.offsetWidth), Object.freeze(A), T.current && !We(n.current.lastBounds, A) && C(n.current.lastBounds = A);
23
23
  };
24
- return [r, p ? oe(r, p) : r, M ? oe(r, M) : r];
25
- }, [C, E, M, p]);
24
+ return [r, p ? oe(r, p) : r, R ? oe(r, R) : r];
25
+ }, [C, E, R, p]);
26
26
  function y() {
27
27
  n.current.scrollContainers && (n.current.scrollContainers.forEach((r) => r.removeEventListener("scroll", m, !0)), n.current.scrollContainers = null), n.current.resizeObserver && (n.current.resizeObserver.disconnect(), n.current.resizeObserver = null), n.current.orientationHandler && ("orientation" in screen && "removeEventListener" in screen.orientation ? screen.orientation.removeEventListener("change", n.current.orientationHandler) : "onorientationchange" in window && window.removeEventListener("orientationchange", n.current.orientationHandler));
28
28
  }
@@ -107,10 +107,10 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
107
107
  text-align: center;
108
108
 
109
109
  a {
110
- color: var(--ethora-color-primary, #0052cd);
110
+ color: var(--ethora-color-primary-text, var(--ethora-color-primary, #0052cd));
111
111
  }
112
112
  `, Qe = ({ pdfUrl: t }) => {
113
- const i = le(), { config: o } = pe(), [E, L] = _e(), u = z(null), C = z(null), n = z(null), [M, p] = H("loading"), [T, b] = H(0), [x, m] = H(1), y = Math.max(320, Math.floor(L.width || 0));
113
+ const i = le(), { config: o } = pe(), [E, L] = _e(), u = z(null), C = z(null), n = z(null), [R, p] = H("loading"), [T, b] = H(0), [x, m] = H(1), y = Math.max(320, Math.floor(L.width || 0));
114
114
  O(() => {
115
115
  let r = !1, g;
116
116
  return p("loading"), m(1), b(0), (async () => {
@@ -140,21 +140,21 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
140
140
  };
141
141
  }, [t, o?.pdfPreview?.workerSrc]), O(() => {
142
142
  const r = C.current, g = u.current;
143
- if (M !== "ready" || !r || !g || y <= 0) return;
143
+ if (R !== "ready" || !r || !g || y <= 0) return;
144
144
  let w = !1;
145
145
  return (async () => {
146
146
  try {
147
147
  const v = await r.getPage(x);
148
148
  if (w) return;
149
- const N = v.getViewport({ scale: 1 }), S = N.width ? y / N.width : 1, R = v.getViewport({ scale: S });
150
- g.width = Math.max(1, Math.floor(R.width)), g.height = Math.max(1, Math.floor(R.height));
149
+ const N = v.getViewport({ scale: 1 }), S = N.width ? y / N.width : 1, M = v.getViewport({ scale: S });
150
+ g.width = Math.max(1, Math.floor(M.width)), g.height = Math.max(1, Math.floor(M.height));
151
151
  const f = g.getContext("2d");
152
152
  if (!f) {
153
153
  p("error");
154
154
  return;
155
155
  }
156
156
  n.current?.cancel();
157
- const h = v.render({ canvasContext: f, viewport: R });
157
+ const h = v.render({ canvasContext: f, viewport: M });
158
158
  n.current = h, await h.promise, v.cleanup();
159
159
  } catch (v) {
160
160
  w || console.warn("[Ethora] PDF page render failed:", v);
@@ -162,7 +162,7 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
162
162
  })(), () => {
163
163
  w = !0, n.current?.cancel(), n.current = null;
164
164
  };
165
- }, [M, x, y]);
165
+ }, [R, x, y]);
166
166
  const Y = k(
167
167
  () => m((r) => Math.max(1, r - 1)),
168
168
  []
@@ -170,11 +170,11 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
170
170
  () => m((r) => Math.min(T || 1, r + 1)),
171
171
  [T]
172
172
  );
173
- return M === "error" ? /* @__PURE__ */ l(ie, { children: /* @__PURE__ */ B(Ge, { children: [
173
+ return R === "error" ? /* @__PURE__ */ l(ie, { children: /* @__PURE__ */ B(Ge, { children: [
174
174
  /* @__PURE__ */ l("span", { children: i("modal.filePreview.pdfUnavailable") }),
175
175
  /* @__PURE__ */ l("a", { href: t, target: "_blank", rel: "noopener noreferrer", children: i("modal.filePreview.openExternally") })
176
176
  ] }) }) : /* @__PURE__ */ B(ie, { children: [
177
- /* @__PURE__ */ l(Ze, { ref: E, children: M === "loading" ? /* @__PURE__ */ l(ve, { color: o?.colors?.primary }) : /* @__PURE__ */ l("canvas", { ref: u }) }),
177
+ /* @__PURE__ */ l(Ze, { ref: E, children: R === "loading" ? /* @__PURE__ */ l(ve, { color: o?.colors?.primary }) : /* @__PURE__ */ l("canvas", { ref: u }) }),
178
178
  T > 1 && /* @__PURE__ */ B(Ke, { children: [
179
179
  /* @__PURE__ */ l(
180
180
  ae,
@@ -235,12 +235,12 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
235
235
  ${ye}
236
236
  `, fe = te.forwardRef(
237
237
  ({ src: t, alt: i, onSwipeLeft: o, onSwipeRight: E, onError: L, onScaleChange: u }, C) => {
238
- const n = z(null), M = z(null), [p, T] = H(I), [b, x] = H({ x: 0, y: 0 }), [m, y] = H(!1), [Y, F] = H(!1), r = z({ scale: I, offset: { x: 0, y: 0 } });
238
+ const n = z(null), R = z(null), [p, T] = H(I), [b, x] = H({ x: 0, y: 0 }), [m, y] = H(!1), [Y, F] = H(!1), r = z({ scale: I, offset: { x: 0, y: 0 } });
239
239
  r.current = { scale: p, offset: b };
240
240
  const g = z(null), w = z(null), v = z(
241
241
  null
242
242
  ), N = k((a) => {
243
- const e = n.current, c = M.current;
243
+ const e = n.current, c = R.current;
244
244
  if (!e) return { x: 0, y: 0 };
245
245
  const s = e.clientWidth, d = e.clientHeight, P = c?.naturalWidth || 0, D = c?.naturalHeight || 0;
246
246
  let j = s, Z = d;
@@ -261,7 +261,7 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
261
261
  });
262
262
  },
263
263
  [N]
264
- ), R = k(
264
+ ), M = k(
265
265
  (a, e, c, s) => {
266
266
  const d = r.current, P = G(a, I, ee), D = P / d.scale;
267
267
  S(
@@ -278,9 +278,9 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
278
278
  S(I, { x: 0, y: 0 }, !0);
279
279
  }, [S]), h = k(
280
280
  (a) => {
281
- R(r.current.scale * a, 0, 0, !0);
281
+ M(r.current.scale * a, 0, 0, !0);
282
282
  },
283
- [R]
283
+ [M]
284
284
  );
285
285
  te.useImperativeHandle(
286
286
  C,
@@ -300,10 +300,10 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
300
300
  const e = (c) => {
301
301
  c.preventDefault();
302
302
  const s = a.getBoundingClientRect(), d = c.clientX - s.left - s.width / 2, P = c.clientY - s.top - s.height / 2, D = Math.exp(-c.deltaY * tt);
303
- R(r.current.scale * D, d, P, !1);
303
+ M(r.current.scale * D, d, P, !1);
304
304
  };
305
305
  return a.addEventListener("wheel", e, { passive: !1 }), () => a.removeEventListener("wheel", e);
306
- }, [R]);
306
+ }, [M]);
307
307
  const A = k(
308
308
  (a, e) => {
309
309
  const c = n.current;
@@ -313,14 +313,14 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
313
313
  return;
314
314
  }
315
315
  const s = c.getBoundingClientRect();
316
- R(
316
+ M(
317
317
  qe,
318
318
  a - s.left - s.width / 2,
319
319
  e - s.top - s.height / 2,
320
320
  !0
321
321
  );
322
322
  },
323
- [f, R]
323
+ [f, M]
324
324
  ), _ = k((a) => {
325
325
  a.button === 0 && (r.current.scale <= I || (a.preventDefault(), g.current = { x: a.clientX, y: a.clientY }, F(!0)));
326
326
  }, []);
@@ -385,7 +385,7 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
385
385
  ), D = n.current;
386
386
  if (!D || P <= 0) return;
387
387
  const j = D.getBoundingClientRect(), Z = (s.clientX + d.clientX) / 2 - j.left - j.width / 2, K = (s.clientY + d.clientY) / 2 - j.top - j.height / 2;
388
- e.moved = !0, R(
388
+ e.moved = !0, M(
389
389
  e.pinchScale * P / e.pinchDistance,
390
390
  Z,
391
391
  K,
@@ -409,7 +409,7 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
409
409
  e.lastX = c.clientX, e.lastY = c.clientY;
410
410
  }
411
411
  },
412
- [S, R]
412
+ [S, M]
413
413
  ), U = k(
414
414
  (a) => {
415
415
  const e = w.current;
@@ -455,7 +455,7 @@ const Ve = ["x", "y", "top", "bottom", "left", "right", "width", "height"], We =
455
455
  children: /* @__PURE__ */ l(
456
456
  rt,
457
457
  {
458
- ref: M,
458
+ ref: R,
459
459
  "data-testid": "image-lightbox-image",
460
460
  src: t,
461
461
  alt: i,
@@ -536,7 +536,7 @@ const ot = (t) => {
536
536
  `, gt = ({
537
537
  handleCloseModal: t
538
538
  }) => {
539
- const i = Ce(), o = le(), E = Me(), { activeFile: L } = q(
539
+ const i = Ce(), o = le(), E = Re(), { activeFile: L } = q(
540
540
  (f) => f.chatSettingStore
541
541
  ), u = $(
542
542
  () => L ?? { fileName: "", fileURL: "", mimetype: "" },
@@ -544,8 +544,8 @@ const ot = (t) => {
544
544
  ), C = q(
545
545
  (f) => f.chatSettingStore.user?.fileToken || ""
546
546
  ), n = q(
547
- (f) => Re(f)?.messages
548
- ), M = z(null), [p, T] = H(I), b = ue(u?.mimetype, u?.fileName), x = $(() => ot(n), [n]), m = $(
547
+ (f) => Me(f)?.messages
548
+ ), R = z(null), [p, T] = H(I), b = ue(u?.mimetype, u?.fileName), x = $(() => ot(n), [n]), m = $(
549
549
  () => b === "image" ? it(x, u) : -1,
550
550
  [x, u, b]
551
551
  ), y = m >= 0 && x.length > 1, Y = y && m > 0, F = y && m < x.length - 1, r = k(
@@ -591,13 +591,13 @@ const ot = (t) => {
591
591
  });
592
592
  }, N = () => {
593
593
  i(re(void 0)), t?.();
594
- }, S = u?.fileName || o("modal.filePreview.imageAlt"), R = $(() => {
594
+ }, S = u?.fileName || o("modal.filePreview.imageAlt"), M = $(() => {
595
595
  switch (b) {
596
596
  case "image":
597
597
  return /* @__PURE__ */ l(
598
598
  fe,
599
599
  {
600
- ref: M,
600
+ ref: R,
601
601
  src: J(u.fileURL, C) || ce,
602
602
  alt: S,
603
603
  onScaleChange: T,
@@ -669,7 +669,7 @@ const ot = (t) => {
669
669
  /* @__PURE__ */ l(
670
670
  V,
671
671
  {
672
- onClick: () => M.current?.zoomOut(),
672
+ onClick: () => R.current?.zoomOut(),
673
673
  disabled: p <= I,
674
674
  "aria-label": o("modal.filePreview.zoomOut"),
675
675
  children: /* @__PURE__ */ l(Xe, {})
@@ -678,7 +678,7 @@ const ot = (t) => {
678
678
  /* @__PURE__ */ l(
679
679
  V,
680
680
  {
681
- onClick: () => M.current?.zoomIn(),
681
+ onClick: () => R.current?.zoomIn(),
682
682
  disabled: p >= ee,
683
683
  "aria-label": o("modal.filePreview.zoomIn"),
684
684
  children: /* @__PURE__ */ l(Ye, {})
@@ -687,7 +687,7 @@ const ot = (t) => {
687
687
  /* @__PURE__ */ l(
688
688
  V,
689
689
  {
690
- onClick: () => M.current?.reset(),
690
+ onClick: () => R.current?.reset(),
691
691
  disabled: p <= I,
692
692
  "aria-label": o("modal.filePreview.resetZoom"),
693
693
  children: /* @__PURE__ */ l(ze, {})
@@ -721,7 +721,7 @@ const ot = (t) => {
721
721
  children: /* @__PURE__ */ l(Fe, {})
722
722
  }
723
723
  ),
724
- R,
724
+ M,
725
725
  y && /* @__PURE__ */ l(
726
726
  ct,
727
727
  {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as o, Fragment as T, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as m, useCallback as M } from "react";
3
- import { av as B, v as t, aw as I, ax as w, B as j, u as z, n as F, F as E, ay as R, J as U, t as x, az as A, aA as $, aB as O, aC as H } from "./main-DmtEeYji.js";
4
- import { S as J, D as f, a as u, b as D, e as v, f as b } from "./SideDrawer-C_nWZRwH.js";
3
+ import { ay as B, x as t, az as I, aA as w, B as j, u as z, p as E, J as F, aB as R, L as U, w as x, aC as A, aD as $, aE as O, aF as H } from "./main-BHtKhpBZ.js";
4
+ import { S as J, D as f, a as u, b as D, e as v, f as b } from "./SideDrawer-DLqEOqAi.js";
5
5
  t(I)`
6
6
  display: flex;
7
7
  box-sizing: border-box;
@@ -82,7 +82,7 @@ const y = t(j)`
82
82
  `, Q = ({
83
83
  handleCloseModal: r
84
84
  }) => {
85
- const { config: l } = z((s) => s.chatSettingStore), e = F(), { showToast: d } = E(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
85
+ const { config: l } = z((s) => s.chatSettingStore), e = E(), { showToast: d } = F(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
86
86
  const p = (await H()).data;
87
87
  x.log(p);
88
88
  const L = new Blob([p], { type: "text/plain" }), h = URL.createObjectURL(L), n = document.createElement("a");
@@ -1,6 +1,6 @@
1
1
  import { jsxs as fs, jsx as ie, Fragment as hs } from "react/jsx-runtime";
2
2
  import "react";
3
- import { m as ei } from "./main-DmtEeYji.js";
3
+ import { o as ei } from "./main-BHtKhpBZ.js";
4
4
  function zr(e) {
5
5
  const t = [], n = String(e || "");
6
6
  let r = n.indexOf(","), u = 0, i = !1;
@@ -16715,7 +16715,7 @@ const h1 = [
16715
16715
  target: "_blank",
16716
16716
  rel: "noopener noreferrer",
16717
16717
  style: {
16718
- color: "var(--ethora-color-primary, #0a66c2)",
16718
+ color: "var(--ethora-color-primary-text, var(--ethora-color-primary, #0a66c2))",
16719
16719
  textDecoration: "none"
16720
16720
  },
16721
16721
  children: r
@@ -16855,7 +16855,7 @@ const h1 = [
16855
16855
  (l.key === "Enter" || l.key === " ") && (l.preventDefault(), o());
16856
16856
  } : void 0,
16857
16857
  style: {
16858
- color: "var(--ethora-color-primary, #0052cd)",
16858
+ color: "var(--ethora-color-primary-text, var(--ethora-color-primary, #0052cd))",
16859
16859
  fontWeight: 600,
16860
16860
  cursor: t ? "pointer" : "default"
16861
16861
  },
@@ -1,6 +1,6 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
2
  import { useId as f, useRef as v } from "react";
3
- import { n as u, w as g, aF as m, aG as w, B as b, aH as y, v as e, aI as D, aJ as k } from "./main-DmtEeYji.js";
3
+ import { p as u, y as g, aI as m, aJ as w, B as b, aK as y, x as e, aL as D, aM as k } from "./main-BHtKhpBZ.js";
4
4
  const c = 767, R = `${c}px`, z = e.div`
5
5
  position: relative;
6
6
  pointer-events: auto;
@@ -62,7 +62,7 @@ const c = 767, R = `${c}px`, z = e.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  gap: var(--ethora-space-2, 8px);
65
- `, O = e.h3`
65
+ `, K = e.h3`
66
66
  margin: 0;
67
67
  padding: 0 var(--ethora-space-1, 4px);
68
68
  font-size: var(--ethora-font-size-xs, 12px);
@@ -70,7 +70,7 @@ const c = 767, R = `${c}px`, z = e.div`
70
70
  letter-spacing: 0.06em;
71
71
  text-transform: uppercase;
72
72
  color: var(--ethora-color-text-muted, #8c8c8c);
73
- `, W = e.div`
73
+ `, O = e.div`
74
74
  display: flex;
75
75
  flex-direction: column;
76
76
  box-sizing: border-box;
@@ -79,17 +79,17 @@ const c = 767, R = `${c}px`, z = e.div`
79
79
  border-radius: var(--ethora-radius-md, 12px);
80
80
  background-color: var(--ethora-color-bg, #fff);
81
81
  overflow: hidden;
82
- `, _ = e.div`
82
+ `, W = e.div`
83
83
  display: flex;
84
84
  flex-direction: column;
85
85
  gap: var(--ethora-space-1, 4px);
86
86
  padding: var(--ethora-space-3, 12px) var(--ethora-space-4, 16px);
87
- `, F = e.div`
87
+ `, _ = e.div`
88
88
  display: flex;
89
89
  align-items: baseline;
90
90
  justify-content: space-between;
91
91
  gap: var(--ethora-space-2, 8px);
92
- `, K = e.button`
92
+ `, F = e.button`
93
93
  border: none;
94
94
  background: transparent;
95
95
  padding: var(--ethora-space-2, 8px) 0;
@@ -97,7 +97,7 @@ const c = 767, R = `${c}px`, z = e.div`
97
97
  font: inherit;
98
98
  font-size: var(--ethora-font-size-xs, 13px);
99
99
  font-weight: var(--ethora-font-weight-medium, 500);
100
- color: var(--ethora-color-primary, #0052cd);
100
+ color: var(--ethora-color-primary-text, var(--ethora-color-primary, #0052cd));
101
101
  align-self: center;
102
102
 
103
103
  &:hover {
@@ -109,11 +109,11 @@ const c = 767, R = `${c}px`, z = e.div`
109
109
  outline-offset: 2px;
110
110
  border-radius: var(--ethora-radius-sm, 8px);
111
111
  }
112
- `, G = e.div`
112
+ `, J = e.div`
113
113
  height: 1px;
114
114
  margin: 0 var(--ethora-space-4, 16px);
115
115
  background-color: var(--ethora-color-border, #e6e8ec);
116
- `, J = e.div`
116
+ `, V = e.div`
117
117
  display: flex;
118
118
  align-items: center;
119
119
  gap: var(--ethora-space-2, 8px);
@@ -135,7 +135,7 @@ const c = 767, R = `${c}px`, z = e.div`
135
135
  & > svg {
136
136
  flex: 0 0 auto;
137
137
  }
138
- `, V = e.input`
138
+ `, X = e.input`
139
139
  flex: 1 1 auto;
140
140
  min-width: 0;
141
141
  border: none;
@@ -148,22 +148,22 @@ const c = 767, R = `${c}px`, z = e.div`
148
148
  &::placeholder {
149
149
  color: var(--ethora-color-text-muted, #8c8c8c);
150
150
  }
151
- `, X = e.div`
151
+ `, q = e.div`
152
152
  display: flex;
153
153
  flex-direction: column;
154
154
  width: 100%;
155
- `, T = e.div`
155
+ `, L = e.div`
156
156
  font-size: var(--ethora-font-size-sm, 14px);
157
157
  font-weight: var(--ethora-font-weight-medium, 500);
158
158
  color: var(--ethora-color-text, #141414);
159
159
  text-align: start;
160
- `, C = e.div`
160
+ `, T = e.div`
161
161
  font-size: var(--ethora-font-size-xs, 12px);
162
162
  font-weight: var(--ethora-font-weight-regular, 400);
163
163
  color: var(--ethora-color-text-muted, #8c8c8c);
164
164
  text-align: start;
165
165
  line-height: 1.4;
166
- `, E = e.button`
166
+ `, C = e.button`
167
167
  display: flex;
168
168
  align-items: center;
169
169
  gap: var(--ethora-space-3, 12px);
@@ -186,17 +186,17 @@ const c = 767, R = `${c}px`, z = e.div`
186
186
  outline: 2px solid var(--ethora-color-primary, #0052cd);
187
187
  outline-offset: -2px;
188
188
  }
189
- `, L = e.span`
189
+ `, E = e.span`
190
190
  display: flex;
191
191
  flex-direction: column;
192
192
  gap: var(--ethora-space-1, 4px);
193
193
  flex: 1 1 auto;
194
194
  min-width: 0;
195
- `, j = e.span`
195
+ `, M = e.span`
196
196
  flex: 0 0 auto;
197
197
  display: inline-flex;
198
198
  color: var(--ethora-color-text-muted, #8c8c8c);
199
- `, H = () => /* @__PURE__ */ o("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
199
+ `, j = () => /* @__PURE__ */ o("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
200
200
  "path",
201
201
  {
202
202
  d: "M6 3.5L10.5 8L6 12.5",
@@ -205,16 +205,16 @@ const c = 767, R = `${c}px`, z = e.div`
205
205
  strokeLinecap: "round",
206
206
  strokeLinejoin: "round"
207
207
  }
208
- ) }), q = ({
208
+ ) }), G = ({
209
209
  label: r,
210
210
  hint: a,
211
211
  onClick: t
212
- }) => /* @__PURE__ */ i(E, { type: "button", onClick: t, children: [
213
- /* @__PURE__ */ i(L, { children: [
214
- /* @__PURE__ */ o(T, { children: r }),
215
- a && /* @__PURE__ */ o(C, { children: a })
212
+ }) => /* @__PURE__ */ i(C, { type: "button", onClick: t, children: [
213
+ /* @__PURE__ */ i(E, { children: [
214
+ /* @__PURE__ */ o(L, { children: r }),
215
+ a && /* @__PURE__ */ o(T, { children: a })
216
216
  ] }),
217
- /* @__PURE__ */ o(j, { "aria-hidden": "true", children: /* @__PURE__ */ o(H, {}) })
217
+ /* @__PURE__ */ o(M, { "aria-hidden": "true", children: /* @__PURE__ */ o(j, {}) })
218
218
  ] }), Q = ({
219
219
  title: r,
220
220
  onClose: a,
@@ -255,16 +255,16 @@ const c = 767, R = `${c}px`, z = e.div`
255
255
  export {
256
256
  $ as D,
257
257
  Q as S,
258
- O as a,
259
- W as b,
260
- G as c,
261
- q as d,
262
- _ as e,
263
- C as f,
264
- T as g,
265
- F as h,
266
- J as i,
267
- V as j,
268
- X as k,
269
- K as l
258
+ K as a,
259
+ O as b,
260
+ J as c,
261
+ G as d,
262
+ W as e,
263
+ T as f,
264
+ L as g,
265
+ _ as h,
266
+ V as i,
267
+ X as j,
268
+ q as k,
269
+ F as l
270
270
  };