@minicode-dev/chat 0.1.13 → 0.1.14
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/CHANGELOG.md +112 -5
- package/README.md +401 -312
- package/assets/sounds/effects/avalanche.mp3 +0 -0
- package/assets/sounds/racing/car_boost.mp3 +0 -0
- package/assets/sounds/racing/car_boost.ogg +0 -0
- package/assets/sounds/racing/car_bump.mp3 +0 -0
- package/assets/sounds/racing/car_bump.ogg +0 -0
- package/assets/sounds/racing/car_drift_loop.mp3 +0 -0
- package/assets/sounds/racing/car_drift_loop.ogg +0 -0
- package/assets/sounds/racing/car_engine_loop.mp3 +0 -0
- package/assets/sounds/racing/car_engine_loop.ogg +0 -0
- package/assets/sounds/racing/car_engine_start.mp3 +0 -0
- package/assets/sounds/racing/car_engine_start.ogg +0 -0
- package/assets/sounds/racing/countdown_beep.mp3 +0 -0
- package/assets/sounds/racing/countdown_beep.ogg +0 -0
- package/assets/sounds/racing/countdown_go.mp3 +0 -0
- package/assets/sounds/racing/countdown_go.ogg +0 -0
- package/assets/sounds/racing/final_lap.mp3 +0 -0
- package/assets/sounds/racing/final_lap.ogg +0 -0
- package/assets/sounds/racing/finish_line.mp3 +0 -0
- package/assets/sounds/racing/finish_line.ogg +0 -0
- package/assets/sounds/racing/lap_complete.mp3 +0 -0
- package/assets/sounds/racing/lap_complete.ogg +0 -0
- package/assets/sounds/racing/music_circuit.mp3 +0 -0
- package/assets/sounds/racing/music_circuit.ogg +0 -0
- package/assets/sounds/racing/music_final_lap.mp3 +0 -0
- package/assets/sounds/racing/music_final_lap.ogg +0 -0
- package/assets/sounds/racing/race_defeat.mp3 +0 -0
- package/assets/sounds/racing/race_defeat.ogg +0 -0
- package/assets/sounds/racing/race_victory.mp3 +0 -0
- package/assets/sounds/racing/race_victory.ogg +0 -0
- package/assets/sounds/tanks/barrel_explode.mp3 +0 -0
- package/assets/sounds/tanks/barrel_explode.ogg +0 -0
- package/assets/sounds/tanks/crate_break.mp3 +0 -0
- package/assets/sounds/tanks/crate_break.ogg +0 -0
- package/assets/sounds/tanks/health_pickup.mp3 +0 -0
- package/assets/sounds/tanks/health_pickup.ogg +0 -0
- package/assets/sounds/tanks/last_life.mp3 +0 -0
- package/assets/sounds/tanks/last_life.ogg +0 -0
- package/assets/sounds/tanks/life_lost.mp3 +0 -0
- package/assets/sounds/tanks/life_lost.ogg +0 -0
- package/assets/sounds/tanks/respawn.mp3 +0 -0
- package/assets/sounds/tanks/respawn.ogg +0 -0
- package/assets/sounds/tanks/shield_end.mp3 +0 -0
- package/assets/sounds/tanks/shield_end.ogg +0 -0
- package/assets/sounds/tanks/shield_loop.mp3 +0 -0
- package/assets/sounds/tanks/shield_loop.ogg +0 -0
- package/assets/sounds/tanks/wall_hit.mp3 +0 -0
- package/assets/sounds/tanks/wall_hit.ogg +0 -0
- package/dist/chunks/{BattleshipGameCard-iRk8d4vR.js → BattleshipGameCard-B-B4r7lK.js} +146 -144
- package/dist/chunks/{BattleshipGameCard-iRk8d4vR.js.map → BattleshipGameCard-B-B4r7lK.js.map} +1 -1
- package/dist/chunks/{ChatContext-DjIEifGY.js → ChatContext-DQtKsR6Z.js} +2 -2
- package/dist/chunks/{ChatContext-DjIEifGY.js.map → ChatContext-DQtKsR6Z.js.map} +1 -1
- package/dist/chunks/RacingLiveGameCard-c1G7uoDI.js +1654 -0
- package/dist/chunks/RacingLiveGameCard-c1G7uoDI.js.map +1 -0
- package/dist/chunks/{TanksGameCard-GrqmdwJ7.js → TanksGameCard-CvTaF7tu.js} +164 -162
- package/dist/chunks/{TanksGameCard-GrqmdwJ7.js.map → TanksGameCard-CvTaF7tu.js.map} +1 -1
- package/dist/chunks/TanksLiveGameCard-COr9Oay5.js +1011 -0
- package/dist/chunks/TanksLiveGameCard-COr9Oay5.js.map +1 -0
- package/dist/chunks/avalancheScene3d-Z5QyZIid.js +1299 -0
- package/dist/chunks/avalancheScene3d-Z5QyZIid.js.map +1 -0
- package/dist/chunks/connect4Sounds-DmD-E9kX.js +235 -0
- package/dist/chunks/connect4Sounds-DmD-E9kX.js.map +1 -0
- package/dist/chunks/connectionStore-DwgIUl30.js +13 -0
- package/dist/chunks/connectionStore-DwgIUl30.js.map +1 -0
- package/dist/chunks/createLiveScene-CWBunxPi.js +367 -0
- package/dist/chunks/{createLiveScene-819NWv84.js.map → createLiveScene-CWBunxPi.js.map} +1 -1
- package/dist/chunks/createRaceScene-C7Rw89kj.js +305 -0
- package/dist/chunks/createRaceScene-C7Rw89kj.js.map +1 -0
- package/dist/chunks/{createTankScene-6asWHKFf.js → createTankScene-yhX6la27.js} +125 -123
- package/dist/chunks/{createTankScene-6asWHKFf.js.map → createTankScene-yhX6la27.js.map} +1 -1
- package/dist/chunks/decor-CyyCnmct.js +418 -0
- package/dist/chunks/decor-CyyCnmct.js.map +1 -0
- package/dist/chunks/fx-1ZwzmPWj.js +458 -0
- package/dist/chunks/fx-1ZwzmPWj.js.map +1 -0
- package/dist/chunks/fx-UZwhOmdl.js +584 -0
- package/dist/chunks/fx-UZwhOmdl.js.map +1 -0
- package/dist/chunks/gameStatus-BChd29yI.js +62 -0
- package/dist/chunks/gameStatus-BChd29yI.js.map +1 -0
- package/dist/chunks/{connect4Sounds-Cv0q31VW.js → games-BvYTWgaR.js} +814 -951
- package/dist/chunks/games-BvYTWgaR.js.map +1 -0
- package/dist/chunks/rolldown-runtime-CGnMp29N.js +10 -0
- package/dist/chunks/tank-DjEQ4FXF.js +553 -0
- package/dist/chunks/tank-DjEQ4FXF.js.map +1 -0
- package/dist/chunks/tanks-live-BcKmrhnV.js +261 -0
- package/dist/chunks/tanks-live-BcKmrhnV.js.map +1 -0
- package/dist/chunks/{tanksSounds-CUNDIOal.js → tanksSounds-DwjfSp3W.js} +43 -11
- package/dist/chunks/tanksSounds-DwjfSp3W.js.map +1 -0
- package/dist/chunks/track-BcnnpnAm.js +259 -0
- package/dist/chunks/track-BcnnpnAm.js.map +1 -0
- package/dist/chunks/util-DwI9bfS7.js +57 -0
- package/dist/chunks/util-DwI9bfS7.js.map +1 -0
- package/dist/index.js +812 -625
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/index.d.ts +3 -1
- package/package.json +1 -1
- package/dist/chunks/TanksLiveGameCard-DSmQcUMh.js +0 -1225
- package/dist/chunks/TanksLiveGameCard-DSmQcUMh.js.map +0 -1
- package/dist/chunks/avalancheScene3d-Dnl2E3EA.js +0 -1878
- package/dist/chunks/avalancheScene3d-Dnl2E3EA.js.map +0 -1
- package/dist/chunks/connect4Sounds-Cv0q31VW.js.map +0 -1
- package/dist/chunks/createLiveScene-819NWv84.js +0 -365
- package/dist/chunks/fx-BNJvJYOu.js +0 -871
- package/dist/chunks/fx-BNJvJYOu.js.map +0 -1
- package/dist/chunks/gameStatus-Cu1Z8un9.js +0 -69
- package/dist/chunks/gameStatus-Cu1Z8un9.js.map +0 -1
- package/dist/chunks/tank-DIn6Jyt8.js +0 -605
- package/dist/chunks/tank-DIn6Jyt8.js.map +0 -1
- package/dist/chunks/tanksSounds-CUNDIOal.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
1
|
+
import { _ as e, a as t, g as n, h as r, i, n as a, r as o, t as s, v as c } from "./chunks/games-BvYTWgaR.js";
|
|
2
|
+
import { a as l, c as u, i as d, n as f, o as p, s as m, t as h } from "./chunks/createPeerLink-DBVs_yvQ.js";
|
|
3
|
+
import { a as g, i as _, n as v, o as y, r as b, s as x, t as S } from "./chunks/ChatContext-DQtKsR6Z.js";
|
|
4
|
+
import { i as C, n as w, r as T } from "./chunks/timeline-BLBedCYj.js";
|
|
5
|
+
import { n as E, r as D, t as O } from "./chunks/connectionStore-DwgIUl30.js";
|
|
6
|
+
import { a as k, c as A, l as j, n as M, o as ee, r as N, s as P, t as te } from "./chunks/gameStatus-BChd29yI.js";
|
|
7
|
+
import { i as ne, n as re, o as F, r as ie, t as ae } from "./chunks/connect4Sounds-DmD-E9kX.js";
|
|
8
|
+
import { t as I } from "./chunks/signalFaults-Dv2YjjKy.js";
|
|
9
|
+
import { Component as L, Suspense as R, createContext as oe, lazy as se, memo as z, useCallback as B, useContext as V, useEffect as H, useId as ce, useMemo as U, useRef as W, useState as G, useSyncExternalStore as K } from "react";
|
|
8
10
|
import { createStore as le } from "zustand/vanilla";
|
|
9
11
|
import { createStore as ue, useStore as de } from "zustand";
|
|
10
12
|
import { AlertCircle as fe, Anchor as q, Angry as pe, ArrowDown as me, ArrowLeft as J, ArrowUpRight as Y, Bell as X, BellOff as he, Box as ge, Car as _e, Check as ve, ChevronDown as ye, ChevronLeft as be, ChevronRight as xe, ChevronUp as Se, CircleDot as Ce, Clapperboard as we, Clock as Te, Copy as Ee, Crosshair as De, Download as Oe, ExternalLink as ke, Eye as Ae, File as je, FileArchive as Me, FileSpreadsheet as Ne, FileText as Pe, Flag as Fe, Flame as Ie, Frown as Le, Gamepad2 as Re, Grip as ze, GripHorizontal as Be, Hand as Ve, HandHeart as He, Hash as Ue, Heart as We, ImageOff as Ge, Laugh as Ke, Lightbulb as qe, Loader2 as Je, Maximize2 as Ye, MessageCircle as Xe, Mic as Ze, Minimize2 as Qe, Music as $e, PanelLeft as et, Paperclip as tt, PartyPopper as nt, Pause as rt, PawPrint as it, Pencil as at, Play as ot, Plus as st, Puzzle as ct, Reply as lt, Rocket as ut, RotateCcw as dt, Search as ft, SearchX as pt, Send as mt, Smile as ht, SmilePlus as gt, Sparkles as _t, Square as vt, Star as yt, Sticker as bt, Trophy as xt, User as St, Utensils as Ct, Volume2 as wt, VolumeX as Tt, X as Et, Zap as Dt } from "lucide-react";
|
|
@@ -51,7 +53,8 @@ var jt = () => {}, Mt = Object.freeze({
|
|
|
51
53
|
battleship: !0,
|
|
52
54
|
battleshipPreview: !0,
|
|
53
55
|
tanks: !1,
|
|
54
|
-
tanksLive: !1
|
|
56
|
+
tanksLive: !1,
|
|
57
|
+
racingLive: !1
|
|
55
58
|
}),
|
|
56
59
|
detach: Object.freeze({
|
|
57
60
|
path: "/chat",
|
|
@@ -211,12 +214,12 @@ function Gt({ url: e, getToken: t, tokenParam: n = "token", reconnect: r = {
|
|
|
211
214
|
}, O = () => {
|
|
212
215
|
x && clearInterval(x), x = null;
|
|
213
216
|
}, k = () => {
|
|
214
|
-
O(), d && f > 0 && (x = setInterval(() =>
|
|
217
|
+
O(), d && f > 0 && (x = setInterval(() => te(d), f));
|
|
215
218
|
}, A = () => {
|
|
216
219
|
if (_ || v || g >= c) return;
|
|
217
220
|
let e = Math.min(u, 2 ** g * l);
|
|
218
221
|
g += 1, D(), b = setTimeout(() => {
|
|
219
|
-
b = null,
|
|
222
|
+
b = null, N().catch(() => {});
|
|
220
223
|
}, e);
|
|
221
224
|
}, j = (e, t, n) => {
|
|
222
225
|
let r = w.get(t.request_id);
|
|
@@ -234,17 +237,17 @@ function Gt({ url: e, getToken: t, tokenParam: n = "token", reconnect: r = {
|
|
|
234
237
|
} catch (e) {
|
|
235
238
|
console.error("[chat] transport handler error", e);
|
|
236
239
|
}
|
|
237
|
-
},
|
|
240
|
+
}, ee = async () => {
|
|
238
241
|
let r = typeof e == "function" ? await e() : e;
|
|
239
242
|
if (!r) throw Error("[chat] createStandaloneTransport: url vacía");
|
|
240
243
|
let i = t ? await t() : null;
|
|
241
244
|
return Wt(String(r), i, n);
|
|
242
245
|
};
|
|
243
|
-
function
|
|
246
|
+
function N() {
|
|
244
247
|
return p && (p.readyState === zt || p.readyState === 0) ? Promise.resolve() : y || (s ? (v = !1, _ = !1, D(), T("connecting"), y = (async () => {
|
|
245
248
|
let e;
|
|
246
249
|
try {
|
|
247
|
-
e = await
|
|
250
|
+
e = await ee();
|
|
248
251
|
} catch (e) {
|
|
249
252
|
throw T("error"), A(), e;
|
|
250
253
|
}
|
|
@@ -271,7 +274,7 @@ function Gt({ url: e, getToken: t, tokenParam: n = "token", reconnect: r = {
|
|
|
271
274
|
y = null;
|
|
272
275
|
}), y) : Promise.reject(/* @__PURE__ */ Error("[chat] WebSocket no disponible")));
|
|
273
276
|
}
|
|
274
|
-
function
|
|
277
|
+
function P(e = 1e3) {
|
|
275
278
|
v = !0, D(), O();
|
|
276
279
|
let t = p;
|
|
277
280
|
if (p = null, m = null, E("Conexión cerrada"), t) try {
|
|
@@ -279,7 +282,7 @@ function Gt({ url: e, getToken: t, tokenParam: n = "token", reconnect: r = {
|
|
|
279
282
|
} catch {}
|
|
280
283
|
T("disconnected");
|
|
281
284
|
}
|
|
282
|
-
function
|
|
285
|
+
function te(e, t) {
|
|
283
286
|
if (!p || p.readyState !== zt) return !1;
|
|
284
287
|
try {
|
|
285
288
|
return p.send(JSON.stringify(t === void 0 ? { action: e } : {
|
|
@@ -290,7 +293,7 @@ function Gt({ url: e, getToken: t, tokenParam: n = "token", reconnect: r = {
|
|
|
290
293
|
return !1;
|
|
291
294
|
}
|
|
292
295
|
}
|
|
293
|
-
function
|
|
296
|
+
function ne(e, t = {}, { timeoutMs: n = Bt } = {}) {
|
|
294
297
|
if (!p || p.readyState !== zt) return Promise.reject(/* @__PURE__ */ Error("Sin conexión"));
|
|
295
298
|
let r = Ut();
|
|
296
299
|
return new Promise((i, a) => {
|
|
@@ -301,17 +304,17 @@ function Gt({ url: e, getToken: t, tokenParam: n = "token", reconnect: r = {
|
|
|
301
304
|
resolve: i,
|
|
302
305
|
reject: a,
|
|
303
306
|
timer: o
|
|
304
|
-
}),
|
|
307
|
+
}), te(e, {
|
|
305
308
|
...t,
|
|
306
309
|
request_id: r
|
|
307
310
|
}) || (clearTimeout(o), w.delete(r), a(/* @__PURE__ */ Error("Sin conexión")));
|
|
308
311
|
});
|
|
309
312
|
}
|
|
310
313
|
return {
|
|
311
|
-
connect:
|
|
312
|
-
close:
|
|
313
|
-
send:
|
|
314
|
-
request:
|
|
314
|
+
connect: N,
|
|
315
|
+
close: P,
|
|
316
|
+
send: te,
|
|
317
|
+
request: ne,
|
|
315
318
|
onEvent(e) {
|
|
316
319
|
return S.add(e), () => S.delete(e);
|
|
317
320
|
},
|
|
@@ -657,22 +660,22 @@ function Kn() {
|
|
|
657
660
|
async function qn(e, { scope: t, room: n, id: r, onClick: i, connectedAt: a, isCurrent: o }) {
|
|
658
661
|
let s = zn();
|
|
659
662
|
if (!s.supported || !s.enabled || s.permission !== "granted" || n == null || !r) return;
|
|
660
|
-
let
|
|
661
|
-
if (!Number.isFinite(
|
|
662
|
-
let
|
|
663
|
-
if (Pn.has(
|
|
664
|
-
Pn.add(
|
|
665
|
-
let
|
|
666
|
-
if (In.set(
|
|
667
|
-
|
|
663
|
+
let l = Date.parse(e.timestamp);
|
|
664
|
+
if (!Number.isFinite(l) || l < a || e.localOnly || e.optimistic || e.is_history || e.history) return;
|
|
665
|
+
let u = `${t}:${r}`;
|
|
666
|
+
if (Pn.has(u)) return;
|
|
667
|
+
Pn.add(u), Pn.size > 500 && Pn.delete(Pn.values().next().value);
|
|
668
|
+
let d = Un(t, n), f = c();
|
|
669
|
+
if (In.set(f, () => {
|
|
670
|
+
d = !0;
|
|
668
671
|
}), Nn?.postMessage({
|
|
669
672
|
type: "visible-query",
|
|
670
|
-
id:
|
|
673
|
+
id: f,
|
|
671
674
|
scope: t,
|
|
672
675
|
room: n
|
|
673
|
-
}), await Gn(150), In.delete(
|
|
676
|
+
}), await Gn(150), In.delete(f), d || Un(t, n) || !o()) return;
|
|
674
677
|
let p = async () => {
|
|
675
|
-
let r = `lira-chat-desktop-seen:${
|
|
678
|
+
let r = `lira-chat-desktop-seen:${u}`;
|
|
676
679
|
try {
|
|
677
680
|
if (localStorage.getItem(r)) return;
|
|
678
681
|
localStorage.setItem(r, String(Date.now()));
|
|
@@ -686,19 +689,19 @@ async function qn(e, { scope: t, room: n, id: r, onClick: i, connectedAt: a, isC
|
|
|
686
689
|
try {
|
|
687
690
|
let e = new Notification(a ? s : "LIRA Chat", {
|
|
688
691
|
body: c,
|
|
689
|
-
tag:
|
|
692
|
+
tag: u,
|
|
690
693
|
silent: !0
|
|
691
694
|
});
|
|
692
695
|
Fn.add(e), e.onclose = () => Fn.delete(e), e.onclick = () => {
|
|
693
696
|
e.close(), o() && (window.focus(), i());
|
|
694
697
|
}, Nn?.postMessage({
|
|
695
698
|
type: "shown",
|
|
696
|
-
id:
|
|
699
|
+
id: u
|
|
697
700
|
});
|
|
698
701
|
} catch {}
|
|
699
702
|
};
|
|
700
703
|
try {
|
|
701
|
-
navigator.locks ? await navigator.locks.request(`lira-desktop:${
|
|
704
|
+
navigator.locks ? await navigator.locks.request(`lira-desktop:${u}`, p) : (await Gn(Math.random() * 100), await p());
|
|
702
705
|
} catch {}
|
|
703
706
|
}
|
|
704
707
|
var Jn = () => {
|
|
@@ -771,11 +774,11 @@ var Qn = 500, $n = [
|
|
|
771
774
|
}
|
|
772
775
|
return r;
|
|
773
776
|
};
|
|
774
|
-
function dr({ transport: t, sendMessage: n, getOwnIds: r, onOpenChat:
|
|
775
|
-
let
|
|
777
|
+
function dr({ transport: t, sendMessage: n, getOwnIds: r, onOpenChat: a, maxMessages: o = 500, games: s = i, unread: c = dn, extras: l = On } = {}) {
|
|
778
|
+
let d = () => t.getIdentity?.() ?? {
|
|
776
779
|
userId: null,
|
|
777
780
|
scope: ""
|
|
778
|
-
},
|
|
781
|
+
}, f = () => r ? r() : [d().userId].filter((e) => e != null).map(String), p = () => t.getConnectionId?.() ?? null, m = () => t.getStatus?.() === "connected", h = (e, n) => t.send(e, n), _ = null, v = (e) => ({
|
|
779
782
|
id: e,
|
|
780
783
|
joinedRooms: /* @__PURE__ */ new Set(),
|
|
781
784
|
connectedAt: Date.now(),
|
|
@@ -789,155 +792,155 @@ function dr({ transport: t, sendMessage: n, getOwnIds: r, onOpenChat: i, maxMess
|
|
|
789
792
|
},
|
|
790
793
|
presenceTimer: null,
|
|
791
794
|
stopActivity: null
|
|
792
|
-
}),
|
|
793
|
-
return le((r,
|
|
794
|
-
let
|
|
795
|
+
}), y = (e) => e && _ === e && p() === e.id && m();
|
|
796
|
+
return le((r, i) => {
|
|
797
|
+
let x = (e) => {
|
|
795
798
|
let t = Date.now();
|
|
796
799
|
e.stale = e.stale.filter((e) => t - e.at < nr);
|
|
797
|
-
},
|
|
798
|
-
let n = e.search,
|
|
799
|
-
|
|
800
|
-
query:
|
|
800
|
+
}, S = (e, { stale: t = !1 } = {}) => {
|
|
801
|
+
let n = e.search, a = n.active;
|
|
802
|
+
a !== null && (clearTimeout(n.timer), n.timer = null, n.active = null, n.deltas.clear(), t && (n.stale = [...n.stale, {
|
|
803
|
+
query: a,
|
|
801
804
|
at: Date.now()
|
|
802
|
-
}].slice(-5)),
|
|
803
|
-
},
|
|
805
|
+
}].slice(-5)), _ === e && (a ? a === i().userSearchQuery && r({ userSearchStatus: "error" }) : r({ presenceStatus: "error" }), C(e)));
|
|
806
|
+
}, C = (e) => {
|
|
804
807
|
let t = e.search;
|
|
805
|
-
if (t.active !== null || !t.queue.length || !
|
|
808
|
+
if (t.active !== null || !t.queue.length || !y(e)) return;
|
|
806
809
|
let n = t.queue.shift();
|
|
807
|
-
t.active = n, t.deltas.clear(), n ? n ===
|
|
808
|
-
|
|
810
|
+
t.active = n, t.deltas.clear(), n ? n === i().userSearchQuery && r({ userSearchStatus: "loading" }) : r({ presenceStatus: "loading" }), h("SEARCH_USERS", { query: n }), t.timer = setTimeout(() => {
|
|
811
|
+
_ === e && t.active === n && S(e, { stale: !0 });
|
|
809
812
|
}, rr);
|
|
810
|
-
},
|
|
813
|
+
}, w = (e) => {
|
|
811
814
|
if (typeof window > "u") return;
|
|
812
815
|
let t = Date.now(), n = t, r = () => {
|
|
813
|
-
|
|
814
|
-
}, i = () => {
|
|
815
|
-
n = Date.now(), d().myPresence.status === "away" && n - t > 5e3 && r();
|
|
816
|
+
y(e) && (h("ACTIVITY", {}), t = Date.now());
|
|
816
817
|
}, a = () => {
|
|
817
|
-
|
|
818
|
-
}, o =
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
818
|
+
n = Date.now(), i().myPresence.status === "away" && n - t > 5e3 && r();
|
|
819
|
+
}, o = () => {
|
|
820
|
+
document.visibilityState === "visible" && a();
|
|
821
|
+
}, s = { passive: !0 };
|
|
822
|
+
ar.forEach((e) => window.addEventListener(e, a, s)), document.addEventListener("visibilitychange", o, s);
|
|
823
|
+
let c = setInterval(() => {
|
|
824
|
+
y(e) && n > t && Date.now() - t >= 6e4 && r();
|
|
822
825
|
}, 15e3);
|
|
823
826
|
e.stopActivity = () => {
|
|
824
|
-
clearInterval(
|
|
827
|
+
clearInterval(c), ar.forEach((e) => window.removeEventListener(e, a, s)), document.removeEventListener("visibilitychange", o, s);
|
|
825
828
|
};
|
|
826
|
-
},
|
|
827
|
-
let e =
|
|
828
|
-
e && (
|
|
829
|
+
}, T = () => {
|
|
830
|
+
let e = _;
|
|
831
|
+
e && (_ = null, clearTimeout(e.search.timer), clearInterval(e.presenceTimer), e.stopActivity?.());
|
|
829
832
|
}, E = () => {
|
|
830
|
-
|
|
831
|
-
let e =
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
}, ir),
|
|
833
|
+
T();
|
|
834
|
+
let e = v(p());
|
|
835
|
+
_ = e, b(), e.presenceTimer = setInterval(() => {
|
|
836
|
+
y(e) && i().searchUsers("");
|
|
837
|
+
}, ir), w(e);
|
|
835
838
|
}, D = (e, t) => {
|
|
836
|
-
e === "connected" ?
|
|
839
|
+
e === "connected" ? _ && _.id === p() || E() : (t === "connected" || _) && (i().resetUserSearch(), T(), s.getState().markDisconnected?.(d().scope));
|
|
837
840
|
}, O = (t) => {
|
|
838
|
-
let n =
|
|
839
|
-
if (
|
|
840
|
-
let e =
|
|
841
|
-
e &&
|
|
841
|
+
let n = f(), p = d().userId, m = t.user_id ?? t.payload?.user_id ?? t.data?.user_id, h = m != null && p != null && !n.includes(String(m)), v = String(t.room_id ?? t.data?.room_id ?? t.payload?.room_id ?? ""), y = v.startsWith("private_") ? v.slice(8).split("_") : [];
|
|
842
|
+
if (y.length === 2 && y.includes(p)) {
|
|
843
|
+
let e = y.find((e) => e !== p);
|
|
844
|
+
e && i().privateRooms[e] !== v && r((t) => ({ privateRooms: {
|
|
842
845
|
...t.privateRooms,
|
|
843
|
-
[e]:
|
|
846
|
+
[e]: v
|
|
844
847
|
} }));
|
|
845
848
|
}
|
|
846
|
-
|
|
849
|
+
m != null && t.username && !i().knownUsers[String(m)] && r((e) => ({ knownUsers: {
|
|
847
850
|
...e.knownUsers,
|
|
848
|
-
[String(
|
|
849
|
-
user_id: String(
|
|
851
|
+
[String(m)]: {
|
|
852
|
+
user_id: String(m),
|
|
850
853
|
username: t.username
|
|
851
854
|
}
|
|
852
855
|
} }));
|
|
853
|
-
let
|
|
854
|
-
...
|
|
856
|
+
let b = t.data ?? t.payload, x = b && typeof b == "object" ? {
|
|
857
|
+
...b,
|
|
855
858
|
...t,
|
|
856
|
-
message: t.message ??
|
|
857
|
-
text: t.text ??
|
|
858
|
-
room_id: t.room_id ??
|
|
859
|
-
user_id:
|
|
860
|
-
} : t, S =
|
|
859
|
+
message: t.message ?? b.message,
|
|
860
|
+
text: t.text ?? b.text,
|
|
861
|
+
room_id: t.room_id ?? b.room_id,
|
|
862
|
+
user_id: m
|
|
863
|
+
} : t, S = x.message ?? x.text;
|
|
861
864
|
if (xn(S)) {
|
|
862
|
-
let e = Tn(S)?.targetId, t = e &&
|
|
865
|
+
let e = Tn(S)?.targetId, t = e && i().chatMessages.map((e) => {
|
|
863
866
|
let t = e.data ?? e.payload;
|
|
864
867
|
return t && typeof t == "object" ? {
|
|
865
868
|
...e,
|
|
866
869
|
...t
|
|
867
870
|
} : e;
|
|
868
871
|
}).find((t) => Sn(t) === e);
|
|
869
|
-
|
|
872
|
+
l.getState().apply(x, t || null);
|
|
870
873
|
return;
|
|
871
874
|
}
|
|
872
|
-
if (
|
|
875
|
+
if (u(S)) {
|
|
873
876
|
e.emit({
|
|
874
|
-
userId: String(
|
|
875
|
-
roomId: String(
|
|
877
|
+
userId: String(m ?? ""),
|
|
878
|
+
roomId: String(x.room_id ?? ""),
|
|
876
879
|
text: S
|
|
877
880
|
});
|
|
878
881
|
return;
|
|
879
882
|
}
|
|
880
|
-
let C =
|
|
881
|
-
if (typeof S == "string" && S.startsWith("LIRA_GAME_V1:") && String(
|
|
882
|
-
|
|
883
|
+
let C = d().scope;
|
|
884
|
+
if (typeof S == "string" && S.startsWith("LIRA_GAME_V1:") && String(x.room_id ?? "").startsWith("private_")) {
|
|
885
|
+
s.getState().ingest(x, {
|
|
883
886
|
scope: C,
|
|
884
|
-
currentUserId:
|
|
887
|
+
currentUserId: p
|
|
885
888
|
});
|
|
886
889
|
return;
|
|
887
890
|
}
|
|
888
|
-
r((e) => ({ chatMessages: ur(e.chatMessages, t,
|
|
889
|
-
let w =
|
|
891
|
+
r((e) => ({ chatMessages: ur(e.chatMessages, t, o) }));
|
|
892
|
+
let w = _?.connectedAt ?? Infinity, T = t.localOnly === !0, E = c.getState().receive(t, {
|
|
890
893
|
ownIds: n,
|
|
891
894
|
connectedAt: w
|
|
892
|
-
}), D = t.message_id ?? t.id ?? `${t.room_id}:${
|
|
893
|
-
if (!
|
|
894
|
-
let O = rn(t), k = O.room_id, A =
|
|
895
|
+
}), D = t.message_id ?? t.id ?? `${t.room_id}:${m}:${t.timestamp}`;
|
|
896
|
+
if (!h || T || !E || (g(D), (t.event || t.type) !== "CHAT_MESSAGE")) return;
|
|
897
|
+
let O = rn(t), k = O.room_id, A = _;
|
|
895
898
|
qn(O, {
|
|
896
899
|
scope: C,
|
|
897
900
|
room: k,
|
|
898
|
-
id: O.message_id ?? O.id ?? `${k}:${
|
|
901
|
+
id: O.message_id ?? O.id ?? `${k}:${m}:${O.timestamp}`,
|
|
899
902
|
connectedAt: w,
|
|
900
|
-
isCurrent: () =>
|
|
903
|
+
isCurrent: () => _ === A && d().userId === p,
|
|
901
904
|
onClick: () => {
|
|
902
|
-
|
|
905
|
+
_ === A && d().userId != null && (i().selectChat(k, String(k).startsWith("private") ? "private" : "group"), a?.(k));
|
|
903
906
|
}
|
|
904
907
|
});
|
|
905
908
|
}, k = (e) => {
|
|
906
909
|
if (!e || typeof e != "object") return !1;
|
|
907
|
-
let { event: t, data: n, payload:
|
|
908
|
-
if (t === "GROUPS_LIST" ||
|
|
909
|
-
let e = n ||
|
|
910
|
+
let { event: t, data: n, payload: a, type: o } = e, s = e.event ?? e.type;
|
|
911
|
+
if (t === "GROUPS_LIST" || o === "groups_list") {
|
|
912
|
+
let e = n || a;
|
|
910
913
|
r((t) => ({ chatState: {
|
|
911
914
|
...t.chatState,
|
|
912
915
|
availableGroups: e
|
|
913
916
|
} }));
|
|
914
|
-
let t =
|
|
917
|
+
let t = _;
|
|
915
918
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
916
919
|
let n = e?.id;
|
|
917
|
-
n == null || String(n).startsWith("private_") || !t || t.joinedRooms.has(n) || (t.joinedRooms.add(n),
|
|
920
|
+
n == null || String(n).startsWith("private_") || !t || t.joinedRooms.has(n) || (t.joinedRooms.add(n), h("CHAT_JOIN", { room_id: n }));
|
|
918
921
|
}), !0;
|
|
919
922
|
}
|
|
920
|
-
if (e.room_id || t === "CHAT_MESSAGE" ||
|
|
923
|
+
if (e.room_id || t === "CHAT_MESSAGE" || o === "CHAT_MESSAGE") return O(e), !0;
|
|
921
924
|
if (t === "CHAT_JOINED" || t === "CHAT_LEFT") return !0;
|
|
922
|
-
if (
|
|
923
|
-
if (
|
|
924
|
-
let t = sr([e.user ?? n?.user ??
|
|
925
|
-
return t && (
|
|
925
|
+
if (s === "SEARCH_RESULTS") return i().receiveUserSearch(e), !0;
|
|
926
|
+
if (s === "USER_ONLINE") {
|
|
927
|
+
let t = sr([e.user ?? n?.user ?? a?.user])[0];
|
|
928
|
+
return t && (_?.search.active === "" && _.search.deltas.set(t.user_id, t), r((e) => ({
|
|
926
929
|
onlineUsers: [...e.onlineUsers.filter((e) => e.user_id !== t.user_id), t],
|
|
927
930
|
knownUsers: cr(e.knownUsers, [t])
|
|
928
931
|
}))), !0;
|
|
929
932
|
}
|
|
930
|
-
if (
|
|
931
|
-
let t = e.user_id ?? n?.user_id ??
|
|
933
|
+
if (s === "USER_OFFLINE") {
|
|
934
|
+
let t = e.user_id ?? n?.user_id ?? a?.user_id;
|
|
932
935
|
if (t != null) {
|
|
933
936
|
let e = String(t);
|
|
934
|
-
|
|
937
|
+
_?.search.active === "" && _.search.deltas.set(e, null), r((t) => ({ onlineUsers: t.onlineUsers.filter((t) => t.user_id !== e) }));
|
|
935
938
|
}
|
|
936
939
|
return !0;
|
|
937
940
|
}
|
|
938
|
-
if (
|
|
941
|
+
if (s === "MY_STATUS") {
|
|
939
942
|
let t = {
|
|
940
|
-
...n ??
|
|
943
|
+
...n ?? a ?? {},
|
|
941
944
|
...e
|
|
942
945
|
};
|
|
943
946
|
return r((e) => ({ myPresence: {
|
|
@@ -945,54 +948,54 @@ function dr({ transport: t, sendMessage: n, getOwnIds: r, onOpenChat: i, maxMess
|
|
|
945
948
|
manual: er.includes(t.manual) ? t.manual : e.myPresence.manual
|
|
946
949
|
} })), !0;
|
|
947
950
|
}
|
|
948
|
-
if (
|
|
951
|
+
if (s === "USER_STATUS") {
|
|
949
952
|
let t = {
|
|
950
|
-
...n ??
|
|
953
|
+
...n ?? a ?? {},
|
|
951
954
|
...e
|
|
952
955
|
};
|
|
953
956
|
if (t.user_id == null || !$n.includes(t.status)) return !0;
|
|
954
|
-
let
|
|
955
|
-
if (
|
|
956
|
-
let e =
|
|
957
|
-
t &&
|
|
957
|
+
let o = String(t.user_id), { status: s } = t;
|
|
958
|
+
if (_?.search.active === "") {
|
|
959
|
+
let e = _.search.deltas.get(o), t = e === void 0 ? i().onlineUsers.find((e) => e.user_id === o) : e;
|
|
960
|
+
t && _.search.deltas.set(o, {
|
|
958
961
|
...t,
|
|
959
|
-
status:
|
|
962
|
+
status: s
|
|
960
963
|
});
|
|
961
964
|
}
|
|
962
965
|
return r((e) => {
|
|
963
|
-
let t = e.knownUsers[
|
|
966
|
+
let t = e.knownUsers[o], n = e.onlineUsers.findIndex((e) => e.user_id === o);
|
|
964
967
|
return n === -1 && !t ? e : {
|
|
965
968
|
onlineUsers: n === -1 ? e.onlineUsers : e.onlineUsers.map((e, t) => t === n ? {
|
|
966
969
|
...e,
|
|
967
|
-
status:
|
|
970
|
+
status: s
|
|
968
971
|
} : e),
|
|
969
972
|
knownUsers: t ? {
|
|
970
973
|
...e.knownUsers,
|
|
971
|
-
[
|
|
974
|
+
[o]: {
|
|
972
975
|
...t,
|
|
973
|
-
status:
|
|
976
|
+
status: s
|
|
974
977
|
}
|
|
975
978
|
} : e.knownUsers
|
|
976
979
|
};
|
|
977
980
|
}), !0;
|
|
978
981
|
}
|
|
979
982
|
if (t === "PRIVATE_RESOLVED") {
|
|
980
|
-
let { room_id: e, recipient_user_id: t } = n ||
|
|
983
|
+
let { room_id: e, recipient_user_id: t } = n || a || {};
|
|
981
984
|
return e && t && (r((n) => ({ privateRooms: {
|
|
982
985
|
...n.privateRooms,
|
|
983
986
|
[t]: e
|
|
984
|
-
} })),
|
|
987
|
+
} })), i().selectChat(e, "private")), !0;
|
|
985
988
|
}
|
|
986
989
|
if (t === "PRIVATE_INVITED") {
|
|
987
|
-
let { room_id: e, from_user_id: t } = n ||
|
|
990
|
+
let { room_id: e, from_user_id: t } = n || a || {};
|
|
988
991
|
return e && t && r((n) => ({ privateRooms: {
|
|
989
992
|
...n.privateRooms,
|
|
990
993
|
[t]: e
|
|
991
994
|
} })), !0;
|
|
992
995
|
}
|
|
993
|
-
if (
|
|
994
|
-
let t = n ??
|
|
995
|
-
return
|
|
996
|
+
if (s === "ERROR") {
|
|
997
|
+
let t = n ?? a ?? {}, r = e.action ?? t.action;
|
|
998
|
+
return _ && (r === "SEARCH_USERS" || String(t.message ?? "").includes("SEARCH_USERS")) && (x(_.search), _.search.stale.length ? _.search.stale.shift() : S(_)), !1;
|
|
996
999
|
}
|
|
997
1000
|
return !1;
|
|
998
1001
|
}, A = null;
|
|
@@ -1001,54 +1004,54 @@ function dr({ transport: t, sendMessage: n, getOwnIds: r, onOpenChat: i, maxMess
|
|
|
1001
1004
|
attach: () => {
|
|
1002
1005
|
if (A) return A;
|
|
1003
1006
|
let e = t.onEvent(k), n = t.onStatus(D);
|
|
1004
|
-
return
|
|
1005
|
-
e?.(), n?.(),
|
|
1007
|
+
return m() && E(), A = () => {
|
|
1008
|
+
e?.(), n?.(), T(), A = null;
|
|
1006
1009
|
}, A;
|
|
1007
1010
|
},
|
|
1008
1011
|
handleFrame: k,
|
|
1009
1012
|
reset: () => {
|
|
1010
|
-
|
|
1013
|
+
i().resetUserSearch(), T(), m() && E(), Kn(), i().chatMessages.forEach(lr), r(or()), l.getState().reset();
|
|
1011
1014
|
},
|
|
1012
1015
|
setUserSearchQuery: (e) => {
|
|
1013
1016
|
let t = String(e ?? "").trim().toLowerCase();
|
|
1014
|
-
t !==
|
|
1017
|
+
t !== i().userSearchQuery && (_ && (_.search.queue = _.search.queue.filter((e) => e === "")), r({
|
|
1015
1018
|
userSearchQuery: t,
|
|
1016
1019
|
userSearchResults: [],
|
|
1017
1020
|
userSearchStatus: t ? "loading" : "idle"
|
|
1018
1021
|
}));
|
|
1019
1022
|
},
|
|
1020
1023
|
searchUsers: (e = "") => {
|
|
1021
|
-
let t =
|
|
1022
|
-
if (!
|
|
1024
|
+
let t = _;
|
|
1025
|
+
if (!y(t)) return;
|
|
1023
1026
|
let n = String(e).trim().toLowerCase();
|
|
1024
|
-
if (n && n !==
|
|
1027
|
+
if (n && n !== i().userSearchQuery) return;
|
|
1025
1028
|
let r = t.search;
|
|
1026
|
-
r.active === n || r.queue.includes(n) || !n && Date.now() - r.lastPresence < 500 || (n && (r.queue = r.queue.filter((e) => e === "")), r.queue.push(n),
|
|
1029
|
+
r.active === n || r.queue.includes(n) || !n && Date.now() - r.lastPresence < 500 || (n && (r.queue = r.queue.filter((e) => e === "")), r.queue.push(n), C(t));
|
|
1027
1030
|
},
|
|
1028
1031
|
receiveUserSearch: (e) => {
|
|
1029
|
-
let t =
|
|
1032
|
+
let t = _;
|
|
1030
1033
|
if (!t) return;
|
|
1031
|
-
let n = t.search,
|
|
1032
|
-
...
|
|
1034
|
+
let n = t.search, a = e.data ?? e.payload, o = a && typeof a == "object" ? {
|
|
1035
|
+
...a,
|
|
1033
1036
|
...e
|
|
1034
|
-
} : e,
|
|
1035
|
-
if (
|
|
1036
|
-
if (!
|
|
1037
|
+
} : e, s = o.is_full_list === !0 ? "presence" : o.is_full_list === !1 ? "text" : null, c = (e) => e === "" ? "presence" : "text";
|
|
1038
|
+
if (x(n), n.stale.length) {
|
|
1039
|
+
if (!s || c(n.stale[0].query) === s) {
|
|
1037
1040
|
n.stale.shift();
|
|
1038
1041
|
return;
|
|
1039
1042
|
}
|
|
1040
|
-
if (n.active === null ||
|
|
1043
|
+
if (n.active === null || c(n.active) !== s) return;
|
|
1041
1044
|
n.stale = [];
|
|
1042
1045
|
}
|
|
1043
|
-
let
|
|
1044
|
-
if (
|
|
1045
|
-
if (clearTimeout(n.timer), n.timer = null, n.active = null, !Array.isArray(
|
|
1046
|
-
r(
|
|
1046
|
+
let l = n.active;
|
|
1047
|
+
if (l === null || s && c(l) !== s) return;
|
|
1048
|
+
if (clearTimeout(n.timer), n.timer = null, n.active = null, !Array.isArray(o.users)) {
|
|
1049
|
+
r(l ? { userSearchStatus: "error" } : { presenceStatus: "error" }), C(t);
|
|
1047
1050
|
return;
|
|
1048
1051
|
}
|
|
1049
|
-
let
|
|
1050
|
-
if (
|
|
1051
|
-
let e = new Map(
|
|
1052
|
+
let u = sr(o.users);
|
|
1053
|
+
if (l === "") {
|
|
1054
|
+
let e = new Map(u.map((e) => [e.user_id, e]));
|
|
1052
1055
|
for (let [t, r] of n.deltas) r ? e.set(t, r) : e.delete(t);
|
|
1053
1056
|
let t = [...e.values()];
|
|
1054
1057
|
n.lastPresence = Date.now(), r((e) => ({
|
|
@@ -1056,15 +1059,15 @@ function dr({ transport: t, sendMessage: n, getOwnIds: r, onOpenChat: i, maxMess
|
|
|
1056
1059
|
presenceStatus: "ready",
|
|
1057
1060
|
knownUsers: cr(e.knownUsers, t)
|
|
1058
1061
|
}));
|
|
1059
|
-
} else
|
|
1060
|
-
userSearchResults:
|
|
1062
|
+
} else l === i().userSearchQuery && r((e) => ({
|
|
1063
|
+
userSearchResults: u,
|
|
1061
1064
|
userSearchStatus: "ready",
|
|
1062
|
-
knownUsers: cr(e.knownUsers,
|
|
1065
|
+
knownUsers: cr(e.knownUsers, u)
|
|
1063
1066
|
}));
|
|
1064
|
-
n.deltas.clear(),
|
|
1067
|
+
n.deltas.clear(), C(t);
|
|
1065
1068
|
},
|
|
1066
1069
|
resetUserSearch: () => {
|
|
1067
|
-
|
|
1070
|
+
_ && (clearTimeout(_.search.timer), _.search = v(_.id).search), r({
|
|
1068
1071
|
onlineUsers: [],
|
|
1069
1072
|
presenceStatus: "idle",
|
|
1070
1073
|
userSearchResults: [],
|
|
@@ -1072,15 +1075,15 @@ function dr({ transport: t, sendMessage: n, getOwnIds: r, onOpenChat: i, maxMess
|
|
|
1072
1075
|
userSearchStatus: "idle"
|
|
1073
1076
|
});
|
|
1074
1077
|
},
|
|
1075
|
-
setMyPresence: (e) => !er.includes(e) || !
|
|
1078
|
+
setMyPresence: (e) => !er.includes(e) || !h("SET_STATUS", { status: e }) ? !1 : (r((t) => ({ myPresence: {
|
|
1076
1079
|
...t.myPresence,
|
|
1077
1080
|
manual: e
|
|
1078
1081
|
} })), !0),
|
|
1079
1082
|
joinChat: (e) => {
|
|
1080
|
-
|
|
1083
|
+
h("CHAT_JOIN", { room_id: e });
|
|
1081
1084
|
},
|
|
1082
1085
|
leaveChat: (e) => {
|
|
1083
|
-
|
|
1086
|
+
h("CHAT_LEAVE", { room_id: e });
|
|
1084
1087
|
},
|
|
1085
1088
|
sendChatMessage: (e, r, i = []) => n ? n(e, r, i) : i.length ? Promise.reject(/* @__PURE__ */ Error("Este transporte no admite adjuntos.")) : t.request("CHAT_MESSAGE", {
|
|
1086
1089
|
room_id: e,
|
|
@@ -1099,28 +1102,28 @@ function dr({ transport: t, sendMessage: n, getOwnIds: r, onOpenChat: i, maxMess
|
|
|
1099
1102
|
}
|
|
1100
1103
|
} })),
|
|
1101
1104
|
searchOnlineUsers: (e) => {
|
|
1102
|
-
|
|
1105
|
+
i().setUserSearchQuery(e), i().searchUsers(e);
|
|
1103
1106
|
},
|
|
1104
1107
|
createGroup: (e) => {
|
|
1105
|
-
|
|
1108
|
+
h("CREATE_GROUP", { name: e });
|
|
1106
1109
|
},
|
|
1107
1110
|
fetchGroups: () => {
|
|
1108
|
-
|
|
1111
|
+
h("FETCH_GROUPS");
|
|
1109
1112
|
},
|
|
1110
1113
|
openPrivateChat: (e) => {
|
|
1111
|
-
|
|
1114
|
+
h("OPEN_PRIVATE", { recipient_user_id: e });
|
|
1112
1115
|
}
|
|
1113
1116
|
};
|
|
1114
1117
|
});
|
|
1115
1118
|
}
|
|
1116
1119
|
// src/provider/hooks.js
|
|
1117
|
-
var fr = () => {}, pr = "idle", mr = () =>
|
|
1120
|
+
var fr = () => {}, pr = "idle", mr = () => v().config, hr = () => v().transport ?? null, gr = (e) => e;
|
|
1118
1121
|
function _r(e = gr) {
|
|
1119
|
-
let { chatStore: t } =
|
|
1122
|
+
let { chatStore: t } = v();
|
|
1120
1123
|
if (!t) throw Error("LiraChatProvider sin chatStore: pasa `transport` o `chatStore`");
|
|
1121
1124
|
return de(t, e);
|
|
1122
1125
|
}
|
|
1123
|
-
var vr = () =>
|
|
1126
|
+
var vr = () => v().chatStore ?? null, yr = (e) => {
|
|
1124
1127
|
let t = e?.getStatus?.();
|
|
1125
1128
|
return t && typeof t == "object" ? t.status ?? pr : t ?? pr;
|
|
1126
1129
|
}, br = (e) => {
|
|
@@ -1128,7 +1131,7 @@ var vr = () => C().chatStore ?? null, yr = (e) => {
|
|
|
1128
1131
|
return t && typeof t == "object" && "connectionId" in t ? t.connectionId ?? null : typeof e?.getConnectionId == "function" ? e.getConnectionId() ?? null : e?.connectionId ?? null;
|
|
1129
1132
|
};
|
|
1130
1133
|
function xr() {
|
|
1131
|
-
let e = hr(), t =
|
|
1134
|
+
let e = hr(), t = B((t) => {
|
|
1132
1135
|
if (!e?.onStatus) return fr;
|
|
1133
1136
|
let n = e.onStatus(t);
|
|
1134
1137
|
return typeof n == "function" ? n : fr;
|
|
@@ -1145,11 +1148,11 @@ var Sr = (e) => {
|
|
|
1145
1148
|
return t;
|
|
1146
1149
|
};
|
|
1147
1150
|
function Cr() {
|
|
1148
|
-
let e =
|
|
1151
|
+
let e = v().stores?.unread, t = !!(e && typeof e.getState == "function" && typeof e.subscribe == "function"), n = B((n) => t ? e.subscribe(n) : fr, [e, t]), r = () => t ? Sr(e.getState()?.counts) : 0;
|
|
1149
1152
|
return K(n, r, r);
|
|
1150
1153
|
}
|
|
1151
1154
|
function wr() {
|
|
1152
|
-
let { config: e, transport: t } =
|
|
1155
|
+
let { config: e, transport: t } = v(), { status: n } = xr(), r = t?.getIdentity?.() ?? null, i = e?.user ?? null, a = r?.userId ?? i?.id ?? null, o = r?.scope || e?.scope || (a == null ? "" : String(a)), s = (i?.ids ?? []).join("|"), c = U(() => {
|
|
1153
1156
|
let e = [...s ? s.split("|") : []];
|
|
1154
1157
|
return a != null && !e.includes(String(a)) && e.unshift(String(a)), e;
|
|
1155
1158
|
}, [s, a]);
|
|
@@ -1249,7 +1252,7 @@ var Tr = 7e3, Er = Object.freeze([
|
|
|
1249
1252
|
id: "nudge",
|
|
1250
1253
|
label: "Zumbido",
|
|
1251
1254
|
emoji: "⚡",
|
|
1252
|
-
durationMs:
|
|
1255
|
+
durationMs: T,
|
|
1253
1256
|
description: "Una tormenta eléctrica con rayos, chispas y trueno."
|
|
1254
1257
|
},
|
|
1255
1258
|
{
|
|
@@ -1296,18 +1299,18 @@ var jr = /* @__PURE__ */ new Map([
|
|
|
1296
1299
|
function Mr(e, { volume: t = .4, onBlocked: n, onPlaying: r } = {}) {
|
|
1297
1300
|
let i = jr.get(e);
|
|
1298
1301
|
if (!i) return () => {};
|
|
1299
|
-
let a, o = !1,
|
|
1300
|
-
!o && !
|
|
1302
|
+
let a, o = !1, c = !1, l = () => {
|
|
1303
|
+
!o && !c && (c = !0, n?.());
|
|
1301
1304
|
}, u = () => {
|
|
1302
1305
|
o || r?.(a);
|
|
1303
1306
|
};
|
|
1304
1307
|
try {
|
|
1305
|
-
a = new Audio(
|
|
1308
|
+
a = new Audio(s(`effects/${i.file}`)), a.volume = Math.max(0, Math.min(1, (Number(t) || 0) * (i.level ?? 1))), a.preload = "auto", a.addEventListener("error", l), a.addEventListener("playing", u), a.play()?.catch(l);
|
|
1306
1309
|
} catch {
|
|
1307
|
-
|
|
1310
|
+
l();
|
|
1308
1311
|
}
|
|
1309
1312
|
return () => {
|
|
1310
|
-
o || (o = !0, a && (a.removeEventListener("error",
|
|
1313
|
+
o || (o = !0, a && (a.removeEventListener("error", l), a.removeEventListener("playing", u), a.pause(), a.removeAttribute("src"), a.load()));
|
|
1311
1314
|
};
|
|
1312
1315
|
}
|
|
1313
1316
|
// src/effects/thunder/thunderScene2d.js
|
|
@@ -1360,7 +1363,7 @@ function Fr(e) {
|
|
|
1360
1363
|
a.splice(n, 1);
|
|
1361
1364
|
continue;
|
|
1362
1365
|
}
|
|
1363
|
-
let i =
|
|
1366
|
+
let i = C(r.age);
|
|
1364
1367
|
[[r.main, 1], ...r.branches.map((e) => [e, .45])].forEach(([e, n]) => {
|
|
1365
1368
|
s(e), t.shadowColor = "#8fb4ff", t.shadowBlur = 24, t.strokeStyle = `rgba(127,168,255,${.45 * i})`, t.lineWidth = 9 * n * (.6 + r.power), t.stroke(), t.shadowBlur = 0, t.strokeStyle = `rgba(255,255,255,${i})`, t.lineWidth = 2.2 * n * (.6 + r.power), t.stroke();
|
|
1366
1369
|
});
|
|
@@ -1434,7 +1437,7 @@ function Rr({ clockRef: e, targetRef: t, waitForAudio: n = !0 }) {
|
|
|
1434
1437
|
let t = Math.min(.05, (e - m) / 1e3);
|
|
1435
1438
|
m = e;
|
|
1436
1439
|
let n = v();
|
|
1437
|
-
for (; p <
|
|
1440
|
+
for (; p < w.length && n >= w[p].at;) y(w[p++]);
|
|
1438
1441
|
try {
|
|
1439
1442
|
l?.render(t);
|
|
1440
1443
|
} catch {
|
|
@@ -1797,7 +1800,7 @@ function Zr({ clockRef: e, waitForAudio: t = !0 }) {
|
|
|
1797
1800
|
}, y = (e) => {
|
|
1798
1801
|
e && (c.add(e), e.onfinish = () => c.delete(e));
|
|
1799
1802
|
};
|
|
1800
|
-
import("./chunks/avalancheScene3d-
|
|
1803
|
+
import("./chunks/avalancheScene3d-Z5QyZIid.js").then(({ createAvalancheScene: e }) => {
|
|
1801
1804
|
d || (u = document.createElement("canvas"), u.className = "lira-avalanche-canvas", u.addEventListener("webglcontextlost", v), i.prepend(u), l = e(u), l.resize(i.clientWidth || 1, i.clientHeight || 1));
|
|
1802
1805
|
}).catch(_);
|
|
1803
1806
|
let b = (e) => {
|
|
@@ -2167,7 +2170,7 @@ function bi(e, t, n) {
|
|
|
2167
2170
|
return r ? Date.now() - r.sentAt > n ? (pi.delete(e), null) : r.room === t ? (pi.delete(e), r.stop?.(), r) : null : null;
|
|
2168
2171
|
}
|
|
2169
2172
|
// src/effects/ChatEffects.jsx
|
|
2170
|
-
var xi =
|
|
2173
|
+
var xi = oe(null), Si = (e) => (document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e)), Ci = () => document.visibilityState === "visible";
|
|
2171
2174
|
function wi(e, t) {
|
|
2172
2175
|
try {
|
|
2173
2176
|
let n = `minicode-effects-seen:${e}`, r = JSON.parse(localStorage.getItem(n) || "[]"), i = Array.isArray(r) ? r.filter((e) => Array.isArray(e) && Date.now() - e[1] < 6e4).slice(-100) : [];
|
|
@@ -2177,12 +2180,12 @@ function wi(e, t) {
|
|
|
2177
2180
|
return !0;
|
|
2178
2181
|
}
|
|
2179
2182
|
function Ti({ children: e, roomId: t, scope: n, identityScope: r = n, messages: i = [], currentUserIds: a = [], config: o = {}, visible: s = !0, targetRef: c }) {
|
|
2180
|
-
let l = K(
|
|
2183
|
+
let l = K(y, _, () => !1), u = K(Si, Ci, () => !1), [d, f] = G(null), [p, m] = G(o.sound !== !1), [h, g] = G(o.autoPlay !== !1), v = W({
|
|
2181
2184
|
room: null,
|
|
2182
2185
|
seen: /* @__PURE__ */ new Set(),
|
|
2183
2186
|
since: Date.now()
|
|
2184
|
-
}),
|
|
2185
|
-
o.enabled === !1 ||
|
|
2187
|
+
}), b = W(!1), x = W(/* @__PURE__ */ new Map()), S = (e, { replace: t = !1, sound: n = !0 } = {}) => {
|
|
2188
|
+
o.enabled === !1 || b.current && !t || !kr.some((t) => t.id === e) || (b.current = !0, f({
|
|
2186
2189
|
effectId: e,
|
|
2187
2190
|
key: Date.now(),
|
|
2188
2191
|
sound: n
|
|
@@ -2191,20 +2194,20 @@ function Ti({ children: e, roomId: t, scope: n, identityScope: r = n, messages:
|
|
|
2191
2194
|
return H(() => {
|
|
2192
2195
|
m(o.sound !== !1), g(o.autoPlay !== !1);
|
|
2193
2196
|
}, [o.sound, o.autoPlay]), H(() => {
|
|
2194
|
-
let e = `${n}:${t}`, c =
|
|
2195
|
-
c && (
|
|
2197
|
+
let e = `${n}:${t}`, c = v.current.room !== e;
|
|
2198
|
+
c && (v.current = {
|
|
2196
2199
|
room: e,
|
|
2197
2200
|
seen: /* @__PURE__ */ new Set(),
|
|
2198
2201
|
since: Date.now()
|
|
2199
|
-
},
|
|
2202
|
+
}, b.current = !1, f(null));
|
|
2200
2203
|
for (let t of i) {
|
|
2201
2204
|
let n = li(t.message ?? t.text);
|
|
2202
|
-
if (!n || n.endsAt ||
|
|
2203
|
-
|
|
2205
|
+
if (!n || n.endsAt || v.current.seen.has(n.id)) continue;
|
|
2206
|
+
v.current.seen.add(n.id);
|
|
2204
2207
|
let i = Date.now() - n.sentAt;
|
|
2205
|
-
!c && h && s && document.visibilityState === "visible" && !a.includes(String(t.user_id)) && !t.localOnly && !t.history && !t.is_history && !t.replay && !t.optimistic && t.user_id != null && n.sentAt >=
|
|
2208
|
+
!c && h && s && document.visibilityState === "visible" && !a.includes(String(t.user_id)) && !t.localOnly && !t.history && !t.is_history && !t.replay && !t.optimistic && t.user_id != null && n.sentAt >= v.current.since && i >= 0 && i <= (o.maxAgeMs ?? 1e4) && Date.now() - (x.current.get(e) ?? 0) >= (o.cooldownMs ?? 5e3) && wi(r, n.id) && (x.current.set(e, Date.now()), S(n.effectId, { replace: !0 }));
|
|
2206
2209
|
}
|
|
2207
|
-
|
|
2210
|
+
v.current.seen.size > 5e3 && (v.current.seen = new Set([...v.current.seen].slice(-2500)));
|
|
2208
2211
|
}, [
|
|
2209
2212
|
i,
|
|
2210
2213
|
t,
|
|
@@ -2217,7 +2220,7 @@ function Ti({ children: e, roomId: t, scope: n, identityScope: r = n, messages:
|
|
|
2217
2220
|
r,
|
|
2218
2221
|
a
|
|
2219
2222
|
]), H(() => {
|
|
2220
|
-
s && o.enabled !== !1 || (
|
|
2223
|
+
s && o.enabled !== !1 || (b.current = !1, f(null));
|
|
2221
2224
|
}, [s, o.enabled]), H(() => {
|
|
2222
2225
|
_i(r, {
|
|
2223
2226
|
sound: p,
|
|
@@ -2230,7 +2233,7 @@ function Ti({ children: e, roomId: t, scope: n, identityScope: r = n, messages:
|
|
|
2230
2233
|
]), H(() => {
|
|
2231
2234
|
if (!s || !u || o.enabled === !1 || t == null) return;
|
|
2232
2235
|
let e = hi(r, String(t)), n = bi(r, String(t), o.maxAgeMs ?? 1e4);
|
|
2233
|
-
return n && h &&
|
|
2236
|
+
return n && h && S(n.effectId, { replace: !0 }), e;
|
|
2234
2237
|
}, [
|
|
2235
2238
|
s,
|
|
2236
2239
|
u,
|
|
@@ -2245,7 +2248,7 @@ function Ti({ children: e, roomId: t, scope: n, identityScope: r = n, messages:
|
|
|
2245
2248
|
!i?.endsAt || i.endsAt <= Date.now() || a.localOnly || a.optimistic || e.push(setTimeout(() => {
|
|
2246
2249
|
if (document.visibilityState !== "visible" || Date.now() - i.endsAt > 1500) return;
|
|
2247
2250
|
let e = `${n}:${t}`;
|
|
2248
|
-
Date.now() - (
|
|
2251
|
+
Date.now() - (x.current.get(e) ?? 0) < (o.cooldownMs ?? 5e3) || wi(r, `countdown-${i.id}`) && (x.current.set(e, Date.now()), S(i.effectId, {
|
|
2249
2252
|
replace: !0,
|
|
2250
2253
|
sound: i.sound
|
|
2251
2254
|
}));
|
|
@@ -2264,7 +2267,7 @@ function Ti({ children: e, roomId: t, scope: n, identityScope: r = n, messages:
|
|
|
2264
2267
|
o.cooldownMs
|
|
2265
2268
|
]), /* @__PURE__ */ $(xi.Provider, {
|
|
2266
2269
|
value: o.enabled === !1 ? null : {
|
|
2267
|
-
play:
|
|
2270
|
+
play: S,
|
|
2268
2271
|
sound: p,
|
|
2269
2272
|
setSound: (e) => {
|
|
2270
2273
|
m(e), o.onPreferencesChange?.({ sound: e });
|
|
@@ -2281,7 +2284,7 @@ function Ti({ children: e, roomId: t, scope: n, identityScope: r = n, messages:
|
|
|
2281
2284
|
volume: o.volume ?? .35,
|
|
2282
2285
|
targetRef: c,
|
|
2283
2286
|
onClose: () => {
|
|
2284
|
-
|
|
2287
|
+
b.current = !1, f(null);
|
|
2285
2288
|
}
|
|
2286
2289
|
}, d.key)]
|
|
2287
2290
|
});
|
|
@@ -2322,7 +2325,7 @@ function Ei({ effect: e, item: t, context: n }) {
|
|
|
2322
2325
|
});
|
|
2323
2326
|
}
|
|
2324
2327
|
function Di({ effect: e }) {
|
|
2325
|
-
let t =
|
|
2328
|
+
let t = V(xi), n = kr.find((t) => t.id === e.effectId);
|
|
2326
2329
|
return e.endsAt ? /* @__PURE__ */ Q(Ei, {
|
|
2327
2330
|
effect: e,
|
|
2328
2331
|
item: n,
|
|
@@ -2347,7 +2350,7 @@ function Di({ effect: e }) {
|
|
|
2347
2350
|
});
|
|
2348
2351
|
}
|
|
2349
2352
|
function Oi({ onSend: e, disabled: t, onClose: n }) {
|
|
2350
|
-
let r =
|
|
2353
|
+
let r = V(xi), [i, a] = G(!1), [o, s] = G("300"), [c, l] = G(!1), [u, d] = G("5"), [f, p] = G(60), [m, h] = G("pig-disco"), [g, _] = G(!0), [v, y] = G(null), [b, x] = G(null), S = W(!1), C = W(!0), w = W(null), T = W(r);
|
|
2351
2354
|
T.current = r, H(() => {
|
|
2352
2355
|
x(null);
|
|
2353
2356
|
}, [r?.sessionKey]), H(() => {
|
|
@@ -2645,7 +2648,7 @@ function Oi({ onSend: e, disabled: t, onClose: n }) {
|
|
|
2645
2648
|
// src/effects/BackgroundEffects.jsx
|
|
2646
2649
|
var ki = 300, Ai = (e, t) => e[t] ?? e.data?.[t] ?? e.payload?.[t];
|
|
2647
2650
|
function ji() {
|
|
2648
|
-
let { config: e, chatStore: t } =
|
|
2651
|
+
let { config: e, chatStore: t } = v(), n = wr(), r = W({
|
|
2649
2652
|
config: e,
|
|
2650
2653
|
identity: n
|
|
2651
2654
|
});
|
|
@@ -2666,7 +2669,7 @@ function ji() {
|
|
|
2666
2669
|
let d = setTimeout(() => {
|
|
2667
2670
|
i.delete(d);
|
|
2668
2671
|
let e = vi(o);
|
|
2669
|
-
if (gi(o, l) || e.sound === !1 || e.auto === !1 || !
|
|
2672
|
+
if (gi(o, l) || e.sound === !1 || e.auto === !1 || !_() || !wi(o, a.id)) return;
|
|
2670
2673
|
n.set(l, Date.now());
|
|
2671
2674
|
let r = Mr(a.effectId, { volume: t.volume ?? .35 });
|
|
2672
2675
|
yi(o, {
|
|
@@ -2727,7 +2730,7 @@ function Mi({ config: e, transport: t, stores: n, chatStore: r, children: i }) {
|
|
|
2727
2730
|
u,
|
|
2728
2731
|
n
|
|
2729
2732
|
]);
|
|
2730
|
-
return /* @__PURE__ */ $(
|
|
2733
|
+
return /* @__PURE__ */ $(S.Provider, {
|
|
2731
2734
|
value: f,
|
|
2732
2735
|
children: [i, u && /* @__PURE__ */ Q(ji, {})]
|
|
2733
2736
|
});
|
|
@@ -2934,7 +2937,7 @@ function _a(e, { active: t = !1, autoFocus: n = !1 } = {}) {
|
|
|
2934
2937
|
return e.current?.querySelector("button, input, textarea")?.focus(), () => {
|
|
2935
2938
|
t?.isConnected && t.focus();
|
|
2936
2939
|
};
|
|
2937
|
-
}, [n, e]),
|
|
2940
|
+
}, [n, e]), B((n) => {
|
|
2938
2941
|
if (!t || n.key !== "Tab" || !e.current) return;
|
|
2939
2942
|
let r = [...e.current.querySelectorAll(ga)].filter((e) => e.getClientRects().length), i = r[0], a = r[r.length - 1];
|
|
2940
2943
|
i ? n.shiftKey && document.activeElement === i ? (n.preventDefault(), a.focus()) : !n.shiftKey && document.activeElement === a && (n.preventDefault(), i.focus()) : n.preventDefault();
|
|
@@ -3000,24 +3003,24 @@ var Sa = {
|
|
|
3000
3003
|
busy: "Ocupado"
|
|
3001
3004
|
};
|
|
3002
3005
|
function Ca({ onDetach: e, onInstall: t, textSize: n, onTextSizeChange: r, title: i, subtitle: a, type: o = "group", secondary: s, presence: c, onClose: l, onMinimize: u, onMaximize: d, onRestore: f, isMaximized: p, onToggleSidebar: m, showSidebar: h }) {
|
|
3003
|
-
let g = o === "private",
|
|
3006
|
+
let g = o === "private", v = [c ? Sa[c] || Sa.online : "Desconectado", s].filter(Boolean).join(" · "), y = W(null);
|
|
3004
3007
|
H(() => {
|
|
3005
3008
|
let e = (e) => {
|
|
3006
|
-
|
|
3009
|
+
y.current?.contains(e.target) || y.current?.removeAttribute("open");
|
|
3007
3010
|
};
|
|
3008
3011
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
3009
3012
|
}, []);
|
|
3010
|
-
let [
|
|
3013
|
+
let [b, S] = G(zn);
|
|
3011
3014
|
H(() => {
|
|
3012
|
-
let e = () =>
|
|
3015
|
+
let e = () => S(zn());
|
|
3013
3016
|
return window.addEventListener("storage", e), window.addEventListener("lira-desktop-settings", e), window.addEventListener("focus", e), () => {
|
|
3014
3017
|
window.removeEventListener("storage", e), window.removeEventListener("lira-desktop-settings", e), window.removeEventListener("focus", e);
|
|
3015
3018
|
};
|
|
3016
3019
|
}, []);
|
|
3017
|
-
let [
|
|
3020
|
+
let [C, w] = G(() => _());
|
|
3018
3021
|
return H(() => {
|
|
3019
3022
|
let e = (e) => {
|
|
3020
|
-
e.key === "lira-chat-sound" &&
|
|
3023
|
+
e.key === "lira-chat-sound" && w(e.newValue !== "false");
|
|
3021
3024
|
};
|
|
3022
3025
|
return window.addEventListener("storage", e), () => window.removeEventListener("storage", e);
|
|
3023
3026
|
}, []), /* @__PURE__ */ $("div", {
|
|
@@ -3047,8 +3050,8 @@ function Ca({ onDetach: e, onInstall: t, textSize: n, onTextSizeChange: r, title
|
|
|
3047
3050
|
children: i
|
|
3048
3051
|
}), g ? /* @__PURE__ */ Q("div", {
|
|
3049
3052
|
className: "chat-header-subtitle",
|
|
3050
|
-
title:
|
|
3051
|
-
children:
|
|
3053
|
+
title: v,
|
|
3054
|
+
children: v
|
|
3052
3055
|
}) : /* @__PURE__ */ Q("div", {
|
|
3053
3056
|
className: "chat-header-subtitle",
|
|
3054
3057
|
children: a === "connected" ? "En línea · tu espacio para conectar" : "Tu espacio para conectar"
|
|
@@ -3059,15 +3062,15 @@ function Ca({ onDetach: e, onInstall: t, textSize: n, onTextSizeChange: r, title
|
|
|
3059
3062
|
className: "chat-header-actions",
|
|
3060
3063
|
children: [
|
|
3061
3064
|
/* @__PURE__ */ $("details", {
|
|
3062
|
-
ref:
|
|
3065
|
+
ref: y,
|
|
3063
3066
|
className: "chat-text-settings chat-notification-settings",
|
|
3064
3067
|
onKeyDown: (e) => {
|
|
3065
|
-
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(),
|
|
3068
|
+
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), y.current?.removeAttribute("open"), y.current?.querySelector("summary")?.focus());
|
|
3066
3069
|
},
|
|
3067
3070
|
children: [/* @__PURE__ */ Q("summary", {
|
|
3068
3071
|
"aria-label": "Notificaciones de escritorio",
|
|
3069
3072
|
title: "Notificaciones de escritorio",
|
|
3070
|
-
children:
|
|
3073
|
+
children: b.enabled && b.permission === "granted" ? /* @__PURE__ */ Q(X, { size: 16 }) : /* @__PURE__ */ Q(he, { size: 16 })
|
|
3071
3074
|
}), /* @__PURE__ */ $("div", {
|
|
3072
3075
|
className: "chat-notification-panel",
|
|
3073
3076
|
role: "group",
|
|
@@ -3083,26 +3086,26 @@ function Ca({ onDetach: e, onInstall: t, textSize: n, onTextSizeChange: r, title
|
|
|
3083
3086
|
}),
|
|
3084
3087
|
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("strong", { children: "Notificaciones" }), /* @__PURE__ */ Q("span", { children: "Recibe avisos en tu escritorio" })] }),
|
|
3085
3088
|
/* @__PURE__ */ Q("span", {
|
|
3086
|
-
className: `chat-notification-status ${
|
|
3087
|
-
children:
|
|
3089
|
+
className: `chat-notification-status ${b.enabled && b.permission === "granted" ? "is-enabled" : ""}`,
|
|
3090
|
+
children: b.enabled && b.permission === "granted" ? "Activas" : "Inactivas"
|
|
3088
3091
|
})
|
|
3089
3092
|
]
|
|
3090
3093
|
}),
|
|
3091
3094
|
/* @__PURE__ */ $("button", {
|
|
3092
3095
|
type: "button",
|
|
3093
3096
|
className: "chat-notification-toggle",
|
|
3094
|
-
disabled: !
|
|
3095
|
-
"aria-pressed":
|
|
3097
|
+
disabled: !b.supported || b.permission === "denied",
|
|
3098
|
+
"aria-pressed": b.enabled && b.permission === "granted",
|
|
3096
3099
|
onClick: () => {
|
|
3097
|
-
Vn().then(() =>
|
|
3100
|
+
Vn().then(() => S(zn()));
|
|
3098
3101
|
},
|
|
3099
|
-
children: [
|
|
3102
|
+
children: [b.enabled && b.permission === "granted" ? /* @__PURE__ */ Q(he, {
|
|
3100
3103
|
size: 16,
|
|
3101
3104
|
"aria-hidden": "true"
|
|
3102
3105
|
}) : /* @__PURE__ */ Q(X, {
|
|
3103
3106
|
size: 16,
|
|
3104
3107
|
"aria-hidden": "true"
|
|
3105
|
-
}),
|
|
3108
|
+
}), b.enabled && b.permission === "granted" ? "Desactivar notificaciones" : "Activar notificaciones"]
|
|
3106
3109
|
}),
|
|
3107
3110
|
/* @__PURE__ */ $("label", {
|
|
3108
3111
|
className: "chat-notification-preview",
|
|
@@ -3112,14 +3115,14 @@ function Ca({ onDetach: e, onInstall: t, textSize: n, onTextSizeChange: r, title
|
|
|
3112
3115
|
}), /* @__PURE__ */ Q("input", {
|
|
3113
3116
|
type: "checkbox",
|
|
3114
3117
|
role: "switch",
|
|
3115
|
-
checked:
|
|
3118
|
+
checked: b.previews,
|
|
3116
3119
|
onChange: (e) => Bn(e.target.checked)
|
|
3117
3120
|
})]
|
|
3118
3121
|
}),
|
|
3119
|
-
(!
|
|
3122
|
+
(!b.supported || b.permission === "denied") && /* @__PURE__ */ Q("p", {
|
|
3120
3123
|
className: "chat-notification-notice",
|
|
3121
3124
|
role: "status",
|
|
3122
|
-
children:
|
|
3125
|
+
children: b.supported ? "Permiso bloqueado. Actívalo en los ajustes del navegador." : "Notificaciones no disponibles en este navegador."
|
|
3123
3126
|
})
|
|
3124
3127
|
]
|
|
3125
3128
|
})]
|
|
@@ -3173,13 +3176,13 @@ function Ca({ onDetach: e, onInstall: t, textSize: n, onTextSizeChange: r, title
|
|
|
3173
3176
|
type: "button",
|
|
3174
3177
|
className: "chat-btn",
|
|
3175
3178
|
onClick: () => {
|
|
3176
|
-
let e =
|
|
3177
|
-
|
|
3179
|
+
let e = x();
|
|
3180
|
+
w(e);
|
|
3178
3181
|
},
|
|
3179
|
-
"aria-label":
|
|
3180
|
-
"aria-pressed":
|
|
3181
|
-
title:
|
|
3182
|
-
children: Q(
|
|
3182
|
+
"aria-label": C ? "Silenciar sonidos" : "Activar sonidos",
|
|
3183
|
+
"aria-pressed": C,
|
|
3184
|
+
title: C ? "Silenciar sonidos" : "Activar sonidos",
|
|
3185
|
+
children: Q(C ? wt : Tt, { size: 16 })
|
|
3183
3186
|
}),
|
|
3184
3187
|
e && /* @__PURE__ */ Q("button", {
|
|
3185
3188
|
type: "button",
|
|
@@ -3463,7 +3466,7 @@ function Pa({ rooms: e = [], users: t = [], onlineUsers: n = [], privateRooms: r
|
|
|
3463
3466
|
selected: String(r[n]) === String(i) && i != null,
|
|
3464
3467
|
onSelect: () => o?.(e)
|
|
3465
3468
|
}, n);
|
|
3466
|
-
},
|
|
3469
|
+
}, ee = U(() => Na({
|
|
3467
3470
|
rooms: e,
|
|
3468
3471
|
privateRooms: r,
|
|
3469
3472
|
users: t,
|
|
@@ -3548,7 +3551,7 @@ function Pa({ rooms: e = [], users: t = [], onlineUsers: n = [], privateRooms: r
|
|
|
3548
3551
|
className: "chat-sidebar-content",
|
|
3549
3552
|
children: [
|
|
3550
3553
|
/* @__PURE__ */ Q(Ea, {
|
|
3551
|
-
conversations:
|
|
3554
|
+
conversations: ee.filter((e) => `${e.name || ""} ${e.secondary || ""}`.toLocaleLowerCase().includes(b.toLocaleLowerCase())),
|
|
3552
3555
|
onSelect: (e) => {
|
|
3553
3556
|
e.noRoom ? o?.({ user_id: e.id }) : a?.(e.id);
|
|
3554
3557
|
},
|
|
@@ -3635,7 +3638,7 @@ function Va(e, t) {
|
|
|
3635
3638
|
}
|
|
3636
3639
|
// src/media/emoji/useCustomEmojis.js
|
|
3637
3640
|
function Ha() {
|
|
3638
|
-
let e =
|
|
3641
|
+
let e = V(S)?.config?.media?.emoji?.custom;
|
|
3639
3642
|
return U(() => Ba(e ?? Ia), [e]);
|
|
3640
3643
|
}
|
|
3641
3644
|
// src/ui/components/MessageText.jsx
|
|
@@ -3925,7 +3928,7 @@ function to(e) {
|
|
|
3925
3928
|
}
|
|
3926
3929
|
// src/ui/components/YouTubePreview.jsx
|
|
3927
3930
|
function no({ text: e }) {
|
|
3928
|
-
let t =
|
|
3931
|
+
let t = V(S), n = U(() => to(e), [e]);
|
|
3929
3932
|
return !n || t?.config?.features === !1 || t?.config?.features?.youtube === !1 ? null : /* @__PURE__ */ $("div", {
|
|
3930
3933
|
className: "chat-youtube-preview",
|
|
3931
3934
|
children: [/* @__PURE__ */ Q("iframe", {
|
|
@@ -5018,7 +5021,7 @@ function ps(e, t) {
|
|
|
5018
5021
|
source: "unicode"
|
|
5019
5022
|
};
|
|
5020
5023
|
}
|
|
5021
|
-
var ms =
|
|
5024
|
+
var ms = z(function({ record: e, value: t, favorite: n, disabled: r, onPick: i, onToggleFavorite: a, onPreview: o }) {
|
|
5022
5025
|
let s = W(null), c = W(!1), l = () => {
|
|
5023
5026
|
s.current && (clearTimeout(s.current), s.current = null);
|
|
5024
5027
|
};
|
|
@@ -5099,7 +5102,7 @@ function hs({ id: e, title: t, items: n, lazy: r, rootRef: i, children: a, ...o
|
|
|
5099
5102
|
});
|
|
5100
5103
|
}
|
|
5101
5104
|
function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
5102
|
-
let i = Ha(), a = os((e) => e.recents), o = os((e) => e.favorites), s = os((e) => e.skinTone), c = os((e) => e.addRecent), l = os((e) => e.toggleFavorite), u = os((e) => e.setSkinTone), d = cs(), [f, p] = G(""), [m, h] = G(!1), [g, _] = G(null), [v, y] = G(null), b = W(null), x = W(null), S = W(0), C = U(() => new Set(o || []), [o]), w =
|
|
5105
|
+
let i = Ha(), a = os((e) => e.recents), o = os((e) => e.favorites), s = os((e) => e.skinTone), c = os((e) => e.addRecent), l = os((e) => e.toggleFavorite), u = os((e) => e.setSkinTone), d = cs(), [f, p] = G(""), [m, h] = G(!1), [g, _] = G(null), [v, y] = G(null), b = W(null), x = W(null), S = W(0), C = U(() => new Set(o || []), [o]), w = B((e) => e.source === "custom" ? e.emoji : Uo(e, s), [s]), T = f.trim(), E = U(() => {
|
|
5103
5106
|
let e = (e) => {
|
|
5104
5107
|
let t = /* @__PURE__ */ new Set();
|
|
5105
5108
|
return e.map((e) => ({
|
|
@@ -5156,12 +5159,12 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5156
5159
|
]), D = E.find((e) => e.items.length)?.items[0] || null, O = v || D && {
|
|
5157
5160
|
record: D.record,
|
|
5158
5161
|
value: D.value
|
|
5159
|
-
}, k =
|
|
5162
|
+
}, k = B((t) => {
|
|
5160
5163
|
e(t), c(t);
|
|
5161
|
-
}, [e, c]), A =
|
|
5164
|
+
}, [e, c]), A = B((e) => l(e.emoji), [l]), j = B((e, t) => y({
|
|
5162
5165
|
record: e,
|
|
5163
5166
|
value: t
|
|
5164
|
-
}), []), M =
|
|
5167
|
+
}), []), M = B(() => {
|
|
5165
5168
|
let e = b.current;
|
|
5166
5169
|
if (!e) return;
|
|
5167
5170
|
let t = [...e.querySelectorAll("[data-section]")], n = e.getBoundingClientRect().top, r = t[0]?.dataset.section || null;
|
|
@@ -5178,23 +5181,23 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5178
5181
|
]), H(() => {
|
|
5179
5182
|
t || (p(""), h(!1), y(null));
|
|
5180
5183
|
}, [t]);
|
|
5181
|
-
let
|
|
5184
|
+
let ee = (e) => {
|
|
5182
5185
|
let t = b.current, n = t?.querySelector(`[data-section="${e}"]`);
|
|
5183
5186
|
n && (t.scrollTo({
|
|
5184
5187
|
top: n.offsetTop - t.firstElementChild.offsetTop,
|
|
5185
5188
|
behavior: "auto"
|
|
5186
5189
|
}), _(e));
|
|
5187
|
-
},
|
|
5190
|
+
}, N = (e) => {
|
|
5188
5191
|
e && (e.focus(), e.scrollIntoView({ block: "nearest" }));
|
|
5189
|
-
},
|
|
5192
|
+
}, P = (e) => {
|
|
5190
5193
|
let t = [...e.querySelectorAll(".chat-emoji-cell")];
|
|
5191
5194
|
if (!t.length) return 1;
|
|
5192
5195
|
let n = t[0].offsetTop;
|
|
5193
5196
|
return Math.max(1, t.filter((e) => e.offsetTop === n).length);
|
|
5194
|
-
},
|
|
5197
|
+
}, te = (e) => {
|
|
5195
5198
|
let t = e.target.closest?.(".chat-emoji-cell");
|
|
5196
5199
|
if (!t) return;
|
|
5197
|
-
let n = b.current, r = [...n.querySelectorAll(".chat-emoji-grid")].filter((e) => e.querySelector(".chat-emoji-cell")), i = [...n.querySelectorAll(".chat-emoji-cell")], a = t.closest(".chat-emoji-grid"), o = r.indexOf(a), s = [...a.querySelectorAll(".chat-emoji-cell")], c = s.indexOf(t), l =
|
|
5200
|
+
let n = b.current, r = [...n.querySelectorAll(".chat-emoji-grid")].filter((e) => e.querySelector(".chat-emoji-cell")), i = [...n.querySelectorAll(".chat-emoji-cell")], a = t.closest(".chat-emoji-grid"), o = r.indexOf(a), s = [...a.querySelectorAll(".chat-emoji-cell")], c = s.indexOf(t), l = P(a), u = null;
|
|
5198
5201
|
switch (e.key) {
|
|
5199
5202
|
case "ArrowRight":
|
|
5200
5203
|
u = i[i.indexOf(t) + 1];
|
|
@@ -5213,7 +5216,7 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5213
5216
|
case "ArrowUp":
|
|
5214
5217
|
if (c - l >= 0) u = s[c - l];
|
|
5215
5218
|
else if (r[o - 1]) {
|
|
5216
|
-
let e = [...r[o - 1].querySelectorAll(".chat-emoji-cell")], t =
|
|
5219
|
+
let e = [...r[o - 1].querySelectorAll(".chat-emoji-cell")], t = P(r[o - 1]), n = Math.floor((e.length - 1) / t) * t;
|
|
5217
5220
|
u = e[Math.min(n + c % l, e.length - 1)];
|
|
5218
5221
|
} else {
|
|
5219
5222
|
e.preventDefault(), x.current?.focus();
|
|
@@ -5238,15 +5241,15 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5238
5241
|
return;
|
|
5239
5242
|
default: return;
|
|
5240
5243
|
}
|
|
5241
|
-
e.preventDefault(),
|
|
5244
|
+
e.preventDefault(), N(u);
|
|
5242
5245
|
};
|
|
5243
5246
|
if (!t) return null;
|
|
5244
|
-
let
|
|
5247
|
+
let ne = ho.find((e) => e.tone === s) || ho[0], re = [
|
|
5245
5248
|
...a?.length ? [["recent", "Recientes"]] : [],
|
|
5246
5249
|
...o?.length ? [["favorites", "Favoritos"]] : [],
|
|
5247
5250
|
..._o.filter(([e]) => e !== "all" && (Vo(e) || []).length),
|
|
5248
5251
|
...i.length ? [["custom", "Personalizados"]] : []
|
|
5249
|
-
],
|
|
5252
|
+
], F = O ? C.has(O.record.emoji) : !1, ie = O?.record.shortcode ? `:${O.record.shortcode}:` : "";
|
|
5250
5253
|
return /* @__PURE__ */ $("div", {
|
|
5251
5254
|
className: "chat-emoji-picker chat-emoji-picker--modern",
|
|
5252
5255
|
role: "dialog",
|
|
@@ -5270,7 +5273,7 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5270
5273
|
p(e.target.value), y(null), b.current?.scrollTo({ top: 0 });
|
|
5271
5274
|
},
|
|
5272
5275
|
onKeyDown: (e) => {
|
|
5273
|
-
e.key === "ArrowDown" && (e.preventDefault(),
|
|
5276
|
+
e.key === "ArrowDown" && (e.preventDefault(), N(b.current?.querySelector(".chat-emoji-cell")));
|
|
5274
5277
|
}
|
|
5275
5278
|
}),
|
|
5276
5279
|
/* @__PURE__ */ $("div", {
|
|
@@ -5280,12 +5283,12 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5280
5283
|
className: "chat-emoji-tone-btn",
|
|
5281
5284
|
"aria-haspopup": "menu",
|
|
5282
5285
|
"aria-expanded": m,
|
|
5283
|
-
"aria-label": `Tono de piel: ${
|
|
5286
|
+
"aria-label": `Tono de piel: ${ne?.label || ""}`,
|
|
5284
5287
|
title: "Tono de piel",
|
|
5285
5288
|
onClick: () => h((e) => !e),
|
|
5286
5289
|
children: /* @__PURE__ */ Q("span", {
|
|
5287
5290
|
className: "chat-emoji-tone-swatch",
|
|
5288
|
-
style: { background:
|
|
5291
|
+
style: { background: ne?.swatch },
|
|
5289
5292
|
"aria-hidden": "true"
|
|
5290
5293
|
})
|
|
5291
5294
|
}), m && /* @__PURE__ */ Q("div", {
|
|
@@ -5323,7 +5326,7 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5323
5326
|
className: "chat-emoji-nav",
|
|
5324
5327
|
role: "tablist",
|
|
5325
5328
|
"aria-label": "Categorías de emojis",
|
|
5326
|
-
children:
|
|
5329
|
+
children: re.map(([e, t]) => {
|
|
5327
5330
|
let n = ls[e] || ht;
|
|
5328
5331
|
return /* @__PURE__ */ Q("button", {
|
|
5329
5332
|
type: "button",
|
|
@@ -5332,7 +5335,7 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5332
5335
|
title: t,
|
|
5333
5336
|
"aria-label": t,
|
|
5334
5337
|
"aria-selected": g === e,
|
|
5335
|
-
onClick: () =>
|
|
5338
|
+
onClick: () => ee(e),
|
|
5336
5339
|
children: /* @__PURE__ */ Q(n, {
|
|
5337
5340
|
size: 16,
|
|
5338
5341
|
"aria-hidden": "true"
|
|
@@ -5343,7 +5346,7 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5343
5346
|
/* @__PURE__ */ Q("div", {
|
|
5344
5347
|
ref: b,
|
|
5345
5348
|
className: "chat-emoji-body",
|
|
5346
|
-
onKeyDown:
|
|
5349
|
+
onKeyDown: te,
|
|
5347
5350
|
onScroll: () => {
|
|
5348
5351
|
cancelAnimationFrame(S.current), S.current = requestAnimationFrame(M);
|
|
5349
5352
|
},
|
|
@@ -5375,22 +5378,22 @@ function gs({ onSelect: e, isOpen: t, onClose: n, disabled: r }) {
|
|
|
5375
5378
|
children: [/* @__PURE__ */ Q("span", {
|
|
5376
5379
|
className: "chat-emoji-preview-name",
|
|
5377
5380
|
children: O.record.label
|
|
5378
|
-
}),
|
|
5381
|
+
}), ie && /* @__PURE__ */ Q("span", {
|
|
5379
5382
|
className: "chat-emoji-preview-code",
|
|
5380
|
-
children:
|
|
5383
|
+
children: ie
|
|
5381
5384
|
})]
|
|
5382
5385
|
}),
|
|
5383
5386
|
/* @__PURE__ */ Q("button", {
|
|
5384
5387
|
type: "button",
|
|
5385
5388
|
className: "chat-emoji-fav-btn",
|
|
5386
|
-
"aria-pressed":
|
|
5387
|
-
"aria-label":
|
|
5388
|
-
title:
|
|
5389
|
+
"aria-pressed": F,
|
|
5390
|
+
"aria-label": F ? "Quitar de favoritos" : "Agregar a favoritos",
|
|
5391
|
+
title: F ? "Quitar de favoritos" : "Agregar a favoritos",
|
|
5389
5392
|
onClick: () => l(O.record.emoji),
|
|
5390
5393
|
children: /* @__PURE__ */ Q(yt, {
|
|
5391
5394
|
size: 16,
|
|
5392
5395
|
"aria-hidden": "true",
|
|
5393
|
-
fill:
|
|
5396
|
+
fill: F ? "currentColor" : "none"
|
|
5394
5397
|
})
|
|
5395
5398
|
})
|
|
5396
5399
|
] })
|
|
@@ -5470,10 +5473,10 @@ function vs({ onSelect: e, onClose: t, align: n = "start" }) {
|
|
|
5470
5473
|
});
|
|
5471
5474
|
}
|
|
5472
5475
|
// src/ui/chatPeopleContext.js
|
|
5473
|
-
var ys =
|
|
5476
|
+
var ys = oe({
|
|
5474
5477
|
ownIds: [],
|
|
5475
5478
|
resolveName: () => null
|
|
5476
|
-
}), bs = () =>
|
|
5479
|
+
}), bs = () => V(ys), xs = 10, Ss = 300, Cs = () => typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
5477
5480
|
function ws({ reactions: e = [], onToggle: t, disabled: n }) {
|
|
5478
5481
|
let { ownIds: r, resolveName: i } = bs(), [a, o] = G(() => /* @__PURE__ */ new Set()), s = W(null), c = W({});
|
|
5479
5482
|
if (H(() => {
|
|
@@ -5519,7 +5522,7 @@ function ws({ reactions: e = [], onToggle: t, disabled: n }) {
|
|
|
5519
5522
|
}, e))
|
|
5520
5523
|
});
|
|
5521
5524
|
}
|
|
5522
|
-
var Ts =
|
|
5525
|
+
var Ts = z(ws);
|
|
5523
5526
|
// src/ui/components/MessageBubble.jsx
|
|
5524
5527
|
function Es({ message: e, isMine: t, senderName: n, timestamp: r, onCopy: i, onReply: a, onJumpQuote: o, onReact: s, onEdit: c, isEditing: l }) {
|
|
5525
5528
|
let [u, d] = G(!1), [f, p] = G(""), [m, h] = G(!1), g = W(null), _ = e.message ?? e.text ?? "", v = /^> ([^\n]{1,240})\n\n/.exec(_), y = v ? _.slice(v[0].length) : _, b = li(y), x = Array.isArray(e.attachments) ? e.attachments : e.attachment ? [e.attachment] : [], S = r == null ? null : new Date(r), C = S && Number.isFinite(S.getTime()), w = !_.trim() && x.length > 0 && x.every(yn), T = !!e.reactionGroups?.length, E = () => {
|
|
@@ -5720,7 +5723,7 @@ function As({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
|
|
|
5720
5723
|
});
|
|
5721
5724
|
}
|
|
5722
5725
|
function js({ game: e, currentUserId: t, onAccept: n, onDecline: r, onMove: i, onClose: a, onRetry: o, onDropSettled: s, onMinimize: c, onDismiss: l, onResync: u, onAdoptOffer: d, soundControls: f, variant: p, connected: m = !0 }) {
|
|
5723
|
-
let h =
|
|
5726
|
+
let h = j(t, e.hostId), g = j(t, e.guestId), _ = h || g, v = e.status === "active" && j(t, e.turnId), y = !m || e.pending || !!e.pendingEvent, b = v && !y && !e.error, x = A(e), S = e.board || Array.from({ length: 6 }, () => Array(7).fill(null)), C = te(e, t);
|
|
5724
5727
|
return /* @__PURE__ */ $("section", {
|
|
5725
5728
|
className: `chat-game-card${v ? " chat-game-card--my-turn" : ""}${p ? ` chat-game-card--${p}` : ""}`,
|
|
5726
5729
|
"aria-label": "Partida de Conecta 4",
|
|
@@ -5815,9 +5818,9 @@ function js({ game: e, currentUserId: t, onAccept: n, onDecline: r, onMove: i, o
|
|
|
5815
5818
|
}), /* @__PURE__ */ Q("div", {
|
|
5816
5819
|
className: "chat-game-board",
|
|
5817
5820
|
role: "img",
|
|
5818
|
-
"aria-label": `Tablero de Conecta 4, ${e.ply || 0} fichas colocadas. ${C}. ${S.map((t, n) => `Fila ${n + 1} de arriba abajo: ${t.map((t) => t == null ? "vacía" :
|
|
5821
|
+
"aria-label": `Tablero de Conecta 4, ${e.ply || 0} fichas colocadas. ${C}. ${S.map((t, n) => `Fila ${n + 1} de arriba abajo: ${t.map((t) => t == null ? "vacía" : j(t, e.hostId) ? "azul" : "violeta").join(", ")}`).join(". ")}`,
|
|
5819
5822
|
children: S.flatMap((t, n) => t.map((t, r) => {
|
|
5820
|
-
let i = t != null, a = i ?
|
|
5823
|
+
let i = t != null, a = i ? j(t, e.hostId) ? "host" : "guest" : "", o = e.lastMove?.row === n && e.lastMove?.column === r, c = e.winningCells?.some(([e, t]) => e === n && t === r);
|
|
5821
5824
|
return /* @__PURE__ */ Q("div", {
|
|
5822
5825
|
className: `chat-game-cell${c ? " chat-game-cell--winning" : ""}`,
|
|
5823
5826
|
children: i && /* @__PURE__ */ Q("span", {
|
|
@@ -5869,7 +5872,7 @@ function js({ game: e, currentUserId: t, onAccept: n, onDecline: r, onMove: i, o
|
|
|
5869
5872
|
]
|
|
5870
5873
|
});
|
|
5871
5874
|
}
|
|
5872
|
-
var Ms =
|
|
5875
|
+
var Ms = z(js);
|
|
5873
5876
|
// \0@oxc-project+runtime@0.155.0/helpers/esm/typeof.js
|
|
5874
5877
|
function Ns(e) {
|
|
5875
5878
|
"@babel/helpers - typeof";
|
|
@@ -5906,17 +5909,21 @@ function Is(e, t, n) {
|
|
|
5906
5909
|
}
|
|
5907
5910
|
// src/games/shared/ConnectedGameCard.jsx
|
|
5908
5911
|
var Ls = {
|
|
5912
|
+
racing_live: {
|
|
5913
|
+
title: "Carreras LIVE 🏎️",
|
|
5914
|
+
load: () => se(() => import("./chunks/RacingLiveGameCard-c1G7uoDI.js").then((e) => e.t))
|
|
5915
|
+
},
|
|
5909
5916
|
battleship: {
|
|
5910
5917
|
title: "Batalla Naval",
|
|
5911
|
-
load: () =>
|
|
5918
|
+
load: () => se(() => import("./chunks/BattleshipGameCard-B-B4r7lK.js"))
|
|
5912
5919
|
},
|
|
5913
5920
|
tanks_live: {
|
|
5914
5921
|
title: "Tanques LIVE 3D",
|
|
5915
|
-
load: () =>
|
|
5922
|
+
load: () => se(() => import("./chunks/TanksLiveGameCard-COr9Oay5.js").then((e) => e.t))
|
|
5916
5923
|
},
|
|
5917
5924
|
tanks: {
|
|
5918
5925
|
title: "Tanques de guerra",
|
|
5919
|
-
load: () =>
|
|
5926
|
+
load: () => se(() => import("./chunks/TanksGameCard-CvTaF7tu.js"))
|
|
5920
5927
|
}
|
|
5921
5928
|
}, Rs = {}, zs = (e) => (Rs[e] ?? (Rs[e] = Ls[e].load()), Rs[e]);
|
|
5922
5929
|
function Bs({ title: e }) {
|
|
@@ -5935,7 +5942,7 @@ function Bs({ title: e }) {
|
|
|
5935
5942
|
})
|
|
5936
5943
|
});
|
|
5937
5944
|
}
|
|
5938
|
-
var Vs = class extends
|
|
5945
|
+
var Vs = class extends L {
|
|
5939
5946
|
constructor(...e) {
|
|
5940
5947
|
super(...e), Is(this, "state", { failed: !1 });
|
|
5941
5948
|
}
|
|
@@ -5967,58 +5974,58 @@ var Vs = class extends re {
|
|
|
5967
5974
|
});
|
|
5968
5975
|
}
|
|
5969
5976
|
};
|
|
5970
|
-
function Hs({ gameKey: e, currentUserId:
|
|
5971
|
-
let
|
|
5977
|
+
function Hs({ gameKey: e, currentUserId: n, variant: r = "panel", onMinimize: i, onDismiss: a, suspended: o = !1 }) {
|
|
5978
|
+
let s = t((t) => t.games[e]), c = D() === "connected", l = s?.game === "racing_live" ? "racing_live" : s?.game === "tanks_live" ? "tanks_live" : k(s) ? "battleship" : P(s) ? "tanks" : s ? "connect4" : null;
|
|
5972
5979
|
if (H(() => {
|
|
5973
|
-
|
|
5974
|
-
}, [
|
|
5975
|
-
if (
|
|
5976
|
-
let
|
|
5980
|
+
l === "connect4" && ae.preload();
|
|
5981
|
+
}, [l]), !s) return null;
|
|
5982
|
+
if (l !== "connect4") {
|
|
5983
|
+
let t = zs(l);
|
|
5977
5984
|
return /* @__PURE__ */ Q(Vs, {
|
|
5978
|
-
type:
|
|
5979
|
-
children: /* @__PURE__ */ Q(
|
|
5980
|
-
fallback: /* @__PURE__ */ Q(Bs, { title: Ls[
|
|
5981
|
-
children: /* @__PURE__ */ Q(
|
|
5985
|
+
type: l,
|
|
5986
|
+
children: /* @__PURE__ */ Q(R, {
|
|
5987
|
+
fallback: /* @__PURE__ */ Q(Bs, { title: Ls[l].title }),
|
|
5988
|
+
children: /* @__PURE__ */ Q(t, {
|
|
5982
5989
|
suspended: o,
|
|
5983
5990
|
gameKey: e,
|
|
5984
|
-
currentUserId:
|
|
5985
|
-
variant:
|
|
5991
|
+
currentUserId: n,
|
|
5992
|
+
variant: r,
|
|
5986
5993
|
onMinimize: i,
|
|
5987
5994
|
onDismiss: a
|
|
5988
5995
|
})
|
|
5989
5996
|
})
|
|
5990
|
-
},
|
|
5997
|
+
}, l);
|
|
5991
5998
|
}
|
|
5992
|
-
let
|
|
5993
|
-
|
|
5994
|
-
},
|
|
5995
|
-
Promise.resolve(
|
|
5999
|
+
let u = (n, r) => {
|
|
6000
|
+
t.getState().act(e, n, r).catch(() => {});
|
|
6001
|
+
}, d = (n) => () => {
|
|
6002
|
+
Promise.resolve(t.getState()[n]?.(e)).catch(() => {});
|
|
5996
6003
|
};
|
|
5997
6004
|
return /* @__PURE__ */ Q(Ms, {
|
|
5998
|
-
game:
|
|
5999
|
-
currentUserId:
|
|
6000
|
-
connected:
|
|
6001
|
-
onAccept: () =>
|
|
6002
|
-
onDecline: () =>
|
|
6003
|
-
onMove: (e) =>
|
|
6004
|
-
onClose: () =>
|
|
6005
|
-
onDropSettled:
|
|
6006
|
-
variant:
|
|
6005
|
+
game: s,
|
|
6006
|
+
currentUserId: n,
|
|
6007
|
+
connected: c,
|
|
6008
|
+
onAccept: () => u("game_accept"),
|
|
6009
|
+
onDecline: () => u("game_decline"),
|
|
6010
|
+
onMove: (e) => u("game_move", { column: e }),
|
|
6011
|
+
onClose: () => u("game_end"),
|
|
6012
|
+
onDropSettled: ie,
|
|
6013
|
+
variant: r,
|
|
6007
6014
|
onMinimize: i,
|
|
6008
6015
|
onDismiss: a,
|
|
6009
|
-
soundControls:
|
|
6010
|
-
onResync:
|
|
6011
|
-
onAdoptOffer:
|
|
6012
|
-
onRetry:
|
|
6013
|
-
|
|
6016
|
+
soundControls: r === "panel" ? /* @__PURE__ */ Q(F, { manager: ae }) : void 0,
|
|
6017
|
+
onResync: d("requestResync"),
|
|
6018
|
+
onAdoptOffer: d("adoptResyncOffer"),
|
|
6019
|
+
onRetry: s.pendingEvent ? () => {
|
|
6020
|
+
t.getState().retry(e).catch(() => {});
|
|
6014
6021
|
} : void 0
|
|
6015
6022
|
});
|
|
6016
6023
|
}
|
|
6017
|
-
var Us =
|
|
6024
|
+
var Us = z(Hs);
|
|
6018
6025
|
// src/games/shared/GameTimelineEntry.jsx
|
|
6019
|
-
function Ws({ gameKey: e, currentUserId:
|
|
6020
|
-
let i =
|
|
6021
|
-
return i ?
|
|
6026
|
+
function Ws({ gameKey: e, currentUserId: n, inPanel: r }) {
|
|
6027
|
+
let i = t((t) => t.games[e]);
|
|
6028
|
+
return i ? r ? /* @__PURE__ */ $("button", {
|
|
6022
6029
|
type: "button",
|
|
6023
6030
|
className: "chat-game-placeholder",
|
|
6024
6031
|
onClick: () => ks.getState().setMinimized(e, !1),
|
|
@@ -6029,15 +6036,15 @@ function Ws({ gameKey: e, currentUserId: t, inPanel: n }) {
|
|
|
6029
6036
|
}),
|
|
6030
6037
|
/* @__PURE__ */ $("span", { children: [
|
|
6031
6038
|
"Partida de ",
|
|
6032
|
-
|
|
6039
|
+
M(i),
|
|
6033
6040
|
" · ",
|
|
6034
|
-
|
|
6041
|
+
N(i, n)
|
|
6035
6042
|
] }),
|
|
6036
6043
|
/* @__PURE__ */ Q("strong", { children: "Ver tablero" })
|
|
6037
6044
|
]
|
|
6038
6045
|
}) : /* @__PURE__ */ Q(Us, {
|
|
6039
6046
|
gameKey: e,
|
|
6040
|
-
currentUserId:
|
|
6047
|
+
currentUserId: n,
|
|
6041
6048
|
variant: "history"
|
|
6042
6049
|
}) : null;
|
|
6043
6050
|
}
|
|
@@ -6164,12 +6171,12 @@ var qs = 120;
|
|
|
6164
6171
|
function Js(e) {
|
|
6165
6172
|
let [t, n] = G("idle"), [r, i] = G(0), [a, o] = G(""), s = W(null), c = W(!0), l = W(e);
|
|
6166
6173
|
l.current = e;
|
|
6167
|
-
let u =
|
|
6174
|
+
let u = B((e) => {
|
|
6168
6175
|
clearInterval(e?.timer), e?.stream?.getTracks().forEach((e) => e.stop());
|
|
6169
|
-
}, []), d =
|
|
6176
|
+
}, []), d = B((e = !1) => {
|
|
6170
6177
|
let t = s.current;
|
|
6171
6178
|
t && (t.cancelled = e, clearInterval(t.timer), t.recorder?.state === "recording" ? (t.recorder.stop(), u(t)) : (u(t), s.current = null, c.current && n("idle")));
|
|
6172
|
-
}, [u]), f =
|
|
6179
|
+
}, [u]), f = B(async () => {
|
|
6173
6180
|
if (s.current) return;
|
|
6174
6181
|
if (o(""), !navigator.mediaDevices?.getUserMedia || typeof MediaRecorder > "u") {
|
|
6175
6182
|
o("Este navegador no permite grabar audio. Puedes adjuntar un archivo de audio.");
|
|
@@ -8512,7 +8519,7 @@ function gl(e, t) {
|
|
|
8512
8519
|
// src/ui/components/GifCategoryBar.jsx
|
|
8513
8520
|
var _l = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
8514
8521
|
function vl({ categories: e = [], activeId: t, onSelect: n, disabled: r }) {
|
|
8515
|
-
let i = W(null), a = W(/* @__PURE__ */ new Map()), [o, s] = G(!1), [c, l] = G(!1), u =
|
|
8522
|
+
let i = W(null), a = W(/* @__PURE__ */ new Map()), [o, s] = G(!1), [c, l] = G(!1), u = B(() => {
|
|
8516
8523
|
let e = i.current;
|
|
8517
8524
|
if (!e) return;
|
|
8518
8525
|
let t = e.scrollWidth - e.clientWidth;
|
|
@@ -8637,7 +8644,7 @@ function vl({ categories: e = [], activeId: t, onSelect: n, disabled: r }) {
|
|
|
8637
8644
|
]
|
|
8638
8645
|
});
|
|
8639
8646
|
}
|
|
8640
|
-
var yl =
|
|
8647
|
+
var yl = z(vl), bl = 420, xl = 350, Sl = [
|
|
8641
8648
|
1.3,
|
|
8642
8649
|
.75,
|
|
8643
8650
|
1,
|
|
@@ -8680,7 +8687,7 @@ function El(e) {
|
|
|
8680
8687
|
return !0;
|
|
8681
8688
|
}
|
|
8682
8689
|
}
|
|
8683
|
-
var Dl =
|
|
8690
|
+
var Dl = z(function({ item: e, fav: t, disabled: n, onSelect: r, onToggleFavorite: i }) {
|
|
8684
8691
|
let [a, o] = G(!1), [s, c] = G(!1), [l, u] = G(!1), [d, f] = G(!1), p = W(null), m = Number(e.width), h = Number(e.height), g = m > 0 && h > 0 ? `${m} / ${h}` : "1 / 1", _ = e.title || "GIF", v = !!e.url && e.url !== e.preview && !d, y = l && v && !s, b = () => {
|
|
8685
8692
|
p.current && (clearTimeout(p.current), p.current = null);
|
|
8686
8693
|
};
|
|
@@ -8762,7 +8769,7 @@ function kl({ items: e, loading: t, hasMore: n, error: r, onLoadMore: i, onRetry
|
|
|
8762
8769
|
onToggleFavorite: s,
|
|
8763
8770
|
onLoadMore: i
|
|
8764
8771
|
};
|
|
8765
|
-
let v =
|
|
8772
|
+
let v = B((e) => _.current.onSelect?.(e), []), y = B((e) => _.current.onToggleFavorite?.(e), []), b = W({
|
|
8766
8773
|
loading: t,
|
|
8767
8774
|
error: r,
|
|
8768
8775
|
hasMore: n
|
|
@@ -8772,7 +8779,7 @@ function kl({ items: e, loading: t, hasMore: n, error: r, onLoadMore: i, onRetry
|
|
|
8772
8779
|
error: r,
|
|
8773
8780
|
hasMore: n
|
|
8774
8781
|
};
|
|
8775
|
-
let x = W(!1), S = W(-1), C =
|
|
8782
|
+
let x = W(!1), S = W(-1), C = B(() => {
|
|
8776
8783
|
let e = b.current;
|
|
8777
8784
|
!e.hasMore || e.loading || e.error || _.current.onLoadMore?.();
|
|
8778
8785
|
}, []);
|
|
@@ -8907,26 +8914,26 @@ var Al = 24, jl = 300, Ml = (e) => !!e?.id && Qi(e.url) && Qi(e.preview), Nl = (
|
|
|
8907
8914
|
title: "No se encontraron GIFs"
|
|
8908
8915
|
};
|
|
8909
8916
|
function Pl({ onSelect: e, onClose: t, disabled: n }) {
|
|
8910
|
-
let [r, i] = G(""), [a, o] = G(ul), [s, c] = G([]), [l, u] = G([]), [d, f] = G(!1), [p, m] = G(1), [h, g] = G(!1), [_, v] = G(""), [y, b] = G(""), x = W(null), S = W(0), C = Vc((e) => e.favorites), w = Vc((e) => e.recents), T = Vc((e) => e.toggleFavorite), E = U(() => new Set((C || []).map((e) => e?.id)), [C]), D =
|
|
8917
|
+
let [r, i] = G(""), [a, o] = G(ul), [s, c] = G([]), [l, u] = G([]), [d, f] = G(!1), [p, m] = G(1), [h, g] = G(!1), [_, v] = G(""), [y, b] = G(""), x = W(null), S = W(0), C = Vc((e) => e.favorites), w = Vc((e) => e.recents), T = Vc((e) => e.toggleFavorite), E = U(() => new Set((C || []).map((e) => e?.id)), [C]), D = B((e) => E.has(typeof e == "object" ? e?.id : e), [E]);
|
|
8911
8918
|
H(() => {
|
|
8912
8919
|
let e = new AbortController();
|
|
8913
8920
|
return ua({ signal: e.signal }).then((t) => {
|
|
8914
8921
|
!e.signal.aborted && Array.isArray(t) && c(t);
|
|
8915
8922
|
}).catch(() => {}), () => e.abort();
|
|
8916
8923
|
}, []);
|
|
8917
|
-
let O = U(() => gl(dl, s), [s]), k = U(() => O.find((e) => e.id === a) ?? O[0], [O, a]), A = r.trim(), j = A ? "search" : k?.source ?? "trending", M = A || k?.query || "",
|
|
8924
|
+
let O = U(() => gl(dl, s), [s]), k = U(() => O.find((e) => e.id === a) ?? O[0], [O, a]), A = r.trim(), j = A ? "search" : k?.source ?? "trending", M = A || k?.query || "", ee = j === "favorites" ? C?.length ?? 0 : j === "recent" ? w?.length ?? 0 : 0, N = W({
|
|
8918
8925
|
source: j,
|
|
8919
8926
|
query: M
|
|
8920
8927
|
});
|
|
8921
|
-
|
|
8928
|
+
N.current = {
|
|
8922
8929
|
source: j,
|
|
8923
8930
|
query: M
|
|
8924
8931
|
};
|
|
8925
|
-
let
|
|
8932
|
+
let P = B(async (e, t) => {
|
|
8926
8933
|
x.current?.abort();
|
|
8927
8934
|
let n = new AbortController();
|
|
8928
8935
|
x.current = n;
|
|
8929
|
-
let r = ++S.current, { source: i, query: a } =
|
|
8936
|
+
let r = ++S.current, { source: i, query: a } = N.current;
|
|
8930
8937
|
f(!0), v("");
|
|
8931
8938
|
try {
|
|
8932
8939
|
let o = await ll({
|
|
@@ -8947,35 +8954,35 @@ function Pl({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
8947
8954
|
}, []);
|
|
8948
8955
|
H(() => {
|
|
8949
8956
|
x.current?.abort(), S.current++, u([]), g(!1), v(""), b(""), f(!0);
|
|
8950
|
-
let e = setTimeout(() =>
|
|
8957
|
+
let e = setTimeout(() => P(1, !1), j === "search" ? jl : 0);
|
|
8951
8958
|
return () => {
|
|
8952
8959
|
clearTimeout(e), x.current?.abort();
|
|
8953
8960
|
};
|
|
8954
8961
|
}, [
|
|
8955
8962
|
j,
|
|
8956
8963
|
M,
|
|
8957
|
-
|
|
8958
|
-
|
|
8964
|
+
ee,
|
|
8965
|
+
P
|
|
8959
8966
|
]);
|
|
8960
|
-
let
|
|
8961
|
-
d || !h || _ ||
|
|
8967
|
+
let te = B(() => {
|
|
8968
|
+
d || !h || _ || P(p + 1, !0);
|
|
8962
8969
|
}, [
|
|
8963
8970
|
d,
|
|
8964
8971
|
h,
|
|
8965
8972
|
_,
|
|
8966
8973
|
p,
|
|
8967
|
-
|
|
8968
|
-
]),
|
|
8969
|
-
l.length ?
|
|
8974
|
+
P
|
|
8975
|
+
]), ne = B(() => {
|
|
8976
|
+
l.length ? P(p + 1, !0) : P(1, !1);
|
|
8970
8977
|
}, [
|
|
8971
8978
|
l.length,
|
|
8972
8979
|
p,
|
|
8973
|
-
|
|
8974
|
-
]),
|
|
8980
|
+
P
|
|
8981
|
+
]), re = B((e) => {
|
|
8975
8982
|
i(""), o(e);
|
|
8976
|
-
}, []),
|
|
8983
|
+
}, []), F = (e) => {
|
|
8977
8984
|
e.key === "Escape" && r && (e.preventDefault(), e.stopPropagation(), i(""));
|
|
8978
|
-
},
|
|
8985
|
+
}, ie = (r) => {
|
|
8979
8986
|
!n && r && Qi(r.url) && (e?.({
|
|
8980
8987
|
kind: "gif",
|
|
8981
8988
|
id: r.id,
|
|
@@ -8988,9 +8995,9 @@ function Pl({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
8988
8995
|
size: 0,
|
|
8989
8996
|
shareQuery: j === "search" ? A : j === "trending" ? "" : M
|
|
8990
8997
|
}), Vc.getState().addRecent(r), t?.());
|
|
8991
|
-
},
|
|
8998
|
+
}, ae = B((e) => {
|
|
8992
8999
|
!n && e && T(e);
|
|
8993
|
-
}, [n, T]),
|
|
9000
|
+
}, [n, T]), I = Nl(j, A);
|
|
8994
9001
|
return /* @__PURE__ */ $("div", {
|
|
8995
9002
|
className: "chat-gif-picker chat-gif-picker--smart",
|
|
8996
9003
|
role: "dialog",
|
|
@@ -9018,7 +9025,7 @@ function Pl({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9018
9025
|
autoFocus: !0,
|
|
9019
9026
|
value: r,
|
|
9020
9027
|
onChange: (e) => i(e.target.value),
|
|
9021
|
-
onKeyDown:
|
|
9028
|
+
onKeyDown: F,
|
|
9022
9029
|
placeholder: "Busca memes, reacciones… (ej. cuánta bendición)",
|
|
9023
9030
|
disabled: n,
|
|
9024
9031
|
"aria-label": "Buscar GIFs",
|
|
@@ -9041,7 +9048,7 @@ function Pl({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9041
9048
|
/* @__PURE__ */ Q(yl, {
|
|
9042
9049
|
categories: O,
|
|
9043
9050
|
activeId: A ? null : k?.id ?? null,
|
|
9044
|
-
onSelect:
|
|
9051
|
+
onSelect: re,
|
|
9045
9052
|
disabled: n
|
|
9046
9053
|
}),
|
|
9047
9054
|
y && /* @__PURE__ */ Q("p", {
|
|
@@ -9054,12 +9061,12 @@ function Pl({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9054
9061
|
loading: d,
|
|
9055
9062
|
hasMore: h,
|
|
9056
9063
|
error: _,
|
|
9057
|
-
onLoadMore:
|
|
9058
|
-
onRetry:
|
|
9059
|
-
onSelect:
|
|
9060
|
-
onToggleFavorite:
|
|
9064
|
+
onLoadMore: te,
|
|
9065
|
+
onRetry: ne,
|
|
9066
|
+
onSelect: ie,
|
|
9067
|
+
onToggleFavorite: ae,
|
|
9061
9068
|
isFavorite: D,
|
|
9062
|
-
empty:
|
|
9069
|
+
empty: I,
|
|
9063
9070
|
disabled: n,
|
|
9064
9071
|
scrollKey: `${j}:${M}`
|
|
9065
9072
|
}),
|
|
@@ -9215,7 +9222,7 @@ function ru({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9215
9222
|
let [r, i] = G(""), [a, o] = G("trending"), [s, c] = G(null), [l, u] = G([]), [d, f] = G([]), [p, m] = G(!1), [h, g] = G(1), [_, v] = G(!1), [y, b] = G(""), [x, S] = G(null), C = W(null), w = W(null), T = W(0), E = W(null), D = W({
|
|
9216
9223
|
mode: "trending",
|
|
9217
9224
|
category: null
|
|
9218
|
-
}), O = a === "search" ? r.trim() : a === "category" && s?.query || "", k =
|
|
9225
|
+
}), O = a === "search" ? r.trim() : a === "category" && s?.query || "", k = B(async (e, t, n = 1, r = !1) => {
|
|
9219
9226
|
w.current?.abort();
|
|
9220
9227
|
let i = new AbortController();
|
|
9221
9228
|
w.current = i;
|
|
@@ -9278,7 +9285,7 @@ function ru({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9278
9285
|
...Ql(r),
|
|
9279
9286
|
shareQuery: O || ""
|
|
9280
9287
|
}), t?.());
|
|
9281
|
-
},
|
|
9288
|
+
}, ee = (e) => {
|
|
9282
9289
|
if (![
|
|
9283
9290
|
"ArrowRight",
|
|
9284
9291
|
"ArrowLeft",
|
|
@@ -9291,7 +9298,7 @@ function ru({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9291
9298
|
if (n === -1 || !t.length) return;
|
|
9292
9299
|
let r = t[0].offsetTop, i = Math.max(1, t.findIndex((e) => e.offsetTop !== r) === -1 ? t.length : t.findIndex((e) => e.offsetTop !== r)), a = n;
|
|
9293
9300
|
e.key === "ArrowRight" ? a = n + 1 : e.key === "ArrowLeft" ? a = n - 1 : e.key === "ArrowDown" ? a = n + i : e.key === "ArrowUp" ? a = n - i : e.key === "Home" ? a = 0 : e.key === "End" && (a = t.length - 1), e.preventDefault(), a = Math.min(t.length - 1, Math.max(0, a)), t[a]?.focus();
|
|
9294
|
-
},
|
|
9301
|
+
}, N = (e, t = null) => a === e && (e !== "category" || s?.query === t?.query);
|
|
9295
9302
|
return /* @__PURE__ */ $("div", {
|
|
9296
9303
|
className: "chat-gif-picker chat-sticker-picker",
|
|
9297
9304
|
role: "dialog",
|
|
@@ -9331,7 +9338,7 @@ function ru({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9331
9338
|
type: "button",
|
|
9332
9339
|
role: "tab",
|
|
9333
9340
|
className: "chat-sticker-tab",
|
|
9334
|
-
"aria-selected":
|
|
9341
|
+
"aria-selected": N("trending"),
|
|
9335
9342
|
onClick: () => j("trending"),
|
|
9336
9343
|
disabled: n,
|
|
9337
9344
|
children: "Tendencias"
|
|
@@ -9340,7 +9347,7 @@ function ru({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9340
9347
|
type: "button",
|
|
9341
9348
|
role: "tab",
|
|
9342
9349
|
className: "chat-sticker-tab",
|
|
9343
|
-
"aria-selected":
|
|
9350
|
+
"aria-selected": N("recent"),
|
|
9344
9351
|
onClick: () => j("recent"),
|
|
9345
9352
|
disabled: n,
|
|
9346
9353
|
children: "Recientes"
|
|
@@ -9349,7 +9356,7 @@ function ru({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9349
9356
|
type: "button",
|
|
9350
9357
|
role: "tab",
|
|
9351
9358
|
className: "chat-sticker-tab chat-sticker-chip",
|
|
9352
|
-
"aria-selected":
|
|
9359
|
+
"aria-selected": N("category", e),
|
|
9353
9360
|
onClick: () => j("category", e),
|
|
9354
9361
|
disabled: n,
|
|
9355
9362
|
title: e.category,
|
|
@@ -9380,7 +9387,7 @@ function ru({ onSelect: e, onClose: t, disabled: n }) {
|
|
|
9380
9387
|
className: "chat-gif-grid chat-sticker-grid",
|
|
9381
9388
|
role: "list",
|
|
9382
9389
|
"aria-label": "Resultados de stickers",
|
|
9383
|
-
onKeyDown:
|
|
9390
|
+
onKeyDown: ee,
|
|
9384
9391
|
children: [
|
|
9385
9392
|
d.map((e) => /* @__PURE__ */ Q("button", {
|
|
9386
9393
|
type: "button",
|
|
@@ -9560,7 +9567,7 @@ function du({ shortcode: e, query: t }) {
|
|
|
9560
9567
|
] });
|
|
9561
9568
|
}
|
|
9562
9569
|
function fu({ textareaRef: e, value: t, onInsert: n, onClose: r, isOpen: i }) {
|
|
9563
|
-
let a = Ha(), [o, s] = G([]), [c, l] = G(0), [u, d] = G(""), f = W(null), p = W(-1), { skinTone: m, recents: h, addRecent: g } = os() || {}, _ = cs(), v = `chat-emoji-ac-${ce().replace(/:/g, "")}`, y = (e) => `${v}-opt-${e}`, b =
|
|
9570
|
+
let a = Ha(), [o, s] = G([]), [c, l] = G(0), [u, d] = G(""), f = W(null), p = W(-1), { skinTone: m, recents: h, addRecent: g } = os() || {}, _ = cs(), v = `chat-emoji-ac-${ce().replace(/:/g, "")}`, y = (e) => `${v}-opt-${e}`, b = B((e) => e.source === "custom" ? e.emoji : Uo(e, m) || e.emoji, [m]), x = U(() => Array.isArray(h) ? h.map(cu).filter(Boolean) : [], [h]);
|
|
9564
9571
|
H(() => {
|
|
9565
9572
|
if (!i || !e.current) {
|
|
9566
9573
|
s([]);
|
|
@@ -9595,7 +9602,7 @@ function fu({ textareaRef: e, value: t, onInsert: n, onClose: r, isOpen: i }) {
|
|
|
9595
9602
|
_,
|
|
9596
9603
|
a
|
|
9597
9604
|
]);
|
|
9598
|
-
let S =
|
|
9605
|
+
let S = B((i) => {
|
|
9599
9606
|
let a = e.current;
|
|
9600
9607
|
if (!a || !i) return;
|
|
9601
9608
|
let o = p.current;
|
|
@@ -9752,19 +9759,89 @@ var pu = ["connect4", "battleship"], mu = [
|
|
|
9752
9759
|
type: "tanks_live",
|
|
9753
9760
|
label: "Tanques LIVE 3D",
|
|
9754
9761
|
Icon: De
|
|
9762
|
+
},
|
|
9763
|
+
{
|
|
9764
|
+
type: "racing_live",
|
|
9765
|
+
label: "Carreras LIVE 🏎️",
|
|
9766
|
+
Icon: Fe
|
|
9767
|
+
}
|
|
9768
|
+
], hu = [
|
|
9769
|
+
{
|
|
9770
|
+
id: "50cc",
|
|
9771
|
+
hint: "~80 km/h"
|
|
9772
|
+
},
|
|
9773
|
+
{
|
|
9774
|
+
id: "100cc",
|
|
9775
|
+
hint: "~130 km/h"
|
|
9776
|
+
},
|
|
9777
|
+
{
|
|
9778
|
+
id: "200cc",
|
|
9779
|
+
hint: "~200 km/h · recomendada"
|
|
9780
|
+
},
|
|
9781
|
+
{
|
|
9782
|
+
id: "400cc",
|
|
9783
|
+
hint: "~300 km/h"
|
|
9784
|
+
},
|
|
9785
|
+
{
|
|
9786
|
+
id: "500cc",
|
|
9787
|
+
hint: "~380 km/h"
|
|
9788
|
+
}
|
|
9789
|
+
], gu = [
|
|
9790
|
+
{
|
|
9791
|
+
id: "random",
|
|
9792
|
+
label: "Aleatorio 🎲",
|
|
9793
|
+
hint: "recomendado"
|
|
9794
|
+
},
|
|
9795
|
+
{
|
|
9796
|
+
id: "meadow",
|
|
9797
|
+
label: "Pradera 🌿",
|
|
9798
|
+
hint: "clásico"
|
|
9799
|
+
},
|
|
9800
|
+
{
|
|
9801
|
+
id: "forest",
|
|
9802
|
+
label: "Bosque 🌲",
|
|
9803
|
+
hint: "combate cercano"
|
|
9804
|
+
},
|
|
9805
|
+
{
|
|
9806
|
+
id: "desert",
|
|
9807
|
+
label: "Desierto 🏜️",
|
|
9808
|
+
hint: "abierto"
|
|
9809
|
+
},
|
|
9810
|
+
{
|
|
9811
|
+
id: "ruins",
|
|
9812
|
+
label: "Ciudad en ruinas 🏚️",
|
|
9813
|
+
hint: "pasillos"
|
|
9814
|
+
},
|
|
9815
|
+
{
|
|
9816
|
+
id: "arctic",
|
|
9817
|
+
label: "Ártico ❄️",
|
|
9818
|
+
hint: "bloques de hielo"
|
|
9819
|
+
}
|
|
9820
|
+
], _u = [
|
|
9821
|
+
{
|
|
9822
|
+
lives: 1,
|
|
9823
|
+
hint: "muerte súbita"
|
|
9824
|
+
},
|
|
9825
|
+
{
|
|
9826
|
+
lives: 3,
|
|
9827
|
+
hint: "recomendado"
|
|
9828
|
+
},
|
|
9829
|
+
{
|
|
9830
|
+
lives: 5,
|
|
9831
|
+
hint: "partida larga"
|
|
9755
9832
|
}
|
|
9756
9833
|
];
|
|
9757
|
-
function
|
|
9758
|
-
let y = Ha(), b = W(null), x = W(null), [S, C] = G(520), [w, T] = G(520), E = W(null), D = W(null), O = W(null), k = W(null), [A, j] = G(null), [M,
|
|
9834
|
+
function vu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, attachments: a = [], attachmentError: o, sending: s = !1, onAddAttachment: c, onRemoveAttachment: l, reply: u, onCancelReply: d, onInviteGame: f, gameInviteDisabled: p, gameTypes: m = pu, onOpenBattleshipPreview: h, editing: g = null, onStartEditLast: _, onCancelEdit: v }) {
|
|
9835
|
+
let y = Ha(), b = W(null), x = W(null), [S, C] = G(520), [w, T] = G(520), E = W(null), D = W(null), O = W(null), k = W(null), [A, j] = G(null), [M, ee] = G(!1), [N, P] = G(null), [te, ne] = G("random"), [re, F] = G(!1), ie = B(() => F(!1), []), ae = B((e) => n(e), [n]), I = Js(c), L = I.status !== "idle", R = a[0], oe = yn(R) ? "Enviando sticker…" : R?.kind === "gif" ? "Enviando GIF…" : R?.type?.startsWith("audio/") ? "Enviando audio…" : R ? "Enviando archivo…" : "Enviando mensaje…";
|
|
9759
9836
|
H(() => {
|
|
9760
|
-
s && (j(null),
|
|
9837
|
+
s && (j(null), F(!1));
|
|
9761
9838
|
}, [s]);
|
|
9762
|
-
let
|
|
9839
|
+
let se = g ? !i && !!t.trim() : !i && (a.length > 0 || !!t.trim()), z = g?.messageId, V = A === "gif" || A === "sticker" ? A : null;
|
|
9763
9840
|
H(() => {
|
|
9764
|
-
u && (j(null),
|
|
9841
|
+
u && (j(null), F(!1), b.current?.focus());
|
|
9765
9842
|
}, [u]), H(() => {
|
|
9766
|
-
if (
|
|
9767
|
-
j(null),
|
|
9843
|
+
if (z == null) return;
|
|
9844
|
+
j(null), F(!1);
|
|
9768
9845
|
let e = requestAnimationFrame(() => {
|
|
9769
9846
|
let e = b.current;
|
|
9770
9847
|
if (!e) return;
|
|
@@ -9773,25 +9850,30 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
9773
9850
|
e.setSelectionRange(t, t);
|
|
9774
9851
|
});
|
|
9775
9852
|
return () => cancelAnimationFrame(e);
|
|
9776
|
-
}, [
|
|
9853
|
+
}, [z]), H(() => {
|
|
9777
9854
|
let e = b.current;
|
|
9778
9855
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 144)}px`);
|
|
9779
9856
|
}, [t]), H(() => {
|
|
9780
9857
|
let e = x.current, t = e?.parentElement;
|
|
9781
|
-
if (!e || !t || !A && !
|
|
9858
|
+
if (!e || !t || !A && !re) return;
|
|
9782
9859
|
let n = () => T(Math.max(60, e.getBoundingClientRect().top - t.getBoundingClientRect().top - 8)), r = new ResizeObserver(n);
|
|
9783
9860
|
return r.observe(t), r.observe(e), n(), () => r.disconnect();
|
|
9784
|
-
}, [A,
|
|
9785
|
-
if (A !== "games")
|
|
9861
|
+
}, [A, re]), H(() => {
|
|
9862
|
+
if (A !== "games") {
|
|
9863
|
+
ee(!1), P(null);
|
|
9864
|
+
return;
|
|
9865
|
+
}
|
|
9786
9866
|
O.current?.querySelector("[role=\"menuitem\"]:not(:disabled)")?.focus();
|
|
9787
9867
|
let e = (e) => {
|
|
9788
9868
|
O.current?.contains(e.target) || k.current?.contains(e.target) || j(null);
|
|
9789
9869
|
};
|
|
9790
9870
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
9791
|
-
}, [A])
|
|
9792
|
-
|
|
9871
|
+
}, [A]), H(() => {
|
|
9872
|
+
A === "games" && O.current?.querySelector("[role=\"menuitem\"]:not(:disabled)")?.focus();
|
|
9873
|
+
}, [M, N]);
|
|
9874
|
+
let ce = (e) => {
|
|
9793
9875
|
j(null), b.current?.focus(), e?.();
|
|
9794
|
-
},
|
|
9876
|
+
}, U = (e) => {
|
|
9795
9877
|
if (![
|
|
9796
9878
|
"ArrowDown",
|
|
9797
9879
|
"ArrowUp",
|
|
@@ -9801,31 +9883,31 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
9801
9883
|
e.preventDefault();
|
|
9802
9884
|
let t = [...O.current?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") || []], n = t.indexOf(document.activeElement);
|
|
9803
9885
|
t[e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus();
|
|
9804
|
-
},
|
|
9886
|
+
}, K = B((e) => {
|
|
9805
9887
|
if (e.key === "Escape" && A) {
|
|
9806
9888
|
e.preventDefault(), e.stopPropagation();
|
|
9807
9889
|
let t = A === "games";
|
|
9808
9890
|
j(null), (t ? k.current : b.current)?.focus();
|
|
9809
|
-
} else e.key === "Escape" && g && !e.defaultPrevented && !
|
|
9891
|
+
} else e.key === "Escape" && g && !e.defaultPrevented && !re ? (e.preventDefault(), v?.()) : e.defaultPrevented || e.target !== b.current || (e.key === "ArrowUp" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey && t === "" && !a.length && !e.nativeEvent.isComposing && e.keyCode !== 229 && !A && !re && !L && !s && !g ? (e.preventDefault(), _?.() && requestAnimationFrame(() => {
|
|
9810
9892
|
let e = b.current;
|
|
9811
9893
|
if (!e) return;
|
|
9812
9894
|
e.focus();
|
|
9813
9895
|
let t = e.value.length;
|
|
9814
9896
|
e.setSelectionRange(t, t);
|
|
9815
|
-
})) : e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && e.keyCode !== 229 && (e.preventDefault(),
|
|
9897
|
+
})) : e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && e.keyCode !== 229 && (e.preventDefault(), se && !L && r()));
|
|
9816
9898
|
}, [
|
|
9817
9899
|
A,
|
|
9818
|
-
|
|
9900
|
+
se,
|
|
9819
9901
|
L,
|
|
9820
9902
|
r,
|
|
9821
9903
|
g,
|
|
9822
9904
|
v,
|
|
9823
9905
|
_,
|
|
9824
|
-
|
|
9906
|
+
re,
|
|
9825
9907
|
t,
|
|
9826
9908
|
a.length,
|
|
9827
9909
|
s
|
|
9828
|
-
]),
|
|
9910
|
+
]), le = B((e) => {
|
|
9829
9911
|
let t = Array.from(e.clipboardData?.files || []);
|
|
9830
9912
|
if (!t.length) {
|
|
9831
9913
|
for (let n of Array.from(e.clipboardData?.items || [])) if (n.kind === "file") {
|
|
@@ -9834,17 +9916,17 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
9834
9916
|
}
|
|
9835
9917
|
}
|
|
9836
9918
|
t.length && (e.preventDefault(), t.forEach((e) => c?.(e)));
|
|
9837
|
-
}, [c]),
|
|
9919
|
+
}, [c]), ue = B((e) => {
|
|
9838
9920
|
let t = e.target.value, r = e.target.selectionStart, i = /(^|[^\p{L}\p{N}_]):([\p{L}\p{N}\p{M}_+-]{1,64})(:| )$/u.exec(t.slice(0, r));
|
|
9839
9921
|
if (!e.nativeEvent.isComposing && i && e.nativeEvent.inputType !== "insertFromPaste") {
|
|
9840
9922
|
let e = y.find((e) => e.shortcode === i[2].toLowerCase())?.emoji || Wo(i[2]);
|
|
9841
9923
|
if (e) {
|
|
9842
9924
|
let a = i.index + i[1].length, o = i[3] === " " ? " " : "";
|
|
9843
|
-
n(t.slice(0, a) + e + o + t.slice(r)),
|
|
9925
|
+
n(t.slice(0, a) + e + o + t.slice(r)), F(!1), j(null), requestAnimationFrame(() => b.current?.setSelectionRange(a + e.length + o.length, a + e.length + o.length));
|
|
9844
9926
|
return;
|
|
9845
9927
|
}
|
|
9846
9928
|
}
|
|
9847
|
-
n(t), A && j(null),
|
|
9929
|
+
n(t), A && j(null), F(!!au(t, r));
|
|
9848
9930
|
}, [
|
|
9849
9931
|
n,
|
|
9850
9932
|
A,
|
|
@@ -9854,8 +9936,8 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
9854
9936
|
ref: x,
|
|
9855
9937
|
className: `chat-composer${g ? " chat-composer--editing" : ""}`,
|
|
9856
9938
|
style: { "--chat-picker-available-height": `${w}px` },
|
|
9857
|
-
onKeyDown:
|
|
9858
|
-
onPaste:
|
|
9939
|
+
onKeyDown: K,
|
|
9940
|
+
onPaste: le,
|
|
9859
9941
|
onDragOver: (e) => e.preventDefault(),
|
|
9860
9942
|
onDrop: (e) => {
|
|
9861
9943
|
e.preventDefault(), Array.from(e.dataTransfer.files).forEach((e) => c?.(e));
|
|
@@ -9887,11 +9969,11 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
9887
9969
|
}), /* @__PURE__ */ $("div", {
|
|
9888
9970
|
className: "chat-send-status-copy",
|
|
9889
9971
|
children: [
|
|
9890
|
-
/* @__PURE__ */ Q("strong", { children:
|
|
9891
|
-
|
|
9972
|
+
/* @__PURE__ */ Q("strong", { children: oe }),
|
|
9973
|
+
R?.name && /* @__PURE__ */ Q("span", {
|
|
9892
9974
|
className: "chat-send-status-file",
|
|
9893
|
-
title:
|
|
9894
|
-
children:
|
|
9975
|
+
title: R.name,
|
|
9976
|
+
children: R.name
|
|
9895
9977
|
}),
|
|
9896
9978
|
/* @__PURE__ */ Q("small", { children: "Mantén esta conversación abierta hasta que termine." })
|
|
9897
9979
|
]
|
|
@@ -9950,7 +10032,7 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
9950
10032
|
ref: b,
|
|
9951
10033
|
className: "chat-composer-textarea",
|
|
9952
10034
|
value: t,
|
|
9953
|
-
onChange:
|
|
10035
|
+
onChange: ue,
|
|
9954
10036
|
readOnly: i,
|
|
9955
10037
|
"aria-label": "Mensaje",
|
|
9956
10038
|
placeholder: "Escribe un mensaje…",
|
|
@@ -9994,7 +10076,7 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
9994
10076
|
className: "chat-composer-btn",
|
|
9995
10077
|
disabled: s || !!g || p && !h,
|
|
9996
10078
|
onClick: () => {
|
|
9997
|
-
|
|
10079
|
+
F(!1), j(A === "games" ? null : "games");
|
|
9998
10080
|
},
|
|
9999
10081
|
"aria-label": "Juegos",
|
|
10000
10082
|
"aria-haspopup": "menu",
|
|
@@ -10026,7 +10108,7 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
10026
10108
|
className: "chat-composer-btn",
|
|
10027
10109
|
disabled: s,
|
|
10028
10110
|
onClick: () => {
|
|
10029
|
-
|
|
10111
|
+
F(!1), j(A === "emoji" ? null : "emoji");
|
|
10030
10112
|
},
|
|
10031
10113
|
"aria-label": "Emojis",
|
|
10032
10114
|
"aria-expanded": A === "emoji",
|
|
@@ -10038,7 +10120,7 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
10038
10120
|
className: "chat-composer-btn",
|
|
10039
10121
|
disabled: s || !!g,
|
|
10040
10122
|
onClick: () => {
|
|
10041
|
-
|
|
10123
|
+
F(!1), j(A === "gif" ? null : "gif");
|
|
10042
10124
|
},
|
|
10043
10125
|
"aria-label": "Buscar GIFs",
|
|
10044
10126
|
"aria-expanded": A === "gif",
|
|
@@ -10050,7 +10132,7 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
10050
10132
|
className: "chat-composer-btn",
|
|
10051
10133
|
disabled: s || !!g,
|
|
10052
10134
|
onClick: () => {
|
|
10053
|
-
|
|
10135
|
+
F(!1), j(A === "sticker" ? null : "sticker");
|
|
10054
10136
|
},
|
|
10055
10137
|
"aria-label": "Stickers",
|
|
10056
10138
|
"aria-expanded": A === "sticker",
|
|
@@ -10076,9 +10158,9 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
10076
10158
|
type: "button",
|
|
10077
10159
|
className: "chat-composer-send",
|
|
10078
10160
|
onClick: () => {
|
|
10079
|
-
|
|
10161
|
+
se && !L && r();
|
|
10080
10162
|
},
|
|
10081
|
-
disabled: !
|
|
10163
|
+
disabled: !se || L,
|
|
10082
10164
|
"aria-label": s ? "Enviando mensaje" : g ? "Guardar edición" : "Enviar mensaje",
|
|
10083
10165
|
"aria-busy": s,
|
|
10084
10166
|
title: s ? "Enviando…" : g ? "Guardar edición" : "Enviar mensaje",
|
|
@@ -10095,34 +10177,133 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
10095
10177
|
className: "chat-game-menu",
|
|
10096
10178
|
role: "menu",
|
|
10097
10179
|
"aria-label": "Juegos",
|
|
10098
|
-
onKeyDown:
|
|
10180
|
+
onKeyDown: U,
|
|
10099
10181
|
onBlur: (e) => {
|
|
10100
10182
|
let t = e.relatedTarget;
|
|
10101
10183
|
!t || O.current?.contains(t) || k.current?.contains(t) || j(null);
|
|
10102
10184
|
},
|
|
10103
|
-
children: [
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10185
|
+
children: [
|
|
10186
|
+
f && M && /* @__PURE__ */ $(Z, { children: [
|
|
10187
|
+
/* @__PURE__ */ Q("span", {
|
|
10188
|
+
className: "chat-game-menu-title",
|
|
10189
|
+
children: "Carreras LIVE · categoría"
|
|
10190
|
+
}),
|
|
10191
|
+
hu.map(({ id: e, hint: t }) => /* @__PURE__ */ $("button", {
|
|
10192
|
+
type: "button",
|
|
10193
|
+
role: "menuitem",
|
|
10194
|
+
className: "chat-game-menu-item",
|
|
10195
|
+
disabled: p,
|
|
10196
|
+
onClick: () => ce(() => f("racing_live", { speedClass: e })),
|
|
10197
|
+
children: [/* @__PURE__ */ Q(Fe, {
|
|
10198
|
+
size: 16,
|
|
10199
|
+
"aria-hidden": "true"
|
|
10200
|
+
}), /* @__PURE__ */ $("span", { children: [
|
|
10201
|
+
/* @__PURE__ */ Q("strong", { children: e }),
|
|
10202
|
+
" · ",
|
|
10203
|
+
t
|
|
10204
|
+
] })]
|
|
10205
|
+
}, e)),
|
|
10206
|
+
/* @__PURE__ */ Q("hr", { className: "chat-game-menu-separator" }),
|
|
10207
|
+
/* @__PURE__ */ Q("button", {
|
|
10208
|
+
type: "button",
|
|
10209
|
+
role: "menuitem",
|
|
10210
|
+
className: "chat-game-menu-item",
|
|
10211
|
+
onClick: () => ee(!1),
|
|
10212
|
+
children: /* @__PURE__ */ Q("span", { children: "← Volver" })
|
|
10213
|
+
})
|
|
10214
|
+
] }),
|
|
10215
|
+
f && N === "map" && /* @__PURE__ */ $(Z, { children: [
|
|
10216
|
+
/* @__PURE__ */ Q("span", {
|
|
10217
|
+
className: "chat-game-menu-title",
|
|
10218
|
+
children: "Tanques LIVE · mapa"
|
|
10219
|
+
}),
|
|
10220
|
+
gu.map(({ id: e, label: t, hint: n }) => /* @__PURE__ */ $("button", {
|
|
10221
|
+
type: "button",
|
|
10222
|
+
role: "menuitem",
|
|
10223
|
+
className: "chat-game-menu-item",
|
|
10224
|
+
disabled: p,
|
|
10225
|
+
onClick: () => {
|
|
10226
|
+
ne(e), P("lives");
|
|
10227
|
+
},
|
|
10228
|
+
children: [/* @__PURE__ */ Q(De, {
|
|
10229
|
+
size: 16,
|
|
10230
|
+
"aria-hidden": "true"
|
|
10231
|
+
}), /* @__PURE__ */ $("span", { children: [
|
|
10232
|
+
/* @__PURE__ */ Q("strong", { children: t }),
|
|
10233
|
+
" · ",
|
|
10234
|
+
n
|
|
10235
|
+
] })]
|
|
10236
|
+
}, e)),
|
|
10237
|
+
/* @__PURE__ */ Q("hr", { className: "chat-game-menu-separator" }),
|
|
10238
|
+
/* @__PURE__ */ Q("button", {
|
|
10239
|
+
type: "button",
|
|
10240
|
+
role: "menuitem",
|
|
10241
|
+
className: "chat-game-menu-item",
|
|
10242
|
+
onClick: () => P(null),
|
|
10243
|
+
children: /* @__PURE__ */ Q("span", { children: "← Volver" })
|
|
10244
|
+
})
|
|
10245
|
+
] }),
|
|
10246
|
+
f && N === "lives" && /* @__PURE__ */ $(Z, { children: [
|
|
10247
|
+
/* @__PURE__ */ Q("span", {
|
|
10248
|
+
className: "chat-game-menu-title",
|
|
10249
|
+
children: "Tanques LIVE · vidas"
|
|
10250
|
+
}),
|
|
10251
|
+
_u.map(({ lives: e, hint: t }) => /* @__PURE__ */ $("button", {
|
|
10252
|
+
type: "button",
|
|
10253
|
+
role: "menuitem",
|
|
10254
|
+
className: "chat-game-menu-item",
|
|
10255
|
+
disabled: p,
|
|
10256
|
+
onClick: () => ce(() => f("tanks_live", {
|
|
10257
|
+
mapId: te,
|
|
10258
|
+
lives: e
|
|
10259
|
+
})),
|
|
10260
|
+
children: [/* @__PURE__ */ Q("span", {
|
|
10261
|
+
"aria-hidden": "true",
|
|
10262
|
+
children: "❤️".repeat(e)
|
|
10263
|
+
}), /* @__PURE__ */ $("span", { children: [
|
|
10264
|
+
/* @__PURE__ */ $("strong", { children: [
|
|
10265
|
+
e,
|
|
10266
|
+
" ",
|
|
10267
|
+
e === 1 ? "vida" : "vidas"
|
|
10268
|
+
] }),
|
|
10269
|
+
" · ",
|
|
10270
|
+
t
|
|
10271
|
+
] })]
|
|
10272
|
+
}, e)),
|
|
10273
|
+
/* @__PURE__ */ Q("hr", { className: "chat-game-menu-separator" }),
|
|
10274
|
+
/* @__PURE__ */ Q("button", {
|
|
10275
|
+
type: "button",
|
|
10276
|
+
role: "menuitem",
|
|
10277
|
+
className: "chat-game-menu-item",
|
|
10278
|
+
onClick: () => P("map"),
|
|
10279
|
+
children: /* @__PURE__ */ Q("span", { children: "← Volver" })
|
|
10280
|
+
})
|
|
10281
|
+
] }),
|
|
10282
|
+
f && !M && !N && /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("span", {
|
|
10283
|
+
className: "chat-game-menu-title",
|
|
10284
|
+
children: "Invitar a jugar"
|
|
10285
|
+
}), mu.filter((e) => m.includes(e.type)).map(({ type: e, label: t, Icon: n }) => /* @__PURE__ */ $("button", {
|
|
10286
|
+
type: "button",
|
|
10287
|
+
role: "menuitem",
|
|
10288
|
+
className: "chat-game-menu-item",
|
|
10289
|
+
disabled: p,
|
|
10290
|
+
onClick: () => e === "racing_live" ? ee(!0) : e === "tanks_live" ? P("map") : ce(() => f(e)),
|
|
10291
|
+
children: [/* @__PURE__ */ Q(n, {
|
|
10292
|
+
size: 16,
|
|
10293
|
+
"aria-hidden": "true"
|
|
10294
|
+
}), /* @__PURE__ */ Q("span", { children: t })]
|
|
10295
|
+
}, e))] }),
|
|
10296
|
+
h && !M && !N && /* @__PURE__ */ $(Z, { children: [f && /* @__PURE__ */ Q("hr", { className: "chat-game-menu-separator" }), /* @__PURE__ */ $("button", {
|
|
10297
|
+
type: "button",
|
|
10298
|
+
role: "menuitem",
|
|
10299
|
+
className: "chat-game-menu-item",
|
|
10300
|
+
onClick: () => ce(h),
|
|
10301
|
+
children: [/* @__PURE__ */ Q(ge, {
|
|
10302
|
+
size: 16,
|
|
10303
|
+
"aria-hidden": "true"
|
|
10304
|
+
}), /* @__PURE__ */ Q("span", { children: "Vista previa 3D (sin rival)" })]
|
|
10305
|
+
})] })
|
|
10306
|
+
]
|
|
10126
10307
|
}),
|
|
10127
10308
|
A === "effects" && /* @__PURE__ */ Q(Oi, {
|
|
10128
10309
|
onSend: e,
|
|
@@ -10143,18 +10324,18 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
10143
10324
|
onClose: () => j(null)
|
|
10144
10325
|
})
|
|
10145
10326
|
}),
|
|
10146
|
-
|
|
10147
|
-
className: `chat-gif-picker-wrapper${
|
|
10327
|
+
V && /* @__PURE__ */ $("div", {
|
|
10328
|
+
className: `chat-gif-picker-wrapper${V === "sticker" ? " chat-sticker-picker-wrapper" : ""}`,
|
|
10148
10329
|
style: { height: Math.min(S, w) },
|
|
10149
10330
|
role: "dialog",
|
|
10150
|
-
"aria-label":
|
|
10331
|
+
"aria-label": V === "sticker" ? "Buscar stickers" : "Buscar GIFs",
|
|
10151
10332
|
onKeyDown: (e) => {
|
|
10152
10333
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), j(null), b.current?.focus());
|
|
10153
10334
|
},
|
|
10154
10335
|
children: [/* @__PURE__ */ Q("button", {
|
|
10155
10336
|
type: "button",
|
|
10156
10337
|
className: "chat-gif-resize-handle",
|
|
10157
|
-
"aria-label":
|
|
10338
|
+
"aria-label": V === "sticker" ? "Cambiar altura del selector de stickers" : "Cambiar altura del selector de GIFs",
|
|
10158
10339
|
title: "Arrastra hacia arriba para ampliar · flechas para ajustar",
|
|
10159
10340
|
onPointerDown: (e) => {
|
|
10160
10341
|
e.button === 0 && (e.preventDefault(), e.stopPropagation(), E.current = {
|
|
@@ -10184,7 +10365,7 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
10184
10365
|
].includes(e.key) && (e.preventDefault(), e.stopPropagation(), C((t) => Math.min(w, Math.max(220, e.key === "End" ? w : e.key === "Home" ? 220 : Math.min(t, w) + (e.key === "ArrowUp" ? 30 : -30)))));
|
|
10185
10366
|
},
|
|
10186
10367
|
children: /* @__PURE__ */ Q(Be, { size: 18 })
|
|
10187
|
-
}),
|
|
10368
|
+
}), V === "sticker" ? /* @__PURE__ */ Q(ru, {
|
|
10188
10369
|
onSelect: (e) => {
|
|
10189
10370
|
c?.(e), b.current?.focus();
|
|
10190
10371
|
},
|
|
@@ -10201,18 +10382,18 @@ function hu({ onSendEffect: e, value: t, onChange: n, onSend: r, disabled: i, at
|
|
|
10201
10382
|
/* @__PURE__ */ Q(fu, {
|
|
10202
10383
|
textareaRef: b,
|
|
10203
10384
|
value: t,
|
|
10204
|
-
onInsert:
|
|
10205
|
-
onClose:
|
|
10206
|
-
isOpen:
|
|
10385
|
+
onInsert: ae,
|
|
10386
|
+
onClose: ie,
|
|
10387
|
+
isOpen: re
|
|
10207
10388
|
})
|
|
10208
10389
|
]
|
|
10209
10390
|
});
|
|
10210
10391
|
}
|
|
10211
10392
|
// src/games/shared/ChatGamePanel.jsx
|
|
10212
|
-
function
|
|
10213
|
-
let
|
|
10214
|
-
if (!
|
|
10215
|
-
let { setMinimized: a, dismiss: o } = ks.getState(), s =
|
|
10393
|
+
function yu({ gameKey: e, currentUserId: n }) {
|
|
10394
|
+
let r = t((t) => t.games[e]), i = ks((t) => !!t.panels[e]?.minimized);
|
|
10395
|
+
if (!r) return null;
|
|
10396
|
+
let { setMinimized: a, dismiss: o } = ks.getState(), s = r.game !== "racing_live" && r.status === "active" && j(n, r.turnId), c = M(r), l = r.game === "tanks_live" || r.game === "racing_live", u = A(r) && !r.pendingEvent;
|
|
10216
10397
|
return /* @__PURE__ */ $("section", {
|
|
10217
10398
|
className: `chat-game-panel${i ? " chat-game-panel--minimized" : ""}`,
|
|
10218
10399
|
"aria-label": `Partida activa de ${c}`,
|
|
@@ -10229,7 +10410,7 @@ function gu({ gameKey: e, currentUserId: t }) {
|
|
|
10229
10410
|
/* @__PURE__ */ $("span", { children: [
|
|
10230
10411
|
c,
|
|
10231
10412
|
" · ",
|
|
10232
|
-
|
|
10413
|
+
N(r, n)
|
|
10233
10414
|
] }),
|
|
10234
10415
|
/* @__PURE__ */ Q(Se, {
|
|
10235
10416
|
size: 15,
|
|
@@ -10241,7 +10422,7 @@ function gu({ gameKey: e, currentUserId: t }) {
|
|
|
10241
10422
|
children: /* @__PURE__ */ Q(Us, {
|
|
10242
10423
|
suspended: i,
|
|
10243
10424
|
gameKey: e,
|
|
10244
|
-
currentUserId:
|
|
10425
|
+
currentUserId: n,
|
|
10245
10426
|
variant: "panel",
|
|
10246
10427
|
onMinimize: () => a(e, !0),
|
|
10247
10428
|
onDismiss: u ? () => o(e) : void 0
|
|
@@ -10250,11 +10431,11 @@ function gu({ gameKey: e, currentUserId: t }) {
|
|
|
10250
10431
|
});
|
|
10251
10432
|
}
|
|
10252
10433
|
// src/ui/components/ChatWindow.jsx
|
|
10253
|
-
function
|
|
10434
|
+
function bu({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEffect: r, effectError: i, BattleshipPreviewComponent: a = null, placement: o = "floating", theme: s, standalone: c, onDetach: l, onInstall: u, installHelp: d, onDismissInstallHelp: f, title: p, subtitle: m, headerType: h, headerSecondary: g, headerPresence: _, currentUserName: v, myPresence: y, onSetPresence: b, isOpen: x, isMaximized: S, isMinimized: C, onClose: w, onMinimize: T, onToggleMaximize: E, rooms: D, users: O, messages: k, onInviteGame: A, gameInviteDisabled: j, gameTypes: M, gameError: ee, gamePanelKey: N, currentUserId: P, currentUserIds: te, onSelectRoom: ne, onSelectUser: re, selectedId: F, inputValue: ie, onInputChange: ae, onSend: I, attachments: L, onAddAttachment: oe, onRemoveAttachment: se, status: z, disabled: B, onSearch: V, searchResults: ce, searchStatus: U, searchQuery: K, presenceStatus: le, onCreateGroup: ue, attachmentError: de, sending: fe, reply: q, onReply: pe, onCancelReply: me, privateRooms: Y, knownUsers: X, unreadCounts: he, onlineUsers: ge, editing: _e, onStartEditLast: ve, onCancelEdit: ye, onEditMessage: be, onReact: xe }) {
|
|
10254
10435
|
let [Se, Ce] = ha(), we = W(null), [Te, Ee] = G(!0), [De, Oe] = G(!1);
|
|
10255
10436
|
H(() => {
|
|
10256
10437
|
Oe(!1);
|
|
10257
|
-
}, [
|
|
10438
|
+
}, [F]);
|
|
10258
10439
|
let [ke, Ae] = G(() => window.matchMedia("(max-width: 640px)").matches);
|
|
10259
10440
|
H(() => {
|
|
10260
10441
|
let e = window.matchMedia("(max-width: 640px)"), t = () => Ae(e.matches);
|
|
@@ -10271,13 +10452,13 @@ function _u({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEf
|
|
|
10271
10452
|
},
|
|
10272
10453
|
enabled: Me,
|
|
10273
10454
|
targetRef: we
|
|
10274
|
-
}), Ie = je ? Te : Te ||
|
|
10455
|
+
}), Ie = je ? Te : Te || F == null;
|
|
10275
10456
|
H(() => {
|
|
10276
|
-
|
|
10277
|
-
}, [
|
|
10457
|
+
F != null && !je && Ee(!1);
|
|
10458
|
+
}, [F, je]), H(() => {
|
|
10278
10459
|
let e = () => {
|
|
10279
|
-
let e = x && !C &&
|
|
10280
|
-
dn.getState().setVisibleRoom(e && document.visibilityState === "visible" && document.hasFocus() ?
|
|
10460
|
+
let e = x && !C && F != null && (je || !Ie);
|
|
10461
|
+
dn.getState().setVisibleRoom(e && document.visibilityState === "visible" && document.hasFocus() ? F : null);
|
|
10281
10462
|
};
|
|
10282
10463
|
return e(), window.addEventListener("focus", e), window.addEventListener("blur", e), document.addEventListener("visibilitychange", e), () => {
|
|
10283
10464
|
window.removeEventListener("focus", e), window.removeEventListener("blur", e), document.removeEventListener("visibilitychange", e), dn.getState().setVisibleRoom(null);
|
|
@@ -10285,12 +10466,12 @@ function _u({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEf
|
|
|
10285
10466
|
}, [
|
|
10286
10467
|
x,
|
|
10287
10468
|
C,
|
|
10288
|
-
|
|
10469
|
+
F,
|
|
10289
10470
|
je,
|
|
10290
10471
|
Ie
|
|
10291
10472
|
]);
|
|
10292
10473
|
let Le = (e) => {
|
|
10293
|
-
fe || (je || Ee(!1),
|
|
10474
|
+
fe || (je || Ee(!1), ne?.(e));
|
|
10294
10475
|
}, Re = _a(we, {
|
|
10295
10476
|
active: ke,
|
|
10296
10477
|
autoFocus: x && !C
|
|
@@ -10317,16 +10498,16 @@ function _u({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEf
|
|
|
10317
10498
|
children: p?.charAt(0).toUpperCase()
|
|
10318
10499
|
})
|
|
10319
10500
|
}) : x ? /* @__PURE__ */ Q(Ti, {
|
|
10320
|
-
roomId:
|
|
10501
|
+
roomId: F,
|
|
10321
10502
|
scope: t,
|
|
10322
10503
|
identityScope: n,
|
|
10323
10504
|
messages: k,
|
|
10324
|
-
currentUserIds:
|
|
10505
|
+
currentUserIds: te,
|
|
10325
10506
|
config: {
|
|
10326
10507
|
...e,
|
|
10327
10508
|
enabled: e?.enabled !== !1 && (h === "private" || e?.allowGroups === !0)
|
|
10328
10509
|
},
|
|
10329
|
-
visible: x && !C &&
|
|
10510
|
+
visible: x && !C && F != null && (je || !Ie),
|
|
10330
10511
|
targetRef: we,
|
|
10331
10512
|
children: /* @__PURE__ */ $("div", {
|
|
10332
10513
|
ref: we,
|
|
@@ -10393,24 +10574,24 @@ function _u({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEf
|
|
|
10393
10574
|
onlineUsers: ge,
|
|
10394
10575
|
privateRooms: Y,
|
|
10395
10576
|
knownUsers: X,
|
|
10396
|
-
selectedId:
|
|
10577
|
+
selectedId: F,
|
|
10397
10578
|
onSelect: Le,
|
|
10398
|
-
onSelectUser:
|
|
10399
|
-
onSearch:
|
|
10579
|
+
onSelectUser: re,
|
|
10580
|
+
onSearch: V,
|
|
10400
10581
|
searchResults: ce,
|
|
10401
10582
|
searchStatus: U,
|
|
10402
10583
|
searchQuery: K,
|
|
10403
10584
|
presenceStatus: le,
|
|
10404
10585
|
onCreateGroup: ue,
|
|
10405
10586
|
unreadCounts: he,
|
|
10406
|
-
currentUserId:
|
|
10407
|
-
currentUserIds:
|
|
10587
|
+
currentUserId: P,
|
|
10588
|
+
currentUserIds: te,
|
|
10408
10589
|
currentUserName: v,
|
|
10409
10590
|
myPresence: y,
|
|
10410
10591
|
onSetPresence: b
|
|
10411
10592
|
}), /* @__PURE__ */ Q("div", {
|
|
10412
10593
|
className: "chat-messages-wrapper",
|
|
10413
|
-
children:
|
|
10594
|
+
children: F == null ? /* @__PURE__ */ Q(Fa, {}) : /* @__PURE__ */ $(Z, { children: [
|
|
10414
10595
|
!je && /* @__PURE__ */ $("button", {
|
|
10415
10596
|
type: "button",
|
|
10416
10597
|
className: "chat-back-btn",
|
|
@@ -10423,20 +10604,20 @@ function _u({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEf
|
|
|
10423
10604
|
}),
|
|
10424
10605
|
/* @__PURE__ */ Q(Ks, {
|
|
10425
10606
|
messages: k,
|
|
10426
|
-
currentUserId:
|
|
10607
|
+
currentUserId: P,
|
|
10427
10608
|
onReply: pe,
|
|
10428
|
-
panelGameKey:
|
|
10609
|
+
panelGameKey: N,
|
|
10429
10610
|
onReact: xe,
|
|
10430
10611
|
onEditMessage: be,
|
|
10431
10612
|
editingId: _e?.messageId
|
|
10432
|
-
}, `messages:${
|
|
10433
|
-
|
|
10434
|
-
gameKey:
|
|
10435
|
-
currentUserId:
|
|
10436
|
-
},
|
|
10613
|
+
}, `messages:${F}`),
|
|
10614
|
+
N && !De && /* @__PURE__ */ Q(yu, {
|
|
10615
|
+
gameKey: N,
|
|
10616
|
+
currentUserId: P
|
|
10617
|
+
}, N),
|
|
10437
10618
|
De && a && /* @__PURE__ */ Q("div", {
|
|
10438
10619
|
className: "bs-proto-overlay",
|
|
10439
|
-
children: /* @__PURE__ */ Q(
|
|
10620
|
+
children: /* @__PURE__ */ Q(R, {
|
|
10440
10621
|
fallback: /* @__PURE__ */ Q("p", {
|
|
10441
10622
|
className: "bs-proto-overlay__loading",
|
|
10442
10623
|
role: "status",
|
|
@@ -10451,19 +10632,19 @@ function _u({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEf
|
|
|
10451
10632
|
/* @__PURE__ */ $("div", {
|
|
10452
10633
|
className: "chat-connection-status",
|
|
10453
10634
|
role: "status",
|
|
10454
|
-
children: [/* @__PURE__ */ Q("span", { className: `chat-connection-dot ${
|
|
10635
|
+
children: [/* @__PURE__ */ Q("span", { className: `chat-connection-dot ${z === "connected" ? "chat-connection-dot--connected" : "chat-connection-dot--disconnected"}` }), /* @__PURE__ */ Q("span", { children: z === "connected" ? "Conectado" : "Sin conexión · puedes preparar archivos y notas de voz" })]
|
|
10455
10636
|
}),
|
|
10456
10637
|
i && /* @__PURE__ */ Q("p", {
|
|
10457
10638
|
className: "chat-game-launch-error",
|
|
10458
10639
|
role: "alert",
|
|
10459
10640
|
children: i
|
|
10460
10641
|
}),
|
|
10461
|
-
|
|
10642
|
+
ee && /* @__PURE__ */ Q("p", {
|
|
10462
10643
|
className: "chat-game-launch-error",
|
|
10463
10644
|
role: "alert",
|
|
10464
|
-
children:
|
|
10645
|
+
children: ee
|
|
10465
10646
|
}),
|
|
10466
|
-
/* @__PURE__ */ Q(
|
|
10647
|
+
/* @__PURE__ */ Q(vu, {
|
|
10467
10648
|
onSendEffect: r,
|
|
10468
10649
|
onInviteGame: A,
|
|
10469
10650
|
gameInviteDisabled: j,
|
|
@@ -10474,16 +10655,16 @@ function _u({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEf
|
|
|
10474
10655
|
editing: _e,
|
|
10475
10656
|
onStartEditLast: ve,
|
|
10476
10657
|
onCancelEdit: ye,
|
|
10477
|
-
value:
|
|
10478
|
-
onChange:
|
|
10479
|
-
onSend:
|
|
10480
|
-
disabled:
|
|
10481
|
-
attachments:
|
|
10658
|
+
value: ie,
|
|
10659
|
+
onChange: ae,
|
|
10660
|
+
onSend: I,
|
|
10661
|
+
disabled: B,
|
|
10662
|
+
attachments: L,
|
|
10482
10663
|
sending: fe,
|
|
10483
10664
|
attachmentError: de,
|
|
10484
|
-
onAddAttachment:
|
|
10485
|
-
onRemoveAttachment:
|
|
10486
|
-
}, `composer:${
|
|
10665
|
+
onAddAttachment: oe,
|
|
10666
|
+
onRemoveAttachment: se
|
|
10667
|
+
}, `composer:${F}`)
|
|
10487
10668
|
] })
|
|
10488
10669
|
})]
|
|
10489
10670
|
})
|
|
@@ -10492,31 +10673,31 @@ function _u({ effectsConfig: e, effectScope: t, effectIdentityScope: n, onSendEf
|
|
|
10492
10673
|
}) : null;
|
|
10493
10674
|
}
|
|
10494
10675
|
// src/pwa/chatApp.js
|
|
10495
|
-
var
|
|
10496
|
-
|
|
10497
|
-
},
|
|
10498
|
-
function
|
|
10499
|
-
if (!
|
|
10500
|
-
if (
|
|
10676
|
+
var xu = null, Su = () => typeof window < "u", Cu = () => {
|
|
10677
|
+
Su() && window.dispatchEvent(new Event("chat-install-change"));
|
|
10678
|
+
}, wu = 0, Tu = null;
|
|
10679
|
+
function Eu() {
|
|
10680
|
+
if (!Su()) return () => {};
|
|
10681
|
+
if (wu++ === 0) {
|
|
10501
10682
|
let e = (e) => {
|
|
10502
|
-
e.preventDefault(),
|
|
10683
|
+
e.preventDefault(), xu = e, Cu();
|
|
10503
10684
|
}, t = () => {
|
|
10504
|
-
|
|
10685
|
+
xu = null, Cu();
|
|
10505
10686
|
};
|
|
10506
|
-
window.addEventListener("beforeinstallprompt", e), window.addEventListener("appinstalled", t),
|
|
10687
|
+
window.addEventListener("beforeinstallprompt", e), window.addEventListener("appinstalled", t), Tu = () => {
|
|
10507
10688
|
window.removeEventListener("beforeinstallprompt", e), window.removeEventListener("appinstalled", t);
|
|
10508
10689
|
};
|
|
10509
10690
|
}
|
|
10510
10691
|
let e = !1;
|
|
10511
10692
|
return function() {
|
|
10512
|
-
e || (e = !0, --
|
|
10693
|
+
e || (e = !0, --wu === 0 && (Tu?.(), Tu = null, xu = null));
|
|
10513
10694
|
};
|
|
10514
10695
|
}
|
|
10515
|
-
function
|
|
10516
|
-
let e = () =>
|
|
10696
|
+
function Du() {
|
|
10697
|
+
let e = () => Su() && (window.matchMedia("(display-mode: standalone)").matches || !!navigator.standalone), [t, n] = G(e), [r, i] = G(!!xu), [a, o] = G("");
|
|
10517
10698
|
return H(() => {
|
|
10518
10699
|
let t = window.matchMedia("(display-mode: standalone)"), r = () => {
|
|
10519
|
-
n(e()), i(!!
|
|
10700
|
+
n(e()), i(!!xu);
|
|
10520
10701
|
};
|
|
10521
10702
|
return window.addEventListener("chat-install-change", r), t.addEventListener("change", r), () => {
|
|
10522
10703
|
window.removeEventListener("chat-install-change", r), t.removeEventListener("change", r);
|
|
@@ -10529,12 +10710,12 @@ function wu() {
|
|
|
10529
10710
|
o("Para instalar el chat, abre la aplicación mediante HTTPS o localhost.");
|
|
10530
10711
|
return;
|
|
10531
10712
|
}
|
|
10532
|
-
if (!
|
|
10713
|
+
if (!xu) {
|
|
10533
10714
|
o("Abre el menú del navegador y elige “Instalar LIRA Chat” o “Añadir al Dock / pantalla de inicio”. Si no aparece, abre esta ventana de chat en una pestaña del navegador.");
|
|
10534
10715
|
return;
|
|
10535
10716
|
}
|
|
10536
|
-
let e =
|
|
10537
|
-
|
|
10717
|
+
let e = xu;
|
|
10718
|
+
xu = null, Cu();
|
|
10538
10719
|
try {
|
|
10539
10720
|
await e.prompt(), await e.userChoice;
|
|
10540
10721
|
} catch {
|
|
@@ -10545,24 +10726,25 @@ function wu() {
|
|
|
10545
10726
|
dismissInstallHelp: () => o("")
|
|
10546
10727
|
};
|
|
10547
10728
|
}
|
|
10548
|
-
var
|
|
10549
|
-
function
|
|
10550
|
-
if (
|
|
10729
|
+
var Ou = null;
|
|
10730
|
+
function ku({ path: e = "/chat", windowName: t = "lira-independent-chat" } = {}) {
|
|
10731
|
+
if (Ou && !Ou.closed) return Ou.focus(), !0;
|
|
10551
10732
|
let n = Math.min(520, window.screen.availWidth), r = Math.min(800, window.screen.availHeight);
|
|
10552
|
-
return
|
|
10733
|
+
return Ou = window.open(e, t, `popup=yes,width=${n},height=${r},resizable=yes,scrollbars=yes`), Ou ? (Ou.opener = null, Ou.focus(), !0) : !1;
|
|
10553
10734
|
}
|
|
10554
|
-
function
|
|
10555
|
-
e &&
|
|
10735
|
+
function Au({ enabled: e = !0, path: t = "/chat", swUrl: n = "/chat-sw.js" } = {}) {
|
|
10736
|
+
e && Su() && "serviceWorker" in navigator && window.isSecureContext && window.location.pathname === t && navigator.serviceWorker.register(n, { scope: t }).catch((e) => console.warn("Chat service worker:", e));
|
|
10556
10737
|
}
|
|
10557
10738
|
// src/ui/connected/useChatController.js
|
|
10558
|
-
var
|
|
10559
|
-
function
|
|
10560
|
-
let
|
|
10739
|
+
var ju = 10485760;
|
|
10740
|
+
function Mu({ isOpen: e = !1, isMinimized: n = !1 } = {}) {
|
|
10741
|
+
let i = Du(), { effects: a, features: o } = mr(), s = o?.games, c = U(() => [
|
|
10561
10742
|
"connect4",
|
|
10562
10743
|
"battleship",
|
|
10563
10744
|
"tanks",
|
|
10564
|
-
"tanks_live"
|
|
10565
|
-
|
|
10745
|
+
"tanks_live",
|
|
10746
|
+
"racing_live"
|
|
10747
|
+
].filter((e) => e === "racing_live" ? s?.racingLive === !0 : e === "tanks_live" ? s?.tanksLive === !0 : e === "tanks" ? s?.tanks === !0 : s?.[e] !== !1), [s]), l = a === !1 ? { enabled: !1 } : a ?? {}, d = W(/* @__PURE__ */ new Map()), f = W(!1), [p, m] = G(""), { chatMessages: h, chatState: g, onlineUsers: _, rawPrivateRooms: v, userSearchQuery: y, userSearchResults: b, userSearchStatus: x, presenceStatus: S, rawKnownUsers: C, myPresence: w } = _r(At((e) => ({
|
|
10566
10748
|
chatMessages: e.chatMessages,
|
|
10567
10749
|
chatState: e.chatState,
|
|
10568
10750
|
onlineUsers: e.onlineUsers,
|
|
@@ -10573,7 +10755,7 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10573
10755
|
presenceStatus: e.presenceStatus,
|
|
10574
10756
|
rawKnownUsers: e.knownUsers,
|
|
10575
10757
|
myPresence: e.myPresence
|
|
10576
|
-
}))), T = wr(), E = xr(), D = T.status, { selectChat: O, fetchGroups: k, searchUsers:
|
|
10758
|
+
}))), T = wr(), E = xr(), D = T.status, { selectChat: O, fetchGroups: k, searchUsers: j, setUserSearchQuery: M, sendChatMessage: N, createGroup: P, openPrivateChat: te, setMyPresence: ne } = _r(At((e) => ({
|
|
10577
10759
|
selectChat: e.selectChat,
|
|
10578
10760
|
fetchGroups: e.fetchGroups,
|
|
10579
10761
|
searchUsers: e.searchUsers,
|
|
@@ -10582,69 +10764,69 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10582
10764
|
createGroup: e.createGroup,
|
|
10583
10765
|
openPrivateChat: e.openPrivateChat,
|
|
10584
10766
|
setMyPresence: e.setMyPresence
|
|
10585
|
-
}))),
|
|
10586
|
-
...Object.fromEntries(Object.entries(
|
|
10767
|
+
}))), re = dn((e) => e.counts), F = dn((e) => e.ledger.rooms), ie = U(() => ({
|
|
10768
|
+
...Object.fromEntries(Object.entries(F).map(([e, t]) => [t.peerId, e])),
|
|
10587
10769
|
...v
|
|
10588
|
-
}), [
|
|
10589
|
-
...Object.fromEntries(Object.values(
|
|
10770
|
+
}), [F, v]), ae = U(() => ({
|
|
10771
|
+
...Object.fromEntries(Object.values(F).map((e) => [e.peerId, {
|
|
10590
10772
|
user_id: e.peerId,
|
|
10591
10773
|
username: e.username
|
|
10592
10774
|
}])),
|
|
10593
10775
|
...C
|
|
10594
|
-
}), [
|
|
10776
|
+
}), [F, C]), [I, L] = G(null), [R, oe] = G(null), [se, z] = G(""), B = On((e) => e.edits), V = On((e) => e.reactions);
|
|
10595
10777
|
H(() => {
|
|
10596
|
-
|
|
10778
|
+
L(null), m("");
|
|
10597
10779
|
}, [g.currentChat?.id, T.userId]);
|
|
10598
10780
|
let [ce, K] = G("");
|
|
10599
10781
|
H(() => {
|
|
10600
|
-
|
|
10782
|
+
oe(null);
|
|
10601
10783
|
}, [g.currentChat?.id, T.userId]);
|
|
10602
|
-
let [le, ue] = G([]), [de, fe] = G(!1), q = W(!1), pe = W(/* @__PURE__ */ new Set()), [me, J] = G(""), Y = W([]), X = g.currentChat?.id, he = X ?? null, ge = T.scope, _e =
|
|
10784
|
+
let [le, ue] = G([]), [de, fe] = G(!1), q = W(!1), pe = W(/* @__PURE__ */ new Set()), [me, J] = G(""), Y = W([]), X = g.currentChat?.id, he = X ?? null, ge = T.scope, _e = t(At((e) => Object.keys(e.games).filter((t) => {
|
|
10603
10785
|
let n = e.games[t];
|
|
10604
10786
|
return n.scope === ge && String(n.roomId) === String(X);
|
|
10605
10787
|
}))), ve = U(() => _e.map((e) => {
|
|
10606
|
-
let
|
|
10788
|
+
let n = t.getState().games[e];
|
|
10607
10789
|
return {
|
|
10608
10790
|
id: `game:${e}`,
|
|
10609
10791
|
gameKey: e,
|
|
10610
10792
|
room_id: X,
|
|
10611
|
-
timestamp:
|
|
10793
|
+
timestamp: n.createdAt
|
|
10612
10794
|
};
|
|
10613
|
-
}), [_e, X]), ye =
|
|
10614
|
-
let t = Object.values(e.games).filter((e) => e.scope === ge && String(e.roomId) === String(X)), n = t.find(
|
|
10795
|
+
}), [_e, X]), ye = t((e) => Object.values(e.games).some((e) => e.scope === ge && String(e.roomId) === String(X) && ee(e))), be = ks((e) => e.panels), xe = t((e) => {
|
|
10796
|
+
let t = Object.values(e.games).filter((e) => e.scope === ge && String(e.roomId) === String(X)), n = t.find(ee);
|
|
10615
10797
|
if (n) return n.key;
|
|
10616
|
-
let r = t.filter(
|
|
10798
|
+
let r = t.filter(A).sort((e, t) => (Date.parse(t.createdAt) || 0) - (Date.parse(e.createdAt) || 0))[0];
|
|
10617
10799
|
return r && !be[r.key]?.dismissed ? r.key : null;
|
|
10618
10800
|
});
|
|
10619
10801
|
H(() => {
|
|
10620
|
-
|
|
10802
|
+
z("");
|
|
10621
10803
|
}, [X, ge]), H(() => (Hn({
|
|
10622
10804
|
scope: ge,
|
|
10623
10805
|
room: X,
|
|
10624
|
-
open: e && !
|
|
10806
|
+
open: e && !n
|
|
10625
10807
|
}), () => Hn(null)), [
|
|
10626
10808
|
ge,
|
|
10627
10809
|
X,
|
|
10628
10810
|
e,
|
|
10629
|
-
|
|
10811
|
+
n
|
|
10630
10812
|
]);
|
|
10631
|
-
let Se = e && !
|
|
10813
|
+
let Se = e && !n, Ce = (e) => {
|
|
10632
10814
|
if (q.current) return;
|
|
10633
10815
|
let t = e?.user_id ?? e?.id;
|
|
10634
10816
|
if (!t) return;
|
|
10635
|
-
let n =
|
|
10636
|
-
n ? Ae(n, "private") :
|
|
10817
|
+
let n = ie[t];
|
|
10818
|
+
n ? Ae(n, "private") : te(t);
|
|
10637
10819
|
}, we = T.userId, Te = T.ids, Ee = U(() => ({
|
|
10638
10820
|
ownIds: Te,
|
|
10639
10821
|
resolveName: (e) => {
|
|
10640
|
-
let t =
|
|
10822
|
+
let t = ae?.[e];
|
|
10641
10823
|
if (t?.username || t?.name) return t.name || t.username;
|
|
10642
10824
|
let n = _.find((t) => String(t.user_id ?? t.id) === String(e));
|
|
10643
10825
|
return n?.name || n?.username || null;
|
|
10644
10826
|
}
|
|
10645
10827
|
}), [
|
|
10646
10828
|
Te,
|
|
10647
|
-
|
|
10829
|
+
ae,
|
|
10648
10830
|
_
|
|
10649
10831
|
]);
|
|
10650
10832
|
H(() => {
|
|
@@ -10661,20 +10843,20 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10661
10843
|
De.current = {
|
|
10662
10844
|
connected: e,
|
|
10663
10845
|
visible: Se
|
|
10664
|
-
}, e && (!t.connected || Se && !t.visible) &&
|
|
10846
|
+
}, e && (!t.connected || Se && !t.visible) && j("");
|
|
10665
10847
|
}, [
|
|
10666
10848
|
D,
|
|
10667
10849
|
Se,
|
|
10668
|
-
|
|
10850
|
+
j
|
|
10669
10851
|
]), H(() => {
|
|
10670
10852
|
if (!Se || D !== "connected" || !y) return;
|
|
10671
|
-
let e = setTimeout(() =>
|
|
10853
|
+
let e = setTimeout(() => j(y), 300);
|
|
10672
10854
|
return () => clearTimeout(e);
|
|
10673
10855
|
}, [
|
|
10674
10856
|
y,
|
|
10675
10857
|
D,
|
|
10676
10858
|
Se,
|
|
10677
|
-
|
|
10859
|
+
j
|
|
10678
10860
|
]), H(() => {
|
|
10679
10861
|
Y.current = le;
|
|
10680
10862
|
}, [le]), H(() => {
|
|
@@ -10683,16 +10865,16 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10683
10865
|
e.forEach((e) => URL.revokeObjectURL(e)), e.clear();
|
|
10684
10866
|
};
|
|
10685
10867
|
}, []);
|
|
10686
|
-
let Oe = U(() =>
|
|
10868
|
+
let Oe = U(() => h.map((e) => {
|
|
10687
10869
|
let t = e.data ?? e.payload;
|
|
10688
10870
|
return t && typeof t == "object" ? {
|
|
10689
10871
|
...e,
|
|
10690
10872
|
...t
|
|
10691
10873
|
} : e;
|
|
10692
|
-
}).filter((e) => !["CHAT_JOINED", "CHAT_LEFT"].includes(e.event) && e.room_id != null && String(e.room_id) === String(X) && !
|
|
10874
|
+
}).filter((e) => !["CHAT_JOINED", "CHAT_LEFT"].includes(e.event) && e.room_id != null && String(e.room_id) === String(X) && !r(e.message ?? e.text) && !u(e.message ?? e.text) && !xn(e.message ?? e.text) && (typeof e.message == "string" || typeof e.text == "string" || e.attachments?.length || e.attachment)).map((e) => {
|
|
10693
10875
|
let t = Sn(e);
|
|
10694
10876
|
if (!t) return e;
|
|
10695
|
-
let n =
|
|
10877
|
+
let n = B[t];
|
|
10696
10878
|
return {
|
|
10697
10879
|
...n ? {
|
|
10698
10880
|
...e,
|
|
@@ -10700,13 +10882,13 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10700
10882
|
edited: !0,
|
|
10701
10883
|
editedAt: n.editedAt
|
|
10702
10884
|
} : e,
|
|
10703
|
-
reactionGroups: kn(
|
|
10885
|
+
reactionGroups: kn(V[t], Te)
|
|
10704
10886
|
};
|
|
10705
10887
|
}), [
|
|
10706
|
-
|
|
10888
|
+
h,
|
|
10707
10889
|
X,
|
|
10890
|
+
B,
|
|
10708
10891
|
V,
|
|
10709
|
-
se,
|
|
10710
10892
|
Te
|
|
10711
10893
|
]), ke = U(() => {
|
|
10712
10894
|
let e = [...Oe];
|
|
@@ -10726,17 +10908,17 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10726
10908
|
let t = Sn(e), n = e.message ?? e.text;
|
|
10727
10909
|
if (!t || typeof n != "string" || !n.trim() || !Te.includes(String(e.user_id))) return !1;
|
|
10728
10910
|
let r = n.match(/^> ([^\n]{1,240})\n\n/), i = r ? r[0] : "";
|
|
10729
|
-
return K(n.slice(i.length)),
|
|
10911
|
+
return K(n.slice(i.length)), L(null), J(""), oe({
|
|
10730
10912
|
messageId: t,
|
|
10731
10913
|
original: e,
|
|
10732
10914
|
quote: i
|
|
10733
10915
|
}), !0;
|
|
10734
10916
|
}, Me = () => {
|
|
10735
|
-
|
|
10917
|
+
oe(null), K("");
|
|
10736
10918
|
}, Ne = (e, t) => {
|
|
10737
10919
|
let n = Sn(e);
|
|
10738
10920
|
if (!n || !t || D !== "connected") return;
|
|
10739
|
-
let r = (
|
|
10921
|
+
let r = (V[n]?.[t] || []).some((e) => Te.includes(String(e)));
|
|
10740
10922
|
N(String(e.room_id ?? X), wn({
|
|
10741
10923
|
targetId: n,
|
|
10742
10924
|
emoji: t,
|
|
@@ -10744,18 +10926,18 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10744
10926
|
}), []).catch((e) => J(e.message));
|
|
10745
10927
|
}, Pe = async () => {
|
|
10746
10928
|
if (X == null || q.current || D !== "connected") return;
|
|
10747
|
-
if (
|
|
10748
|
-
let e = ce.trim(), t =
|
|
10749
|
-
if (!e ||
|
|
10929
|
+
if (R) {
|
|
10930
|
+
let e = ce.trim(), t = R.original?.message ?? R.original?.text ?? "";
|
|
10931
|
+
if (!e || R.quote + e === t) {
|
|
10750
10932
|
Me();
|
|
10751
10933
|
return;
|
|
10752
10934
|
}
|
|
10753
10935
|
q.current = !0, fe(!0), J("");
|
|
10754
10936
|
try {
|
|
10755
10937
|
await N(X, Cn({
|
|
10756
|
-
targetId:
|
|
10757
|
-
text:
|
|
10758
|
-
}), []),
|
|
10938
|
+
targetId: R.messageId,
|
|
10939
|
+
text: R.quote + e
|
|
10940
|
+
}), []), oe(null), K("");
|
|
10759
10941
|
} catch (e) {
|
|
10760
10942
|
J(e.message);
|
|
10761
10943
|
} finally {
|
|
@@ -10767,10 +10949,10 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10767
10949
|
if (t || e.length) {
|
|
10768
10950
|
q.current = !0, fe(!0), J("");
|
|
10769
10951
|
try {
|
|
10770
|
-
let n =
|
|
10952
|
+
let n = I ? `> ${String(I.username || "Usuario").replace(/[\r\n]/g, " ").slice(0, 50)}: ${String(I.message || I.text || "[Archivo adjunto]").replace(/\s+/g, " ").slice(0, 180)}\n\n` : "";
|
|
10771
10953
|
await N(X, n + t, e), e.forEach((e) => {
|
|
10772
10954
|
e.kind === "gif" && e.slug && (yn(e) ? Zl(e.slug, { query: e.shareQuery || "" }) : da(e.slug, { query: e.shareQuery || "" }));
|
|
10773
|
-
}),
|
|
10955
|
+
}), L(null), e.forEach((e) => {
|
|
10774
10956
|
e.preview?.startsWith("blob:") && (URL.revokeObjectURL(e.preview), pe.current.delete(e.preview));
|
|
10775
10957
|
}), Y.current = [], ue([]), K("");
|
|
10776
10958
|
} catch (e) {
|
|
@@ -10799,7 +10981,7 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10799
10981
|
return;
|
|
10800
10982
|
}
|
|
10801
10983
|
else {
|
|
10802
|
-
if (!(e instanceof Blob) || !e.size || e.size >
|
|
10984
|
+
if (!(e instanceof Blob) || !e.size || e.size > ju) {
|
|
10803
10985
|
J("Máximo 10 MB por archivo.");
|
|
10804
10986
|
return;
|
|
10805
10987
|
}
|
|
@@ -10823,7 +11005,7 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10823
11005
|
}, Le = g.availableGroups?.find((e) => String(e.id) === String(X)), Re = g.currentChat?.type === "private", ze = _, Be = "Chat", Ve, He = null;
|
|
10824
11006
|
if (X != null) {
|
|
10825
11007
|
if (Re) {
|
|
10826
|
-
let e = Object.keys(
|
|
11008
|
+
let e = Object.keys(ie).find((e) => ie[e] === X), t = e && ae[e] || _.find((t) => String(t.user_id ?? t.id) === String(e));
|
|
10827
11009
|
Be = t?.name || t?.username || (e ? `Usuario ${String(e).slice(0, 8)}` : "Conversación privada"), t?.username && t.username !== Be && (Ve = t.username);
|
|
10828
11010
|
let n = e != null && _.find((t) => String(t.user_id ?? t.id) === String(e));
|
|
10829
11011
|
He = n ? n.status || "online" : null;
|
|
@@ -10833,24 +11015,24 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10833
11015
|
identity: we,
|
|
10834
11016
|
people: Ee,
|
|
10835
11017
|
windowProps: {
|
|
10836
|
-
effectsConfig:
|
|
11018
|
+
effectsConfig: l,
|
|
10837
11019
|
effectIdentityScope: T.scope,
|
|
10838
11020
|
effectScope: `${T.scope}:${E.connectionId ?? E.status}`,
|
|
10839
|
-
effectError:
|
|
10840
|
-
onSendEffect:
|
|
10841
|
-
if (X == null || D !== "connected" || q.current ||
|
|
11021
|
+
effectError: p,
|
|
11022
|
+
onSendEffect: l.enabled !== !1 && (Re || l.allowGroups) ? async (e, t) => {
|
|
11023
|
+
if (X == null || D !== "connected" || q.current || R || f.current) return {
|
|
10842
11024
|
ok: !1,
|
|
10843
11025
|
error: "No se puede enviar un efecto ahora."
|
|
10844
11026
|
};
|
|
10845
|
-
let n = `${T.scope}:${X}`, r =
|
|
11027
|
+
let n = `${T.scope}:${X}`, r = d.current.get(n) ?? 0, i = (l.cooldownMs ?? 5e3) - (Date.now() - r);
|
|
10846
11028
|
if (i > 0) {
|
|
10847
11029
|
let e = `Espera ${Math.ceil(i / 1e3)} s para enviar otro efecto.`;
|
|
10848
|
-
return
|
|
11030
|
+
return m(e), {
|
|
10849
11031
|
ok: !1,
|
|
10850
11032
|
error: e
|
|
10851
11033
|
};
|
|
10852
11034
|
}
|
|
10853
|
-
|
|
11035
|
+
f.current = !0, m("");
|
|
10854
11036
|
try {
|
|
10855
11037
|
return await N(X, ci({
|
|
10856
11038
|
effectId: e,
|
|
@@ -10858,15 +11040,15 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10858
11040
|
endsAt: Date.now() + t.durationMs,
|
|
10859
11041
|
sound: t.sound
|
|
10860
11042
|
} : {}
|
|
10861
|
-
}), []),
|
|
11043
|
+
}), []), d.current.set(n, Date.now()), { ok: !0 };
|
|
10862
11044
|
} catch (e) {
|
|
10863
11045
|
let t = e.message || "No se pudo enviar el efecto.";
|
|
10864
|
-
return
|
|
11046
|
+
return m(t), {
|
|
10865
11047
|
ok: !1,
|
|
10866
11048
|
error: t
|
|
10867
11049
|
};
|
|
10868
11050
|
} finally {
|
|
10869
|
-
|
|
11051
|
+
f.current = !1;
|
|
10870
11052
|
}
|
|
10871
11053
|
} : void 0,
|
|
10872
11054
|
title: Be,
|
|
@@ -10875,11 +11057,11 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10875
11057
|
headerPresence: He,
|
|
10876
11058
|
currentUserName: T.name ?? void 0,
|
|
10877
11059
|
myPresence: w,
|
|
10878
|
-
onSetPresence:
|
|
11060
|
+
onSetPresence: ne,
|
|
10879
11061
|
subtitle: D,
|
|
10880
|
-
onInstall:
|
|
10881
|
-
installHelp:
|
|
10882
|
-
onDismissInstallHelp:
|
|
11062
|
+
onInstall: i.installed ? void 0 : i.install,
|
|
11063
|
+
installHelp: i.installHelp,
|
|
11064
|
+
onDismissInstallHelp: i.dismissInstallHelp,
|
|
10883
11065
|
rooms: g.availableGroups || [],
|
|
10884
11066
|
users: ze,
|
|
10885
11067
|
onlineUsers: _,
|
|
@@ -10887,28 +11069,33 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10887
11069
|
searchResults: b,
|
|
10888
11070
|
searchStatus: x,
|
|
10889
11071
|
searchQuery: y,
|
|
10890
|
-
onSearch:
|
|
10891
|
-
privateRooms:
|
|
10892
|
-
knownUsers:
|
|
11072
|
+
onSearch: M,
|
|
11073
|
+
privateRooms: ie,
|
|
11074
|
+
knownUsers: ae,
|
|
10893
11075
|
messages: ke,
|
|
10894
11076
|
gamePanelKey: xe,
|
|
10895
|
-
gameError:
|
|
11077
|
+
gameError: se,
|
|
10896
11078
|
gameInviteDisabled: ye || D !== "connected",
|
|
10897
|
-
gameTypes:
|
|
10898
|
-
onInviteGame: Re && X != null ? (e = "connect4") => {
|
|
10899
|
-
let
|
|
10900
|
-
|
|
11079
|
+
gameTypes: c,
|
|
11080
|
+
onInviteGame: Re && X != null ? (e = "connect4", n = {}) => {
|
|
11081
|
+
let r = Object.keys(ie).find((e) => String(ie[e]) === String(X));
|
|
11082
|
+
r ? (z(""), t.getState().invite({
|
|
10901
11083
|
roomId: String(X),
|
|
10902
|
-
opponentId:
|
|
10903
|
-
gameType: e
|
|
10904
|
-
|
|
11084
|
+
opponentId: r,
|
|
11085
|
+
gameType: e,
|
|
11086
|
+
...e === "racing_live" && n.speedClass ? { speedClass: n.speedClass } : {},
|
|
11087
|
+
...e === "tanks_live" ? {
|
|
11088
|
+
...n.mapId ? { mapId: n.mapId } : {},
|
|
11089
|
+
...n.lives ? { lives: n.lives } : {}
|
|
11090
|
+
} : {}
|
|
11091
|
+
}).catch((e) => z(e.message))) : z("Abre de nuevo la conversación privada para invitar a jugar.");
|
|
10905
11092
|
} : void 0,
|
|
10906
11093
|
currentUserId: we,
|
|
10907
11094
|
currentUserIds: Te,
|
|
10908
|
-
unreadCounts:
|
|
11095
|
+
unreadCounts: re,
|
|
10909
11096
|
onSelectRoom: (e) => Ae(e),
|
|
10910
11097
|
onSelectUser: Ce,
|
|
10911
|
-
editing:
|
|
11098
|
+
editing: R,
|
|
10912
11099
|
onStartEditLast: () => {
|
|
10913
11100
|
let e = An(Oe, Te);
|
|
10914
11101
|
return e ? je(e) : !1;
|
|
@@ -10920,15 +11107,15 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10920
11107
|
je(e);
|
|
10921
11108
|
},
|
|
10922
11109
|
onReact: Ne,
|
|
10923
|
-
reply:
|
|
11110
|
+
reply: I,
|
|
10924
11111
|
onReply: (e) => {
|
|
10925
|
-
q.current ||
|
|
11112
|
+
q.current || L({
|
|
10926
11113
|
...e,
|
|
10927
11114
|
message: ui(e.message ?? e.text)
|
|
10928
11115
|
});
|
|
10929
11116
|
},
|
|
10930
11117
|
onCancelReply: () => {
|
|
10931
|
-
q.current ||
|
|
11118
|
+
q.current || L(null);
|
|
10932
11119
|
},
|
|
10933
11120
|
selectedId: he,
|
|
10934
11121
|
inputValue: ce,
|
|
@@ -10951,46 +11138,46 @@ function ku({ isOpen: e = !1, isMinimized: t = !1 } = {}) {
|
|
|
10951
11138
|
};
|
|
10952
11139
|
}
|
|
10953
11140
|
// src/ui/connected/chatUiStore.js
|
|
10954
|
-
var
|
|
11141
|
+
var Nu = ue((e) => ({
|
|
10955
11142
|
isOpen: !1,
|
|
10956
11143
|
open: () => e({ isOpen: !0 }),
|
|
10957
11144
|
close: () => e({ isOpen: !1 }),
|
|
10958
11145
|
toggle: () => e((e) => ({ isOpen: !e.isOpen }))
|
|
10959
|
-
})),
|
|
10960
|
-
function
|
|
10961
|
-
let r = mr(), i = e === "embedded" || e === "page", a = t !== void 0, o =
|
|
11146
|
+
})), Pu = (e) => e, Fu = (e = Pu) => de(Nu, e), Iu = (e) => !e || e === document || e === document.body || document.documentElement === e || typeof e.closest == "function" && !!e.closest(".chat-window");
|
|
11147
|
+
function Lu({ mode: e = "floating", open: t, onOpenChange: n } = {}) {
|
|
11148
|
+
let r = mr(), i = e === "embedded" || e === "page", a = t !== void 0, o = Fu((e) => e.isOpen), s = i || !!(a ? t : o), [c, l] = G(!1), [u, d] = G(!1), f = W({});
|
|
10962
11149
|
f.current = {
|
|
10963
11150
|
controlled: a,
|
|
10964
11151
|
onOpenChange: n,
|
|
10965
11152
|
onConfigOpenChange: r?.callbacks?.onOpenChange
|
|
10966
11153
|
};
|
|
10967
|
-
let p =
|
|
11154
|
+
let p = B((e) => {
|
|
10968
11155
|
let { controlled: t, onOpenChange: n, onConfigOpenChange: r } = f.current;
|
|
10969
|
-
t ||
|
|
11156
|
+
t || Nu.setState({ isOpen: e }), n?.(e), r?.(e);
|
|
10970
11157
|
}, []);
|
|
10971
11158
|
H(() => {
|
|
10972
11159
|
s && d(!1);
|
|
10973
11160
|
}, [s]);
|
|
10974
|
-
let m = e === "floating", h =
|
|
11161
|
+
let m = e === "floating", h = B(() => {
|
|
10975
11162
|
d(!0), p(!1);
|
|
10976
|
-
}, [p]), g =
|
|
11163
|
+
}, [p]), g = B(() => {
|
|
10977
11164
|
d(!1), p(!0);
|
|
10978
|
-
}, [p]), _ =
|
|
11165
|
+
}, [p]), _ = B(() => {
|
|
10979
11166
|
d(!1), p(!1);
|
|
10980
|
-
}, [p]), v =
|
|
11167
|
+
}, [p]), v = B(() => {
|
|
10981
11168
|
u ? g() : h();
|
|
10982
11169
|
}, [
|
|
10983
11170
|
u,
|
|
10984
11171
|
g,
|
|
10985
11172
|
h
|
|
10986
|
-
]), y =
|
|
11173
|
+
]), y = B(() => l((e) => !e), []), b = r?.pwa, x = B(() => ku({
|
|
10987
11174
|
path: b?.path,
|
|
10988
11175
|
windowName: b?.windowName
|
|
10989
11176
|
}) ? (d(!1), p(!1), !0) : !1, [b, p]);
|
|
10990
11177
|
return H(() => {
|
|
10991
11178
|
if (!s || i) return;
|
|
10992
11179
|
let e = (e) => {
|
|
10993
|
-
e.key === "Escape" && !e.defaultPrevented &&
|
|
11180
|
+
e.key === "Escape" && !e.defaultPrevented && Iu(e.target) && (e.preventDefault(), m ? h() : _());
|
|
10994
11181
|
};
|
|
10995
11182
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
10996
11183
|
}, [
|
|
@@ -11016,8 +11203,8 @@ function Pu({ mode: e = "floating", open: t, onOpenChange: n } = {}) {
|
|
|
11016
11203
|
};
|
|
11017
11204
|
}
|
|
11018
11205
|
// src/ui/connected/ChatWindow.jsx
|
|
11019
|
-
var
|
|
11020
|
-
function
|
|
11206
|
+
var Ru = "El navegador bloqueó la ventana. Permite ventanas emergentes para este sitio.", zu = (e) => typeof document > "u" ? null : (typeof e?.portalContainer == "function" ? e.portalContainer() : e?.portalContainer) || document.body;
|
|
11207
|
+
function Bu({ open: e, onClose: t, theme: n, children: r }) {
|
|
11021
11208
|
let i = W(null), a = _a(i, {
|
|
11022
11209
|
active: e,
|
|
11023
11210
|
autoFocus: e
|
|
@@ -11036,15 +11223,15 @@ function Lu({ open: e, onClose: t, theme: n, children: r }) {
|
|
|
11036
11223
|
})
|
|
11037
11224
|
}) : null;
|
|
11038
11225
|
}
|
|
11039
|
-
function
|
|
11040
|
-
let o = mr(), s = e === "modal" || e === "embedded" ? e : "floating", c =
|
|
11226
|
+
function Vu({ placement: e = "floating", open: t, onOpenChange: n, theme: r, className: i, BattleshipPreviewComponent: a = null }) {
|
|
11227
|
+
let o = mr(), s = e === "modal" || e === "embedded" ? e : "floating", c = Lu({
|
|
11041
11228
|
mode: s,
|
|
11042
11229
|
open: t,
|
|
11043
11230
|
onOpenChange: n
|
|
11044
|
-
}), l =
|
|
11231
|
+
}), l = Mu({
|
|
11045
11232
|
isOpen: c.isOpen,
|
|
11046
11233
|
isMinimized: c.isMinimized
|
|
11047
|
-
}), u = s === "floating", d = u && o?.features?.detach !== !1, f = /* @__PURE__ */ Q(
|
|
11234
|
+
}), u = s === "floating", d = u && o?.features?.detach !== !1, f = /* @__PURE__ */ Q(bu, {
|
|
11048
11235
|
...l.windowProps,
|
|
11049
11236
|
BattleshipPreviewComponent: a,
|
|
11050
11237
|
placement: s,
|
|
@@ -11053,7 +11240,7 @@ function Ru({ placement: e = "floating", open: t, onOpenChange: n, theme: r, cla
|
|
|
11053
11240
|
isMaximized: u && c.isMaximized,
|
|
11054
11241
|
isMinimized: c.isMinimized,
|
|
11055
11242
|
onDetach: d ? () => {
|
|
11056
|
-
c.detach() || l.setAttachmentError(
|
|
11243
|
+
c.detach() || l.setAttachmentError(Ru);
|
|
11057
11244
|
} : void 0,
|
|
11058
11245
|
onClose: s === "embedded" ? void 0 : c.close,
|
|
11059
11246
|
onMinimize: u ? c.toggleMinimize : void 0,
|
|
@@ -11066,8 +11253,8 @@ function Ru({ placement: e = "floating", open: t, onOpenChange: n, theme: r, cla
|
|
|
11066
11253
|
className: `mc-chat-embedded${i ? ` ${i}` : ""}`,
|
|
11067
11254
|
children: p
|
|
11068
11255
|
});
|
|
11069
|
-
let m =
|
|
11070
|
-
return m ? Ot(s === "modal" ? /* @__PURE__ */ Q(
|
|
11256
|
+
let m = zu(o);
|
|
11257
|
+
return m ? Ot(s === "modal" ? /* @__PURE__ */ Q(Bu, {
|
|
11071
11258
|
open: c.isOpen,
|
|
11072
11259
|
onClose: c.close,
|
|
11073
11260
|
theme: r,
|
|
@@ -11081,15 +11268,15 @@ function Ru({ placement: e = "floating", open: t, onOpenChange: n, theme: r, cla
|
|
|
11081
11268
|
}) : p, m) : null;
|
|
11082
11269
|
}
|
|
11083
11270
|
// src/ui/connected/ChatPage.jsx
|
|
11084
|
-
function
|
|
11085
|
-
let r = mr(), i =
|
|
11271
|
+
function Hu({ theme: e, className: t, BattleshipPreviewComponent: n = null }) {
|
|
11272
|
+
let r = mr(), i = Lu({ mode: "page" }), a = Mu({
|
|
11086
11273
|
isOpen: !0,
|
|
11087
11274
|
isMinimized: !1
|
|
11088
11275
|
});
|
|
11089
11276
|
if (typeof document > "u") return null;
|
|
11090
11277
|
let o = (typeof r?.portalContainer == "function" ? r.portalContainer() : r?.portalContainer) || document.body, s = /* @__PURE__ */ Q(ys.Provider, {
|
|
11091
11278
|
value: a.people,
|
|
11092
|
-
children: /* @__PURE__ */ Q(
|
|
11279
|
+
children: /* @__PURE__ */ Q(bu, {
|
|
11093
11280
|
...a.windowProps,
|
|
11094
11281
|
BattleshipPreviewComponent: n,
|
|
11095
11282
|
placement: "page",
|
|
@@ -11106,13 +11293,13 @@ function zu({ theme: e, className: t, BattleshipPreviewComponent: n = null }) {
|
|
|
11106
11293
|
}) : s, o);
|
|
11107
11294
|
}
|
|
11108
11295
|
// src/ui/connected/ChatButton.jsx
|
|
11109
|
-
function
|
|
11110
|
-
let o = dn(nn), s =
|
|
11296
|
+
function Uu({ className: e, label: t = "Chat", onClick: n, pressed: r, badgeClassName: i, iconSize: a = 17 }) {
|
|
11297
|
+
let o = dn(nn), s = Fu((e) => e.isOpen), c = r ?? (n ? void 0 : s);
|
|
11111
11298
|
return /* @__PURE__ */ $("button", {
|
|
11112
11299
|
type: "button",
|
|
11113
11300
|
className: e ?? "mc-chat mc-chat-button",
|
|
11114
11301
|
onClick: (e) => {
|
|
11115
|
-
n ? n(e) :
|
|
11302
|
+
n ? n(e) : Nu.getState().toggle();
|
|
11116
11303
|
},
|
|
11117
11304
|
"aria-label": o ? `${t}, ${o} mensajes nuevos` : t,
|
|
11118
11305
|
"aria-pressed": c,
|
|
@@ -11127,19 +11314,19 @@ function Bu({ className: e, label: t = "Chat", onClick: n, pressed: r, badgeClas
|
|
|
11127
11314
|
});
|
|
11128
11315
|
}
|
|
11129
11316
|
// src/notifications/appBadge.js
|
|
11130
|
-
var
|
|
11317
|
+
var Wu = /* @__PURE__ */ new WeakMap(), Gu = (e, t, n, ...r) => {
|
|
11131
11318
|
try {
|
|
11132
11319
|
let i = e[t](...r);
|
|
11133
11320
|
i && typeof i.catch == "function" && i.catch(n);
|
|
11134
11321
|
} catch {
|
|
11135
11322
|
n();
|
|
11136
11323
|
}
|
|
11137
|
-
},
|
|
11138
|
-
function
|
|
11139
|
-
if (
|
|
11324
|
+
}, Ku = (e = dn) => Wu.has(e);
|
|
11325
|
+
function qu({ store: e = dn, nav: t = globalThis.navigator, schedule: n = queueMicrotask } = {}) {
|
|
11326
|
+
if (Wu.has(e)) return Wu.get(e);
|
|
11140
11327
|
if (!t || !("setAppBadge" in t)) {
|
|
11141
11328
|
let t = () => {};
|
|
11142
|
-
return
|
|
11329
|
+
return Wu.set(e, t), t;
|
|
11143
11330
|
}
|
|
11144
11331
|
let r, i = !1, a = () => {
|
|
11145
11332
|
i = !1;
|
|
@@ -11149,33 +11336,33 @@ function Wu({ store: e = dn, nav: t = globalThis.navigator, schedule: n = queueM
|
|
|
11149
11336
|
let o = () => {
|
|
11150
11337
|
r === a && (r = void 0);
|
|
11151
11338
|
};
|
|
11152
|
-
a > 0 ?
|
|
11339
|
+
a > 0 ? Gu(t, "setAppBadge", o, a) : "clearAppBadge" in t ? Gu(t, "clearAppBadge", o) : Gu(t, "setAppBadge", o, 0);
|
|
11153
11340
|
};
|
|
11154
11341
|
a();
|
|
11155
11342
|
let o = e.subscribe(() => {
|
|
11156
11343
|
i || (i = !0, n(a));
|
|
11157
11344
|
}), s = () => {
|
|
11158
|
-
o(),
|
|
11345
|
+
o(), Wu.delete(e);
|
|
11159
11346
|
};
|
|
11160
|
-
return
|
|
11347
|
+
return Wu.set(e, s), s;
|
|
11161
11348
|
}
|
|
11162
11349
|
// src/ui/connected/ChatNotifications.jsx
|
|
11163
|
-
function
|
|
11164
|
-
let e = mr()?.notifications, t = e !== !1, n = t && e?.desktop !== !1, r = t && e?.appBadge !== !1,
|
|
11350
|
+
function Ju() {
|
|
11351
|
+
let e = mr()?.notifications, t = e !== !1, n = t && e?.desktop !== !1, r = t && e?.appBadge !== !1, i = t && e?.sound !== !1;
|
|
11165
11352
|
return H(() => n ? Zn() : void 0, [n]), H(() => {
|
|
11166
|
-
if (r && !
|
|
11353
|
+
if (r && !Ku()) return qu();
|
|
11167
11354
|
}, [r]), H(() => {
|
|
11168
|
-
if (
|
|
11169
|
-
}, [
|
|
11355
|
+
if (i && (b(), !re())) return ne();
|
|
11356
|
+
}, [i]), null;
|
|
11170
11357
|
}
|
|
11171
11358
|
// src/core/relay/fileRelay.js
|
|
11172
|
-
var
|
|
11359
|
+
var Yu = 10485760, Xu = /* @__PURE__ */ new WeakMap(), Zu = (e) => (Xu.has(e) || Xu.set(e, {
|
|
11173
11360
|
pending: /* @__PURE__ */ new Map(),
|
|
11174
11361
|
files: /* @__PURE__ */ new Map()
|
|
11175
|
-
}),
|
|
11176
|
-
function
|
|
11362
|
+
}), Xu.get(e));
|
|
11363
|
+
function Qu(e, t, n) {
|
|
11177
11364
|
if (e?.readyState !== WebSocket.OPEN) return Promise.reject(/* @__PURE__ */ Error("Sin conexión"));
|
|
11178
|
-
let r =
|
|
11365
|
+
let r = Zu(e), i = c();
|
|
11179
11366
|
return new Promise((a, o) => {
|
|
11180
11367
|
let s = setTimeout(() => {
|
|
11181
11368
|
r.pending.delete(i), o(/* @__PURE__ */ Error("El servidor no confirmó el envío. Conservamos el borrador."));
|
|
@@ -11193,8 +11380,8 @@ function Yu(e, t, n) {
|
|
|
11193
11380
|
}));
|
|
11194
11381
|
});
|
|
11195
11382
|
}
|
|
11196
|
-
function
|
|
11197
|
-
let n =
|
|
11383
|
+
function $u(e, t) {
|
|
11384
|
+
let n = Zu(e), r = t.data || t.payload || {};
|
|
11198
11385
|
if (t.event === "CHAT_ACK" || t.event === "ERROR" || t.type === "ERROR") {
|
|
11199
11386
|
let e = n.pending.get(r.request_id);
|
|
11200
11387
|
return e ? (clearTimeout(e.timer), n.pending.delete(r.request_id), t.event === "CHAT_ACK" ? e.resolve() : e.reject(Error(r.message || "No se pudo enviar")), !0) : !1;
|
|
@@ -11202,7 +11389,7 @@ function Xu(e, t) {
|
|
|
11202
11389
|
if (t.event !== "CHAT_FILE") return !1;
|
|
11203
11390
|
let i = Date.now();
|
|
11204
11391
|
for (let [e, t] of n.files) i - t.created > 6e4 && n.files.delete(e);
|
|
11205
|
-
if (!Number.isInteger(r.size) || r.size <= 0 || r.size >
|
|
11392
|
+
if (!Number.isInteger(r.size) || r.size <= 0 || r.size > Yu) return !0;
|
|
11206
11393
|
if (r.index === 0) {
|
|
11207
11394
|
if (n.files.size >= 4) return !0;
|
|
11208
11395
|
n.files.set(r.id, {
|
|
@@ -11219,8 +11406,8 @@ function Xu(e, t) {
|
|
|
11219
11406
|
let o = atob(r.chunk), s = Uint8Array.from(o, (e) => e.charCodeAt(0));
|
|
11220
11407
|
return a.bytes += s.length, a.bytes > r.size || s.length > 32768 ? (n.files.delete(r.id), !0) : (a.parts.push(s), a.index++, r.final && a.bytes === r.size && (a.blob = new Blob(a.parts, { type: r.type })), !0);
|
|
11221
11408
|
}
|
|
11222
|
-
function
|
|
11223
|
-
let n =
|
|
11409
|
+
function ed(e, t) {
|
|
11410
|
+
let n = Zu(e);
|
|
11224
11411
|
return {
|
|
11225
11412
|
...t,
|
|
11226
11413
|
attachments: (t.attachments || []).map((e) => {
|
|
@@ -11236,13 +11423,13 @@ function Zu(e, t) {
|
|
|
11236
11423
|
})
|
|
11237
11424
|
};
|
|
11238
11425
|
}
|
|
11239
|
-
function
|
|
11240
|
-
let t =
|
|
11426
|
+
function td(e) {
|
|
11427
|
+
let t = Xu.get(e);
|
|
11241
11428
|
t && (t.pending.forEach(({ reject: e, timer: t }) => {
|
|
11242
11429
|
clearTimeout(t), e(/* @__PURE__ */ Error("Conexión interrumpida. Reintenta el envío."));
|
|
11243
11430
|
}), t.pending.clear(), t.files.clear());
|
|
11244
11431
|
}
|
|
11245
|
-
async function
|
|
11432
|
+
async function nd(e, t, n, r = []) {
|
|
11246
11433
|
if (r.length > 1) throw Error("Envía un archivo o GIF por mensaje.");
|
|
11247
11434
|
let i = [];
|
|
11248
11435
|
for (let n of r) {
|
|
@@ -11255,11 +11442,11 @@ async function $u(e, t, n, r = []) {
|
|
|
11255
11442
|
continue;
|
|
11256
11443
|
}
|
|
11257
11444
|
let r = n.file;
|
|
11258
|
-
if (!(r instanceof Blob) || !r.size || r.size >
|
|
11259
|
-
let a =
|
|
11445
|
+
if (!(r instanceof Blob) || !r.size || r.size > Yu) throw Error("El archivo debe pesar entre 1 byte y 10 MB.");
|
|
11446
|
+
let a = c();
|
|
11260
11447
|
for (let i = 0, o = 0; i < r.size; i += 32768, o++) {
|
|
11261
11448
|
let s = new Uint8Array(await r.slice(i, i + 32768).arrayBuffer()), c = btoa(String.fromCharCode(...s));
|
|
11262
|
-
await
|
|
11449
|
+
await Qu(e, "CHAT_FILE", {
|
|
11263
11450
|
id: a,
|
|
11264
11451
|
room_id: t,
|
|
11265
11452
|
size: r.size,
|
|
@@ -11271,14 +11458,14 @@ async function $u(e, t, n, r = []) {
|
|
|
11271
11458
|
}
|
|
11272
11459
|
i.push({ id: a });
|
|
11273
11460
|
}
|
|
11274
|
-
await
|
|
11461
|
+
await Qu(e, "CHAT_MESSAGE", {
|
|
11275
11462
|
room_id: t,
|
|
11276
11463
|
message: n,
|
|
11277
11464
|
attachments: i
|
|
11278
11465
|
});
|
|
11279
11466
|
}
|
|
11280
11467
|
// src/net/webrtc/index.js
|
|
11281
|
-
var
|
|
11282
|
-
export {
|
|
11468
|
+
var rd = se(() => import("./chunks/WebRtcLab-ClRSYt4E.js")), id = "0.1.0", ad = () => import("./chunks/BattleshipPrototype-CmQd5AUO.js");
|
|
11469
|
+
export { Uu as ChatButton, S as ChatContext, Ju as ChatNotifications, Hu as ChatPage, ys as ChatPeopleContext, Vu as ChatWindow, bu as ChatWindowShell, Mt as DEFAULT_CONFIG, h as DEFAULT_ICE_SERVERS, pn as EDIT_PREFIX, kr as EFFECT_CATALOG, ri as EFFECT_PREFIX, gs as EmojiPicker, Pl as GifPicker, Mi as LiraChatProvider, Qn as MAX_CHAT_MESSAGES, d as MAX_SIGNAL_LENGTH, id as MINICODE_CHAT_VERSION, Es as MessageBubble, vu as MessageComposer, Ks as MessageList, mn as REACT_PREFIX, vn as STICKER_NAME_PREFIX, ru as StickerPicker, Ni as TRANSPORT_STATUSES, l as WEBRTC_PREFIX, rd as WebRtcLab, Fi as assertTransport, O as chatConnectionStore, i as chatGamesStore, Nu as chatUiStore, td as closeRelay, Vi as configureKlipy, $u as consumeRelayEvent, n as createChatSignaling, dr as createChatStore, f as createPeerLink, Gt as createStandaloneTransport, li as decodeEffect, p as decodeSignal, Cn as encodeEdit, ci as encodeEffect, wn as encodeReaction, m as encodeSignal, a as getChatAssetsBaseUrl, Ar as getChatEffect, kn as groupReactions, ed as hydrateRelayMessage, xn as isMessageAction, yn as isStickerAttachment, u as isWebrtcMessage, ad as loadBattleshipPreview, Rt as normalizeConfig, Pt as normalizeUser, ku as openChatWindow, Tn as parseMessageAction, Au as registerChatWorker, e as rtcSignals, nd as sendRelayMessage, o as setChatAssetsBaseUrl, E as setChatConnectionStatus, qu as startAppBadge, Eu as startChatApp, ne as startConnect4Sounds, Zn as startDesktopNotifications, ss as startEmojiPreferencesSync, Hc as startGifLibrarySync, fn as startUnreadStorageSync, nn as totalUnread, Zt as unreadScope, mr as useChatConfig, xr as useChatConnection, D as useChatConnectionStatus, v as useChatContext, t as useChatGames, wr as useChatIdentity, Du as useChatInstall, _r as useChatStore, vr as useChatStoreApi, hr as useChatTransport, Fu as useChatUi, dn as useChatUnread, Cr as useChatUnreadTotal, I as withSignalFaults };
|
|
11283
11470
|
|
|
11284
11471
|
//# sourceMappingURL=index.js.map
|