@bcc-code/vue-bcc-chat-ui 7.1.29 → 7.1.31

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.
@@ -1,16 +1,16 @@
1
- import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as L, withModifiers as R } from "vue";
2
- import { BccAvatar as te, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as V, BccMessage as ae, BccProgressSpinner as H, BccTag as oe } from "@bcc-code/component-library-vue";
3
- import { CometChat as U } from "@cometchat/chat-sdk-javascript";
4
- import { AddIcon as se, AttachFileIcon as ce, BarChartIcon as W, CalendarAddOnIcon as le, CheckIcon as ue, CloseIcon as de, CodeBlocksIcon as fe, ContentCopyIcon as pe, DeleteIcon as me, DescriptionIcon as he, DoneAllIcon as ge, EditCalendarIcon as _e, EditIcon as ve, ErrorIcon as ye, FilePresentIcon as be, FolderZipIcon as xe, ForumIcon as Se, ImageIcon as Ce, InfoIcon as we, KeyboardArrowDownIcon as Te, KeyboardArrowUpIcon as Ee, MicIcon as De, OpenInNewIcon as Oe, PendingIcon as ke, PictureAsPdfIcon as Ae, ReplyIcon as je, ScheduleIcon as Me, SendIcon as Ne, TableChartIcon as Pe, TextSnippetIcon as Fe, TranslateIcon as Ie, VideocamIcon as Le } from "@bcc-code/icons-vue";
1
+ import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as N, vModelText as ee, vShow as P, watch as F, withCtx as I, withDirectives as te, withModifiers as L } from "vue";
2
+ import { BccAvatar as R, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as ae, BccMessage as oe, BccProgressSpinner as se, BccTag as V } from "@bcc-code/component-library-vue";
3
+ import { CometChat as H } from "@cometchat/chat-sdk-javascript";
4
+ import { AddIcon as U, AttachFileIcon as ce, BarChartIcon as le, CalendarAddOnIcon as ue, CheckIcon as de, CloseIcon as fe, CodeBlocksIcon as pe, ContentCopyIcon as me, DeleteIcon as he, DescriptionIcon as ge, DoneAllIcon as _e, EditCalendarIcon as ve, EditIcon as ye, ErrorIcon as be, FilePresentIcon as xe, FolderZipIcon as Se, ForumIcon as Ce, ImageIcon as we, InfoIcon as Te, KeyboardArrowDownIcon as Ee, KeyboardArrowUpIcon as De, MicIcon as Oe, OpenInNewIcon as ke, PendingIcon as Ae, PictureAsPdfIcon as je, ReplyIcon as Me, ScheduleIcon as Ne, SendIcon as Pe, TableChartIcon as Fe, TextSnippetIcon as Ie, TranslateIcon as Le, VideocamIcon as Re } from "@bcc-code/icons-vue";
5
5
  //#region \0rolldown/runtime.js
6
- var G = Object.defineProperty, Re = (e, t) => {
6
+ var W = Object.defineProperty, ze = (e, t) => {
7
7
  let n = {};
8
- for (var r in e) G(n, r, {
8
+ for (var r in e) W(n, r, {
9
9
  get: e[r],
10
10
  enumerable: !0
11
11
  });
12
- return t || G(n, Symbol.toStringTag, { value: "Module" }), n;
13
- }, ze = {
12
+ return t || W(n, Symbol.toStringTag, { value: "Module" }), n;
13
+ }, Be = {
14
14
  prod: {
15
15
  region: "eu",
16
16
  appId: "2520339d45a9d557",
@@ -21,62 +21,62 @@ var G = Object.defineProperty, Re = (e, t) => {
21
21
  appId: "24847302853e129f",
22
22
  chatApiBaseUrl: "https://chat.api.sandbox.bcc.no"
23
23
  }
24
- }, Be = null;
25
- function Ve(e) {
26
- Be = e;
24
+ }, Ve = null;
25
+ function He(e) {
26
+ Ve = e;
27
27
  }
28
- function K() {
29
- if (!Be) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
30
- return ze[Be];
28
+ function G() {
29
+ if (!Ve) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
30
+ return Be[Ve];
31
31
  }
32
32
  //#endregion
33
33
  //#region src/chat/accessToken.ts
34
- var He = ":loginAccessToken", Ue = ":token", We = void 0;
35
- function Ge(e) {
36
- return `${K().appId}${e}`;
34
+ var Ue = ":loginAccessToken", We = ":token", Ge = void 0;
35
+ function Ke(e) {
36
+ return `${G().appId}${e}`;
37
37
  }
38
- function Ke() {
39
- return We === void 0 && (We = localStorage.getItem(Ge(He))), We;
38
+ function qe() {
39
+ return Ge === void 0 && (Ge = localStorage.getItem(Ke(Ue))), Ge;
40
40
  }
41
- function qe(e) {
42
- We = e;
43
- let t = Ge(He);
41
+ function Je(e) {
42
+ Ge = e;
43
+ let t = Ke(Ue);
44
44
  if (e) {
45
45
  localStorage.setItem(t, e);
46
46
  return;
47
47
  }
48
48
  localStorage.removeItem(t);
49
49
  }
50
- function Je() {
51
- let e = Ge(Ue), t = localStorage.getItem(e);
50
+ function Ye() {
51
+ let e = Ke(We), t = localStorage.getItem(e);
52
52
  return t ? JSON.parse(t) : null;
53
53
  }
54
- function Ye() {
55
- return Je();
54
+ function Xe() {
55
+ return Ye();
56
56
  }
57
- function Xe(e) {
58
- localStorage.setItem(Ge(Ue), JSON.stringify(e));
57
+ function Ze(e) {
58
+ localStorage.setItem(Ke(We), JSON.stringify(e));
59
59
  }
60
- function Ze() {
61
- localStorage.removeItem(Ge(Ue));
60
+ function Qe() {
61
+ localStorage.removeItem(Ke(We));
62
62
  }
63
63
  //#endregion
64
64
  //#region src/chat/avatar.ts
65
- function Qe(e) {
66
- let t = et(e);
65
+ function $e(e) {
66
+ let t = tt(e);
67
67
  if (!t) return;
68
68
  let n = t.trim();
69
69
  if (n) {
70
70
  try {
71
- if (tt(new URL(n))) return `${K().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
71
+ if (nt(new URL(n))) return `${G().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
72
72
  } catch {}
73
73
  return n;
74
74
  }
75
75
  }
76
- function $e(e) {
77
- return Qe(e) ?? e;
78
- }
79
76
  function et(e) {
77
+ return $e(e) ?? e;
78
+ }
79
+ function tt(e) {
80
80
  if (typeof e == "string") return e;
81
81
  if (!e || typeof e != "object") return;
82
82
  let t = e, n = [
@@ -94,36 +94,36 @@ function et(e) {
94
94
  t.avatar,
95
95
  t.image
96
96
  ].find((e) => e && typeof e == "object");
97
- if (r) return et(r);
97
+ if (r) return tt(r);
98
98
  }
99
- function tt(e) {
100
- let { appId: t, region: n } = K(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
99
+ function nt(e) {
100
+ let { appId: t, region: n } = G(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
101
101
  return e.hostname.toLowerCase() === r.toLowerCase() && e.pathname.startsWith(i);
102
102
  }
103
103
  //#endregion
104
104
  //#region src/chat/cacheScope.ts
105
- var nt = ":chatCacheScope", rt = ":chatCacheOwner", it, at;
106
- function ot(e) {
107
- return `${K().appId}${e}`;
108
- }
109
- function st() {
110
- return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
105
+ var rt = ":chatCacheScope", it = ":chatCacheOwner", at, ot;
106
+ function st(e) {
107
+ return `${G().appId}${e}`;
111
108
  }
112
109
  function ct() {
113
- return it === void 0 && (it = localStorage.getItem(ot(nt))), it;
110
+ return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
114
111
  }
115
112
  function lt() {
116
- return at === void 0 && (at = localStorage.getItem(ot(rt))), at;
113
+ return at === void 0 && (at = localStorage.getItem(st(rt))), at;
114
+ }
115
+ function ut() {
116
+ return ot === void 0 && (ot = localStorage.getItem(st(it))), ot;
117
117
  }
118
- function ut(e) {
119
- let t = ct(), n = lt();
118
+ function dt(e) {
119
+ let t = lt(), n = ut();
120
120
  if (t && n === e) return t;
121
- let r = st();
122
- return it = r, at = e, localStorage.setItem(ot(nt), r), localStorage.setItem(ot(rt), e), r;
121
+ let r = ct();
122
+ return at = r, ot = e, localStorage.setItem(st(rt), r), localStorage.setItem(st(it), e), r;
123
123
  }
124
124
  //#endregion
125
125
  //#region src/chat/localization.ts
126
- var dt = {
126
+ var ft = {
127
127
  en: {
128
128
  addOption: "Add option",
129
129
  addToMessage: "Add to message",
@@ -364,102 +364,102 @@ var dt = {
364
364
  you: "Du",
365
365
  youSentAMessage: "Du sendte en melding"
366
366
  }
367
- }, ft = w("en");
368
- function pt(e) {
367
+ }, pt = w("en");
368
+ function mt(e) {
369
369
  return e === "nb" || e === "no" ? "nb" : "en";
370
370
  }
371
- function mt(e) {
372
- return pt(e) === "nb" ? "nb-NO" : "en-US";
371
+ function ht(e) {
372
+ return mt(e) === "nb" ? "nb-NO" : "en-US";
373
373
  }
374
- function ht() {
374
+ function gt() {
375
375
  return "h23";
376
376
  }
377
- function gt(e) {
378
- ft.value = e;
377
+ function _t(e) {
378
+ pt.value = e;
379
379
  }
380
- function _t(e, t, n) {
381
- let r = dt[pt(n ?? ft.value)][e] ?? dt.en[e];
380
+ function vt(e, t, n) {
381
+ let r = ft[mt(n ?? pt.value)][e] ?? ft.en[e];
382
382
  return typeof r == "function" ? r(t ?? {}) : r;
383
383
  }
384
- function q(e) {
385
- let t = n(() => A(e) ?? ft.value);
384
+ function K(e) {
385
+ let t = n(() => A(e) ?? pt.value);
386
386
  return {
387
- locale: n(() => mt(t.value)),
388
- t: (e, n) => _t(e, n, t.value)
387
+ locale: n(() => ht(t.value)),
388
+ t: (e, n) => vt(e, n, t.value)
389
389
  };
390
390
  }
391
391
  //#endregion
392
392
  //#region src/chat/mentions.ts
393
- var vt = /<@uid:([^>]+)>/g, yt = /&lt;@uid:([^&]+)&gt;/g, bt = "mention:", xt = "", St = "data-mention-uid", Ct = "composer-mention", wt = "message-mention";
394
- function Tt(e) {
393
+ var yt = /<@uid:([^>]+)>/g, bt = /&lt;@uid:([^&]+)&gt;/g, xt = "mention:", St = "", Ct = "data-mention-uid", wt = "composer-mention", Tt = "message-mention";
394
+ function Et(e) {
395
395
  return {
396
396
  uid: e.uid,
397
397
  displayName: e.displayName,
398
398
  avatar: e.avatar
399
399
  };
400
400
  }
401
- function Et(e) {
401
+ function Dt(e) {
402
402
  let t = {};
403
403
  for (let n of e) t[n.uid] = n.displayName;
404
404
  return t;
405
405
  }
406
- function Dt(e, t, n = 8) {
406
+ function Ot(e, t, n = 8) {
407
407
  let r = t.trim().toLowerCase(), i = e.filter((e) => e.displayName.trim().length > 0);
408
408
  return r ? i.filter((e) => {
409
409
  let t = e.displayName.toLowerCase(), n = e.uid.toLowerCase();
410
410
  return t.includes(r) || n.includes(r);
411
411
  }).slice(0, n) : i.slice(0, n);
412
412
  }
413
- function Ot(e) {
414
- return `<@uid:${e}>`;
415
- }
416
413
  function kt(e) {
417
- return e.replace(yt, (e, t) => Ot(t));
414
+ return `<@uid:${e}>`;
418
415
  }
419
416
  function At(e) {
420
- return vt.lastIndex = 0, yt.lastIndex = 0, vt.test(e) || yt.test(e);
417
+ return e.replace(bt, (e, t) => kt(t));
421
418
  }
422
419
  function jt(e) {
420
+ return yt.lastIndex = 0, bt.lastIndex = 0, yt.test(e) || bt.test(e);
421
+ }
422
+ function Mt(e) {
423
423
  let t = [];
424
424
  return {
425
- shielded: kt(e).replace(vt, (e) => `${bt}${t.push(e) - 1}${xt}`),
425
+ shielded: At(e).replace(yt, (e) => `${xt}${t.push(e) - 1}${St}`),
426
426
  tokens: t
427
427
  };
428
428
  }
429
- function Mt(e, t) {
430
- let n = RegExp(`${bt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${xt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
429
+ function Nt(e, t) {
430
+ let n = RegExp(`${xt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${St.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
431
431
  return e.replace(n, (e, n) => t[Number(n)] ?? "");
432
432
  }
433
- function Nt(e, t, n = wt) {
434
- return e.replace(vt, (e, r) => {
433
+ function Pt(e, t, n = Tt) {
434
+ return e.replace(yt, (e, r) => {
435
435
  let i = t(r).trim() || r;
436
- return `<span class="${n}" ${St}="${Ut(r)}">@${Wt(i)}</span>`;
436
+ return `<span class="${n}" ${Ct}="${Wt(r)}">@${Gt(i)}</span>`;
437
437
  });
438
438
  }
439
- function Pt(e, t = {}) {
440
- return Nt(e, (e) => t[e] ?? e, Ct);
441
- }
442
439
  function Ft(e, t = {}) {
443
- return Nt(e, (e) => t[e] ?? e, wt);
440
+ return Pt(e, (e) => t[e] ?? e, wt);
441
+ }
442
+ function It(e, t = {}) {
443
+ return Pt(e, (e) => t[e] ?? e, Tt);
444
444
  }
445
- function It(e) {
445
+ function Lt(e) {
446
446
  if (!e) return "";
447
447
  let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
448
448
  if (!n) return e;
449
- for (let e of [...n.querySelectorAll(`span[${St}]`)]) {
450
- let n = e.getAttribute(St);
451
- n && e.replaceWith(t.createTextNode(Ot(n)));
449
+ for (let e of [...n.querySelectorAll(`span[${Ct}]`)]) {
450
+ let n = e.getAttribute(Ct);
451
+ n && e.replaceWith(t.createTextNode(kt(n)));
452
452
  }
453
- return Lt(n.innerHTML);
453
+ return Rt(n.innerHTML);
454
454
  }
455
- function Lt(e) {
455
+ function Rt(e) {
456
456
  return e.replace(/&lt;@uid:([^&]+)&gt;/g, "<@uid:$1>");
457
457
  }
458
- var Rt = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
459
- function zt(e, t, n = "member") {
458
+ var zt = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
459
+ function Bt(e, t, n = "member") {
460
460
  return t[e]?.trim() || n;
461
461
  }
462
- function Bt(e) {
462
+ function Vt(e) {
463
463
  let t = {};
464
464
  for (let n of e?.getMentionedUsers?.() ?? []) {
465
465
  let e = n.getUid?.(), r = n.getName?.()?.trim();
@@ -467,31 +467,31 @@ function Bt(e) {
467
467
  }
468
468
  return t;
469
469
  }
470
- function Vt(...e) {
470
+ function Ht(...e) {
471
471
  let t = {};
472
472
  for (let n of e) Object.assign(t, n);
473
473
  return t;
474
474
  }
475
- function Ht(e, t = {}) {
476
- return kt(e).replace(vt, (e, n) => `@${zt(n, t)}`).replace(Rt, (e, n) => `@${zt(n, t)}`);
475
+ function Ut(e, t = {}) {
476
+ return At(e).replace(yt, (e, n) => `@${Bt(n, t)}`).replace(zt, (e, n) => `@${Bt(n, t)}`);
477
477
  }
478
- function Ut(e) {
478
+ function Wt(e) {
479
479
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
480
480
  }
481
- function Wt(e) {
481
+ function Gt(e) {
482
482
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
483
483
  }
484
484
  //#endregion
485
485
  //#region node_modules/dompurify/dist/purify.es.mjs
486
- function Gt(e, t) {
486
+ function Kt(e, t) {
487
487
  (t == null || t > e.length) && (t = e.length);
488
488
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
489
489
  return r;
490
490
  }
491
- function Kt(e) {
491
+ function qt(e) {
492
492
  if (Array.isArray(e)) return e;
493
493
  }
494
- function qt(e, t) {
494
+ function Jt(e, t) {
495
495
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
496
496
  if (n != null) {
497
497
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -509,99 +509,99 @@ function qt(e, t) {
509
509
  return s;
510
510
  }
511
511
  }
512
- function Jt() {
512
+ function Yt() {
513
513
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
514
514
  }
515
- function Yt(e, t) {
516
- return Kt(e) || qt(e, t) || Xt(e, t) || Jt();
517
- }
518
515
  function Xt(e, t) {
516
+ return qt(e) || Jt(e, t) || Zt(e, t) || Yt();
517
+ }
518
+ function Zt(e, t) {
519
519
  if (e) {
520
- if (typeof e == "string") return Gt(e, t);
520
+ if (typeof e == "string") return Kt(e, t);
521
521
  var n = {}.toString.call(e).slice(8, -1);
522
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Gt(e, t) : void 0;
522
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Kt(e, t) : void 0;
523
523
  }
524
524
  }
525
- var Zt = Object.entries, Qt = Object.setPrototypeOf, $t = Object.isFrozen, en = Object.getPrototypeOf, tn = Object.getOwnPropertyDescriptor, nn = Object.freeze, rn = Object.seal, an = Object.create, on = typeof Reflect < "u" && Reflect, sn = on.apply, cn = on.construct;
526
- nn ||= function(e) {
525
+ var Qt = Object.entries, $t = Object.setPrototypeOf, en = Object.isFrozen, tn = Object.getPrototypeOf, nn = Object.getOwnPropertyDescriptor, rn = Object.freeze, an = Object.seal, on = Object.create, sn = typeof Reflect < "u" && Reflect, cn = sn.apply, ln = sn.construct;
526
+ rn ||= function(e) {
527
527
  return e;
528
- }, rn ||= function(e) {
528
+ }, an ||= function(e) {
529
529
  return e;
530
- }, sn ||= function(e, t) {
530
+ }, cn ||= function(e, t) {
531
531
  var n = [...arguments].slice(2);
532
532
  return e.apply(t, n);
533
- }, cn ||= function(e) {
533
+ }, ln ||= function(e) {
534
534
  return new e(...[...arguments].slice(1));
535
535
  };
536
- var ln = On(Array.prototype.forEach), un = On(Array.prototype.lastIndexOf), dn = On(Array.prototype.pop), fn = On(Array.prototype.push), pn = On(Array.prototype.splice), mn = Array.isArray, hn = On(String.prototype.toLowerCase), gn = On(String.prototype.toString), _n = On(String.prototype.match), vn = On(String.prototype.replace), yn = On(String.prototype.indexOf), bn = On(String.prototype.trim), xn = On(Number.prototype.toString), Sn = On(Boolean.prototype.toString), Cn = typeof BigInt > "u" ? null : On(BigInt.prototype.toString), wn = typeof Symbol > "u" ? null : On(Symbol.prototype.toString), J = On(Object.prototype.hasOwnProperty), Tn = On(Object.prototype.toString), En = On(RegExp.prototype.test), Dn = kn(TypeError);
537
- function On(e) {
536
+ var un = J(Array.prototype.forEach), dn = J(Array.prototype.lastIndexOf), fn = J(Array.prototype.pop), pn = J(Array.prototype.push), mn = J(Array.prototype.splice), hn = Array.isArray, gn = J(String.prototype.toLowerCase), _n = J(String.prototype.toString), vn = J(String.prototype.match), yn = J(String.prototype.replace), bn = J(String.prototype.indexOf), xn = J(String.prototype.trim), Sn = J(Number.prototype.toString), Cn = J(Boolean.prototype.toString), wn = typeof BigInt > "u" ? null : J(BigInt.prototype.toString), Tn = typeof Symbol > "u" ? null : J(Symbol.prototype.toString), q = J(Object.prototype.hasOwnProperty), En = J(Object.prototype.toString), Dn = J(RegExp.prototype.test), On = kn(TypeError);
537
+ function J(e) {
538
538
  return function(t) {
539
539
  t instanceof RegExp && (t.lastIndex = 0);
540
540
  var n = [...arguments].slice(1);
541
- return sn(e, t, n);
541
+ return cn(e, t, n);
542
542
  };
543
543
  }
544
544
  function kn(e) {
545
545
  return function() {
546
- return cn(e, [...arguments]);
546
+ return ln(e, [...arguments]);
547
547
  };
548
548
  }
549
549
  function Y(e, t) {
550
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : hn;
551
- if (Qt && Qt(e, null), !mn(t)) return e;
550
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gn;
551
+ if ($t && $t(e, null), !hn(t)) return e;
552
552
  let r = t.length;
553
553
  for (; r--;) {
554
554
  let i = t[r];
555
555
  if (typeof i == "string") {
556
556
  let e = n(i);
557
- e !== i && ($t(t) || (t[r] = e), i = e);
557
+ e !== i && (en(t) || (t[r] = e), i = e);
558
558
  }
559
559
  e[i] = !0;
560
560
  }
561
561
  return e;
562
562
  }
563
563
  function An(e) {
564
- for (let t = 0; t < e.length; t++) J(e, t) || (e[t] = null);
564
+ for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
565
565
  return e;
566
566
  }
567
567
  function jn(e) {
568
- let t = an(null);
569
- for (let r of Zt(e)) {
570
- var n = Yt(r, 2);
568
+ let t = on(null);
569
+ for (let r of Qt(e)) {
570
+ var n = Xt(r, 2);
571
571
  let i = n[0], a = n[1];
572
- J(e, i) && (mn(a) ? t[i] = An(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = jn(a) : t[i] = a);
572
+ q(e, i) && (hn(a) ? t[i] = An(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = jn(a) : t[i] = a);
573
573
  }
574
574
  return t;
575
575
  }
576
576
  function Mn(e) {
577
577
  switch (typeof e) {
578
578
  case "string": return e;
579
- case "number": return xn(e);
580
- case "boolean": return Sn(e);
581
- case "bigint": return Cn ? Cn(e) : "0";
582
- case "symbol": return wn ? wn(e) : "Symbol()";
583
- case "undefined": return Tn(e);
579
+ case "number": return Sn(e);
580
+ case "boolean": return Cn(e);
581
+ case "bigint": return wn ? wn(e) : "0";
582
+ case "symbol": return Tn ? Tn(e) : "Symbol()";
583
+ case "undefined": return En(e);
584
584
  case "function":
585
585
  case "object": {
586
- if (e === null) return Tn(e);
586
+ if (e === null) return En(e);
587
587
  let t = e, n = Nn(t, "toString");
588
588
  if (typeof n == "function") {
589
589
  let e = n(t);
590
- return typeof e == "string" ? e : Tn(e);
590
+ return typeof e == "string" ? e : En(e);
591
591
  }
592
- return Tn(e);
592
+ return En(e);
593
593
  }
594
- default: return Tn(e);
594
+ default: return En(e);
595
595
  }
596
596
  }
597
597
  function Nn(e, t) {
598
598
  for (; e !== null;) {
599
- let n = tn(e, t);
599
+ let n = nn(e, t);
600
600
  if (n) {
601
- if (n.get) return On(n.get);
602
- if (typeof n.value == "function") return On(n.value);
601
+ if (n.get) return J(n.get);
602
+ if (typeof n.value == "function") return J(n.value);
603
603
  }
604
- e = en(e);
604
+ e = tn(e);
605
605
  }
606
606
  function n() {
607
607
  return null;
@@ -610,12 +610,12 @@ function Nn(e, t) {
610
610
  }
611
611
  function Pn(e) {
612
612
  try {
613
- return En(e, ""), !0;
613
+ return Dn(e, ""), !0;
614
614
  } catch {
615
615
  return !1;
616
616
  }
617
617
  }
618
- var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), In = nn(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ln = nn([
618
+ var Fn = rn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), In = rn(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ln = rn([
619
619
  "feBlend",
620
620
  "feColorMatrix",
621
621
  "feComponentTransfer",
@@ -641,7 +641,7 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
641
641
  "feSpotLight",
642
642
  "feTile",
643
643
  "feTurbulence"
644
- ]), Rn = nn([
644
+ ]), Rn = rn([
645
645
  "animate",
646
646
  "color-profile",
647
647
  "cursor",
@@ -664,7 +664,7 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
664
664
  "solidcolor",
665
665
  "unknown",
666
666
  "use"
667
- ]), zn = nn(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Bn = nn([
667
+ ]), zn = rn(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Bn = rn([
668
668
  "maction",
669
669
  "maligngroup",
670
670
  "malignmark",
@@ -680,13 +680,13 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
680
680
  "annotation-xml",
681
681
  "mprescripts",
682
682
  "none"
683
- ]), Vn = nn(["#text"]), Hn = nn(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Un = nn(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Wn = nn(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Gn = nn([
683
+ ]), Vn = rn(["#text"]), Hn = rn(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Un = rn(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Wn = rn(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Gn = rn([
684
684
  "xlink:href",
685
685
  "xml:id",
686
686
  "xlink:title",
687
687
  "xml:space",
688
688
  "xmlns:xlink"
689
- ]), Kn = rn(/{{[\w\W]*|^[\w\W]*}}/g), qn = rn(/<%[\w\W]*|^[\w\W]*%>/g), Jn = rn(/\${[\w\W]*/g), Yn = rn(/^data-[\-\w.\u00B7-\uFFFF]+$/), Xn = rn(/^aria-[\-\w]+$/), Zn = rn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Qn = rn(/^(?:\w+script|data):/i), $n = rn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), er = rn(/^html$/i), tr = rn(/^[a-z][.\w]*(-[.\w]+)+$/i), nr = {
689
+ ]), Kn = an(/{{[\w\W]*|^[\w\W]*}}/g), qn = an(/<%[\w\W]*|^[\w\W]*%>/g), Jn = an(/\${[\w\W]*/g), Yn = an(/^data-[\-\w.\u00B7-\uFFFF]+$/), Xn = an(/^aria-[\-\w]+$/), Zn = an(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Qn = an(/^(?:\w+script|data):/i), $n = an(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), er = an(/^html$/i), tr = an(/^[a-z][.\w]*(-[.\w]+)+$/i), nr = {
690
690
  element: 1,
691
691
  text: 3,
692
692
  progressingInstruction: 7,
@@ -733,8 +733,8 @@ function or() {
733
733
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
734
734
  }
735
735
  let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = ar();
736
- t.isSupported = typeof Zt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
737
- let A = Kn, j = qn, M = Jn, ee = Yn, N = Xn, P = Qn, F = $n, I = tr, L = Zn, R = null, te = Y({}, [
736
+ t.isSupported = typeof Qt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
737
+ let A = Kn, j = qn, M = Jn, N = Yn, ee = Xn, P = Qn, F = $n, I = tr, te = Zn, L = null, R = Y({}, [
738
738
  ...Fn,
739
739
  ...In,
740
740
  ...Ln,
@@ -745,7 +745,7 @@ function or() {
745
745
  ...Un,
746
746
  ...Wn,
747
747
  ...Gn
748
- ]), B = Object.seal(an(null, {
748
+ ]), B = Object.seal(on(null, {
749
749
  tagNameCheck: {
750
750
  writable: !0,
751
751
  configurable: !1,
@@ -764,7 +764,7 @@ function or() {
764
764
  enumerable: !0,
765
765
  value: !1
766
766
  }
767
- })), re = null, ie = null, V = Object.seal(an(null, {
767
+ })), re = null, ie = null, ae = Object.seal(on(null, {
768
768
  tagCheck: {
769
769
  writable: !0,
770
770
  configurable: !1,
@@ -777,7 +777,7 @@ function or() {
777
777
  enumerable: !0,
778
778
  value: null
779
779
  }
780
- })), ae = !0, H = !0, oe = !1, U = !0, se = !1, ce = !0, W = !1, le = !1, ue = !1, de = !1, fe = !1, pe = !1, me = !0, he = !1, ge = "user-content-", _e = !0, ve = !1, ye = {}, be = null, xe = Y({}, [
780
+ })), oe = !0, se = !0, V = !1, H = !0, U = !1, ce = !0, le = !1, ue = !1, de = !1, fe = !1, pe = !1, me = !1, he = !0, ge = !1, _e = "user-content-", ve = !0, ye = !1, be = {}, xe = null, Se = Y({}, [
781
781
  "annotation-xml",
782
782
  "audio",
783
783
  "colgroup",
@@ -803,14 +803,14 @@ function or() {
803
803
  "title",
804
804
  "video",
805
805
  "xmp"
806
- ]), Se = null, Ce = Y({}, [
806
+ ]), Ce = null, we = Y({}, [
807
807
  "audio",
808
808
  "video",
809
809
  "img",
810
810
  "source",
811
811
  "image",
812
812
  "track"
813
- ]), we = null, Te = Y({}, [
813
+ ]), Te = null, Ee = Y({}, [
814
814
  "alt",
815
815
  "class",
816
816
  "for",
@@ -825,125 +825,125 @@ function or() {
825
825
  "value",
826
826
  "style",
827
827
  "xmlns"
828
- ]), Ee = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg", Oe = "http://www.w3.org/1999/xhtml", ke = Oe, Ae = !1, je = null, Me = Y({}, [
829
- Ee,
828
+ ]), De = "http://www.w3.org/1998/Math/MathML", Oe = "http://www.w3.org/2000/svg", ke = "http://www.w3.org/1999/xhtml", Ae = ke, je = !1, Me = null, Ne = Y({}, [
830
829
  De,
831
- Oe
832
- ], gn), Ne = Y({}, [
830
+ Oe,
831
+ ke
832
+ ], _n), Pe = Y({}, [
833
833
  "mi",
834
834
  "mo",
835
835
  "mn",
836
836
  "ms",
837
837
  "mtext"
838
- ]), Pe = Y({}, ["annotation-xml"]), Fe = Y({}, [
838
+ ]), Fe = Y({}, ["annotation-xml"]), Ie = Y({}, [
839
839
  "title",
840
840
  "style",
841
841
  "font",
842
842
  "a",
843
843
  "script"
844
- ]), Ie = null, Le = ["application/xhtml+xml", "text/html"], G = null, Re = null, ze = n.createElement("form"), Be = function(e) {
844
+ ]), Le = null, Re = ["application/xhtml+xml", "text/html"], W = null, ze = null, Be = n.createElement("form"), Ve = function(e) {
845
845
  return e instanceof RegExp || e instanceof Function;
846
- }, Ve = function() {
846
+ }, He = function() {
847
847
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
848
- if (Re && Re === e) return;
849
- (!e || typeof e != "object") && (e = {}), e = jn(e), Ie = Le.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, G = Ie === "application/xhtml+xml" ? gn : hn, R = J(e, "ALLOWED_TAGS") && mn(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, G) : te, z = J(e, "ALLOWED_ATTR") && mn(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, G) : ne, je = J(e, "ALLOWED_NAMESPACES") && mn(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, gn) : Me, we = J(e, "ADD_URI_SAFE_ATTR") && mn(e.ADD_URI_SAFE_ATTR) ? Y(jn(Te), e.ADD_URI_SAFE_ATTR, G) : Te, Se = J(e, "ADD_DATA_URI_TAGS") && mn(e.ADD_DATA_URI_TAGS) ? Y(jn(Ce), e.ADD_DATA_URI_TAGS, G) : Ce, be = J(e, "FORBID_CONTENTS") && mn(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, G) : xe, re = J(e, "FORBID_TAGS") && mn(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, G) : jn({}), ie = J(e, "FORBID_ATTR") && mn(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, G) : jn({}), ye = J(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? jn(e.USE_PROFILES) : e.USE_PROFILES : !1, ae = e.ALLOW_ARIA_ATTR !== !1, H = e.ALLOW_DATA_ATTR !== !1, oe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, U = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, se = e.SAFE_FOR_TEMPLATES || !1, ce = e.SAFE_FOR_XML !== !1, W = e.WHOLE_DOCUMENT || !1, de = e.RETURN_DOM || !1, fe = e.RETURN_DOM_FRAGMENT || !1, pe = e.RETURN_TRUSTED_TYPE || !1, ue = e.FORCE_BODY || !1, me = e.SANITIZE_DOM !== !1, he = e.SANITIZE_NAMED_PROPS || !1, _e = e.KEEP_CONTENT !== !1, ve = e.IN_PLACE || !1, L = Pn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Zn, ke = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Oe, Ne = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? jn(e.MATHML_TEXT_INTEGRATION_POINTS) : Y({}, [
848
+ if (ze && ze === e) return;
849
+ (!e || typeof e != "object") && (e = {}), e = jn(e), Le = Re.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, W = Le === "application/xhtml+xml" ? _n : gn, L = q(e, "ALLOWED_TAGS") && hn(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, W) : R, z = q(e, "ALLOWED_ATTR") && hn(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, W) : ne, Me = q(e, "ALLOWED_NAMESPACES") && hn(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, _n) : Ne, Te = q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) ? Y(jn(Ee), e.ADD_URI_SAFE_ATTR, W) : Ee, Ce = q(e, "ADD_DATA_URI_TAGS") && hn(e.ADD_DATA_URI_TAGS) ? Y(jn(we), e.ADD_DATA_URI_TAGS, W) : we, xe = q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, W) : Se, re = q(e, "FORBID_TAGS") && hn(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, W) : jn({}), ie = q(e, "FORBID_ATTR") && hn(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, W) : jn({}), be = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? jn(e.USE_PROFILES) : e.USE_PROFILES : !1, oe = e.ALLOW_ARIA_ATTR !== !1, se = e.ALLOW_DATA_ATTR !== !1, V = e.ALLOW_UNKNOWN_PROTOCOLS || !1, H = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, U = e.SAFE_FOR_TEMPLATES || !1, ce = e.SAFE_FOR_XML !== !1, le = e.WHOLE_DOCUMENT || !1, fe = e.RETURN_DOM || !1, pe = e.RETURN_DOM_FRAGMENT || !1, me = e.RETURN_TRUSTED_TYPE || !1, de = e.FORCE_BODY || !1, he = e.SANITIZE_DOM !== !1, ge = e.SANITIZE_NAMED_PROPS || !1, ve = e.KEEP_CONTENT !== !1, ye = e.IN_PLACE || !1, te = Pn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Zn, Ae = typeof e.NAMESPACE == "string" ? e.NAMESPACE : ke, Pe = q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? jn(e.MATHML_TEXT_INTEGRATION_POINTS) : Y({}, [
850
850
  "mi",
851
851
  "mo",
852
852
  "mn",
853
853
  "ms",
854
854
  "mtext"
855
- ]), Pe = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? jn(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
856
- let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? jn(e.CUSTOM_ELEMENT_HANDLING) : an(null);
857
- if (B = an(null), J(t, "tagNameCheck") && Be(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && Be(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), se && (H = !1), fe && (de = !0), ye && (R = Y({}, Vn), z = an(null), ye.html === !0 && (Y(R, Fn), Y(z, Hn)), ye.svg === !0 && (Y(R, In), Y(z, Un), Y(z, Gn)), ye.svgFilters === !0 && (Y(R, Ln), Y(z, Un), Y(z, Gn)), ye.mathMl === !0 && (Y(R, zn), Y(z, Wn), Y(z, Gn))), V.tagCheck = null, V.attributeCheck = null, J(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? V.tagCheck = e.ADD_TAGS : mn(e.ADD_TAGS) && (R === te && (R = jn(R)), Y(R, e.ADD_TAGS, G))), J(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? V.attributeCheck = e.ADD_ATTR : mn(e.ADD_ATTR) && (z === ne && (z = jn(z)), Y(z, e.ADD_ATTR, G))), J(e, "ADD_URI_SAFE_ATTR") && mn(e.ADD_URI_SAFE_ATTR) && Y(we, e.ADD_URI_SAFE_ATTR, G), J(e, "FORBID_CONTENTS") && mn(e.FORBID_CONTENTS) && (be === xe && (be = jn(be)), Y(be, e.FORBID_CONTENTS, G)), J(e, "ADD_FORBID_CONTENTS") && mn(e.ADD_FORBID_CONTENTS) && (be === xe && (be = jn(be)), Y(be, e.ADD_FORBID_CONTENTS, G)), _e && (R["#text"] = !0), W && Y(R, [
855
+ ]), Fe = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? jn(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
856
+ let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? jn(e.CUSTOM_ELEMENT_HANDLING) : on(null);
857
+ if (B = on(null), q(t, "tagNameCheck") && Ve(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && Ve(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), U && (se = !1), pe && (fe = !0), be && (L = Y({}, Vn), z = on(null), be.html === !0 && (Y(L, Fn), Y(z, Hn)), be.svg === !0 && (Y(L, In), Y(z, Un), Y(z, Gn)), be.svgFilters === !0 && (Y(L, Ln), Y(z, Un), Y(z, Gn)), be.mathMl === !0 && (Y(L, zn), Y(z, Wn), Y(z, Gn))), ae.tagCheck = null, ae.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ae.tagCheck = e.ADD_TAGS : hn(e.ADD_TAGS) && (L === R && (L = jn(L)), Y(L, e.ADD_TAGS, W))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ae.attributeCheck = e.ADD_ATTR : hn(e.ADD_ATTR) && (z === ne && (z = jn(z)), Y(z, e.ADD_ATTR, W))), q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) && Y(Te, e.ADD_URI_SAFE_ATTR, W), q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) && (xe === Se && (xe = jn(xe)), Y(xe, e.FORBID_CONTENTS, W)), q(e, "ADD_FORBID_CONTENTS") && hn(e.ADD_FORBID_CONTENTS) && (xe === Se && (xe = jn(xe)), Y(xe, e.ADD_FORBID_CONTENTS, W)), ve && (L["#text"] = !0), le && Y(L, [
858
858
  "html",
859
859
  "head",
860
860
  "body"
861
- ]), R.table && (Y(R, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
862
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Dn("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
863
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Dn("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
861
+ ]), L.table && (Y(L, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
862
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw On("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
863
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw On("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
864
864
  x = e.TRUSTED_TYPES_POLICY, S = x.createHTML("");
865
865
  } else x === void 0 && (x = ir(m, i)), x !== null && typeof S == "string" && (S = x.createHTML(""));
866
- nn && nn(e), Re = e;
867
- }, K = Y({}, [
866
+ rn && rn(e), ze = e;
867
+ }, G = Y({}, [
868
868
  ...In,
869
869
  ...Ln,
870
870
  ...Rn
871
- ]), He = Y({}, [...zn, ...Bn]), Ue = function(e) {
871
+ ]), Ue = Y({}, [...zn, ...Bn]), We = function(e) {
872
872
  let t = b(e);
873
873
  (!t || !t.tagName) && (t = {
874
- namespaceURI: ke,
874
+ namespaceURI: Ae,
875
875
  tagName: "template"
876
876
  });
877
- let n = hn(e.tagName), r = hn(t.tagName);
878
- return je[e.namespaceURI] ? e.namespaceURI === De ? t.namespaceURI === Oe ? n === "svg" : t.namespaceURI === Ee ? n === "svg" && (r === "annotation-xml" || Ne[r]) : !!K[n] : e.namespaceURI === Ee ? t.namespaceURI === Oe ? n === "math" : t.namespaceURI === De ? n === "math" && Pe[r] : !!He[n] : e.namespaceURI === Oe ? t.namespaceURI === De && !Pe[r] || t.namespaceURI === Ee && !Ne[r] ? !1 : !He[n] && (Fe[n] || !K[n]) : !!(Ie === "application/xhtml+xml" && je[e.namespaceURI]) : !1;
879
- }, We = function(e) {
880
- fn(t.removed, { element: e });
877
+ let n = gn(e.tagName), r = gn(t.tagName);
878
+ return Me[e.namespaceURI] ? e.namespaceURI === Oe ? t.namespaceURI === ke ? n === "svg" : t.namespaceURI === De ? n === "svg" && (r === "annotation-xml" || Pe[r]) : !!G[n] : e.namespaceURI === De ? t.namespaceURI === ke ? n === "math" : t.namespaceURI === Oe ? n === "math" && Fe[r] : !!Ue[n] : e.namespaceURI === ke ? t.namespaceURI === Oe && !Fe[r] || t.namespaceURI === De && !Pe[r] ? !1 : !Ue[n] && (Ie[n] || !G[n]) : !!(Le === "application/xhtml+xml" && Me[e.namespaceURI]) : !1;
879
+ }, Ge = function(e) {
880
+ pn(t.removed, { element: e });
881
881
  try {
882
882
  b(e).removeChild(e);
883
883
  } catch {
884
884
  _(e);
885
885
  }
886
- }, Ge = function(e, n) {
886
+ }, Ke = function(e, n) {
887
887
  try {
888
- fn(t.removed, {
888
+ pn(t.removed, {
889
889
  attribute: n.getAttributeNode(e),
890
890
  from: n
891
891
  });
892
892
  } catch {
893
- fn(t.removed, {
893
+ pn(t.removed, {
894
894
  attribute: null,
895
895
  from: n
896
896
  });
897
897
  }
898
- if (n.removeAttribute(e), e === "is") if (de || fe) try {
899
- We(n);
898
+ if (n.removeAttribute(e), e === "is") if (fe || pe) try {
899
+ Ge(n);
900
900
  } catch {}
901
901
  else try {
902
902
  n.setAttribute(e, "");
903
903
  } catch {}
904
- }, Ke = function(e) {
904
+ }, qe = function(e) {
905
905
  let t = null, r = null;
906
- if (ue) e = "<remove></remove>" + e;
906
+ if (de) e = "<remove></remove>" + e;
907
907
  else {
908
- let t = _n(e, /^[\r\n\t ]+/);
908
+ let t = vn(e, /^[\r\n\t ]+/);
909
909
  r = t && t[0];
910
910
  }
911
- Ie === "application/xhtml+xml" && ke === Oe && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
911
+ Le === "application/xhtml+xml" && Ae === ke && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
912
912
  let i = x ? x.createHTML(e) : e;
913
- if (ke === Oe) try {
914
- t = new p().parseFromString(i, Ie);
913
+ if (Ae === ke) try {
914
+ t = new p().parseFromString(i, Le);
915
915
  } catch {}
916
916
  if (!t || !t.documentElement) {
917
- t = w.createDocument(ke, "template", null);
917
+ t = w.createDocument(Ae, "template", null);
918
918
  try {
919
- t.documentElement.innerHTML = Ae ? S : i;
919
+ t.documentElement.innerHTML = je ? S : i;
920
920
  } catch {}
921
921
  }
922
922
  let a = t.body || t.documentElement;
923
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ke === Oe ? D.call(t, W ? "html" : "body")[0] : W ? t.documentElement : a;
924
- }, qe = function(e) {
925
- return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
923
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ae === ke ? D.call(t, le ? "html" : "body")[0] : le ? t.documentElement : a;
926
924
  }, Je = function(e) {
927
- return e instanceof f && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
925
+ return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
928
926
  }, Ye = function(e) {
927
+ return e instanceof f && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
928
+ }, Xe = function(e) {
929
929
  return typeof s == "function" && e instanceof s;
930
930
  };
931
- function Xe(e, n, r) {
932
- ln(e, (e) => {
933
- e.call(t, n, r, Re);
931
+ function Ze(e, n, r) {
932
+ un(e, (e) => {
933
+ e.call(t, n, r, ze);
934
934
  });
935
935
  }
936
- let Ze = function(e) {
936
+ let Qe = function(e) {
937
937
  let n = null;
938
- if (Xe(k.beforeSanitizeElements, e, null), Je(e)) return We(e), !0;
939
- let r = G(e.nodeName);
940
- if (Xe(k.uponSanitizeElement, e, {
938
+ if (Ze(k.beforeSanitizeElements, e, null), Ye(e)) return Ge(e), !0;
939
+ let r = W(e.nodeName);
940
+ if (Ze(k.uponSanitizeElement, e, {
941
941
  tagName: r,
942
- allowedTags: R
943
- }), ce && e.hasChildNodes() && !Ye(e.firstElementChild) && En(/<[/\w!]/g, e.innerHTML) && En(/<[/\w!]/g, e.textContent) || ce && e.namespaceURI === Oe && r === "style" && Ye(e.firstElementChild) || e.nodeType === nr.progressingInstruction || ce && e.nodeType === nr.comment && En(/<[/\w]/g, e.data)) return We(e), !0;
944
- if (re[r] || !(V.tagCheck instanceof Function && V.tagCheck(r)) && !R[r]) {
945
- if (!re[r] && et(r) && (B.tagNameCheck instanceof RegExp && En(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
946
- if (_e && !be[r]) {
942
+ allowedTags: L
943
+ }), ce && e.hasChildNodes() && !Xe(e.firstElementChild) && Dn(/<[/\w!]/g, e.innerHTML) && Dn(/<[/\w!]/g, e.textContent) || ce && e.namespaceURI === ke && r === "style" && Xe(e.firstElementChild) || e.nodeType === nr.progressingInstruction || ce && e.nodeType === nr.comment && Dn(/<[/\w]/g, e.data)) return Ge(e), !0;
944
+ if (re[r] || !(ae.tagCheck instanceof Function && ae.tagCheck(r)) && !L[r]) {
945
+ if (!re[r] && tt(r) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
946
+ if (ve && !xe[r]) {
947
947
  let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
948
948
  if (n && t) {
949
949
  let r = n.length;
@@ -953,25 +953,25 @@ function or() {
953
953
  }
954
954
  }
955
955
  }
956
- return We(e), !0;
956
+ return Ge(e), !0;
957
957
  }
958
- return e instanceof c && !Ue(e) || (r === "noscript" || r === "noembed" || r === "noframes") && En(/<\/no(script|embed|frames)/i, e.innerHTML) ? (We(e), !0) : (se && e.nodeType === nr.text && (n = e.textContent, ln([
958
+ return e instanceof c && !We(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Dn(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ge(e), !0) : (U && e.nodeType === nr.text && (n = e.textContent, un([
959
959
  A,
960
960
  j,
961
961
  M
962
962
  ], (e) => {
963
- n = vn(n, e, " ");
964
- }), e.textContent !== n && (fn(t.removed, { element: e.cloneNode() }), e.textContent = n)), Xe(k.afterSanitizeElements, e, null), !1);
965
- }, Qe = function(e, t, r) {
966
- if (ie[t] || me && (t === "id" || t === "name") && (r in n || r in ze)) return !1;
967
- let i = z[t] || V.attributeCheck instanceof Function && V.attributeCheck(t, e);
968
- if (!(H && !ie[t] && En(ee, t)) && !(ae && En(N, t))) {
963
+ n = yn(n, e, " ");
964
+ }), e.textContent !== n && (pn(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ze(k.afterSanitizeElements, e, null), !1);
965
+ }, $e = function(e, t, r) {
966
+ if (ie[t] || he && (t === "id" || t === "name") && (r in n || r in Be)) return !1;
967
+ let i = z[t] || ae.attributeCheck instanceof Function && ae.attributeCheck(t, e);
968
+ if (!(se && !ie[t] && Dn(N, t)) && !(oe && Dn(ee, t))) {
969
969
  if (!i || ie[t]) {
970
- if (!(et(e) && (B.tagNameCheck instanceof RegExp && En(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && En(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && En(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
971
- } else if (!we[t] && !En(L, vn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && yn(r, "data:") === 0 && Se[e]) && !(oe && !En(P, vn(r, F, ""))) && r) return !1;
970
+ if (!(tt(e) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && Dn(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
971
+ } else if (!Te[t] && !Dn(te, yn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && bn(r, "data:") === 0 && Ce[e]) && !(V && !Dn(P, yn(r, F, ""))) && r) return !1;
972
972
  }
973
973
  return !0;
974
- }, $e = Y({}, [
974
+ }, et = Y({}, [
975
975
  "annotation-xml",
976
976
  "color-profile",
977
977
  "font-face",
@@ -980,12 +980,12 @@ function or() {
980
980
  "font-face-src",
981
981
  "font-face-uri",
982
982
  "missing-glyph"
983
- ]), et = function(e) {
984
- return !$e[hn(e)] && En(I, e);
985
- }, tt = function(e) {
986
- Xe(k.beforeSanitizeAttributes, e, null);
983
+ ]), tt = function(e) {
984
+ return !et[gn(e)] && Dn(I, e);
985
+ }, nt = function(e) {
986
+ Ze(k.beforeSanitizeAttributes, e, null);
987
987
  let n = e.attributes;
988
- if (!n || Je(e)) return;
988
+ if (!n || Ye(e)) return;
989
989
  let r = {
990
990
  attrName: "",
991
991
  attrValue: "",
@@ -994,34 +994,34 @@ function or() {
994
994
  forceKeepAttr: void 0
995
995
  }, i = n.length;
996
996
  for (; i--;) {
997
- let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = G(o), u = c, d = o === "value" ? u : bn(u);
998
- if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Xe(k.uponSanitizeAttribute, e, r), d = r.attrValue, he && (l === "id" || l === "name") && yn(d, ge) !== 0 && (Ge(o, e), d = ge + d), ce && En(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
999
- Ge(o, e);
997
+ let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = W(o), u = c, d = o === "value" ? u : xn(u);
998
+ if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Ze(k.uponSanitizeAttribute, e, r), d = r.attrValue, ge && (l === "id" || l === "name") && bn(d, _e) !== 0 && (Ke(o, e), d = _e + d), ce && Dn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
999
+ Ke(o, e);
1000
1000
  continue;
1001
1001
  }
1002
- if (l === "attributename" && _n(d, "href")) {
1003
- Ge(o, e);
1002
+ if (l === "attributename" && vn(d, "href")) {
1003
+ Ke(o, e);
1004
1004
  continue;
1005
1005
  }
1006
1006
  if (r.forceKeepAttr) continue;
1007
1007
  if (!r.keepAttr) {
1008
- Ge(o, e);
1008
+ Ke(o, e);
1009
1009
  continue;
1010
1010
  }
1011
- if (!U && En(/\/>/i, d)) {
1012
- Ge(o, e);
1011
+ if (!H && Dn(/\/>/i, d)) {
1012
+ Ke(o, e);
1013
1013
  continue;
1014
1014
  }
1015
- se && ln([
1015
+ U && un([
1016
1016
  A,
1017
1017
  j,
1018
1018
  M
1019
1019
  ], (e) => {
1020
- d = vn(d, e, " ");
1020
+ d = yn(d, e, " ");
1021
1021
  });
1022
- let f = G(e.nodeName);
1023
- if (!Qe(f, l, d)) {
1024
- Ge(o, e);
1022
+ let f = W(e.nodeName);
1023
+ if (!$e(f, l, d)) {
1024
+ Ke(o, e);
1025
1025
  continue;
1026
1026
  }
1027
1027
  if (x && typeof m == "object" && typeof m.getAttributeType == "function" && !s) switch (m.getAttributeType(f, l)) {
@@ -1033,87 +1033,87 @@ function or() {
1033
1033
  break;
1034
1034
  }
1035
1035
  if (d !== u) try {
1036
- s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), Je(e) ? We(e) : dn(t.removed);
1036
+ s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), Ye(e) ? Ge(e) : fn(t.removed);
1037
1037
  } catch {
1038
- Ge(o, e);
1038
+ Ke(o, e);
1039
1039
  }
1040
1040
  }
1041
- Xe(k.afterSanitizeAttributes, e, null);
1042
- }, nt = function(e) {
1043
- let t = null, n = qe(e);
1044
- for (Xe(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Xe(k.uponSanitizeShadowNode, t, null), Ze(t), tt(t), t.content instanceof a && nt(t.content);
1045
- Xe(k.afterSanitizeShadowDOM, e, null);
1041
+ Ze(k.afterSanitizeAttributes, e, null);
1046
1042
  }, rt = function(e) {
1043
+ let t = null, n = Je(e);
1044
+ for (Ze(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Ze(k.uponSanitizeShadowNode, t, null), Qe(t), nt(t), t.content instanceof a && rt(t.content);
1045
+ Ze(k.afterSanitizeShadowDOM, e, null);
1046
+ }, it = function(e) {
1047
1047
  if (e.nodeType === nr.element && e.shadowRoot instanceof a) {
1048
1048
  let t = e.shadowRoot;
1049
- rt(t), nt(t);
1049
+ it(t), rt(t);
1050
1050
  }
1051
1051
  let t = e.childNodes;
1052
1052
  if (!t) return;
1053
1053
  let n = [];
1054
- ln(t, (e) => {
1055
- fn(n, e);
1054
+ un(t, (e) => {
1055
+ pn(n, e);
1056
1056
  });
1057
- for (let e of n) rt(e);
1057
+ for (let e of n) it(e);
1058
1058
  };
1059
1059
  return t.sanitize = function(e) {
1060
1060
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
1061
- if (Ae = !e, Ae && (e = "<!-->"), typeof e != "string" && !Ye(e) && (e = Mn(e), typeof e != "string")) throw Dn("dirty is not a string, aborting");
1061
+ if (je = !e, je && (e = "<!-->"), typeof e != "string" && !Xe(e) && (e = Mn(e), typeof e != "string")) throw On("dirty is not a string, aborting");
1062
1062
  if (!t.isSupported) return e;
1063
- if (le || Ve(n), t.removed = [], typeof e == "string" && (ve = !1), ve) {
1063
+ if (ue || He(n), t.removed = [], typeof e == "string" && (ye = !1), ye) {
1064
1064
  let t = e.nodeName;
1065
1065
  if (typeof t == "string") {
1066
- let e = G(t);
1067
- if (!R[e] || re[e]) throw Dn("root node is forbidden and cannot be sanitized in-place");
1066
+ let e = W(t);
1067
+ if (!L[e] || re[e]) throw On("root node is forbidden and cannot be sanitized in-place");
1068
1068
  }
1069
- rt(e);
1070
- } else if (e instanceof s) i = Ke("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === nr.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), rt(o);
1069
+ it(e);
1070
+ } else if (e instanceof s) i = qe("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === nr.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), it(o);
1071
1071
  else {
1072
- if (!de && !se && !W && e.indexOf("<") === -1) return x && pe ? x.createHTML(e) : e;
1073
- if (i = Ke(e), !i) return de ? null : pe ? S : "";
1074
- }
1075
- i && ue && We(i.firstChild);
1076
- let u = qe(ve ? e : i);
1077
- for (; c = u.nextNode();) Ze(c), tt(c), c.content instanceof a && nt(c.content);
1078
- if (ve) return e;
1079
- if (de) {
1080
- if (se) {
1072
+ if (!fe && !U && !le && e.indexOf("<") === -1) return x && me ? x.createHTML(e) : e;
1073
+ if (i = qe(e), !i) return fe ? null : me ? S : "";
1074
+ }
1075
+ i && de && Ge(i.firstChild);
1076
+ let u = Je(ye ? e : i);
1077
+ for (; c = u.nextNode();) Qe(c), nt(c), c.content instanceof a && rt(c.content);
1078
+ if (ye) return e;
1079
+ if (fe) {
1080
+ if (U) {
1081
1081
  i.normalize();
1082
1082
  let e = i.innerHTML;
1083
- ln([
1083
+ un([
1084
1084
  A,
1085
1085
  j,
1086
1086
  M
1087
1087
  ], (t) => {
1088
- e = vn(e, t, " ");
1088
+ e = yn(e, t, " ");
1089
1089
  }), i.innerHTML = e;
1090
1090
  }
1091
- if (fe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
1091
+ if (pe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
1092
1092
  else l = i;
1093
1093
  return (z.shadowroot || z.shadowrootmode) && (l = O.call(r, l, !0)), l;
1094
1094
  }
1095
- let d = W ? i.outerHTML : i.innerHTML;
1096
- return W && R["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && En(er, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), se && ln([
1095
+ let d = le ? i.outerHTML : i.innerHTML;
1096
+ return le && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Dn(er, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), U && un([
1097
1097
  A,
1098
1098
  j,
1099
1099
  M
1100
1100
  ], (e) => {
1101
- d = vn(d, e, " ");
1102
- }), x && pe ? x.createHTML(d) : d;
1101
+ d = yn(d, e, " ");
1102
+ }), x && me ? x.createHTML(d) : d;
1103
1103
  }, t.setConfig = function() {
1104
- Ve(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), le = !0;
1104
+ He(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), ue = !0;
1105
1105
  }, t.clearConfig = function() {
1106
- Re = null, le = !1;
1106
+ ze = null, ue = !1;
1107
1107
  }, t.isValidAttribute = function(e, t, n) {
1108
- return Re || Ve({}), Qe(G(e), G(t), n);
1108
+ return ze || He({}), $e(W(e), W(t), n);
1109
1109
  }, t.addHook = function(e, t) {
1110
- typeof t == "function" && fn(k[e], t);
1110
+ typeof t == "function" && pn(k[e], t);
1111
1111
  }, t.removeHook = function(e, t) {
1112
1112
  if (t !== void 0) {
1113
- let n = un(k[e], t);
1114
- return n === -1 ? void 0 : pn(k[e], n, 1)[0];
1113
+ let n = dn(k[e], t);
1114
+ return n === -1 ? void 0 : mn(k[e], n, 1)[0];
1115
1115
  }
1116
- return dn(k[e]);
1116
+ return fn(k[e]);
1117
1117
  }, t.removeHooks = function(e) {
1118
1118
  k[e] = [];
1119
1119
  }, t.removeAllHooks = function() {
@@ -1319,12 +1319,12 @@ hr.prototype.parse = function(e, t) {
1319
1319
  };
1320
1320
  //#endregion
1321
1321
  //#region node_modules/mdurl/index.mjs
1322
- var Dr = /* @__PURE__ */ Re({
1322
+ var Dr = /* @__PURE__ */ ze({
1323
1323
  decode: () => ur,
1324
1324
  encode: () => pr,
1325
1325
  format: () => mr,
1326
1326
  parse: () => Er
1327
- }), Or = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, kr = /[\0-\x1F\x7F-\x9F]/, Ar = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, jr = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, Mr = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, Nr = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Pr = /* @__PURE__ */ Re({
1327
+ }), Or = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, kr = /[\0-\x1F\x7F-\x9F]/, Ar = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, jr = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, Mr = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, Nr = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Pr = /* @__PURE__ */ ze({
1328
1328
  Any: () => Or,
1329
1329
  Cc: () => kr,
1330
1330
  Cf: () => Ar,
@@ -1519,7 +1519,7 @@ function $r(e, t = Jr.Legacy) {
1519
1519
  }
1520
1520
  //#endregion
1521
1521
  //#region node_modules/markdown-it/lib/common/utils.mjs
1522
- var ei = /* @__PURE__ */ Re({
1522
+ var ei = /* @__PURE__ */ ze({
1523
1523
  arrayReplaceAt: () => oi,
1524
1524
  assign: () => ai,
1525
1525
  escapeHtml: () => yi,
@@ -1754,7 +1754,7 @@ function ki(e, t, n, r) {
1754
1754
  }
1755
1755
  //#endregion
1756
1756
  //#region node_modules/markdown-it/lib/helpers/index.mjs
1757
- var Ai = /* @__PURE__ */ Re({
1757
+ var Ai = /* @__PURE__ */ ze({
1758
1758
  parseLinkDestination: () => Oi,
1759
1759
  parseLinkLabel: () => Di,
1760
1760
  parseLinkTitle: () => ki
@@ -3735,7 +3735,7 @@ var hs = new ms({
3735
3735
  "href",
3736
3736
  "target",
3737
3737
  "rel",
3738
- St,
3738
+ Ct,
3739
3739
  "class"
3740
3740
  ], vs = [
3741
3741
  "br",
@@ -3749,8 +3749,8 @@ var hs = new ms({
3749
3749
  ], ys = /<(?:\/)?(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, bs = /<\/(?:div|p|li|h[1-6]|blockquote|pre)>/gi, xs = /<(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Ss = /&nbsp;/gi, Cs = /https?:\/\/[^\s<>()]+[^\s<>().,!?;:]/i, ws = /(^|[\s([{"'`])((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/[^\s<]*)?)/gi, Ts = /[),.!?;:]+$/;
3750
3750
  function Es(e) {
3751
3751
  if (!e) return "";
3752
- let { shielded: t, tokens: n } = jt(e), r = t.replace(/\r\n?/g, "\n").replace(xs, "<br>").replace(bs, "").replace(Ss, " ");
3753
- return Mt(sr.sanitize(r, {
3752
+ let { shielded: t, tokens: n } = Mt(e), r = t.replace(/\r\n?/g, "\n").replace(xs, "<br>").replace(bs, "").replace(Ss, " ");
3753
+ return Nt(sr.sanitize(r, {
3754
3754
  ALLOWED_TAGS: vs,
3755
3755
  ALLOWED_ATTR: _s,
3756
3756
  ALLOW_DATA_ATTR: !1
@@ -3758,12 +3758,12 @@ function Es(e) {
3758
3758
  }
3759
3759
  function Ds(e, t) {
3760
3760
  if (!e) return "";
3761
- let n = Ht(kt(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(ys, (e) => e.startsWith("</") ? "\n" : "");
3761
+ let n = Ut(At(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(ys, (e) => e.startsWith("</") ? "\n" : "");
3762
3762
  return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").replace(/\n{3,}/g, "\n\n").trim();
3763
3763
  }
3764
3764
  function Os(e, t) {
3765
3765
  if (!e) return "";
3766
- let n = kt(e), r = Es(At(n) ? Ft(n, t?.mentionNameByUid ?? {}) : n);
3766
+ let n = At(e), r = Es(jt(n) ? It(n, t?.mentionNameByUid ?? {}) : n);
3767
3767
  if (!r) return "";
3768
3768
  let i = hs.render(Ps(r));
3769
3769
  return sr.sanitize(i, {
@@ -3788,7 +3788,7 @@ function Ms(e) {
3788
3788
  return e.replace(/\n{2,}/g, (e) => "\n" + "<br>".repeat(e.length - 1));
3789
3789
  }
3790
3790
  function Ns(e, t) {
3791
- return e.replace(vt, (e, n) => `<span class="${wt}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
3791
+ return e.replace(yt, (e, n) => `<span class="${Tt}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
3792
3792
  }
3793
3793
  function Ps(e) {
3794
3794
  let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
@@ -3838,23 +3838,23 @@ function Ls(e) {
3838
3838
  function Rs(e, t) {
3839
3839
  if (!e) return t;
3840
3840
  switch (e.kind) {
3841
- case "image": return _t("photo");
3842
- case "video": return _t("video");
3843
- case "audio": return _t("audio");
3841
+ case "image": return vt("photo");
3842
+ case "video": return vt("video");
3843
+ case "audio": return vt("audio");
3844
3844
  case "file": return e.name || t;
3845
3845
  default: return t;
3846
3846
  }
3847
3847
  }
3848
- function zs(e, t = _t("attachment")) {
3848
+ function zs(e, t = vt("attachment")) {
3849
3849
  return Rs(e[0], t);
3850
3850
  }
3851
3851
  function Bs(e, t) {
3852
- let n = kt(e ?? "");
3853
- return n ? At(n) && t ? Es(Pt(n, t)) : Es(n) : "";
3852
+ let n = At(e ?? "");
3853
+ return n ? jt(n) && t ? Es(Ft(n, t)) : Es(n) : "";
3854
3854
  }
3855
3855
  function Vs(e) {
3856
3856
  let t = Es(e);
3857
- return t ? It(t) : "";
3857
+ return t ? Lt(t) : "";
3858
3858
  }
3859
3859
  function Hs(e) {
3860
3860
  return Ds(e).length > 0;
@@ -3862,26 +3862,26 @@ function Hs(e) {
3862
3862
  function Us(e, t) {
3863
3863
  return Ds(e, t);
3864
3864
  }
3865
- function Ws(e, t = _t("message"), n) {
3865
+ function Ws(e, t = vt("message"), n) {
3866
3866
  if (e.kind === "poll" && e.poll) return e.poll.question;
3867
3867
  let r = Us(e.text, n);
3868
3868
  return e.attachments.length > 0 ? r || zs(e.attachments, t) : r || t;
3869
3869
  }
3870
3870
  function Gs(e, t = {}) {
3871
- return Ht(e, t);
3871
+ return Ut(e, t);
3872
3872
  }
3873
3873
  function Ks(e) {
3874
- return e.source?.getText?.() || kt(e.text);
3874
+ return e.source?.getText?.() || At(e.text);
3875
3875
  }
3876
3876
  function qs(e, t = !1, n = !0) {
3877
3877
  if (!e) return "";
3878
3878
  if (e.getDeletedAt?.() != null) return "(Message removed)";
3879
- if (e instanceof U.TextMessage) return e.getText?.() ?? "";
3880
- if (e instanceof U.MediaMessage) {
3879
+ if (e instanceof H.TextMessage) return e.getText?.() ?? "";
3880
+ if (e instanceof H.MediaMessage) {
3881
3881
  let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
3882
3882
  return a === "image" ? `${t ? "🖼️ " : ""}${i || "Photo"}` : a === "video" ? `${t ? "🎥 " : ""}${i || r || "Video"}` : a === "audio" ? `${t ? "🎤 " : ""}${r || "Audio message"}` : a === "file" ? `${t ? "📄 " : ""}${i || r || "File"}` : `${t ? "🖼️ " : ""}${i || r || "Media message"}`;
3883
3883
  }
3884
- if (e instanceof U.Action) {
3884
+ if (e instanceof H.Action) {
3885
3885
  let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
3886
3886
  return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
3887
3887
  }
@@ -3911,9 +3911,9 @@ function Xs(e) {
3911
3911
  return Ys(e).join("\n").trim();
3912
3912
  }
3913
3913
  function Zs(e) {
3914
- if (e.kind === "poll" && e.poll) return _t("pollPrefix", { question: e.poll.question });
3915
- let t = Bt(e.source);
3916
- return Ws(e, e.attachments.length > 0 ? _t("sentAnAttachment") : _t("youSentAMessage"), t);
3914
+ if (e.kind === "poll" && e.poll) return vt("pollPrefix", { question: e.poll.question });
3915
+ let t = Vt(e.source);
3916
+ return Ws(e, e.attachments.length > 0 ? vt("sentAnAttachment") : vt("youSentAMessage"), t);
3917
3917
  }
3918
3918
  //#endregion
3919
3919
  //#region src/chat/offlineStore.ts
@@ -4161,148 +4161,155 @@ function ac(e) {
4161
4161
  //#region src/chat/client.ts
4162
4162
  var oc = null, sc = null;
4163
4163
  function cc({ environment: e }) {
4164
- Ve(e);
4164
+ He(e);
4165
4165
  let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(null), _ = w(null), v = w([]), y = w([]), b = w([]), x = w([]), S = w(!1), C = w(!1), T = w(null), E = w(null), D = w(null), O = w(null), k = w([]), A = w({}), j = n(() => k.value.length);
4166
- function M(e) {
4166
+ function M() {
4167
+ return typeof navigator < "u" ? !navigator.onLine : !1;
4168
+ }
4169
+ function N() {
4170
+ let e = M();
4171
+ if (e !== m.value) {
4172
+ if (m.value = e, e) {
4173
+ p.value = !1, ye();
4174
+ return;
4175
+ }
4176
+ se = !0, V || Se(!0);
4177
+ }
4178
+ }
4179
+ function ee(e) {
4167
4180
  if (!e.length) return;
4168
4181
  let t = { ...A.value };
4169
4182
  for (let n of e) n.uid && n.displayName.trim() && (t[n.uid] = n.displayName);
4170
4183
  A.value = t;
4171
4184
  }
4172
- function ee(e) {
4173
- M(Object.entries(Bt(e)).map(([e, t]) => ({
4185
+ function P(e) {
4186
+ ee(Object.entries(Vt(e)).map(([e, t]) => ({
4174
4187
  uid: e,
4175
4188
  displayName: t
4176
4189
  })));
4177
4190
  }
4178
- function N(e, t) {
4179
- return ee(e), fc(e, t);
4191
+ function F(e, t) {
4192
+ return P(e), fc(e, t);
4180
4193
  }
4181
- let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`, L = !1, R = !1, te = null, z = null, ne = null, B = null, re = 0, ie = 0, V = !1, ae = !1, H = null, oe = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set(), ce = null, W = null, le = 0;
4182
- async function ue() {
4183
- await lc(e), !t.value && (he(), dt(), t.value = !0, await lt(), _.value && (ut(_.value.uid), pe(), we(), !m.value && !ae && Se()));
4194
+ let I = n(() => v.value.find((e) => e.id === T.value) ?? null), te = `bcc-ui-connection-${crypto.randomUUID()}`, L = `bcc-ui-message-${crypto.randomUUID()}`, R = !1, z = !1, ne = null, B = null, re = null, ie = null, ae = 0, oe = 0, se = !1, V = !1, U = null, ce = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Set(), ue = null, de = null, fe = 0;
4195
+ async function pe() {
4196
+ await lc(e), !t.value && (ve(), ft(), t.value = !0, await ut(), _.value && (dt(_.value.uid), ge(), Te(), !m.value && !V && Ce()));
4184
4197
  }
4185
- async function de(e) {
4198
+ async function me(e) {
4186
4199
  g.value = null, r.value = !0;
4187
4200
  try {
4188
- await ue();
4189
- let t = Ke();
4190
- await U.getLoggedinUser() && t !== e && await U.logout(), qe(e);
4201
+ await pe();
4202
+ let t = qe();
4203
+ await H.getLoggedinUser() && t !== e && await H.logout(), Je(e);
4191
4204
  let n = await uc(e);
4192
- _.value = hc(await U.login(n)), ut(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, pe(), we(), ae || await Se(), await Oe(), Kt();
4205
+ _.value = hc(await H.login(n)), dt(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, ge(), Te(), V || await Ce(), await ke(), qt();
4193
4206
  } catch (e) {
4194
- throw xt(), g.value = Z(e, "Unable to sign in to chat."), e;
4207
+ throw St(), g.value = Z(e, "Unable to sign in to chat."), e;
4195
4208
  } finally {
4196
4209
  r.value = !1;
4197
4210
  }
4198
4211
  }
4199
- async function fe() {
4212
+ async function he() {
4200
4213
  g.value = null;
4201
4214
  try {
4202
- qe(null), Ze(), await U.getLoggedinUser() && await U.logout();
4215
+ Je(null), Qe(), await H.getLoggedinUser() && await H.logout();
4203
4216
  } finally {
4204
- xt();
4217
+ St();
4205
4218
  }
4206
4219
  }
4207
- function pe() {
4208
- let e = ct();
4220
+ function ge() {
4221
+ let e = lt();
4209
4222
  if (!e) {
4210
- H = null, k.value = [];
4223
+ U = null, k.value = [];
4211
4224
  return;
4212
4225
  }
4213
- let t = `bcc-chat:${K().appId}:${e}`;
4214
- me(t), H = new $s(t), k.value = H.getQueue();
4226
+ let t = `bcc-chat:${G().appId}:${e}`;
4227
+ _e(t), U = new $s(t), k.value = U.getQueue();
4215
4228
  }
4216
- function me(e) {
4229
+ function _e(e) {
4217
4230
  if (typeof window > "u") return;
4218
- let t = `bcc-chat:${K().appId}:`, n = [];
4231
+ let t = `bcc-chat:${G().appId}:`, n = [];
4219
4232
  for (let r = 0; r < window.localStorage.length; r += 1) {
4220
4233
  let i = window.localStorage.key(r);
4221
4234
  i && i.startsWith(t) && i !== e && n.push(i);
4222
4235
  }
4223
4236
  n.forEach((e) => window.localStorage.removeItem(e));
4224
4237
  }
4225
- function he() {
4226
- R || typeof window > "u" || (window.addEventListener("online", ge), window.addEventListener("offline", _e), R = !0);
4227
- }
4228
- function ge() {
4229
- m.value = !1, V = !0, ae || xe(!0);
4230
- }
4231
- function _e() {
4232
- m.value = !0, p.value = !1, ve();
4233
- }
4234
4238
  function ve() {
4235
- te !== null && (clearTimeout(te), te = null);
4239
+ z || typeof window > "u" || (window.addEventListener("online", N), window.addEventListener("offline", N), window.addEventListener("focus", N), document.addEventListener("visibilitychange", N), z = !0, N());
4236
4240
  }
4237
4241
  function ye() {
4238
- re = Date.now() + 1500;
4242
+ ne !== null && (clearTimeout(ne), ne = null);
4239
4243
  }
4240
4244
  function be() {
4241
- return Date.now() < re;
4245
+ ae = Date.now() + 1500;
4242
4246
  }
4243
- function xe(e = !1) {
4244
- if (te !== null || z || m.value || !h.value || ae) return;
4245
- let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ie, 4));
4246
- te = setTimeout(() => {
4247
- te = null, Se();
4247
+ function xe() {
4248
+ return Date.now() < ae;
4249
+ }
4250
+ function Se(e = !1) {
4251
+ if (ne !== null || B || m.value || !h.value || V) return;
4252
+ let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(oe, 4));
4253
+ ne = setTimeout(() => {
4254
+ ne = null, Ce();
4248
4255
  }, t);
4249
4256
  }
4250
- async function Se() {
4251
- if (!(m.value || !h.value || ae)) return z || (z = (async () => {
4252
- ve();
4257
+ async function Ce() {
4258
+ if (N(), !(m.value || !h.value || V)) return B || (B = (async () => {
4259
+ ye();
4253
4260
  try {
4254
- let e = await U.getLoggedinUser();
4261
+ let e = await H.getLoggedinUser();
4255
4262
  if (!e) {
4256
- let t = Ke();
4263
+ let t = qe();
4257
4264
  if (!t) return;
4258
4265
  let n = await uc(t);
4259
- e = await U.login(n);
4266
+ e = await H.login(n);
4260
4267
  }
4261
- _.value = hc(e), h.value = !0, pe();
4262
- let t = U.connect;
4263
- typeof t == "function" && (await t.call(U), p.value = !0), ie = 0, V && await Ce();
4268
+ _.value = hc(e), h.value = !0, ge();
4269
+ let t = H.connect;
4270
+ typeof t == "function" && (await t.call(H), p.value = !0), oe = 0, se && await we();
4264
4271
  } catch (e) {
4265
- p.value = !1, ie += 1, It(e) || (g.value = Z(e, "Unable to reconnect to chat.")), xe();
4272
+ p.value = !1, oe += 1, Lt(e) || (g.value = Z(e, "Unable to reconnect to chat.")), Se();
4266
4273
  } finally {
4267
- z = null;
4274
+ B = null;
4268
4275
  }
4269
- })(), z);
4276
+ })(), B);
4270
4277
  }
4271
- async function Ce() {
4272
- return ne || m.value || !h.value || ae || (ne = (async () => {
4273
- V = !1, g.value = null;
4278
+ async function we() {
4279
+ return re || m.value || !h.value || V || (re = (async () => {
4280
+ se = !1, g.value = null;
4274
4281
  try {
4275
- await Oe(), Kt();
4282
+ await ke(), qt();
4276
4283
  } finally {
4277
- ne = null;
4284
+ re = null;
4278
4285
  }
4279
- })()), ne;
4286
+ })()), re;
4280
4287
  }
4281
- function we() {
4282
- if (!H || v.value.length > 0) return;
4283
- let e = H.getConversations();
4284
- e.length !== 0 && (v.value = bc(e), !T.value && v.value.length > 0 && Te(T.value));
4288
+ function Te() {
4289
+ if (!U || v.value.length > 0) return;
4290
+ let e = U.getConversations();
4291
+ e.length !== 0 && (v.value = bc(e), !T.value && v.value.length > 0 && Ee(T.value));
4285
4292
  }
4286
- function Te(e) {
4287
- if (!H || !e) return y.value = [], !1;
4288
- let t = H.getMessages(e).sort(xc);
4293
+ function Ee(e) {
4294
+ if (!U || !e) return y.value = [], !1;
4295
+ let t = U.getMessages(e).sort(xc);
4289
4296
  return y.value = t, t.length > 0;
4290
4297
  }
4291
- async function Ee() {
4292
- ae = !1, V = !0, await Se();
4293
- }
4294
4298
  async function De() {
4295
- ae = !0, V = !1, ve();
4296
- let e = U.disconnect;
4297
- typeof e == "function" && await e.call(U), p.value = !1;
4299
+ V = !1, se = !0, await Ce();
4298
4300
  }
4299
4301
  async function Oe() {
4300
- if (await ue(), i.value = !0, g.value = null, m.value && H) {
4301
- v.value = bc(H.getConversations()), P.value && await nt(), i.value = !1;
4302
+ V = !0, se = !1, ye();
4303
+ let e = H.disconnect;
4304
+ typeof e == "function" && await e.call(H), p.value = !1;
4305
+ }
4306
+ async function ke() {
4307
+ if (await pe(), N(), i.value = !0, g.value = null, m.value) {
4308
+ v.value = bc(U?.getConversations() ?? []), I.value && await rt(), i.value = !1;
4302
4309
  return;
4303
4310
  }
4304
4311
  try {
4305
- let e = new U.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(U.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4312
+ let e = new H.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(H.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4306
4313
  do
4307
4314
  n = await e.fetchNext(), t.push(...n.map((e) => dc(e, _.value?.uid)));
4308
4315
  while (n.length === 50);
@@ -4311,9 +4318,9 @@ function cc({ environment: e }) {
4311
4318
  let t = r.get(e.id);
4312
4319
  t && (e.subtitle === "No messages yet" && t.subtitle && t.subtitle !== "No messages yet" && (e.subtitle = t.subtitle), !e.lastMessageAt && t.lastMessageAt && (e.lastMessageAt = t.lastMessageAt), !e.lastMessage && t.lastMessage && (e.lastMessage = t.lastMessage));
4313
4320
  }
4314
- v.value = bc(await pt(t)), H?.setConversations(v.value), P.value && await nt();
4321
+ v.value = bc(await mt(t)), U?.setConversations(v.value), I.value && await rt();
4315
4322
  } catch (e) {
4316
- let t = H?.getConversations() ?? [];
4323
+ let t = U?.getConversations() ?? [];
4317
4324
  if (t.length > 0) {
4318
4325
  v.value = bc(t);
4319
4326
  return;
@@ -4323,39 +4330,39 @@ function cc({ environment: e }) {
4323
4330
  i.value = !1;
4324
4331
  }
4325
4332
  }
4326
- async function ke(e) {
4327
- T.value = e, E.value = null, b.value = [], W = null, C.value = !1, D.value = null, O.value = null, Te(e), await nt();
4333
+ async function Ae(e) {
4334
+ T.value = e, E.value = null, b.value = [], de = null, C.value = !1, D.value = null, O.value = null, Ee(e), await rt();
4328
4335
  }
4329
- function Ae(e) {
4336
+ function je(e) {
4330
4337
  e && (O.value = null), D.value = e;
4331
4338
  }
4332
- function je(e) {
4339
+ function Me(e) {
4333
4340
  e && (D.value = null), O.value = e;
4334
4341
  }
4335
- async function Me(e) {
4336
- E.value = e, W = null, C.value = !1, D.value = null, O.value = null, await it(e.id);
4342
+ async function Ne(e) {
4343
+ E.value = e, de = null, C.value = !1, D.value = null, O.value = null, await at(e.id);
4337
4344
  }
4338
- function Ne() {
4339
- E.value = null, b.value = [], W = null, C.value = !1, D.value = null, O.value = null;
4345
+ function Pe() {
4346
+ E.value = null, b.value = [], de = null, C.value = !1, D.value = null, O.value = null;
4340
4347
  }
4341
- async function Pe(e, t) {
4348
+ async function Fe(e, t) {
4342
4349
  if (u.value) return;
4343
- let n = P.value;
4350
+ let n = I.value;
4344
4351
  if (!n) return;
4345
4352
  let r = Vs(e);
4346
4353
  if (!Hs(r)) return;
4347
4354
  if (O.value) {
4348
- await Fe(O.value, r);
4355
+ await Ie(O.value, r);
4349
4356
  return;
4350
4357
  }
4351
- let i = E.value?.id, a = crypto.randomUUID(), o = Dc(Pt(D.value, t), a);
4358
+ let i = E.value?.id, a = crypto.randomUUID(), o = Dc(Ft(D.value, t), a);
4352
4359
  u.value = !0, g.value = null;
4353
4360
  try {
4354
4361
  if (m.value) {
4355
- Lt(n, r, o, i, a), D.value = null;
4362
+ Rt(n, r, o, i, a), D.value = null;
4356
4363
  return;
4357
4364
  }
4358
- Ut(Nt({
4365
+ Wt(Pt({
4359
4366
  conversation: n,
4360
4367
  kind: "text",
4361
4368
  text: r,
@@ -4364,31 +4371,31 @@ function cc({ environment: e }) {
4364
4371
  muid: a,
4365
4372
  deliveryState: "sending"
4366
4373
  }));
4367
- let e = new U.TextMessage(n.targetId, r, kc(n));
4374
+ let e = new H.TextMessage(n.targetId, r, kc(n));
4368
4375
  e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
4369
- let t = await U.sendMessage(e);
4370
- Ct(N(t, _.value?.uid)), ht(t), await vt(t), D.value = null;
4376
+ let t = await H.sendMessage(e);
4377
+ wt(F(t, _.value?.uid)), gt(t), await yt(t), D.value = null;
4371
4378
  } catch (e) {
4372
- if (It(e)) {
4373
- Wt("queued", a), Lt(n, r, o, E.value?.id, a), D.value = null;
4379
+ if (Lt(e)) {
4380
+ Gt("queued", a), Rt(n, r, o, E.value?.id, a), D.value = null;
4374
4381
  return;
4375
4382
  }
4376
- throw Wt("failed", a), g.value = Z(e, "Unable to send the message."), e;
4383
+ throw Gt("failed", a), g.value = Z(e, "Unable to send the message."), e;
4377
4384
  } finally {
4378
4385
  u.value = !1;
4379
4386
  }
4380
4387
  }
4381
- async function Fe(e, t) {
4382
- let n = P.value;
4388
+ async function Ie(e, t) {
4389
+ let n = I.value;
4383
4390
  if (!n || m.value) return;
4384
4391
  let r = Vs(t);
4385
4392
  if (Hs(r)) {
4386
4393
  u.value = !0, g.value = null;
4387
4394
  try {
4388
4395
  let t;
4389
- e.kind === "text" ? t = new U.TextMessage(n.targetId, r, kc(n)) : (t = new U.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, kc(n)), t.setCaption(r)), t.setId(Number(e.id));
4390
- let i = await U.editMessage(t);
4391
- Ct(N(i, _.value?.uid)), ht(i), O.value = null;
4396
+ e.kind === "text" ? t = new H.TextMessage(n.targetId, r, kc(n)) : (t = new H.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, kc(n)), t.setCaption(r)), t.setId(Number(e.id));
4397
+ let i = await H.editMessage(t);
4398
+ wt(F(i, _.value?.uid)), gt(i), O.value = null;
4392
4399
  } catch (e) {
4393
4400
  throw g.value = Z(e, "Unable to edit the message."), e;
4394
4401
  } finally {
@@ -4396,18 +4403,18 @@ function cc({ environment: e }) {
4396
4403
  }
4397
4404
  }
4398
4405
  }
4399
- async function Ie(e, t) {
4406
+ async function Le(e, t) {
4400
4407
  if (u.value) return;
4401
- let n = P.value;
4408
+ let n = I.value;
4402
4409
  if (!n) return;
4403
- let r = E.value?.id, i = crypto.randomUUID(), a = Dc(Pt(D.value, t), i), o = Nc(e.file);
4410
+ let r = E.value?.id, i = crypto.randomUUID(), a = Dc(Ft(D.value, t), i), o = Nc(e.file);
4404
4411
  u.value = !0, g.value = null;
4405
4412
  try {
4406
4413
  if (m.value) {
4407
- await Vt(n, e, a, r, i), D.value = null;
4414
+ await Ht(n, e, a, r, i), D.value = null;
4408
4415
  return;
4409
4416
  }
4410
- Ut(Nt({
4417
+ Wt(Pt({
4411
4418
  conversation: n,
4412
4419
  kind: o,
4413
4420
  text: e.caption?.trim() ?? "",
@@ -4422,37 +4429,37 @@ function cc({ environment: e }) {
4422
4429
  muid: i,
4423
4430
  deliveryState: "sending"
4424
4431
  }));
4425
- let t = new U.MediaMessage(n.targetId, e.file, o, kc(n));
4432
+ let t = new H.MediaMessage(n.targetId, e.file, o, kc(n));
4426
4433
  t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
4427
- let s = await U.sendMediaMessage(t);
4428
- Ct(N(s, _.value?.uid)), ht(s), await vt(s), D.value = null;
4434
+ let s = await H.sendMediaMessage(t);
4435
+ wt(F(s, _.value?.uid)), gt(s), await yt(s), D.value = null;
4429
4436
  } catch (t) {
4430
- if (It(t)) {
4431
- Wt("queued", i), await Vt(n, e, a, r, i), D.value = null;
4437
+ if (Lt(t)) {
4438
+ Gt("queued", i), await Ht(n, e, a, r, i), D.value = null;
4432
4439
  return;
4433
4440
  }
4434
- throw Wt("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
4441
+ throw Gt("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
4435
4442
  } finally {
4436
4443
  u.value = !1;
4437
4444
  }
4438
4445
  }
4439
- async function Le(e, t) {
4446
+ async function Re(e, t) {
4440
4447
  if (u.value) return;
4441
- let n = P.value;
4448
+ let n = I.value;
4442
4449
  if (!n) return;
4443
4450
  let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
4444
4451
  if (!r || i.length < 2) return;
4445
- let a = E.value?.id, o = crypto.randomUUID(), s = Dc(Pt(D.value, t), o);
4452
+ let a = E.value?.id, o = crypto.randomUUID(), s = Dc(Ft(D.value, t), o);
4446
4453
  u.value = !0, g.value = null;
4447
4454
  try {
4448
4455
  if (m.value) {
4449
- Rt(n, {
4456
+ zt(n, {
4450
4457
  question: r,
4451
4458
  options: i
4452
4459
  }, s, a, o), D.value = null;
4453
4460
  return;
4454
4461
  }
4455
- Ut(Nt({
4462
+ Wt(Pt({
4456
4463
  conversation: n,
4457
4464
  kind: "poll",
4458
4465
  text: `Poll: ${r}`,
@@ -4469,41 +4476,41 @@ function cc({ environment: e }) {
4469
4476
  question: r,
4470
4477
  options: i,
4471
4478
  receiver: n.targetId,
4472
- receiverType: n.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER
4479
+ receiverType: n.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER
4473
4480
  };
4474
4481
  a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
4475
- let t = await U.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4476
- c ? (Gt(o), Ct(N(c, _.value?.uid)), ht(c), await vt(c)) : (Gt(o), await St()), D.value = null;
4482
+ let t = await H.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4483
+ c ? (Kt(o), wt(F(c, _.value?.uid)), gt(c), await yt(c)) : (Kt(o), await Ct()), D.value = null;
4477
4484
  } catch (e) {
4478
- if (It(e)) {
4479
- Wt("queued", o), Rt(n, {
4485
+ if (Lt(e)) {
4486
+ Gt("queued", o), zt(n, {
4480
4487
  question: r,
4481
4488
  options: i
4482
4489
  }, s, a, o), D.value = null;
4483
4490
  return;
4484
4491
  }
4485
- throw Wt("failed", o), g.value = Z(e, "Unable to send the poll."), e;
4492
+ throw Gt("failed", o), g.value = Z(e, "Unable to send the poll."), e;
4486
4493
  } finally {
4487
4494
  u.value = !1;
4488
4495
  }
4489
4496
  }
4490
- async function G(e, t) {
4497
+ async function W(e, t) {
4491
4498
  let n = e.poll?.id ?? e.id, r = _.value?.uid;
4492
4499
  if (!n || !t || m.value) return;
4493
- let i = Tt(e.id, e.parentMessageId) ?? e;
4500
+ let i = Et(e.id, e.parentMessageId) ?? e;
4494
4501
  if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
4495
- g.value = null, r && Ct(Re(i, t, r));
4502
+ g.value = null, r && wt(ze(i, t, r));
4496
4503
  try {
4497
- await U.callExtension("polls", "POST", "v2/vote", {
4504
+ await H.callExtension("polls", "POST", "v2/vote", {
4498
4505
  id: n,
4499
4506
  vote: t
4500
4507
  });
4501
4508
  } catch (e) {
4502
- throw Ct(i), g.value = Z(e, "Unable to cast the vote."), e;
4509
+ throw wt(i), g.value = Z(e, "Unable to cast the vote."), e;
4503
4510
  }
4504
4511
  }
4505
4512
  }
4506
- function Re(e, t, n) {
4513
+ function ze(e, t, n) {
4507
4514
  if (!e.poll) return e;
4508
4515
  let r = e.poll, i = r.allowsMultipleAnswers, a = r.options.filter((e) => e.voters.includes(n)).map((e) => e.id), o = !i && a.length > 0, s = r.options.map((e) => o && e.voters.includes(n) && e.id !== t ? {
4509
4516
  ...e,
@@ -4523,80 +4530,80 @@ function cc({ environment: e }) {
4523
4530
  }
4524
4531
  };
4525
4532
  }
4526
- async function ze(e, t) {
4533
+ async function Be(e, t) {
4527
4534
  g.value = null;
4528
- let n = Tt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4529
- Ct(Et(n, t));
4535
+ let n = Et(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4536
+ wt(Dt(n, t));
4530
4537
  try {
4531
- Ct(N(r ? await U.removeReaction(Number(e.id), t) : await U.addReaction(Number(e.id), t), _.value?.uid));
4538
+ wt(F(r ? await H.removeReaction(Number(e.id), t) : await H.addReaction(Number(e.id), t), _.value?.uid));
4532
4539
  } catch (e) {
4533
- throw Ct(n), g.value = Z(e, "Unable to update the reaction."), e;
4540
+ throw wt(n), g.value = Z(e, "Unable to update the reaction."), e;
4534
4541
  }
4535
4542
  }
4536
- async function Be(e) {
4543
+ async function Ve(e) {
4537
4544
  if (g.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
4538
- kt(e);
4545
+ At(e);
4539
4546
  return;
4540
4547
  }
4541
4548
  if (!m.value) try {
4542
- let t = N(await U.deleteMessage(String(e.id)), _.value?.uid);
4543
- kt(t), At(t);
4549
+ let t = F(await H.deleteMessage(String(e.id)), _.value?.uid);
4550
+ At(t), jt(t);
4544
4551
  } catch (e) {
4545
4552
  throw g.value = Z(e, "Unable to delete the message."), e;
4546
4553
  }
4547
4554
  }
4548
- async function He(e) {
4555
+ async function Ue(e) {
4549
4556
  let t = e.source?.getText?.() ?? e.text;
4550
4557
  if (Hs(t)) {
4551
4558
  g.value = null;
4552
4559
  try {
4553
- let n = (await U.callExtension("message-translation", "POST", "v2/translate", {
4560
+ let n = (await H.callExtension("message-translation", "POST", "v2/translate", {
4554
4561
  msgId: Number(e.id),
4555
4562
  text: t,
4556
4563
  languages: typeof navigator < "u" ? navigator.languages : ["en"]
4557
4564
  })).translations?.[0]?.message_translated?.trim();
4558
4565
  if (!n) return;
4559
- wt({
4566
+ Tt({
4560
4567
  ...e,
4561
4568
  translatedText: n,
4562
4569
  metadata: {
4563
4570
  ...e.metadata ?? {},
4564
4571
  translated_message: n
4565
4572
  }
4566
- }), Ot();
4573
+ }), kt();
4567
4574
  } catch (e) {
4568
4575
  throw g.value = Z(e, "Unable to translate the message."), e;
4569
4576
  }
4570
4577
  }
4571
4578
  }
4572
- async function Ue(e) {
4573
- let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++le;
4579
+ async function We(e) {
4580
+ let t = e ?? I.value?.targetId, n = _.value?.uid, r = ++fe;
4574
4581
  if (!t || !n) {
4575
- r === le && (x.value = []);
4582
+ r === fe && (x.value = []);
4576
4583
  return;
4577
4584
  }
4578
4585
  l.value = !0, g.value = null;
4579
4586
  try {
4580
- let e = new U.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4587
+ let e = new H.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4581
4588
  do
4582
- a = await e.fetchPrevious(), i.push(...a.map((e) => N(e, _.value?.uid)));
4589
+ a = await e.fetchPrevious(), i.push(...a.map((e) => F(e, _.value?.uid)));
4583
4590
  while (a.length === 50);
4584
4591
  let o = i.filter((e) => !(e.isDeleted || !e.scheduled?.scheduleDate || t && e.scheduled.originalChatUid && e.scheduled.originalChatUid !== t)).sort((e, t) => (e.scheduled?.scheduleDate?.getTime() ?? e.sentAt.getTime()) - (t.scheduled?.scheduleDate?.getTime() ?? t.sentAt.getTime()));
4585
- if (r !== le) return;
4592
+ if (r !== fe) return;
4586
4593
  x.value = o;
4587
4594
  } catch (e) {
4588
- if (r !== le) return;
4589
- throw g.value = Z(e, _t("loadScheduledMessagesError")), e;
4595
+ if (r !== fe) return;
4596
+ throw g.value = Z(e, vt("loadScheduledMessagesError")), e;
4590
4597
  } finally {
4591
- r === le && (l.value = !1);
4598
+ r === fe && (l.value = !1);
4592
4599
  }
4593
4600
  }
4594
- async function We(e, t) {
4595
- let n = P.value;
4601
+ async function Ge(e, t) {
4602
+ let n = I.value;
4596
4603
  if (n) {
4597
4604
  d.value = !0, g.value = null;
4598
4605
  try {
4599
- e.file ? await Mc(n, e, t) : await jc(n, e, t), await Ue(n.targetId);
4606
+ e.file ? await Mc(n, e, t) : await jc(n, e, t), await We(n.targetId);
4600
4607
  } catch (e) {
4601
4608
  throw g.value = Z(e, "Unable to schedule the message."), e;
4602
4609
  } finally {
@@ -4604,16 +4611,16 @@ function cc({ environment: e }) {
4604
4611
  }
4605
4612
  }
4606
4613
  }
4607
- async function Ge(e) {
4614
+ async function Ke(e) {
4608
4615
  if (g.value = null, !e.scheduled) return;
4609
4616
  let t = e.scheduled.originalChatUid;
4610
4617
  try {
4611
- await U.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await Ue(t);
4618
+ await H.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await We(t);
4612
4619
  } catch (e) {
4613
4620
  throw g.value = Z(e, "Unable to remove the scheduled message."), e;
4614
4621
  }
4615
4622
  }
4616
- async function Je(e, t) {
4623
+ async function Ye(e, t) {
4617
4624
  g.value = null;
4618
4625
  let n = _.value?.uid;
4619
4626
  if (!n || !e.scheduled?.muid || e.kind === "poll") return;
@@ -4623,22 +4630,22 @@ function cc({ environment: e }) {
4623
4630
  !i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
4624
4631
  try {
4625
4632
  let t;
4626
- if (e.kind === "text") t = new U.TextMessage(n, r, U.RECEIVER_TYPE.GROUP);
4633
+ if (e.kind === "text") t = new H.TextMessage(n, r, H.RECEIVER_TYPE.GROUP);
4627
4634
  else {
4628
4635
  let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
4629
- t = new U.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, U.RECEIVER_TYPE.GROUP), t.setCaption(r);
4636
+ t = new H.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, H.RECEIVER_TYPE.GROUP), t.setCaption(r);
4630
4637
  }
4631
- Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await U.editMessage(t), await Ue(e.scheduled.originalChatUid);
4638
+ Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await H.editMessage(t), await We(e.scheduled.originalChatUid);
4632
4639
  } catch (e) {
4633
4640
  throw g.value = Z(e, "Unable to edit the scheduled message."), e;
4634
4641
  } finally {
4635
4642
  d.value = !1;
4636
4643
  }
4637
4644
  }
4638
- async function Ye(e) {
4645
+ async function Xe(e) {
4639
4646
  d.value = !0, g.value = null;
4640
4647
  try {
4641
- let t = Ac(), n = await fetch(`${K().chatApiBaseUrl}/chats/rescheduleMessage`, {
4648
+ let t = Ac(), n = await fetch(`${G().chatApiBaseUrl}/chats/rescheduleMessage`, {
4642
4649
  method: "POST",
4643
4650
  headers: {
4644
4651
  "Content-Type": "application/json",
@@ -4652,23 +4659,23 @@ function cc({ environment: e }) {
4652
4659
  })
4653
4660
  });
4654
4661
  if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
4655
- await Ue(e.originalChatUid);
4662
+ await We(e.originalChatUid);
4656
4663
  } catch (e) {
4657
4664
  throw g.value = Z(e, "Unable to reschedule the message."), e;
4658
4665
  } finally {
4659
4666
  d.value = !1;
4660
4667
  }
4661
4668
  }
4662
- function Xe(e) {
4663
- let t = new U.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4669
+ function Ze(e) {
4670
+ let t = new H.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4664
4671
  return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
4665
4672
  }
4666
- function Qe(e) {
4667
- return new U.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4673
+ function $e(e) {
4674
+ return new H.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4668
4675
  }
4669
- async function $e(e) {
4676
+ async function et(e) {
4670
4677
  if (!e.isOwn || e.receipts.readAt) return e;
4671
- let t = `bcc-chat:${K().appId}:message_${e.id}_receiptStatus`;
4678
+ let t = `bcc-chat:${G().appId}:message_${e.id}_receiptStatus`;
4672
4679
  try {
4673
4680
  let n = localStorage.getItem(t);
4674
4681
  if (n) {
@@ -4676,7 +4683,7 @@ function cc({ environment: e }) {
4676
4683
  if (!Number.isNaN(r.getTime()) && !Number.isNaN(i.getTime())) return e.receipts.readAt = r, e.receipts.deliveredAt = i, e;
4677
4684
  }
4678
4685
  } catch {}
4679
- let n = await bt(e);
4686
+ let n = await xt(e);
4680
4687
  for (let t of n) t.kind === "read" && t.timestamp && (!e.receipts.readAt || t.timestamp > e.receipts.readAt) && (e.receipts.readAt = t.timestamp), t.kind === "delivered" && t.timestamp && (!e.receipts.deliveredAt || t.timestamp > e.receipts.deliveredAt) && (e.receipts.deliveredAt = t.timestamp);
4681
4688
  if (e.receipts.readAt) try {
4682
4689
  localStorage.setItem(t, JSON.stringify({
@@ -4686,7 +4693,7 @@ function cc({ environment: e }) {
4686
4693
  } catch {}
4687
4694
  return e;
4688
4695
  }
4689
- async function et(e) {
4696
+ async function tt(e) {
4690
4697
  try {
4691
4698
  return await e.fetchPrevious();
4692
4699
  } catch (e) {
@@ -4694,37 +4701,38 @@ function cc({ environment: e }) {
4694
4701
  throw e;
4695
4702
  }
4696
4703
  }
4697
- async function tt(e) {
4698
- let t = P.value;
4699
- if (!t) return y.value = [], S.value = !1, !1;
4700
- if ((e?.reset || ce?.conversationId !== t.id) && (ce = {
4704
+ async function nt(e) {
4705
+ let t = I.value;
4706
+ if (!t || m.value) return y.value = [], S.value = !1, !1;
4707
+ if ((e?.reset || ue?.conversationId !== t.id) && (ue = {
4701
4708
  conversationId: t.id,
4702
- request: Xe(t)
4703
- }, S.value = !0), !ce) return !1;
4704
- let n = await et(ce.request), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map($e));
4705
- y.value = e?.reset ? Cc(y.value.filter((e) => e.conversationId === t.id && wc(e)), r) : Cc(y.value, r), S.value = n.length === 50, H?.setMessages(t.id, y.value);
4709
+ request: Ze(t)
4710
+ }, S.value = !0), !ue) return !1;
4711
+ let n = await tt(ue.request), r = await Promise.all(n.map((e) => F(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
4712
+ y.value = e?.reset ? Cc(y.value.filter((e) => e.conversationId === t.id && wc(e)), r) : Cc(y.value, r), S.value = n.length === 50, U?.setMessages(t.id, y.value);
4706
4713
  let i = n[n.length - 1];
4707
- return i && (await yt(i), await vt(i)), n.length > 0;
4714
+ return i && (await bt(i), await yt(i)), n.length > 0;
4708
4715
  }
4709
- async function nt() {
4710
- let e = P.value;
4716
+ async function rt() {
4717
+ N();
4718
+ let e = I.value;
4711
4719
  if (!e) {
4712
- y.value = [], S.value = !1, ce = null;
4720
+ y.value = [], S.value = !1, ue = null;
4713
4721
  return;
4714
4722
  }
4715
- let t = Te(e.id);
4716
- if (a.value = !0, m.value && H) {
4717
- S.value = !1, ce = null, a.value = !1;
4723
+ let t = Ee(e.id);
4724
+ if (a.value = !0, m.value) {
4725
+ S.value = !1, ue = null, a.value = !1;
4718
4726
  return;
4719
4727
  }
4720
4728
  try {
4721
- await tt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4729
+ await nt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4722
4730
  ...t,
4723
4731
  lastMessage: y.value.at(-1) ?? null,
4724
4732
  unreadCount: 0
4725
- } : t), H?.setConversations(v.value);
4733
+ } : t), U?.setConversations(v.value);
4726
4734
  } catch (n) {
4727
- let r = H?.getMessages(e.id) ?? [];
4735
+ let r = U?.getMessages(e.id) ?? [];
4728
4736
  if (r.length > 0) {
4729
4737
  t || (y.value = r.sort(xc));
4730
4738
  return;
@@ -4734,27 +4742,27 @@ function cc({ environment: e }) {
4734
4742
  a.value = !1;
4735
4743
  }
4736
4744
  }
4737
- async function rt(e) {
4745
+ async function it(e) {
4738
4746
  let t = E.value?.id;
4739
4747
  if (!t) return b.value = [], C.value = !1, !1;
4740
- if ((e?.reset || W?.parentMessageId !== t) && (W = {
4748
+ if ((e?.reset || de?.parentMessageId !== t) && (de = {
4741
4749
  parentMessageId: t,
4742
- request: Qe(t)
4743
- }, C.value = !0), !W) return !1;
4744
- let n = await W.request.fetchPrevious(), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map($e));
4745
- b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50, H?.setThreadMessages(t, b.value);
4750
+ request: $e(t)
4751
+ }, C.value = !0), !de) return !1;
4752
+ let n = await de.request.fetchPrevious(), r = await Promise.all(n.map((e) => F(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
4753
+ b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50, U?.setThreadMessages(t, b.value);
4746
4754
  let i = n[n.length - 1];
4747
- return i && (await yt(i), await vt(i)), n.length > 0;
4755
+ return i && (await bt(i), await yt(i)), n.length > 0;
4748
4756
  }
4749
- async function it(e) {
4750
- if (o.value = !0, m.value && H) {
4751
- b.value = H.getThreadMessages(e).sort(xc), C.value = !1, W = null, o.value = !1;
4757
+ async function at(e) {
4758
+ if (o.value = !0, m.value) {
4759
+ b.value = (U?.getThreadMessages(e) ?? []).sort(xc), C.value = !1, de = null, o.value = !1;
4752
4760
  return;
4753
4761
  }
4754
4762
  try {
4755
- await rt({ reset: !0 });
4763
+ await it({ reset: !0 });
4756
4764
  } catch (t) {
4757
- let n = H?.getThreadMessages(e) ?? [];
4765
+ let n = U?.getThreadMessages(e) ?? [];
4758
4766
  if (n.length > 0) {
4759
4767
  b.value = n.sort(xc);
4760
4768
  return;
@@ -4764,29 +4772,29 @@ function cc({ environment: e }) {
4764
4772
  o.value = !1;
4765
4773
  }
4766
4774
  }
4767
- async function at() {
4775
+ async function ot() {
4768
4776
  if (a.value || s.value || !S.value) return !1;
4769
4777
  s.value = !0, g.value = null;
4770
4778
  try {
4771
- return await tt();
4779
+ return await nt();
4772
4780
  } catch (e) {
4773
4781
  throw g.value = Z(e, "Unable to load messages."), e;
4774
4782
  } finally {
4775
4783
  s.value = !1;
4776
4784
  }
4777
4785
  }
4778
- async function ot() {
4786
+ async function st() {
4779
4787
  if (o.value || c.value || !C.value) return !1;
4780
4788
  c.value = !0, g.value = null;
4781
4789
  try {
4782
- return await rt();
4790
+ return await it();
4783
4791
  } catch (e) {
4784
4792
  throw g.value = Z(e, "Unable to load thread."), e;
4785
4793
  } finally {
4786
4794
  c.value = !1;
4787
4795
  }
4788
4796
  }
4789
- async function st(e) {
4797
+ async function ct(e) {
4790
4798
  let t = e.trim();
4791
4799
  if (!t) return !1;
4792
4800
  let n = () => y.value.some((e) => e.id === t) || b.value.some((e) => e.id === t) || E.value?.id === t;
@@ -4794,101 +4802,101 @@ function cc({ environment: e }) {
4794
4802
  let r = 0;
4795
4803
  for (; C.value && E.value && r < 100;) {
4796
4804
  r += 1;
4797
- let e = await ot();
4805
+ let e = await st();
4798
4806
  if (n()) return !0;
4799
4807
  if (!e) break;
4800
4808
  }
4801
- for (; S.value && P.value && r < 100;) {
4809
+ for (; S.value && I.value && r < 100;) {
4802
4810
  r += 1;
4803
- let e = await at();
4811
+ let e = await ot();
4804
4812
  if (n()) return !0;
4805
4813
  if (!e) break;
4806
4814
  }
4807
4815
  return n();
4808
4816
  }
4809
- async function lt() {
4810
- let e = await U.getLoggedinUser();
4817
+ async function ut() {
4818
+ let e = await H.getLoggedinUser();
4811
4819
  _.value = e ? hc(e) : null, h.value = !!e;
4812
4820
  }
4813
- function dt() {
4814
- L ||= (U.addConnectionListener(F, new U.ConnectionListener({
4821
+ function ft() {
4822
+ R ||= (H.addConnectionListener(te, new H.ConnectionListener({
4815
4823
  onConnected: () => {
4816
- if (p.value = !0, ie = 0, ve(), V) {
4817
- Ce();
4824
+ if (p.value = !0, oe = 0, ye(), se) {
4825
+ we();
4818
4826
  return;
4819
4827
  }
4820
- Kt();
4828
+ qt();
4821
4829
  },
4822
4830
  onDisconnected: () => {
4823
- p.value = !1, !m.value && h.value && !ae && (V = !0, xe(!0));
4831
+ p.value = !1, !m.value && h.value && !V && (se = !0, Se(!0));
4824
4832
  }
4825
- })), U.addMessageListener(I, new U.MessageListener({
4833
+ })), H.addMessageListener(L, new H.MessageListener({
4826
4834
  onTextMessageReceived: (e) => {
4827
- ft(e);
4835
+ pt(e);
4828
4836
  },
4829
4837
  onMediaMessageReceived: (e) => {
4830
- ft(e);
4838
+ pt(e);
4831
4839
  },
4832
4840
  onCustomMessageReceived: (e) => {
4833
- ft(e);
4841
+ pt(e);
4834
4842
  },
4835
4843
  onMessagesDelivered: () => {
4836
- be() || St({ includeThread: !1 });
4844
+ xe() || Ct({ includeThread: !1 });
4837
4845
  },
4838
4846
  onMessagesRead: () => {
4839
- be() || St({ includeThread: !1 });
4847
+ xe() || Ct({ includeThread: !1 });
4840
4848
  },
4841
4849
  onMessageEdited: (e) => {
4842
- let t = N(e, _.value?.uid);
4843
- Tc(t) && (gt(t), ht(e));
4850
+ let t = F(e, _.value?.uid);
4851
+ Tc(t) && (_t(t), gt(e));
4844
4852
  },
4845
4853
  onMessageDeleted: (e) => {
4846
- let t = N(e, _.value?.uid);
4847
- t.parentMessageId ? kt(t) : (kt(t), At(t)), Ot();
4854
+ let t = F(e, _.value?.uid);
4855
+ t.parentMessageId ? At(t) : (At(t), jt(t)), kt();
4848
4856
  },
4849
4857
  onMessageReactionAdded: () => {
4850
- St();
4858
+ Ct();
4851
4859
  },
4852
4860
  onMessageReactionRemoved: () => {
4853
- St();
4861
+ Ct();
4854
4862
  },
4855
4863
  onMessagesDeliveredToAll: () => {
4856
- be() || St({ includeThread: !1 });
4864
+ xe() || Ct({ includeThread: !1 });
4857
4865
  },
4858
4866
  onMessagesReadByAll: () => {
4859
- be() || St({ includeThread: !1 });
4867
+ xe() || Ct({ includeThread: !1 });
4860
4868
  }
4861
4869
  })), !0);
4862
4870
  }
4863
- async function ft(e) {
4864
- let t = N(e, _.value?.uid);
4871
+ async function pt(e) {
4872
+ let t = F(e, _.value?.uid);
4865
4873
  if (Tc(t)) {
4866
- if (ht(e), await yt(e), t.parentMessageId) {
4867
- q(t), Dt(t.parentMessageId), Ot();
4874
+ if (gt(e), await bt(e), t.parentMessageId) {
4875
+ K(t), Ot(t.parentMessageId), kt();
4868
4876
  return;
4869
4877
  }
4870
- t.conversationId === T.value && (gt(t), Ot(), await vt(e));
4878
+ t.conversationId === T.value && (_t(t), kt(), await yt(e));
4871
4879
  }
4872
4880
  }
4873
- async function pt(e) {
4881
+ async function mt(e) {
4874
4882
  return await Promise.all(e.map(async (e) => {
4875
- let t = await mt(e.targetId);
4883
+ let t = await ht(e.targetId);
4876
4884
  return {
4877
4885
  ...e,
4878
4886
  muteSettings: t ? new Date(t) : null
4879
4887
  };
4880
4888
  }));
4881
4889
  }
4882
- async function mt(e) {
4883
- let t = H?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4890
+ async function ht(e) {
4891
+ let t = U?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4884
4892
  if (t && (m.value || !n)) return t.mutedUntil;
4885
4893
  if (m.value || !h.value) return t?.mutedUntil ?? null;
4886
4894
  try {
4887
- let n = (await U.getLoggedinUser())?.getUid?.();
4895
+ let n = (await H.getLoggedinUser())?.getUid?.();
4888
4896
  if (!n || e === n) return t?.mutedUntil ?? null;
4889
- let r = Ke();
4897
+ let r = qe();
4890
4898
  if (!r) return t?.mutedUntil ?? null;
4891
- let i = await fetch(`${K().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
4899
+ let i = await fetch(`${G().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
4892
4900
  method: "GET",
4893
4901
  headers: {
4894
4902
  "Content-Type": "application/json",
@@ -4897,7 +4905,7 @@ function cc({ environment: e }) {
4897
4905
  });
4898
4906
  if (!i.ok) return t?.mutedUntil ?? null;
4899
4907
  let a = await i.json();
4900
- return H?.storeParticipantSettings({
4908
+ return U?.storeParticipantSettings({
4901
4909
  chatUid: e,
4902
4910
  mutedUntil: a.mutedUntil ?? null,
4903
4911
  lastUpdated: Date.now()
@@ -4906,12 +4914,12 @@ function cc({ environment: e }) {
4906
4914
  return t?.mutedUntil ?? null;
4907
4915
  }
4908
4916
  }
4909
- function ht(e) {
4910
- let t = N(e, _.value?.uid);
4917
+ function gt(e) {
4918
+ let t = F(e, _.value?.uid);
4911
4919
  if (!Tc(t) || t.isDeleted) return;
4912
4920
  let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
4913
4921
  if (!r) {
4914
- Oe();
4922
+ ke();
4915
4923
  return;
4916
4924
  }
4917
4925
  let i = {
@@ -4921,56 +4929,56 @@ function cc({ environment: e }) {
4921
4929
  unreadCount: n === T.value ? 0 : r.unreadCount + 1,
4922
4930
  lastMessage: t
4923
4931
  };
4924
- v.value = bc(v.value.map((e) => e.id === n ? i : e)), H?.setConversations(v.value);
4932
+ v.value = bc(v.value.map((e) => e.id === n ? i : e)), U?.setConversations(v.value);
4925
4933
  }
4926
- function gt(e) {
4927
- y.value = Sc(y.value, e), T.value && H?.setMessages(T.value, y.value);
4934
+ function _t(e) {
4935
+ y.value = Sc(y.value, e), T.value && U?.setMessages(T.value, y.value);
4928
4936
  }
4929
- function q(e) {
4930
- e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId && H?.setThreadMessages(e.parentMessageId, b.value));
4937
+ function K(e) {
4938
+ e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId && U?.setThreadMessages(e.parentMessageId, b.value));
4931
4939
  }
4932
- async function vt(e) {
4940
+ async function yt(e) {
4933
4941
  if (m.value) return;
4934
4942
  let t = e.getSender?.()?.getUid?.();
4935
- !t || t === _.value?.uid || e.getReadByMeAt?.() || (ye(), await U.markAsRead(e));
4943
+ !t || t === _.value?.uid || e.getReadByMeAt?.() || (be(), await H.markAsRead(e));
4936
4944
  }
4937
- async function yt(e) {
4945
+ async function bt(e) {
4938
4946
  if (m.value) return;
4939
4947
  let t = e.getSender?.()?.getUid?.();
4940
- !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (ye(), await U.markAsDelivered(e));
4948
+ !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (be(), await H.markAsDelivered(e));
4941
4949
  }
4942
- async function bt(e) {
4943
- return m.value ? [] : pc(await U.getMessageReceipts(String(e.id)));
4950
+ async function xt(e) {
4951
+ return m.value ? [] : pc(await H.getMessageReceipts(String(e.id)));
4944
4952
  }
4945
- function xt() {
4946
- r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ve(), ie = 0, V = !1, ae = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, ce = null, W = null, se.clear();
4953
+ function St() {
4954
+ r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ye(), oe = 0, se = !1, V = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, ue = null, de = null, le.clear();
4947
4955
  }
4948
- async function St(e) {
4949
- if (B) return B;
4956
+ async function Ct(e) {
4957
+ if (ie) return ie;
4950
4958
  let t = e?.includeThread ?? !0;
4951
- B = (async () => {
4952
- P.value && await nt(), t && E.value && await it(E.value.id);
4959
+ ie = (async () => {
4960
+ I.value && await rt(), t && E.value && await at(E.value.id);
4953
4961
  })();
4954
4962
  try {
4955
- await B;
4963
+ await ie;
4956
4964
  } finally {
4957
- B = null;
4965
+ ie = null;
4958
4966
  }
4959
4967
  }
4960
- function Ct(e) {
4961
- wt(e), e.parentMessageId && Dt(e.parentMessageId, e.replyCount), Ot();
4962
- }
4963
4968
  function wt(e) {
4969
+ Tt(e), e.parentMessageId && Ot(e.parentMessageId, e.replyCount), kt();
4970
+ }
4971
+ function Tt(e) {
4964
4972
  if (e.parentMessageId) {
4965
4973
  E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e));
4966
4974
  return;
4967
4975
  }
4968
4976
  y.value = Sc(y.value, e), E.value?.id === e.id && (E.value = e);
4969
4977
  }
4970
- function Tt(e, t) {
4978
+ function Et(e, t) {
4971
4979
  return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
4972
4980
  }
4973
- function Et(e, t) {
4981
+ function Dt(e, t) {
4974
4982
  let n = e.reactions.find((e) => e.emoji === t);
4975
4983
  return n ? n.reactedByMe && n.count === 1 ? {
4976
4984
  ...e,
@@ -4991,7 +4999,7 @@ function cc({ environment: e }) {
4991
4999
  }]
4992
5000
  };
4993
5001
  }
4994
- function Dt(e, t) {
5002
+ function Ot(e, t) {
4995
5003
  let n = y.value.find((t) => t.id === e);
4996
5004
  if (!n) return;
4997
5005
  let r = {
@@ -5000,18 +5008,18 @@ function cc({ environment: e }) {
5000
5008
  };
5001
5009
  y.value = Sc(y.value, r), E.value?.id === e && (E.value = r);
5002
5010
  }
5003
- function Ot() {
5004
- T.value && H?.setMessages(T.value, y.value), E.value && H?.setThreadMessages(E.value.id, b.value);
5011
+ function kt() {
5012
+ T.value && U?.setMessages(T.value, y.value), E.value && U?.setThreadMessages(E.value.id, b.value);
5005
5013
  }
5006
- function kt(e) {
5007
- if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), H?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && H?.setMessages(T.value, y.value)), e.muid) {
5014
+ function At(e) {
5015
+ if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), U?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && U?.setMessages(T.value, y.value)), e.muid) {
5008
5016
  k.value = k.value.filter((t) => t.muid !== e.muid);
5009
- let t = H?.getQueue().filter((t) => t.muid === e.muid) ?? [];
5010
- for (let e of t) H?.dequeue(e.id), oe.delete(e.id), e.kind === "attachment" && H?.deleteQueuedAttachment(e.id);
5017
+ let t = U?.getQueue().filter((t) => t.muid === e.muid) ?? [];
5018
+ for (let e of t) U?.dequeue(e.id), ce.delete(e.id), e.kind === "attachment" && U?.deleteQueuedAttachment(e.id);
5011
5019
  }
5012
- e.parentMessageId || jt(e.conversationId);
5020
+ e.parentMessageId || Mt(e.conversationId);
5013
5021
  }
5014
- function At(e) {
5022
+ function jt(e) {
5015
5023
  if (e.parentMessageId) return;
5016
5024
  let t = e.conversationId, n = v.value.find((e) => e.id === t);
5017
5025
  if (!n) return;
@@ -5034,28 +5042,28 @@ function cc({ environment: e }) {
5034
5042
  ...e,
5035
5043
  subtitle: "No messages yet",
5036
5044
  lastMessageAt: void 0
5037
- } : e : e)), H?.setConversations(v.value);
5045
+ } : e : e)), U?.setConversations(v.value);
5038
5046
  }
5039
- function jt(e, t) {
5047
+ function Mt(e, t) {
5040
5048
  let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
5041
5049
  v.value = bc(v.value.map((t) => t.id === e ? {
5042
5050
  ...t,
5043
5051
  subtitle: r ? Oc(r) : "No messages yet",
5044
5052
  lastMessageAt: r?.sentAt,
5045
5053
  lastMessage: r
5046
- } : t)), H?.setConversations(v.value);
5054
+ } : t)), U?.setConversations(v.value);
5047
5055
  }
5048
- function Mt(e) {
5056
+ function Nt(e) {
5049
5057
  v.value = bc(v.value.map((t) => t.id === e.conversationId ? {
5050
5058
  ...t,
5051
5059
  subtitle: Oc(e),
5052
5060
  lastMessageAt: e.sentAt,
5053
5061
  lastMessage: e,
5054
5062
  unreadCount: 0
5055
- } : t)), H?.setConversations(v.value);
5063
+ } : t)), U?.setConversations(v.value);
5056
5064
  }
5057
- function Nt(e) {
5058
- let t = /* @__PURE__ */ new Date(), n = Ft(e.metadata);
5065
+ function Pt(e) {
5066
+ let t = /* @__PURE__ */ new Date(), n = It(e.metadata);
5059
5067
  return {
5060
5068
  id: `local-${e.muid}`,
5061
5069
  muid: e.muid,
@@ -5094,11 +5102,11 @@ function cc({ environment: e }) {
5094
5102
  source: null
5095
5103
  };
5096
5104
  }
5097
- function Pt(e, t) {
5105
+ function Ft(e, t) {
5098
5106
  let n = {};
5099
5107
  return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = Js(e), n) : n;
5100
5108
  }
5101
- function Ft(e) {
5109
+ function It(e) {
5102
5110
  let t = e.replyPreview;
5103
5111
  if (!t || typeof t != "object") return;
5104
5112
  let n = t;
@@ -5109,13 +5117,13 @@ function cc({ environment: e }) {
5109
5117
  kind: n.kind ?? "text"
5110
5118
  };
5111
5119
  }
5112
- function It(e) {
5113
- if (typeof navigator < "u" && !navigator.onLine) return !0;
5120
+ function Lt(e) {
5121
+ if (M() || m.value) return !0;
5114
5122
  let t = Z(e, "").toLowerCase();
5115
5123
  return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
5116
5124
  }
5117
- function Lt(e, t, n, r, i) {
5118
- let a = Nt({
5125
+ function Rt(e, t, n, r, i) {
5126
+ let a = Pt({
5119
5127
  conversation: e,
5120
5128
  kind: "text",
5121
5129
  text: t,
@@ -5124,7 +5132,7 @@ function cc({ environment: e }) {
5124
5132
  muid: i,
5125
5133
  deliveryState: "queued"
5126
5134
  });
5127
- Ht(a, {
5135
+ Ut(a, {
5128
5136
  id: a.id,
5129
5137
  muid: i,
5130
5138
  conversationId: e.id,
@@ -5137,9 +5145,9 @@ function cc({ environment: e }) {
5137
5145
  createdAt: a.sentAt.toISOString()
5138
5146
  });
5139
5147
  }
5140
- function Rt(e, t, n, r, i) {
5141
- if (zt(e, t, r)) return;
5142
- let a = Nt({
5148
+ function zt(e, t, n, r, i) {
5149
+ if (Bt(e, t, r)) return;
5150
+ let a = Pt({
5143
5151
  conversation: e,
5144
5152
  kind: "poll",
5145
5153
  text: `Poll: ${t.question}`,
@@ -5149,7 +5157,7 @@ function cc({ environment: e }) {
5149
5157
  muid: i,
5150
5158
  deliveryState: "queued"
5151
5159
  });
5152
- Ht(a, {
5160
+ Ut(a, {
5153
5161
  id: a.id,
5154
5162
  muid: i,
5155
5163
  conversationId: e.id,
@@ -5162,7 +5170,7 @@ function cc({ environment: e }) {
5162
5170
  createdAt: a.sentAt.toISOString()
5163
5171
  });
5164
5172
  }
5165
- function zt(e, t, n) {
5173
+ function Bt(e, t, n) {
5166
5174
  let r = Date.now(), i = (e) => e.trim().toLowerCase(), a = (e) => e.map((e) => i(e)).filter(Boolean).join("\0"), o = i(t.question), s = a(t.options);
5167
5175
  return k.value.some((t) => {
5168
5176
  if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
@@ -5170,8 +5178,8 @@ function cc({ environment: e }) {
5170
5178
  return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
5171
5179
  });
5172
5180
  }
5173
- async function Vt(e, t, n, r, i) {
5174
- let a = Nc(t.file), o = Nt({
5181
+ async function Ht(e, t, n, r, i) {
5182
+ let a = Nc(t.file), o = Pt({
5175
5183
  conversation: e,
5176
5184
  kind: a,
5177
5185
  text: t.caption?.trim() ?? "",
@@ -5203,19 +5211,19 @@ function cc({ environment: e }) {
5203
5211
  parentMessageId: r,
5204
5212
  createdAt: o.sentAt.toISOString()
5205
5213
  };
5206
- oe.set(s.id, t.file);
5214
+ ce.set(s.id, t.file);
5207
5215
  try {
5208
- await H?.storeQueuedAttachment(s.id, t.file);
5216
+ await U?.storeQueuedAttachment(s.id, t.file);
5209
5217
  } catch {}
5210
- Ht(o, s);
5218
+ Ut(o, s);
5211
5219
  }
5212
- function Ht(e, t) {
5213
- k.value = [...k.value, t], H?.enqueue(t), Ut(e);
5220
+ function Ut(e, t) {
5221
+ k.value = [...k.value, t], U?.enqueue(t), Wt(e);
5214
5222
  }
5215
- function Ut(e) {
5216
- e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e)), Dt(e.parentMessageId)) : y.value = Sc(y.value, e), Mt(e), Ot();
5223
+ function Wt(e) {
5224
+ e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e)), Ot(e.parentMessageId)) : y.value = Sc(y.value, e), Nt(e), kt();
5217
5225
  }
5218
- function Wt(e, t) {
5226
+ function Gt(e, t) {
5219
5227
  let n = (n) => n.map((n) => {
5220
5228
  let r = Ec(n);
5221
5229
  return n.muid !== t && r !== t ? n : {
@@ -5223,40 +5231,40 @@ function cc({ environment: e }) {
5223
5231
  deliveryState: e
5224
5232
  };
5225
5233
  });
5226
- y.value = n(y.value), b.value = n(b.value), Ot();
5234
+ y.value = n(y.value), b.value = n(b.value), kt();
5227
5235
  }
5228
- function Gt(e) {
5236
+ function Kt(e) {
5229
5237
  if (!e) return;
5230
5238
  let t = [...y.value, ...b.value].filter((t) => {
5231
5239
  if (!t.id.startsWith("local-")) return !1;
5232
5240
  let n = Ec(t);
5233
5241
  return t.muid === e || n === e;
5234
5242
  });
5235
- for (let e of t) kt(e);
5243
+ for (let e of t) At(e);
5236
5244
  }
5237
- async function Kt() {
5245
+ async function qt() {
5238
5246
  if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
5239
5247
  f.value = !0;
5240
5248
  try {
5241
- let e = [...k.value].filter((e) => !se.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5242
- for (let t of e) if (!se.has(t.id)) {
5243
- se.add(t.id);
5249
+ let e = [...k.value].filter((e) => !le.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5250
+ for (let t of e) if (!le.has(t.id)) {
5251
+ le.add(t.id);
5244
5252
  try {
5245
- let e = await qt(t);
5246
- k.value = k.value.filter((e) => e.id !== t.id), H?.dequeue(t.id), oe.delete(t.id), t.kind === "attachment" && await H?.deleteQueuedAttachment(t.id), Gt(t.muid), e ? Ct(N(e, _.value?.uid)) : await St();
5253
+ let e = await Jt(t);
5254
+ k.value = k.value.filter((e) => e.id !== t.id), U?.dequeue(t.id), ce.delete(t.id), t.kind === "attachment" && await U?.deleteQueuedAttachment(t.id), Kt(t.muid), e ? wt(F(e, _.value?.uid)) : await Ct();
5247
5255
  } finally {
5248
- se.delete(t.id);
5256
+ le.delete(t.id);
5249
5257
  }
5250
5258
  }
5251
5259
  } catch (e) {
5252
- It(e) || (g.value = Z(e, "Unable to sync queued messages."));
5260
+ Lt(e) || (g.value = Z(e, "Unable to sync queued messages."));
5253
5261
  } finally {
5254
5262
  f.value = !1;
5255
5263
  }
5256
5264
  }
5257
5265
  }
5258
- async function qt(e) {
5259
- let t = e.receiverType === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
5266
+ async function Jt(e) {
5267
+ let t = e.receiverType === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
5260
5268
  if (e.kind === "poll" && e.poll) {
5261
5269
  let n = {
5262
5270
  question: e.poll.question,
@@ -5265,17 +5273,17 @@ function cc({ environment: e }) {
5265
5273
  receiverType: t
5266
5274
  };
5267
5275
  e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
5268
- let r = await U.callExtension("polls", "POST", "v2/create", n);
5276
+ let r = await H.callExtension("polls", "POST", "v2/create", n);
5269
5277
  return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
5270
5278
  }
5271
5279
  if (e.kind === "attachment" && e.attachment) {
5272
- let n = oe.get(e.id) ?? await H?.getQueuedAttachment(e.id) ?? null;
5280
+ let n = ce.get(e.id) ?? await U?.getQueuedAttachment(e.id) ?? null;
5273
5281
  if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
5274
- let r = new U.MediaMessage(e.targetId, n, e.attachment.kind, t);
5275
- return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), U.sendMediaMessage(r);
5282
+ let r = new H.MediaMessage(e.targetId, n, e.attachment.kind, t);
5283
+ return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), H.sendMediaMessage(r);
5276
5284
  }
5277
- let n = new U.TextMessage(e.targetId, e.text ?? "", t);
5278
- return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), U.sendMessage(n);
5285
+ let n = new H.TextMessage(e.targetId, e.text ?? "", t);
5286
+ return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), H.sendMessage(n);
5279
5287
  }
5280
5288
  return {
5281
5289
  initialized: t,
@@ -5302,73 +5310,73 @@ function cc({ environment: e }) {
5302
5310
  hasOlderThreadMessages: C,
5303
5311
  pendingQueueCount: j,
5304
5312
  activeConversationId: T,
5305
- activeConversation: P,
5313
+ activeConversation: I,
5306
5314
  activeThreadParentMessage: E,
5307
5315
  replyToMessage: D,
5308
5316
  editingMessage: O,
5309
- init: ue,
5310
- connectRealtime: Ee,
5311
- disconnectRealtime: De,
5312
- login: de,
5313
- logout: fe,
5314
- fetchConversations: Oe,
5315
- selectConversation: ke,
5316
- sendTextMessage: Pe,
5317
- sendAttachmentMessage: Ie,
5318
- sendPollMessage: Le,
5319
- fetchScheduledMessages: Ue,
5320
- loadOlderMessages: at,
5321
- loadOlderThreadMessages: ot,
5322
- ensureMessageLoaded: st,
5323
- scheduleMessage: We,
5324
- rescheduleMessage: Ye,
5325
- removeScheduledMessage: Ge,
5326
- editScheduledMessage: Je,
5327
- setReplyToMessage: Ae,
5328
- setEditingMessage: je,
5329
- openThread: Me,
5330
- closeThread: Ne,
5331
- refreshVisibleMessages: St,
5332
- fetchMessageReceipts: bt,
5333
- deleteMessage: Be,
5334
- votePoll: G,
5335
- toggleReaction: ze,
5336
- translateMessage: He,
5317
+ init: pe,
5318
+ connectRealtime: De,
5319
+ disconnectRealtime: Oe,
5320
+ login: me,
5321
+ logout: he,
5322
+ fetchConversations: ke,
5323
+ selectConversation: Ae,
5324
+ sendTextMessage: Fe,
5325
+ sendAttachmentMessage: Le,
5326
+ sendPollMessage: Re,
5327
+ fetchScheduledMessages: We,
5328
+ loadOlderMessages: ot,
5329
+ loadOlderThreadMessages: st,
5330
+ ensureMessageLoaded: ct,
5331
+ scheduleMessage: Ge,
5332
+ rescheduleMessage: Xe,
5333
+ removeScheduledMessage: Ke,
5334
+ editScheduledMessage: Ye,
5335
+ setReplyToMessage: je,
5336
+ setEditingMessage: Me,
5337
+ openThread: Ne,
5338
+ closeThread: Pe,
5339
+ refreshVisibleMessages: Ct,
5340
+ fetchMessageReceipts: xt,
5341
+ deleteMessage: Ve,
5342
+ votePoll: W,
5343
+ toggleReaction: Be,
5344
+ translateMessage: Ue,
5337
5345
  mentionDisplayNamesByUid: A,
5338
- rememberMentionDisplayNames: M
5346
+ rememberMentionDisplayNames: ee
5339
5347
  };
5340
5348
  }
5341
5349
  async function lc(e) {
5342
- return Ve(e), oc === e && sc || (sc = (async () => {
5343
- let t = K(), n = new U.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(U.StorageMode.SESSION).build();
5344
- await U.init(t.appId, n), oc = e;
5350
+ return He(e), oc === e && sc || (sc = (async () => {
5351
+ let t = G(), n = new H.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(H.StorageMode.SESSION).build();
5352
+ await H.init(t.appId, n), oc = e;
5345
5353
  })()), sc;
5346
5354
  }
5347
5355
  async function uc(e) {
5348
5356
  let t = JSON.parse(atob(e.split(".")[1]));
5349
5357
  if (!t.sub) throw Error("Cannot read JWT subject from access token.");
5350
- let n = Je();
5358
+ let n = Ye();
5351
5359
  if (n && n.sub === t.sub && n.token) return n.token;
5352
- let r = await fetch(`${K().chatApiBaseUrl}/chats/token`, {
5360
+ let r = await fetch(`${G().chatApiBaseUrl}/chats/token`, {
5353
5361
  method: "POST",
5354
5362
  headers: new Headers([["Authorization", `Bearer ${e}`]])
5355
5363
  });
5356
- if (r.status === 401) throw qe(null), Ze(), Error("Unauthorized while fetching CometChat token.");
5364
+ if (r.status === 401) throw Je(null), Qe(), Error("Unauthorized while fetching CometChat token.");
5357
5365
  if (!r.ok) throw Error(`Token exchange failed with status ${r.status}.`);
5358
5366
  let i = await r.json();
5359
- return Xe({
5367
+ return Ze({
5360
5368
  sub: t.sub,
5361
5369
  token: i.token
5362
5370
  }), i.token;
5363
5371
  }
5364
5372
  function dc(e, t) {
5365
- let n = e.getConversationWith(), r = e.getConversationType() === U.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
5373
+ let n = e.getConversationWith(), r = e.getConversationType() === H.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
5366
5374
  if (c && e.getConversationId() === c) return {
5367
5375
  id: e.getConversationId(),
5368
5376
  targetId: o,
5369
5377
  type: r,
5370
- title: _t("scheduledMessages"),
5371
- subtitle: _t("hiddenHelperConversation"),
5378
+ title: vt("scheduledMessages"),
5379
+ subtitle: vt("hiddenHelperConversation"),
5372
5380
  hasJoined: !0,
5373
5381
  unreadCount: 0,
5374
5382
  tags: [],
@@ -5381,7 +5389,7 @@ function dc(e, t) {
5381
5389
  type: r,
5382
5390
  title: n.getName() ?? o,
5383
5391
  subtitle: l && Tc(l) && !l.isDeleted ? Oc(l) : "No messages yet",
5384
- avatar: i ? Qe(i.getAvatar()) : void 0,
5392
+ avatar: i ? $e(i.getAvatar()) : void 0,
5385
5393
  unreadCount: Number.isFinite(u) ? u : 0,
5386
5394
  hasJoined: a?.getHasJoined() ?? !0,
5387
5395
  lastMessageAt: s && !l?.isDeleted ? /* @__PURE__ */ new Date((s.getSentAt?.() ?? 0) * 1e3) : void 0,
@@ -5441,7 +5449,7 @@ function hc(e) {
5441
5449
  return {
5442
5450
  uid: e.getUid(),
5443
5451
  name: e.getName?.() ?? e.getUid(),
5444
- avatar: Qe(e.getAvatar?.()),
5452
+ avatar: $e(e.getAvatar?.()),
5445
5453
  status: e.getStatus?.() ?? void 0
5446
5454
  };
5447
5455
  }
@@ -5461,7 +5469,7 @@ function vc(e, t) {
5461
5469
  let n = e.getType?.(), r = e.getCategory?.(), i = el(e);
5462
5470
  if (String(r).toLowerCase() === "action") return Uc(e);
5463
5471
  if (i) return `Poll: ${i.question}`;
5464
- if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5472
+ if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5465
5473
  let t = Us(e.getText());
5466
5474
  if (t) return t;
5467
5475
  }
@@ -5469,14 +5477,14 @@ function vc(e, t) {
5469
5477
  let t = Yc(e, Kc(e))[0];
5470
5478
  return e.getCaption?.()?.trim?.() || zs(t ? [t] : [], "Sent an attachment");
5471
5479
  }
5472
- return e.getSender?.()?.getUid?.() === t ? _t("youSentAMessage") : _t("unsupportedMessageType");
5480
+ return e.getSender?.()?.getUid?.() === t ? vt("youSentAMessage") : vt("unsupportedMessageType");
5473
5481
  }
5474
5482
  function yc(e, t) {
5475
5483
  if (e.getDeletedAt?.()) return "Message removed";
5476
5484
  let n = e.getType?.(), r = e.getCategory?.(), i = el(e);
5477
5485
  if (String(r).toLowerCase() === "action") return Uc(e);
5478
5486
  if (i) return `Poll: ${i.question}`;
5479
- if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5487
+ if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5480
5488
  let t = Bs(e.getText?.());
5481
5489
  if (Hs(t)) return t;
5482
5490
  }
@@ -5486,10 +5494,10 @@ function yc(e, t) {
5486
5494
  let n = Yc(e, Kc(e))[0];
5487
5495
  return zs(n ? [n] : [], "Sent an attachment");
5488
5496
  }
5489
- return e.getSender?.()?.getUid?.() === t ? _t("youSentAMessage") : _t("unsupportedMessageType");
5497
+ return e.getSender?.()?.getUid?.() === t ? vt("youSentAMessage") : vt("unsupportedMessageType");
5490
5498
  }
5491
5499
  function bc(e) {
5492
- return [...e].filter((e) => e.title !== _t("scheduledMessages")).sort((e, t) => {
5500
+ return [...e].filter((e) => e.title !== vt("scheduledMessages")).sort((e, t) => {
5493
5501
  let n = e.lastMessageAt?.getTime() ?? 0;
5494
5502
  return (t.lastMessageAt?.getTime() ?? 0) - n;
5495
5503
  });
@@ -5525,20 +5533,23 @@ function Oc(e) {
5525
5533
  return Zs(e);
5526
5534
  }
5527
5535
  function Z(e, t) {
5528
- return e instanceof Error && e.message ? e.message : t;
5536
+ return console.warn("BCC Chat: an error occurred", {
5537
+ error: e,
5538
+ fallbackMessage: t
5539
+ }), e instanceof Error && e.message ? e.message : t;
5529
5540
  }
5530
5541
  function kc(e) {
5531
- return e.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
5542
+ return e.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
5532
5543
  }
5533
5544
  function Ac() {
5534
- let e = Ke();
5545
+ let e = qe();
5535
5546
  if (!e) throw Error("Missing access token.");
5536
5547
  return e;
5537
5548
  }
5538
5549
  async function jc(e, t, n) {
5539
5550
  let r = t.text?.trim();
5540
5551
  if (!r) return;
5541
- let i = Ac(), a = await fetch(`${K().chatApiBaseUrl}/chats/scheduledMessages`, {
5552
+ let i = Ac(), a = await fetch(`${G().chatApiBaseUrl}/chats/scheduledMessages`, {
5542
5553
  method: "POST",
5543
5554
  headers: {
5544
5555
  "Content-Type": "application/json",
@@ -5558,9 +5569,9 @@ async function jc(e, t, n) {
5558
5569
  }
5559
5570
  async function Mc(e, t, n) {
5560
5571
  if (!t.file) return;
5561
- let r = Ac(), i = Je()?.token;
5572
+ let r = Ac(), i = Ye()?.token;
5562
5573
  if (!i) throw Error("Missing CometChat auth token.");
5563
- let a = Pc(t.file), o = t.caption?.trim() ?? "", s = Fc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${K().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
5574
+ let a = Pc(t.file), o = t.caption?.trim() ?? "", s = Fc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${G().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
5564
5575
  method: "POST",
5565
5576
  headers: {
5566
5577
  Accept: "multipart/form-data",
@@ -5581,7 +5592,7 @@ function Pc(e) {
5581
5592
  return t;
5582
5593
  }
5583
5594
  function Fc(e, t, n, r, i, a) {
5584
- let o = new U.MediaMessage(e.targetId, t, n, kc(e));
5595
+ let o = new H.MediaMessage(e.targetId, t, n, kc(e));
5585
5596
  return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
5586
5597
  scheduleDate: i,
5587
5598
  file: t,
@@ -5614,11 +5625,11 @@ function Rc(e, t) {
5614
5625
  return typeof n == "string" && n.trim() ? n.trim() : e?.getName?.() ?? "System";
5615
5626
  }
5616
5627
  function zc(e, t) {
5617
- return Qe(Vc(t)) || (Bc(e, "sender") ?? void 0);
5628
+ return $e(Vc(t)) || (Bc(e, "sender") ?? void 0);
5618
5629
  }
5619
5630
  function Bc(e, t) {
5620
5631
  let n = ol(e)?.entities?.[t]?.entity;
5621
- return Qe(Vc(n));
5632
+ return $e(Vc(n));
5622
5633
  }
5623
5634
  function Vc(e) {
5624
5635
  if (!e || typeof e != "object") return e;
@@ -5866,9 +5877,9 @@ function ll(e, t) {
5866
5877
  let n = t?.value?.getMetadata?.() ?? {};
5867
5878
  if (!e?.getSender?.() || n.isChannel) return "";
5868
5879
  let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
5869
- e instanceof U.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5880
+ e instanceof H.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5870
5881
  let a = i.systemDisplayName;
5871
- return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof U.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
5882
+ return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof H.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
5872
5883
  }
5873
5884
  function ul(e, t = 25, n) {
5874
5885
  let r = e.trim();
@@ -5891,7 +5902,7 @@ function ul(e, t = 25, n) {
5891
5902
  };
5892
5903
  }
5893
5904
  async function dl(e) {
5894
- let t = new U.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
5905
+ let t = new H.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
5895
5906
  try {
5896
5907
  for (; n;) {
5897
5908
  let e = await t.fetchNext();
@@ -5910,7 +5921,7 @@ async function dl(e) {
5910
5921
  }
5911
5922
  async function fl(e) {
5912
5923
  await Sl("failed to get muted setting. User not logged in");
5913
- let t = await Cl(`${K().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
5924
+ let t = await Cl(`${G().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
5914
5925
  return yl()?.storeParticipantSettings({
5915
5926
  chatUid: e,
5916
5927
  mutedUntil: t.mutedUntil,
@@ -5919,7 +5930,7 @@ async function fl(e) {
5919
5930
  }
5920
5931
  async function pl(e, t) {
5921
5932
  await Sl("failed to mute chat. User not logged in");
5922
- let n = await Cl(`${K().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, {
5933
+ let n = await Cl(`${G().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, {
5923
5934
  method: "PATCH",
5924
5935
  body: JSON.stringify({ mutedUntil: t })
5925
5936
  });
@@ -5930,10 +5941,10 @@ async function pl(e, t) {
5930
5941
  }), n.mutedUntil;
5931
5942
  }
5932
5943
  async function ml() {
5933
- return await Sl("failed to get muted all setting. User not logged in"), Cl(`${K().chatApiBaseUrl}/person/settings`, { method: "GET" });
5944
+ return await Sl("failed to get muted all setting. User not logged in"), Cl(`${G().chatApiBaseUrl}/person/settings`, { method: "GET" });
5934
5945
  }
5935
5946
  async function hl(e) {
5936
- return await Sl("failed to update person settings. User not logged in"), Cl(`${K().chatApiBaseUrl}/person/settings`, {
5947
+ return await Sl("failed to update person settings. User not logged in"), Cl(`${G().chatApiBaseUrl}/person/settings`, {
5937
5948
  method: "PATCH",
5938
5949
  body: JSON.stringify(e)
5939
5950
  });
@@ -5958,19 +5969,19 @@ function yl() {
5958
5969
  return e ? new $s(e) : null;
5959
5970
  }
5960
5971
  function bl() {
5961
- let e = ct();
5962
- return e ? `bcc-chat:${K().appId}:${e}` : null;
5972
+ let e = lt();
5973
+ return e ? `bcc-chat:${G().appId}:${e}` : null;
5963
5974
  }
5964
5975
  function xl() {
5965
- return U.__bccCompatLoggedInUser ?? null;
5976
+ return H.__bccCompatLoggedInUser ?? null;
5966
5977
  }
5967
5978
  async function Sl(e) {
5968
- let t = await U.getLoggedinUser();
5969
- if (U.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
5979
+ let t = await H.getLoggedinUser();
5980
+ if (H.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
5970
5981
  return t;
5971
5982
  }
5972
5983
  async function Cl(e, t) {
5973
- let n = Ke();
5984
+ let n = qe();
5974
5985
  if (!n) throw Error("Missing access token.");
5975
5986
  let r = await fetch(e, {
5976
5987
  ...t,
@@ -6034,7 +6045,7 @@ function Vl(e) {
6034
6045
  if (Q.value && !e && !Al.value) return Q.value;
6035
6046
  let t = e ?? Al.value;
6036
6047
  if (!t) throw Error("Environment has not been set yet. Call app.use(chat, { environment: ... }) first.");
6037
- return (!Q.value || Al.value !== t) && (Al.value = t, Ve(t), Q.value = cc({ environment: t })), Q.value;
6048
+ return (!Q.value || Al.value !== t) && (Al.value = t, He(t), Q.value = cc({ environment: t })), Q.value;
6038
6049
  }
6039
6050
  var Hl = n(() => Q.value?.currentUser.value?.uid);
6040
6051
  function Ul(e) {
@@ -6049,7 +6060,7 @@ async function Wl(e) {
6049
6060
  if (!Ll.has(e)) {
6050
6061
  Ll.add(e);
6051
6062
  try {
6052
- let t = await U.getMessageReceipts(e);
6063
+ let t = await H.getMessageReceipts(e);
6053
6064
  Il.value = {
6054
6065
  ...Il.value,
6055
6066
  [e]: Ul(t)
@@ -6108,17 +6119,17 @@ F([() => Q.value?.conversations.value, () => Hl.value], async () => {
6108
6119
  Il.value = {}, Ll.clear();
6109
6120
  });
6110
6121
  async function Ql(e, t) {
6111
- Pl.value = t.loggerCallback, gt(t.language ?? "en"), Bl(t.themeMode);
6122
+ Pl.value = t.loggerCallback, _t(t.language ?? "en"), Bl(t.themeMode);
6112
6123
  let n = e.config.globalProperties.$primevue;
6113
6124
  n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", vh), e.component("BccChatMessageList", vh), e.provide("theme", { theme: El });
6114
6125
  let r = Vl(t.environment);
6115
6126
  zl(Ol.INFO, "Initializing chat", {
6116
6127
  environment: t.environment,
6117
- language: ft.value,
6128
+ language: pt.value,
6118
6129
  themeMode: t.themeMode
6119
6130
  }), await r.init(), kl.value = !0, Rl?.(), p(t.accessToken) ? Rl = F(t.accessToken, async (e) => {
6120
6131
  e ? await $l(e) : await eu();
6121
- }, { immediate: !0 }) : t.accessToken && await $l(t.accessToken), zl(Ol.INFO, "Chat initialized", { environment: K().appId });
6132
+ }, { immediate: !0 }) : t.accessToken && await $l(t.accessToken), zl(Ol.INFO, "Chat initialized", { environment: G().appId });
6122
6133
  }
6123
6134
  async function $l(e) {
6124
6135
  if (!e) return eu();
@@ -6146,7 +6157,7 @@ function iu(e) {
6146
6157
  Ml.value = e;
6147
6158
  }
6148
6159
  function au(e) {
6149
- gt(e);
6160
+ _t(e);
6150
6161
  }
6151
6162
  function ou(e) {
6152
6163
  Bl(e);
@@ -6160,7 +6171,7 @@ function cu(e) {
6160
6171
  async function lu(e, t = !1) {
6161
6172
  if (!Jl.value) return null;
6162
6173
  try {
6163
- return await U.getGroup(e);
6174
+ return await H.getGroup(e);
6164
6175
  } catch (e) {
6165
6176
  if (e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND") return;
6166
6177
  if (t) throw e;
@@ -6177,7 +6188,7 @@ async function du(e) {
6177
6188
  }
6178
6189
  async function fu(e) {
6179
6190
  try {
6180
- return Jl.value && (await U.getOnlineGroupMemberCount([e]))[e] || 0;
6191
+ return Jl.value && (await H.getOnlineGroupMemberCount([e]))[e] || 0;
6181
6192
  } catch {
6182
6193
  return 0;
6183
6194
  }
@@ -6209,7 +6220,7 @@ var gu = {
6209
6220
  login: $l,
6210
6221
  logout: eu,
6211
6222
  setCurrentEnvironment: cu,
6212
- getCurrentEnvironment: K,
6223
+ getCurrentEnvironment: G,
6213
6224
  setThemeMode: ou,
6214
6225
  setLanguage: au,
6215
6226
  getGroup: lu,
@@ -6221,7 +6232,7 @@ var gu = {
6221
6232
  searchChat: (e, t = 25) => ul(e, t, Q.value?.currentUser.value?.uid),
6222
6233
  getSenderDisplayName: ll,
6223
6234
  getMessageTextPreview: qs,
6224
- proxyImage: $e,
6235
+ proxyImage: et,
6225
6236
  getMutedUntil: mu,
6226
6237
  muteChat: pu,
6227
6238
  getMyChatSettings: ml,
@@ -6229,7 +6240,7 @@ var gu = {
6229
6240
  setMuteAll: gl,
6230
6241
  toggleMuteAll: _l,
6231
6242
  toMarkdownHtml: ks,
6232
- retrieveCcToken: Ye,
6243
+ retrieveCcToken: Xe,
6233
6244
  getChatMessages: Ml,
6234
6245
  scrollToMessageId: Nl,
6235
6246
  scrollToMessage: hu,
@@ -6238,7 +6249,7 @@ var gu = {
6238
6249
  onlineStatus: Yl.onlineStatus,
6239
6250
  theme: El,
6240
6251
  themeMode: jl,
6241
- language: ft
6252
+ language: pt
6242
6253
  };
6243
6254
  //#endregion
6244
6255
  //#region src/chat/conversationState.ts
@@ -6289,7 +6300,7 @@ function Ou(e) {
6289
6300
  uid: t.targetId,
6290
6301
  displayName: t.title,
6291
6302
  avatar: t.avatar
6292
- }] : a.filter((e) => e.uid !== n).map(Tt) : [];
6303
+ }] : a.filter((e) => e.uid !== n).map(Et) : [];
6293
6304
  });
6294
6305
  return {
6295
6306
  client: t,
@@ -6303,7 +6314,7 @@ function Ou(e) {
6303
6314
  isChannel: u,
6304
6315
  sendOptions: d,
6305
6316
  mentionCandidates: f,
6306
- mentionNameByUid: n(() => Vt(Et(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
6317
+ mentionNameByUid: n(() => Ht(Dt(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
6307
6318
  };
6308
6319
  }
6309
6320
  var ku = Symbol("conversationCtx");
@@ -6688,10 +6699,10 @@ function Qu(e) {
6688
6699
  return;
6689
6700
  }
6690
6701
  try {
6691
- t.value = (await new U.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6702
+ t.value = (await new H.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6692
6703
  uid: e.getUid(),
6693
6704
  displayName: e.getName(),
6694
- avatar: Qe(e.getAvatar?.()) ?? "",
6705
+ avatar: $e(e.getAvatar?.()) ?? "",
6695
6706
  role: e.getScope()
6696
6707
  })), e.onMembersChanged(t.value);
6697
6708
  } catch {
@@ -6704,8 +6715,8 @@ function Qu(e) {
6704
6715
  let c = {
6705
6716
  uid: r.getUid(),
6706
6717
  displayName: r.getName(),
6707
- avatar: Qe(r.getAvatar?.()) ?? "",
6708
- role: a ?? r.getScope?.() ?? U.GROUP_MEMBER_SCOPE.PARTICIPANT
6718
+ avatar: $e(r.getAvatar?.()) ?? "",
6719
+ role: a ?? r.getScope?.() ?? H.GROUP_MEMBER_SCOPE.PARTICIPANT
6709
6720
  };
6710
6721
  i === "add" ? t.value.some((e) => e.uid === c.uid) || (t.value = [...t.value, c]) : i === "remove" ? t.value = t.value.filter((e) => e.uid !== c.uid) : t.value = t.value.map((e) => e.uid === c.uid ? {
6711
6722
  ...e,
@@ -6713,7 +6724,7 @@ function Qu(e) {
6713
6724
  } : e), e.onMembersChanged(t.value);
6714
6725
  }
6715
6726
  return b(() => {
6716
- U.addGroupListener(n, new U.GroupListener({
6727
+ H.addGroupListener(n, new H.GroupListener({
6717
6728
  onGroupMemberScopeChanged: (e, t, n, r, a) => {
6718
6729
  i(a, t, "update", n);
6719
6730
  },
@@ -6737,7 +6748,7 @@ function Qu(e) {
6737
6748
  }
6738
6749
  }));
6739
6750
  }), x(() => {
6740
- U.removeGroupListener(n);
6751
+ H.removeGroupListener(n);
6741
6752
  }), {
6742
6753
  groupMembers: t,
6743
6754
  fetchGroupMembers: r
@@ -6820,7 +6831,7 @@ function id(e) {
6820
6831
  triggerChar: "@",
6821
6832
  enabled: e.enabled,
6822
6833
  maxSuggestions: e.maxSuggestions ?? 8,
6823
- getCandidates: (t) => Dt(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
6834
+ getCandidates: (t) => Ot(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
6824
6835
  id: e.uid,
6825
6836
  label: e.displayName,
6826
6837
  avatar: e.avatar
@@ -6990,7 +7001,7 @@ function ud(e, t, r, i) {
6990
7001
  }, { deep: !0 });
6991
7002
  function C(e) {
6992
7003
  let t = Es(e);
6993
- return t.includes("<@uid:") ? Es(Pt(t, i.getMentionNameByUid?.() ?? {})) : t;
7004
+ return t.includes("<@uid:") ? Es(Ft(t, i.getMentionNameByUid?.() ?? {})) : t;
6994
7005
  }
6995
7006
  F(() => i.getModelValue(), (e) => {
6996
7007
  let n = t.value, r = C(e);
@@ -7054,7 +7065,7 @@ function ud(e, t, r, i) {
7054
7065
  e.key === "Escape" && (O(), g());
7055
7066
  }
7056
7067
  }
7057
- function ee(e) {
7068
+ function N(e) {
7058
7069
  e.preventDefault();
7059
7070
  let t = e.clipboardData?.getData("text/html") ?? "", n = e.clipboardData?.getData("text/plain") ?? "";
7060
7071
  if (document.execCommand("styleWithCSS", !1, "false"), t) {
@@ -7066,7 +7077,7 @@ function ud(e, t, r, i) {
7066
7077
  }
7067
7078
  n && (document.execCommand("insertText", !1, n), E());
7068
7079
  }
7069
- function N(e) {
7080
+ function ee(e) {
7070
7081
  if (!k()) {
7071
7082
  O();
7072
7083
  return;
@@ -7083,32 +7094,32 @@ function ud(e, t, r, i) {
7083
7094
  function I(e) {
7084
7095
  x(e), D();
7085
7096
  }
7086
- function L() {
7097
+ function te() {
7087
7098
  k() || O();
7088
7099
  }
7089
- function R() {
7100
+ function L() {
7090
7101
  o.value += 1, O(), g(), l.value = "", i.updateModelValue("");
7091
7102
  }
7092
7103
  return b(() => {
7093
- document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", L), h(() => {
7104
+ document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", te), h(() => {
7094
7105
  if (t.value) {
7095
7106
  let e = C(i.getModelValue());
7096
7107
  t.value.innerHTML = e, T(t.value), e ? delete t.value.dataset.empty : t.value.dataset.empty = "true", l.value = e;
7097
7108
  }
7098
7109
  });
7099
7110
  }), y(() => {
7100
- document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", L);
7111
+ document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", te);
7101
7112
  }), {
7102
7113
  applyFormat: A,
7103
7114
  editorKey: o,
7104
7115
  focusEditor: D,
7105
7116
  formatMenuPosition: c,
7106
- handleContextMenu: N,
7117
+ handleContextMenu: ee,
7107
7118
  handleInput: j,
7108
7119
  handleKeydown: M,
7109
- handlePaste: ee,
7120
+ handlePaste: N,
7110
7121
  hideFormatMenu: O,
7111
- resetEditor: R,
7122
+ resetEditor: L,
7112
7123
  showFormatMenu: s,
7113
7124
  triggerCandidates: d,
7114
7125
  triggerMenuPosition: f,
@@ -7123,23 +7134,23 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7123
7134
  __name: "ComposerActionsPopover",
7124
7135
  emits: ["pickFile", "openPoll"],
7125
7136
  setup(t, { expose: n, emit: i }) {
7126
- let s = i, c = w(!1), l = w(null), { t: u } = q(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
7137
+ let s = i, c = w(!1), l = w(null), { t: u } = K(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
7127
7138
  {
7128
7139
  kind: "image",
7129
7140
  label: "attachImage",
7130
- icon: Ce,
7141
+ icon: we,
7131
7142
  testId: "composer-attach-image"
7132
7143
  },
7133
7144
  {
7134
7145
  kind: "video",
7135
7146
  label: "attachVideo",
7136
- icon: Le,
7147
+ icon: Re,
7137
7148
  testId: "composer-attach-video"
7138
7149
  },
7139
7150
  {
7140
7151
  kind: "audio",
7141
7152
  label: "attachAudio",
7142
- icon: De,
7153
+ icon: Oe,
7143
7154
  testId: "composer-attach-audio"
7144
7155
  },
7145
7156
  {
@@ -7173,7 +7184,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7173
7184
  }), n({
7174
7185
  toggle: p,
7175
7186
  hide: m
7176
- }), (t, n) => L((S(), a("div", {
7187
+ }), (t, n) => te((S(), a("div", {
7177
7188
  ref_key: "menuRef",
7178
7189
  ref: l,
7179
7190
  class: "composer-actions-menu",
@@ -7189,7 +7200,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7189
7200
  class: "composer-actions-menu__item",
7190
7201
  "data-testid": "composer-create-poll",
7191
7202
  onClick: g
7192
- }, [o("span", pd, [(S(), r(D(j(W)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
7203
+ }, [o("span", pd, [(S(), r(D(j(le)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
7193
7204
  }
7194
7205
  }), $ = (e, t) => {
7195
7206
  let n = e.__vccOpts || e;
@@ -7204,13 +7215,13 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7204
7215
  },
7205
7216
  emits: ["cancel"],
7206
7217
  setup(e, { emit: t }) {
7207
- let r = e, i = t, { t: s } = q(), c = ju(), u = n(() => Ws(r.message, s("message"), c.mentionNameByUid.value));
7218
+ let r = e, i = t, { t: s } = K(), c = ju(), u = n(() => Ws(r.message, s("message"), c.mentionNameByUid.value));
7208
7219
  return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div", gd, [
7209
7220
  o("p", _d, k(e.variant === "editing" ? j(s)("editingInContext", { context: e.contextLabel }) : j(s)("replyingInContext", { context: e.contextLabel })), 1),
7210
7221
  o("p", vd, k(e.message.senderName), 1),
7211
7222
  o("p", yd, k(u.value), 1)
7212
7223
  ]), l(j(z), {
7213
- icon: j(de),
7224
+ icon: j(fe),
7214
7225
  text: "",
7215
7226
  rounded: "",
7216
7227
  severity: "secondary",
@@ -7225,7 +7236,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7225
7236
  },
7226
7237
  emits: ["format"],
7227
7238
  setup(e, { emit: t }) {
7228
- let n = t, { t: r } = q();
7239
+ let n = t, { t: r } = K();
7229
7240
  return (t, s) => e.visible ? (S(), a("div", {
7230
7241
  key: 0,
7231
7242
  class: "format-menu",
@@ -7237,19 +7248,19 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7237
7248
  o("button", {
7238
7249
  type: "button",
7239
7250
  class: "format-menu__item",
7240
- onMousedown: s[0] ||= R(() => {}, ["prevent"]),
7251
+ onMousedown: s[0] ||= L(() => {}, ["prevent"]),
7241
7252
  onClick: s[1] ||= (e) => n("format", "bold")
7242
7253
  }, [s[6] ||= o("span", { class: "format-menu__icon font-bold" }, "B", -1), o("span", null, k(j(r)("bold")), 1)], 32),
7243
7254
  o("button", {
7244
7255
  type: "button",
7245
7256
  class: "format-menu__item",
7246
- onMousedown: s[2] ||= R(() => {}, ["prevent"]),
7257
+ onMousedown: s[2] ||= L(() => {}, ["prevent"]),
7247
7258
  onClick: s[3] ||= (e) => n("format", "italic")
7248
7259
  }, [s[7] ||= o("span", { class: "format-menu__icon italic" }, "I", -1), o("span", null, k(j(r)("italic")), 1)], 32),
7249
7260
  o("button", {
7250
7261
  type: "button",
7251
7262
  class: "format-menu__item",
7252
- onMousedown: s[4] ||= R(() => {}, ["prevent"]),
7263
+ onMousedown: s[4] ||= L(() => {}, ["prevent"]),
7253
7264
  onClick: s[5] ||= (e) => n("format", "underline")
7254
7265
  }, [s[8] ||= o("span", { class: "format-menu__icon underline" }, "U", -1), o("span", null, k(j(r)("underline")), 1)], 32)
7255
7266
  ], 4)) : i("", !0);
@@ -7262,7 +7273,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7262
7273
  },
7263
7274
  emits: ["update:visible", "send"],
7264
7275
  setup(t, { expose: i, emit: s }) {
7265
- let c = t, u = s, { t: d } = q(), f = w(""), p = w(["", ""]), m = n(() => {
7276
+ let c = t, u = s, { t: d } = K(), f = w(""), p = w(["", ""]), m = n(() => {
7266
7277
  let e = f.value.trim(), t = p.value.map((e) => e.trim()).filter(Boolean);
7267
7278
  return !!e && t.length >= 2;
7268
7279
  });
@@ -7298,7 +7309,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7298
7309
  onClick: y
7299
7310
  }, null, 8, ["label"]), l(j(z), {
7300
7311
  label: j(d)("sendPoll"),
7301
- icon: j(Ne),
7312
+ icon: j(Pe),
7302
7313
  disabled: c.disabled || !m.value,
7303
7314
  onClick: v
7304
7315
  }, null, 8, [
@@ -7326,7 +7337,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7326
7337
  "placeholder",
7327
7338
  "onUpdate:modelValue"
7328
7339
  ]), l(j(z), {
7329
- icon: j(de),
7340
+ icon: j(fe),
7330
7341
  text: "",
7331
7342
  rounded: "",
7332
7343
  severity: "secondary",
@@ -7339,7 +7350,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7339
7350
  ])]))), 128)),
7340
7351
  l(j(z), {
7341
7352
  label: j(d)("addOption"),
7342
- icon: j(se),
7353
+ icon: j(U),
7343
7354
  text: "",
7344
7355
  onClick: h
7345
7356
  }, null, 8, ["label", "icon"])
@@ -7357,7 +7368,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7357
7368
  },
7358
7369
  emits: ["update:visible", "schedule"],
7359
7370
  setup(e, { expose: t, emit: i }) {
7360
- let a = e, s = i, { t: c } = q(), u = w(p()), d = w(m());
7371
+ let a = e, s = i, { t: c } = K(), u = w(p()), d = w(m());
7361
7372
  function f() {
7362
7373
  return new Date(Date.now() + 3600 * 1e3);
7363
7374
  }
@@ -7397,7 +7408,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7397
7408
  onClick: b
7398
7409
  }, null, 8, ["label"]), l(j(z), {
7399
7410
  label: j(c)("schedule"),
7400
- icon: j(le),
7411
+ icon: j(ue),
7401
7412
  disabled: a.disabled || !g.value,
7402
7413
  onClick: y
7403
7414
  }, null, 8, [
@@ -7455,7 +7466,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7455
7466
  top: `${t.position.y}px`
7456
7467
  }),
7457
7468
  role: "listbox",
7458
- onMousedown: l[0] ||= R(() => {}, ["stop"])
7469
+ onMousedown: l[0] ||= L(() => {}, ["stop"])
7459
7470
  }, [(S(!0), a(e, null, T(t.candidates, (e, t) => (S(), a("button", {
7460
7471
  key: e.id,
7461
7472
  type: "button",
@@ -7463,8 +7474,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7463
7474
  role: "option",
7464
7475
  "aria-selected": t === s.value,
7465
7476
  onMouseover: (e) => s.value = t,
7466
- onMousedown: R((t) => c("select", e), ["stop", "prevent"])
7467
- }, [e.avatar ? (S(), r(j(te), {
7477
+ onMousedown: L((t) => c("select", e), ["stop", "prevent"])
7478
+ }, [e.avatar ? (S(), r(j(R), {
7468
7479
  key: 0,
7469
7480
  src: e.avatar,
7470
7481
  name: e.label,
@@ -7513,62 +7524,62 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7513
7524
  video: "video/*",
7514
7525
  audio: "audio/*",
7515
7526
  file: "*/*"
7516
- }, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = q(), T = null, E = w(null), D = w(null), O = w(null), { applyFormat: A, editorKey: M, formatMenuPosition: ee, focusEditor: N, handleContextMenu: P, handleInput: I, handleKeydown: L, handlePaste: te, hideFormatMenu: ne, resetEditor: B, showFormatMenu: re, triggerCandidates: ie, triggerMenuPosition: V, highlightedTriggerIndex: ae, showTriggerMenu: H, selectTriggerCandidate: U } = ud(E, D, O, {
7527
+ }, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = K(), T = null, E = w(null), D = w(null), O = w(null), { applyFormat: A, editorKey: M, formatMenuPosition: N, focusEditor: ee, handleContextMenu: P, handleInput: I, handleKeydown: te, handlePaste: R, hideFormatMenu: ne, resetEditor: B, showFormatMenu: re, triggerCandidates: ie, triggerMenuPosition: ae, highlightedTriggerIndex: oe, showTriggerMenu: se, selectTriggerCandidate: H } = ud(E, D, O, {
7517
7528
  getModelValue: () => u.modelValue,
7518
7529
  updateModelValue: (e) => d("update:modelValue", e),
7519
- submit: () => we(),
7530
+ submit: () => Te(),
7520
7531
  getMentionCandidates: () => u.mentionCandidates ?? [],
7521
7532
  getMentionNameByUid: () => u.mentionNameByUid ?? {},
7522
7533
  mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
7523
- }), ce = n(() => c[v.value]), W = n(() => {
7534
+ }), ce = n(() => c[v.value]), le = n(() => {
7524
7535
  if (!_.value) return null;
7525
7536
  let e = _.value.type;
7526
7537
  return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
7527
- }), le = n(() => {
7528
- switch (W.value) {
7538
+ }), ue = n(() => {
7539
+ switch (le.value) {
7529
7540
  case "image": return C("image");
7530
7541
  case "video": return C("video");
7531
7542
  case "audio": return C("audio");
7532
7543
  case "file": return C("file");
7533
7544
  default: return C("attachment");
7534
7545
  }
7535
- }), fe = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), pe = n(() => Hs(u.modelValue) || !!_.value), me = n(() => pe.value && W.value !== "file"), he = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : Us(u.modelValue) || C("currentDraftWillBeScheduled"));
7546
+ }), pe = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), me = n(() => Hs(u.modelValue) || !!_.value), he = n(() => me.value && le.value !== "file"), ge = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : Us(u.modelValue) || C("currentDraftWillBeScheduled"));
7536
7547
  F(() => u.resetSignal, () => {
7537
7548
  B(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
7538
7549
  });
7539
- async function ge() {
7540
- await h(), N();
7550
+ async function _e() {
7551
+ await h(), ee();
7541
7552
  }
7542
- function ve() {
7553
+ function ye() {
7543
7554
  m.value?.hide();
7544
7555
  }
7545
7556
  t({
7546
- focusEditor: ge,
7547
- hideComposerActions: ve
7557
+ focusEditor: _e,
7558
+ hideComposerActions: ye
7548
7559
  });
7549
- async function ye(e = "file") {
7560
+ async function be(e = "file") {
7550
7561
  v.value = e, await h(), f.value?.click();
7551
7562
  }
7552
- function be(e) {
7553
- _.value = e.target.files?.[0] ?? null, ve();
7554
- }
7555
7563
  function xe(e) {
7564
+ _.value = e.target.files?.[0] ?? null, ye();
7565
+ }
7566
+ function Se(e) {
7556
7567
  if (u.disabled) return;
7557
7568
  let t = rd(e);
7558
7569
  if (t) {
7559
- e.preventDefault(), _.value = t, ve();
7570
+ e.preventDefault(), _.value = t, ye();
7560
7571
  return;
7561
7572
  }
7562
- te(e);
7573
+ R(e);
7563
7574
  }
7564
- function Se() {
7575
+ function Ce() {
7565
7576
  _.value = null, f.value && (f.value.value = "");
7566
7577
  }
7567
- function Ce(e) {
7578
+ function we(e) {
7568
7579
  m.value?.toggle(e);
7569
7580
  }
7570
- function we() {
7571
- if (!(u.disabled || !pe.value)) {
7581
+ function Te() {
7582
+ if (!(u.disabled || !me.value)) {
7572
7583
  if (_.value) {
7573
7584
  d("sendAttachment", {
7574
7585
  file: _.value,
@@ -7579,10 +7590,10 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7579
7590
  d("sendText");
7580
7591
  }
7581
7592
  }
7582
- function Te(e) {
7593
+ function Ee(e) {
7583
7594
  d("sendPoll", e);
7584
7595
  }
7585
- function Ee(e) {
7596
+ function De(e) {
7586
7597
  d("scheduleMessage", {
7587
7598
  ...e,
7588
7599
  text: _.value ? void 0 : Vs(u.modelValue),
@@ -7590,30 +7601,30 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7590
7601
  caption: _.value ? Vs(u.modelValue) : void 0
7591
7602
  });
7592
7603
  }
7593
- function De() {
7604
+ function Oe() {
7594
7605
  d("openScheduled");
7595
7606
  }
7596
- function Oe() {
7607
+ function ke() {
7597
7608
  T !== null && (clearTimeout(T), T = null);
7598
7609
  }
7599
- function ke(e) {
7600
- u.disabled || !me.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, Oe(), T = setTimeout(() => {
7610
+ function Ae(e) {
7611
+ u.disabled || !he.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, ke(), T = setTimeout(() => {
7601
7612
  T = null, x.value = !0, b.value = !0;
7602
7613
  }, Jd));
7603
7614
  }
7604
- function Ae() {
7605
- Oe();
7606
- }
7607
7615
  function je() {
7608
- if (!(u.disabled || !pe.value)) {
7616
+ ke();
7617
+ }
7618
+ function Me() {
7619
+ if (!(u.disabled || !me.value)) {
7609
7620
  if (x.value) {
7610
7621
  x.value = !1;
7611
7622
  return;
7612
7623
  }
7613
- we();
7624
+ Te();
7614
7625
  }
7615
7626
  }
7616
- return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", fe.value]) }, [
7627
+ return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", pe.value]) }, [
7617
7628
  o("input", {
7618
7629
  ref_key: "fileInputRef",
7619
7630
  ref: f,
@@ -7621,8 +7632,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7621
7632
  class: "hidden",
7622
7633
  accept: ce.value,
7623
7634
  disabled: e.disabled,
7624
- onChange: be,
7625
- onCancel: ve
7635
+ onChange: xe,
7636
+ onCancel: ye
7626
7637
  }, null, 40, Bd),
7627
7638
  e.editingMessage ? (S(), r(bd, {
7628
7639
  key: 0,
@@ -7639,12 +7650,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7639
7650
  "data-testid": "composer-reply-context",
7640
7651
  onCancel: n[1] ||= (e) => d("cancelReply")
7641
7652
  }, null, 8, ["message", "context-label"])) : i("", !0),
7642
- _.value ? (S(), a("div", Vd, [o("div", Hd, [o("p", Ud, k(_.value.name), 1), o("p", Wd, k(_.value.type || le.value), 1)]), l(j(z), {
7643
- icon: j(de),
7653
+ _.value ? (S(), a("div", Vd, [o("div", Hd, [o("p", Ud, k(_.value.name), 1), o("p", Wd, k(_.value.type || ue.value), 1)]), l(j(z), {
7654
+ icon: j(fe),
7644
7655
  text: "",
7645
7656
  rounded: "",
7646
7657
  severity: "secondary",
7647
- onClick: Se
7658
+ onClick: Ce
7648
7659
  }, null, 8, ["icon"])])) : i("", !0),
7649
7660
  o("div", {
7650
7661
  ref_key: "composerShellRef",
@@ -7654,7 +7665,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7654
7665
  l(hd, {
7655
7666
  ref_key: "composerActionsRef",
7656
7667
  ref: m,
7657
- onPickFile: ye,
7668
+ onPickFile: be,
7658
7669
  onOpenPoll: n[2] ||= (e) => y.value = !0
7659
7670
  }, null, 512),
7660
7671
  l(j(z), {
@@ -7665,8 +7676,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7665
7676
  disabled: e.disabled || !!e.editingMessage,
7666
7677
  "aria-label": j(C)("addToMessage"),
7667
7678
  "data-testid": "composer-actions-button",
7668
- icon: j(se),
7669
- onClick: Ce
7679
+ icon: j(U),
7680
+ onClick: we
7670
7681
  }, null, 8, [
7671
7682
  "class",
7672
7683
  "disabled",
@@ -7685,12 +7696,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7685
7696
  onFocus: n[3] ||= (...e) => j(ne) && j(ne)(...e),
7686
7697
  onInput: n[4] ||= (...e) => j(I) && j(I)(...e),
7687
7698
  onKeyup: n[5] ||= (...e) => j(I) && j(I)(...e),
7688
- onKeydown: n[6] ||= (...e) => j(L) && j(L)(...e),
7689
- onPaste: xe,
7699
+ onKeydown: n[6] ||= (...e) => j(te) && j(te)(...e),
7700
+ onPaste: Se,
7690
7701
  onContextmenu: n[7] ||= (...e) => j(P) && j(P)(...e)
7691
7702
  }, null, 42, Gd)),
7692
7703
  _.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Kd, [
7693
- e.editingMessage ? (S(), r(j(oe), {
7704
+ e.editingMessage ? (S(), r(j(V), {
7694
7705
  key: 0,
7695
7706
  text: j(C)("editing"),
7696
7707
  context: "info",
@@ -7698,7 +7709,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7698
7709
  size: "sm",
7699
7710
  class: "composer-meta-tag"
7700
7711
  }, null, 8, ["text"])) : i("", !0),
7701
- e.contextLabel ? (S(), r(j(oe), {
7712
+ e.contextLabel ? (S(), r(j(V), {
7702
7713
  key: 1,
7703
7714
  text: e.contextLabel,
7704
7715
  context: "contrast",
@@ -7715,8 +7726,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7715
7726
  class: g(["composer-schedule-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
7716
7727
  disabled: e.disabled,
7717
7728
  "aria-label": j(C)("scheduledMessages"),
7718
- icon: j(_e),
7719
- onClick: De
7729
+ icon: j(ve),
7730
+ onClick: Oe
7720
7731
  }, null, 8, [
7721
7732
  "class",
7722
7733
  "disabled",
@@ -7728,17 +7739,17 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7728
7739
  severity: "primary",
7729
7740
  text: "",
7730
7741
  class: g(["composer-send-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
7731
- disabled: e.disabled || !pe.value,
7742
+ disabled: e.disabled || !me.value,
7732
7743
  "aria-label": e.editingMessage ? j(C)("saveMessage") : _.value ? j(C)("sendAttachment") : j(C)("sendMessage"),
7733
- icon: e.editingMessage ? j(ue) : j(Ne),
7734
- onMousedown: ke,
7735
- onMouseup: Ae,
7736
- onMouseleave: Ae,
7737
- onTouchstart: ke,
7738
- onTouchend: Ae,
7739
- onTouchcancel: Ae,
7740
- onContextmenu: n[8] ||= R(() => {}, ["prevent"]),
7741
- onClick: je
7744
+ icon: e.editingMessage ? j(de) : j(Pe),
7745
+ onMousedown: Ae,
7746
+ onMouseup: je,
7747
+ onMouseleave: je,
7748
+ onTouchstart: Ae,
7749
+ onTouchend: je,
7750
+ onTouchcancel: je,
7751
+ onContextmenu: n[8] ||= L(() => {}, ["prevent"]),
7752
+ onClick: Me
7742
7753
  }, null, 8, [
7743
7754
  "class",
7744
7755
  "disabled",
@@ -7748,18 +7759,18 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7748
7759
  ], 2),
7749
7760
  l(xd, {
7750
7761
  visible: j(re),
7751
- position: j(ee),
7762
+ position: j(N),
7752
7763
  onFormat: n[9] ||= (e) => j(A)(e)
7753
7764
  }, null, 8, ["visible", "position"]),
7754
7765
  l(zd, {
7755
7766
  ref_key: "triggerMenuRef",
7756
7767
  ref: O,
7757
- "highlighted-index": j(ae),
7758
- "onUpdate:highlightedIndex": n[10] ||= (e) => p(ae) ? ae.value = e : null,
7759
- visible: j(H),
7760
- position: j(V),
7768
+ "highlighted-index": j(oe),
7769
+ "onUpdate:highlightedIndex": n[10] ||= (e) => p(oe) ? oe.value = e : null,
7770
+ visible: j(se),
7771
+ position: j(ae),
7761
7772
  candidates: j(ie),
7762
- onSelect: n[11] ||= (e) => j(U)(e)
7773
+ onSelect: n[11] ||= (e) => j(H)(e)
7763
7774
  }, null, 8, [
7764
7775
  "highlighted-index",
7765
7776
  "visible",
@@ -7770,15 +7781,15 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7770
7781
  visible: y.value,
7771
7782
  "onUpdate:visible": n[12] ||= (e) => y.value = e,
7772
7783
  disabled: e.disabled,
7773
- onSend: Te
7784
+ onSend: Ee
7774
7785
  }, null, 8, ["visible", "disabled"]),
7775
7786
  l(Nd, {
7776
7787
  visible: b.value,
7777
7788
  "onUpdate:visible": n[13] ||= (e) => b.value = e,
7778
7789
  disabled: e.disabled,
7779
- "can-schedule": me.value,
7780
- "content-preview": he.value,
7781
- onSchedule: Ee
7790
+ "can-schedule": he.value,
7791
+ "content-preview": ge.value,
7792
+ onSchedule: De
7782
7793
  }, null, 8, [
7783
7794
  "visible",
7784
7795
  "disabled",
@@ -7794,7 +7805,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7794
7805
  __name: "ConversationComposer",
7795
7806
  props: { target: {} },
7796
7807
  setup(e, { expose: t }) {
7797
- let o = e, { t: s } = q(), c = ju(), l = Fu(), u = Bu(), d = Gu(), f = Xu(), p = n(() => o.target === "thread"), m = n({
7808
+ let o = e, { t: s } = K(), c = ju(), l = Fu(), u = Bu(), d = Gu(), f = Xu(), p = n(() => o.target === "thread"), m = n({
7798
7809
  get: () => p.value ? u.threadDraft.value : u.draft.value,
7799
7810
  set: (e) => {
7800
7811
  p.value ? u.threadDraft.value = e : u.draft.value = e;
@@ -7837,10 +7848,10 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7837
7848
  Zu(f, "ui:closeComposerActions", () => {
7838
7849
  M.value?.hideComposerActions();
7839
7850
  });
7840
- async function ee() {
7851
+ async function N() {
7841
7852
  await M.value?.focusEditor();
7842
7853
  }
7843
- return t({ focusEditor: ee }), (e, t) => y.value ? (S(), r(Yd, {
7854
+ return t({ focusEditor: N }), (e, t) => y.value ? (S(), r(Yd, {
7844
7855
  key: 0,
7845
7856
  ref_key: "composerRef",
7846
7857
  ref: M,
@@ -8006,49 +8017,49 @@ function $d(e) {
8006
8017
  {
8007
8018
  key: "reply",
8008
8019
  label: e.t("reply"),
8009
- icon: je,
8020
+ icon: Me,
8010
8021
  visible: e.canReply(),
8011
8022
  command: () => C(t)
8012
8023
  },
8013
8024
  {
8014
8025
  key: "edit",
8015
8026
  label: e.t("edit"),
8016
- icon: ve,
8027
+ icon: ye,
8017
8028
  visible: s(t),
8018
8029
  command: () => T(t)
8019
8030
  },
8020
8031
  {
8021
8032
  key: "copy",
8022
8033
  label: r.value === t.id ? e.t("copied") : e.t("copyText"),
8023
- icon: r.value === t.id ? ue : pe,
8034
+ icon: r.value === t.id ? de : me,
8024
8035
  visible: !0,
8025
8036
  command: () => S(t)
8026
8037
  },
8027
8038
  {
8028
8039
  key: "info",
8029
8040
  label: e.t("info"),
8030
- icon: we,
8041
+ icon: Te,
8031
8042
  visible: c(t),
8032
8043
  command: () => O(t)
8033
8044
  },
8034
8045
  {
8035
8046
  key: "thread",
8036
8047
  label: e.t("threadWithCount", { count: t.replyCount }),
8037
- icon: Se,
8048
+ icon: Ce,
8038
8049
  visible: !e.isInThread() && e.canOpenThread(),
8039
8050
  command: () => E(t)
8040
8051
  },
8041
8052
  {
8042
8053
  key: "delete",
8043
8054
  label: e.t("delete"),
8044
- icon: me,
8055
+ icon: he,
8045
8056
  visible: l(t),
8046
8057
  command: () => k(t)
8047
8058
  },
8048
8059
  {
8049
8060
  key: "translate",
8050
8061
  label: e.t("translate"),
8051
- icon: Ie,
8062
+ icon: Le,
8052
8063
  visible: o(t),
8053
8064
  command: () => D(t)
8054
8065
  }
@@ -8306,7 +8317,7 @@ var uf = { class: "w-full" }, df = {
8306
8317
  props: { attachment: {} },
8307
8318
  emits: ["close"],
8308
8319
  setup(t, { emit: s }) {
8309
- let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = q(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = lf({
8320
+ let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = K(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: N, handleDoubleClick: ee } = lf({
8310
8321
  viewportRef: u,
8311
8322
  imageRef: d,
8312
8323
  isImage: () => p.value
@@ -8331,7 +8342,7 @@ var uf = { class: "w-full" }, df = {
8331
8342
  target: "_blank",
8332
8343
  rel: "noreferrer",
8333
8344
  class: "media-viewer-link-action"
8334
- }, [(S(), r(D(j(Oe)), {
8345
+ }, [(S(), r(D(j(ke)), {
8335
8346
  class: "size-4",
8336
8347
  "aria-hidden": "true"
8337
8348
  })), o("span", null, k(j(_)("openInNewTab")), 1)], 8, pf)) : i("", !0)]),
@@ -8346,8 +8357,8 @@ var uf = { class: "w-full" }, df = {
8346
8357
  onPointerup: s[2] ||= (...e) => j(A) && j(A)(...e),
8347
8358
  onPointercancel: s[3] ||= (...e) => j(M) && j(M)(...e),
8348
8359
  onPointerleave: s[4] ||= (...e) => j(A) && j(A)(...e),
8349
- onWheel: s[5] ||= (...e) => j(ee) && j(ee)(...e),
8350
- onDblclick: s[6] ||= (...e) => j(N) && j(N)(...e)
8360
+ onWheel: s[5] ||= (...e) => j(N) && j(N)(...e),
8361
+ onDblclick: s[6] ||= (...e) => j(ee) && j(ee)(...e)
8351
8362
  }, [o("img", {
8352
8363
  ref_key: "imageRef",
8353
8364
  ref: d,
@@ -8379,7 +8390,7 @@ var uf = { class: "w-full" }, df = {
8379
8390
  __name: "MessageDateSeparator",
8380
8391
  props: { date: {} },
8381
8392
  setup(e) {
8382
- let t = e, { locale: r, t: i } = q(), s = n(() => {
8393
+ let t = e, { locale: r, t: i } = K(), s = n(() => {
8383
8394
  let e = /* @__PURE__ */ new Date(), n = t.date, a = new Date(e.getFullYear(), e.getMonth(), e.getDate()), o = new Date(a);
8384
8395
  o.setDate(o.getDate() - 1);
8385
8396
  let s = new Date(a);
@@ -8413,7 +8424,7 @@ var uf = { class: "w-full" }, df = {
8413
8424
  isOwn: { type: Boolean }
8414
8425
  },
8415
8426
  setup(e) {
8416
- let t = e, r = w(null), s = w(!1), { t: c } = q(), l = n(() => {
8427
+ let t = e, r = w(null), s = w(!1), { t: c } = K(), l = n(() => {
8417
8428
  try {
8418
8429
  return new URL(t.url).hostname.replace(/^www\./, "");
8419
8430
  } catch {
@@ -8526,7 +8537,7 @@ var uf = { class: "w-full" }, df = {
8526
8537
  props: { message: {} },
8527
8538
  emits: ["openMedia"],
8528
8539
  setup(t, { emit: n }) {
8529
- let s = n, { t: l } = q();
8540
+ let s = n, { t: l } = K();
8530
8541
  function u(e) {
8531
8542
  return !e || Number.isNaN(e) ? "" : e < 1024 * 1024 ? `${Math.round(e / 1024)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
8532
8543
  }
@@ -8535,21 +8546,21 @@ var uf = { class: "w-full" }, df = {
8535
8546
  }
8536
8547
  function f(e) {
8537
8548
  let t = d(e), n = e.mimeType?.toLowerCase() || "";
8538
- return n === "application/pdf" || t === "pdf" ? Ae : [
8549
+ return n === "application/pdf" || t === "pdf" ? je : [
8539
8550
  "doc",
8540
8551
  "docx",
8541
8552
  "odt",
8542
8553
  "rtf"
8543
- ].includes(t) ? he : [
8554
+ ].includes(t) ? ge : [
8544
8555
  "xls",
8545
8556
  "xlsx",
8546
8557
  "csv",
8547
8558
  "ods"
8548
- ].includes(t) ? Pe : [
8559
+ ].includes(t) ? Fe : [
8549
8560
  "ppt",
8550
8561
  "pptx",
8551
8562
  "odp"
8552
- ].includes(t) ? be : [
8563
+ ].includes(t) ? xe : [
8553
8564
  "txt",
8554
8565
  "md",
8555
8566
  "json",
@@ -8560,13 +8571,13 @@ var uf = { class: "w-full" }, df = {
8560
8571
  "ts",
8561
8572
  "html",
8562
8573
  "css"
8563
- ].includes(t) || n.startsWith("text/") ? n.startsWith("text/") ? Fe : fe : [
8574
+ ].includes(t) || n.startsWith("text/") ? n.startsWith("text/") ? Ie : pe : [
8564
8575
  "zip",
8565
8576
  "rar",
8566
8577
  "7z",
8567
8578
  "tar",
8568
8579
  "gz"
8569
- ].includes(t) ? xe : he;
8580
+ ].includes(t) ? Se : ge;
8570
8581
  }
8571
8582
  function p(e) {
8572
8583
  let t = Us(e.text).trim();
@@ -8632,11 +8643,11 @@ var uf = { class: "w-full" }, df = {
8632
8643
  __name: "MessageDeliveryStatus",
8633
8644
  props: { message: {} },
8634
8645
  setup(e) {
8635
- let t = e, { locale: s, t: c } = q();
8646
+ let t = e, { locale: s, t: c } = K();
8636
8647
  function l(e) {
8637
8648
  return new Intl.DateTimeFormat(s.value, {
8638
8649
  timeStyle: "short",
8639
- hourCycle: ht()
8650
+ hourCycle: gt()
8640
8651
  }).format(e);
8641
8652
  }
8642
8653
  let u = n(() => {
@@ -8646,34 +8657,34 @@ var uf = { class: "w-full" }, df = {
8646
8657
  case "read": return {
8647
8658
  state: "read",
8648
8659
  label: c("read"),
8649
- icon: ge,
8660
+ icon: _e,
8650
8661
  class: "text-success"
8651
8662
  };
8652
8663
  case "delivered": return {
8653
8664
  state: "delivered",
8654
8665
  label: c("delivered"),
8655
- icon: ue
8666
+ icon: de
8656
8667
  };
8657
8668
  case "queued": return {
8658
8669
  state: "queued",
8659
8670
  label: c("queued"),
8660
- icon: Me
8671
+ icon: Ne
8661
8672
  };
8662
8673
  case "sending": return {
8663
8674
  state: "sending",
8664
8675
  label: c("sending"),
8665
- icon: Ne
8676
+ icon: Pe
8666
8677
  };
8667
8678
  case "failed": return {
8668
8679
  state: "failed",
8669
8680
  label: c("failed"),
8670
- icon: ye,
8681
+ icon: be,
8671
8682
  class: "text-danger"
8672
8683
  };
8673
8684
  default: return {
8674
8685
  state: "sent",
8675
8686
  label: c("sent"),
8676
- icon: ke
8687
+ icon: Ae
8677
8688
  };
8678
8689
  }
8679
8690
  });
@@ -8697,7 +8708,7 @@ var uf = { class: "w-full" }, df = {
8697
8708
  __name: "MessageItemHeader",
8698
8709
  props: { message: {} },
8699
8710
  setup(e) {
8700
- let t = e, { locale: n, t: s } = q();
8711
+ let t = e, { locale: n, t: s } = K();
8701
8712
  function c(e) {
8702
8713
  return e ? new Intl.DateTimeFormat(n.value, {
8703
8714
  month: "short",
@@ -8709,7 +8720,7 @@ var uf = { class: "w-full" }, df = {
8709
8720
  function l() {
8710
8721
  return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
8711
8722
  }
8712
- return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(oe), {
8723
+ return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(V), {
8713
8724
  key: 0,
8714
8725
  text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
8715
8726
  context: "warn",
@@ -8748,7 +8759,7 @@ var uf = { class: "w-full" }, df = {
8748
8759
  },
8749
8760
  emits: ["toggleReaction", "openThread"],
8750
8761
  setup(e, { emit: t }) {
8751
- let s = e, c = t, { t: u } = q(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
8762
+ let s = e, c = t, { t: u } = K(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
8752
8763
  return (t, n) => (S(), a("div", _p, [l(gp, {
8753
8764
  message: e.message,
8754
8765
  disabled: e.canReact === !1,
@@ -8760,8 +8771,8 @@ var uf = { class: "w-full" }, df = {
8760
8771
  class: "message-reactions__thread-button text-subtle hover:text-default inline-flex items-center gap-1 rounded-full px-1 py-0 font-medium transition",
8761
8772
  "aria-label": d.value,
8762
8773
  title: d.value,
8763
- onClick: n[1] ||= R((e) => c("openThread"), ["stop"])
8764
- }, [(S(), r(D(j(je)), {
8774
+ onClick: n[1] ||= L((e) => c("openThread"), ["stop"])
8775
+ }, [(S(), r(D(j(Me)), {
8765
8776
  class: "size-4",
8766
8777
  "aria-hidden": "true"
8767
8778
  })), o("span", yp, k(e.message.replyCount), 1)], 8, vp)) : i("", !0)]));
@@ -8778,7 +8789,7 @@ var uf = { class: "w-full" }, df = {
8778
8789
  },
8779
8790
  emits: ["vote"],
8780
8791
  setup(t, { emit: n }) {
8781
- let r = t, s = n, { t: c } = q();
8792
+ let r = t, s = n, { t: c } = K();
8782
8793
  function l(e) {
8783
8794
  let t = r.currentUserId;
8784
8795
  return !t || !r.message.poll ? !1 : r.message.poll.options.some((n) => n.id === e && n.voters.includes(t));
@@ -8894,7 +8905,7 @@ var uf = { class: "w-full" }, df = {
8894
8905
  key: 0,
8895
8906
  text: t.message.text,
8896
8907
  class: g(f.value)
8897
- }, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(te), {
8908
+ }, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(R), {
8898
8909
  key: 0,
8899
8910
  image: t.message.senderAvatar,
8900
8911
  label: t.message.senderAvatar ? void 0 : t.message.senderName.slice(0, 1).toUpperCase(),
@@ -8987,7 +8998,7 @@ var uf = { class: "w-full" }, df = {
8987
8998
  class: "message-reaction-more",
8988
8999
  disabled: !t.canReact,
8989
9000
  onClick: p
8990
- }, [(S(), r(D(u.value ? j(Ee) : j(Te)), {
9001
+ }, [(S(), r(D(u.value ? j(De) : j(Ee)), {
8991
9002
  class: "size-7",
8992
9003
  "aria-hidden": "true"
8993
9004
  }))], 8, Hp)]), u.value && t.canReact ? (S(), a("div", Up, [(S(!0), a(e, null, T(d.value, (e) => (S(), a("button", {
@@ -9065,7 +9076,7 @@ var uf = { class: "w-full" }, df = {
9065
9076
  message: e.message,
9066
9077
  "can-react": e.canReact,
9067
9078
  onReact: o[0] ||= (e) => s("react", e)
9068
- }, null, 8, ["message", "can-react"]), l(j(V), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
9079
+ }, null, 8, ["message", "can-react"]), l(j(ae), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
9069
9080
  }
9070
9081
  }), [["__scopeId", "data-v-54f6bf5c"]]), qp = { class: "chat-header border-default bg-elevation-surface-default sticky top-0 z-10 flex items-center justify-between gap-3 border-b px-4 py-3 max-md:px-4 max-md:pb-3 sm:px-5 sm:py-3.5" }, Jp = {
9071
9082
  key: 0,
@@ -9080,13 +9091,13 @@ var uf = { class: "w-full" }, df = {
9080
9091
  parentMessage: {}
9081
9092
  },
9082
9093
  setup(t) {
9083
- let { t: n } = q();
9084
- return (s, c) => (S(), a("header", qp, [t.conversation ? (S(), a("div", Jp, [l(j(te), {
9094
+ let { t: n } = K();
9095
+ return (s, c) => (S(), a("header", qp, [t.conversation ? (S(), a("div", Jp, [l(j(R), {
9085
9096
  image: t.conversation.avatar,
9086
9097
  label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
9087
9098
  shape: "circle",
9088
9099
  class: "chat-header__avatar shrink-0"
9089
- }, null, 8, ["image", "label"]), o("div", Yp, [o("p", Xp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Zp, [t.parentMessage ? (S(), a("span", Qp, k(t.parentMessage.senderName), 1)) : (S(), a("span", $p, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", em, [t.conversation?.tags?.length ? (S(), a("div", tm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(oe), {
9100
+ }, null, 8, ["image", "label"]), o("div", Yp, [o("p", Xp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Zp, [t.parentMessage ? (S(), a("span", Qp, k(t.parentMessage.senderName), 1)) : (S(), a("span", $p, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", em, [t.conversation?.tags?.length ? (S(), a("div", tm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(V), {
9090
9101
  key: e,
9091
9102
  text: e,
9092
9103
  context: "secondary",
@@ -9113,13 +9124,13 @@ var uf = { class: "w-full" }, df = {
9113
9124
  },
9114
9125
  emits: ["anchorclick"],
9115
9126
  setup(t) {
9116
- let s = t, { t: c } = q(), u = ju(), d = Fu(), f = Xu(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
9127
+ let s = t, { t: c } = K(), u = ju(), d = Fu(), f = Xu(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
9117
9128
  let e = u.conversation.value;
9118
9129
  return e ? _.value ? c("thread") : e.title : "";
9119
9130
  }), O = n(() => {
9120
9131
  let e = u.conversation.value;
9121
9132
  return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
9122
- }), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Eu(u.conversation.value)), L = ee("threadRef"), { handleThreadScroll: R } = of({
9133
+ }), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), ee = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Eu(u.conversation.value)), te = N("threadRef"), { handleThreadScroll: L } = of({
9123
9134
  getConversation: () => u.conversation.value,
9124
9135
  getParentMessage: () => _.value,
9125
9136
  getMessages: () => m.value,
@@ -9127,14 +9138,14 @@ var uf = { class: "w-full" }, df = {
9127
9138
  isLoadingOlder: () => x.value,
9128
9139
  canLoadOlder: () => b.value,
9129
9140
  onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
9130
- threadRef: L
9131
- }), te = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: V, getActionItems: ae } = $d({
9141
+ threadRef: te
9142
+ }), R = N("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: ae, getActionItems: oe } = $d({
9132
9143
  canUseMessageActions: () => u.canUseMessageActions.value,
9133
9144
  canReact: () => u.canReact.value,
9134
9145
  canReply: () => u.canReply.value,
9135
9146
  canOpenThread: () => v.value,
9136
9147
  isInThread: () => p.value,
9137
- actionMenuRef: te,
9148
+ actionMenuRef: R,
9138
9149
  t: c,
9139
9150
  emit: {
9140
9151
  reply: (e) => f.emit("message:reply", e),
@@ -9150,21 +9161,21 @@ var uf = { class: "w-full" }, df = {
9150
9161
  },
9151
9162
  onMenuOpen: () => f.emit("ui:closeComposerActions")
9152
9163
  });
9153
- function H(e) {
9164
+ function se(e) {
9154
9165
  return !!e.url && [
9155
9166
  "image",
9156
9167
  "video",
9157
9168
  "audio"
9158
9169
  ].includes(e.kind);
9159
9170
  }
9160
- function oe(e) {
9161
- H(e) && (M.value = e);
9171
+ function V(e) {
9172
+ se(e) && (M.value = e);
9162
9173
  }
9163
- function U() {
9174
+ function H() {
9164
9175
  M.value = null;
9165
9176
  }
9166
- async function se(e, t) {
9167
- N.value = `${e.id}:${t}`;
9177
+ async function U(e, t) {
9178
+ ee.value = `${e.id}:${t}`;
9168
9179
  try {
9169
9180
  f.emit("message:votePoll", {
9170
9181
  message: e,
@@ -9172,19 +9183,19 @@ var uf = { class: "w-full" }, df = {
9172
9183
  });
9173
9184
  } finally {
9174
9185
  window.setTimeout(() => {
9175
- N.value === `${e.id}:${t}` && (N.value = null);
9186
+ ee.value === `${e.id}:${t}` && (ee.value = null);
9176
9187
  }, 300);
9177
9188
  }
9178
9189
  }
9179
9190
  function ce(e) {
9180
9191
  v.value && f.emit("message:openThread", e);
9181
9192
  }
9182
- function W(e, t) {
9193
+ function le(e, t) {
9183
9194
  return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth() || e.getDate() !== t.getDate();
9184
9195
  }
9185
- function le(e) {
9196
+ function ue(e) {
9186
9197
  let t = m.value;
9187
- return e === 0 ? !0 : W(t[e].sentAt, t[e - 1].sentAt);
9198
+ return e === 0 ? !0 : le(t[e].sentAt, t[e - 1].sentAt);
9188
9199
  }
9189
9200
  return (t, n) => (S(), a(e, null, [
9190
9201
  o("section", { class: g(["message-list-root", [t.$attrs.class, F.value ? "message-list--embedded-thread" : P.value ? "message-list--thread" : "message-list--main"]]) }, [y.value ? E(t.$slots, "header", {
@@ -9203,12 +9214,12 @@ var uf = { class: "w-full" }, df = {
9203
9214
  class: g(["message-list__body", F.value || P.value ? "bg-elevation-surface-overlay" : ""])
9204
9215
  }, [o("div", {
9205
9216
  ref_key: "threadRef",
9206
- ref: L,
9217
+ ref: te,
9207
9218
  class: g(["message-list__scroll min-h-0 flex-1", F.value ? "p-0" : P.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
9208
- onScroll: n[2] ||= (...e) => j(R) && j(R)(...e)
9219
+ onScroll: n[2] ||= (...e) => j(L) && j(L)(...e)
9209
9220
  }, [o("div", im, [
9210
9221
  _.value ? (S(), a("div", am, [o("p", om, k(_.value.senderName), 1), o("p", sm, k(j(Ws)(_.value, j(c)("message"), j(u).mentionNameByUid.value)), 1)])) : i("", !0),
9211
- (S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [le(c) ? (S(), r(kf, {
9222
+ (S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [ue(c) ? (S(), r(kf, {
9212
9223
  key: 0,
9213
9224
  date: o.sentAt
9214
9225
  }, null, 8, ["date"])) : i("", !0), l(Lp, {
@@ -9217,14 +9228,14 @@ var uf = { class: "w-full" }, df = {
9217
9228
  "can-react": j(u).canReact.value,
9218
9229
  "can-open-thread": !_.value && v.value,
9219
9230
  "can-show-sender-avatar": I.value,
9220
- "pending-option-key": N.value,
9231
+ "pending-option-key": ee.value,
9221
9232
  "action-message-class": s.actionMessageClass,
9222
9233
  "action-message-row-class": s.actionMessageRowClass,
9223
9234
  onContextmenu: (e) => j(ne)(o, e),
9224
9235
  onTap: (e) => j(B)(o, e),
9225
- onOpenMedia: oe,
9226
- onVotePoll: (e) => se(o, e),
9227
- onToggleReaction: (e) => j(V)(o, e),
9236
+ onOpenMedia: V,
9237
+ onVotePoll: (e) => U(o, e),
9238
+ onToggleReaction: (e) => j(ae)(o, e),
9228
9239
  onOpenThread: (e) => ce(o),
9229
9240
  onOpenReferencedMessage: n[0] ||= (e) => j(f).emit("message:openReference", e),
9230
9241
  onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
@@ -9247,14 +9258,14 @@ var uf = { class: "w-full" }, df = {
9247
9258
  ])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", P.value ? F.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", rm, k(j(c)("selectConversationToStart")), 1))], 2),
9248
9259
  l(Ef, {
9249
9260
  attachment: M.value,
9250
- onClose: U
9261
+ onClose: H
9251
9262
  }, null, 8, ["attachment"]),
9252
9263
  l(Kp, {
9253
9264
  ref_key: "actionMenuRef",
9254
- ref: te,
9265
+ ref: R,
9255
9266
  message: j(z),
9256
9267
  "can-react": j(u).canReact.value,
9257
- "action-items": j(z) ? j(ae)(j(z)) : [],
9268
+ "action-items": j(z) ? j(oe)(j(z)) : [],
9258
9269
  onHide: j(re),
9259
9270
  onReact: n[3] ||= (e) => j(ie)(j(z), e)
9260
9271
  }, null, 8, [
@@ -9283,7 +9294,7 @@ var uf = { class: "w-full" }, df = {
9283
9294
  return (n, r) => (S(), a("section", um, [o("div", dm, [o("p", fm, k(t.title), 1), o("span", pm, k(t.receipts.length), 1)]), t.receipts.length ? (S(), a("div", mm, [(S(!0), a(e, null, T(t.receipts, (e) => (S(), a("div", {
9284
9295
  key: `${e.kind}-${e.user.uid}`,
9285
9296
  class: "receipt-section__row"
9286
- }, [o("div", hm, [l(j(te), {
9297
+ }, [o("div", hm, [l(j(R), {
9287
9298
  image: e.user.avatar,
9288
9299
  label: e.user.avatar ? void 0 : e.user.name.slice(0, 1).toUpperCase(),
9289
9300
  shape: "circle",
@@ -9313,12 +9324,12 @@ var uf = { class: "w-full" }, df = {
9313
9324
  },
9314
9325
  emits: ["close"],
9315
9326
  setup(e, { emit: t }) {
9316
- let s = e, c = t, { locale: u, t: d } = q(), f = ju(), p = n(() => s.receipts.filter((e) => e.kind === "delivered")), m = n(() => s.receipts.filter((e) => e.kind === "read")), h = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
9327
+ let s = e, c = t, { locale: u, t: d } = K(), f = ju(), p = n(() => s.receipts.filter((e) => e.kind === "delivered")), m = n(() => s.receipts.filter((e) => e.kind === "read")), h = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
9317
9328
  function g(e) {
9318
9329
  return e ? new Intl.DateTimeFormat(u.value, {
9319
9330
  dateStyle: "medium",
9320
9331
  timeStyle: "short",
9321
- hourCycle: ht()
9332
+ hourCycle: gt()
9322
9333
  }).format(e) : d("notYet");
9323
9334
  }
9324
9335
  function _(e, t) {
@@ -9333,19 +9344,19 @@ var uf = { class: "w-full" }, df = {
9333
9344
  }, {
9334
9345
  default: I(() => [e.message ? (S(), a("div", Sm, [o("div", Cm, [o("p", wm, k(j(Ws)(e.message, j(d)("message"), j(f).mentionNameByUid.value)), 1), o("div", Tm, [
9335
9346
  o("div", Em, [o("p", Dm, k(j(d)("sent")), 1), o("p", Om, k(g(e.message.sentAt)), 1)]),
9336
- o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(oe), {
9347
+ o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(V), {
9337
9348
  key: 0,
9338
9349
  text: String(h.value.length),
9339
9350
  context: "secondary",
9340
9351
  rounded: ""
9341
9352
  }, null, 8, ["text"])) : i("", !0)]), o("p", Mm, k(_(e.message.receipts.deliveredAt, h.value.length)), 1)]),
9342
- o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(oe), {
9353
+ o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(V), {
9343
9354
  key: 0,
9344
9355
  text: String(m.value.length),
9345
9356
  context: "success",
9346
9357
  rounded: ""
9347
9358
  }, null, 8, ["text"])) : i("", !0)]), o("p", Im, k(_(e.message.receipts.readAt, m.value.length)), 1)])
9348
- ])]), e.loading ? (S(), a("div", Lm, [l(j(H), {
9359
+ ])]), e.loading ? (S(), a("div", Lm, [l(j(se), {
9349
9360
  style: {
9350
9361
  width: "2.5rem",
9351
9362
  height: "2.5rem"
@@ -9420,7 +9431,7 @@ var uf = { class: "w-full" }, df = {
9420
9431
  "editText"
9421
9432
  ],
9422
9433
  setup(t, { emit: s }) {
9423
- let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = q(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
9434
+ let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = K(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
9424
9435
  F(() => c.open, (e) => {
9425
9436
  e || (d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "");
9426
9437
  });
@@ -9428,7 +9439,7 @@ var uf = { class: "w-full" }, df = {
9428
9439
  return e ? new Intl.DateTimeFormat(_.value, {
9429
9440
  dateStyle: "medium",
9430
9441
  timeStyle: "short",
9431
- hourCycle: ht()
9442
+ hourCycle: gt()
9432
9443
  }).format(e) : v("unscheduled");
9433
9444
  }
9434
9445
  function C(e) {
@@ -9451,7 +9462,7 @@ var uf = { class: "w-full" }, df = {
9451
9462
  function M() {
9452
9463
  d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "";
9453
9464
  }
9454
- function ee(e) {
9465
+ function N(e) {
9455
9466
  return {
9456
9467
  ...e,
9457
9468
  text: ""
@@ -9460,10 +9471,10 @@ var uf = { class: "w-full" }, df = {
9460
9471
  function P() {
9461
9472
  p.value = !0;
9462
9473
  }
9463
- function R(e) {
9474
+ function L(e) {
9464
9475
  return e.attachments.length ? !(d.value === e.id && p.value) : !1;
9465
9476
  }
9466
- function te(e) {
9477
+ function R(e) {
9467
9478
  if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !m.value || !b.value) return;
9468
9479
  let [t, n, r] = m.value.split("-").map(Number), [i, a] = h.value.split(":").map(Number), o = new Date(t, n - 1, r, i, a, 0, 0);
9469
9480
  u("reschedule", {
@@ -9494,7 +9505,7 @@ var uf = { class: "w-full" }, df = {
9494
9505
  "close-label": j(v)("close"),
9495
9506
  onClose: s[3] ||= (e) => u("close")
9496
9507
  }, {
9497
- default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(H), {
9508
+ default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(se), {
9498
9509
  style: {
9499
9510
  width: "2.75rem",
9500
9511
  height: "2.75rem"
@@ -9504,33 +9515,33 @@ var uf = { class: "w-full" }, df = {
9504
9515
  key: e.id,
9505
9516
  class: "border-default rounded-lg border px-4 py-3"
9506
9517
  }, [o("div", Gm, [o("div", Km, [
9507
- o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(oe), {
9518
+ o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(V), {
9508
9519
  key: 0,
9509
9520
  text: j(v)("poll"),
9510
9521
  context: "info",
9511
9522
  rounded: ""
9512
- }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(oe), {
9523
+ }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(V), {
9513
9524
  key: 1,
9514
9525
  text: D(e.attachments[0].kind),
9515
9526
  context: "info",
9516
9527
  rounded: ""
9517
- }, null, 8, ["text"])) : (S(), r(j(oe), {
9528
+ }, null, 8, ["text"])) : (S(), r(j(V), {
9518
9529
  key: 2,
9519
9530
  text: j(v)("message"),
9520
9531
  context: "info",
9521
9532
  rounded: ""
9522
9533
  }, null, 8, ["text"]))]), l(j(z), {
9523
- icon: j(me),
9534
+ icon: j(he),
9524
9535
  text: "",
9525
9536
  size: "small",
9526
9537
  onClick: (t) => B(e)
9527
9538
  }, null, 8, ["icon", "onClick"])]),
9528
9539
  o("div", Ym, [o("p", Xm, k(x(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Zm, k(e.poll.question), 1)) : (S(), a("p", Qm, k(j(Ws)(e, j(v)("attachment"))), 1))]),
9529
- R(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
9540
+ L(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message: N(e) }, null, 8, ["message"])])) : i("", !0)
9530
9541
  ]), o("div", eh, [e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
9531
9542
  key: 0,
9532
9543
  label: j(v)("edit"),
9533
- icon: j(ve),
9544
+ icon: j(ye),
9534
9545
  severity: "secondary",
9535
9546
  size: "small",
9536
9547
  onClick: (t) => A(e)
@@ -9541,7 +9552,7 @@ var uf = { class: "w-full" }, df = {
9541
9552
  ])), e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(z), {
9542
9553
  key: 1,
9543
9554
  label: j(v)("reschedule"),
9544
- icon: j(le),
9555
+ icon: j(ue),
9545
9556
  severity: "secondary",
9546
9557
  size: "small",
9547
9558
  onClick: (t) => O(e)
@@ -9549,11 +9560,11 @@ var uf = { class: "w-full" }, df = {
9549
9560
  "label",
9550
9561
  "icon",
9551
9562
  "onClick"
9552
- ])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", th, [o("div", nh, [L(o("input", {
9563
+ ])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", th, [o("div", nh, [te(o("input", {
9553
9564
  "onUpdate:modelValue": s[0] ||= (e) => m.value = e,
9554
9565
  type: "date",
9555
9566
  class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
9556
- }, null, 512), [[N, m.value]]), L(o("input", {
9567
+ }, null, 512), [[ee, m.value]]), te(o("input", {
9557
9568
  "onUpdate:modelValue": s[1] ||= (e) => h.value = e,
9558
9569
  type: "time",
9559
9570
  inputmode: "numeric",
@@ -9561,11 +9572,11 @@ var uf = { class: "w-full" }, df = {
9561
9572
  pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
9562
9573
  "aria-label": "Time (24-hour)",
9563
9574
  class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
9564
- }, null, 512), [[N, h.value]])]), o("div", rh, [l(j(z), {
9575
+ }, null, 512), [[ee, h.value]])]), o("div", rh, [l(j(z), {
9565
9576
  label: j(v)("save"),
9566
9577
  size: "small",
9567
9578
  disabled: !m.value || !b.value,
9568
- onClick: (t) => te(e)
9579
+ onClick: (t) => R(e)
9569
9580
  }, null, 8, [
9570
9581
  "label",
9571
9582
  "disabled",
@@ -9576,8 +9587,8 @@ var uf = { class: "w-full" }, df = {
9576
9587
  text: "",
9577
9588
  onClick: M
9578
9589
  }, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", ih, [
9579
- R(e) ? (S(), a("div", ah, [l(cp, { message: ee(e) }, null, 8, ["message"]), o("div", oh, [l(j(z), {
9580
- icon: j(de),
9590
+ L(e) ? (S(), a("div", ah, [l(cp, { message: N(e) }, null, 8, ["message"]), o("div", oh, [l(j(z), {
9591
+ icon: j(fe),
9581
9592
  "aria-label": j(v)("remove"),
9582
9593
  text: "",
9583
9594
  rounded: "",
@@ -9585,12 +9596,12 @@ var uf = { class: "w-full" }, df = {
9585
9596
  size: "small",
9586
9597
  onClick: P
9587
9598
  }, null, 8, ["icon", "aria-label"])])])) : i("", !0),
9588
- L(o("textarea", {
9599
+ te(o("textarea", {
9589
9600
  "onUpdate:modelValue": s[2] ||= (e) => g.value = e,
9590
9601
  rows: "3",
9591
9602
  class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
9592
9603
  placeholder: j(v)("writeMessage")
9593
- }, null, 8, sh), [[N, g.value]]),
9604
+ }, null, 8, sh), [[ee, g.value]]),
9594
9605
  o("div", ch, [l(j(z), {
9595
9606
  label: j(v)("cancel"),
9596
9607
  size: "small",
@@ -9684,8 +9695,8 @@ var uf = { class: "w-full" }, df = {
9684
9695
  "linkClicked",
9685
9696
  "chatNotAMember"
9686
9697
  ],
9687
- setup(t, { expose: o, emit: u }) {
9688
- function f(e) {
9698
+ setup(t, { expose: r, emit: o }) {
9699
+ function u(e) {
9689
9700
  let t = /* @__PURE__ */ new Set(), n = [], r = (r) => {
9690
9701
  !r.uid || r.uid === e.currentUserId || t.has(r.uid) || (t.add(r.uid), n.push(r));
9691
9702
  };
@@ -9698,121 +9709,121 @@ var uf = { class: "w-full" }, df = {
9698
9709
  });
9699
9710
  return n;
9700
9711
  }
9701
- let p = t, m = u, { t: h } = q(() => p.language), v = w(null), x = w(!1), C = w(!1), T = w(!1), D = n(() => p.client ?? Q.value ?? null), O = n(() => !!p.chatUid), A = n(() => {
9702
- if (p.conversation !== void 0) return p.conversation;
9703
- let e = D.value;
9704
- return e ? p.chatUid ? e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null : e.activeConversation.value : null;
9705
- }), { groupMembers: M, fetchGroupMembers: N } = Qu({
9706
- getConversationTargetId: () => A.value?.targetId,
9707
- isChannel: () => vu(A.value),
9712
+ let f = t, p = o, { t: m } = K(() => f.language), h = w(null), v = w(!1), x = w(!1), C = w(!1), T = n(() => f.client ?? Q.value ?? null), D = n(() => !!f.chatUid), O = n(() => {
9713
+ if (f.conversation !== void 0) return f.conversation;
9714
+ let e = T.value;
9715
+ return e ? f.chatUid ? e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null : e.activeConversation.value : null;
9716
+ }), { groupMembers: A, fetchGroupMembers: M } = Qu({
9717
+ getConversationTargetId: () => O.value?.targetId,
9718
+ isChannel: () => vu(O.value),
9708
9719
  onMembersChanged: (e) => {
9709
- m("chatMembersFetched", e), D.value?.rememberMentionDisplayNames(e);
9720
+ p("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
9710
9721
  }
9711
- }), P = Ou({
9712
- chatClient: D,
9713
- selectedConversation: A,
9714
- getPropIsReadOnly: () => p.isReadOnly,
9715
- getPropSendOptions: () => p.sendOptions,
9716
- getSenderDisplayName: () => p.senderDisplayName,
9717
- getMentionCandidates: () => f({
9718
- groupMembers: M.value,
9719
- messages: p.messages ?? D.value?.messages.value ?? [],
9720
- currentUserId: D.value?.currentUser.value?.uid
9722
+ }), ee = Ou({
9723
+ chatClient: T,
9724
+ selectedConversation: O,
9725
+ getPropIsReadOnly: () => f.isReadOnly,
9726
+ getPropSendOptions: () => f.sendOptions,
9727
+ getSenderDisplayName: () => f.senderDisplayName,
9728
+ getMentionCandidates: () => u({
9729
+ groupMembers: A.value,
9730
+ messages: f.messages ?? T.value?.messages.value ?? [],
9731
+ currentUserId: T.value?.currentUser.value?.uid
9721
9732
  })
9722
9733
  });
9723
- Au(P);
9724
- let L = Mu({
9725
- chatClient: D,
9726
- selectedConversation: A,
9727
- usesPublicContract: O,
9728
- loadingChat: C,
9729
- getPropMessages: () => p.messages,
9730
- getPropThreadMessages: () => p.threadMessages,
9731
- getPropLoadingMessages: () => p.loadingMessages,
9732
- getPropLoadingThreadMessages: () => p.loadingThreadMessages,
9733
- getPropShowDefaultEmptyState: () => p.showDefaultEmptyState,
9734
- getHideDeletedMessages: () => p.hideDeletedMessages
9734
+ Au(ee);
9735
+ let P = Mu({
9736
+ chatClient: T,
9737
+ selectedConversation: O,
9738
+ usesPublicContract: D,
9739
+ loadingChat: x,
9740
+ getPropMessages: () => f.messages,
9741
+ getPropThreadMessages: () => f.threadMessages,
9742
+ getPropLoadingMessages: () => f.loadingMessages,
9743
+ getPropLoadingThreadMessages: () => f.loadingThreadMessages,
9744
+ getPropShowDefaultEmptyState: () => f.showDefaultEmptyState,
9745
+ getHideDeletedMessages: () => f.hideDeletedMessages
9735
9746
  });
9736
- Pu(L);
9737
- let R = n(() => L.messages.value.length > 0), te = n(() => p.showHeader ?? p.showMessageHeader), z = Hu({
9738
- chatClient: D,
9739
- selectedConversation: A,
9740
- getInitialScheduledMessagesOpen: () => !!p.initialScheduledMessagesOpen,
9741
- fetchErrorFallback: h("loadMessageReceiptsError")
9747
+ Pu(P);
9748
+ let te = n(() => P.messages.value.length > 0), L = n(() => f.showHeader ?? f.showMessageHeader), R = Hu({
9749
+ chatClient: T,
9750
+ selectedConversation: O,
9751
+ getInitialScheduledMessagesOpen: () => !!f.initialScheduledMessagesOpen,
9752
+ fetchErrorFallback: m("loadMessageReceiptsError")
9742
9753
  });
9743
- Wu(z);
9744
- let ne = ee("mainComposerRef"), B = ee("threadComposerRef"), re = Lu({
9745
- chatClient: D,
9746
- sendOptions: P.sendOptions,
9747
- mentionNameByUid: P.mentionNameByUid,
9748
- afterSchedule: () => z.openScheduledMessages(),
9749
- mainComposerRef: ne,
9750
- threadComposerRef: B
9754
+ Wu(R);
9755
+ let z = N("mainComposerRef"), ne = N("threadComposerRef"), B = Lu({
9756
+ chatClient: T,
9757
+ sendOptions: ee.sendOptions,
9758
+ mentionNameByUid: ee.mentionNameByUid,
9759
+ afterSchedule: () => R.openScheduledMessages(),
9760
+ mainComposerRef: z,
9761
+ threadComposerRef: ne
9751
9762
  });
9752
- zu(re);
9753
- let ie = Ju();
9754
- Yu(ie), Ku({
9755
- conversation: P,
9756
- composer: re,
9757
- dialogs: z,
9758
- bus: ie
9763
+ zu(B);
9764
+ let re = Ju();
9765
+ Yu(re), Ku({
9766
+ conversation: ee,
9767
+ composer: B,
9768
+ dialogs: R,
9769
+ bus: re
9759
9770
  });
9760
- let { scrollToRequestedMessage: V } = $u({
9761
- chatRootRef: v,
9762
- getClient: () => D.value
9771
+ let { scrollToRequestedMessage: ie } = $u({
9772
+ chatRootRef: h,
9773
+ getClient: () => T.value
9763
9774
  });
9764
- F(() => A.value?.targetId ?? null, () => {
9765
- z.refreshScheduledMessages();
9766
- }, { immediate: !0 }), F(() => A.value?.targetId ?? null, async (e) => {
9767
- !e || A.value?.type !== "group" || await N(e);
9768
- }, { immediate: !0 }), F(() => A.value?.id, () => {
9769
- re.resetMainComposer(), re.resetThreadComposer(), z.showScheduledMessages.value = !1, z.closeMessageInfo();
9770
- }), F(() => p.chatMessageGetter, (e) => {
9775
+ F(() => O.value?.targetId ?? null, () => {
9776
+ R.refreshScheduledMessages();
9777
+ }, { immediate: !0 }), F(() => O.value?.targetId ?? null, async (e) => {
9778
+ !e || O.value?.type !== "group" || await M(e);
9779
+ }, { immediate: !0 }), F(() => O.value?.id, () => {
9780
+ B.resetMainComposer(), B.resetThreadComposer(), R.showScheduledMessages.value = !1, R.closeMessageInfo();
9781
+ }), F(() => f.chatMessageGetter, (e) => {
9771
9782
  gu.setGetChatMessagesCallback(e);
9772
- }, { immediate: !0 }), F(() => p.language, (e) => {
9773
- e && gt(e);
9774
- }, { immediate: !0 }), F(L.isChatEmpty, (e) => {
9775
- e && m("chatEmpty");
9783
+ }, { immediate: !0 }), F(() => f.language, (e) => {
9784
+ e && _t(e);
9785
+ }, { immediate: !0 }), F(P.isChatEmpty, (e) => {
9786
+ e && p("chatEmpty");
9776
9787
  }), F([
9777
- () => p.chatUid,
9778
- () => p.client ? p.client.initialized.value : gu.initialized.value,
9779
- () => p.client ? p.client.loggedIn.value : gu.loggedIn.value,
9780
- () => D.value?.conversations.value.length ?? 0
9788
+ () => f.chatUid,
9789
+ () => f.client ? f.client.initialized.value : gu.initialized.value,
9790
+ () => f.client ? f.client.loggedIn.value : gu.loggedIn.value,
9791
+ () => T.value?.conversations.value.length ?? 0
9781
9792
  ], async ([e, t, n]) => {
9782
- !O.value || !e || !t || !n || !D.value || await H();
9793
+ !D.value || !e || !t || !n || !T.value || await ae();
9783
9794
  }, { immediate: !0 }), F([
9784
- () => L.messages.value.length,
9785
- () => L.threadMessages.value.length,
9795
+ () => P.messages.value.length,
9796
+ () => P.threadMessages.value.length,
9786
9797
  () => gu.scrollToMessageId.value
9787
9798
  ], async () => {
9788
- await V();
9799
+ await ie();
9789
9800
  });
9790
- async function H() {
9791
- let e = D.value;
9801
+ async function ae() {
9802
+ let e = T.value;
9792
9803
  if (e) {
9793
- C.value = !0, x.value = !1, T.value = !1;
9804
+ x.value = !0, v.value = !1, C.value = !1;
9794
9805
  try {
9795
9806
  e.conversations.value.length === 0 && await e.fetchConversations();
9796
- let t = e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null;
9807
+ let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
9797
9808
  if (!t) try {
9798
- t = await oe(p.chatUid, e);
9809
+ t = await se(f.chatUid, e);
9799
9810
  } catch (e) {
9800
9811
  if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
9801
- x.value = !1, T.value = !0, m("chatMembersFetched", []);
9812
+ v.value = !1, C.value = !0, p("chatMembersFetched", []);
9802
9813
  return;
9803
9814
  }
9804
9815
  }
9805
9816
  if (!t) {
9806
- x.value = !0, T.value = !1, m("chatMembersFetched", []);
9817
+ v.value = !0, C.value = !1, p("chatMembersFetched", []);
9807
9818
  return;
9808
9819
  }
9809
- e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await N(t.targetId);
9820
+ e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await M(t.targetId);
9810
9821
  } finally {
9811
- C.value = !1;
9822
+ x.value = !1;
9812
9823
  }
9813
9824
  }
9814
9825
  }
9815
- async function oe(e, t) {
9826
+ async function se(e, t) {
9816
9827
  let n = await gu.getGroup(e, !0);
9817
9828
  if (!n || typeof n != "object") return null;
9818
9829
  let r = String(n.getGuid());
@@ -9831,51 +9842,53 @@ var uf = { class: "w-full" }, df = {
9831
9842
  };
9832
9843
  return t.conversations.value = [i, ...t.conversations.value.filter((e) => e.id !== i.id && e.targetId !== r)], i;
9833
9844
  }
9834
- function U(e, t) {
9835
- m("linkClicked", e, t);
9845
+ function V(e, t) {
9846
+ p("linkClicked", e, t);
9836
9847
  }
9837
- let se = w(!1);
9848
+ let H = w(!1);
9838
9849
  b(() => {
9839
9850
  setTimeout(() => {
9840
- se.value = !0;
9851
+ H.value = !0;
9841
9852
  }, 200);
9842
9853
  }), y(() => {
9843
- let e = D.value;
9844
- e && e.activeConversation.value === A.value && e.selectConversation(null);
9854
+ let e = T.value;
9855
+ e && e.activeConversation.value === O.value && e.selectConversation(null);
9845
9856
  });
9846
- async function ce(e) {
9847
- return await new Promise((e) => setTimeout(e, 100)), se.value ? V(e) : (await new Promise((e) => setTimeout(e, 110)), ce(e));
9857
+ async function U(e) {
9858
+ return await new Promise((e) => setTimeout(e, 100)), H.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)), U(e));
9848
9859
  }
9849
- return o({
9850
- scrollToMessage: ce,
9851
- groupMembers: n(() => M.value)
9852
- }), (n, o) => (S(), a("div", {
9860
+ return r({
9861
+ scrollToMessage: U,
9862
+ groupMembers: n(() => A.value)
9863
+ }), (n, r) => (S(), a("div", {
9853
9864
  ref_key: "chatRootRef",
9854
- ref: v,
9865
+ ref: h,
9855
9866
  class: "text-default relative h-full min-h-104"
9856
9867
  }, [
9857
- O.value && D.value?.error.value ? (S(), r(j(ae), {
9868
+ D.value && T.value?.error.value ? E(n.$slots, "error-message", {
9858
9869
  key: 0,
9870
+ message: T.value.error.value
9871
+ }, () => [l(j(oe), {
9859
9872
  severity: "error",
9860
9873
  closable: !1,
9861
9874
  class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
9862
9875
  }, {
9863
- default: I(() => [c(k(D.value.error.value), 1)]),
9876
+ default: I(() => [c(k(T.value.error.value), 1)]),
9864
9877
  _: 1
9865
- })) : i("", !0),
9866
- D.value ? (S(), a(e, { key: 1 }, [
9878
+ })]) : i("", !0),
9879
+ T.value ? (S(), a(e, { key: 1 }, [
9867
9880
  l(lm, {
9868
9881
  target: "main",
9869
9882
  class: g(["h-full", t.containerClass]),
9870
9883
  "hide-group-actions": t.hideGroupActions,
9871
- "show-header": te.value,
9884
+ "show-header": L.value,
9872
9885
  "action-message-class": t.actionMessageClass,
9873
9886
  "action-message-row-class": t.actionMessageRowClass,
9874
- onAnchorclick: U
9887
+ onAnchorclick: V
9875
9888
  }, s({
9876
9889
  composer: I(() => [l(Zd, {
9877
9890
  ref_key: "mainComposerRef",
9878
- ref: ne,
9891
+ ref: z,
9879
9892
  target: "main"
9880
9893
  }, null, 512)]),
9881
9894
  _: 2
@@ -9891,12 +9904,12 @@ var uf = { class: "w-full" }, df = {
9891
9904
  "action-message-row-class"
9892
9905
  ]),
9893
9906
  l(ff, {
9894
- open: !!j(L).activeThreadParentMessage.value,
9895
- title: j(h)("threadWithCount", { count: j(L).activeThreadParentMessage.value?.replyCount ?? 0 }),
9896
- subtitle: A.value?.title ?? "",
9897
- "close-label": j(h)("close"),
9898
- "close-aria-label": j(h)("closeThread"),
9899
- onClose: o[0] ||= (e) => j(ie).emit("ui:closeThread")
9907
+ open: !!j(P).activeThreadParentMessage.value,
9908
+ title: j(m)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
9909
+ subtitle: O.value?.title ?? "",
9910
+ "close-label": j(m)("close"),
9911
+ "close-aria-label": j(m)("closeThread"),
9912
+ onClose: r[0] ||= (e) => j(re).emit("ui:closeThread")
9900
9913
  }, {
9901
9914
  default: I(() => [l(lm, {
9902
9915
  target: "thread",
@@ -9906,7 +9919,7 @@ var uf = { class: "w-full" }, df = {
9906
9919
  }, {
9907
9920
  composer: I(() => [l(Zd, {
9908
9921
  ref_key: "threadComposerRef",
9909
- ref: B,
9922
+ ref: ne,
9910
9923
  target: "thread"
9911
9924
  }, null, 512)]),
9912
9925
  _: 1
@@ -9920,14 +9933,14 @@ var uf = { class: "w-full" }, df = {
9920
9933
  "close-aria-label"
9921
9934
  ]),
9922
9935
  l(lh, {
9923
- open: j(z).showScheduledMessages.value,
9924
- loading: j(z).loadingScheduledMessages.value,
9925
- messages: j(z).scheduledMessages.value,
9926
- "conversation-title": A.value?.title,
9927
- onClose: o[1] ||= (e) => j(z).showScheduledMessages.value = !1,
9928
- onReschedule: o[2] ||= (e) => j(ie).emit("ui:reschedule", e),
9929
- onRemove: o[3] ||= (e) => j(ie).emit("ui:removeScheduled", e),
9930
- onEditText: o[4] ||= (e) => j(ie).emit("ui:editScheduledText", e)
9936
+ open: j(R).showScheduledMessages.value,
9937
+ loading: j(R).loadingScheduledMessages.value,
9938
+ messages: j(R).scheduledMessages.value,
9939
+ "conversation-title": O.value?.title,
9940
+ onClose: r[1] ||= (e) => j(R).showScheduledMessages.value = !1,
9941
+ onReschedule: r[2] ||= (e) => j(re).emit("ui:reschedule", e),
9942
+ onRemove: r[3] ||= (e) => j(re).emit("ui:removeScheduled", e),
9943
+ onEditText: r[4] ||= (e) => j(re).emit("ui:editScheduledText", e)
9931
9944
  }, null, 8, [
9932
9945
  "open",
9933
9946
  "loading",
@@ -9935,12 +9948,12 @@ var uf = { class: "w-full" }, df = {
9935
9948
  "conversation-title"
9936
9949
  ]),
9937
9950
  l(Bm, {
9938
- open: !!j(z).infoMessage.value,
9939
- message: j(z).infoMessage.value,
9940
- receipts: j(z).infoMessageReceipts.value,
9941
- loading: j(z).loadingMessageReceipts.value,
9942
- error: j(z).messageReceiptsError.value,
9943
- onClose: o[5] ||= (e) => j(z).closeMessageInfo()
9951
+ open: !!j(R).infoMessage.value,
9952
+ message: j(R).infoMessage.value,
9953
+ receipts: j(R).infoMessageReceipts.value,
9954
+ loading: j(R).loadingMessageReceipts.value,
9955
+ error: j(R).messageReceiptsError.value,
9956
+ onClose: r[5] ||= (e) => j(R).closeMessageInfo()
9944
9957
  }, null, 8, [
9945
9958
  "open",
9946
9959
  "message",
@@ -9950,21 +9963,21 @@ var uf = { class: "w-full" }, df = {
9950
9963
  ])
9951
9964
  ], 64)) : i("", !0),
9952
9965
  l(_h, {
9953
- visible: O.value && (D.value?.offlineMode.value || !D.value?.connected.value || C.value && !R.value || x.value || T.value || t.displayNoMessagesText && j(L).isChatEmpty.value),
9954
- "offline-mode": !!(D.value?.offlineMode.value && !A.value),
9955
- connected: !!(D.value?.connected.value || A.value),
9956
- loading: C.value,
9957
- "not-found": x.value,
9958
- "not-a-member": T.value,
9959
- "is-empty": j(L).isChatEmpty.value,
9966
+ visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || x.value && !te.value || v.value || C.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
9967
+ "offline-mode": !!(T.value?.offlineMode.value && !O.value),
9968
+ connected: !!(T.value?.connected.value || O.value),
9969
+ loading: x.value,
9970
+ "not-found": v.value,
9971
+ "not-a-member": C.value,
9972
+ "is-empty": j(P).isChatEmpty.value,
9960
9973
  "show-empty-slot": t.displayNoMessagesText,
9961
9974
  messages: {
9962
- waitingForNetwork: j(h)("waitingForNetwork"),
9963
- connecting: j(h)("connecting"),
9964
- loading: j(h)("loadingChat"),
9965
- notFound: j(h)("chatNotFound"),
9966
- noMessages: j(h)("noMessagesHaveBeenSentYet"),
9967
- notAMember: j(h)("chatNotAMember")
9975
+ waitingForNetwork: j(m)("waitingForNetwork"),
9976
+ connecting: j(m)("connecting"),
9977
+ loading: j(m)("loadingChat"),
9978
+ notFound: j(m)("chatNotFound"),
9979
+ noMessages: j(m)("noMessagesHaveBeenSentYet"),
9980
+ notAMember: j(m)("chatNotAMember")
9968
9981
  }
9969
9982
  }, s({ _: 2 }, [n.$slots["no-messages"] ? {
9970
9983
  name: "no-messages",