@bcc-code/vue-bcc-chat-ui 7.1.23 → 7.1.24

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 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 V, BccTag as se } from "@bcc-code/component-library-vue";
3
- import { CometChat as H } from "@cometchat/chat-sdk-javascript";
4
- import { AddIcon as ce, AttachFileIcon as le, BarChartIcon as U, 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";
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";
5
5
  //#region \0rolldown/runtime.js
6
- var W = Object.defineProperty, ze = (e, t) => {
6
+ var G = Object.defineProperty, Re = (e, t) => {
7
7
  let n = {};
8
- for (var r in e) W(n, r, {
8
+ for (var r in e) G(n, r, {
9
9
  get: e[r],
10
10
  enumerable: !0
11
11
  });
12
- return t || W(n, Symbol.toStringTag, { value: "Module" }), n;
13
- }, Be = {
12
+ return t || G(n, Symbol.toStringTag, { value: "Module" }), n;
13
+ }, ze = {
14
14
  prod: {
15
15
  region: "eu",
16
16
  appId: "2520339d45a9d557",
@@ -21,62 +21,62 @@ var W = Object.defineProperty, ze = (e, t) => {
21
21
  appId: "24847302853e129f",
22
22
  chatApiBaseUrl: "https://chat.api.sandbox.bcc.no"
23
23
  }
24
- }, Ve = null;
25
- function He(e) {
26
- Ve = e;
24
+ }, Be = null;
25
+ function Ve(e) {
26
+ Be = e;
27
27
  }
28
- function G() {
29
- if (!Ve) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
30
- return Be[Ve];
28
+ function K() {
29
+ if (!Be) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
30
+ return ze[Be];
31
31
  }
32
32
  //#endregion
33
33
  //#region src/chat/accessToken.ts
34
- var Ue = ":loginAccessToken", We = ":token", Ge = void 0;
35
- function Ke(e) {
36
- return `${G().appId}${e}`;
34
+ var He = ":loginAccessToken", Ue = ":token", We = void 0;
35
+ function Ge(e) {
36
+ return `${K().appId}${e}`;
37
37
  }
38
- function qe() {
39
- return Ge === void 0 && (Ge = localStorage.getItem(Ke(Ue))), Ge;
38
+ function Ke() {
39
+ return We === void 0 && (We = localStorage.getItem(Ge(He))), We;
40
40
  }
41
- function Je(e) {
42
- Ge = e;
43
- let t = Ke(Ue);
41
+ function qe(e) {
42
+ We = e;
43
+ let t = Ge(He);
44
44
  if (e) {
45
45
  localStorage.setItem(t, e);
46
46
  return;
47
47
  }
48
48
  localStorage.removeItem(t);
49
49
  }
50
- function Ye() {
51
- let e = Ke(We), t = localStorage.getItem(e);
50
+ function Je() {
51
+ let e = Ge(Ue), t = localStorage.getItem(e);
52
52
  return t ? JSON.parse(t) : null;
53
53
  }
54
- function Xe() {
55
- return Ye();
54
+ function Ye() {
55
+ return Je();
56
56
  }
57
- function Ze(e) {
58
- localStorage.setItem(Ke(We), JSON.stringify(e));
57
+ function Xe(e) {
58
+ localStorage.setItem(Ge(Ue), JSON.stringify(e));
59
59
  }
60
- function Qe() {
61
- localStorage.removeItem(Ke(We));
60
+ function Ze() {
61
+ localStorage.removeItem(Ge(Ue));
62
62
  }
63
63
  //#endregion
64
64
  //#region src/chat/avatar.ts
65
- function $e(e) {
66
- let t = tt(e);
65
+ function Qe(e) {
66
+ let t = et(e);
67
67
  if (!t) return;
68
68
  let n = t.trim();
69
69
  if (n) {
70
70
  try {
71
- if (nt(new URL(n))) return `${G().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
71
+ if (tt(new URL(n))) return `${K().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
72
72
  } catch {}
73
73
  return n;
74
74
  }
75
75
  }
76
- function et(e) {
77
- return $e(e) ?? e;
76
+ function $e(e) {
77
+ return Qe(e) ?? e;
78
78
  }
79
- function tt(e) {
79
+ function et(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 tt(e) {
94
94
  t.avatar,
95
95
  t.image
96
96
  ].find((e) => e && typeof e == "object");
97
- if (r) return tt(r);
97
+ if (r) return et(r);
98
98
  }
99
- function nt(e) {
100
- let { appId: t, region: n } = G(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
99
+ function tt(e) {
100
+ let { appId: t, region: n } = K(), 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 rt = ":chatCacheScope", it = ":chatCacheOwner", at, ot;
106
- function st(e) {
107
- return `${G().appId}${e}`;
105
+ var nt = ":chatCacheScope", rt = ":chatCacheOwner", it, at;
106
+ function ot(e) {
107
+ return `${K().appId}${e}`;
108
108
  }
109
- function ct() {
109
+ function st() {
110
110
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
111
111
  }
112
- function lt() {
113
- return at === void 0 && (at = localStorage.getItem(st(rt))), at;
112
+ function ct() {
113
+ return it === void 0 && (it = localStorage.getItem(ot(nt))), it;
114
114
  }
115
- function ut() {
116
- return ot === void 0 && (ot = localStorage.getItem(st(it))), ot;
115
+ function lt() {
116
+ return at === void 0 && (at = localStorage.getItem(ot(rt))), at;
117
117
  }
118
- function dt(e) {
119
- let t = lt(), n = ut();
118
+ function ut(e) {
119
+ let t = ct(), n = lt();
120
120
  if (t && n === e) return t;
121
- let r = ct();
122
- return at = r, ot = e, localStorage.setItem(st(rt), r), localStorage.setItem(st(it), e), r;
121
+ let r = st();
122
+ return it = r, at = e, localStorage.setItem(ot(nt), r), localStorage.setItem(ot(rt), e), r;
123
123
  }
124
124
  //#endregion
125
125
  //#region src/chat/localization.ts
126
- var ft = {
126
+ var dt = {
127
127
  en: {
128
128
  addOption: "Add option",
129
129
  addToMessage: "Add to message",
@@ -138,6 +138,7 @@ var ft = {
138
138
  bold: "Bold",
139
139
  cancel: "Cancel",
140
140
  chatNotFound: "Chat not found...",
141
+ chatNotAMember: "You are not a member of this chat.",
141
142
  close: "Close",
142
143
  closeMediaViewer: "Close media viewer",
143
144
  closeThread: "Close thread",
@@ -257,6 +258,7 @@ var ft = {
257
258
  bold: "Fet",
258
259
  cancel: "Avbryt",
259
260
  chatNotFound: "Fant ikke chatten...",
261
+ chatNotAMember: "Du er ikke medlem av denne chatten.",
260
262
  close: "Lukk",
261
263
  closeMediaViewer: "Lukk medievisning",
262
264
  closeThread: "Lukk tråd",
@@ -362,102 +364,102 @@ var ft = {
362
364
  you: "Du",
363
365
  youSentAMessage: "Du sendte en melding"
364
366
  }
365
- }, pt = w("en");
366
- function mt(e) {
367
+ }, ft = w("en");
368
+ function pt(e) {
367
369
  return e === "nb" || e === "no" ? "nb" : "en";
368
370
  }
369
- function ht(e) {
370
- return mt(e) === "nb" ? "nb-NO" : "en-US";
371
+ function mt(e) {
372
+ return pt(e) === "nb" ? "nb-NO" : "en-US";
371
373
  }
372
- function gt() {
374
+ function ht() {
373
375
  return "h23";
374
376
  }
375
- function _t(e) {
376
- pt.value = e;
377
+ function gt(e) {
378
+ ft.value = e;
377
379
  }
378
- function vt(e, t, n) {
379
- let r = ft[mt(n ?? pt.value)][e] ?? ft.en[e];
380
+ function _t(e, t, n) {
381
+ let r = dt[pt(n ?? ft.value)][e] ?? dt.en[e];
380
382
  return typeof r == "function" ? r(t ?? {}) : r;
381
383
  }
382
- function K(e) {
383
- let t = n(() => A(e) ?? pt.value);
384
+ function q(e) {
385
+ let t = n(() => A(e) ?? ft.value);
384
386
  return {
385
- locale: n(() => ht(t.value)),
386
- t: (e, n) => vt(e, n, t.value)
387
+ locale: n(() => mt(t.value)),
388
+ t: (e, n) => _t(e, n, t.value)
387
389
  };
388
390
  }
389
391
  //#endregion
390
392
  //#region src/chat/mentions.ts
391
- var yt = /<@uid:([^>]+)>/g, bt = /&lt;@uid:([^&]+)&gt;/g, xt = "mention:", St = "", Ct = "data-mention-uid", wt = "composer-mention", Tt = "message-mention";
392
- function Et(e) {
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
395
  return {
394
396
  uid: e.uid,
395
397
  displayName: e.displayName,
396
398
  avatar: e.avatar
397
399
  };
398
400
  }
399
- function Dt(e) {
401
+ function Et(e) {
400
402
  let t = {};
401
403
  for (let n of e) t[n.uid] = n.displayName;
402
404
  return t;
403
405
  }
404
- function Ot(e, t, n = 8) {
406
+ function Dt(e, t, n = 8) {
405
407
  let r = t.trim().toLowerCase(), i = e.filter((e) => e.displayName.trim().length > 0);
406
408
  return r ? i.filter((e) => {
407
409
  let t = e.displayName.toLowerCase(), n = e.uid.toLowerCase();
408
410
  return t.includes(r) || n.includes(r);
409
411
  }).slice(0, n) : i.slice(0, n);
410
412
  }
411
- function kt(e) {
413
+ function Ot(e) {
412
414
  return `<@uid:${e}>`;
413
415
  }
416
+ function kt(e) {
417
+ return e.replace(yt, (e, t) => Ot(t));
418
+ }
414
419
  function At(e) {
415
- return e.replace(bt, (e, t) => kt(t));
420
+ return vt.lastIndex = 0, yt.lastIndex = 0, vt.test(e) || yt.test(e);
416
421
  }
417
422
  function jt(e) {
418
- return yt.lastIndex = 0, bt.lastIndex = 0, yt.test(e) || bt.test(e);
419
- }
420
- function Mt(e) {
421
423
  let t = [];
422
424
  return {
423
- shielded: At(e).replace(yt, (e) => `${xt}${t.push(e) - 1}${St}`),
425
+ shielded: kt(e).replace(vt, (e) => `${bt}${t.push(e) - 1}${xt}`),
424
426
  tokens: t
425
427
  };
426
428
  }
427
- function Nt(e, t) {
428
- let n = RegExp(`${xt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${St.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
429
+ function Mt(e, t) {
430
+ let n = RegExp(`${bt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${xt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
429
431
  return e.replace(n, (e, n) => t[Number(n)] ?? "");
430
432
  }
431
- function Pt(e, t, n = Tt) {
432
- return e.replace(yt, (e, r) => {
433
+ function Nt(e, t, n = wt) {
434
+ return e.replace(vt, (e, r) => {
433
435
  let i = t(r).trim() || r;
434
- return `<span class="${n}" ${Ct}="${Wt(r)}">@${Gt(i)}</span>`;
436
+ return `<span class="${n}" ${St}="${Ut(r)}">@${Wt(i)}</span>`;
435
437
  });
436
438
  }
437
- function Ft(e, t = {}) {
438
- return Pt(e, (e) => t[e] ?? e, wt);
439
+ function Pt(e, t = {}) {
440
+ return Nt(e, (e) => t[e] ?? e, Ct);
439
441
  }
440
- function It(e, t = {}) {
441
- return Pt(e, (e) => t[e] ?? e, Tt);
442
+ function Ft(e, t = {}) {
443
+ return Nt(e, (e) => t[e] ?? e, wt);
442
444
  }
443
- function Lt(e) {
445
+ function It(e) {
444
446
  if (!e) return "";
445
447
  let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
446
448
  if (!n) return e;
447
- for (let e of [...n.querySelectorAll(`span[${Ct}]`)]) {
448
- let n = e.getAttribute(Ct);
449
- n && e.replaceWith(t.createTextNode(kt(n)));
449
+ for (let e of [...n.querySelectorAll(`span[${St}]`)]) {
450
+ let n = e.getAttribute(St);
451
+ n && e.replaceWith(t.createTextNode(Ot(n)));
450
452
  }
451
- return Rt(n.innerHTML);
453
+ return Lt(n.innerHTML);
452
454
  }
453
- function Rt(e) {
455
+ function Lt(e) {
454
456
  return e.replace(/&lt;@uid:([^&]+)&gt;/g, "<@uid:$1>");
455
457
  }
456
- var zt = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
457
- function Bt(e, t, n = "member") {
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
460
  return t[e]?.trim() || n;
459
461
  }
460
- function Vt(e) {
462
+ function Bt(e) {
461
463
  let t = {};
462
464
  for (let n of e?.getMentionedUsers?.() ?? []) {
463
465
  let e = n.getUid?.(), r = n.getName?.()?.trim();
@@ -465,31 +467,31 @@ function Vt(e) {
465
467
  }
466
468
  return t;
467
469
  }
468
- function Ht(...e) {
470
+ function Vt(...e) {
469
471
  let t = {};
470
472
  for (let n of e) Object.assign(t, n);
471
473
  return t;
472
474
  }
473
- function Ut(e, t = {}) {
474
- return At(e).replace(yt, (e, n) => `@${Bt(n, t)}`).replace(zt, (e, n) => `@${Bt(n, t)}`);
475
+ function Ht(e, t = {}) {
476
+ return kt(e).replace(vt, (e, n) => `@${zt(n, t)}`).replace(Rt, (e, n) => `@${zt(n, t)}`);
475
477
  }
476
- function Wt(e) {
478
+ function Ut(e) {
477
479
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
478
480
  }
479
- function Gt(e) {
481
+ function Wt(e) {
480
482
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
481
483
  }
482
484
  //#endregion
483
485
  //#region node_modules/dompurify/dist/purify.es.mjs
484
- function Kt(e, t) {
486
+ function Gt(e, t) {
485
487
  (t == null || t > e.length) && (t = e.length);
486
488
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
487
489
  return r;
488
490
  }
489
- function qt(e) {
491
+ function Kt(e) {
490
492
  if (Array.isArray(e)) return e;
491
493
  }
492
- function Jt(e, t) {
494
+ function qt(e, t) {
493
495
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
494
496
  if (n != null) {
495
497
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -507,99 +509,99 @@ function Jt(e, t) {
507
509
  return s;
508
510
  }
509
511
  }
510
- function Yt() {
512
+ function Jt() {
511
513
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
512
514
  }
513
- function Xt(e, t) {
514
- return qt(e) || Jt(e, t) || Zt(e, t) || Yt();
515
+ function Yt(e, t) {
516
+ return Kt(e) || qt(e, t) || Xt(e, t) || Jt();
515
517
  }
516
- function Zt(e, t) {
518
+ function Xt(e, t) {
517
519
  if (e) {
518
- if (typeof e == "string") return Kt(e, t);
520
+ if (typeof e == "string") return Gt(e, t);
519
521
  var n = {}.toString.call(e).slice(8, -1);
520
- 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;
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;
521
523
  }
522
524
  }
523
- 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;
524
- rn ||= function(e) {
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
527
  return e;
526
- }, an ||= function(e) {
528
+ }, rn ||= function(e) {
527
529
  return e;
528
- }, cn ||= function(e, t) {
530
+ }, sn ||= function(e, t) {
529
531
  var n = [...arguments].slice(2);
530
532
  return e.apply(t, n);
531
- }, ln ||= function(e) {
533
+ }, cn ||= function(e) {
532
534
  return new e(...[...arguments].slice(1));
533
535
  };
534
- 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);
535
- function J(e) {
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
538
  return function(t) {
537
539
  t instanceof RegExp && (t.lastIndex = 0);
538
540
  var n = [...arguments].slice(1);
539
- return cn(e, t, n);
541
+ return sn(e, t, n);
540
542
  };
541
543
  }
542
544
  function kn(e) {
543
545
  return function() {
544
- return ln(e, [...arguments]);
546
+ return cn(e, [...arguments]);
545
547
  };
546
548
  }
547
549
  function Y(e, t) {
548
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gn;
549
- if ($t && $t(e, null), !hn(t)) return e;
550
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : hn;
551
+ if (Qt && Qt(e, null), !mn(t)) return e;
550
552
  let r = t.length;
551
553
  for (; r--;) {
552
554
  let i = t[r];
553
555
  if (typeof i == "string") {
554
556
  let e = n(i);
555
- e !== i && (en(t) || (t[r] = e), i = e);
557
+ e !== i && ($t(t) || (t[r] = e), i = e);
556
558
  }
557
559
  e[i] = !0;
558
560
  }
559
561
  return e;
560
562
  }
561
563
  function An(e) {
562
- for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
564
+ for (let t = 0; t < e.length; t++) J(e, t) || (e[t] = null);
563
565
  return e;
564
566
  }
565
567
  function jn(e) {
566
- let t = on(null);
567
- for (let r of Qt(e)) {
568
- var n = Xt(r, 2);
568
+ let t = an(null);
569
+ for (let r of Zt(e)) {
570
+ var n = Yt(r, 2);
569
571
  let i = n[0], a = n[1];
570
- q(e, i) && (hn(a) ? t[i] = An(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = jn(a) : t[i] = a);
572
+ J(e, i) && (mn(a) ? t[i] = An(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = jn(a) : t[i] = a);
571
573
  }
572
574
  return t;
573
575
  }
574
576
  function Mn(e) {
575
577
  switch (typeof e) {
576
578
  case "string": return e;
577
- case "number": return Sn(e);
578
- case "boolean": return Cn(e);
579
- case "bigint": return wn ? wn(e) : "0";
580
- case "symbol": return Tn ? Tn(e) : "Symbol()";
581
- case "undefined": return En(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);
582
584
  case "function":
583
585
  case "object": {
584
- if (e === null) return En(e);
586
+ if (e === null) return Tn(e);
585
587
  let t = e, n = Nn(t, "toString");
586
588
  if (typeof n == "function") {
587
589
  let e = n(t);
588
- return typeof e == "string" ? e : En(e);
590
+ return typeof e == "string" ? e : Tn(e);
589
591
  }
590
- return En(e);
592
+ return Tn(e);
591
593
  }
592
- default: return En(e);
594
+ default: return Tn(e);
593
595
  }
594
596
  }
595
597
  function Nn(e, t) {
596
598
  for (; e !== null;) {
597
- let n = nn(e, t);
599
+ let n = tn(e, t);
598
600
  if (n) {
599
- if (n.get) return J(n.get);
600
- if (typeof n.value == "function") return J(n.value);
601
+ if (n.get) return On(n.get);
602
+ if (typeof n.value == "function") return On(n.value);
601
603
  }
602
- e = tn(e);
604
+ e = en(e);
603
605
  }
604
606
  function n() {
605
607
  return null;
@@ -608,12 +610,12 @@ function Nn(e, t) {
608
610
  }
609
611
  function Pn(e) {
610
612
  try {
611
- return Dn(e, ""), !0;
613
+ return En(e, ""), !0;
612
614
  } catch {
613
615
  return !1;
614
616
  }
615
617
  }
616
- 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([
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([
617
619
  "feBlend",
618
620
  "feColorMatrix",
619
621
  "feComponentTransfer",
@@ -639,7 +641,7 @@ var Fn = rn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
639
641
  "feSpotLight",
640
642
  "feTile",
641
643
  "feTurbulence"
642
- ]), Rn = rn([
644
+ ]), Rn = nn([
643
645
  "animate",
644
646
  "color-profile",
645
647
  "cursor",
@@ -662,7 +664,7 @@ var Fn = rn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
662
664
  "solidcolor",
663
665
  "unknown",
664
666
  "use"
665
- ]), 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([
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([
666
668
  "maction",
667
669
  "maligngroup",
668
670
  "malignmark",
@@ -678,13 +680,13 @@ var Fn = rn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
678
680
  "annotation-xml",
679
681
  "mprescripts",
680
682
  "none"
681
- ]), 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([
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([
682
684
  "xlink:href",
683
685
  "xml:id",
684
686
  "xlink:title",
685
687
  "xml:space",
686
688
  "xmlns:xlink"
687
- ]), 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 = {
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 = {
688
690
  element: 1,
689
691
  text: 3,
690
692
  progressingInstruction: 7,
@@ -731,8 +733,8 @@ function or() {
731
733
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
732
734
  }
733
735
  let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = ar();
734
- t.isSupported = typeof Qt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
735
- let A = Kn, j = qn, M = Jn, ee = Yn, N = Xn, P = Qn, F = $n, I = tr, te = Zn, L = null, R = Y({}, [
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
738
  ...Fn,
737
739
  ...In,
738
740
  ...Ln,
@@ -743,7 +745,7 @@ function or() {
743
745
  ...Un,
744
746
  ...Wn,
745
747
  ...Gn
746
- ]), B = Object.seal(on(null, {
748
+ ]), B = Object.seal(an(null, {
747
749
  tagNameCheck: {
748
750
  writable: !0,
749
751
  configurable: !1,
@@ -762,7 +764,7 @@ function or() {
762
764
  enumerable: !0,
763
765
  value: !1
764
766
  }
765
- })), re = null, ie = null, ae = Object.seal(on(null, {
767
+ })), re = null, ie = null, V = Object.seal(an(null, {
766
768
  tagCheck: {
767
769
  writable: !0,
768
770
  configurable: !1,
@@ -775,7 +777,7 @@ function or() {
775
777
  enumerable: !0,
776
778
  value: null
777
779
  }
778
- })), oe = !0, V = !0, se = !1, H = !0, ce = !1, le = !0, U = !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({}, [
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({}, [
779
781
  "annotation-xml",
780
782
  "audio",
781
783
  "colgroup",
@@ -801,14 +803,14 @@ function or() {
801
803
  "title",
802
804
  "video",
803
805
  "xmp"
804
- ]), Ce = null, we = Y({}, [
806
+ ]), Se = null, Ce = Y({}, [
805
807
  "audio",
806
808
  "video",
807
809
  "img",
808
810
  "source",
809
811
  "image",
810
812
  "track"
811
- ]), Te = null, Ee = Y({}, [
813
+ ]), we = null, Te = Y({}, [
812
814
  "alt",
813
815
  "class",
814
816
  "for",
@@ -823,125 +825,125 @@ function or() {
823
825
  "value",
824
826
  "style",
825
827
  "xmlns"
826
- ]), 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({}, [
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,
827
830
  De,
828
- Oe,
829
- ke
830
- ], _n), Pe = Y({}, [
831
+ Oe
832
+ ], gn), Ne = Y({}, [
831
833
  "mi",
832
834
  "mo",
833
835
  "mn",
834
836
  "ms",
835
837
  "mtext"
836
- ]), Fe = Y({}, ["annotation-xml"]), Ie = Y({}, [
838
+ ]), Pe = Y({}, ["annotation-xml"]), Fe = Y({}, [
837
839
  "title",
838
840
  "style",
839
841
  "font",
840
842
  "a",
841
843
  "script"
842
- ]), Le = null, Re = ["application/xhtml+xml", "text/html"], W = null, ze = null, Be = n.createElement("form"), Ve = function(e) {
844
+ ]), Ie = null, Le = ["application/xhtml+xml", "text/html"], G = null, Re = null, ze = n.createElement("form"), Be = function(e) {
843
845
  return e instanceof RegExp || e instanceof Function;
844
- }, He = function() {
846
+ }, Ve = function() {
845
847
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
846
- if (ze && ze === e) return;
847
- (!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, V = e.ALLOW_DATA_ATTR !== !1, se = e.ALLOW_UNKNOWN_PROTOCOLS || !1, H = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ce = e.SAFE_FOR_TEMPLATES || !1, le = e.SAFE_FOR_XML !== !1, U = 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({}, [
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
850
  "mi",
849
851
  "mo",
850
852
  "mn",
851
853
  "ms",
852
854
  "mtext"
853
- ]), Fe = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? jn(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
854
- let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? jn(e.CUSTOM_ELEMENT_HANDLING) : on(null);
855
- 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), ce && (V = !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), U && Y(L, [
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, [
856
858
  "html",
857
859
  "head",
858
860
  "body"
859
- ]), L.table && (Y(L, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
860
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw On("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
861
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw On("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
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.");
862
864
  x = e.TRUSTED_TYPES_POLICY, S = x.createHTML("");
863
865
  } else x === void 0 && (x = ir(m, i)), x !== null && typeof S == "string" && (S = x.createHTML(""));
864
- rn && rn(e), ze = e;
865
- }, G = Y({}, [
866
+ nn && nn(e), Re = e;
867
+ }, K = Y({}, [
866
868
  ...In,
867
869
  ...Ln,
868
870
  ...Rn
869
- ]), Ue = Y({}, [...zn, ...Bn]), We = function(e) {
871
+ ]), He = Y({}, [...zn, ...Bn]), Ue = function(e) {
870
872
  let t = b(e);
871
873
  (!t || !t.tagName) && (t = {
872
- namespaceURI: Ae,
874
+ namespaceURI: ke,
873
875
  tagName: "template"
874
876
  });
875
- let n = gn(e.tagName), r = gn(t.tagName);
876
- 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;
877
- }, Ge = function(e) {
878
- pn(t.removed, { element: e });
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 });
879
881
  try {
880
882
  b(e).removeChild(e);
881
883
  } catch {
882
884
  _(e);
883
885
  }
884
- }, Ke = function(e, n) {
886
+ }, Ge = function(e, n) {
885
887
  try {
886
- pn(t.removed, {
888
+ fn(t.removed, {
887
889
  attribute: n.getAttributeNode(e),
888
890
  from: n
889
891
  });
890
892
  } catch {
891
- pn(t.removed, {
893
+ fn(t.removed, {
892
894
  attribute: null,
893
895
  from: n
894
896
  });
895
897
  }
896
- if (n.removeAttribute(e), e === "is") if (fe || pe) try {
897
- Ge(n);
898
+ if (n.removeAttribute(e), e === "is") if (de || fe) try {
899
+ We(n);
898
900
  } catch {}
899
901
  else try {
900
902
  n.setAttribute(e, "");
901
903
  } catch {}
902
- }, qe = function(e) {
904
+ }, Ke = function(e) {
903
905
  let t = null, r = null;
904
- if (de) e = "<remove></remove>" + e;
906
+ if (ue) e = "<remove></remove>" + e;
905
907
  else {
906
- let t = vn(e, /^[\r\n\t ]+/);
908
+ let t = _n(e, /^[\r\n\t ]+/);
907
909
  r = t && t[0];
908
910
  }
909
- Le === "application/xhtml+xml" && Ae === ke && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
911
+ Ie === "application/xhtml+xml" && ke === Oe && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
910
912
  let i = x ? x.createHTML(e) : e;
911
- if (Ae === ke) try {
912
- t = new p().parseFromString(i, Le);
913
+ if (ke === Oe) try {
914
+ t = new p().parseFromString(i, Ie);
913
915
  } catch {}
914
916
  if (!t || !t.documentElement) {
915
- t = w.createDocument(Ae, "template", null);
917
+ t = w.createDocument(ke, "template", null);
916
918
  try {
917
- t.documentElement.innerHTML = je ? S : i;
919
+ t.documentElement.innerHTML = Ae ? S : i;
918
920
  } catch {}
919
921
  }
920
922
  let a = t.body || t.documentElement;
921
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ae === ke ? D.call(t, U ? "html" : "body")[0] : U ? t.documentElement : a;
922
- }, Je = function(e) {
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) {
923
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);
924
- }, Ye = function(e) {
926
+ }, Je = function(e) {
925
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");
926
- }, Xe = function(e) {
928
+ }, Ye = function(e) {
927
929
  return typeof s == "function" && e instanceof s;
928
930
  };
929
- function Ze(e, n, r) {
930
- un(e, (e) => {
931
- e.call(t, n, r, ze);
931
+ function Xe(e, n, r) {
932
+ ln(e, (e) => {
933
+ e.call(t, n, r, Re);
932
934
  });
933
935
  }
934
- let Qe = function(e) {
936
+ let Ze = function(e) {
935
937
  let n = null;
936
- if (Ze(k.beforeSanitizeElements, e, null), Ye(e)) return Ge(e), !0;
937
- let r = W(e.nodeName);
938
- if (Ze(k.uponSanitizeElement, e, {
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, {
939
941
  tagName: r,
940
- allowedTags: L
941
- }), le && e.hasChildNodes() && !Xe(e.firstElementChild) && Dn(/<[/\w!]/g, e.innerHTML) && Dn(/<[/\w!]/g, e.textContent) || le && e.namespaceURI === ke && r === "style" && Xe(e.firstElementChild) || e.nodeType === nr.progressingInstruction || le && e.nodeType === nr.comment && Dn(/<[/\w]/g, e.data)) return Ge(e), !0;
942
- if (re[r] || !(ae.tagCheck instanceof Function && ae.tagCheck(r)) && !L[r]) {
943
- if (!re[r] && tt(r) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
944
- if (ve && !xe[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]) {
945
947
  let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
946
948
  if (n && t) {
947
949
  let r = n.length;
@@ -951,25 +953,25 @@ function or() {
951
953
  }
952
954
  }
953
955
  }
954
- return Ge(e), !0;
956
+ return We(e), !0;
955
957
  }
956
- return e instanceof c && !We(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Dn(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ge(e), !0) : (ce && e.nodeType === nr.text && (n = e.textContent, un([
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([
957
959
  A,
958
960
  j,
959
961
  M
960
962
  ], (e) => {
961
- n = yn(n, e, " ");
962
- }), e.textContent !== n && (pn(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ze(k.afterSanitizeElements, e, null), !1);
963
- }, $e = function(e, t, r) {
964
- if (ie[t] || he && (t === "id" || t === "name") && (r in n || r in Be)) return !1;
965
- let i = z[t] || ae.attributeCheck instanceof Function && ae.attributeCheck(t, e);
966
- if (!(V && !ie[t] && Dn(ee, t)) && !(oe && Dn(N, t))) {
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))) {
967
969
  if (!i || ie[t]) {
968
- 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;
969
- } else if (!Te[t] && !Dn(te, yn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && bn(r, "data:") === 0 && Ce[e]) && !(se && !Dn(P, yn(r, F, ""))) && r) return !1;
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
972
  }
971
973
  return !0;
972
- }, et = Y({}, [
974
+ }, $e = Y({}, [
973
975
  "annotation-xml",
974
976
  "color-profile",
975
977
  "font-face",
@@ -978,12 +980,12 @@ function or() {
978
980
  "font-face-src",
979
981
  "font-face-uri",
980
982
  "missing-glyph"
981
- ]), tt = function(e) {
982
- return !et[gn(e)] && Dn(I, e);
983
- }, nt = function(e) {
984
- Ze(k.beforeSanitizeAttributes, e, null);
983
+ ]), et = function(e) {
984
+ return !$e[hn(e)] && En(I, e);
985
+ }, tt = function(e) {
986
+ Xe(k.beforeSanitizeAttributes, e, null);
985
987
  let n = e.attributes;
986
- if (!n || Ye(e)) return;
988
+ if (!n || Je(e)) return;
987
989
  let r = {
988
990
  attrName: "",
989
991
  attrValue: "",
@@ -992,34 +994,34 @@ function or() {
992
994
  forceKeepAttr: void 0
993
995
  }, i = n.length;
994
996
  for (; i--;) {
995
- let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = W(o), u = c, d = o === "value" ? u : xn(u);
996
- 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), le && Dn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
997
- Ke(o, e);
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);
998
1000
  continue;
999
1001
  }
1000
- if (l === "attributename" && vn(d, "href")) {
1001
- Ke(o, e);
1002
+ if (l === "attributename" && _n(d, "href")) {
1003
+ Ge(o, e);
1002
1004
  continue;
1003
1005
  }
1004
1006
  if (r.forceKeepAttr) continue;
1005
1007
  if (!r.keepAttr) {
1006
- Ke(o, e);
1008
+ Ge(o, e);
1007
1009
  continue;
1008
1010
  }
1009
- if (!H && Dn(/\/>/i, d)) {
1010
- Ke(o, e);
1011
+ if (!U && En(/\/>/i, d)) {
1012
+ Ge(o, e);
1011
1013
  continue;
1012
1014
  }
1013
- ce && un([
1015
+ se && ln([
1014
1016
  A,
1015
1017
  j,
1016
1018
  M
1017
1019
  ], (e) => {
1018
- d = yn(d, e, " ");
1020
+ d = vn(d, e, " ");
1019
1021
  });
1020
- let f = W(e.nodeName);
1021
- if (!$e(f, l, d)) {
1022
- Ke(o, e);
1022
+ let f = G(e.nodeName);
1023
+ if (!Qe(f, l, d)) {
1024
+ Ge(o, e);
1023
1025
  continue;
1024
1026
  }
1025
1027
  if (x && typeof m == "object" && typeof m.getAttributeType == "function" && !s) switch (m.getAttributeType(f, l)) {
@@ -1031,87 +1033,87 @@ function or() {
1031
1033
  break;
1032
1034
  }
1033
1035
  if (d !== u) try {
1034
- s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), Ye(e) ? Ge(e) : fn(t.removed);
1036
+ s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), Je(e) ? We(e) : dn(t.removed);
1035
1037
  } catch {
1036
- Ke(o, e);
1038
+ Ge(o, e);
1037
1039
  }
1038
1040
  }
1039
- Ze(k.afterSanitizeAttributes, e, null);
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);
1040
1046
  }, rt = function(e) {
1041
- let t = null, n = Je(e);
1042
- 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);
1043
- Ze(k.afterSanitizeShadowDOM, e, null);
1044
- }, it = function(e) {
1045
1047
  if (e.nodeType === nr.element && e.shadowRoot instanceof a) {
1046
1048
  let t = e.shadowRoot;
1047
- it(t), rt(t);
1049
+ rt(t), nt(t);
1048
1050
  }
1049
1051
  let t = e.childNodes;
1050
1052
  if (!t) return;
1051
1053
  let n = [];
1052
- un(t, (e) => {
1053
- pn(n, e);
1054
+ ln(t, (e) => {
1055
+ fn(n, e);
1054
1056
  });
1055
- for (let e of n) it(e);
1057
+ for (let e of n) rt(e);
1056
1058
  };
1057
1059
  return t.sanitize = function(e) {
1058
1060
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
1059
- if (je = !e, je && (e = "<!-->"), typeof e != "string" && !Xe(e) && (e = Mn(e), typeof e != "string")) throw On("dirty is not a string, aborting");
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");
1060
1062
  if (!t.isSupported) return e;
1061
- if (ue || He(n), t.removed = [], typeof e == "string" && (ye = !1), ye) {
1063
+ if (le || Ve(n), t.removed = [], typeof e == "string" && (ve = !1), ve) {
1062
1064
  let t = e.nodeName;
1063
1065
  if (typeof t == "string") {
1064
- let e = W(t);
1065
- if (!L[e] || re[e]) throw On("root node is forbidden and cannot be sanitized in-place");
1066
+ let e = G(t);
1067
+ if (!R[e] || re[e]) throw Dn("root node is forbidden and cannot be sanitized in-place");
1066
1068
  }
1067
- it(e);
1068
- } 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);
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
1071
  else {
1070
- if (!fe && !ce && !U && e.indexOf("<") === -1) return x && me ? x.createHTML(e) : e;
1071
- if (i = qe(e), !i) return fe ? null : me ? S : "";
1072
- }
1073
- i && de && Ge(i.firstChild);
1074
- let u = Je(ye ? e : i);
1075
- for (; c = u.nextNode();) Qe(c), nt(c), c.content instanceof a && rt(c.content);
1076
- if (ye) return e;
1077
- if (fe) {
1078
- if (ce) {
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) {
1079
1081
  i.normalize();
1080
1082
  let e = i.innerHTML;
1081
- un([
1083
+ ln([
1082
1084
  A,
1083
1085
  j,
1084
1086
  M
1085
1087
  ], (t) => {
1086
- e = yn(e, t, " ");
1088
+ e = vn(e, t, " ");
1087
1089
  }), i.innerHTML = e;
1088
1090
  }
1089
- if (pe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
1091
+ if (fe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
1090
1092
  else l = i;
1091
1093
  return (z.shadowroot || z.shadowrootmode) && (l = O.call(r, l, !0)), l;
1092
1094
  }
1093
- let d = U ? i.outerHTML : i.innerHTML;
1094
- return U && 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), ce && un([
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
1097
  A,
1096
1098
  j,
1097
1099
  M
1098
1100
  ], (e) => {
1099
- d = yn(d, e, " ");
1100
- }), x && me ? x.createHTML(d) : d;
1101
+ d = vn(d, e, " ");
1102
+ }), x && pe ? x.createHTML(d) : d;
1101
1103
  }, t.setConfig = function() {
1102
- He(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), ue = !0;
1104
+ Ve(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), le = !0;
1103
1105
  }, t.clearConfig = function() {
1104
- ze = null, ue = !1;
1106
+ Re = null, le = !1;
1105
1107
  }, t.isValidAttribute = function(e, t, n) {
1106
- return ze || He({}), $e(W(e), W(t), n);
1108
+ return Re || Ve({}), Qe(G(e), G(t), n);
1107
1109
  }, t.addHook = function(e, t) {
1108
- typeof t == "function" && pn(k[e], t);
1110
+ typeof t == "function" && fn(k[e], t);
1109
1111
  }, t.removeHook = function(e, t) {
1110
1112
  if (t !== void 0) {
1111
- let n = dn(k[e], t);
1112
- return n === -1 ? void 0 : mn(k[e], n, 1)[0];
1113
+ let n = un(k[e], t);
1114
+ return n === -1 ? void 0 : pn(k[e], n, 1)[0];
1113
1115
  }
1114
- return fn(k[e]);
1116
+ return dn(k[e]);
1115
1117
  }, t.removeHooks = function(e) {
1116
1118
  k[e] = [];
1117
1119
  }, t.removeAllHooks = function() {
@@ -1317,12 +1319,12 @@ hr.prototype.parse = function(e, t) {
1317
1319
  };
1318
1320
  //#endregion
1319
1321
  //#region node_modules/mdurl/index.mjs
1320
- var Dr = /* @__PURE__ */ ze({
1322
+ var Dr = /* @__PURE__ */ Re({
1321
1323
  decode: () => ur,
1322
1324
  encode: () => pr,
1323
1325
  format: () => mr,
1324
1326
  parse: () => Er
1325
- }), 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({
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({
1326
1328
  Any: () => Or,
1327
1329
  Cc: () => kr,
1328
1330
  Cf: () => Ar,
@@ -1517,7 +1519,7 @@ function $r(e, t = Jr.Legacy) {
1517
1519
  }
1518
1520
  //#endregion
1519
1521
  //#region node_modules/markdown-it/lib/common/utils.mjs
1520
- var ei = /* @__PURE__ */ ze({
1522
+ var ei = /* @__PURE__ */ Re({
1521
1523
  arrayReplaceAt: () => oi,
1522
1524
  assign: () => ai,
1523
1525
  escapeHtml: () => yi,
@@ -1752,7 +1754,7 @@ function ki(e, t, n, r) {
1752
1754
  }
1753
1755
  //#endregion
1754
1756
  //#region node_modules/markdown-it/lib/helpers/index.mjs
1755
- var Ai = /* @__PURE__ */ ze({
1757
+ var Ai = /* @__PURE__ */ Re({
1756
1758
  parseLinkDestination: () => Oi,
1757
1759
  parseLinkLabel: () => Di,
1758
1760
  parseLinkTitle: () => ki
@@ -3733,7 +3735,7 @@ var hs = new ms({
3733
3735
  "href",
3734
3736
  "target",
3735
3737
  "rel",
3736
- Ct,
3738
+ St,
3737
3739
  "class"
3738
3740
  ], vs = [
3739
3741
  "br",
@@ -3747,8 +3749,8 @@ var hs = new ms({
3747
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 = /[),.!?;:]+$/;
3748
3750
  function Es(e) {
3749
3751
  if (!e) return "";
3750
- let { shielded: t, tokens: n } = Mt(e), r = t.replace(/\r\n?/g, "\n").replace(xs, "<br>").replace(bs, "").replace(Ss, " ");
3751
- return Nt(sr.sanitize(r, {
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
3754
  ALLOWED_TAGS: vs,
3753
3755
  ALLOWED_ATTR: _s,
3754
3756
  ALLOW_DATA_ATTR: !1
@@ -3756,12 +3758,12 @@ function Es(e) {
3756
3758
  }
3757
3759
  function Ds(e, t) {
3758
3760
  if (!e) return "";
3759
- let n = Ut(At(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(ys, (e) => e.startsWith("</") ? "\n" : "");
3761
+ let n = Ht(kt(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(ys, (e) => e.startsWith("</") ? "\n" : "");
3760
3762
  return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").replace(/\n{3,}/g, "\n\n").trim();
3761
3763
  }
3762
3764
  function Os(e, t) {
3763
3765
  if (!e) return "";
3764
- let n = At(e), r = Es(jt(n) ? It(n, t?.mentionNameByUid ?? {}) : n);
3766
+ let n = kt(e), r = Es(At(n) ? Ft(n, t?.mentionNameByUid ?? {}) : n);
3765
3767
  if (!r) return "";
3766
3768
  let i = hs.render(Ps(r));
3767
3769
  return sr.sanitize(i, {
@@ -3786,7 +3788,7 @@ function Ms(e) {
3786
3788
  return e.replace(/\n{2,}/g, (e) => "\n" + "<br>".repeat(e.length - 1));
3787
3789
  }
3788
3790
  function Ns(e, t) {
3789
- return e.replace(yt, (e, n) => `<span class="${Tt}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
3791
+ return e.replace(vt, (e, n) => `<span class="${wt}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
3790
3792
  }
3791
3793
  function Ps(e) {
3792
3794
  let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
@@ -3836,23 +3838,23 @@ function Ls(e) {
3836
3838
  function Rs(e, t) {
3837
3839
  if (!e) return t;
3838
3840
  switch (e.kind) {
3839
- case "image": return vt("photo");
3840
- case "video": return vt("video");
3841
- case "audio": return vt("audio");
3841
+ case "image": return _t("photo");
3842
+ case "video": return _t("video");
3843
+ case "audio": return _t("audio");
3842
3844
  case "file": return e.name || t;
3843
3845
  default: return t;
3844
3846
  }
3845
3847
  }
3846
- function zs(e, t = vt("attachment")) {
3848
+ function zs(e, t = _t("attachment")) {
3847
3849
  return Rs(e[0], t);
3848
3850
  }
3849
3851
  function Bs(e, t) {
3850
- let n = At(e ?? "");
3851
- return n ? jt(n) && t ? Es(Ft(n, t)) : Es(n) : "";
3852
+ let n = kt(e ?? "");
3853
+ return n ? At(n) && t ? Es(Pt(n, t)) : Es(n) : "";
3852
3854
  }
3853
3855
  function Vs(e) {
3854
3856
  let t = Es(e);
3855
- return t ? Lt(t) : "";
3857
+ return t ? It(t) : "";
3856
3858
  }
3857
3859
  function Hs(e) {
3858
3860
  return Ds(e).length > 0;
@@ -3860,26 +3862,26 @@ function Hs(e) {
3860
3862
  function Us(e, t) {
3861
3863
  return Ds(e, t);
3862
3864
  }
3863
- function Ws(e, t = vt("message"), n) {
3865
+ function Ws(e, t = _t("message"), n) {
3864
3866
  if (e.kind === "poll" && e.poll) return e.poll.question;
3865
3867
  let r = Us(e.text, n);
3866
3868
  return e.attachments.length > 0 ? r || zs(e.attachments, t) : r || t;
3867
3869
  }
3868
3870
  function Gs(e, t = {}) {
3869
- return Ut(e, t);
3871
+ return Ht(e, t);
3870
3872
  }
3871
3873
  function Ks(e) {
3872
- return e.source?.getText?.() || At(e.text);
3874
+ return e.source?.getText?.() || kt(e.text);
3873
3875
  }
3874
3876
  function qs(e, t = !1, n = !0) {
3875
3877
  if (!e) return "";
3876
3878
  if (e.getDeletedAt?.() != null) return "(Message removed)";
3877
- if (e instanceof H.TextMessage) return e.getText?.() ?? "";
3878
- if (e instanceof H.MediaMessage) {
3879
+ if (e instanceof U.TextMessage) return e.getText?.() ?? "";
3880
+ if (e instanceof U.MediaMessage) {
3879
3881
  let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
3880
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"}`;
3881
3883
  }
3882
- if (e instanceof H.Action) {
3884
+ if (e instanceof U.Action) {
3883
3885
  let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
3884
3886
  return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
3885
3887
  }
@@ -3909,9 +3911,9 @@ function Xs(e) {
3909
3911
  return Ys(e).join("\n").trim();
3910
3912
  }
3911
3913
  function Zs(e) {
3912
- if (e.kind === "poll" && e.poll) return vt("pollPrefix", { question: e.poll.question });
3913
- let t = Vt(e.source);
3914
- return Ws(e, e.attachments.length > 0 ? vt("sentAnAttachment") : vt("youSentAMessage"), t);
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);
3915
3917
  }
3916
3918
  //#endregion
3917
3919
  //#region src/chat/offlineStore.ts
@@ -4159,7 +4161,7 @@ function ac(e) {
4159
4161
  //#region src/chat/client.ts
4160
4162
  var oc = null, sc = null;
4161
4163
  function cc({ environment: e }) {
4162
- He(e);
4164
+ Ve(e);
4163
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);
4164
4166
  function M(e) {
4165
4167
  if (!e.length) return;
@@ -4168,7 +4170,7 @@ function cc({ environment: e }) {
4168
4170
  A.value = t;
4169
4171
  }
4170
4172
  function ee(e) {
4171
- M(Object.entries(Vt(e)).map(([e, t]) => ({
4173
+ M(Object.entries(Bt(e)).map(([e, t]) => ({
4172
4174
  uid: e,
4173
4175
  displayName: t
4174
4176
  })));
@@ -4176,131 +4178,131 @@ function cc({ environment: e }) {
4176
4178
  function N(e, t) {
4177
4179
  return ee(e), fc(e, t);
4178
4180
  }
4179
- let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`, te = !1, L = !1, R = null, z = null, ne = null, B = null, re = 0, ie = 0, ae = !1, oe = !1, V = null, se = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Set(), le = null, U = null, ue = 0;
4180
- async function de() {
4181
- await lc(e), !t.value && (ge(), ut(), t.value = !0, await ct(), _.value && (dt(_.value.uid), me(), Te(), !m.value && !oe && Ce()));
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(), lt(), t.value = !0, await st(), _.value && (ut(_.value.uid), pe(), we(), !m.value && !ae && Se()));
4182
4184
  }
4183
- async function fe(e) {
4185
+ async function de(e) {
4184
4186
  g.value = null, r.value = !0;
4185
4187
  try {
4186
- await de();
4187
- let t = qe();
4188
- await H.getLoggedinUser() && t !== e && await H.logout(), Je(e);
4188
+ await ue();
4189
+ let t = Ke();
4190
+ await U.getLoggedinUser() && t !== e && await U.logout(), qe(e);
4189
4191
  let n = await uc(e);
4190
- _.value = hc(await H.login(n)), dt(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, me(), Te(), oe || await Ce(), await ke(), Kt();
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(), Gt();
4191
4193
  } catch (e) {
4192
- throw xt(), g.value = Z(e, "Unable to sign in to chat."), e;
4194
+ throw bt(), g.value = Z(e, "Unable to sign in to chat."), e;
4193
4195
  } finally {
4194
4196
  r.value = !1;
4195
4197
  }
4196
4198
  }
4197
- async function pe() {
4199
+ async function fe() {
4198
4200
  g.value = null;
4199
4201
  try {
4200
- Je(null), Qe(), await H.getLoggedinUser() && await H.logout();
4202
+ qe(null), Ze(), await U.getLoggedinUser() && await U.logout();
4201
4203
  } finally {
4202
- xt();
4204
+ bt();
4203
4205
  }
4204
4206
  }
4205
- function me() {
4206
- let e = lt();
4207
+ function pe() {
4208
+ let e = ct();
4207
4209
  if (!e) {
4208
- V = null, k.value = [];
4210
+ H = null, k.value = [];
4209
4211
  return;
4210
4212
  }
4211
- let t = `bcc-chat:${G().appId}:${e}`;
4212
- he(t), V = new $s(t), k.value = V.getQueue();
4213
+ let t = `bcc-chat:${K().appId}:${e}`;
4214
+ me(t), H = new $s(t), k.value = H.getQueue();
4213
4215
  }
4214
- function he(e) {
4216
+ function me(e) {
4215
4217
  if (typeof window > "u") return;
4216
- let t = `bcc-chat:${G().appId}:`, n = [];
4218
+ let t = `bcc-chat:${K().appId}:`, n = [];
4217
4219
  for (let r = 0; r < window.localStorage.length; r += 1) {
4218
4220
  let i = window.localStorage.key(r);
4219
4221
  i && i.startsWith(t) && i !== e && n.push(i);
4220
4222
  }
4221
4223
  n.forEach((e) => window.localStorage.removeItem(e));
4222
4224
  }
4225
+ function he() {
4226
+ R || typeof window > "u" || (window.addEventListener("online", ge), window.addEventListener("offline", _e), R = !0);
4227
+ }
4223
4228
  function ge() {
4224
- L || typeof window > "u" || (window.addEventListener("online", _e), window.addEventListener("offline", ve), L = !0);
4229
+ m.value = !1, V = !0, ae || xe(!0);
4225
4230
  }
4226
4231
  function _e() {
4227
- m.value = !1, ae = !0, oe || Se(!0);
4232
+ m.value = !0, p.value = !1, ve();
4228
4233
  }
4229
4234
  function ve() {
4230
- m.value = !0, p.value = !1, ye();
4235
+ te !== null && (clearTimeout(te), te = null);
4231
4236
  }
4232
4237
  function ye() {
4233
- R !== null && (clearTimeout(R), R = null);
4234
- }
4235
- function be() {
4236
4238
  re = Date.now() + 1500;
4237
4239
  }
4238
- function xe() {
4240
+ function be() {
4239
4241
  return Date.now() < re;
4240
4242
  }
4241
- function Se(e = !1) {
4242
- if (R !== null || z || m.value || !h.value || oe) return;
4243
+ function xe(e = !1) {
4244
+ if (te !== null || z || m.value || !h.value || ae) return;
4243
4245
  let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ie, 4));
4244
- R = setTimeout(() => {
4245
- R = null, Ce();
4246
+ te = setTimeout(() => {
4247
+ te = null, Se();
4246
4248
  }, t);
4247
4249
  }
4248
- async function Ce() {
4249
- if (!(m.value || !h.value || oe)) return z || (z = (async () => {
4250
- ye();
4250
+ async function Se() {
4251
+ if (!(m.value || !h.value || ae)) return z || (z = (async () => {
4252
+ ve();
4251
4253
  try {
4252
- let e = await H.getLoggedinUser();
4254
+ let e = await U.getLoggedinUser();
4253
4255
  if (!e) {
4254
- let t = qe();
4256
+ let t = Ke();
4255
4257
  if (!t) return;
4256
4258
  let n = await uc(t);
4257
- e = await H.login(n);
4259
+ e = await U.login(n);
4258
4260
  }
4259
- _.value = hc(e), h.value = !0, me();
4260
- let t = H.connect;
4261
- typeof t == "function" && (await t.call(H), p.value = !0), ie = 0, ae && await we();
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();
4262
4264
  } catch (e) {
4263
- p.value = !1, ie += 1, It(e) || (g.value = Z(e, "Unable to reconnect to chat.")), Se();
4265
+ p.value = !1, ie += 1, Ft(e) || (g.value = Z(e, "Unable to reconnect to chat.")), xe();
4264
4266
  } finally {
4265
4267
  z = null;
4266
4268
  }
4267
4269
  })(), z);
4268
4270
  }
4269
- async function we() {
4270
- return ne || m.value || !h.value || oe || (ne = (async () => {
4271
- ae = !1, g.value = null;
4271
+ async function Ce() {
4272
+ return ne || m.value || !h.value || ae || (ne = (async () => {
4273
+ V = !1, g.value = null;
4272
4274
  try {
4273
- await ke(), Kt();
4275
+ await Oe(), Gt();
4274
4276
  } finally {
4275
4277
  ne = null;
4276
4278
  }
4277
4279
  })()), ne;
4278
4280
  }
4279
- function Te() {
4280
- if (!V || v.value.length > 0) return;
4281
- let e = V.getConversations();
4282
- e.length !== 0 && (v.value = bc(e), !T.value && v.value.length > 0 && Ee(T.value));
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));
4283
4285
  }
4284
- function Ee(e) {
4285
- if (!V || !e) return y.value = [], !1;
4286
- let t = V.getMessages(e).sort(xc);
4286
+ function Te(e) {
4287
+ if (!H || !e) return y.value = [], !1;
4288
+ let t = H.getMessages(e).sort(xc);
4287
4289
  return y.value = t, t.length > 0;
4288
4290
  }
4291
+ async function Ee() {
4292
+ ae = !1, V = !0, await Se();
4293
+ }
4289
4294
  async function De() {
4290
- oe = !1, ae = !0, await Ce();
4295
+ ae = !0, V = !1, ve();
4296
+ let e = U.disconnect;
4297
+ typeof e == "function" && await e.call(U), p.value = !1;
4291
4298
  }
4292
4299
  async function Oe() {
4293
- oe = !0, ae = !1, ye();
4294
- let e = H.disconnect;
4295
- typeof e == "function" && await e.call(H), p.value = !1;
4296
- }
4297
- async function ke() {
4298
- if (await de(), i.value = !0, g.value = null, m.value && V) {
4299
- v.value = bc(V.getConversations()), P.value && await nt(), i.value = !1;
4300
+ if (await ue(), i.value = !0, g.value = null, m.value && H) {
4301
+ v.value = bc(H.getConversations()), P.value && await tt(), i.value = !1;
4300
4302
  return;
4301
4303
  }
4302
4304
  try {
4303
- let e = new H.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(H.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4305
+ let e = new U.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(U.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4304
4306
  do
4305
4307
  n = await e.fetchNext(), t.push(...n.map((e) => dc(e, _.value?.uid)));
4306
4308
  while (n.length === 50);
@@ -4309,9 +4311,9 @@ function cc({ environment: e }) {
4309
4311
  let t = r.get(e.id);
4310
4312
  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));
4311
4313
  }
4312
- v.value = bc(await pt(t)), V?.setConversations(v.value), P.value && await nt();
4314
+ v.value = bc(await ft(t)), H?.setConversations(v.value), P.value && await tt();
4313
4315
  } catch (e) {
4314
- let t = V?.getConversations() ?? [];
4316
+ let t = H?.getConversations() ?? [];
4315
4317
  if (t.length > 0) {
4316
4318
  v.value = bc(t);
4317
4319
  return;
@@ -4321,39 +4323,39 @@ function cc({ environment: e }) {
4321
4323
  i.value = !1;
4322
4324
  }
4323
4325
  }
4324
- async function Ae(e) {
4325
- T.value = e, E.value = null, b.value = [], U = null, C.value = !1, D.value = null, O.value = null, Ee(e), await nt();
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 tt();
4326
4328
  }
4327
- function je(e) {
4329
+ function Ae(e) {
4328
4330
  e && (O.value = null), D.value = e;
4329
4331
  }
4330
- function Me(e) {
4332
+ function je(e) {
4331
4333
  e && (D.value = null), O.value = e;
4332
4334
  }
4333
- async function Ne(e) {
4334
- E.value = e, U = null, C.value = !1, D.value = null, O.value = null, await it(e.id);
4335
+ async function Me(e) {
4336
+ E.value = e, W = null, C.value = !1, D.value = null, O.value = null, await rt(e.id);
4335
4337
  }
4336
- function Pe() {
4337
- E.value = null, b.value = [], U = null, C.value = !1, D.value = null, O.value = null;
4338
+ function Ne() {
4339
+ E.value = null, b.value = [], W = null, C.value = !1, D.value = null, O.value = null;
4338
4340
  }
4339
- async function Fe(e, t) {
4341
+ async function Pe(e, t) {
4340
4342
  if (u.value) return;
4341
4343
  let n = P.value;
4342
4344
  if (!n) return;
4343
4345
  let r = Vs(e);
4344
4346
  if (!Hs(r)) return;
4345
4347
  if (O.value) {
4346
- await Ie(O.value, r);
4348
+ await Fe(O.value, r);
4347
4349
  return;
4348
4350
  }
4349
- let i = E.value?.id, a = crypto.randomUUID(), o = Dc(Pt(D.value, t), a);
4351
+ let i = E.value?.id, a = crypto.randomUUID(), o = Dc(Nt(D.value, t), a);
4350
4352
  u.value = !0, g.value = null;
4351
4353
  try {
4352
4354
  if (m.value) {
4353
- Lt(n, r, o, i, a), D.value = null;
4355
+ It(n, r, o, i, a), D.value = null;
4354
4356
  return;
4355
4357
  }
4356
- Ut(Nt({
4358
+ Ht(Mt({
4357
4359
  conversation: n,
4358
4360
  kind: "text",
4359
4361
  text: r,
@@ -4362,21 +4364,21 @@ function cc({ environment: e }) {
4362
4364
  muid: a,
4363
4365
  deliveryState: "sending"
4364
4366
  }));
4365
- let e = new H.TextMessage(n.targetId, r, kc(n));
4367
+ let e = new U.TextMessage(n.targetId, r, kc(n));
4366
4368
  e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
4367
- let t = await H.sendMessage(e);
4368
- Ct(N(t, _.value?.uid)), ht(t), await K(t), D.value = null;
4369
+ let t = await U.sendMessage(e);
4370
+ St(N(t, _.value?.uid)), mt(t), await q(t), D.value = null;
4369
4371
  } catch (e) {
4370
- if (It(e)) {
4371
- Wt("queued", a), Lt(n, r, o, E.value?.id, a), D.value = null;
4372
+ if (Ft(e)) {
4373
+ Ut("queued", a), It(n, r, o, E.value?.id, a), D.value = null;
4372
4374
  return;
4373
4375
  }
4374
- throw Wt("failed", a), g.value = Z(e, "Unable to send the message."), e;
4376
+ throw Ut("failed", a), g.value = Z(e, "Unable to send the message."), e;
4375
4377
  } finally {
4376
4378
  u.value = !1;
4377
4379
  }
4378
4380
  }
4379
- async function Ie(e, t) {
4381
+ async function Fe(e, t) {
4380
4382
  let n = P.value;
4381
4383
  if (!n || m.value) return;
4382
4384
  let r = Vs(t);
@@ -4384,9 +4386,9 @@ function cc({ environment: e }) {
4384
4386
  u.value = !0, g.value = null;
4385
4387
  try {
4386
4388
  let t;
4387
- 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));
4388
- let i = await H.editMessage(t);
4389
- Ct(N(i, _.value?.uid)), ht(i), O.value = null;
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
+ St(N(i, _.value?.uid)), mt(i), O.value = null;
4390
4392
  } catch (e) {
4391
4393
  throw g.value = Z(e, "Unable to edit the message."), e;
4392
4394
  } finally {
@@ -4394,18 +4396,18 @@ function cc({ environment: e }) {
4394
4396
  }
4395
4397
  }
4396
4398
  }
4397
- async function Le(e, t) {
4399
+ async function Ie(e, t) {
4398
4400
  if (u.value) return;
4399
4401
  let n = P.value;
4400
4402
  if (!n) return;
4401
- let r = E.value?.id, i = crypto.randomUUID(), a = Dc(Pt(D.value, t), i), o = Nc(e.file);
4403
+ let r = E.value?.id, i = crypto.randomUUID(), a = Dc(Nt(D.value, t), i), o = Nc(e.file);
4402
4404
  u.value = !0, g.value = null;
4403
4405
  try {
4404
4406
  if (m.value) {
4405
- await Bt(n, e, a, r, i), D.value = null;
4407
+ await zt(n, e, a, r, i), D.value = null;
4406
4408
  return;
4407
4409
  }
4408
- Ut(Nt({
4410
+ Ht(Mt({
4409
4411
  conversation: n,
4410
4412
  kind: o,
4411
4413
  text: e.caption?.trim() ?? "",
@@ -4420,37 +4422,37 @@ function cc({ environment: e }) {
4420
4422
  muid: i,
4421
4423
  deliveryState: "sending"
4422
4424
  }));
4423
- let t = new H.MediaMessage(n.targetId, e.file, o, kc(n));
4425
+ let t = new U.MediaMessage(n.targetId, e.file, o, kc(n));
4424
4426
  t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
4425
- let s = await H.sendMediaMessage(t);
4426
- Ct(N(s, _.value?.uid)), ht(s), await K(s), D.value = null;
4427
+ let s = await U.sendMediaMessage(t);
4428
+ St(N(s, _.value?.uid)), mt(s), await q(s), D.value = null;
4427
4429
  } catch (t) {
4428
- if (It(t)) {
4429
- Wt("queued", i), await Bt(n, e, a, r, i), D.value = null;
4430
+ if (Ft(t)) {
4431
+ Ut("queued", i), await zt(n, e, a, r, i), D.value = null;
4430
4432
  return;
4431
4433
  }
4432
- throw Wt("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
4434
+ throw Ut("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
4433
4435
  } finally {
4434
4436
  u.value = !1;
4435
4437
  }
4436
4438
  }
4437
- async function Re(e, t) {
4439
+ async function Le(e, t) {
4438
4440
  if (u.value) return;
4439
4441
  let n = P.value;
4440
4442
  if (!n) return;
4441
4443
  let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
4442
4444
  if (!r || i.length < 2) return;
4443
- let a = E.value?.id, o = crypto.randomUUID(), s = Dc(Pt(D.value, t), o);
4445
+ let a = E.value?.id, o = crypto.randomUUID(), s = Dc(Nt(D.value, t), o);
4444
4446
  u.value = !0, g.value = null;
4445
4447
  try {
4446
4448
  if (m.value) {
4447
- Rt(n, {
4449
+ Lt(n, {
4448
4450
  question: r,
4449
4451
  options: i
4450
4452
  }, s, a, o), D.value = null;
4451
4453
  return;
4452
4454
  }
4453
- Ut(Nt({
4455
+ Ht(Mt({
4454
4456
  conversation: n,
4455
4457
  kind: "poll",
4456
4458
  text: `Poll: ${r}`,
@@ -4467,41 +4469,41 @@ function cc({ environment: e }) {
4467
4469
  question: r,
4468
4470
  options: i,
4469
4471
  receiver: n.targetId,
4470
- receiverType: n.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER
4472
+ receiverType: n.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER
4471
4473
  };
4472
4474
  a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
4473
- let t = await H.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4474
- c ? (Gt(o), Ct(N(c, _.value?.uid)), ht(c), await K(c)) : (Gt(o), await St()), D.value = null;
4475
+ let t = await U.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4476
+ c ? (Wt(o), St(N(c, _.value?.uid)), mt(c), await q(c)) : (Wt(o), await xt()), D.value = null;
4475
4477
  } catch (e) {
4476
- if (It(e)) {
4477
- Wt("queued", o), Rt(n, {
4478
+ if (Ft(e)) {
4479
+ Ut("queued", o), Lt(n, {
4478
4480
  question: r,
4479
4481
  options: i
4480
4482
  }, s, a, o), D.value = null;
4481
4483
  return;
4482
4484
  }
4483
- throw Wt("failed", o), g.value = Z(e, "Unable to send the poll."), e;
4485
+ throw Ut("failed", o), g.value = Z(e, "Unable to send the poll."), e;
4484
4486
  } finally {
4485
4487
  u.value = !1;
4486
4488
  }
4487
4489
  }
4488
- async function W(e, t) {
4490
+ async function G(e, t) {
4489
4491
  let n = e.poll?.id ?? e.id, r = _.value?.uid;
4490
4492
  if (!n || !t || m.value) return;
4491
- let i = Tt(e.id, e.parentMessageId) ?? e;
4493
+ let i = wt(e.id, e.parentMessageId) ?? e;
4492
4494
  if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
4493
- g.value = null, r && Ct(ze(i, t, r));
4495
+ g.value = null, r && St(Re(i, t, r));
4494
4496
  try {
4495
- await H.callExtension("polls", "POST", "v2/vote", {
4497
+ await U.callExtension("polls", "POST", "v2/vote", {
4496
4498
  id: n,
4497
4499
  vote: t
4498
4500
  });
4499
4501
  } catch (e) {
4500
- throw Ct(i), g.value = Z(e, "Unable to cast the vote."), e;
4502
+ throw St(i), g.value = Z(e, "Unable to cast the vote."), e;
4501
4503
  }
4502
4504
  }
4503
4505
  }
4504
- function ze(e, t, n) {
4506
+ function Re(e, t, n) {
4505
4507
  if (!e.poll) return e;
4506
4508
  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 ? {
4507
4509
  ...e,
@@ -4521,80 +4523,80 @@ function cc({ environment: e }) {
4521
4523
  }
4522
4524
  };
4523
4525
  }
4524
- async function Be(e, t) {
4526
+ async function ze(e, t) {
4525
4527
  g.value = null;
4526
- let n = Tt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4527
- Ct(Et(n, t));
4528
+ let n = wt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4529
+ St(Tt(n, t));
4528
4530
  try {
4529
- Ct(N(r ? await H.removeReaction(Number(e.id), t) : await H.addReaction(Number(e.id), t), _.value?.uid));
4531
+ St(N(r ? await U.removeReaction(Number(e.id), t) : await U.addReaction(Number(e.id), t), _.value?.uid));
4530
4532
  } catch (e) {
4531
- throw Ct(n), g.value = Z(e, "Unable to update the reaction."), e;
4533
+ throw St(n), g.value = Z(e, "Unable to update the reaction."), e;
4532
4534
  }
4533
4535
  }
4534
- async function Ve(e) {
4536
+ async function Be(e) {
4535
4537
  if (g.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
4536
- kt(e);
4538
+ Ot(e);
4537
4539
  return;
4538
4540
  }
4539
4541
  if (!m.value) try {
4540
- let t = N(await H.deleteMessage(String(e.id)), _.value?.uid);
4541
- kt(t), At(t);
4542
+ let t = N(await U.deleteMessage(String(e.id)), _.value?.uid);
4543
+ Ot(t), kt(t);
4542
4544
  } catch (e) {
4543
4545
  throw g.value = Z(e, "Unable to delete the message."), e;
4544
4546
  }
4545
4547
  }
4546
- async function Ue(e) {
4548
+ async function He(e) {
4547
4549
  let t = e.source?.getText?.() ?? e.text;
4548
4550
  if (Hs(t)) {
4549
4551
  g.value = null;
4550
4552
  try {
4551
- let n = (await H.callExtension("message-translation", "POST", "v2/translate", {
4553
+ let n = (await U.callExtension("message-translation", "POST", "v2/translate", {
4552
4554
  msgId: Number(e.id),
4553
4555
  text: t,
4554
4556
  languages: typeof navigator < "u" ? navigator.languages : ["en"]
4555
4557
  })).translations?.[0]?.message_translated?.trim();
4556
4558
  if (!n) return;
4557
- wt({
4559
+ Ct({
4558
4560
  ...e,
4559
4561
  translatedText: n,
4560
4562
  metadata: {
4561
4563
  ...e.metadata ?? {},
4562
4564
  translated_message: n
4563
4565
  }
4564
- }), Ot();
4566
+ }), Dt();
4565
4567
  } catch (e) {
4566
4568
  throw g.value = Z(e, "Unable to translate the message."), e;
4567
4569
  }
4568
4570
  }
4569
4571
  }
4570
- async function We(e) {
4571
- let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++ue;
4572
+ async function Ue(e) {
4573
+ let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++le;
4572
4574
  if (!t || !n) {
4573
- r === ue && (x.value = []);
4575
+ r === le && (x.value = []);
4574
4576
  return;
4575
4577
  }
4576
4578
  l.value = !0, g.value = null;
4577
4579
  try {
4578
- let e = new H.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4580
+ let e = new U.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4579
4581
  do
4580
4582
  a = await e.fetchPrevious(), i.push(...a.map((e) => N(e, _.value?.uid)));
4581
4583
  while (a.length === 50);
4582
4584
  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()));
4583
- if (r !== ue) return;
4585
+ if (r !== le) return;
4584
4586
  x.value = o;
4585
4587
  } catch (e) {
4586
- if (r !== ue) return;
4587
- throw g.value = Z(e, vt("loadScheduledMessagesError")), e;
4588
+ if (r !== le) return;
4589
+ throw g.value = Z(e, _t("loadScheduledMessagesError")), e;
4588
4590
  } finally {
4589
- r === ue && (l.value = !1);
4591
+ r === le && (l.value = !1);
4590
4592
  }
4591
4593
  }
4592
- async function Ge(e, t) {
4594
+ async function We(e, t) {
4593
4595
  let n = P.value;
4594
4596
  if (n) {
4595
4597
  d.value = !0, g.value = null;
4596
4598
  try {
4597
- e.file ? await Mc(n, e, t) : await jc(n, e, t), await We(n.targetId);
4599
+ e.file ? await Mc(n, e, t) : await jc(n, e, t), await Ue(n.targetId);
4598
4600
  } catch (e) {
4599
4601
  throw g.value = Z(e, "Unable to schedule the message."), e;
4600
4602
  } finally {
@@ -4602,16 +4604,16 @@ function cc({ environment: e }) {
4602
4604
  }
4603
4605
  }
4604
4606
  }
4605
- async function Ke(e) {
4607
+ async function Ge(e) {
4606
4608
  if (g.value = null, !e.scheduled) return;
4607
4609
  let t = e.scheduled.originalChatUid;
4608
4610
  try {
4609
- await H.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await We(t);
4611
+ await U.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await Ue(t);
4610
4612
  } catch (e) {
4611
4613
  throw g.value = Z(e, "Unable to remove the scheduled message."), e;
4612
4614
  }
4613
4615
  }
4614
- async function Ye(e, t) {
4616
+ async function Je(e, t) {
4615
4617
  g.value = null;
4616
4618
  let n = _.value?.uid;
4617
4619
  if (!n || !e.scheduled?.muid || e.kind === "poll") return;
@@ -4621,22 +4623,22 @@ function cc({ environment: e }) {
4621
4623
  !i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
4622
4624
  try {
4623
4625
  let t;
4624
- if (e.kind === "text") t = new H.TextMessage(n, r, H.RECEIVER_TYPE.GROUP);
4626
+ if (e.kind === "text") t = new U.TextMessage(n, r, U.RECEIVER_TYPE.GROUP);
4625
4627
  else {
4626
4628
  let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
4627
- t = new H.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, H.RECEIVER_TYPE.GROUP), t.setCaption(r);
4629
+ t = new U.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, U.RECEIVER_TYPE.GROUP), t.setCaption(r);
4628
4630
  }
4629
- Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await H.editMessage(t), await We(e.scheduled.originalChatUid);
4631
+ Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await U.editMessage(t), await Ue(e.scheduled.originalChatUid);
4630
4632
  } catch (e) {
4631
4633
  throw g.value = Z(e, "Unable to edit the scheduled message."), e;
4632
4634
  } finally {
4633
4635
  d.value = !1;
4634
4636
  }
4635
4637
  }
4636
- async function Xe(e) {
4638
+ async function Ye(e) {
4637
4639
  d.value = !0, g.value = null;
4638
4640
  try {
4639
- let t = Ac(), n = await fetch(`${G().chatApiBaseUrl}/chats/rescheduleMessage`, {
4641
+ let t = Ac(), n = await fetch(`${K().chatApiBaseUrl}/chats/rescheduleMessage`, {
4640
4642
  method: "POST",
4641
4643
  headers: {
4642
4644
  "Content-Type": "application/json",
@@ -4650,23 +4652,23 @@ function cc({ environment: e }) {
4650
4652
  })
4651
4653
  });
4652
4654
  if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
4653
- await We(e.originalChatUid);
4655
+ await Ue(e.originalChatUid);
4654
4656
  } catch (e) {
4655
4657
  throw g.value = Z(e, "Unable to reschedule the message."), e;
4656
4658
  } finally {
4657
4659
  d.value = !1;
4658
4660
  }
4659
4661
  }
4660
- function Ze(e) {
4661
- let t = new H.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4662
+ function Xe(e) {
4663
+ let t = new U.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4662
4664
  return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
4663
4665
  }
4664
- function $e(e) {
4665
- return new H.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4666
+ function Qe(e) {
4667
+ return new U.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4666
4668
  }
4667
- async function et(e) {
4669
+ async function $e(e) {
4668
4670
  if (!e.isOwn || e.receipts.readAt) return e;
4669
- let t = `bcc-chat:${G().appId}:message_${e.id}_receiptStatus`;
4671
+ let t = `bcc-chat:${K().appId}:message_${e.id}_receiptStatus`;
4670
4672
  try {
4671
4673
  let n = localStorage.getItem(t);
4672
4674
  if (n) {
@@ -4674,7 +4676,7 @@ function cc({ environment: e }) {
4674
4676
  if (!Number.isNaN(r.getTime()) && !Number.isNaN(i.getTime())) return e.receipts.readAt = r, e.receipts.deliveredAt = i, e;
4675
4677
  }
4676
4678
  } catch {}
4677
- let n = await bt(e);
4679
+ let n = await yt(e);
4678
4680
  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);
4679
4681
  if (e.receipts.readAt) try {
4680
4682
  localStorage.setItem(t, JSON.stringify({
@@ -4684,37 +4686,37 @@ function cc({ environment: e }) {
4684
4686
  } catch {}
4685
4687
  return e;
4686
4688
  }
4687
- async function tt(e) {
4689
+ async function et(e) {
4688
4690
  let t = P.value;
4689
4691
  if (!t) return y.value = [], S.value = !1, !1;
4690
- if ((e?.reset || le?.conversationId !== t.id) && (le = {
4692
+ if ((e?.reset || ce?.conversationId !== t.id) && (ce = {
4691
4693
  conversationId: t.id,
4692
- request: Ze(t)
4693
- }, S.value = !0), !le) return !1;
4694
- let n = await le.request.fetchPrevious(), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
4695
- 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, V?.setMessages(t.id, y.value);
4694
+ request: Xe(t)
4695
+ }, S.value = !0), !ce) return !1;
4696
+ let n = await ce.request.fetchPrevious(), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map($e));
4697
+ 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);
4696
4698
  let i = n[n.length - 1];
4697
- return i && (await yt(i), await K(i)), n.length > 0;
4699
+ return i && (await vt(i), await q(i)), n.length > 0;
4698
4700
  }
4699
- async function nt() {
4701
+ async function tt() {
4700
4702
  let e = P.value;
4701
4703
  if (!e) {
4702
- y.value = [], S.value = !1, le = null;
4704
+ y.value = [], S.value = !1, ce = null;
4703
4705
  return;
4704
4706
  }
4705
- let t = Ee(e.id);
4706
- if (a.value = !0, m.value && V) {
4707
- S.value = !1, le = null, a.value = !1;
4707
+ let t = Te(e.id);
4708
+ if (a.value = !0, m.value && H) {
4709
+ S.value = !1, ce = null, a.value = !1;
4708
4710
  return;
4709
4711
  }
4710
4712
  try {
4711
- await tt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4713
+ await et({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4712
4714
  ...t,
4713
4715
  lastMessage: y.value.at(-1) ?? null,
4714
4716
  unreadCount: 0
4715
- } : t), V?.setConversations(v.value);
4717
+ } : t), H?.setConversations(v.value);
4716
4718
  } catch (n) {
4717
- let r = V?.getMessages(e.id) ?? [];
4719
+ let r = H?.getMessages(e.id) ?? [];
4718
4720
  if (r.length > 0) {
4719
4721
  t || (y.value = r.sort(xc));
4720
4722
  return;
@@ -4724,27 +4726,27 @@ function cc({ environment: e }) {
4724
4726
  a.value = !1;
4725
4727
  }
4726
4728
  }
4727
- async function rt(e) {
4729
+ async function nt(e) {
4728
4730
  let t = E.value?.id;
4729
4731
  if (!t) return b.value = [], C.value = !1, !1;
4730
- if ((e?.reset || U?.parentMessageId !== t) && (U = {
4732
+ if ((e?.reset || W?.parentMessageId !== t) && (W = {
4731
4733
  parentMessageId: t,
4732
- request: $e(t)
4733
- }, C.value = !0), !U) return !1;
4734
- let n = await U.request.fetchPrevious(), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
4735
- b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50, V?.setThreadMessages(t, b.value);
4734
+ request: Qe(t)
4735
+ }, C.value = !0), !W) return !1;
4736
+ let n = await W.request.fetchPrevious(), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map($e));
4737
+ 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);
4736
4738
  let i = n[n.length - 1];
4737
- return i && (await yt(i), await K(i)), n.length > 0;
4739
+ return i && (await vt(i), await q(i)), n.length > 0;
4738
4740
  }
4739
- async function it(e) {
4740
- if (o.value = !0, m.value && V) {
4741
- b.value = V.getThreadMessages(e).sort(xc), C.value = !1, U = null, o.value = !1;
4741
+ async function rt(e) {
4742
+ if (o.value = !0, m.value && H) {
4743
+ b.value = H.getThreadMessages(e).sort(xc), C.value = !1, W = null, o.value = !1;
4742
4744
  return;
4743
4745
  }
4744
4746
  try {
4745
- await rt({ reset: !0 });
4747
+ await nt({ reset: !0 });
4746
4748
  } catch (t) {
4747
- let n = V?.getThreadMessages(e) ?? [];
4749
+ let n = H?.getThreadMessages(e) ?? [];
4748
4750
  if (n.length > 0) {
4749
4751
  b.value = n.sort(xc);
4750
4752
  return;
@@ -4754,29 +4756,29 @@ function cc({ environment: e }) {
4754
4756
  o.value = !1;
4755
4757
  }
4756
4758
  }
4757
- async function at() {
4759
+ async function it() {
4758
4760
  if (a.value || s.value || !S.value) return !1;
4759
4761
  s.value = !0, g.value = null;
4760
4762
  try {
4761
- return await tt();
4763
+ return await et();
4762
4764
  } catch (e) {
4763
4765
  throw g.value = Z(e, "Unable to load messages."), e;
4764
4766
  } finally {
4765
4767
  s.value = !1;
4766
4768
  }
4767
4769
  }
4768
- async function ot() {
4770
+ async function at() {
4769
4771
  if (o.value || c.value || !C.value) return !1;
4770
4772
  c.value = !0, g.value = null;
4771
4773
  try {
4772
- return await rt();
4774
+ return await nt();
4773
4775
  } catch (e) {
4774
4776
  throw g.value = Z(e, "Unable to load thread."), e;
4775
4777
  } finally {
4776
4778
  c.value = !1;
4777
4779
  }
4778
4780
  }
4779
- async function st(e) {
4781
+ async function ot(e) {
4780
4782
  let t = e.trim();
4781
4783
  if (!t) return !1;
4782
4784
  let n = () => y.value.some((e) => e.id === t) || b.value.some((e) => e.id === t) || E.value?.id === t;
@@ -4784,101 +4786,101 @@ function cc({ environment: e }) {
4784
4786
  let r = 0;
4785
4787
  for (; C.value && E.value && r < 100;) {
4786
4788
  r += 1;
4787
- let e = await ot();
4789
+ let e = await at();
4788
4790
  if (n()) return !0;
4789
4791
  if (!e) break;
4790
4792
  }
4791
4793
  for (; S.value && P.value && r < 100;) {
4792
4794
  r += 1;
4793
- let e = await at();
4795
+ let e = await it();
4794
4796
  if (n()) return !0;
4795
4797
  if (!e) break;
4796
4798
  }
4797
4799
  return n();
4798
4800
  }
4799
- async function ct() {
4800
- let e = await H.getLoggedinUser();
4801
+ async function st() {
4802
+ let e = await U.getLoggedinUser();
4801
4803
  _.value = e ? hc(e) : null, h.value = !!e;
4802
4804
  }
4803
- function ut() {
4804
- te ||= (H.addConnectionListener(F, new H.ConnectionListener({
4805
+ function lt() {
4806
+ L ||= (U.addConnectionListener(F, new U.ConnectionListener({
4805
4807
  onConnected: () => {
4806
- if (p.value = !0, ie = 0, ye(), ae) {
4807
- we();
4808
+ if (p.value = !0, ie = 0, ve(), V) {
4809
+ Ce();
4808
4810
  return;
4809
4811
  }
4810
- Kt();
4812
+ Gt();
4811
4813
  },
4812
4814
  onDisconnected: () => {
4813
- p.value = !1, !m.value && h.value && !oe && (ae = !0, Se(!0));
4815
+ p.value = !1, !m.value && h.value && !ae && (V = !0, xe(!0));
4814
4816
  }
4815
- })), H.addMessageListener(I, new H.MessageListener({
4817
+ })), U.addMessageListener(I, new U.MessageListener({
4816
4818
  onTextMessageReceived: (e) => {
4817
- ft(e);
4819
+ dt(e);
4818
4820
  },
4819
4821
  onMediaMessageReceived: (e) => {
4820
- ft(e);
4822
+ dt(e);
4821
4823
  },
4822
4824
  onCustomMessageReceived: (e) => {
4823
- ft(e);
4825
+ dt(e);
4824
4826
  },
4825
4827
  onMessagesDelivered: () => {
4826
- xe() || St({ includeThread: !1 });
4828
+ be() || xt({ includeThread: !1 });
4827
4829
  },
4828
4830
  onMessagesRead: () => {
4829
- xe() || St({ includeThread: !1 });
4831
+ be() || xt({ includeThread: !1 });
4830
4832
  },
4831
4833
  onMessageEdited: (e) => {
4832
4834
  let t = N(e, _.value?.uid);
4833
- Tc(t) && (gt(t), ht(e));
4835
+ Tc(t) && (ht(t), mt(e));
4834
4836
  },
4835
4837
  onMessageDeleted: (e) => {
4836
4838
  let t = N(e, _.value?.uid);
4837
- t.parentMessageId ? kt(t) : (kt(t), At(t)), Ot();
4839
+ t.parentMessageId ? Ot(t) : (Ot(t), kt(t)), Dt();
4838
4840
  },
4839
4841
  onMessageReactionAdded: () => {
4840
- St();
4842
+ xt();
4841
4843
  },
4842
4844
  onMessageReactionRemoved: () => {
4843
- St();
4845
+ xt();
4844
4846
  },
4845
4847
  onMessagesDeliveredToAll: () => {
4846
- xe() || St({ includeThread: !1 });
4848
+ be() || xt({ includeThread: !1 });
4847
4849
  },
4848
4850
  onMessagesReadByAll: () => {
4849
- xe() || St({ includeThread: !1 });
4851
+ be() || xt({ includeThread: !1 });
4850
4852
  }
4851
4853
  })), !0);
4852
4854
  }
4853
- async function ft(e) {
4855
+ async function dt(e) {
4854
4856
  let t = N(e, _.value?.uid);
4855
4857
  if (Tc(t)) {
4856
- if (ht(e), await yt(e), t.parentMessageId) {
4857
- _t(t), Dt(t.parentMessageId), Ot();
4858
+ if (mt(e), await vt(e), t.parentMessageId) {
4859
+ gt(t), Et(t.parentMessageId), Dt();
4858
4860
  return;
4859
4861
  }
4860
- t.conversationId === T.value && (gt(t), Ot(), await K(e));
4862
+ t.conversationId === T.value && (ht(t), Dt(), await q(e));
4861
4863
  }
4862
4864
  }
4863
- async function pt(e) {
4865
+ async function ft(e) {
4864
4866
  return await Promise.all(e.map(async (e) => {
4865
- let t = await mt(e.targetId);
4867
+ let t = await pt(e.targetId);
4866
4868
  return {
4867
4869
  ...e,
4868
4870
  muteSettings: t ? new Date(t) : null
4869
4871
  };
4870
4872
  }));
4871
4873
  }
4872
- async function mt(e) {
4873
- let t = V?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4874
+ async function pt(e) {
4875
+ let t = H?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4874
4876
  if (t && (m.value || !n)) return t.mutedUntil;
4875
4877
  if (m.value || !h.value) return t?.mutedUntil ?? null;
4876
4878
  try {
4877
- let n = (await H.getLoggedinUser())?.getUid?.();
4879
+ let n = (await U.getLoggedinUser())?.getUid?.();
4878
4880
  if (!n || e === n) return t?.mutedUntil ?? null;
4879
- let r = qe();
4881
+ let r = Ke();
4880
4882
  if (!r) return t?.mutedUntil ?? null;
4881
- let i = await fetch(`${G().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
4883
+ let i = await fetch(`${K().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
4882
4884
  method: "GET",
4883
4885
  headers: {
4884
4886
  "Content-Type": "application/json",
@@ -4887,7 +4889,7 @@ function cc({ environment: e }) {
4887
4889
  });
4888
4890
  if (!i.ok) return t?.mutedUntil ?? null;
4889
4891
  let a = await i.json();
4890
- return V?.storeParticipantSettings({
4892
+ return H?.storeParticipantSettings({
4891
4893
  chatUid: e,
4892
4894
  mutedUntil: a.mutedUntil ?? null,
4893
4895
  lastUpdated: Date.now()
@@ -4896,12 +4898,12 @@ function cc({ environment: e }) {
4896
4898
  return t?.mutedUntil ?? null;
4897
4899
  }
4898
4900
  }
4899
- function ht(e) {
4901
+ function mt(e) {
4900
4902
  let t = N(e, _.value?.uid);
4901
4903
  if (!Tc(t) || t.isDeleted) return;
4902
4904
  let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
4903
4905
  if (!r) {
4904
- ke();
4906
+ Oe();
4905
4907
  return;
4906
4908
  }
4907
4909
  let i = {
@@ -4911,35 +4913,35 @@ function cc({ environment: e }) {
4911
4913
  unreadCount: n === T.value ? 0 : r.unreadCount + 1,
4912
4914
  lastMessage: t
4913
4915
  };
4914
- v.value = bc(v.value.map((e) => e.id === n ? i : e)), V?.setConversations(v.value);
4916
+ v.value = bc(v.value.map((e) => e.id === n ? i : e)), H?.setConversations(v.value);
4915
4917
  }
4916
- function gt(e) {
4917
- y.value = Sc(y.value, e), T.value && V?.setMessages(T.value, y.value);
4918
+ function ht(e) {
4919
+ y.value = Sc(y.value, e), T.value && H?.setMessages(T.value, y.value);
4918
4920
  }
4919
- function _t(e) {
4920
- e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId && V?.setThreadMessages(e.parentMessageId, b.value));
4921
+ function gt(e) {
4922
+ e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId && H?.setThreadMessages(e.parentMessageId, b.value));
4921
4923
  }
4922
- async function K(e) {
4924
+ async function q(e) {
4923
4925
  if (m.value) return;
4924
4926
  let t = e.getSender?.()?.getUid?.();
4925
- !t || t === _.value?.uid || e.getReadByMeAt?.() || (be(), await H.markAsRead(e));
4927
+ !t || t === _.value?.uid || e.getReadByMeAt?.() || (ye(), await U.markAsRead(e));
4926
4928
  }
4927
- async function yt(e) {
4929
+ async function vt(e) {
4928
4930
  if (m.value) return;
4929
4931
  let t = e.getSender?.()?.getUid?.();
4930
- !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (be(), await H.markAsDelivered(e));
4932
+ !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (ye(), await U.markAsDelivered(e));
4931
4933
  }
4932
- async function bt(e) {
4933
- return m.value ? [] : pc(await H.getMessageReceipts(String(e.id)));
4934
+ async function yt(e) {
4935
+ return m.value ? [] : pc(await U.getMessageReceipts(String(e.id)));
4934
4936
  }
4935
- function xt() {
4936
- 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(), ie = 0, ae = !1, oe = !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, le = null, U = null, ce.clear();
4937
+ function bt() {
4938
+ 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();
4937
4939
  }
4938
- async function St(e) {
4940
+ async function xt(e) {
4939
4941
  if (B) return B;
4940
4942
  let t = e?.includeThread ?? !0;
4941
4943
  B = (async () => {
4942
- P.value && await nt(), t && E.value && await it(E.value.id);
4944
+ P.value && await tt(), t && E.value && await rt(E.value.id);
4943
4945
  })();
4944
4946
  try {
4945
4947
  await B;
@@ -4947,20 +4949,20 @@ function cc({ environment: e }) {
4947
4949
  B = null;
4948
4950
  }
4949
4951
  }
4950
- function Ct(e) {
4951
- wt(e), e.parentMessageId && Dt(e.parentMessageId, e.replyCount), Ot();
4952
+ function St(e) {
4953
+ Ct(e), e.parentMessageId && Et(e.parentMessageId, e.replyCount), Dt();
4952
4954
  }
4953
- function wt(e) {
4955
+ function Ct(e) {
4954
4956
  if (e.parentMessageId) {
4955
4957
  E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e));
4956
4958
  return;
4957
4959
  }
4958
4960
  y.value = Sc(y.value, e), E.value?.id === e.id && (E.value = e);
4959
4961
  }
4960
- function Tt(e, t) {
4962
+ function wt(e, t) {
4961
4963
  return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
4962
4964
  }
4963
- function Et(e, t) {
4965
+ function Tt(e, t) {
4964
4966
  let n = e.reactions.find((e) => e.emoji === t);
4965
4967
  return n ? n.reactedByMe && n.count === 1 ? {
4966
4968
  ...e,
@@ -4981,7 +4983,7 @@ function cc({ environment: e }) {
4981
4983
  }]
4982
4984
  };
4983
4985
  }
4984
- function Dt(e, t) {
4986
+ function Et(e, t) {
4985
4987
  let n = y.value.find((t) => t.id === e);
4986
4988
  if (!n) return;
4987
4989
  let r = {
@@ -4990,18 +4992,18 @@ function cc({ environment: e }) {
4990
4992
  };
4991
4993
  y.value = Sc(y.value, r), E.value?.id === e && (E.value = r);
4992
4994
  }
4993
- function Ot() {
4994
- T.value && V?.setMessages(T.value, y.value), E.value && V?.setThreadMessages(E.value.id, b.value);
4995
+ function Dt() {
4996
+ T.value && H?.setMessages(T.value, y.value), E.value && H?.setThreadMessages(E.value.id, b.value);
4995
4997
  }
4996
- function kt(e) {
4997
- if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), V?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && V?.setMessages(T.value, y.value)), e.muid) {
4998
+ function Ot(e) {
4999
+ 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) {
4998
5000
  k.value = k.value.filter((t) => t.muid !== e.muid);
4999
- let t = V?.getQueue().filter((t) => t.muid === e.muid) ?? [];
5000
- for (let e of t) V?.dequeue(e.id), se.delete(e.id), e.kind === "attachment" && V?.deleteQueuedAttachment(e.id);
5001
+ let t = H?.getQueue().filter((t) => t.muid === e.muid) ?? [];
5002
+ for (let e of t) H?.dequeue(e.id), oe.delete(e.id), e.kind === "attachment" && H?.deleteQueuedAttachment(e.id);
5001
5003
  }
5002
- e.parentMessageId || jt(e.conversationId);
5004
+ e.parentMessageId || At(e.conversationId);
5003
5005
  }
5004
- function At(e) {
5006
+ function kt(e) {
5005
5007
  if (e.parentMessageId) return;
5006
5008
  let t = e.conversationId, n = v.value.find((e) => e.id === t);
5007
5009
  if (!n) return;
@@ -5024,28 +5026,28 @@ function cc({ environment: e }) {
5024
5026
  ...e,
5025
5027
  subtitle: "No messages yet",
5026
5028
  lastMessageAt: void 0
5027
- } : e : e)), V?.setConversations(v.value);
5029
+ } : e : e)), H?.setConversations(v.value);
5028
5030
  }
5029
- function jt(e, t) {
5031
+ function At(e, t) {
5030
5032
  let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
5031
5033
  v.value = bc(v.value.map((t) => t.id === e ? {
5032
5034
  ...t,
5033
5035
  subtitle: r ? Oc(r) : "No messages yet",
5034
5036
  lastMessageAt: r?.sentAt,
5035
5037
  lastMessage: r
5036
- } : t)), V?.setConversations(v.value);
5038
+ } : t)), H?.setConversations(v.value);
5037
5039
  }
5038
- function Mt(e) {
5040
+ function jt(e) {
5039
5041
  v.value = bc(v.value.map((t) => t.id === e.conversationId ? {
5040
5042
  ...t,
5041
5043
  subtitle: Oc(e),
5042
5044
  lastMessageAt: e.sentAt,
5043
5045
  lastMessage: e,
5044
5046
  unreadCount: 0
5045
- } : t)), V?.setConversations(v.value);
5047
+ } : t)), H?.setConversations(v.value);
5046
5048
  }
5047
- function Nt(e) {
5048
- let t = /* @__PURE__ */ new Date(), n = Ft(e.metadata);
5049
+ function Mt(e) {
5050
+ let t = /* @__PURE__ */ new Date(), n = Pt(e.metadata);
5049
5051
  return {
5050
5052
  id: `local-${e.muid}`,
5051
5053
  muid: e.muid,
@@ -5084,11 +5086,11 @@ function cc({ environment: e }) {
5084
5086
  source: null
5085
5087
  };
5086
5088
  }
5087
- function Pt(e, t) {
5089
+ function Nt(e, t) {
5088
5090
  let n = {};
5089
5091
  return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = Js(e), n) : n;
5090
5092
  }
5091
- function Ft(e) {
5093
+ function Pt(e) {
5092
5094
  let t = e.replyPreview;
5093
5095
  if (!t || typeof t != "object") return;
5094
5096
  let n = t;
@@ -5099,13 +5101,13 @@ function cc({ environment: e }) {
5099
5101
  kind: n.kind ?? "text"
5100
5102
  };
5101
5103
  }
5102
- function It(e) {
5104
+ function Ft(e) {
5103
5105
  if (typeof navigator < "u" && !navigator.onLine) return !0;
5104
5106
  let t = Z(e, "").toLowerCase();
5105
5107
  return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
5106
5108
  }
5107
- function Lt(e, t, n, r, i) {
5108
- let a = Nt({
5109
+ function It(e, t, n, r, i) {
5110
+ let a = Mt({
5109
5111
  conversation: e,
5110
5112
  kind: "text",
5111
5113
  text: t,
@@ -5114,7 +5116,7 @@ function cc({ environment: e }) {
5114
5116
  muid: i,
5115
5117
  deliveryState: "queued"
5116
5118
  });
5117
- Ht(a, {
5119
+ Vt(a, {
5118
5120
  id: a.id,
5119
5121
  muid: i,
5120
5122
  conversationId: e.id,
@@ -5127,9 +5129,9 @@ function cc({ environment: e }) {
5127
5129
  createdAt: a.sentAt.toISOString()
5128
5130
  });
5129
5131
  }
5130
- function Rt(e, t, n, r, i) {
5131
- if (zt(e, t, r)) return;
5132
- let a = Nt({
5132
+ function Lt(e, t, n, r, i) {
5133
+ if (Rt(e, t, r)) return;
5134
+ let a = Mt({
5133
5135
  conversation: e,
5134
5136
  kind: "poll",
5135
5137
  text: `Poll: ${t.question}`,
@@ -5139,7 +5141,7 @@ function cc({ environment: e }) {
5139
5141
  muid: i,
5140
5142
  deliveryState: "queued"
5141
5143
  });
5142
- Ht(a, {
5144
+ Vt(a, {
5143
5145
  id: a.id,
5144
5146
  muid: i,
5145
5147
  conversationId: e.id,
@@ -5152,7 +5154,7 @@ function cc({ environment: e }) {
5152
5154
  createdAt: a.sentAt.toISOString()
5153
5155
  });
5154
5156
  }
5155
- function zt(e, t, n) {
5157
+ function Rt(e, t, n) {
5156
5158
  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);
5157
5159
  return k.value.some((t) => {
5158
5160
  if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
@@ -5160,8 +5162,8 @@ function cc({ environment: e }) {
5160
5162
  return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
5161
5163
  });
5162
5164
  }
5163
- async function Bt(e, t, n, r, i) {
5164
- let a = Nc(t.file), o = Nt({
5165
+ async function zt(e, t, n, r, i) {
5166
+ let a = Nc(t.file), o = Mt({
5165
5167
  conversation: e,
5166
5168
  kind: a,
5167
5169
  text: t.caption?.trim() ?? "",
@@ -5193,19 +5195,19 @@ function cc({ environment: e }) {
5193
5195
  parentMessageId: r,
5194
5196
  createdAt: o.sentAt.toISOString()
5195
5197
  };
5196
- se.set(s.id, t.file);
5198
+ oe.set(s.id, t.file);
5197
5199
  try {
5198
- await V?.storeQueuedAttachment(s.id, t.file);
5200
+ await H?.storeQueuedAttachment(s.id, t.file);
5199
5201
  } catch {}
5200
- Ht(o, s);
5202
+ Vt(o, s);
5201
5203
  }
5202
- function Ht(e, t) {
5203
- k.value = [...k.value, t], V?.enqueue(t), Ut(e);
5204
+ function Vt(e, t) {
5205
+ k.value = [...k.value, t], H?.enqueue(t), Ht(e);
5204
5206
  }
5205
- function Ut(e) {
5206
- 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();
5207
+ function Ht(e) {
5208
+ e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e)), Et(e.parentMessageId)) : y.value = Sc(y.value, e), jt(e), Dt();
5207
5209
  }
5208
- function Wt(e, t) {
5210
+ function Ut(e, t) {
5209
5211
  let n = (n) => n.map((n) => {
5210
5212
  let r = Ec(n);
5211
5213
  return n.muid !== t && r !== t ? n : {
@@ -5213,40 +5215,40 @@ function cc({ environment: e }) {
5213
5215
  deliveryState: e
5214
5216
  };
5215
5217
  });
5216
- y.value = n(y.value), b.value = n(b.value), Ot();
5218
+ y.value = n(y.value), b.value = n(b.value), Dt();
5217
5219
  }
5218
- function Gt(e) {
5220
+ function Wt(e) {
5219
5221
  if (!e) return;
5220
5222
  let t = [...y.value, ...b.value].filter((t) => {
5221
5223
  if (!t.id.startsWith("local-")) return !1;
5222
5224
  let n = Ec(t);
5223
5225
  return t.muid === e || n === e;
5224
5226
  });
5225
- for (let e of t) kt(e);
5227
+ for (let e of t) Ot(e);
5226
5228
  }
5227
- async function Kt() {
5229
+ async function Gt() {
5228
5230
  if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
5229
5231
  f.value = !0;
5230
5232
  try {
5231
- let e = [...k.value].filter((e) => !ce.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5232
- for (let t of e) if (!ce.has(t.id)) {
5233
- ce.add(t.id);
5233
+ let e = [...k.value].filter((e) => !se.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5234
+ for (let t of e) if (!se.has(t.id)) {
5235
+ se.add(t.id);
5234
5236
  try {
5235
- let e = await qt(t);
5236
- k.value = k.value.filter((e) => e.id !== t.id), V?.dequeue(t.id), se.delete(t.id), t.kind === "attachment" && await V?.deleteQueuedAttachment(t.id), Gt(t.muid), e ? Ct(N(e, _.value?.uid)) : await St();
5237
+ let e = await Kt(t);
5238
+ 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), Wt(t.muid), e ? St(N(e, _.value?.uid)) : await xt();
5237
5239
  } finally {
5238
- ce.delete(t.id);
5240
+ se.delete(t.id);
5239
5241
  }
5240
5242
  }
5241
5243
  } catch (e) {
5242
- It(e) || (g.value = Z(e, "Unable to sync queued messages."));
5244
+ Ft(e) || (g.value = Z(e, "Unable to sync queued messages."));
5243
5245
  } finally {
5244
5246
  f.value = !1;
5245
5247
  }
5246
5248
  }
5247
5249
  }
5248
- async function qt(e) {
5249
- let t = e.receiverType === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
5250
+ async function Kt(e) {
5251
+ let t = e.receiverType === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
5250
5252
  if (e.kind === "poll" && e.poll) {
5251
5253
  let n = {
5252
5254
  question: e.poll.question,
@@ -5255,17 +5257,17 @@ function cc({ environment: e }) {
5255
5257
  receiverType: t
5256
5258
  };
5257
5259
  e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
5258
- let r = await H.callExtension("polls", "POST", "v2/create", n);
5260
+ let r = await U.callExtension("polls", "POST", "v2/create", n);
5259
5261
  return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
5260
5262
  }
5261
5263
  if (e.kind === "attachment" && e.attachment) {
5262
- let n = se.get(e.id) ?? await V?.getQueuedAttachment(e.id) ?? null;
5264
+ let n = oe.get(e.id) ?? await H?.getQueuedAttachment(e.id) ?? null;
5263
5265
  if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
5264
- let r = new H.MediaMessage(e.targetId, n, e.attachment.kind, t);
5265
- 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);
5266
+ let r = new U.MediaMessage(e.targetId, n, e.attachment.kind, t);
5267
+ 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);
5266
5268
  }
5267
- let n = new H.TextMessage(e.targetId, e.text ?? "", t);
5268
- 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);
5269
+ let n = new U.TextMessage(e.targetId, e.text ?? "", t);
5270
+ 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);
5269
5271
  }
5270
5272
  return {
5271
5273
  initialized: t,
@@ -5296,69 +5298,69 @@ function cc({ environment: e }) {
5296
5298
  activeThreadParentMessage: E,
5297
5299
  replyToMessage: D,
5298
5300
  editingMessage: O,
5299
- init: de,
5300
- connectRealtime: De,
5301
- disconnectRealtime: Oe,
5302
- login: fe,
5303
- logout: pe,
5304
- fetchConversations: ke,
5305
- selectConversation: Ae,
5306
- sendTextMessage: Fe,
5307
- sendAttachmentMessage: Le,
5308
- sendPollMessage: Re,
5309
- fetchScheduledMessages: We,
5310
- loadOlderMessages: at,
5311
- loadOlderThreadMessages: ot,
5312
- ensureMessageLoaded: st,
5313
- scheduleMessage: Ge,
5314
- rescheduleMessage: Xe,
5315
- removeScheduledMessage: Ke,
5316
- editScheduledMessage: Ye,
5317
- setReplyToMessage: je,
5318
- setEditingMessage: Me,
5319
- openThread: Ne,
5320
- closeThread: Pe,
5321
- refreshVisibleMessages: St,
5322
- fetchMessageReceipts: bt,
5323
- deleteMessage: Ve,
5324
- votePoll: W,
5325
- toggleReaction: Be,
5326
- translateMessage: Ue,
5301
+ init: ue,
5302
+ connectRealtime: Ee,
5303
+ disconnectRealtime: De,
5304
+ login: de,
5305
+ logout: fe,
5306
+ fetchConversations: Oe,
5307
+ selectConversation: ke,
5308
+ sendTextMessage: Pe,
5309
+ sendAttachmentMessage: Ie,
5310
+ sendPollMessage: Le,
5311
+ fetchScheduledMessages: Ue,
5312
+ loadOlderMessages: it,
5313
+ loadOlderThreadMessages: at,
5314
+ ensureMessageLoaded: ot,
5315
+ scheduleMessage: We,
5316
+ rescheduleMessage: Ye,
5317
+ removeScheduledMessage: Ge,
5318
+ editScheduledMessage: Je,
5319
+ setReplyToMessage: Ae,
5320
+ setEditingMessage: je,
5321
+ openThread: Me,
5322
+ closeThread: Ne,
5323
+ refreshVisibleMessages: xt,
5324
+ fetchMessageReceipts: yt,
5325
+ deleteMessage: Be,
5326
+ votePoll: G,
5327
+ toggleReaction: ze,
5328
+ translateMessage: He,
5327
5329
  mentionDisplayNamesByUid: A,
5328
5330
  rememberMentionDisplayNames: M
5329
5331
  };
5330
5332
  }
5331
5333
  async function lc(e) {
5332
- return He(e), oc === e && sc || (sc = (async () => {
5333
- let t = G(), n = new H.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(H.StorageMode.SESSION).build();
5334
- await H.init(t.appId, n), oc = e;
5334
+ return Ve(e), oc === e && sc || (sc = (async () => {
5335
+ let t = K(), n = new U.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(U.StorageMode.SESSION).build();
5336
+ await U.init(t.appId, n), oc = e;
5335
5337
  })()), sc;
5336
5338
  }
5337
5339
  async function uc(e) {
5338
5340
  let t = JSON.parse(atob(e.split(".")[1]));
5339
5341
  if (!t.sub) throw Error("Cannot read JWT subject from access token.");
5340
- let n = Ye();
5342
+ let n = Je();
5341
5343
  if (n && n.sub === t.sub && n.token) return n.token;
5342
- let r = await fetch(`${G().chatApiBaseUrl}/chats/token`, {
5344
+ let r = await fetch(`${K().chatApiBaseUrl}/chats/token`, {
5343
5345
  method: "POST",
5344
5346
  headers: new Headers([["Authorization", `Bearer ${e}`]])
5345
5347
  });
5346
- if (r.status === 401) throw Je(null), Qe(), Error("Unauthorized while fetching CometChat token.");
5348
+ if (r.status === 401) throw qe(null), Ze(), Error("Unauthorized while fetching CometChat token.");
5347
5349
  if (!r.ok) throw Error(`Token exchange failed with status ${r.status}.`);
5348
5350
  let i = await r.json();
5349
- return Ze({
5351
+ return Xe({
5350
5352
  sub: t.sub,
5351
5353
  token: i.token
5352
5354
  }), i.token;
5353
5355
  }
5354
5356
  function dc(e, t) {
5355
- 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;
5357
+ 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;
5356
5358
  if (c && e.getConversationId() === c) return {
5357
5359
  id: e.getConversationId(),
5358
5360
  targetId: o,
5359
5361
  type: r,
5360
- title: vt("scheduledMessages"),
5361
- subtitle: vt("hiddenHelperConversation"),
5362
+ title: _t("scheduledMessages"),
5363
+ subtitle: _t("hiddenHelperConversation"),
5362
5364
  unreadCount: 0,
5363
5365
  tags: [],
5364
5366
  source: e
@@ -5370,7 +5372,7 @@ function dc(e, t) {
5370
5372
  type: r,
5371
5373
  title: n.getName() ?? o,
5372
5374
  subtitle: l && Tc(l) && !l.isDeleted ? Oc(l) : "No messages yet",
5373
- avatar: i ? $e(i.getAvatar()) : void 0,
5375
+ avatar: i ? Qe(i.getAvatar()) : void 0,
5374
5376
  unreadCount: Number.isFinite(u) ? u : 0,
5375
5377
  lastMessageAt: s && !l?.isDeleted ? /* @__PURE__ */ new Date((s.getSentAt?.() ?? 0) * 1e3) : void 0,
5376
5378
  tags: (e.getTags() ?? []).map((e) => String(e)),
@@ -5429,7 +5431,7 @@ function hc(e) {
5429
5431
  return {
5430
5432
  uid: e.getUid(),
5431
5433
  name: e.getName?.() ?? e.getUid(),
5432
- avatar: $e(e.getAvatar?.()),
5434
+ avatar: Qe(e.getAvatar?.()),
5433
5435
  status: e.getStatus?.() ?? void 0
5434
5436
  };
5435
5437
  }
@@ -5449,7 +5451,7 @@ function vc(e, t) {
5449
5451
  let n = e.getType?.(), r = e.getCategory?.(), i = el(e);
5450
5452
  if (String(r).toLowerCase() === "action") return Uc(e);
5451
5453
  if (i) return `Poll: ${i.question}`;
5452
- if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5454
+ if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5453
5455
  let t = Us(e.getText());
5454
5456
  if (t) return t;
5455
5457
  }
@@ -5457,14 +5459,14 @@ function vc(e, t) {
5457
5459
  let t = Yc(e, Kc(e))[0];
5458
5460
  return e.getCaption?.()?.trim?.() || zs(t ? [t] : [], "Sent an attachment");
5459
5461
  }
5460
- return e.getSender?.()?.getUid?.() === t ? vt("youSentAMessage") : vt("unsupportedMessageType");
5462
+ return e.getSender?.()?.getUid?.() === t ? _t("youSentAMessage") : _t("unsupportedMessageType");
5461
5463
  }
5462
5464
  function yc(e, t) {
5463
5465
  if (e.getDeletedAt?.()) return "Message removed";
5464
5466
  let n = e.getType?.(), r = e.getCategory?.(), i = el(e);
5465
5467
  if (String(r).toLowerCase() === "action") return Uc(e);
5466
5468
  if (i) return `Poll: ${i.question}`;
5467
- if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5469
+ if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5468
5470
  let t = Bs(e.getText?.());
5469
5471
  if (Hs(t)) return t;
5470
5472
  }
@@ -5474,10 +5476,10 @@ function yc(e, t) {
5474
5476
  let n = Yc(e, Kc(e))[0];
5475
5477
  return zs(n ? [n] : [], "Sent an attachment");
5476
5478
  }
5477
- return e.getSender?.()?.getUid?.() === t ? vt("youSentAMessage") : vt("unsupportedMessageType");
5479
+ return e.getSender?.()?.getUid?.() === t ? _t("youSentAMessage") : _t("unsupportedMessageType");
5478
5480
  }
5479
5481
  function bc(e) {
5480
- return [...e].filter((e) => e.title !== vt("scheduledMessages")).sort((e, t) => {
5482
+ return [...e].filter((e) => e.title !== _t("scheduledMessages")).sort((e, t) => {
5481
5483
  let n = e.lastMessageAt?.getTime() ?? 0;
5482
5484
  return (t.lastMessageAt?.getTime() ?? 0) - n;
5483
5485
  });
@@ -5516,17 +5518,17 @@ function Z(e, t) {
5516
5518
  return e instanceof Error && e.message ? e.message : t;
5517
5519
  }
5518
5520
  function kc(e) {
5519
- return e.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
5521
+ return e.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
5520
5522
  }
5521
5523
  function Ac() {
5522
- let e = qe();
5524
+ let e = Ke();
5523
5525
  if (!e) throw Error("Missing access token.");
5524
5526
  return e;
5525
5527
  }
5526
5528
  async function jc(e, t, n) {
5527
5529
  let r = t.text?.trim();
5528
5530
  if (!r) return;
5529
- let i = Ac(), a = await fetch(`${G().chatApiBaseUrl}/chats/scheduledMessages`, {
5531
+ let i = Ac(), a = await fetch(`${K().chatApiBaseUrl}/chats/scheduledMessages`, {
5530
5532
  method: "POST",
5531
5533
  headers: {
5532
5534
  "Content-Type": "application/json",
@@ -5546,9 +5548,9 @@ async function jc(e, t, n) {
5546
5548
  }
5547
5549
  async function Mc(e, t, n) {
5548
5550
  if (!t.file) return;
5549
- let r = Ac(), i = Ye()?.token;
5551
+ let r = Ac(), i = Je()?.token;
5550
5552
  if (!i) throw Error("Missing CometChat auth token.");
5551
- 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`, {
5553
+ 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`, {
5552
5554
  method: "POST",
5553
5555
  headers: {
5554
5556
  Accept: "multipart/form-data",
@@ -5569,7 +5571,7 @@ function Pc(e) {
5569
5571
  return t;
5570
5572
  }
5571
5573
  function Fc(e, t, n, r, i, a) {
5572
- let o = new H.MediaMessage(e.targetId, t, n, kc(e));
5574
+ let o = new U.MediaMessage(e.targetId, t, n, kc(e));
5573
5575
  return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
5574
5576
  scheduleDate: i,
5575
5577
  file: t,
@@ -5602,11 +5604,11 @@ function Rc(e, t) {
5602
5604
  return typeof n == "string" && n.trim() ? n.trim() : e?.getName?.() ?? "System";
5603
5605
  }
5604
5606
  function zc(e, t) {
5605
- return $e(Vc(t)) || (Bc(e, "sender") ?? void 0);
5607
+ return Qe(Vc(t)) || (Bc(e, "sender") ?? void 0);
5606
5608
  }
5607
5609
  function Bc(e, t) {
5608
5610
  let n = ol(e)?.entities?.[t]?.entity;
5609
- return $e(Vc(n));
5611
+ return Qe(Vc(n));
5610
5612
  }
5611
5613
  function Vc(e) {
5612
5614
  if (!e || typeof e != "object") return e;
@@ -5854,9 +5856,9 @@ function ll(e, t) {
5854
5856
  let n = t?.value?.getMetadata?.() ?? {};
5855
5857
  if (!e?.getSender?.() || n.isChannel) return "";
5856
5858
  let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
5857
- e instanceof H.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5859
+ e instanceof U.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5858
5860
  let a = i.systemDisplayName;
5859
- 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?.();
5861
+ 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?.();
5860
5862
  }
5861
5863
  function ul(e, t = 25, n) {
5862
5864
  let r = e.trim();
@@ -5879,7 +5881,7 @@ function ul(e, t = 25, n) {
5879
5881
  };
5880
5882
  }
5881
5883
  async function dl(e) {
5882
- let t = new H.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
5884
+ let t = new U.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
5883
5885
  try {
5884
5886
  for (; n;) {
5885
5887
  let e = await t.fetchNext();
@@ -5898,7 +5900,7 @@ async function dl(e) {
5898
5900
  }
5899
5901
  async function fl(e) {
5900
5902
  await Sl("failed to get muted setting. User not logged in");
5901
- let t = await Cl(`${G().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
5903
+ let t = await Cl(`${K().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
5902
5904
  return yl()?.storeParticipantSettings({
5903
5905
  chatUid: e,
5904
5906
  mutedUntil: t.mutedUntil,
@@ -5907,7 +5909,7 @@ async function fl(e) {
5907
5909
  }
5908
5910
  async function pl(e, t) {
5909
5911
  await Sl("failed to mute chat. User not logged in");
5910
- let n = await Cl(`${G().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, {
5912
+ let n = await Cl(`${K().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, {
5911
5913
  method: "PATCH",
5912
5914
  body: JSON.stringify({ mutedUntil: t })
5913
5915
  });
@@ -5918,10 +5920,10 @@ async function pl(e, t) {
5918
5920
  }), n.mutedUntil;
5919
5921
  }
5920
5922
  async function ml() {
5921
- return await Sl("failed to get muted all setting. User not logged in"), Cl(`${G().chatApiBaseUrl}/person/settings`, { method: "GET" });
5923
+ return await Sl("failed to get muted all setting. User not logged in"), Cl(`${K().chatApiBaseUrl}/person/settings`, { method: "GET" });
5922
5924
  }
5923
5925
  async function hl(e) {
5924
- return await Sl("failed to update person settings. User not logged in"), Cl(`${G().chatApiBaseUrl}/person/settings`, {
5926
+ return await Sl("failed to update person settings. User not logged in"), Cl(`${K().chatApiBaseUrl}/person/settings`, {
5925
5927
  method: "PATCH",
5926
5928
  body: JSON.stringify(e)
5927
5929
  });
@@ -5946,19 +5948,19 @@ function yl() {
5946
5948
  return e ? new $s(e) : null;
5947
5949
  }
5948
5950
  function bl() {
5949
- let e = lt();
5950
- return e ? `bcc-chat:${G().appId}:${e}` : null;
5951
+ let e = ct();
5952
+ return e ? `bcc-chat:${K().appId}:${e}` : null;
5951
5953
  }
5952
5954
  function xl() {
5953
- return H.__bccCompatLoggedInUser ?? null;
5955
+ return U.__bccCompatLoggedInUser ?? null;
5954
5956
  }
5955
5957
  async function Sl(e) {
5956
- let t = await H.getLoggedinUser();
5957
- if (H.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
5958
+ let t = await U.getLoggedinUser();
5959
+ if (U.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
5958
5960
  return t;
5959
5961
  }
5960
5962
  async function Cl(e, t) {
5961
- let n = qe();
5963
+ let n = Ke();
5962
5964
  if (!n) throw Error("Missing access token.");
5963
5965
  let r = await fetch(e, {
5964
5966
  ...t,
@@ -6022,7 +6024,7 @@ function Vl(e) {
6022
6024
  if (Q.value && !e && !Al.value) return Q.value;
6023
6025
  let t = e ?? Al.value;
6024
6026
  if (!t) throw Error("Environment has not been set yet. Call app.use(chat, { environment: ... }) first.");
6025
- return (!Q.value || Al.value !== t) && (Al.value = t, He(t), Q.value = cc({ environment: t })), Q.value;
6027
+ return (!Q.value || Al.value !== t) && (Al.value = t, Ve(t), Q.value = cc({ environment: t })), Q.value;
6026
6028
  }
6027
6029
  var Hl = n(() => Q.value?.currentUser.value?.uid);
6028
6030
  function Ul(e) {
@@ -6037,7 +6039,7 @@ async function Wl(e) {
6037
6039
  if (!Ll.has(e)) {
6038
6040
  Ll.add(e);
6039
6041
  try {
6040
- let t = await H.getMessageReceipts(e);
6042
+ let t = await U.getMessageReceipts(e);
6041
6043
  Il.value = {
6042
6044
  ...Il.value,
6043
6045
  [e]: Ul(t)
@@ -6095,17 +6097,17 @@ F([() => Q.value?.conversations.value, () => Hl.value], async () => {
6095
6097
  Il.value = {}, Ll.clear();
6096
6098
  });
6097
6099
  async function Ql(e, t) {
6098
- Pl.value = t.loggerCallback, _t(t.language ?? "en"), Bl(t.themeMode);
6100
+ Pl.value = t.loggerCallback, gt(t.language ?? "en"), Bl(t.themeMode);
6099
6101
  let n = e.config.globalProperties.$primevue;
6100
- n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", _h), e.component("BccChatMessageList", _h), e.provide("theme", { theme: El });
6102
+ n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", vh), e.component("BccChatMessageList", vh), e.provide("theme", { theme: El });
6101
6103
  let r = Vl(t.environment);
6102
6104
  zl(Ol.INFO, "Initializing chat", {
6103
6105
  environment: t.environment,
6104
- language: pt.value,
6106
+ language: ft.value,
6105
6107
  themeMode: t.themeMode
6106
6108
  }), await r.init(), kl.value = !0, Rl?.(), p(t.accessToken) ? Rl = F(t.accessToken, async (e) => {
6107
6109
  e ? await $l(e) : await eu();
6108
- }, { immediate: !0 }) : t.accessToken && await $l(t.accessToken), zl(Ol.INFO, "Chat initialized", { environment: G().appId });
6110
+ }, { immediate: !0 }) : t.accessToken && await $l(t.accessToken), zl(Ol.INFO, "Chat initialized", { environment: K().appId });
6109
6111
  }
6110
6112
  async function $l(e) {
6111
6113
  if (!e) return eu();
@@ -6133,7 +6135,7 @@ function iu(e) {
6133
6135
  Ml.value = e;
6134
6136
  }
6135
6137
  function au(e) {
6136
- _t(e);
6138
+ gt(e);
6137
6139
  }
6138
6140
  function ou(e) {
6139
6141
  Bl(e);
@@ -6147,7 +6149,7 @@ function cu(e) {
6147
6149
  async function lu(e) {
6148
6150
  if (!Jl.value) return null;
6149
6151
  try {
6150
- return await H.getGroup(e);
6152
+ return await U.getGroup(e);
6151
6153
  } catch (e) {
6152
6154
  return e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND" ? void 0 : null;
6153
6155
  }
@@ -6162,7 +6164,7 @@ async function du(e) {
6162
6164
  }
6163
6165
  async function fu(e) {
6164
6166
  try {
6165
- return Jl.value && (await H.getOnlineGroupMemberCount([e]))[e] || 0;
6167
+ return Jl.value && (await U.getOnlineGroupMemberCount([e]))[e] || 0;
6166
6168
  } catch {
6167
6169
  return 0;
6168
6170
  }
@@ -6194,7 +6196,7 @@ var gu = {
6194
6196
  login: $l,
6195
6197
  logout: eu,
6196
6198
  setCurrentEnvironment: cu,
6197
- getCurrentEnvironment: G,
6199
+ getCurrentEnvironment: K,
6198
6200
  setThemeMode: ou,
6199
6201
  setLanguage: au,
6200
6202
  getGroup: lu,
@@ -6206,7 +6208,7 @@ var gu = {
6206
6208
  searchChat: (e, t = 25) => ul(e, t, Q.value?.currentUser.value?.uid),
6207
6209
  getSenderDisplayName: ll,
6208
6210
  getMessageTextPreview: qs,
6209
- proxyImage: et,
6211
+ proxyImage: $e,
6210
6212
  getMutedUntil: mu,
6211
6213
  muteChat: pu,
6212
6214
  getMyChatSettings: ml,
@@ -6214,7 +6216,7 @@ var gu = {
6214
6216
  setMuteAll: gl,
6215
6217
  toggleMuteAll: _l,
6216
6218
  toMarkdownHtml: ks,
6217
- retrieveCcToken: Xe,
6219
+ retrieveCcToken: Ye,
6218
6220
  getChatMessages: Ml,
6219
6221
  scrollToMessageId: Nl,
6220
6222
  scrollToMessage: hu,
@@ -6223,7 +6225,7 @@ var gu = {
6223
6225
  onlineStatus: Yl.onlineStatus,
6224
6226
  theme: El,
6225
6227
  themeMode: jl,
6226
- language: pt
6228
+ language: ft
6227
6229
  };
6228
6230
  //#endregion
6229
6231
  //#region src/chat/conversationState.ts
@@ -6274,7 +6276,7 @@ function Ou(e) {
6274
6276
  uid: t.targetId,
6275
6277
  displayName: t.title,
6276
6278
  avatar: t.avatar
6277
- }] : a.filter((e) => e.uid !== n).map(Et) : [];
6279
+ }] : a.filter((e) => e.uid !== n).map(Tt) : [];
6278
6280
  });
6279
6281
  return {
6280
6282
  client: t,
@@ -6288,7 +6290,7 @@ function Ou(e) {
6288
6290
  isChannel: u,
6289
6291
  sendOptions: d,
6290
6292
  mentionCandidates: f,
6291
- mentionNameByUid: n(() => Ht(Dt(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
6293
+ mentionNameByUid: n(() => Vt(Et(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
6292
6294
  };
6293
6295
  }
6294
6296
  var ku = Symbol("conversationCtx");
@@ -6673,10 +6675,10 @@ function Qu(e) {
6673
6675
  return;
6674
6676
  }
6675
6677
  try {
6676
- t.value = (await new H.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6678
+ t.value = (await new U.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6677
6679
  uid: e.getUid(),
6678
6680
  displayName: e.getName(),
6679
- avatar: $e(e.getAvatar?.()) ?? "",
6681
+ avatar: Qe(e.getAvatar?.()) ?? "",
6680
6682
  role: e.getScope()
6681
6683
  })), e.onMembersChanged(t.value);
6682
6684
  } catch {
@@ -6689,8 +6691,8 @@ function Qu(e) {
6689
6691
  let c = {
6690
6692
  uid: r.getUid(),
6691
6693
  displayName: r.getName(),
6692
- avatar: $e(r.getAvatar?.()) ?? "",
6693
- role: a ?? r.getScope?.() ?? H.GROUP_MEMBER_SCOPE.PARTICIPANT
6694
+ avatar: Qe(r.getAvatar?.()) ?? "",
6695
+ role: a ?? r.getScope?.() ?? U.GROUP_MEMBER_SCOPE.PARTICIPANT
6694
6696
  };
6695
6697
  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 ? {
6696
6698
  ...e,
@@ -6698,7 +6700,7 @@ function Qu(e) {
6698
6700
  } : e), e.onMembersChanged(t.value);
6699
6701
  }
6700
6702
  return b(() => {
6701
- H.addGroupListener(n, new H.GroupListener({
6703
+ U.addGroupListener(n, new U.GroupListener({
6702
6704
  onGroupMemberScopeChanged: (e, t, n, r, a) => {
6703
6705
  i(a, t, "update", n);
6704
6706
  },
@@ -6722,7 +6724,7 @@ function Qu(e) {
6722
6724
  }
6723
6725
  }));
6724
6726
  }), x(() => {
6725
- H.removeGroupListener(n);
6727
+ U.removeGroupListener(n);
6726
6728
  }), {
6727
6729
  groupMembers: t,
6728
6730
  fetchGroupMembers: r
@@ -6805,7 +6807,7 @@ function id(e) {
6805
6807
  triggerChar: "@",
6806
6808
  enabled: e.enabled,
6807
6809
  maxSuggestions: e.maxSuggestions ?? 8,
6808
- getCandidates: (t) => Ot(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
6810
+ getCandidates: (t) => Dt(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
6809
6811
  id: e.uid,
6810
6812
  label: e.displayName,
6811
6813
  avatar: e.avatar
@@ -6975,7 +6977,7 @@ function ud(e, t, r, i) {
6975
6977
  }, { deep: !0 });
6976
6978
  function C(e) {
6977
6979
  let t = Es(e);
6978
- return t.includes("<@uid:") ? Es(Ft(t, i.getMentionNameByUid?.() ?? {})) : t;
6980
+ return t.includes("<@uid:") ? Es(Pt(t, i.getMentionNameByUid?.() ?? {})) : t;
6979
6981
  }
6980
6982
  F(() => i.getModelValue(), (e) => {
6981
6983
  let n = t.value, r = C(e);
@@ -7068,21 +7070,21 @@ function ud(e, t, r, i) {
7068
7070
  function I(e) {
7069
7071
  x(e), D();
7070
7072
  }
7071
- function te() {
7073
+ function L() {
7072
7074
  k() || O();
7073
7075
  }
7074
- function L() {
7076
+ function R() {
7075
7077
  o.value += 1, O(), g(), l.value = "", i.updateModelValue("");
7076
7078
  }
7077
7079
  return b(() => {
7078
- document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", te), h(() => {
7080
+ document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", L), h(() => {
7079
7081
  if (t.value) {
7080
7082
  let e = C(i.getModelValue());
7081
7083
  t.value.innerHTML = e, T(t.value), e ? delete t.value.dataset.empty : t.value.dataset.empty = "true", l.value = e;
7082
7084
  }
7083
7085
  });
7084
7086
  }), y(() => {
7085
- document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", te);
7087
+ document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", L);
7086
7088
  }), {
7087
7089
  applyFormat: A,
7088
7090
  editorKey: o,
@@ -7093,7 +7095,7 @@ function ud(e, t, r, i) {
7093
7095
  handleKeydown: M,
7094
7096
  handlePaste: ee,
7095
7097
  hideFormatMenu: O,
7096
- resetEditor: L,
7098
+ resetEditor: R,
7097
7099
  showFormatMenu: s,
7098
7100
  triggerCandidates: d,
7099
7101
  triggerMenuPosition: f,
@@ -7108,29 +7110,29 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7108
7110
  __name: "ComposerActionsPopover",
7109
7111
  emits: ["pickFile", "openPoll"],
7110
7112
  setup(t, { expose: n, emit: i }) {
7111
- 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 = [
7113
+ 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 = [
7112
7114
  {
7113
7115
  kind: "image",
7114
7116
  label: "attachImage",
7115
- icon: we,
7117
+ icon: Ce,
7116
7118
  testId: "composer-attach-image"
7117
7119
  },
7118
7120
  {
7119
7121
  kind: "video",
7120
7122
  label: "attachVideo",
7121
- icon: Re,
7123
+ icon: Le,
7122
7124
  testId: "composer-attach-video"
7123
7125
  },
7124
7126
  {
7125
7127
  kind: "audio",
7126
7128
  label: "attachAudio",
7127
- icon: Oe,
7129
+ icon: De,
7128
7130
  testId: "composer-attach-audio"
7129
7131
  },
7130
7132
  {
7131
7133
  kind: "file",
7132
7134
  label: "attachFile",
7133
- icon: le,
7135
+ icon: ce,
7134
7136
  testId: "composer-attach-file"
7135
7137
  }
7136
7138
  ];
@@ -7158,7 +7160,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7158
7160
  }), n({
7159
7161
  toggle: p,
7160
7162
  hide: m
7161
- }), (t, n) => te((S(), a("div", {
7163
+ }), (t, n) => L((S(), a("div", {
7162
7164
  ref_key: "menuRef",
7163
7165
  ref: l,
7164
7166
  class: "composer-actions-menu",
@@ -7174,7 +7176,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7174
7176
  class: "composer-actions-menu__item",
7175
7177
  "data-testid": "composer-create-poll",
7176
7178
  onClick: g
7177
- }, [o("span", pd, [(S(), r(D(j(U)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
7179
+ }, [o("span", pd, [(S(), r(D(j(W)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
7178
7180
  }
7179
7181
  }), $ = (e, t) => {
7180
7182
  let n = e.__vccOpts || e;
@@ -7189,13 +7191,13 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7189
7191
  },
7190
7192
  emits: ["cancel"],
7191
7193
  setup(e, { emit: t }) {
7192
- let r = e, i = t, { t: s } = K(), c = ju(), u = n(() => Ws(r.message, s("message"), c.mentionNameByUid.value));
7194
+ let r = e, i = t, { t: s } = q(), c = ju(), u = n(() => Ws(r.message, s("message"), c.mentionNameByUid.value));
7193
7195
  return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div", gd, [
7194
7196
  o("p", _d, k(e.variant === "editing" ? j(s)("editingInContext", { context: e.contextLabel }) : j(s)("replyingInContext", { context: e.contextLabel })), 1),
7195
7197
  o("p", vd, k(e.message.senderName), 1),
7196
7198
  o("p", yd, k(u.value), 1)
7197
7199
  ]), l(j(z), {
7198
- icon: j(fe),
7200
+ icon: j(de),
7199
7201
  text: "",
7200
7202
  rounded: "",
7201
7203
  severity: "secondary",
@@ -7210,7 +7212,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7210
7212
  },
7211
7213
  emits: ["format"],
7212
7214
  setup(e, { emit: t }) {
7213
- let n = t, { t: r } = K();
7215
+ let n = t, { t: r } = q();
7214
7216
  return (t, s) => e.visible ? (S(), a("div", {
7215
7217
  key: 0,
7216
7218
  class: "format-menu",
@@ -7222,19 +7224,19 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7222
7224
  o("button", {
7223
7225
  type: "button",
7224
7226
  class: "format-menu__item",
7225
- onMousedown: s[0] ||= L(() => {}, ["prevent"]),
7227
+ onMousedown: s[0] ||= R(() => {}, ["prevent"]),
7226
7228
  onClick: s[1] ||= (e) => n("format", "bold")
7227
7229
  }, [s[6] ||= o("span", { class: "format-menu__icon font-bold" }, "B", -1), o("span", null, k(j(r)("bold")), 1)], 32),
7228
7230
  o("button", {
7229
7231
  type: "button",
7230
7232
  class: "format-menu__item",
7231
- onMousedown: s[2] ||= L(() => {}, ["prevent"]),
7233
+ onMousedown: s[2] ||= R(() => {}, ["prevent"]),
7232
7234
  onClick: s[3] ||= (e) => n("format", "italic")
7233
7235
  }, [s[7] ||= o("span", { class: "format-menu__icon italic" }, "I", -1), o("span", null, k(j(r)("italic")), 1)], 32),
7234
7236
  o("button", {
7235
7237
  type: "button",
7236
7238
  class: "format-menu__item",
7237
- onMousedown: s[4] ||= L(() => {}, ["prevent"]),
7239
+ onMousedown: s[4] ||= R(() => {}, ["prevent"]),
7238
7240
  onClick: s[5] ||= (e) => n("format", "underline")
7239
7241
  }, [s[8] ||= o("span", { class: "format-menu__icon underline" }, "U", -1), o("span", null, k(j(r)("underline")), 1)], 32)
7240
7242
  ], 4)) : i("", !0);
@@ -7247,7 +7249,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7247
7249
  },
7248
7250
  emits: ["update:visible", "send"],
7249
7251
  setup(t, { expose: i, emit: s }) {
7250
- let c = t, u = s, { t: d } = K(), f = w(""), p = w(["", ""]), m = n(() => {
7252
+ let c = t, u = s, { t: d } = q(), f = w(""), p = w(["", ""]), m = n(() => {
7251
7253
  let e = f.value.trim(), t = p.value.map((e) => e.trim()).filter(Boolean);
7252
7254
  return !!e && t.length >= 2;
7253
7255
  });
@@ -7283,7 +7285,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7283
7285
  onClick: y
7284
7286
  }, null, 8, ["label"]), l(j(z), {
7285
7287
  label: j(d)("sendPoll"),
7286
- icon: j(Pe),
7288
+ icon: j(Ne),
7287
7289
  disabled: c.disabled || !m.value,
7288
7290
  onClick: v
7289
7291
  }, null, 8, [
@@ -7311,7 +7313,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7311
7313
  "placeholder",
7312
7314
  "onUpdate:modelValue"
7313
7315
  ]), l(j(z), {
7314
- icon: j(fe),
7316
+ icon: j(de),
7315
7317
  text: "",
7316
7318
  rounded: "",
7317
7319
  severity: "secondary",
@@ -7324,7 +7326,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7324
7326
  ])]))), 128)),
7325
7327
  l(j(z), {
7326
7328
  label: j(d)("addOption"),
7327
- icon: j(ce),
7329
+ icon: j(se),
7328
7330
  text: "",
7329
7331
  onClick: h
7330
7332
  }, null, 8, ["label", "icon"])
@@ -7342,7 +7344,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7342
7344
  },
7343
7345
  emits: ["update:visible", "schedule"],
7344
7346
  setup(e, { expose: t, emit: i }) {
7345
- let a = e, s = i, { t: c } = K(), u = w(p()), d = w(m());
7347
+ let a = e, s = i, { t: c } = q(), u = w(p()), d = w(m());
7346
7348
  function f() {
7347
7349
  return new Date(Date.now() + 3600 * 1e3);
7348
7350
  }
@@ -7382,7 +7384,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7382
7384
  onClick: b
7383
7385
  }, null, 8, ["label"]), l(j(z), {
7384
7386
  label: j(c)("schedule"),
7385
- icon: j(ue),
7387
+ icon: j(le),
7386
7388
  disabled: a.disabled || !g.value,
7387
7389
  onClick: y
7388
7390
  }, null, 8, [
@@ -7440,7 +7442,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7440
7442
  top: `${t.position.y}px`
7441
7443
  }),
7442
7444
  role: "listbox",
7443
- onMousedown: l[0] ||= L(() => {}, ["stop"])
7445
+ onMousedown: l[0] ||= R(() => {}, ["stop"])
7444
7446
  }, [(S(!0), a(e, null, T(t.candidates, (e, t) => (S(), a("button", {
7445
7447
  key: e.id,
7446
7448
  type: "button",
@@ -7448,8 +7450,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7448
7450
  role: "option",
7449
7451
  "aria-selected": t === s.value,
7450
7452
  onMouseover: (e) => s.value = t,
7451
- onMousedown: L((t) => c("select", e), ["stop", "prevent"])
7452
- }, [e.avatar ? (S(), r(j(R), {
7453
+ onMousedown: R((t) => c("select", e), ["stop", "prevent"])
7454
+ }, [e.avatar ? (S(), r(j(te), {
7453
7455
  key: 0,
7454
7456
  src: e.avatar,
7455
7457
  name: e.label,
@@ -7498,62 +7500,62 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7498
7500
  video: "video/*",
7499
7501
  audio: "audio/*",
7500
7502
  file: "*/*"
7501
- }, 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: ee, focusEditor: N, handleContextMenu: P, handleInput: I, handleKeydown: te, handlePaste: R, hideFormatMenu: ne, resetEditor: B, showFormatMenu: re, triggerCandidates: ie, triggerMenuPosition: ae, highlightedTriggerIndex: oe, showTriggerMenu: V, selectTriggerCandidate: H } = ud(E, D, O, {
7503
+ }, 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, {
7502
7504
  getModelValue: () => u.modelValue,
7503
7505
  updateModelValue: (e) => d("update:modelValue", e),
7504
- submit: () => Te(),
7506
+ submit: () => we(),
7505
7507
  getMentionCandidates: () => u.mentionCandidates ?? [],
7506
7508
  getMentionNameByUid: () => u.mentionNameByUid ?? {},
7507
7509
  mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
7508
- }), le = n(() => c[v.value]), U = n(() => {
7510
+ }), ce = n(() => c[v.value]), W = n(() => {
7509
7511
  if (!_.value) return null;
7510
7512
  let e = _.value.type;
7511
7513
  return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
7512
- }), ue = n(() => {
7513
- switch (U.value) {
7514
+ }), le = n(() => {
7515
+ switch (W.value) {
7514
7516
  case "image": return C("image");
7515
7517
  case "video": return C("video");
7516
7518
  case "audio": return C("audio");
7517
7519
  case "file": return C("file");
7518
7520
  default: return C("attachment");
7519
7521
  }
7520
- }), pe = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), me = n(() => Hs(u.modelValue) || !!_.value), he = n(() => me.value && U.value !== "file"), ge = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : Us(u.modelValue) || C("currentDraftWillBeScheduled"));
7522
+ }), 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"));
7521
7523
  F(() => u.resetSignal, () => {
7522
7524
  B(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
7523
7525
  });
7524
- async function _e() {
7526
+ async function ge() {
7525
7527
  await h(), N();
7526
7528
  }
7527
- function ye() {
7529
+ function ve() {
7528
7530
  m.value?.hide();
7529
7531
  }
7530
7532
  t({
7531
- focusEditor: _e,
7532
- hideComposerActions: ye
7533
+ focusEditor: ge,
7534
+ hideComposerActions: ve
7533
7535
  });
7534
- async function be(e = "file") {
7536
+ async function ye(e = "file") {
7535
7537
  v.value = e, await h(), f.value?.click();
7536
7538
  }
7537
- function xe(e) {
7538
- _.value = e.target.files?.[0] ?? null, ye();
7539
+ function be(e) {
7540
+ _.value = e.target.files?.[0] ?? null, ve();
7539
7541
  }
7540
- function Se(e) {
7542
+ function xe(e) {
7541
7543
  if (u.disabled) return;
7542
7544
  let t = rd(e);
7543
7545
  if (t) {
7544
- e.preventDefault(), _.value = t, ye();
7546
+ e.preventDefault(), _.value = t, ve();
7545
7547
  return;
7546
7548
  }
7547
- R(e);
7549
+ te(e);
7548
7550
  }
7549
- function Ce() {
7551
+ function Se() {
7550
7552
  _.value = null, f.value && (f.value.value = "");
7551
7553
  }
7552
- function we(e) {
7554
+ function Ce(e) {
7553
7555
  m.value?.toggle(e);
7554
7556
  }
7555
- function Te() {
7556
- if (!(u.disabled || !me.value)) {
7557
+ function we() {
7558
+ if (!(u.disabled || !pe.value)) {
7557
7559
  if (_.value) {
7558
7560
  d("sendAttachment", {
7559
7561
  file: _.value,
@@ -7564,10 +7566,10 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7564
7566
  d("sendText");
7565
7567
  }
7566
7568
  }
7567
- function Ee(e) {
7569
+ function Te(e) {
7568
7570
  d("sendPoll", e);
7569
7571
  }
7570
- function De(e) {
7572
+ function Ee(e) {
7571
7573
  d("scheduleMessage", {
7572
7574
  ...e,
7573
7575
  text: _.value ? void 0 : Vs(u.modelValue),
@@ -7575,39 +7577,39 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7575
7577
  caption: _.value ? Vs(u.modelValue) : void 0
7576
7578
  });
7577
7579
  }
7578
- function Oe() {
7580
+ function De() {
7579
7581
  d("openScheduled");
7580
7582
  }
7581
- function ke() {
7583
+ function Oe() {
7582
7584
  T !== null && (clearTimeout(T), T = null);
7583
7585
  }
7584
- function Ae(e) {
7585
- u.disabled || !he.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, ke(), T = setTimeout(() => {
7586
+ function ke(e) {
7587
+ u.disabled || !me.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, Oe(), T = setTimeout(() => {
7586
7588
  T = null, x.value = !0, b.value = !0;
7587
7589
  }, Jd));
7588
7590
  }
7589
- function je() {
7590
- ke();
7591
+ function Ae() {
7592
+ Oe();
7591
7593
  }
7592
- function Me() {
7593
- if (!(u.disabled || !me.value)) {
7594
+ function je() {
7595
+ if (!(u.disabled || !pe.value)) {
7594
7596
  if (x.value) {
7595
7597
  x.value = !1;
7596
7598
  return;
7597
7599
  }
7598
- Te();
7600
+ we();
7599
7601
  }
7600
7602
  }
7601
- 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]) }, [
7603
+ 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]) }, [
7602
7604
  o("input", {
7603
7605
  ref_key: "fileInputRef",
7604
7606
  ref: f,
7605
7607
  type: "file",
7606
7608
  class: "hidden",
7607
- accept: le.value,
7609
+ accept: ce.value,
7608
7610
  disabled: e.disabled,
7609
- onChange: xe,
7610
- onCancel: ye
7611
+ onChange: be,
7612
+ onCancel: ve
7611
7613
  }, null, 40, Bd),
7612
7614
  e.editingMessage ? (S(), r(bd, {
7613
7615
  key: 0,
@@ -7624,12 +7626,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7624
7626
  "data-testid": "composer-reply-context",
7625
7627
  onCancel: n[1] ||= (e) => d("cancelReply")
7626
7628
  }, null, 8, ["message", "context-label"])) : i("", !0),
7627
- _.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), {
7628
- icon: j(fe),
7629
+ _.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), {
7630
+ icon: j(de),
7629
7631
  text: "",
7630
7632
  rounded: "",
7631
7633
  severity: "secondary",
7632
- onClick: Ce
7634
+ onClick: Se
7633
7635
  }, null, 8, ["icon"])])) : i("", !0),
7634
7636
  o("div", {
7635
7637
  ref_key: "composerShellRef",
@@ -7639,7 +7641,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7639
7641
  l(hd, {
7640
7642
  ref_key: "composerActionsRef",
7641
7643
  ref: m,
7642
- onPickFile: be,
7644
+ onPickFile: ye,
7643
7645
  onOpenPoll: n[2] ||= (e) => y.value = !0
7644
7646
  }, null, 512),
7645
7647
  l(j(z), {
@@ -7650,8 +7652,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7650
7652
  disabled: e.disabled || !!e.editingMessage,
7651
7653
  "aria-label": j(C)("addToMessage"),
7652
7654
  "data-testid": "composer-actions-button",
7653
- icon: j(ce),
7654
- onClick: we
7655
+ icon: j(se),
7656
+ onClick: Ce
7655
7657
  }, null, 8, [
7656
7658
  "class",
7657
7659
  "disabled",
@@ -7670,12 +7672,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7670
7672
  onFocus: n[3] ||= (...e) => j(ne) && j(ne)(...e),
7671
7673
  onInput: n[4] ||= (...e) => j(I) && j(I)(...e),
7672
7674
  onKeyup: n[5] ||= (...e) => j(I) && j(I)(...e),
7673
- onKeydown: n[6] ||= (...e) => j(te) && j(te)(...e),
7674
- onPaste: Se,
7675
+ onKeydown: n[6] ||= (...e) => j(L) && j(L)(...e),
7676
+ onPaste: xe,
7675
7677
  onContextmenu: n[7] ||= (...e) => j(P) && j(P)(...e)
7676
7678
  }, null, 42, Gd)),
7677
7679
  _.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Kd, [
7678
- e.editingMessage ? (S(), r(j(se), {
7680
+ e.editingMessage ? (S(), r(j(oe), {
7679
7681
  key: 0,
7680
7682
  text: j(C)("editing"),
7681
7683
  context: "info",
@@ -7683,7 +7685,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7683
7685
  size: "sm",
7684
7686
  class: "composer-meta-tag"
7685
7687
  }, null, 8, ["text"])) : i("", !0),
7686
- e.contextLabel ? (S(), r(j(se), {
7688
+ e.contextLabel ? (S(), r(j(oe), {
7687
7689
  key: 1,
7688
7690
  text: e.contextLabel,
7689
7691
  context: "contrast",
@@ -7700,8 +7702,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7700
7702
  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"]),
7701
7703
  disabled: e.disabled,
7702
7704
  "aria-label": j(C)("scheduledMessages"),
7703
- icon: j(ve),
7704
- onClick: Oe
7705
+ icon: j(_e),
7706
+ onClick: De
7705
7707
  }, null, 8, [
7706
7708
  "class",
7707
7709
  "disabled",
@@ -7713,17 +7715,17 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7713
7715
  severity: "primary",
7714
7716
  text: "",
7715
7717
  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"]),
7716
- disabled: e.disabled || !me.value,
7718
+ disabled: e.disabled || !pe.value,
7717
7719
  "aria-label": e.editingMessage ? j(C)("saveMessage") : _.value ? j(C)("sendAttachment") : j(C)("sendMessage"),
7718
- icon: e.editingMessage ? j(de) : j(Pe),
7719
- onMousedown: Ae,
7720
- onMouseup: je,
7721
- onMouseleave: je,
7722
- onTouchstart: Ae,
7723
- onTouchend: je,
7724
- onTouchcancel: je,
7725
- onContextmenu: n[8] ||= L(() => {}, ["prevent"]),
7726
- onClick: Me
7720
+ icon: e.editingMessage ? j(ue) : j(Ne),
7721
+ onMousedown: ke,
7722
+ onMouseup: Ae,
7723
+ onMouseleave: Ae,
7724
+ onTouchstart: ke,
7725
+ onTouchend: Ae,
7726
+ onTouchcancel: Ae,
7727
+ onContextmenu: n[8] ||= R(() => {}, ["prevent"]),
7728
+ onClick: je
7727
7729
  }, null, 8, [
7728
7730
  "class",
7729
7731
  "disabled",
@@ -7739,12 +7741,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7739
7741
  l(zd, {
7740
7742
  ref_key: "triggerMenuRef",
7741
7743
  ref: O,
7742
- "highlighted-index": j(oe),
7743
- "onUpdate:highlightedIndex": n[10] ||= (e) => p(oe) ? oe.value = e : null,
7744
- visible: j(V),
7745
- position: j(ae),
7744
+ "highlighted-index": j(ae),
7745
+ "onUpdate:highlightedIndex": n[10] ||= (e) => p(ae) ? ae.value = e : null,
7746
+ visible: j(H),
7747
+ position: j(V),
7746
7748
  candidates: j(ie),
7747
- onSelect: n[11] ||= (e) => j(H)(e)
7749
+ onSelect: n[11] ||= (e) => j(U)(e)
7748
7750
  }, null, 8, [
7749
7751
  "highlighted-index",
7750
7752
  "visible",
@@ -7755,15 +7757,15 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7755
7757
  visible: y.value,
7756
7758
  "onUpdate:visible": n[12] ||= (e) => y.value = e,
7757
7759
  disabled: e.disabled,
7758
- onSend: Ee
7760
+ onSend: Te
7759
7761
  }, null, 8, ["visible", "disabled"]),
7760
7762
  l(Nd, {
7761
7763
  visible: b.value,
7762
7764
  "onUpdate:visible": n[13] ||= (e) => b.value = e,
7763
7765
  disabled: e.disabled,
7764
- "can-schedule": he.value,
7765
- "content-preview": ge.value,
7766
- onSchedule: De
7766
+ "can-schedule": me.value,
7767
+ "content-preview": he.value,
7768
+ onSchedule: Ee
7767
7769
  }, null, 8, [
7768
7770
  "visible",
7769
7771
  "disabled",
@@ -7779,7 +7781,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7779
7781
  __name: "ConversationComposer",
7780
7782
  props: { target: {} },
7781
7783
  setup(e, { expose: t }) {
7782
- let o = e, { t: s } = K(), c = ju(), l = Fu(), u = Bu(), d = Gu(), f = Xu(), p = n(() => o.target === "thread"), m = n({
7784
+ let o = e, { t: s } = q(), c = ju(), l = Fu(), u = Bu(), d = Gu(), f = Xu(), p = n(() => o.target === "thread"), m = n({
7783
7785
  get: () => p.value ? u.threadDraft.value : u.draft.value,
7784
7786
  set: (e) => {
7785
7787
  p.value ? u.threadDraft.value = e : u.draft.value = e;
@@ -7991,49 +7993,49 @@ function $d(e) {
7991
7993
  {
7992
7994
  key: "reply",
7993
7995
  label: e.t("reply"),
7994
- icon: Me,
7996
+ icon: je,
7995
7997
  visible: e.canReply(),
7996
7998
  command: () => C(t)
7997
7999
  },
7998
8000
  {
7999
8001
  key: "edit",
8000
8002
  label: e.t("edit"),
8001
- icon: ye,
8003
+ icon: ve,
8002
8004
  visible: s(t),
8003
8005
  command: () => T(t)
8004
8006
  },
8005
8007
  {
8006
8008
  key: "copy",
8007
8009
  label: r.value === t.id ? e.t("copied") : e.t("copyText"),
8008
- icon: r.value === t.id ? de : me,
8010
+ icon: r.value === t.id ? ue : pe,
8009
8011
  visible: !0,
8010
8012
  command: () => S(t)
8011
8013
  },
8012
8014
  {
8013
8015
  key: "info",
8014
8016
  label: e.t("info"),
8015
- icon: Te,
8017
+ icon: we,
8016
8018
  visible: c(t),
8017
8019
  command: () => O(t)
8018
8020
  },
8019
8021
  {
8020
8022
  key: "thread",
8021
8023
  label: e.t("threadWithCount", { count: t.replyCount }),
8022
- icon: Ce,
8024
+ icon: Se,
8023
8025
  visible: !e.isInThread() && e.canOpenThread(),
8024
8026
  command: () => E(t)
8025
8027
  },
8026
8028
  {
8027
8029
  key: "delete",
8028
8030
  label: e.t("delete"),
8029
- icon: he,
8031
+ icon: me,
8030
8032
  visible: l(t),
8031
8033
  command: () => k(t)
8032
8034
  },
8033
8035
  {
8034
8036
  key: "translate",
8035
8037
  label: e.t("translate"),
8036
- icon: Le,
8038
+ icon: Ie,
8037
8039
  visible: o(t),
8038
8040
  command: () => D(t)
8039
8041
  }
@@ -8291,7 +8293,7 @@ var uf = { class: "w-full" }, df = {
8291
8293
  props: { attachment: {} },
8292
8294
  emits: ["close"],
8293
8295
  setup(t, { emit: s }) {
8294
- 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: ee, handleDoubleClick: N } = lf({
8296
+ 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({
8295
8297
  viewportRef: u,
8296
8298
  imageRef: d,
8297
8299
  isImage: () => p.value
@@ -8316,7 +8318,7 @@ var uf = { class: "w-full" }, df = {
8316
8318
  target: "_blank",
8317
8319
  rel: "noreferrer",
8318
8320
  class: "media-viewer-link-action"
8319
- }, [(S(), r(D(j(ke)), {
8321
+ }, [(S(), r(D(j(Oe)), {
8320
8322
  class: "size-4",
8321
8323
  "aria-hidden": "true"
8322
8324
  })), o("span", null, k(j(_)("openInNewTab")), 1)], 8, pf)) : i("", !0)]),
@@ -8364,7 +8366,7 @@ var uf = { class: "w-full" }, df = {
8364
8366
  __name: "MessageDateSeparator",
8365
8367
  props: { date: {} },
8366
8368
  setup(e) {
8367
- let t = e, { locale: r, t: i } = K(), s = n(() => {
8369
+ let t = e, { locale: r, t: i } = q(), s = n(() => {
8368
8370
  let e = /* @__PURE__ */ new Date(), n = t.date, a = new Date(e.getFullYear(), e.getMonth(), e.getDate()), o = new Date(a);
8369
8371
  o.setDate(o.getDate() - 1);
8370
8372
  let s = new Date(a);
@@ -8398,7 +8400,7 @@ var uf = { class: "w-full" }, df = {
8398
8400
  isOwn: { type: Boolean }
8399
8401
  },
8400
8402
  setup(e) {
8401
- let t = e, r = w(null), s = w(!1), { t: c } = K(), l = n(() => {
8403
+ let t = e, r = w(null), s = w(!1), { t: c } = q(), l = n(() => {
8402
8404
  try {
8403
8405
  return new URL(t.url).hostname.replace(/^www\./, "");
8404
8406
  } catch {
@@ -8511,7 +8513,7 @@ var uf = { class: "w-full" }, df = {
8511
8513
  props: { message: {} },
8512
8514
  emits: ["openMedia"],
8513
8515
  setup(t, { emit: n }) {
8514
- let s = n, { t: l } = K();
8516
+ let s = n, { t: l } = q();
8515
8517
  function u(e) {
8516
8518
  return !e || Number.isNaN(e) ? "" : e < 1024 * 1024 ? `${Math.round(e / 1024)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
8517
8519
  }
@@ -8520,21 +8522,21 @@ var uf = { class: "w-full" }, df = {
8520
8522
  }
8521
8523
  function f(e) {
8522
8524
  let t = d(e), n = e.mimeType?.toLowerCase() || "";
8523
- return n === "application/pdf" || t === "pdf" ? je : [
8525
+ return n === "application/pdf" || t === "pdf" ? Ae : [
8524
8526
  "doc",
8525
8527
  "docx",
8526
8528
  "odt",
8527
8529
  "rtf"
8528
- ].includes(t) ? ge : [
8530
+ ].includes(t) ? he : [
8529
8531
  "xls",
8530
8532
  "xlsx",
8531
8533
  "csv",
8532
8534
  "ods"
8533
- ].includes(t) ? Fe : [
8535
+ ].includes(t) ? Pe : [
8534
8536
  "ppt",
8535
8537
  "pptx",
8536
8538
  "odp"
8537
- ].includes(t) ? xe : [
8539
+ ].includes(t) ? be : [
8538
8540
  "txt",
8539
8541
  "md",
8540
8542
  "json",
@@ -8545,13 +8547,13 @@ var uf = { class: "w-full" }, df = {
8545
8547
  "ts",
8546
8548
  "html",
8547
8549
  "css"
8548
- ].includes(t) || n.startsWith("text/") ? n.startsWith("text/") ? Ie : pe : [
8550
+ ].includes(t) || n.startsWith("text/") ? n.startsWith("text/") ? Fe : fe : [
8549
8551
  "zip",
8550
8552
  "rar",
8551
8553
  "7z",
8552
8554
  "tar",
8553
8555
  "gz"
8554
- ].includes(t) ? Se : ge;
8556
+ ].includes(t) ? xe : he;
8555
8557
  }
8556
8558
  function p(e) {
8557
8559
  let t = Us(e.text).trim();
@@ -8617,11 +8619,11 @@ var uf = { class: "w-full" }, df = {
8617
8619
  __name: "MessageDeliveryStatus",
8618
8620
  props: { message: {} },
8619
8621
  setup(e) {
8620
- let t = e, { locale: s, t: c } = K();
8622
+ let t = e, { locale: s, t: c } = q();
8621
8623
  function l(e) {
8622
8624
  return new Intl.DateTimeFormat(s.value, {
8623
8625
  timeStyle: "short",
8624
- hourCycle: gt()
8626
+ hourCycle: ht()
8625
8627
  }).format(e);
8626
8628
  }
8627
8629
  let u = n(() => {
@@ -8631,34 +8633,34 @@ var uf = { class: "w-full" }, df = {
8631
8633
  case "read": return {
8632
8634
  state: "read",
8633
8635
  label: c("read"),
8634
- icon: _e,
8636
+ icon: ge,
8635
8637
  class: "text-success"
8636
8638
  };
8637
8639
  case "delivered": return {
8638
8640
  state: "delivered",
8639
8641
  label: c("delivered"),
8640
- icon: de
8642
+ icon: ue
8641
8643
  };
8642
8644
  case "queued": return {
8643
8645
  state: "queued",
8644
8646
  label: c("queued"),
8645
- icon: Ne
8647
+ icon: Me
8646
8648
  };
8647
8649
  case "sending": return {
8648
8650
  state: "sending",
8649
8651
  label: c("sending"),
8650
- icon: Pe
8652
+ icon: Ne
8651
8653
  };
8652
8654
  case "failed": return {
8653
8655
  state: "failed",
8654
8656
  label: c("failed"),
8655
- icon: be,
8657
+ icon: ye,
8656
8658
  class: "text-danger"
8657
8659
  };
8658
8660
  default: return {
8659
8661
  state: "sent",
8660
8662
  label: c("sent"),
8661
- icon: Ae
8663
+ icon: ke
8662
8664
  };
8663
8665
  }
8664
8666
  });
@@ -8682,7 +8684,7 @@ var uf = { class: "w-full" }, df = {
8682
8684
  __name: "MessageItemHeader",
8683
8685
  props: { message: {} },
8684
8686
  setup(e) {
8685
- let t = e, { locale: n, t: s } = K();
8687
+ let t = e, { locale: n, t: s } = q();
8686
8688
  function c(e) {
8687
8689
  return e ? new Intl.DateTimeFormat(n.value, {
8688
8690
  month: "short",
@@ -8694,7 +8696,7 @@ var uf = { class: "w-full" }, df = {
8694
8696
  function l() {
8695
8697
  return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
8696
8698
  }
8697
- return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(se), {
8699
+ return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(oe), {
8698
8700
  key: 0,
8699
8701
  text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
8700
8702
  context: "warn",
@@ -8733,7 +8735,7 @@ var uf = { class: "w-full" }, df = {
8733
8735
  },
8734
8736
  emits: ["toggleReaction", "openThread"],
8735
8737
  setup(e, { emit: t }) {
8736
- 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);
8738
+ 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);
8737
8739
  return (t, n) => (S(), a("div", _p, [l(gp, {
8738
8740
  message: e.message,
8739
8741
  disabled: e.canReact === !1,
@@ -8745,8 +8747,8 @@ var uf = { class: "w-full" }, df = {
8745
8747
  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",
8746
8748
  "aria-label": d.value,
8747
8749
  title: d.value,
8748
- onClick: n[1] ||= L((e) => c("openThread"), ["stop"])
8749
- }, [(S(), r(D(j(Me)), {
8750
+ onClick: n[1] ||= R((e) => c("openThread"), ["stop"])
8751
+ }, [(S(), r(D(j(je)), {
8750
8752
  class: "size-4",
8751
8753
  "aria-hidden": "true"
8752
8754
  })), o("span", yp, k(e.message.replyCount), 1)], 8, vp)) : i("", !0)]));
@@ -8763,7 +8765,7 @@ var uf = { class: "w-full" }, df = {
8763
8765
  },
8764
8766
  emits: ["vote"],
8765
8767
  setup(t, { emit: n }) {
8766
- let r = t, s = n, { t: c } = K();
8768
+ let r = t, s = n, { t: c } = q();
8767
8769
  function l(e) {
8768
8770
  let t = r.currentUserId;
8769
8771
  return !t || !r.message.poll ? !1 : r.message.poll.options.some((n) => n.id === e && n.voters.includes(t));
@@ -8879,7 +8881,7 @@ var uf = { class: "w-full" }, df = {
8879
8881
  key: 0,
8880
8882
  text: t.message.text,
8881
8883
  class: g(f.value)
8882
- }, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(R), {
8884
+ }, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(te), {
8883
8885
  key: 0,
8884
8886
  image: t.message.senderAvatar,
8885
8887
  label: t.message.senderAvatar ? void 0 : t.message.senderName.slice(0, 1).toUpperCase(),
@@ -8972,7 +8974,7 @@ var uf = { class: "w-full" }, df = {
8972
8974
  class: "message-reaction-more",
8973
8975
  disabled: !t.canReact,
8974
8976
  onClick: p
8975
- }, [(S(), r(D(u.value ? j(De) : j(Ee)), {
8977
+ }, [(S(), r(D(u.value ? j(Ee) : j(Te)), {
8976
8978
  class: "size-7",
8977
8979
  "aria-hidden": "true"
8978
8980
  }))], 8, Hp)]), u.value && t.canReact ? (S(), a("div", Up, [(S(!0), a(e, null, T(d.value, (e) => (S(), a("button", {
@@ -9050,7 +9052,7 @@ var uf = { class: "w-full" }, df = {
9050
9052
  message: e.message,
9051
9053
  "can-react": e.canReact,
9052
9054
  onReact: o[0] ||= (e) => s("react", e)
9053
- }, null, 8, ["message", "can-react"]), l(j(ae), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
9055
+ }, null, 8, ["message", "can-react"]), l(j(V), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
9054
9056
  }
9055
9057
  }), [["__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 = {
9056
9058
  key: 0,
@@ -9065,13 +9067,13 @@ var uf = { class: "w-full" }, df = {
9065
9067
  parentMessage: {}
9066
9068
  },
9067
9069
  setup(t) {
9068
- let { t: n } = K();
9069
- return (s, c) => (S(), a("header", qp, [t.conversation ? (S(), a("div", Jp, [l(j(R), {
9070
+ let { t: n } = q();
9071
+ return (s, c) => (S(), a("header", qp, [t.conversation ? (S(), a("div", Jp, [l(j(te), {
9070
9072
  image: t.conversation.avatar,
9071
9073
  label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
9072
9074
  shape: "circle",
9073
9075
  class: "chat-header__avatar shrink-0"
9074
- }, 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(se), {
9076
+ }, 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), {
9075
9077
  key: e,
9076
9078
  text: e,
9077
9079
  context: "secondary",
@@ -9098,13 +9100,13 @@ var uf = { class: "w-full" }, df = {
9098
9100
  },
9099
9101
  emits: ["anchorclick"],
9100
9102
  setup(t) {
9101
- 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(() => {
9103
+ 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(() => {
9102
9104
  let e = u.conversation.value;
9103
9105
  return e ? _.value ? c("thread") : e.title : "";
9104
9106
  }), O = n(() => {
9105
9107
  let e = u.conversation.value;
9106
9108
  return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
9107
- }), 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)), te = ee("threadRef"), { handleThreadScroll: L } = of({
9109
+ }), 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({
9108
9110
  getConversation: () => u.conversation.value,
9109
9111
  getParentMessage: () => _.value,
9110
9112
  getMessages: () => m.value,
@@ -9112,14 +9114,14 @@ var uf = { class: "w-full" }, df = {
9112
9114
  isLoadingOlder: () => x.value,
9113
9115
  canLoadOlder: () => b.value,
9114
9116
  onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
9115
- threadRef: te
9116
- }), R = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: ae, getActionItems: oe } = $d({
9117
+ threadRef: L
9118
+ }), te = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: V, getActionItems: ae } = $d({
9117
9119
  canUseMessageActions: () => u.canUseMessageActions.value,
9118
9120
  canReact: () => u.canReact.value,
9119
9121
  canReply: () => u.canReply.value,
9120
9122
  canOpenThread: () => v.value,
9121
9123
  isInThread: () => p.value,
9122
- actionMenuRef: R,
9124
+ actionMenuRef: te,
9123
9125
  t: c,
9124
9126
  emit: {
9125
9127
  reply: (e) => f.emit("message:reply", e),
@@ -9135,20 +9137,20 @@ var uf = { class: "w-full" }, df = {
9135
9137
  },
9136
9138
  onMenuOpen: () => f.emit("ui:closeComposerActions")
9137
9139
  });
9138
- function V(e) {
9140
+ function H(e) {
9139
9141
  return !!e.url && [
9140
9142
  "image",
9141
9143
  "video",
9142
9144
  "audio"
9143
9145
  ].includes(e.kind);
9144
9146
  }
9145
- function se(e) {
9146
- V(e) && (M.value = e);
9147
+ function oe(e) {
9148
+ H(e) && (M.value = e);
9147
9149
  }
9148
- function H() {
9150
+ function U() {
9149
9151
  M.value = null;
9150
9152
  }
9151
- async function ce(e, t) {
9153
+ async function se(e, t) {
9152
9154
  N.value = `${e.id}:${t}`;
9153
9155
  try {
9154
9156
  f.emit("message:votePoll", {
@@ -9161,15 +9163,15 @@ var uf = { class: "w-full" }, df = {
9161
9163
  }, 300);
9162
9164
  }
9163
9165
  }
9164
- function le(e) {
9166
+ function ce(e) {
9165
9167
  v.value && f.emit("message:openThread", e);
9166
9168
  }
9167
- function U(e, t) {
9169
+ function W(e, t) {
9168
9170
  return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth() || e.getDate() !== t.getDate();
9169
9171
  }
9170
- function ue(e) {
9172
+ function le(e) {
9171
9173
  let t = m.value;
9172
- return e === 0 ? !0 : U(t[e].sentAt, t[e - 1].sentAt);
9174
+ return e === 0 ? !0 : W(t[e].sentAt, t[e - 1].sentAt);
9173
9175
  }
9174
9176
  return (t, n) => (S(), a(e, null, [
9175
9177
  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", {
@@ -9188,12 +9190,12 @@ var uf = { class: "w-full" }, df = {
9188
9190
  class: g(["message-list__body", F.value || P.value ? "bg-elevation-surface-overlay" : ""])
9189
9191
  }, [o("div", {
9190
9192
  ref_key: "threadRef",
9191
- ref: te,
9193
+ ref: L,
9192
9194
  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"]),
9193
- onScroll: n[2] ||= (...e) => j(L) && j(L)(...e)
9195
+ onScroll: n[2] ||= (...e) => j(R) && j(R)(...e)
9194
9196
  }, [o("div", im, [
9195
9197
  _.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),
9196
- (S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [ue(c) ? (S(), r(kf, {
9198
+ (S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [le(c) ? (S(), r(kf, {
9197
9199
  key: 0,
9198
9200
  date: o.sentAt
9199
9201
  }, null, 8, ["date"])) : i("", !0), l(Lp, {
@@ -9207,10 +9209,10 @@ var uf = { class: "w-full" }, df = {
9207
9209
  "action-message-row-class": s.actionMessageRowClass,
9208
9210
  onContextmenu: (e) => j(ne)(o, e),
9209
9211
  onTap: (e) => j(B)(o, e),
9210
- onOpenMedia: se,
9211
- onVotePoll: (e) => ce(o, e),
9212
- onToggleReaction: (e) => j(ae)(o, e),
9213
- onOpenThread: (e) => le(o),
9212
+ onOpenMedia: oe,
9213
+ onVotePoll: (e) => se(o, e),
9214
+ onToggleReaction: (e) => j(V)(o, e),
9215
+ onOpenThread: (e) => ce(o),
9214
9216
  onOpenReferencedMessage: n[0] ||= (e) => j(f).emit("message:openReference", e),
9215
9217
  onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
9216
9218
  }, null, 8, [
@@ -9232,14 +9234,14 @@ var uf = { class: "w-full" }, df = {
9232
9234
  ])], 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),
9233
9235
  l(Ef, {
9234
9236
  attachment: M.value,
9235
- onClose: H
9237
+ onClose: U
9236
9238
  }, null, 8, ["attachment"]),
9237
9239
  l(Kp, {
9238
9240
  ref_key: "actionMenuRef",
9239
- ref: R,
9241
+ ref: te,
9240
9242
  message: j(z),
9241
9243
  "can-react": j(u).canReact.value,
9242
- "action-items": j(z) ? j(oe)(j(z)) : [],
9244
+ "action-items": j(z) ? j(ae)(j(z)) : [],
9243
9245
  onHide: j(re),
9244
9246
  onReact: n[3] ||= (e) => j(ie)(j(z), e)
9245
9247
  }, null, 8, [
@@ -9268,7 +9270,7 @@ var uf = { class: "w-full" }, df = {
9268
9270
  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", {
9269
9271
  key: `${e.kind}-${e.user.uid}`,
9270
9272
  class: "receipt-section__row"
9271
- }, [o("div", hm, [l(j(R), {
9273
+ }, [o("div", hm, [l(j(te), {
9272
9274
  image: e.user.avatar,
9273
9275
  label: e.user.avatar ? void 0 : e.user.name.slice(0, 1).toUpperCase(),
9274
9276
  shape: "circle",
@@ -9298,12 +9300,12 @@ var uf = { class: "w-full" }, df = {
9298
9300
  },
9299
9301
  emits: ["close"],
9300
9302
  setup(e, { emit: t }) {
9301
- 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"));
9303
+ 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"));
9302
9304
  function g(e) {
9303
9305
  return e ? new Intl.DateTimeFormat(u.value, {
9304
9306
  dateStyle: "medium",
9305
9307
  timeStyle: "short",
9306
- hourCycle: gt()
9308
+ hourCycle: ht()
9307
9309
  }).format(e) : d("notYet");
9308
9310
  }
9309
9311
  function _(e, t) {
@@ -9318,19 +9320,19 @@ var uf = { class: "w-full" }, df = {
9318
9320
  }, {
9319
9321
  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, [
9320
9322
  o("div", Em, [o("p", Dm, k(j(d)("sent")), 1), o("p", Om, k(g(e.message.sentAt)), 1)]),
9321
- o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(se), {
9323
+ o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(oe), {
9322
9324
  key: 0,
9323
9325
  text: String(h.value.length),
9324
9326
  context: "secondary",
9325
9327
  rounded: ""
9326
9328
  }, null, 8, ["text"])) : i("", !0)]), o("p", Mm, k(_(e.message.receipts.deliveredAt, h.value.length)), 1)]),
9327
- o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(se), {
9329
+ o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(oe), {
9328
9330
  key: 0,
9329
9331
  text: String(m.value.length),
9330
9332
  context: "success",
9331
9333
  rounded: ""
9332
9334
  }, null, 8, ["text"])) : i("", !0)]), o("p", Im, k(_(e.message.receipts.readAt, m.value.length)), 1)])
9333
- ])]), e.loading ? (S(), a("div", Lm, [l(j(V), {
9335
+ ])]), e.loading ? (S(), a("div", Lm, [l(j(H), {
9334
9336
  style: {
9335
9337
  width: "2.5rem",
9336
9338
  height: "2.5rem"
@@ -9405,7 +9407,7 @@ var uf = { class: "w-full" }, df = {
9405
9407
  "editText"
9406
9408
  ],
9407
9409
  setup(t, { emit: s }) {
9408
- 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));
9410
+ 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));
9409
9411
  F(() => c.open, (e) => {
9410
9412
  e || (d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "");
9411
9413
  });
@@ -9413,7 +9415,7 @@ var uf = { class: "w-full" }, df = {
9413
9415
  return e ? new Intl.DateTimeFormat(_.value, {
9414
9416
  dateStyle: "medium",
9415
9417
  timeStyle: "short",
9416
- hourCycle: gt()
9418
+ hourCycle: ht()
9417
9419
  }).format(e) : v("unscheduled");
9418
9420
  }
9419
9421
  function C(e) {
@@ -9445,10 +9447,10 @@ var uf = { class: "w-full" }, df = {
9445
9447
  function P() {
9446
9448
  p.value = !0;
9447
9449
  }
9448
- function L(e) {
9450
+ function R(e) {
9449
9451
  return e.attachments.length ? !(d.value === e.id && p.value) : !1;
9450
9452
  }
9451
- function R(e) {
9453
+ function te(e) {
9452
9454
  if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !m.value || !b.value) return;
9453
9455
  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);
9454
9456
  u("reschedule", {
@@ -9479,7 +9481,7 @@ var uf = { class: "w-full" }, df = {
9479
9481
  "close-label": j(v)("close"),
9480
9482
  onClose: s[3] ||= (e) => u("close")
9481
9483
  }, {
9482
- default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(V), {
9484
+ default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(H), {
9483
9485
  style: {
9484
9486
  width: "2.75rem",
9485
9487
  height: "2.75rem"
@@ -9489,33 +9491,33 @@ var uf = { class: "w-full" }, df = {
9489
9491
  key: e.id,
9490
9492
  class: "border-default rounded-lg border px-4 py-3"
9491
9493
  }, [o("div", Gm, [o("div", Km, [
9492
- o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(se), {
9494
+ o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(oe), {
9493
9495
  key: 0,
9494
9496
  text: j(v)("poll"),
9495
9497
  context: "info",
9496
9498
  rounded: ""
9497
- }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(se), {
9499
+ }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(oe), {
9498
9500
  key: 1,
9499
9501
  text: D(e.attachments[0].kind),
9500
9502
  context: "info",
9501
9503
  rounded: ""
9502
- }, null, 8, ["text"])) : (S(), r(j(se), {
9504
+ }, null, 8, ["text"])) : (S(), r(j(oe), {
9503
9505
  key: 2,
9504
9506
  text: j(v)("message"),
9505
9507
  context: "info",
9506
9508
  rounded: ""
9507
9509
  }, null, 8, ["text"]))]), l(j(z), {
9508
- icon: j(he),
9510
+ icon: j(me),
9509
9511
  text: "",
9510
9512
  size: "small",
9511
9513
  onClick: (t) => B(e)
9512
9514
  }, null, 8, ["icon", "onClick"])]),
9513
9515
  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))]),
9514
- L(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
9516
+ R(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
9515
9517
  ]), o("div", eh, [e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
9516
9518
  key: 0,
9517
9519
  label: j(v)("edit"),
9518
- icon: j(ye),
9520
+ icon: j(ve),
9519
9521
  severity: "secondary",
9520
9522
  size: "small",
9521
9523
  onClick: (t) => A(e)
@@ -9526,7 +9528,7 @@ var uf = { class: "w-full" }, df = {
9526
9528
  ])), e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(z), {
9527
9529
  key: 1,
9528
9530
  label: j(v)("reschedule"),
9529
- icon: j(ue),
9531
+ icon: j(le),
9530
9532
  severity: "secondary",
9531
9533
  size: "small",
9532
9534
  onClick: (t) => O(e)
@@ -9534,11 +9536,11 @@ var uf = { class: "w-full" }, df = {
9534
9536
  "label",
9535
9537
  "icon",
9536
9538
  "onClick"
9537
- ])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", th, [o("div", nh, [te(o("input", {
9539
+ ])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", th, [o("div", nh, [L(o("input", {
9538
9540
  "onUpdate:modelValue": s[0] ||= (e) => m.value = e,
9539
9541
  type: "date",
9540
9542
  class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
9541
- }, null, 512), [[N, m.value]]), te(o("input", {
9543
+ }, null, 512), [[N, m.value]]), L(o("input", {
9542
9544
  "onUpdate:modelValue": s[1] ||= (e) => h.value = e,
9543
9545
  type: "time",
9544
9546
  inputmode: "numeric",
@@ -9550,7 +9552,7 @@ var uf = { class: "w-full" }, df = {
9550
9552
  label: j(v)("save"),
9551
9553
  size: "small",
9552
9554
  disabled: !m.value || !b.value,
9553
- onClick: (t) => R(e)
9555
+ onClick: (t) => te(e)
9554
9556
  }, null, 8, [
9555
9557
  "label",
9556
9558
  "disabled",
@@ -9561,8 +9563,8 @@ var uf = { class: "w-full" }, df = {
9561
9563
  text: "",
9562
9564
  onClick: M
9563
9565
  }, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", ih, [
9564
- L(e) ? (S(), a("div", ah, [l(cp, { message: ee(e) }, null, 8, ["message"]), o("div", oh, [l(j(z), {
9565
- icon: j(fe),
9566
+ R(e) ? (S(), a("div", ah, [l(cp, { message: ee(e) }, null, 8, ["message"]), o("div", oh, [l(j(z), {
9567
+ icon: j(de),
9566
9568
  "aria-label": j(v)("remove"),
9567
9569
  text: "",
9568
9570
  rounded: "",
@@ -9570,7 +9572,7 @@ var uf = { class: "w-full" }, df = {
9570
9572
  size: "small",
9571
9573
  onClick: P
9572
9574
  }, null, 8, ["icon", "aria-label"])])])) : i("", !0),
9573
- te(o("textarea", {
9575
+ L(o("textarea", {
9574
9576
  "onUpdate:modelValue": s[2] ||= (e) => g.value = e,
9575
9577
  rows: "3",
9576
9578
  class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
@@ -9603,7 +9605,10 @@ var uf = { class: "w-full" }, df = {
9603
9605
  }), [["__scopeId", "data-v-0bb2dc95"]]), uh = {
9604
9606
  key: 0,
9605
9607
  class: "chat-status-overlay"
9606
- }, dh = { class: "chat-status-overlay__card" }, fh = { key: 0 }, ph = { key: 1 }, mh = { key: 2 }, hh = { key: 3 }, gh = /* @__PURE__ */ $(/* @__PURE__ */ u({
9608
+ }, dh = { class: "chat-status-overlay__card" }, fh = { key: 0 }, ph = { key: 1 }, mh = { key: 2 }, hh = { key: 3 }, gh = {
9609
+ key: 4,
9610
+ name: "not-a-member"
9611
+ }, _h = /* @__PURE__ */ $(/* @__PURE__ */ u({
9607
9612
  __name: "ChatStatusOverlay",
9608
9613
  props: {
9609
9614
  visible: { type: Boolean },
@@ -9611,14 +9616,15 @@ var uf = { class: "w-full" }, df = {
9611
9616
  connected: { type: Boolean },
9612
9617
  loading: { type: Boolean },
9613
9618
  notFound: { type: Boolean },
9619
+ notAMember: { type: Boolean },
9614
9620
  isEmpty: { type: Boolean },
9615
9621
  showEmptySlot: { type: Boolean },
9616
9622
  messages: {}
9617
9623
  },
9618
9624
  setup(e) {
9619
- return (t, n) => e.visible ? (S(), a("div", uh, [o("div", dh, [e.offlineMode ? (S(), a("span", fh, k(e.messages.waitingForNetwork), 1)) : e.connected ? e.loading ? (S(), a("span", mh, k(e.messages.loading), 1)) : e.notFound ? (S(), a("span", hh, k(e.messages.notFound), 1)) : e.isEmpty && e.showEmptySlot ? E(t.$slots, "no-messages", { key: 4 }, () => [o("span", null, k(e.messages.noMessages), 1)], !0) : i("", !0) : (S(), a("span", ph, k(e.messages.connecting), 1))])])) : i("", !0);
9625
+ return (t, n) => e.visible ? (S(), a("div", uh, [o("div", dh, [e.offlineMode ? (S(), a("span", fh, k(e.messages.waitingForNetwork), 1)) : e.connected ? e.loading ? (S(), a("span", mh, k(e.messages.loading), 1)) : e.notFound ? (S(), a("span", hh, k(e.messages.notFound), 1)) : e.notAMember ? (S(), a("span", gh, k(e.messages.notAMember), 1)) : e.isEmpty && e.showEmptySlot ? E(t.$slots, "no-messages", { key: 5 }, () => [o("span", null, k(e.messages.noMessages), 1)], !0) : i("", !0) : (S(), a("span", ph, k(e.messages.connecting), 1))])])) : i("", !0);
9620
9626
  }
9621
- }), [["__scopeId", "data-v-20316f96"]]), _h = /* @__PURE__ */ u({
9627
+ }), [["__scopeId", "data-v-b16e2055"]]), vh = /* @__PURE__ */ u({
9622
9628
  __name: "BccChat",
9623
9629
  props: {
9624
9630
  client: { default: null },
@@ -9679,33 +9685,33 @@ var uf = { class: "w-full" }, df = {
9679
9685
  });
9680
9686
  return n;
9681
9687
  }
9682
- let p = t, m = u, { t: h } = K(() => p.language), v = w(null), x = w(!1), C = w(!1), T = n(() => p.client ?? Q.value ?? null), D = n(() => !!p.chatUid), O = n(() => {
9688
+ 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(() => {
9683
9689
  if (p.conversation !== void 0) return p.conversation;
9684
- let e = T.value;
9690
+ let e = D.value;
9685
9691
  return e ? p.chatUid ? e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null : e.activeConversation.value : null;
9686
- }), { groupMembers: A, fetchGroupMembers: M } = Qu({
9687
- getConversationTargetId: () => O.value?.targetId,
9688
- isChannel: () => vu(O.value),
9692
+ }), { groupMembers: M, fetchGroupMembers: N } = Qu({
9693
+ getConversationTargetId: () => A.value?.targetId,
9694
+ isChannel: () => vu(A.value),
9689
9695
  onMembersChanged: (e) => {
9690
- m("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
9696
+ m("chatMembersFetched", e), D.value?.rememberMentionDisplayNames(e);
9691
9697
  }
9692
- }), N = Ou({
9693
- chatClient: T,
9694
- selectedConversation: O,
9698
+ }), P = Ou({
9699
+ chatClient: D,
9700
+ selectedConversation: A,
9695
9701
  getPropIsReadOnly: () => p.isReadOnly,
9696
9702
  getPropSendOptions: () => p.sendOptions,
9697
9703
  getSenderDisplayName: () => p.senderDisplayName,
9698
9704
  getMentionCandidates: () => f({
9699
- groupMembers: A.value,
9700
- messages: p.messages ?? T.value?.messages.value ?? [],
9701
- currentUserId: T.value?.currentUser.value?.uid
9705
+ groupMembers: M.value,
9706
+ messages: p.messages ?? D.value?.messages.value ?? [],
9707
+ currentUserId: D.value?.currentUser.value?.uid
9702
9708
  })
9703
9709
  });
9704
- Au(N);
9705
- let P = Mu({
9706
- chatClient: T,
9707
- selectedConversation: O,
9708
- usesPublicContract: D,
9710
+ Au(P);
9711
+ let L = Mu({
9712
+ chatClient: D,
9713
+ selectedConversation: A,
9714
+ usesPublicContract: O,
9709
9715
  loadingChat: C,
9710
9716
  getPropMessages: () => p.messages,
9711
9717
  getPropThreadMessages: () => p.threadMessages,
@@ -9714,86 +9720,86 @@ var uf = { class: "w-full" }, df = {
9714
9720
  getPropShowDefaultEmptyState: () => p.showDefaultEmptyState,
9715
9721
  getHideDeletedMessages: () => p.hideDeletedMessages
9716
9722
  });
9717
- Pu(P);
9718
- let te = n(() => P.messages.value.length > 0), L = n(() => p.showHeader ?? p.showMessageHeader), R = Hu({
9719
- chatClient: T,
9720
- selectedConversation: O,
9723
+ Pu(L);
9724
+ let R = n(() => L.messages.value.length > 0), te = n(() => p.showHeader ?? p.showMessageHeader), z = Hu({
9725
+ chatClient: D,
9726
+ selectedConversation: A,
9721
9727
  getInitialScheduledMessagesOpen: () => !!p.initialScheduledMessagesOpen,
9722
9728
  fetchErrorFallback: h("loadMessageReceiptsError")
9723
9729
  });
9724
- Wu(R);
9725
- let z = ee("mainComposerRef"), ne = ee("threadComposerRef"), B = Lu({
9726
- chatClient: T,
9727
- sendOptions: N.sendOptions,
9728
- mentionNameByUid: N.mentionNameByUid,
9729
- afterSchedule: () => R.openScheduledMessages(),
9730
- mainComposerRef: z,
9731
- threadComposerRef: ne
9730
+ Wu(z);
9731
+ let ne = ee("mainComposerRef"), B = ee("threadComposerRef"), re = Lu({
9732
+ chatClient: D,
9733
+ sendOptions: P.sendOptions,
9734
+ mentionNameByUid: P.mentionNameByUid,
9735
+ afterSchedule: () => z.openScheduledMessages(),
9736
+ mainComposerRef: ne,
9737
+ threadComposerRef: B
9732
9738
  });
9733
- zu(B);
9734
- let re = Ju();
9735
- Yu(re), Ku({
9736
- conversation: N,
9737
- composer: B,
9738
- dialogs: R,
9739
- bus: re
9739
+ zu(re);
9740
+ let ie = Ju();
9741
+ Yu(ie), Ku({
9742
+ conversation: P,
9743
+ composer: re,
9744
+ dialogs: z,
9745
+ bus: ie
9740
9746
  });
9741
- let { scrollToRequestedMessage: ie } = $u({
9747
+ let { scrollToRequestedMessage: V } = $u({
9742
9748
  chatRootRef: v,
9743
- getClient: () => T.value
9749
+ getClient: () => D.value
9744
9750
  });
9745
- F(() => O.value?.targetId ?? null, () => {
9746
- R.refreshScheduledMessages();
9747
- }, { immediate: !0 }), F(() => O.value?.targetId ?? null, async (e) => {
9748
- !e || O.value?.type !== "group" || await M(e);
9749
- }, { immediate: !0 }), F(() => O.value?.id, () => {
9750
- B.resetMainComposer(), B.resetThreadComposer(), R.showScheduledMessages.value = !1, R.closeMessageInfo();
9751
+ F(() => A.value?.targetId ?? null, () => {
9752
+ z.refreshScheduledMessages();
9753
+ }, { immediate: !0 }), F(() => A.value?.targetId ?? null, async (e) => {
9754
+ !e || A.value?.type !== "group" || await N(e);
9755
+ }, { immediate: !0 }), F(() => A.value?.id, () => {
9756
+ re.resetMainComposer(), re.resetThreadComposer(), z.showScheduledMessages.value = !1, z.closeMessageInfo();
9751
9757
  }), F(() => p.chatMessageGetter, (e) => {
9752
9758
  gu.setGetChatMessagesCallback(e);
9753
9759
  }, { immediate: !0 }), F(() => p.language, (e) => {
9754
- e && _t(e);
9755
- }, { immediate: !0 }), F(P.isChatEmpty, (e) => {
9760
+ e && gt(e);
9761
+ }, { immediate: !0 }), F(L.isChatEmpty, (e) => {
9756
9762
  e && m("chatEmpty");
9757
9763
  }), F([
9758
9764
  () => p.chatUid,
9759
9765
  () => p.client ? p.client.initialized.value : gu.initialized.value,
9760
9766
  () => p.client ? p.client.loggedIn.value : gu.loggedIn.value,
9761
- () => T.value?.conversations.value.length ?? 0
9767
+ () => D.value?.conversations.value.length ?? 0
9762
9768
  ], async ([e, t, n]) => {
9763
- !D.value || !e || !t || !n || !T.value || await ae();
9769
+ !O.value || !e || !t || !n || !D.value || await H();
9764
9770
  }, { immediate: !0 }), F([
9765
- () => P.messages.value.length,
9766
- () => P.threadMessages.value.length,
9771
+ () => L.messages.value.length,
9772
+ () => L.threadMessages.value.length,
9767
9773
  () => gu.scrollToMessageId.value
9768
9774
  ], async () => {
9769
- await ie();
9775
+ await V();
9770
9776
  });
9771
- async function ae() {
9772
- let e = T.value;
9777
+ async function H() {
9778
+ let e = D.value;
9773
9779
  if (e) {
9774
- C.value = !0, x.value = !1;
9780
+ C.value = !0, x.value = !1, T.value = !1;
9775
9781
  try {
9776
9782
  e.conversations.value.length === 0 && await e.fetchConversations();
9777
9783
  let t = e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null;
9778
9784
  if (!t) try {
9779
- t = await V(p.chatUid, e);
9785
+ t = await oe(p.chatUid, e);
9780
9786
  } catch (e) {
9781
9787
  if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
9782
- x.value = !0, m("chatMembersFetched", []), m("chatNotAMember", p.chatUid);
9788
+ x.value = !0, T.value = !0, m("chatMembersFetched", []);
9783
9789
  return;
9784
9790
  }
9785
9791
  }
9786
9792
  if (!t) {
9787
- x.value = !0, m("chatMembersFetched", []);
9793
+ x.value = !0, T.value = !1, m("chatMembersFetched", []);
9788
9794
  return;
9789
9795
  }
9790
- e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await M(t.targetId);
9796
+ e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await N(t.targetId);
9791
9797
  } finally {
9792
9798
  C.value = !1;
9793
9799
  }
9794
9800
  }
9795
9801
  }
9796
- async function V(e, t) {
9802
+ async function oe(e, t) {
9797
9803
  let n = await gu.getGroup(e);
9798
9804
  if (!n || typeof n != "object") return null;
9799
9805
  let r = String(n.getGuid());
@@ -9811,51 +9817,51 @@ var uf = { class: "w-full" }, df = {
9811
9817
  };
9812
9818
  return t.conversations.value = [i, ...t.conversations.value.filter((e) => e.id !== i.id && e.targetId !== r)], i;
9813
9819
  }
9814
- function se(e, t) {
9820
+ function U(e, t) {
9815
9821
  m("linkClicked", e, t);
9816
9822
  }
9817
- let H = w(!1);
9823
+ let se = w(!1);
9818
9824
  b(() => {
9819
9825
  setTimeout(() => {
9820
- H.value = !0;
9826
+ se.value = !0;
9821
9827
  }, 200);
9822
9828
  }), y(() => {
9823
- let e = T.value;
9824
- e && e.activeConversation.value === O.value && e.selectConversation(null);
9829
+ let e = D.value;
9830
+ e && e.activeConversation.value === A.value && e.selectConversation(null);
9825
9831
  });
9826
9832
  async function ce(e) {
9827
- return await new Promise((e) => setTimeout(e, 100)), H.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)), ce(e));
9833
+ return await new Promise((e) => setTimeout(e, 100)), se.value ? V(e) : (await new Promise((e) => setTimeout(e, 110)), ce(e));
9828
9834
  }
9829
9835
  return o({
9830
9836
  scrollToMessage: ce,
9831
- groupMembers: n(() => A.value)
9837
+ groupMembers: n(() => M.value)
9832
9838
  }), (n, o) => (S(), a("div", {
9833
9839
  ref_key: "chatRootRef",
9834
9840
  ref: v,
9835
9841
  class: "text-default relative h-full min-h-104"
9836
9842
  }, [
9837
- D.value && T.value?.error.value ? (S(), r(j(oe), {
9843
+ O.value && D.value?.error.value ? (S(), r(j(ae), {
9838
9844
  key: 0,
9839
9845
  severity: "error",
9840
9846
  closable: !1,
9841
9847
  class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
9842
9848
  }, {
9843
- default: I(() => [c(k(T.value.error.value), 1)]),
9849
+ default: I(() => [c(k(D.value.error.value), 1)]),
9844
9850
  _: 1
9845
9851
  })) : i("", !0),
9846
- T.value ? (S(), a(e, { key: 1 }, [
9852
+ D.value ? (S(), a(e, { key: 1 }, [
9847
9853
  l(lm, {
9848
9854
  target: "main",
9849
9855
  class: g(["h-full", t.containerClass]),
9850
9856
  "hide-group-actions": t.hideGroupActions,
9851
- "show-header": L.value,
9857
+ "show-header": te.value,
9852
9858
  "action-message-class": t.actionMessageClass,
9853
9859
  "action-message-row-class": t.actionMessageRowClass,
9854
- onAnchorclick: se
9860
+ onAnchorclick: U
9855
9861
  }, s({
9856
9862
  composer: I(() => [l(Zd, {
9857
9863
  ref_key: "mainComposerRef",
9858
- ref: z,
9864
+ ref: ne,
9859
9865
  target: "main"
9860
9866
  }, null, 512)]),
9861
9867
  _: 2
@@ -9871,12 +9877,12 @@ var uf = { class: "w-full" }, df = {
9871
9877
  "action-message-row-class"
9872
9878
  ]),
9873
9879
  l(ff, {
9874
- open: !!j(P).activeThreadParentMessage.value,
9875
- title: j(h)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
9876
- subtitle: O.value?.title ?? "",
9880
+ open: !!j(L).activeThreadParentMessage.value,
9881
+ title: j(h)("threadWithCount", { count: j(L).activeThreadParentMessage.value?.replyCount ?? 0 }),
9882
+ subtitle: A.value?.title ?? "",
9877
9883
  "close-label": j(h)("close"),
9878
9884
  "close-aria-label": j(h)("closeThread"),
9879
- onClose: o[0] ||= (e) => j(re).emit("ui:closeThread")
9885
+ onClose: o[0] ||= (e) => j(ie).emit("ui:closeThread")
9880
9886
  }, {
9881
9887
  default: I(() => [l(lm, {
9882
9888
  target: "thread",
@@ -9886,7 +9892,7 @@ var uf = { class: "w-full" }, df = {
9886
9892
  }, {
9887
9893
  composer: I(() => [l(Zd, {
9888
9894
  ref_key: "threadComposerRef",
9889
- ref: ne,
9895
+ ref: B,
9890
9896
  target: "thread"
9891
9897
  }, null, 512)]),
9892
9898
  _: 1
@@ -9900,14 +9906,14 @@ var uf = { class: "w-full" }, df = {
9900
9906
  "close-aria-label"
9901
9907
  ]),
9902
9908
  l(lh, {
9903
- open: j(R).showScheduledMessages.value,
9904
- loading: j(R).loadingScheduledMessages.value,
9905
- messages: j(R).scheduledMessages.value,
9906
- "conversation-title": O.value?.title,
9907
- onClose: o[1] ||= (e) => j(R).showScheduledMessages.value = !1,
9908
- onReschedule: o[2] ||= (e) => j(re).emit("ui:reschedule", e),
9909
- onRemove: o[3] ||= (e) => j(re).emit("ui:removeScheduled", e),
9910
- onEditText: o[4] ||= (e) => j(re).emit("ui:editScheduledText", e)
9909
+ open: j(z).showScheduledMessages.value,
9910
+ loading: j(z).loadingScheduledMessages.value,
9911
+ messages: j(z).scheduledMessages.value,
9912
+ "conversation-title": A.value?.title,
9913
+ onClose: o[1] ||= (e) => j(z).showScheduledMessages.value = !1,
9914
+ onReschedule: o[2] ||= (e) => j(ie).emit("ui:reschedule", e),
9915
+ onRemove: o[3] ||= (e) => j(ie).emit("ui:removeScheduled", e),
9916
+ onEditText: o[4] ||= (e) => j(ie).emit("ui:editScheduledText", e)
9911
9917
  }, null, 8, [
9912
9918
  "open",
9913
9919
  "loading",
@@ -9915,12 +9921,12 @@ var uf = { class: "w-full" }, df = {
9915
9921
  "conversation-title"
9916
9922
  ]),
9917
9923
  l(Bm, {
9918
- open: !!j(R).infoMessage.value,
9919
- message: j(R).infoMessage.value,
9920
- receipts: j(R).infoMessageReceipts.value,
9921
- loading: j(R).loadingMessageReceipts.value,
9922
- error: j(R).messageReceiptsError.value,
9923
- onClose: o[5] ||= (e) => j(R).closeMessageInfo()
9924
+ open: !!j(z).infoMessage.value,
9925
+ message: j(z).infoMessage.value,
9926
+ receipts: j(z).infoMessageReceipts.value,
9927
+ loading: j(z).loadingMessageReceipts.value,
9928
+ error: j(z).messageReceiptsError.value,
9929
+ onClose: o[5] ||= (e) => j(z).closeMessageInfo()
9924
9930
  }, null, 8, [
9925
9931
  "open",
9926
9932
  "message",
@@ -9929,30 +9935,38 @@ var uf = { class: "w-full" }, df = {
9929
9935
  "error"
9930
9936
  ])
9931
9937
  ], 64)) : i("", !0),
9932
- l(gh, {
9933
- visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || C.value && !te.value || x.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
9934
- "offline-mode": !!(T.value?.offlineMode.value && !O.value),
9935
- connected: !!(T.value?.connected.value || O.value),
9938
+ l(_h, {
9939
+ 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),
9940
+ "offline-mode": !!(D.value?.offlineMode.value && !A.value),
9941
+ connected: !!(D.value?.connected.value || A.value),
9936
9942
  loading: C.value,
9937
9943
  "not-found": x.value,
9938
- "is-empty": j(P).isChatEmpty.value,
9944
+ "not-a-member": T.value,
9945
+ "is-empty": j(L).isChatEmpty.value,
9939
9946
  "show-empty-slot": t.displayNoMessagesText,
9940
9947
  messages: {
9941
9948
  waitingForNetwork: j(h)("waitingForNetwork"),
9942
9949
  connecting: j(h)("connecting"),
9943
9950
  loading: j(h)("loadingChat"),
9944
9951
  notFound: j(h)("chatNotFound"),
9945
- noMessages: j(h)("noMessagesHaveBeenSentYet")
9952
+ noMessages: j(h)("noMessagesHaveBeenSentYet"),
9953
+ notAMember: j(h)("chatNotAMember")
9946
9954
  }
9947
- }, {
9948
- "no-messages": I(() => [E(n.$slots, "no-messages")]),
9949
- _: 3
9950
- }, 8, [
9955
+ }, s({ _: 2 }, [n.$slots["no-messages"] ? {
9956
+ name: "no-messages",
9957
+ fn: I(() => [E(n.$slots, "no-messages")]),
9958
+ key: "0"
9959
+ } : void 0, n.$slots["not-a-member"] ? {
9960
+ name: "not-a-member",
9961
+ fn: I(() => [E(n.$slots, "not-a-member")]),
9962
+ key: "1"
9963
+ } : void 0]), 1032, [
9951
9964
  "visible",
9952
9965
  "offline-mode",
9953
9966
  "connected",
9954
9967
  "loading",
9955
9968
  "not-found",
9969
+ "not-a-member",
9956
9970
  "is-empty",
9957
9971
  "show-empty-slot",
9958
9972
  "messages"
@@ -9961,6 +9975,6 @@ var uf = { class: "w-full" }, df = {
9961
9975
  }
9962
9976
  });
9963
9977
  //#endregion
9964
- export { _h as BccChat, _h as BccChatMessageList, Ol as LogSeverity, gu as chat, gu as default, cc as createChatClient };
9978
+ export { vh as BccChat, vh as BccChatMessageList, Ol as LogSeverity, gu as chat, gu as default, cc as createChatClient };
9965
9979
 
9966
9980
  //# sourceMappingURL=vue-bcc-chat-ui.js.map