@gamention/pulse-elements 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pulse-elements.cjs +40 -40
- package/dist/pulse-elements.js +412 -450
- package/package.json +3 -3
package/dist/pulse-elements.js
CHANGED
|
@@ -20,11 +20,11 @@ let bt = class extends Event {
|
|
|
20
20
|
*/
|
|
21
21
|
let We = class {
|
|
22
22
|
constructor(e, t, i, n) {
|
|
23
|
-
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (
|
|
24
|
-
this.unsubscribe && (this.unsubscribe !==
|
|
23
|
+
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, r) => {
|
|
24
|
+
this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, r)), this.unsubscribe = r;
|
|
25
25
|
}, this.host = e, t.context !== void 0) {
|
|
26
|
-
const
|
|
27
|
-
this.context =
|
|
26
|
+
const o = t;
|
|
27
|
+
this.context = o.context, this.callback = o.callback, this.subscribe = o.subscribe ?? !1;
|
|
28
28
|
} else this.context = t, this.callback = i, this.subscribe = n ?? !1;
|
|
29
29
|
this.host.addController(this);
|
|
30
30
|
}
|
|
@@ -82,17 +82,17 @@ let At = class extends Event {
|
|
|
82
82
|
}
|
|
83
83
|
}, Ve = class extends Pt {
|
|
84
84
|
constructor(e, t, i) {
|
|
85
|
-
var n,
|
|
86
|
-
super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (
|
|
87
|
-
if (
|
|
88
|
-
const l =
|
|
89
|
-
l !== this.host && (
|
|
90
|
-
}, this.onProviderRequest = (
|
|
91
|
-
if (
|
|
85
|
+
var n, o;
|
|
86
|
+
super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
|
|
87
|
+
if (r.context !== this.context) return;
|
|
88
|
+
const l = r.contextTarget ?? r.composedPath()[0];
|
|
89
|
+
l !== this.host && (r.stopPropagation(), this.addCallback(r.callback, l, r.subscribe));
|
|
90
|
+
}, this.onProviderRequest = (r) => {
|
|
91
|
+
if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
|
|
92
92
|
const l = /* @__PURE__ */ new Set();
|
|
93
93
|
for (const [a, { consumerHost: c }] of this.subscriptions) l.has(a) || (l.add(a), c.dispatchEvent(new bt(this.context, c, a, !0)));
|
|
94
|
-
|
|
95
|
-
}, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (
|
|
94
|
+
r.stopPropagation();
|
|
95
|
+
}, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (o = (n = this.host).addController) == null || o.call(n, this);
|
|
96
96
|
}
|
|
97
97
|
attachListeners() {
|
|
98
98
|
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
@@ -106,7 +106,7 @@ let At = class extends Event {
|
|
|
106
106
|
* Copyright 2017 Google LLC
|
|
107
107
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
108
|
*/
|
|
109
|
-
function
|
|
109
|
+
function Mt({ context: s }) {
|
|
110
110
|
return (e, t) => {
|
|
111
111
|
const i = /* @__PURE__ */ new WeakMap();
|
|
112
112
|
if (typeof t == "object") return { get() {
|
|
@@ -117,25 +117,25 @@ function It({ context: s }) {
|
|
|
117
117
|
return i.set(this, new Ve(this, { context: s, initialValue: n })), n;
|
|
118
118
|
} };
|
|
119
119
|
{
|
|
120
|
-
e.constructor.addInitializer(((
|
|
121
|
-
i.set(
|
|
120
|
+
e.constructor.addInitializer(((r) => {
|
|
121
|
+
i.set(r, new Ve(r, { context: s }));
|
|
122
122
|
}));
|
|
123
123
|
const n = Object.getOwnPropertyDescriptor(e, t);
|
|
124
|
-
let
|
|
124
|
+
let o;
|
|
125
125
|
if (n === void 0) {
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
return
|
|
126
|
+
const r = /* @__PURE__ */ new WeakMap();
|
|
127
|
+
o = { get() {
|
|
128
|
+
return r.get(this);
|
|
129
129
|
}, set(l) {
|
|
130
|
-
i.get(this).setValue(l),
|
|
130
|
+
i.get(this).setValue(l), r.set(this, l);
|
|
131
131
|
}, configurable: !0, enumerable: !0 };
|
|
132
132
|
} else {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
i.get(this).setValue(l),
|
|
133
|
+
const r = n.set;
|
|
134
|
+
o = { ...n, set(l) {
|
|
135
|
+
i.get(this).setValue(l), r == null || r.call(this, l);
|
|
136
136
|
} };
|
|
137
137
|
}
|
|
138
|
-
return void Object.defineProperty(e, t,
|
|
138
|
+
return void Object.defineProperty(e, t, o);
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
}
|
|
@@ -151,13 +151,13 @@ function he({ context: s, subscribe: e }) {
|
|
|
151
151
|
t.set.call(this, n);
|
|
152
152
|
}, subscribe: e });
|
|
153
153
|
})) : t.constructor.addInitializer(((n) => {
|
|
154
|
-
new We(n, { context: s, callback: (
|
|
155
|
-
n[i] =
|
|
154
|
+
new We(n, { context: s, callback: (o) => {
|
|
155
|
+
n[i] = o;
|
|
156
156
|
}, subscribe: e });
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var
|
|
160
|
+
var It = Object.defineProperty, Ot = (s, e, t) => e in s ? It(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, y = (s, e, t) => Ot(s, typeof e != "symbol" ? e + "" : e, t);
|
|
161
161
|
const Rt = "ws://localhost:4567";
|
|
162
162
|
let Le = class {
|
|
163
163
|
constructor() {
|
|
@@ -248,8 +248,8 @@ let Le = class {
|
|
|
248
248
|
const t = this._typing.get(e);
|
|
249
249
|
if (!t) return [];
|
|
250
250
|
const i = Date.now(), n = [];
|
|
251
|
-
for (const [
|
|
252
|
-
i -
|
|
251
|
+
for (const [o, r] of t)
|
|
252
|
+
i - r < 3e3 && n.push(o);
|
|
253
253
|
return n;
|
|
254
254
|
}
|
|
255
255
|
get viewports() {
|
|
@@ -527,8 +527,8 @@ let Le = class {
|
|
|
527
527
|
body: i
|
|
528
528
|
});
|
|
529
529
|
if (!n.ok) {
|
|
530
|
-
const
|
|
531
|
-
throw new Error(
|
|
530
|
+
const o = await n.json().catch(() => ({ error: "Upload failed" }));
|
|
531
|
+
throw new Error(o.error ?? "Upload failed");
|
|
532
532
|
}
|
|
533
533
|
return n.json();
|
|
534
534
|
}
|
|
@@ -561,12 +561,12 @@ let xt = class {
|
|
|
561
561
|
return this.cssText;
|
|
562
562
|
}
|
|
563
563
|
};
|
|
564
|
-
const zt = (s) => new xt(typeof s == "string" ? s : s + "", void 0, ze),
|
|
565
|
-
const t = s.length === 1 ? s[0] : e.reduce((i, n,
|
|
566
|
-
if (
|
|
567
|
-
if (typeof
|
|
568
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
569
|
-
})(n) + s[
|
|
564
|
+
const zt = (s) => new xt(typeof s == "string" ? s : s + "", void 0, ze), M = (s, ...e) => {
|
|
565
|
+
const t = s.length === 1 ? s[0] : e.reduce((i, n, o) => i + ((r) => {
|
|
566
|
+
if (r._$cssResult$ === !0) return r.cssText;
|
|
567
|
+
if (typeof r == "number") return r;
|
|
568
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
569
|
+
})(n) + s[o + 1], s[0]);
|
|
570
570
|
return new xt(t, s, ze);
|
|
571
571
|
}, Ut = (s, e) => {
|
|
572
572
|
if (je) s.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
@@ -628,14 +628,14 @@ let Y = class extends HTMLElement {
|
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
630
|
static getPropertyDescriptor(e, t, i) {
|
|
631
|
-
const { get: n, set:
|
|
631
|
+
const { get: n, set: o } = Nt(this.prototype, e) ?? { get() {
|
|
632
632
|
return this[t];
|
|
633
|
-
}, set(
|
|
634
|
-
this[t] =
|
|
633
|
+
}, set(r) {
|
|
634
|
+
this[t] = r;
|
|
635
635
|
} };
|
|
636
|
-
return { get: n, set(
|
|
636
|
+
return { get: n, set(r) {
|
|
637
637
|
const l = n == null ? void 0 : n.call(this);
|
|
638
|
-
|
|
638
|
+
o == null || o.call(this, r), this.requestUpdate(e, l, i);
|
|
639
639
|
}, configurable: !0, enumerable: !0 };
|
|
640
640
|
}
|
|
641
641
|
static getPropertyOptions(e) {
|
|
@@ -720,34 +720,34 @@ let Y = class extends HTMLElement {
|
|
|
720
720
|
this._$AK(e, i);
|
|
721
721
|
}
|
|
722
722
|
_$ET(e, t) {
|
|
723
|
-
var
|
|
723
|
+
var o;
|
|
724
724
|
const i = this.constructor.elementProperties.get(e), n = this.constructor._$Eu(e, i);
|
|
725
725
|
if (n !== void 0 && i.reflect === !0) {
|
|
726
|
-
const
|
|
727
|
-
this._$Em = e,
|
|
726
|
+
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : ye).toAttribute(t, i.type);
|
|
727
|
+
this._$Em = e, r == null ? this.removeAttribute(n) : this.setAttribute(n, r), this._$Em = null;
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
_$AK(e, t) {
|
|
731
|
-
var
|
|
731
|
+
var o, r;
|
|
732
732
|
const i = this.constructor, n = i._$Eh.get(e);
|
|
733
733
|
if (n !== void 0 && this._$Em !== n) {
|
|
734
|
-
const l = i.getPropertyOptions(n), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((
|
|
734
|
+
const l = i.getPropertyOptions(n), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter : ye;
|
|
735
735
|
this._$Em = n;
|
|
736
736
|
const c = a.fromAttribute(t, l.type);
|
|
737
|
-
this[n] = c ?? ((
|
|
737
|
+
this[n] = c ?? ((r = this._$Ej) == null ? void 0 : r.get(n)) ?? c, this._$Em = null;
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
requestUpdate(e, t, i, n = !1,
|
|
741
|
-
var
|
|
740
|
+
requestUpdate(e, t, i, n = !1, o) {
|
|
741
|
+
var r;
|
|
742
742
|
if (e !== void 0) {
|
|
743
743
|
const l = this.constructor;
|
|
744
|
-
if (n === !1 && (
|
|
744
|
+
if (n === !1 && (o = this[e]), i ?? (i = l.getPropertyOptions(e)), !((i.hasChanged ?? Ue)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(l._$Eu(e, i)))) return;
|
|
745
745
|
this.C(e, t, i);
|
|
746
746
|
}
|
|
747
747
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
748
748
|
}
|
|
749
|
-
C(e, t, { useDefault: i, reflect: n, wrapped:
|
|
750
|
-
i && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(e) && (this._$Ej.set(e,
|
|
749
|
+
C(e, t, { useDefault: i, reflect: n, wrapped: o }, r) {
|
|
750
|
+
i && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(e) && (this._$Ej.set(e, r ?? t ?? this[e]), o !== !0 || r !== void 0) || (this._$AL.has(e) || (this.hasUpdated || i || (t = void 0), this._$AL.set(e, t)), n === !0 && this._$Em !== e && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(e));
|
|
751
751
|
}
|
|
752
752
|
async _$EP() {
|
|
753
753
|
this.isUpdatePending = !0;
|
|
@@ -767,21 +767,21 @@ let Y = class extends HTMLElement {
|
|
|
767
767
|
if (!this.isUpdatePending) return;
|
|
768
768
|
if (!this.hasUpdated) {
|
|
769
769
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
770
|
-
for (const [
|
|
770
|
+
for (const [o, r] of this._$Ep) this[o] = r;
|
|
771
771
|
this._$Ep = void 0;
|
|
772
772
|
}
|
|
773
773
|
const n = this.constructor.elementProperties;
|
|
774
|
-
if (n.size > 0) for (const [
|
|
775
|
-
const { wrapped: l } =
|
|
776
|
-
l !== !0 || this._$AL.has(
|
|
774
|
+
if (n.size > 0) for (const [o, r] of n) {
|
|
775
|
+
const { wrapped: l } = r, a = this[o];
|
|
776
|
+
l !== !0 || this._$AL.has(o) || a === void 0 || this.C(o, void 0, r, a);
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
779
|
let e = !1;
|
|
780
780
|
const t = this._$AL;
|
|
781
781
|
try {
|
|
782
782
|
e = this.shouldUpdate(t), e ? (this.willUpdate(t), (i = this._$EO) == null || i.forEach((n) => {
|
|
783
|
-
var
|
|
784
|
-
return (
|
|
783
|
+
var o;
|
|
784
|
+
return (o = n.hostUpdate) == null ? void 0 : o.call(n);
|
|
785
785
|
}), this.update(t)) : this._$EM();
|
|
786
786
|
} catch (n) {
|
|
787
787
|
throw e = !1, this._$EM(), n;
|
|
@@ -832,21 +832,21 @@ function Et(s, e) {
|
|
|
832
832
|
}
|
|
833
833
|
const Kt = (s, e) => {
|
|
834
834
|
const t = s.length - 1, i = [];
|
|
835
|
-
let n,
|
|
835
|
+
let n, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = te;
|
|
836
836
|
for (let l = 0; l < t; l++) {
|
|
837
837
|
const a = s[l];
|
|
838
838
|
let c, h, p = -1, m = 0;
|
|
839
|
-
for (; m < a.length && (
|
|
840
|
-
const f =
|
|
841
|
-
|
|
839
|
+
for (; m < a.length && (r.lastIndex = m, h = r.exec(a), h !== null); ) m = r.lastIndex, r === te ? h[1] === "!--" ? r = Qe : h[1] !== void 0 ? r = et : h[2] !== void 0 ? ($t.test(h[2]) && (n = RegExp("</" + h[2], "g")), r = H) : h[3] !== void 0 && (r = H) : r === H ? h[0] === ">" ? (r = n ?? te, p = -1) : h[1] === void 0 ? p = -2 : (p = r.lastIndex - h[2].length, c = h[1], r = h[3] === void 0 ? H : h[3] === '"' ? it : tt) : r === it || r === tt ? r = H : r === Qe || r === et ? r = te : (r = H, n = void 0);
|
|
840
|
+
const f = r === H && s[l + 1].startsWith("/>") ? " " : "";
|
|
841
|
+
o += r === te ? a + Vt : p >= 0 ? (i.push(c), a.slice(0, p) + yt + a.slice(p) + z + f) : a + z + (p === -2 ? l : f);
|
|
842
842
|
}
|
|
843
|
-
return [Et(s,
|
|
843
|
+
return [Et(s, o + (s[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
844
844
|
};
|
|
845
845
|
class re {
|
|
846
846
|
constructor({ strings: e, _$litType$: t }, i) {
|
|
847
847
|
let n;
|
|
848
848
|
this.parts = [];
|
|
849
|
-
let
|
|
849
|
+
let o = 0, r = 0;
|
|
850
850
|
const l = e.length - 1, a = this.parts, [c, h] = Kt(e, t);
|
|
851
851
|
if (this.el = re.createElement(c, i), N.currentNode = this.el.content, t === 2 || t === 3) {
|
|
852
852
|
const p = this.el.content.firstChild;
|
|
@@ -855,23 +855,23 @@ class re {
|
|
|
855
855
|
for (; (n = N.nextNode()) !== null && a.length < l; ) {
|
|
856
856
|
if (n.nodeType === 1) {
|
|
857
857
|
if (n.hasAttributes()) for (const p of n.getAttributeNames()) if (p.endsWith(yt)) {
|
|
858
|
-
const m = h[
|
|
859
|
-
a.push({ type: 1, index:
|
|
860
|
-
} else p.startsWith(z) && (a.push({ type: 6, index:
|
|
858
|
+
const m = h[r++], f = n.getAttribute(p).split(z), b = /([.?@])?(.*)/.exec(m);
|
|
859
|
+
a.push({ type: 1, index: o, name: b[2], strings: f, ctor: b[1] === "." ? Jt : b[1] === "?" ? Zt : b[1] === "@" ? Qt : Ee }), n.removeAttribute(p);
|
|
860
|
+
} else p.startsWith(z) && (a.push({ type: 6, index: o }), n.removeAttribute(p));
|
|
861
861
|
if ($t.test(n.tagName)) {
|
|
862
862
|
const p = n.textContent.split(z), m = p.length - 1;
|
|
863
863
|
if (m > 0) {
|
|
864
864
|
n.textContent = we ? we.emptyScript : "";
|
|
865
|
-
for (let f = 0; f < m; f++) n.append(p[f], ne()), N.nextNode(), a.push({ type: 2, index: ++
|
|
865
|
+
for (let f = 0; f < m; f++) n.append(p[f], ne()), N.nextNode(), a.push({ type: 2, index: ++o });
|
|
866
866
|
n.append(p[m], ne());
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
|
-
} else if (n.nodeType === 8) if (n.data === wt) a.push({ type: 2, index:
|
|
869
|
+
} else if (n.nodeType === 8) if (n.data === wt) a.push({ type: 2, index: o });
|
|
870
870
|
else {
|
|
871
871
|
let p = -1;
|
|
872
|
-
for (; (p = n.data.indexOf(z, p + 1)) !== -1; ) a.push({ type: 7, index:
|
|
872
|
+
for (; (p = n.data.indexOf(z, p + 1)) !== -1; ) a.push({ type: 7, index: o }), p += z.length - 1;
|
|
873
873
|
}
|
|
874
|
-
|
|
874
|
+
o++;
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
static createElement(e, t) {
|
|
@@ -880,11 +880,11 @@ class re {
|
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
function K(s, e, t = s, i) {
|
|
883
|
-
var
|
|
883
|
+
var r, l;
|
|
884
884
|
if (e === q) return e;
|
|
885
|
-
let n = i !== void 0 ? (
|
|
886
|
-
const
|
|
887
|
-
return (n == null ? void 0 : n.constructor) !==
|
|
885
|
+
let n = i !== void 0 ? (r = t._$Co) == null ? void 0 : r[i] : t._$Cl;
|
|
886
|
+
const o = oe(e) ? void 0 : e._$litDirective$;
|
|
887
|
+
return (n == null ? void 0 : n.constructor) !== o && ((l = n == null ? void 0 : n._$AO) == null || l.call(n, !1), o === void 0 ? n = void 0 : (n = new o(s), n._$AT(s, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = n : t._$Cl = n), n !== void 0 && (e = K(s, n._$AS(s, e.values), n, i)), e;
|
|
888
888
|
}
|
|
889
889
|
class Gt {
|
|
890
890
|
constructor(e, t) {
|
|
@@ -899,13 +899,13 @@ class Gt {
|
|
|
899
899
|
u(e) {
|
|
900
900
|
const { el: { content: t }, parts: i } = this._$AD, n = ((e == null ? void 0 : e.creationScope) ?? F).importNode(t, !0);
|
|
901
901
|
N.currentNode = n;
|
|
902
|
-
let
|
|
902
|
+
let o = N.nextNode(), r = 0, l = 0, a = i[0];
|
|
903
903
|
for (; a !== void 0; ) {
|
|
904
|
-
if (
|
|
904
|
+
if (r === a.index) {
|
|
905
905
|
let c;
|
|
906
|
-
a.type === 2 ? c = new pe(
|
|
906
|
+
a.type === 2 ? c = new pe(o, o.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (c = new ei(o, this, e)), this._$AV.push(c), a = i[++l];
|
|
907
907
|
}
|
|
908
|
-
|
|
908
|
+
r !== (a == null ? void 0 : a.index) && (o = N.nextNode(), r++);
|
|
909
909
|
}
|
|
910
910
|
return N.currentNode = F, n;
|
|
911
911
|
}
|
|
@@ -946,12 +946,12 @@ class pe {
|
|
|
946
946
|
this._$AH !== u && oe(this._$AH) ? this._$AA.nextSibling.data = e : this.T(F.createTextNode(e)), this._$AH = e;
|
|
947
947
|
}
|
|
948
948
|
$(e) {
|
|
949
|
-
var
|
|
949
|
+
var o;
|
|
950
950
|
const { values: t, _$litType$: i } = e, n = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = re.createElement(Et(i.h, i.h[0]), this.options)), i);
|
|
951
|
-
if (((
|
|
951
|
+
if (((o = this._$AH) == null ? void 0 : o._$AD) === n) this._$AH.p(t);
|
|
952
952
|
else {
|
|
953
|
-
const
|
|
954
|
-
|
|
953
|
+
const r = new Gt(n, this), l = r.u(this.options);
|
|
954
|
+
r.p(t), this.T(l), this._$AH = r;
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
957
|
_$AC(e) {
|
|
@@ -962,7 +962,7 @@ class pe {
|
|
|
962
962
|
De(this._$AH) || (this._$AH = [], this._$AR());
|
|
963
963
|
const t = this._$AH;
|
|
964
964
|
let i, n = 0;
|
|
965
|
-
for (const
|
|
965
|
+
for (const o of e) n === t.length ? t.push(i = new pe(this.O(ne()), this.O(ne()), this, this.options)) : i = t[n], i._$AI(o), n++;
|
|
966
966
|
n < t.length && (this._$AR(i && i._$AB.nextSibling, n), t.length = n);
|
|
967
967
|
}
|
|
968
968
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
@@ -984,19 +984,19 @@ class Ee {
|
|
|
984
984
|
get _$AU() {
|
|
985
985
|
return this._$AM._$AU;
|
|
986
986
|
}
|
|
987
|
-
constructor(e, t, i, n,
|
|
988
|
-
this.type = 1, this._$AH = u, this._$AN = void 0, this.element = e, this.name = t, this._$AM = n, this.options =
|
|
987
|
+
constructor(e, t, i, n, o) {
|
|
988
|
+
this.type = 1, this._$AH = u, this._$AN = void 0, this.element = e, this.name = t, this._$AM = n, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = u;
|
|
989
989
|
}
|
|
990
990
|
_$AI(e, t = this, i, n) {
|
|
991
|
-
const
|
|
992
|
-
let
|
|
993
|
-
if (
|
|
991
|
+
const o = this.strings;
|
|
992
|
+
let r = !1;
|
|
993
|
+
if (o === void 0) e = K(this, e, t, 0), r = !oe(e) || e !== this._$AH && e !== q, r && (this._$AH = e);
|
|
994
994
|
else {
|
|
995
995
|
const l = e;
|
|
996
996
|
let a, c;
|
|
997
|
-
for (e =
|
|
997
|
+
for (e = o[0], a = 0; a < o.length - 1; a++) c = K(this, l[i + a], t, a), c === q && (c = this._$AH[a]), r || (r = !oe(c) || c !== this._$AH[a]), c === u ? e = u : e !== u && (e += (c ?? "") + o[a + 1]), this._$AH[a] = c;
|
|
998
998
|
}
|
|
999
|
-
|
|
999
|
+
r && !n && this.j(e);
|
|
1000
1000
|
}
|
|
1001
1001
|
j(e) {
|
|
1002
1002
|
e === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
@@ -1019,13 +1019,13 @@ class Zt extends Ee {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
1021
|
class Qt extends Ee {
|
|
1022
|
-
constructor(e, t, i, n,
|
|
1023
|
-
super(e, t, i, n,
|
|
1022
|
+
constructor(e, t, i, n, o) {
|
|
1023
|
+
super(e, t, i, n, o), this.type = 5;
|
|
1024
1024
|
}
|
|
1025
1025
|
_$AI(e, t = this) {
|
|
1026
1026
|
if ((e = K(this, e, t, 0) ?? u) === q) return;
|
|
1027
|
-
const i = this._$AH, n = e === u && i !== u || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive,
|
|
1028
|
-
n && this.element.removeEventListener(this.name, this, i),
|
|
1027
|
+
const i = this._$AH, n = e === u && i !== u || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== u && (i === u || n);
|
|
1028
|
+
n && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
1029
1029
|
}
|
|
1030
1030
|
handleEvent(e) {
|
|
1031
1031
|
var t;
|
|
@@ -1049,8 +1049,8 @@ const ti = (s, e, t) => {
|
|
|
1049
1049
|
const i = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
1050
1050
|
let n = i._$litPart$;
|
|
1051
1051
|
if (n === void 0) {
|
|
1052
|
-
const
|
|
1053
|
-
i._$litPart$ = n = new pe(e.insertBefore(ne(),
|
|
1052
|
+
const o = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
1053
|
+
i._$litPart$ = n = new pe(e.insertBefore(ne(), o), o, void 0, t ?? {});
|
|
1054
1054
|
}
|
|
1055
1055
|
return n._$AI(s), n;
|
|
1056
1056
|
};
|
|
@@ -1107,29 +1107,29 @@ const R = (s) => (e, t) => {
|
|
|
1107
1107
|
*/
|
|
1108
1108
|
const ii = { attribute: !0, type: String, converter: ye, reflect: !1, hasChanged: Ue }, si = (s = ii, e, t) => {
|
|
1109
1109
|
const { kind: i, metadata: n } = t;
|
|
1110
|
-
let
|
|
1111
|
-
if (
|
|
1112
|
-
const { name:
|
|
1110
|
+
let o = globalThis.litPropertyMetadata.get(n);
|
|
1111
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(n, o = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), o.set(t.name, s), i === "accessor") {
|
|
1112
|
+
const { name: r } = t;
|
|
1113
1113
|
return { set(l) {
|
|
1114
1114
|
const a = e.get.call(this);
|
|
1115
|
-
e.set.call(this, l), this.requestUpdate(
|
|
1115
|
+
e.set.call(this, l), this.requestUpdate(r, a, s, !0, l);
|
|
1116
1116
|
}, init(l) {
|
|
1117
|
-
return l !== void 0 && this.C(
|
|
1117
|
+
return l !== void 0 && this.C(r, void 0, s, l), l;
|
|
1118
1118
|
} };
|
|
1119
1119
|
}
|
|
1120
1120
|
if (i === "setter") {
|
|
1121
|
-
const { name:
|
|
1121
|
+
const { name: r } = t;
|
|
1122
1122
|
return function(l) {
|
|
1123
|
-
const a = this[
|
|
1124
|
-
e.call(this, l), this.requestUpdate(
|
|
1123
|
+
const a = this[r];
|
|
1124
|
+
e.call(this, l), this.requestUpdate(r, a, s, !0, l);
|
|
1125
1125
|
};
|
|
1126
1126
|
}
|
|
1127
1127
|
throw Error("Unsupported decorator location: " + i);
|
|
1128
1128
|
};
|
|
1129
1129
|
function g(s) {
|
|
1130
|
-
return (e, t) => typeof t == "object" ? si(s, e, t) : ((i, n,
|
|
1131
|
-
const
|
|
1132
|
-
return n.constructor.createProperty(
|
|
1130
|
+
return (e, t) => typeof t == "object" ? si(s, e, t) : ((i, n, o) => {
|
|
1131
|
+
const r = n.hasOwnProperty(o);
|
|
1132
|
+
return n.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(n, o) : void 0;
|
|
1133
1133
|
})(s, e, t);
|
|
1134
1134
|
}
|
|
1135
1135
|
/**
|
|
@@ -1142,8 +1142,8 @@ function v(s) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
const J = "pulse-client";
|
|
1144
1144
|
var ni = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, Z = (s, e, t, i) => {
|
|
1145
|
-
for (var n = i > 1 ? void 0 : i ? oi(e, t) : e,
|
|
1146
|
-
(
|
|
1145
|
+
for (var n = i > 1 ? void 0 : i ? oi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1146
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1147
1147
|
return i && n && ni(e, t, n), n;
|
|
1148
1148
|
};
|
|
1149
1149
|
let W = class extends S {
|
|
@@ -1181,14 +1181,14 @@ Z([
|
|
|
1181
1181
|
g()
|
|
1182
1182
|
], W.prototype, "endpoint", 2);
|
|
1183
1183
|
Z([
|
|
1184
|
-
|
|
1184
|
+
Mt({ context: J })
|
|
1185
1185
|
], W.prototype, "client", 2);
|
|
1186
1186
|
W = Z([
|
|
1187
1187
|
R("pulse-provider")
|
|
1188
1188
|
], W);
|
|
1189
1189
|
var ri = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, Ce = (s, e, t, i) => {
|
|
1190
|
-
for (var n = i > 1 ? void 0 : i ? ai(e, t) : e,
|
|
1191
|
-
(
|
|
1190
|
+
for (var n = i > 1 ? void 0 : i ? ai(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1191
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1192
1192
|
return i && n && ri(e, t, n), n;
|
|
1193
1193
|
};
|
|
1194
1194
|
let G = class extends S {
|
|
@@ -1235,7 +1235,7 @@ let G = class extends S {
|
|
|
1235
1235
|
`;
|
|
1236
1236
|
}
|
|
1237
1237
|
};
|
|
1238
|
-
G.styles =
|
|
1238
|
+
G.styles = M`
|
|
1239
1239
|
:host {
|
|
1240
1240
|
display: inline-flex;
|
|
1241
1241
|
align-items: center;
|
|
@@ -1353,8 +1353,8 @@ G = Ce([
|
|
|
1353
1353
|
R("pulse-presence")
|
|
1354
1354
|
], G);
|
|
1355
1355
|
var li = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, He = (s, e, t, i) => {
|
|
1356
|
-
for (var n = i > 1 ? void 0 : i ? ci(e, t) : e,
|
|
1357
|
-
(
|
|
1356
|
+
for (var n = i > 1 ? void 0 : i ? ci(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1357
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1358
1358
|
return i && n && li(e, t, n), n;
|
|
1359
1359
|
};
|
|
1360
1360
|
let ae = class extends S {
|
|
@@ -1434,7 +1434,7 @@ let ae = class extends S {
|
|
|
1434
1434
|
`;
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
1437
|
-
ae.styles =
|
|
1437
|
+
ae.styles = M`
|
|
1438
1438
|
:host {
|
|
1439
1439
|
position: fixed;
|
|
1440
1440
|
top: 0;
|
|
@@ -1482,8 +1482,8 @@ ae = He([
|
|
|
1482
1482
|
R("pulse-cursors")
|
|
1483
1483
|
], ae);
|
|
1484
1484
|
var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, ue = (s, e, t, i) => {
|
|
1485
|
-
for (var n = i > 1 ? void 0 : i ? hi(e, t) : e,
|
|
1486
|
-
(
|
|
1485
|
+
for (var n = i > 1 ? void 0 : i ? hi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1486
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1487
1487
|
return i && n && di(e, t, n), n;
|
|
1488
1488
|
};
|
|
1489
1489
|
let V = class extends S {
|
|
@@ -1522,15 +1522,15 @@ let V = class extends S {
|
|
|
1522
1522
|
s.preventDefault();
|
|
1523
1523
|
const t = s.target.querySelector("textarea"), i = t.value.trim();
|
|
1524
1524
|
if (!i) return;
|
|
1525
|
-
const n = [...i.matchAll(/@(\w+)/g)].map((
|
|
1525
|
+
const n = [...i.matchAll(/@(\w+)/g)].map((o) => o[1]);
|
|
1526
1526
|
this.client.createThread(i, { mentions: n }), t.value = "";
|
|
1527
1527
|
}
|
|
1528
1528
|
handleReply(s, e) {
|
|
1529
1529
|
e.preventDefault();
|
|
1530
1530
|
const i = e.target.querySelector("input"), n = i.value.trim();
|
|
1531
1531
|
if (!n) return;
|
|
1532
|
-
const
|
|
1533
|
-
this.client.reply(s, n,
|
|
1532
|
+
const o = [...n.matchAll(/@(\w+)/g)].map((r) => r[1]);
|
|
1533
|
+
this.client.reply(s, n, o), i.value = "", this.replyingTo = null;
|
|
1534
1534
|
}
|
|
1535
1535
|
render() {
|
|
1536
1536
|
const s = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
|
|
@@ -1600,11 +1600,11 @@ let V = class extends S {
|
|
|
1600
1600
|
const e = new Date(s), i = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), n = Math.floor(i / 6e4);
|
|
1601
1601
|
if (n < 1) return "just now";
|
|
1602
1602
|
if (n < 60) return `${n}m ago`;
|
|
1603
|
-
const
|
|
1604
|
-
return
|
|
1603
|
+
const o = Math.floor(n / 60);
|
|
1604
|
+
return o < 24 ? `${o}h ago` : e.toLocaleDateString();
|
|
1605
1605
|
}
|
|
1606
1606
|
};
|
|
1607
|
-
V.styles =
|
|
1607
|
+
V.styles = M`
|
|
1608
1608
|
:host {
|
|
1609
1609
|
display: block;
|
|
1610
1610
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -1833,8 +1833,8 @@ V = ue([
|
|
|
1833
1833
|
R("pulse-comments")
|
|
1834
1834
|
], V);
|
|
1835
1835
|
var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, Ne = (s, e, t, i) => {
|
|
1836
|
-
for (var n = i > 1 ? void 0 : i ? ui(e, t) : e,
|
|
1837
|
-
(
|
|
1836
|
+
for (var n = i > 1 ? void 0 : i ? ui(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1837
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1838
1838
|
return i && n && pi(e, t, n), n;
|
|
1839
1839
|
};
|
|
1840
1840
|
const fi = {
|
|
@@ -1892,8 +1892,8 @@ let le = class extends S {
|
|
|
1892
1892
|
const e = new Date(s), i = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), n = Math.floor(i / 6e4);
|
|
1893
1893
|
if (n < 1) return "just now";
|
|
1894
1894
|
if (n < 60) return `${n}m ago`;
|
|
1895
|
-
const
|
|
1896
|
-
return
|
|
1895
|
+
const o = Math.floor(n / 60);
|
|
1896
|
+
return o < 24 ? `${o}h ago` : e.toLocaleDateString();
|
|
1897
1897
|
}
|
|
1898
1898
|
render() {
|
|
1899
1899
|
const s = this.notifications.filter((e) => !e.read).length;
|
|
@@ -1933,7 +1933,7 @@ let le = class extends S {
|
|
|
1933
1933
|
`;
|
|
1934
1934
|
}
|
|
1935
1935
|
};
|
|
1936
|
-
le.styles =
|
|
1936
|
+
le.styles = M`
|
|
1937
1937
|
:host {
|
|
1938
1938
|
display: block;
|
|
1939
1939
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -2085,8 +2085,8 @@ le = Ne([
|
|
|
2085
2085
|
R("pulse-notifications")
|
|
2086
2086
|
], le);
|
|
2087
2087
|
var gi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Q = (s, e, t, i) => {
|
|
2088
|
-
for (var n = i > 1 ? void 0 : i ? bi(e, t) : e,
|
|
2089
|
-
(
|
|
2088
|
+
for (var n = i > 1 ? void 0 : i ? bi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
2089
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
2090
2090
|
return i && n && gi(e, t, n), n;
|
|
2091
2091
|
};
|
|
2092
2092
|
const vi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
@@ -2114,12 +2114,12 @@ let D = class extends S {
|
|
|
2114
2114
|
var t, i;
|
|
2115
2115
|
const s = /* @__PURE__ */ new Map(), e = (i = (t = this.client) == null ? void 0 : t.state.user) == null ? void 0 : i.id;
|
|
2116
2116
|
for (const n of this.reactions) {
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2117
|
+
const o = s.get(n.emoji) ?? { count: 0, userReactionId: null };
|
|
2118
|
+
o.count++, n.userId === e && (o.userReactionId = n.id), s.set(n.emoji, o);
|
|
2119
2119
|
}
|
|
2120
|
-
return [...s.entries()].map(([n,
|
|
2120
|
+
return [...s.entries()].map(([n, o]) => ({
|
|
2121
2121
|
emoji: n,
|
|
2122
|
-
...
|
|
2122
|
+
...o
|
|
2123
2123
|
}));
|
|
2124
2124
|
}
|
|
2125
2125
|
toggleReaction(s) {
|
|
@@ -2164,7 +2164,7 @@ let D = class extends S {
|
|
|
2164
2164
|
`;
|
|
2165
2165
|
}
|
|
2166
2166
|
};
|
|
2167
|
-
D.styles =
|
|
2167
|
+
D.styles = M`
|
|
2168
2168
|
:host {
|
|
2169
2169
|
display: inline-flex;
|
|
2170
2170
|
align-items: center;
|
|
@@ -2322,7 +2322,7 @@ class wi {
|
|
|
2322
2322
|
* Copyright 2017 Google LLC
|
|
2323
2323
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2324
2324
|
*/
|
|
2325
|
-
class
|
|
2325
|
+
class Me extends wi {
|
|
2326
2326
|
constructor(e) {
|
|
2327
2327
|
if (super(e), this.it = u, e.type !== xi.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2328
2328
|
}
|
|
@@ -2336,16 +2336,16 @@ class Ie extends wi {
|
|
|
2336
2336
|
return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
|
|
2337
2337
|
}
|
|
2338
2338
|
}
|
|
2339
|
-
|
|
2339
|
+
Me.directiveName = "unsafeHTML", Me.resultType = 1;
|
|
2340
2340
|
/**
|
|
2341
2341
|
* @license
|
|
2342
2342
|
* Copyright 2017 Google LLC
|
|
2343
2343
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2344
2344
|
*/
|
|
2345
|
-
class
|
|
2345
|
+
class Ie extends Me {
|
|
2346
2346
|
}
|
|
2347
|
-
|
|
2348
|
-
const $i = yi(
|
|
2347
|
+
Ie.directiveName = "unsafeSVG", Ie.resultType = 2;
|
|
2348
|
+
const $i = yi(Ie);
|
|
2349
2349
|
/**
|
|
2350
2350
|
* @license lucide v0.577.0 - ISC
|
|
2351
2351
|
*
|
|
@@ -2483,7 +2483,7 @@ const Ai = [
|
|
|
2483
2483
|
* This source code is licensed under the ISC license.
|
|
2484
2484
|
* See the LICENSE file in the root directory of this source tree.
|
|
2485
2485
|
*/
|
|
2486
|
-
const
|
|
2486
|
+
const Mi = [
|
|
2487
2487
|
["path", { d: "M10 11v6" }],
|
|
2488
2488
|
["path", { d: "M14 11v6" }],
|
|
2489
2489
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }],
|
|
@@ -2506,7 +2506,7 @@ const fe = [
|
|
|
2506
2506
|
* This source code is licensed under the ISC license.
|
|
2507
2507
|
* See the LICENSE file in the root directory of this source tree.
|
|
2508
2508
|
*/
|
|
2509
|
-
const
|
|
2509
|
+
const Ii = [
|
|
2510
2510
|
[
|
|
2511
2511
|
"path",
|
|
2512
2512
|
{
|
|
@@ -2516,7 +2516,7 @@ const Mi = [
|
|
|
2516
2516
|
];
|
|
2517
2517
|
function Oi(s) {
|
|
2518
2518
|
return s.map(([e, t]) => {
|
|
2519
|
-
const i = Object.entries(t).filter(([, n]) => n != null).map(([n,
|
|
2519
|
+
const i = Object.entries(t).filter(([, n]) => n != null).map(([n, o]) => `${n}="${o}"`).join(" ");
|
|
2520
2520
|
return `<${e} ${i}/>`;
|
|
2521
2521
|
}).join("");
|
|
2522
2522
|
}
|
|
@@ -2533,7 +2533,7 @@ function C(s, e = 18) {
|
|
|
2533
2533
|
stroke-linejoin="round"
|
|
2534
2534
|
>${$i(Oi(s))}</svg>`;
|
|
2535
2535
|
}
|
|
2536
|
-
const ee =
|
|
2536
|
+
const ee = M`
|
|
2537
2537
|
* {
|
|
2538
2538
|
box-sizing: border-box;
|
|
2539
2539
|
margin: 0;
|
|
@@ -2576,7 +2576,7 @@ const ee = I`
|
|
|
2576
2576
|
--pw-shadow: var(--pulse-shadow);
|
|
2577
2577
|
--pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
2578
2578
|
}
|
|
2579
|
-
`, me =
|
|
2579
|
+
`, me = M`
|
|
2580
2580
|
.pw-btn {
|
|
2581
2581
|
display: inline-flex;
|
|
2582
2582
|
align-items: center;
|
|
@@ -2620,7 +2620,7 @@ const ee = I`
|
|
|
2620
2620
|
width: 18px;
|
|
2621
2621
|
height: 18px;
|
|
2622
2622
|
}
|
|
2623
|
-
`, _e =
|
|
2623
|
+
`, _e = M`
|
|
2624
2624
|
.pw-scrollable::-webkit-scrollbar {
|
|
2625
2625
|
width: 4px;
|
|
2626
2626
|
}
|
|
@@ -2633,8 +2633,8 @@ const ee = I`
|
|
|
2633
2633
|
}
|
|
2634
2634
|
`;
|
|
2635
2635
|
var Ri = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, Be = (s, e, t, i) => {
|
|
2636
|
-
for (var n = i > 1 ? void 0 : i ? Li(e, t) : e,
|
|
2637
|
-
(
|
|
2636
|
+
for (var n = i > 1 ? void 0 : i ? Li(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
2637
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
2638
2638
|
return i && n && Ri(e, t, n), n;
|
|
2639
2639
|
};
|
|
2640
2640
|
let X = class extends S {
|
|
@@ -2723,7 +2723,7 @@ X.styles = [
|
|
|
2723
2723
|
ee,
|
|
2724
2724
|
me,
|
|
2725
2725
|
_e,
|
|
2726
|
-
|
|
2726
|
+
M`
|
|
2727
2727
|
:host {
|
|
2728
2728
|
display: block;
|
|
2729
2729
|
}
|
|
@@ -2872,9 +2872,9 @@ class Oe {
|
|
|
2872
2872
|
* element once metadata has loaded.
|
|
2873
2873
|
*/
|
|
2874
2874
|
static render(e, t) {
|
|
2875
|
-
let i = !1, n = t != null ? t / 1e3 : 0,
|
|
2876
|
-
const
|
|
2877
|
-
|
|
2875
|
+
let i = !1, n = t != null ? t / 1e3 : 0, o = 0;
|
|
2876
|
+
const r = document.createElement("audio");
|
|
2877
|
+
r.preload = "metadata", r.src = e;
|
|
2878
2878
|
const l = document.createElement("div");
|
|
2879
2879
|
Object.assign(l.style, {
|
|
2880
2880
|
display: "inline-flex",
|
|
@@ -2964,12 +2964,12 @@ class Oe {
|
|
|
2964
2964
|
lineHeight: "1"
|
|
2965
2965
|
});
|
|
2966
2966
|
function _() {
|
|
2967
|
-
const k = at(
|
|
2967
|
+
const k = at(o), A = at(n);
|
|
2968
2968
|
x.textContent = `${k} / ${A}`;
|
|
2969
2969
|
}
|
|
2970
2970
|
_(), m.appendChild(f), m.appendChild(x), l.appendChild(a), l.appendChild(m);
|
|
2971
2971
|
function $() {
|
|
2972
|
-
const k = n > 0 ?
|
|
2972
|
+
const k = n > 0 ? o / n : 0, A = Math.floor(k * ve);
|
|
2973
2973
|
for (let w = 0; w < ve; w++)
|
|
2974
2974
|
b[w].style.background = w <= A ? nt : ot;
|
|
2975
2975
|
}
|
|
@@ -2979,22 +2979,22 @@ class Oe {
|
|
|
2979
2979
|
1,
|
|
2980
2980
|
Math.max(0, (k.clientX - A.left) / A.width)
|
|
2981
2981
|
);
|
|
2982
|
-
|
|
2982
|
+
r.currentTime = w * n, o = r.currentTime, $(), _();
|
|
2983
2983
|
}), a.addEventListener("click", () => {
|
|
2984
|
-
i ?
|
|
2984
|
+
i ? r.pause() : r.play().catch(() => {
|
|
2985
2985
|
});
|
|
2986
|
-
}),
|
|
2986
|
+
}), r.addEventListener("play", () => {
|
|
2987
2987
|
i = !0, p();
|
|
2988
|
-
}),
|
|
2988
|
+
}), r.addEventListener("pause", () => {
|
|
2989
2989
|
i = !1, h();
|
|
2990
|
-
}),
|
|
2991
|
-
i = !1, h(),
|
|
2992
|
-
}),
|
|
2993
|
-
|
|
2994
|
-
}),
|
|
2995
|
-
|
|
2996
|
-
}),
|
|
2997
|
-
|
|
2990
|
+
}), r.addEventListener("ended", () => {
|
|
2991
|
+
i = !1, h(), o = 0, $(), _();
|
|
2992
|
+
}), r.addEventListener("timeupdate", () => {
|
|
2993
|
+
o = r.currentTime, $(), _();
|
|
2994
|
+
}), r.addEventListener("loadedmetadata", () => {
|
|
2995
|
+
r.duration && isFinite(r.duration) && (n = r.duration, _());
|
|
2996
|
+
}), r.addEventListener("durationchange", () => {
|
|
2997
|
+
r.duration && isFinite(r.duration) && (n = r.duration, _());
|
|
2998
2998
|
}), l;
|
|
2999
2999
|
}
|
|
3000
3000
|
}
|
|
@@ -3014,20 +3014,20 @@ class Re {
|
|
|
3014
3014
|
this.analyser = this.audioCtx.createAnalyser(), this.analyser.fftSize = 64, t.connect(this.analyser);
|
|
3015
3015
|
const i = this.detectMimeType(), n = {};
|
|
3016
3016
|
i && (n.mimeType = i), this.recorder = new MediaRecorder(this.stream, n);
|
|
3017
|
-
const
|
|
3017
|
+
const o = [];
|
|
3018
3018
|
this.recorder.ondataavailable = (l) => {
|
|
3019
|
-
l.data.size > 0 &&
|
|
3019
|
+
l.data.size > 0 && o.push(l.data);
|
|
3020
3020
|
}, this.buildUI(e);
|
|
3021
|
-
const
|
|
3021
|
+
const r = new Promise((l) => {
|
|
3022
3022
|
this.resolve = l;
|
|
3023
3023
|
});
|
|
3024
3024
|
return this.recorder.onstop = () => {
|
|
3025
3025
|
var c, h;
|
|
3026
|
-
const l = ((c = this.recorder) == null ? void 0 : c.mimeType) || i || "audio/webm", a = new Blob(
|
|
3026
|
+
const l = ((c = this.recorder) == null ? void 0 : c.mimeType) || i || "audio/webm", a = new Blob(o, { type: l });
|
|
3027
3027
|
(h = this.resolve) == null || h.call(this, a), this.resolve = null, this.cleanupResources();
|
|
3028
3028
|
}, this.recorder.start(), this.recording = !0, this.startTime = Date.now(), this.maxTimer = setTimeout(() => {
|
|
3029
3029
|
this.stopRecording();
|
|
3030
|
-
}, this.maxDuration), this.animate(),
|
|
3030
|
+
}, this.maxDuration), this.animate(), r;
|
|
3031
3031
|
}
|
|
3032
3032
|
/** Stops recording — resolves the promise with the recorded Blob. */
|
|
3033
3033
|
stopRecording() {
|
|
@@ -3125,11 +3125,11 @@ class Re {
|
|
|
3125
3125
|
if (!this.canvas || !this.analyser) return;
|
|
3126
3126
|
const e = this.canvas.getContext("2d");
|
|
3127
3127
|
if (!e) return;
|
|
3128
|
-
const t = this.canvas.width, i = this.canvas.height, n = this.analyser.frequencyBinCount,
|
|
3129
|
-
this.analyser.getByteFrequencyData(
|
|
3130
|
-
const
|
|
3131
|
-
for (let c = 0; c <
|
|
3132
|
-
const h =
|
|
3128
|
+
const t = this.canvas.width, i = this.canvas.height, n = this.analyser.frequencyBinCount, o = new Uint8Array(n);
|
|
3129
|
+
this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
|
|
3130
|
+
const r = n, l = Math.max(2, t / r * 0.7), a = (t - l * r) / (r - 1 || 1);
|
|
3131
|
+
for (let c = 0; c < r; c++) {
|
|
3132
|
+
const h = o[c] / 255, p = Math.max(2, h * i * 0.85), m = c * (l + a), f = (i - p) / 2, b = 0.4 + h * 0.6;
|
|
3133
3133
|
e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(m, f, l, p, 1), e.fill();
|
|
3134
3134
|
}
|
|
3135
3135
|
}
|
|
@@ -3171,8 +3171,8 @@ class _t {
|
|
|
3171
3171
|
*/
|
|
3172
3172
|
static render(e, t) {
|
|
3173
3173
|
let i = !1, n = !0;
|
|
3174
|
-
const
|
|
3175
|
-
Object.assign(
|
|
3174
|
+
const o = document.createElement("div");
|
|
3175
|
+
Object.assign(o.style, {
|
|
3176
3176
|
position: "relative",
|
|
3177
3177
|
display: "inline-block",
|
|
3178
3178
|
width: `${lt}px`,
|
|
@@ -3186,14 +3186,14 @@ class _t {
|
|
|
3186
3186
|
userSelect: "none",
|
|
3187
3187
|
WebkitUserSelect: "none"
|
|
3188
3188
|
});
|
|
3189
|
-
const
|
|
3190
|
-
Object.assign(
|
|
3189
|
+
const r = document.createElement("video");
|
|
3190
|
+
Object.assign(r.style, {
|
|
3191
3191
|
width: "100%",
|
|
3192
3192
|
height: "100%",
|
|
3193
3193
|
objectFit: "cover",
|
|
3194
3194
|
display: "block",
|
|
3195
3195
|
borderRadius: "50%"
|
|
3196
|
-
}),
|
|
3196
|
+
}), r.src = e, r.loop = !0, r.muted = !0, r.playsInline = !0, r.preload = "metadata", t && (r.poster = t), o.appendChild(r);
|
|
3197
3197
|
const l = document.createElement("div");
|
|
3198
3198
|
Object.assign(l.style, {
|
|
3199
3199
|
position: "absolute",
|
|
@@ -3208,7 +3208,7 @@ class _t {
|
|
|
3208
3208
|
transition: "opacity 0.25s ease",
|
|
3209
3209
|
opacity: "1",
|
|
3210
3210
|
pointerEvents: "none"
|
|
3211
|
-
}), l.innerHTML = Ni,
|
|
3211
|
+
}), l.innerHTML = Ni, o.appendChild(l);
|
|
3212
3212
|
const a = document.createElement("div");
|
|
3213
3213
|
Object.assign(a.style, {
|
|
3214
3214
|
position: "absolute",
|
|
@@ -3223,19 +3223,19 @@ class _t {
|
|
|
3223
3223
|
justifyContent: "center",
|
|
3224
3224
|
pointerEvents: "none",
|
|
3225
3225
|
transition: "opacity 0.2s ease"
|
|
3226
|
-
}), a.innerHTML = ct,
|
|
3226
|
+
}), a.innerHTML = ct, o.appendChild(a);
|
|
3227
3227
|
function c() {
|
|
3228
3228
|
l.style.opacity = i ? "0" : "1";
|
|
3229
3229
|
}
|
|
3230
3230
|
function h() {
|
|
3231
3231
|
a.style.display = i ? "flex" : "none", a.innerHTML = n ? ct : Bi;
|
|
3232
3232
|
}
|
|
3233
|
-
return
|
|
3234
|
-
p.stopPropagation(), i ? n ? (
|
|
3233
|
+
return o.addEventListener("click", (p) => {
|
|
3234
|
+
p.stopPropagation(), i ? n ? (r.muted = !1, n = !1) : (r.pause(), i = !1, n = !0, r.muted = !0) : (r.muted = !0, n = !0, r.play().catch(() => {
|
|
3235
3235
|
}), i = !0), c(), h();
|
|
3236
|
-
}),
|
|
3237
|
-
i && (i = !1, n = !0,
|
|
3238
|
-
}),
|
|
3236
|
+
}), r.addEventListener("pause", () => {
|
|
3237
|
+
i && (i = !1, n = !0, r.muted = !0, c(), h());
|
|
3238
|
+
}), o;
|
|
3239
3239
|
}
|
|
3240
3240
|
}
|
|
3241
3241
|
const dt = 60, Fi = `
|
|
@@ -3369,8 +3369,8 @@ function Vi(s) {
|
|
|
3369
3369
|
n.muted = !0, n.playsInline = !0, n.preload = "auto", n.src = i, n.addEventListener("loadeddata", () => {
|
|
3370
3370
|
n.currentTime = 0.01;
|
|
3371
3371
|
}), n.addEventListener("seeked", () => {
|
|
3372
|
-
const
|
|
3373
|
-
|
|
3372
|
+
const o = document.createElement("canvas");
|
|
3373
|
+
o.width = n.videoWidth || 240, o.height = n.videoHeight || 240, o.getContext("2d").drawImage(n, 0, 0, o.width, o.height), URL.revokeObjectURL(i), o.toBlob(
|
|
3374
3374
|
(l) => {
|
|
3375
3375
|
l ? e(l) : t(new Error("Failed to generate poster frame"));
|
|
3376
3376
|
},
|
|
@@ -3401,15 +3401,15 @@ class Xi {
|
|
|
3401
3401
|
}));
|
|
3402
3402
|
const i = Wi(), n = {};
|
|
3403
3403
|
i && (n.mimeType = i);
|
|
3404
|
-
const
|
|
3405
|
-
return this.mediaRecorder =
|
|
3406
|
-
|
|
3407
|
-
},
|
|
3404
|
+
const o = new MediaRecorder(t, n);
|
|
3405
|
+
return this.mediaRecorder = o, o.ondataavailable = (r) => {
|
|
3406
|
+
r.data.size > 0 && this.chunks.push(r.data);
|
|
3407
|
+
}, o.onstop = () => {
|
|
3408
3408
|
this.handleRecordingComplete();
|
|
3409
|
-
},
|
|
3409
|
+
}, o.start(), this.timerInterval = setInterval(() => {
|
|
3410
3410
|
this.elapsed++, this.updateTimer(), this.elapsed >= dt && this.stopRecording();
|
|
3411
|
-
}, 1e3), new Promise((
|
|
3412
|
-
this.resolvePromise =
|
|
3411
|
+
}, 1e3), new Promise((r) => {
|
|
3412
|
+
this.resolvePromise = r;
|
|
3413
3413
|
});
|
|
3414
3414
|
}
|
|
3415
3415
|
stopRecording() {
|
|
@@ -3431,12 +3431,12 @@ class Xi {
|
|
|
3431
3431
|
i.className = "vr-ring", t.appendChild(i);
|
|
3432
3432
|
const n = document.createElement("div");
|
|
3433
3433
|
n.className = "vr-video-circle", this.videoEl = document.createElement("video"), this.videoEl.muted = !0, this.videoEl.playsInline = !0, this.videoEl.setAttribute("playsinline", ""), n.appendChild(this.videoEl), t.appendChild(n), this.root.appendChild(t), this.timerEl = document.createElement("span"), this.timerEl.className = "vr-timer", this.timerEl.textContent = "00:00", this.root.appendChild(this.timerEl);
|
|
3434
|
-
const
|
|
3435
|
-
|
|
3436
|
-
const
|
|
3437
|
-
|
|
3434
|
+
const o = document.createElement("div");
|
|
3435
|
+
o.className = "vr-actions";
|
|
3436
|
+
const r = document.createElement("button");
|
|
3437
|
+
r.className = "vr-btn vr-btn-stop", r.textContent = "Stop", r.addEventListener("click", () => this.stopRecording()), o.appendChild(r);
|
|
3438
3438
|
const l = document.createElement("button");
|
|
3439
|
-
l.className = "vr-btn vr-btn-cancel", l.textContent = "Cancel", l.addEventListener("click", () => this.cancelRecording()),
|
|
3439
|
+
l.className = "vr-btn vr-btn-cancel", l.textContent = "Cancel", l.addEventListener("click", () => this.cancelRecording()), o.appendChild(l), this.root.appendChild(o), e.appendChild(this.root);
|
|
3440
3440
|
}
|
|
3441
3441
|
updateTimer() {
|
|
3442
3442
|
if (!this.timerEl) return;
|
|
@@ -3444,18 +3444,18 @@ class Xi {
|
|
|
3444
3444
|
this.timerEl.textContent = qi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
|
|
3445
3445
|
}
|
|
3446
3446
|
async handleRecordingComplete() {
|
|
3447
|
-
var n,
|
|
3447
|
+
var n, o;
|
|
3448
3448
|
const e = ((n = this.mediaRecorder) == null ? void 0 : n.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
|
|
3449
3449
|
let i;
|
|
3450
3450
|
try {
|
|
3451
3451
|
i = await Vi(t);
|
|
3452
3452
|
} catch {
|
|
3453
|
-
const
|
|
3454
|
-
|
|
3455
|
-
|
|
3453
|
+
const r = document.createElement("canvas");
|
|
3454
|
+
r.width = 1, r.height = 1, i = await new Promise((l) => {
|
|
3455
|
+
r.toBlob((a) => l(a), "image/png");
|
|
3456
3456
|
});
|
|
3457
3457
|
}
|
|
3458
|
-
this.cleanup(), (
|
|
3458
|
+
this.cleanup(), (o = this.resolvePromise) == null || o.call(this, { blob: t, posterBlob: i }), this.resolvePromise = null;
|
|
3459
3459
|
}
|
|
3460
3460
|
cleanup() {
|
|
3461
3461
|
if (this.recording = !1, this.timerInterval && (clearInterval(this.timerInterval), this.timerInterval = null), this.mediaRecorder && this.mediaRecorder.state !== "inactive")
|
|
@@ -3517,8 +3517,8 @@ const T = class T {
|
|
|
3517
3517
|
i.style.background = "rgba(255,255,255,0.3)";
|
|
3518
3518
|
}), i.addEventListener("mouseleave", () => {
|
|
3519
3519
|
i.style.background = "rgba(255,255,255,0.15)";
|
|
3520
|
-
}), i.addEventListener("click", (
|
|
3521
|
-
|
|
3520
|
+
}), i.addEventListener("click", (r) => {
|
|
3521
|
+
r.stopPropagation(), T.close();
|
|
3522
3522
|
});
|
|
3523
3523
|
const n = document.createElement("img");
|
|
3524
3524
|
n.src = e, n.alt = "Lightbox image", Object.assign(n.style, {
|
|
@@ -3528,15 +3528,15 @@ const T = class T {
|
|
|
3528
3528
|
objectFit: "contain",
|
|
3529
3529
|
cursor: "default",
|
|
3530
3530
|
userSelect: "none"
|
|
3531
|
-
}), n.addEventListener("click", (
|
|
3532
|
-
|
|
3531
|
+
}), n.addEventListener("click", (r) => {
|
|
3532
|
+
r.stopPropagation();
|
|
3533
3533
|
}), t.appendChild(i), t.appendChild(n), t.addEventListener("click", () => {
|
|
3534
3534
|
T.close();
|
|
3535
3535
|
});
|
|
3536
|
-
const
|
|
3537
|
-
|
|
3536
|
+
const o = (r) => {
|
|
3537
|
+
r.key === "Escape" && T.close();
|
|
3538
3538
|
};
|
|
3539
|
-
document.addEventListener("keydown",
|
|
3539
|
+
document.addEventListener("keydown", o), T.overlay = t, T.onKeyDown = o, document.body.appendChild(t), requestAnimationFrame(() => {
|
|
3540
3540
|
t.style.opacity = "1";
|
|
3541
3541
|
});
|
|
3542
3542
|
}
|
|
@@ -3563,25 +3563,25 @@ class ke {
|
|
|
3563
3563
|
return new Promise((t) => {
|
|
3564
3564
|
this.input.accept = e, this.input.value = "";
|
|
3565
3565
|
const i = () => {
|
|
3566
|
-
|
|
3566
|
+
o(), t(null);
|
|
3567
3567
|
}, n = async () => {
|
|
3568
3568
|
var l;
|
|
3569
|
-
|
|
3570
|
-
const
|
|
3571
|
-
if (!
|
|
3569
|
+
o();
|
|
3570
|
+
const r = (l = this.input.files) == null ? void 0 : l[0];
|
|
3571
|
+
if (!r) {
|
|
3572
3572
|
t(null);
|
|
3573
3573
|
return;
|
|
3574
3574
|
}
|
|
3575
3575
|
this.uploading = !0;
|
|
3576
3576
|
try {
|
|
3577
|
-
const a = await this.client.uploadFile(
|
|
3577
|
+
const a = await this.client.uploadFile(r);
|
|
3578
3578
|
t(a);
|
|
3579
3579
|
} catch {
|
|
3580
3580
|
t(null);
|
|
3581
3581
|
} finally {
|
|
3582
3582
|
this.uploading = !1;
|
|
3583
3583
|
}
|
|
3584
|
-
},
|
|
3584
|
+
}, o = () => {
|
|
3585
3585
|
this.input.removeEventListener("change", n), this.input.removeEventListener("cancel", i);
|
|
3586
3586
|
};
|
|
3587
3587
|
this.input.addEventListener("change", n, { once: !0 }), this.input.addEventListener("cancel", i, { once: !0 }), this.input.click();
|
|
@@ -3626,27 +3626,27 @@ class Ji {
|
|
|
3626
3626
|
}, this.handlePopoverEscape = (i) => {
|
|
3627
3627
|
i.key === "Escape" && this.closePopover();
|
|
3628
3628
|
}, this.handlePopoverOutsideClick = (i) => {
|
|
3629
|
-
var n,
|
|
3629
|
+
var n, o;
|
|
3630
3630
|
if (this.popover && !this.popover.contains(i.target)) {
|
|
3631
|
-
if ((n = this.container) != null && n.contains(i.target) || (
|
|
3631
|
+
if ((n = this.container) != null && n.contains(i.target) || (o = this.pickerEl) != null && o.contains(i.target)) return;
|
|
3632
3632
|
this.closePopover();
|
|
3633
3633
|
}
|
|
3634
3634
|
}, this.handleOverlayClick = (i) => {
|
|
3635
3635
|
this.form && (this.form.remove(), this.form = null);
|
|
3636
|
-
const n = window.innerWidth,
|
|
3636
|
+
const n = window.innerWidth, o = window.innerHeight, r = {
|
|
3637
3637
|
x: i.clientX / n,
|
|
3638
|
-
y: i.clientY /
|
|
3638
|
+
y: i.clientY / o,
|
|
3639
3639
|
scrollX: window.scrollX,
|
|
3640
3640
|
scrollY: window.scrollY
|
|
3641
3641
|
}, l = this.overlay.style.pointerEvents;
|
|
3642
3642
|
this.overlay.style.pointerEvents = "none";
|
|
3643
3643
|
const a = document.elementFromPoint(i.clientX, i.clientY);
|
|
3644
3644
|
if (this.overlay.style.pointerEvents = l, a) {
|
|
3645
|
-
|
|
3645
|
+
r.selector = this.getSelector(a);
|
|
3646
3646
|
const c = a.getBoundingClientRect();
|
|
3647
|
-
c.width > 0 && c.height > 0 && (
|
|
3647
|
+
c.width > 0 && c.height > 0 && (r.elementOffsetX = (i.clientX - c.left) / c.width, r.elementOffsetY = (i.clientY - c.top) / c.height);
|
|
3648
3648
|
}
|
|
3649
|
-
this.showPinForm(i.clientX, i.clientY,
|
|
3649
|
+
this.showPinForm(i.clientX, i.clientY, r);
|
|
3650
3650
|
}, this.pickerEl = null, this.client = e, this.onPinModeExit = t.onPinModeExit, this.init();
|
|
3651
3651
|
}
|
|
3652
3652
|
get pinModeActive() {
|
|
@@ -3704,8 +3704,8 @@ class Ji {
|
|
|
3704
3704
|
this.container && (this.container.style.display = e ? "" : "none");
|
|
3705
3705
|
}
|
|
3706
3706
|
destroy() {
|
|
3707
|
-
var e, t, i, n,
|
|
3708
|
-
this.exitPinMode(), this.closePopover(), this.removePickerEl(), (e = this.unsub) == null || e.call(this), (t = this.threadUnsub) == null || t.call(this), (i = this.reactionUnsub) == null || i.call(this), (n = this.typingUnsub2) == null || n.call(this), window.removeEventListener("scroll", this.handleReposition, !0), window.removeEventListener("resize", this.handleReposition), (
|
|
3707
|
+
var e, t, i, n, o, r;
|
|
3708
|
+
this.exitPinMode(), this.closePopover(), this.removePickerEl(), (e = this.unsub) == null || e.call(this), (t = this.threadUnsub) == null || t.call(this), (i = this.reactionUnsub) == null || i.call(this), (n = this.typingUnsub2) == null || n.call(this), window.removeEventListener("scroll", this.handleReposition, !0), window.removeEventListener("resize", this.handleReposition), (o = this.mutationObserver) == null || o.disconnect(), this.mutationObserver = null, this.repositionDebounce && (clearTimeout(this.repositionDebounce), this.repositionDebounce = null), (r = this.container) == null || r.remove(), this.container = null, this.pinEls.clear();
|
|
3709
3709
|
}
|
|
3710
3710
|
closePopover() {
|
|
3711
3711
|
var e;
|
|
@@ -3722,27 +3722,27 @@ class Ji {
|
|
|
3722
3722
|
t.unshift(`#${i.id}`);
|
|
3723
3723
|
break;
|
|
3724
3724
|
}
|
|
3725
|
-
const n = i.tagName.toLowerCase(),
|
|
3726
|
-
let
|
|
3725
|
+
const n = i.tagName.toLowerCase(), o = [...i.classList].filter((a) => !a.startsWith("pulse-")).slice(0, 2);
|
|
3726
|
+
let r = o.length > 0 ? `${n}.${o.join(".")}` : n;
|
|
3727
3727
|
const l = i.parentElement;
|
|
3728
3728
|
if (l) {
|
|
3729
3729
|
const a = [...l.children].filter((c) => c.tagName === i.tagName);
|
|
3730
3730
|
if (a.length > 1) {
|
|
3731
3731
|
const c = a.indexOf(i) + 1;
|
|
3732
|
-
|
|
3732
|
+
r += `:nth-child(${c})`;
|
|
3733
3733
|
}
|
|
3734
3734
|
}
|
|
3735
|
-
if (t.unshift(
|
|
3735
|
+
if (t.unshift(r), i = i.parentElement, t.length >= 4) break;
|
|
3736
3736
|
}
|
|
3737
3737
|
return t.join(" > ");
|
|
3738
3738
|
}
|
|
3739
3739
|
showPinForm(e, t, i) {
|
|
3740
3740
|
this.form = document.createElement("div");
|
|
3741
|
-
const n = Math.min(280, window.innerWidth - 32),
|
|
3742
|
-
let
|
|
3743
|
-
|
|
3741
|
+
const n = Math.min(280, window.innerWidth - 32), o = 120;
|
|
3742
|
+
let r = e + 16, l = t - 10;
|
|
3743
|
+
r + n > window.innerWidth - 16 && (r = e - n - 16), l + o > window.innerHeight - 16 && (l = window.innerHeight - o - 16), l < 16 && (l = 16), Object.assign(this.form.style, {
|
|
3744
3744
|
position: "fixed",
|
|
3745
|
-
left: `${
|
|
3745
|
+
left: `${r}px`,
|
|
3746
3746
|
top: `${l}px`,
|
|
3747
3747
|
width: `${n}px`,
|
|
3748
3748
|
zIndex: "10001",
|
|
@@ -3828,14 +3828,7 @@ class Ji {
|
|
|
3828
3828
|
const f = a.value.trim();
|
|
3829
3829
|
if (!f && this.pendingAttachmentIds.length === 0) return;
|
|
3830
3830
|
const b = [...(f || "").matchAll(/@(\w+)/g)].map((x) => x[1]);
|
|
3831
|
-
this.client.
|
|
3832
|
-
type: "thread:create",
|
|
3833
|
-
id: crypto.randomUUID(),
|
|
3834
|
-
body: f || "(attachment)",
|
|
3835
|
-
mentions: b,
|
|
3836
|
-
position: i,
|
|
3837
|
-
attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0
|
|
3838
|
-
}), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
3831
|
+
this.client.createThread(f || "(attachment)", { position: i, mentions: b }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
3839
3832
|
}), a.addEventListener("keydown", (f) => {
|
|
3840
3833
|
f.key === "Escape" && this.exitPinMode(), f.stopPropagation();
|
|
3841
3834
|
}), document.body.appendChild(this.form), requestAnimationFrame(() => a.focus());
|
|
@@ -3843,11 +3836,11 @@ class Ji {
|
|
|
3843
3836
|
// ── Inline thread popover (shown when a pin dot is clicked) ──
|
|
3844
3837
|
showThreadPopover(e, t) {
|
|
3845
3838
|
this.closePopover(), this.popover = document.createElement("div"), this.popover.dataset.threadId = e.id;
|
|
3846
|
-
const i = window.innerWidth <= 480, n = i ? window.innerWidth : 300,
|
|
3847
|
-
let
|
|
3848
|
-
i ? (
|
|
3839
|
+
const i = window.innerWidth <= 480, n = i ? window.innerWidth : 300, o = t.getBoundingClientRect();
|
|
3840
|
+
let r, l;
|
|
3841
|
+
i ? (r = 0, l = window.innerHeight * 0.4) : (r = o.right + 10, l = o.top - 8, r + n > window.innerWidth - 16 && (r = o.left - n - 10), l < 16 && (l = 16)), Object.assign(this.popover.style, {
|
|
3849
3842
|
position: "fixed",
|
|
3850
|
-
left: `${
|
|
3843
|
+
left: `${r}px`,
|
|
3851
3844
|
top: `${l}px`,
|
|
3852
3845
|
width: i ? "100vw" : `${n}px`,
|
|
3853
3846
|
maxHeight: i ? "60vh" : "360px",
|
|
@@ -3960,11 +3953,11 @@ class Ji {
|
|
|
3960
3953
|
this.client.deleteComment(a.dataset.commentId);
|
|
3961
3954
|
});
|
|
3962
3955
|
});
|
|
3963
|
-
const n = t.querySelector(".edit-save"),
|
|
3956
|
+
const n = t.querySelector(".edit-save"), o = t.querySelector(".edit-cancel"), r = t.querySelector(
|
|
3964
3957
|
".edit-textarea"
|
|
3965
3958
|
);
|
|
3966
|
-
n &&
|
|
3967
|
-
const a =
|
|
3959
|
+
n && r && n.addEventListener("click", () => {
|
|
3960
|
+
const a = r.value.trim();
|
|
3968
3961
|
if (!a) return;
|
|
3969
3962
|
const c = [...a.matchAll(/@(\w+)/g)].map((h) => h[1]);
|
|
3970
3963
|
this.client.editComment(
|
|
@@ -3972,7 +3965,7 @@ class Ji {
|
|
|
3972
3965
|
a,
|
|
3973
3966
|
c
|
|
3974
3967
|
), this.editingPopoverCommentId = null;
|
|
3975
|
-
}),
|
|
3968
|
+
}), o && o.addEventListener("click", () => {
|
|
3976
3969
|
this.editingPopoverCommentId = null, this.refreshPopoverComments(e);
|
|
3977
3970
|
}), t.querySelectorAll("[data-reaction-emoji]").forEach((a) => {
|
|
3978
3971
|
a.addEventListener("click", (c) => {
|
|
@@ -4030,41 +4023,23 @@ class Ji {
|
|
|
4030
4023
|
`;
|
|
4031
4024
|
const i = t.querySelector("input"), n = t.querySelector(".reply-send");
|
|
4032
4025
|
this.upload || (this.upload = new ke(this.client)), t.querySelector(".reply-attach-img").addEventListener("click", async () => {
|
|
4033
|
-
|
|
4034
|
-
o && this.client.send({
|
|
4035
|
-
type: "comment:create",
|
|
4036
|
-
threadId: e.id,
|
|
4037
|
-
id: crypto.randomUUID(),
|
|
4038
|
-
body: "(image)",
|
|
4039
|
-
mentions: [],
|
|
4040
|
-
attachmentIds: [o.id]
|
|
4041
|
-
});
|
|
4026
|
+
await this.upload.pickFile("image/*") && this.client.reply(e.id, "(image)");
|
|
4042
4027
|
}), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
|
|
4043
4028
|
this.audioRecorder || (this.audioRecorder = new Re());
|
|
4044
|
-
const
|
|
4045
|
-
|
|
4046
|
-
const l = await this.upload.uploadBlob(o, "audio.webm");
|
|
4047
|
-
l && this.client.send({
|
|
4048
|
-
type: "comment:create",
|
|
4049
|
-
threadId: e.id,
|
|
4050
|
-
id: crypto.randomUUID(),
|
|
4051
|
-
body: "(audio note)",
|
|
4052
|
-
mentions: [],
|
|
4053
|
-
attachmentIds: [l.id]
|
|
4054
|
-
});
|
|
4055
|
-
}
|
|
4029
|
+
const r = await this.audioRecorder.startRecording(t);
|
|
4030
|
+
r && await this.upload.uploadBlob(r, "audio.webm") && this.client.reply(e.id, "(audio note)");
|
|
4056
4031
|
});
|
|
4057
|
-
const
|
|
4058
|
-
const
|
|
4059
|
-
if (!
|
|
4060
|
-
const l = [...
|
|
4061
|
-
this.client.reply(e.id,
|
|
4032
|
+
const o = () => {
|
|
4033
|
+
const r = i.value.trim();
|
|
4034
|
+
if (!r) return;
|
|
4035
|
+
const l = [...r.matchAll(/@(\w+)/g)].map((a) => a[1]);
|
|
4036
|
+
this.client.reply(e.id, r, l), i.value = "";
|
|
4062
4037
|
};
|
|
4063
|
-
n.addEventListener("click",
|
|
4064
|
-
const
|
|
4065
|
-
|
|
4066
|
-
}), i.addEventListener("keydown", (
|
|
4067
|
-
|
|
4038
|
+
n.addEventListener("click", o), i.addEventListener("input", () => {
|
|
4039
|
+
const r = Date.now(), l = this.lastTypingSendPins.get(e.id) ?? 0;
|
|
4040
|
+
r - l >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, r));
|
|
4041
|
+
}), i.addEventListener("keydown", (r) => {
|
|
4042
|
+
r.key === "Enter" && (r.preventDefault(), o()), r.key === "Escape" && this.closePopover(), r.stopPropagation();
|
|
4068
4043
|
}), this.popover.appendChild(t);
|
|
4069
4044
|
}
|
|
4070
4045
|
removePickerEl() {
|
|
@@ -4090,8 +4065,8 @@ class Ji {
|
|
|
4090
4065
|
fontFamily: ge
|
|
4091
4066
|
});
|
|
4092
4067
|
for (const n of Yi) {
|
|
4093
|
-
const
|
|
4094
|
-
Object.assign(
|
|
4068
|
+
const o = document.createElement("button");
|
|
4069
|
+
Object.assign(o.style, {
|
|
4095
4070
|
border: "none",
|
|
4096
4071
|
background: "none",
|
|
4097
4072
|
cursor: "pointer",
|
|
@@ -4099,8 +4074,8 @@ class Ji {
|
|
|
4099
4074
|
padding: "4px",
|
|
4100
4075
|
borderRadius: "4px",
|
|
4101
4076
|
lineHeight: "1"
|
|
4102
|
-
}),
|
|
4103
|
-
|
|
4077
|
+
}), o.textContent = n, o.addEventListener("click", (r) => {
|
|
4078
|
+
r.stopPropagation();
|
|
4104
4079
|
const a = this.client.state.getReactions(t).find(
|
|
4105
4080
|
(c) => {
|
|
4106
4081
|
var h;
|
|
@@ -4108,7 +4083,7 @@ class Ji {
|
|
|
4108
4083
|
}
|
|
4109
4084
|
);
|
|
4110
4085
|
a ? this.client.removeReaction(a.id) : this.client.addReaction(t, "comment", n), this.popoverPickerOpen = null, this.removePickerEl();
|
|
4111
|
-
}), this.pickerEl.appendChild(
|
|
4086
|
+
}), this.pickerEl.appendChild(o);
|
|
4112
4087
|
}
|
|
4113
4088
|
document.body.appendChild(this.pickerEl);
|
|
4114
4089
|
}
|
|
@@ -4119,10 +4094,10 @@ class Ji {
|
|
|
4119
4094
|
const h = n.get(c.emoji) ?? { count: 0, ownId: null };
|
|
4120
4095
|
h.count++, c.userId === i && (h.ownId = c.id), n.set(c.emoji, h);
|
|
4121
4096
|
}
|
|
4122
|
-
const
|
|
4097
|
+
const o = "display:inline-flex;align-items:center;gap:3px;padding:2px 8px;border-radius:12px;border:1px solid #e2e8f0;background:#fff;font-size:12px;cursor:pointer;transition:all 0.15s;line-height:1.4;", r = o + "background:#eef2ff;border-color:#6366f1;";
|
|
4123
4098
|
let l = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
|
|
4124
4099
|
for (const [c, { count: h, ownId: p }] of n) {
|
|
4125
|
-
const m = p ?
|
|
4100
|
+
const m = p ? r : o;
|
|
4126
4101
|
l += `<button data-reaction-emoji="${c}" data-reaction-target="${e}" ${p ? `data-reaction-id="${p}"` : ""} style="${m}">
|
|
4127
4102
|
<span>${c}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${h}</span>
|
|
4128
4103
|
</button>`;
|
|
@@ -4144,20 +4119,20 @@ class Ji {
|
|
|
4144
4119
|
n && this.popover.insertBefore(t, n);
|
|
4145
4120
|
}
|
|
4146
4121
|
const i = this.client.state.getTypingUsers(e).filter((n) => {
|
|
4147
|
-
var
|
|
4148
|
-
return n !== ((
|
|
4122
|
+
var o;
|
|
4123
|
+
return n !== ((o = this.client.state.user) == null ? void 0 : o.id);
|
|
4149
4124
|
}).map((n) => {
|
|
4150
|
-
const
|
|
4151
|
-
return (
|
|
4125
|
+
const o = this.client.state.presence.find((r) => r.user.id === n);
|
|
4126
|
+
return (o == null ? void 0 : o.user.name) ?? "Someone";
|
|
4152
4127
|
});
|
|
4153
4128
|
i.length === 0 ? t.textContent = "" : i.length === 1 ? t.textContent = `${i[0]} is typing...` : t.textContent = `${i.join(", ")} are typing...`;
|
|
4154
4129
|
}
|
|
4155
4130
|
formatTime(e) {
|
|
4156
|
-
const t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(),
|
|
4157
|
-
if (
|
|
4158
|
-
if (
|
|
4159
|
-
const
|
|
4160
|
-
return
|
|
4131
|
+
const t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), o = Math.floor(n / 6e4);
|
|
4132
|
+
if (o < 1) return "now";
|
|
4133
|
+
if (o < 60) return `${o}m`;
|
|
4134
|
+
const r = Math.floor(o / 60);
|
|
4135
|
+
return r < 24 ? `${r}h` : t.toLocaleDateString();
|
|
4161
4136
|
}
|
|
4162
4137
|
// ── Pin rendering ──
|
|
4163
4138
|
/** Resolve a pin position to viewport pixel coordinates. */
|
|
@@ -4185,9 +4160,9 @@ class Ji {
|
|
|
4185
4160
|
for (const [i, n] of this.pinEls)
|
|
4186
4161
|
t.has(i) || (n.remove(), this.pinEls.delete(i));
|
|
4187
4162
|
e.forEach((i, n) => {
|
|
4188
|
-
const
|
|
4189
|
-
let
|
|
4190
|
-
|
|
4163
|
+
const o = i.position;
|
|
4164
|
+
let r = this.pinEls.get(i.id);
|
|
4165
|
+
r || (r = document.createElement("div"), Object.assign(r.style, {
|
|
4191
4166
|
position: "fixed",
|
|
4192
4167
|
width: "24px",
|
|
4193
4168
|
height: "24px",
|
|
@@ -4207,26 +4182,26 @@ class Ji {
|
|
|
4207
4182
|
transition: "left 0.15s ease, top 0.15s ease, transform 0.15s ease",
|
|
4208
4183
|
zIndex: "9997",
|
|
4209
4184
|
transform: "translate(-50%, -50%)"
|
|
4210
|
-
}),
|
|
4211
|
-
|
|
4212
|
-
}),
|
|
4213
|
-
|
|
4214
|
-
}),
|
|
4185
|
+
}), r.addEventListener("mouseenter", () => {
|
|
4186
|
+
r.style.transform = "translate(-50%, -50%) scale(1.15)";
|
|
4187
|
+
}), r.addEventListener("mouseleave", () => {
|
|
4188
|
+
r.style.transform = "translate(-50%, -50%)";
|
|
4189
|
+
}), r.addEventListener("click", () => {
|
|
4215
4190
|
if (this.popover && this.popover.dataset.threadId === i.id) {
|
|
4216
4191
|
this.closePopover();
|
|
4217
4192
|
return;
|
|
4218
4193
|
}
|
|
4219
4194
|
const a = this.threads.find((c) => c.id === i.id);
|
|
4220
|
-
a && this.showThreadPopover(a,
|
|
4221
|
-
}), this.container.appendChild(
|
|
4222
|
-
const l = this.resolvePosition(
|
|
4223
|
-
|
|
4195
|
+
a && this.showThreadPopover(a, r);
|
|
4196
|
+
}), this.container.appendChild(r), this.pinEls.set(i.id, r)), r.textContent = `${n + 1}`;
|
|
4197
|
+
const l = this.resolvePosition(o);
|
|
4198
|
+
r.style.left = `${l.x}px`, r.style.top = `${l.y}px`;
|
|
4224
4199
|
});
|
|
4225
4200
|
}
|
|
4226
4201
|
}
|
|
4227
4202
|
var Zi = Object.defineProperty, Qi = Object.getOwnPropertyDescriptor, j = (s, e, t, i) => {
|
|
4228
|
-
for (var n = i > 1 ? void 0 : i ? Qi(e, t) : e,
|
|
4229
|
-
(
|
|
4203
|
+
for (var n = i > 1 ? void 0 : i ? Qi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
4204
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
4230
4205
|
return i && n && Zi(e, t, n), n;
|
|
4231
4206
|
};
|
|
4232
4207
|
const es = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
@@ -4235,28 +4210,34 @@ let O = class extends S {
|
|
|
4235
4210
|
super(...arguments), this.highlightThreadId = null, this.threads = [], this.replyingTo = null, this.editingCommentId = null, this.editBody = "", this.pickerOpenForComment = null, this.typingByThread = /* @__PURE__ */ new Map(), this.reactionsVersion = 0, this.typingTimers = /* @__PURE__ */ new Map(), this.lastTypingSend = /* @__PURE__ */ new Map();
|
|
4236
4211
|
}
|
|
4237
4212
|
connectedCallback() {
|
|
4238
|
-
super.connectedCallback(), this.
|
|
4213
|
+
super.connectedCallback(), this.updateComplete.then(() => this.ensureListener());
|
|
4239
4214
|
}
|
|
4240
4215
|
disconnectedCallback() {
|
|
4216
|
+
super.disconnectedCallback(), this.teardownListeners();
|
|
4217
|
+
}
|
|
4218
|
+
updated(s) {
|
|
4219
|
+
var e, t;
|
|
4220
|
+
s.has("client") && this.client && this.ensureListener(), (e = this.shadowRoot) == null || e.querySelectorAll(".audio-player-host").forEach((i) => {
|
|
4221
|
+
if (i.children.length > 0) return;
|
|
4222
|
+
const n = i.dataset.url;
|
|
4223
|
+
if (n) {
|
|
4224
|
+
const o = i.dataset.duration ? parseInt(i.dataset.duration) : void 0;
|
|
4225
|
+
i.appendChild(Oe.render(n, o));
|
|
4226
|
+
}
|
|
4227
|
+
}), (t = this.shadowRoot) == null || t.querySelectorAll(".video-player-host").forEach((i) => {
|
|
4228
|
+
if (i.children.length > 0) return;
|
|
4229
|
+
const n = i.dataset.url;
|
|
4230
|
+
n && i.appendChild(_t.render(n, i.dataset.poster || void 0));
|
|
4231
|
+
});
|
|
4232
|
+
}
|
|
4233
|
+
teardownListeners() {
|
|
4241
4234
|
var s, e, t;
|
|
4242
|
-
|
|
4235
|
+
(s = this.unsub) == null || s.call(this), this.unsub = void 0, (e = this.reactionUnsub) == null || e.call(this), this.reactionUnsub = void 0, (t = this.typingUnsub) == null || t.call(this), this.typingUnsub = void 0;
|
|
4243
4236
|
for (const i of this.typingTimers.values()) clearTimeout(i);
|
|
4244
4237
|
this.typingTimers.clear();
|
|
4245
4238
|
}
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
s.has("client") && this.client && ((e = this.unsub) == null || e.call(this), (t = this.reactionUnsub) == null || t.call(this), (i = this.typingUnsub) == null || i.call(this), this.setupListener()), (n = this.shadowRoot) == null || n.querySelectorAll(".audio-player-host").forEach((o) => {
|
|
4249
|
-
if (o.children.length > 0) return;
|
|
4250
|
-
const l = o.dataset.url;
|
|
4251
|
-
if (l) {
|
|
4252
|
-
const a = o.dataset.duration ? parseInt(o.dataset.duration) : void 0;
|
|
4253
|
-
o.appendChild(Oe.render(l, a));
|
|
4254
|
-
}
|
|
4255
|
-
}), (r = this.shadowRoot) == null || r.querySelectorAll(".video-player-host").forEach((o) => {
|
|
4256
|
-
if (o.children.length > 0) return;
|
|
4257
|
-
const l = o.dataset.url;
|
|
4258
|
-
l && o.appendChild(_t.render(l, o.dataset.poster || void 0));
|
|
4259
|
-
});
|
|
4239
|
+
ensureListener() {
|
|
4240
|
+
this.client && (this.teardownListeners(), this.threads = [...this.client.state.threads], this.setupListener());
|
|
4260
4241
|
}
|
|
4261
4242
|
setupListener() {
|
|
4262
4243
|
this.client && (this.threads = this.client.state.threads, this.unsub = this.client.state.on("threads", (s) => {
|
|
@@ -4272,11 +4253,11 @@ let O = class extends S {
|
|
|
4272
4253
|
}
|
|
4273
4254
|
refreshTyping(s) {
|
|
4274
4255
|
const t = this.client.state.getTypingUsers(s).filter((n) => {
|
|
4275
|
-
var
|
|
4276
|
-
return n !== ((
|
|
4256
|
+
var o;
|
|
4257
|
+
return n !== ((o = this.client.state.user) == null ? void 0 : o.id);
|
|
4277
4258
|
}).map((n) => {
|
|
4278
|
-
const
|
|
4279
|
-
return (
|
|
4259
|
+
const o = this.client.state.presence.find((r) => r.user.id === n);
|
|
4260
|
+
return (o == null ? void 0 : o.user.name) ?? "Someone";
|
|
4280
4261
|
}), i = new Map(this.typingByThread);
|
|
4281
4262
|
i.set(s, t), this.typingByThread = i, this.typingTimers.has(s) && clearTimeout(this.typingTimers.get(s)), this.typingTimers.set(
|
|
4282
4263
|
s,
|
|
@@ -4290,9 +4271,9 @@ let O = class extends S {
|
|
|
4290
4271
|
e - t >= 2e3 && (this.client.sendTyping(s), this.lastTypingSend.set(s, e));
|
|
4291
4272
|
}
|
|
4292
4273
|
toggleReaction(s, e) {
|
|
4293
|
-
var
|
|
4294
|
-
const t = this.client.state.getReactions(s), i = (
|
|
4295
|
-
(
|
|
4274
|
+
var o;
|
|
4275
|
+
const t = this.client.state.getReactions(s), i = (o = this.client.state.user) == null ? void 0 : o.id, n = t.find(
|
|
4276
|
+
(r) => r.emoji === e && r.userId === i
|
|
4296
4277
|
);
|
|
4297
4278
|
n ? this.client.removeReaction(n.id) : this.client.addReaction(s, "comment", e), this.pickerOpenForComment = null;
|
|
4298
4279
|
}
|
|
@@ -4325,43 +4306,24 @@ let O = class extends S {
|
|
|
4325
4306
|
const e = new Date(s), i = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), n = Math.floor(i / 6e4);
|
|
4326
4307
|
if (n < 1) return "now";
|
|
4327
4308
|
if (n < 60) return `${n}m`;
|
|
4328
|
-
const
|
|
4329
|
-
return
|
|
4309
|
+
const o = Math.floor(n / 60);
|
|
4310
|
+
return o < 24 ? `${o}h` : e.toLocaleDateString();
|
|
4330
4311
|
}
|
|
4331
4312
|
async handleAttachImage(s) {
|
|
4332
|
-
this.upload || (this.upload = new ke(this.client));
|
|
4333
|
-
const e = await this.upload.pickFile("image/*");
|
|
4334
|
-
e && this.client.send({
|
|
4335
|
-
type: "comment:create",
|
|
4336
|
-
threadId: s,
|
|
4337
|
-
id: crypto.randomUUID(),
|
|
4338
|
-
body: "(image)",
|
|
4339
|
-
mentions: [],
|
|
4340
|
-
attachmentIds: [e.id]
|
|
4341
|
-
});
|
|
4313
|
+
this.upload || (this.upload = new ke(this.client)), await this.upload.pickFile("image/*") && this.client.reply(s, "(image)");
|
|
4342
4314
|
}
|
|
4343
4315
|
async handleRecordAudio(s) {
|
|
4344
4316
|
var i;
|
|
4345
4317
|
this.upload || (this.upload = new ke(this.client)), this.audioRecorder || (this.audioRecorder = new Re());
|
|
4346
4318
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${s}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
|
|
4347
|
-
|
|
4348
|
-
const n = await this.upload.uploadBlob(t, "audio.webm");
|
|
4349
|
-
n && this.client.send({
|
|
4350
|
-
type: "comment:create",
|
|
4351
|
-
threadId: s,
|
|
4352
|
-
id: crypto.randomUUID(),
|
|
4353
|
-
body: "(audio note)",
|
|
4354
|
-
mentions: [],
|
|
4355
|
-
attachmentIds: [n.id]
|
|
4356
|
-
});
|
|
4357
|
-
}
|
|
4319
|
+
t && await this.upload.uploadBlob(t, "audio.webm") && this.client.reply(s, "(audio note)");
|
|
4358
4320
|
}
|
|
4359
4321
|
handleReply(s, e) {
|
|
4360
4322
|
e.preventDefault();
|
|
4361
4323
|
const i = e.target.querySelector("input"), n = i.value.trim();
|
|
4362
4324
|
if (!n) return;
|
|
4363
|
-
const
|
|
4364
|
-
this.client.reply(s, n,
|
|
4325
|
+
const o = [...n.matchAll(/@(\w+)/g)].map((r) => r[1]);
|
|
4326
|
+
this.client.reply(s, n, o), i.value = "", this.replyingTo = null;
|
|
4365
4327
|
}
|
|
4366
4328
|
isOwnComment(s) {
|
|
4367
4329
|
var e, t;
|
|
@@ -4402,20 +4364,20 @@ let O = class extends S {
|
|
|
4402
4364
|
var n;
|
|
4403
4365
|
this.reactionsVersion;
|
|
4404
4366
|
const e = this.client.state.getReactions(s.id), t = (n = this.client.state.user) == null ? void 0 : n.id, i = /* @__PURE__ */ new Map();
|
|
4405
|
-
for (const
|
|
4406
|
-
i.has(
|
|
4367
|
+
for (const o of e)
|
|
4368
|
+
i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
|
|
4407
4369
|
return d`
|
|
4408
4370
|
<div class="comment-reactions">
|
|
4409
4371
|
${[...i.entries()].map(
|
|
4410
|
-
([
|
|
4411
|
-
const l =
|
|
4372
|
+
([o, r]) => {
|
|
4373
|
+
const l = r.some((a) => a.userId === t);
|
|
4412
4374
|
return d`
|
|
4413
4375
|
<button
|
|
4414
4376
|
class="reaction-pill ${l ? "own" : ""}"
|
|
4415
|
-
@click=${() => this.toggleReaction(s.id,
|
|
4377
|
+
@click=${() => this.toggleReaction(s.id, o)}
|
|
4416
4378
|
>
|
|
4417
|
-
<span>${
|
|
4418
|
-
<span class="count">${
|
|
4379
|
+
<span>${o}</span>
|
|
4380
|
+
<span class="count">${r.length}</span>
|
|
4419
4381
|
</button>
|
|
4420
4382
|
`;
|
|
4421
4383
|
}
|
|
@@ -4431,10 +4393,10 @@ let O = class extends S {
|
|
|
4431
4393
|
${this.pickerOpenForComment === s.id ? d`
|
|
4432
4394
|
<div class="emoji-picker">
|
|
4433
4395
|
${es.map(
|
|
4434
|
-
(
|
|
4435
|
-
<button @click=${(
|
|
4436
|
-
|
|
4437
|
-
}}>${
|
|
4396
|
+
(o) => d`
|
|
4397
|
+
<button @click=${(r) => {
|
|
4398
|
+
r.stopPropagation(), this.toggleReaction(s.id, o);
|
|
4399
|
+
}}>${o}</button>
|
|
4438
4400
|
`
|
|
4439
4401
|
)}
|
|
4440
4402
|
</div>
|
|
@@ -4530,7 +4492,7 @@ let O = class extends S {
|
|
|
4530
4492
|
Pinned
|
|
4531
4493
|
</div>` : u}
|
|
4532
4494
|
${s.comments.map((t, i) => {
|
|
4533
|
-
const n = this.getUserForComment(t.userId),
|
|
4495
|
+
const n = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
|
|
4534
4496
|
return d`
|
|
4535
4497
|
${i > 0 ? d`<div class="comment-divider"></div>` : u}
|
|
4536
4498
|
<div class="comment">
|
|
@@ -4545,13 +4507,13 @@ let O = class extends S {
|
|
|
4545
4507
|
<span class="comment-time">${this.formatTime(t.createdAt)}</span>
|
|
4546
4508
|
${t.editedAt ? d`<span class="edited-badge">(edited)</span>` : u}
|
|
4547
4509
|
</div>
|
|
4548
|
-
${
|
|
4510
|
+
${r ? this.renderEditForm(t) : d`
|
|
4549
4511
|
<div class="comment-body">${this.parseMentions(t.body)}</div>
|
|
4550
4512
|
${this.renderAttachments(t.attachments ?? [])}
|
|
4551
4513
|
`}
|
|
4552
|
-
${
|
|
4514
|
+
${o && !r ? d`<div class="comment-actions">
|
|
4553
4515
|
<button @click=${() => this.startEdit(t)} title="Edit">${C(Pi, 14)}</button>
|
|
4554
|
-
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(
|
|
4516
|
+
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Mi, 14)}</button>
|
|
4555
4517
|
</div>` : u}
|
|
4556
4518
|
${this.renderReactions(t)}
|
|
4557
4519
|
</div>
|
|
@@ -4608,7 +4570,7 @@ O.styles = [
|
|
|
4608
4570
|
ee,
|
|
4609
4571
|
me,
|
|
4610
4572
|
_e,
|
|
4611
|
-
|
|
4573
|
+
M`
|
|
4612
4574
|
:host {
|
|
4613
4575
|
display: block;
|
|
4614
4576
|
}
|
|
@@ -5098,8 +5060,8 @@ O = j([
|
|
|
5098
5060
|
R("pulse-widget-comments-panel")
|
|
5099
5061
|
], O);
|
|
5100
5062
|
var ts = Object.defineProperty, is = Object.getOwnPropertyDescriptor, Fe = (s, e, t, i) => {
|
|
5101
|
-
for (var n = i > 1 ? void 0 : i ? is(e, t) : e,
|
|
5102
|
-
(
|
|
5063
|
+
for (var n = i > 1 ? void 0 : i ? is(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
5064
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
5103
5065
|
return i && n && ts(e, t, n), n;
|
|
5104
5066
|
};
|
|
5105
5067
|
const ss = {
|
|
@@ -5154,8 +5116,8 @@ let ce = class extends S {
|
|
|
5154
5116
|
const e = new Date(s), i = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), n = Math.floor(i / 6e4);
|
|
5155
5117
|
if (n < 1) return "now";
|
|
5156
5118
|
if (n < 60) return `${n}m`;
|
|
5157
|
-
const
|
|
5158
|
-
return
|
|
5119
|
+
const o = Math.floor(n / 60);
|
|
5120
|
+
return o < 24 ? `${o}h` : e.toLocaleDateString();
|
|
5159
5121
|
}
|
|
5160
5122
|
render() {
|
|
5161
5123
|
const s = this.notifications.filter((e) => !e.read).length;
|
|
@@ -5207,7 +5169,7 @@ ce.styles = [
|
|
|
5207
5169
|
ee,
|
|
5208
5170
|
me,
|
|
5209
5171
|
_e,
|
|
5210
|
-
|
|
5172
|
+
M`
|
|
5211
5173
|
:host {
|
|
5212
5174
|
display: block;
|
|
5213
5175
|
}
|
|
@@ -5440,7 +5402,7 @@ class rs {
|
|
|
5440
5402
|
i.position = t;
|
|
5441
5403
|
else {
|
|
5442
5404
|
const n = this.client.state.presence.find(
|
|
5443
|
-
(
|
|
5405
|
+
(o) => o.user.id === e
|
|
5444
5406
|
);
|
|
5445
5407
|
n && this.cursors.set(e, {
|
|
5446
5408
|
userId: e,
|
|
@@ -5488,9 +5450,9 @@ class rs {
|
|
|
5488
5450
|
showClickRipple(e, t) {
|
|
5489
5451
|
if (!this.container) return;
|
|
5490
5452
|
const i = this.client.state.presence.find(
|
|
5491
|
-
(
|
|
5492
|
-
), n = (i == null ? void 0 : i.user.color) ?? "#6366f1",
|
|
5493
|
-
Object.assign(
|
|
5453
|
+
(r) => r.user.id === e
|
|
5454
|
+
), n = (i == null ? void 0 : i.user.color) ?? "#6366f1", o = document.createElement("div");
|
|
5455
|
+
Object.assign(o.style, {
|
|
5494
5456
|
position: "absolute",
|
|
5495
5457
|
left: `${t.x}px`,
|
|
5496
5458
|
top: `${t.y}px`,
|
|
@@ -5502,9 +5464,9 @@ class rs {
|
|
|
5502
5464
|
pointerEvents: "none",
|
|
5503
5465
|
opacity: "1",
|
|
5504
5466
|
transition: "width 0.6s ease-out, height 0.6s ease-out, opacity 0.6s ease-out"
|
|
5505
|
-
}), this.container.appendChild(
|
|
5506
|
-
|
|
5507
|
-
}), setTimeout(() =>
|
|
5467
|
+
}), this.container.appendChild(o), requestAnimationFrame(() => {
|
|
5468
|
+
o.style.width = "60px", o.style.height = "60px", o.style.opacity = "0";
|
|
5469
|
+
}), setTimeout(() => o.remove(), 600);
|
|
5508
5470
|
}
|
|
5509
5471
|
showEmojiDrop(e, t, i) {
|
|
5510
5472
|
if (!this.container) return;
|
|
@@ -5563,11 +5525,11 @@ class as {
|
|
|
5563
5525
|
this.container = null, this.unsubs = [], this.enabled = !1, this.drawMode = !1, this.currentPoints = [], this.currentPath = null, this.lastPoint = null, this.fadeTimers = /* @__PURE__ */ new Map(), this.handlePointerDown = (t) => {
|
|
5564
5526
|
var l, a, c;
|
|
5565
5527
|
t.preventDefault(), (a = (l = t.target) == null ? void 0 : l.setPointerCapture) == null || a.call(l, t.pointerId), this.currentPoints = [{ x: t.clientX, y: t.clientY }], this.lastPoint = { x: t.clientX, y: t.clientY };
|
|
5566
|
-
const i = this.client.state.user, n = (i == null ? void 0 : i.color) ?? "#6366f1",
|
|
5528
|
+
const i = this.client.state.user, n = (i == null ? void 0 : i.color) ?? "#6366f1", r = 2 + (t.pressure > 0 ? t.pressure : 0.5) * 4;
|
|
5567
5529
|
this.currentPath = document.createElementNS(
|
|
5568
5530
|
"http://www.w3.org/2000/svg",
|
|
5569
5531
|
"polyline"
|
|
5570
|
-
), this.currentPath.setAttribute("fill", "none"), this.currentPath.setAttribute("stroke", n), this.currentPath.setAttribute("stroke-width", String(
|
|
5532
|
+
), this.currentPath.setAttribute("fill", "none"), this.currentPath.setAttribute("stroke", n), this.currentPath.setAttribute("stroke-width", String(r)), this.currentPath.setAttribute("stroke-linecap", "round"), this.currentPath.setAttribute("stroke-linejoin", "round"), this.currentPath.setAttribute(
|
|
5571
5533
|
"points",
|
|
5572
5534
|
`${t.clientX},${t.clientY}`
|
|
5573
5535
|
), (c = this.container) == null || c.appendChild(this.currentPath), document.addEventListener("pointermove", this.handlePointerMove), document.addEventListener("pointerup", this.handlePointerUp);
|
|
@@ -5576,8 +5538,8 @@ class as {
|
|
|
5576
5538
|
const i = t.clientX - this.lastPoint.x, n = t.clientY - this.lastPoint.y;
|
|
5577
5539
|
if (i * i + n * n < 4) return;
|
|
5578
5540
|
this.currentPoints.push({ x: t.clientX, y: t.clientY }), this.lastPoint = { x: t.clientX, y: t.clientY };
|
|
5579
|
-
const
|
|
5580
|
-
this.currentPath.setAttribute("points",
|
|
5541
|
+
const o = this.currentPoints.map((r) => `${r.x},${r.y}`).join(" ");
|
|
5542
|
+
this.currentPath.setAttribute("points", o);
|
|
5581
5543
|
}, this.handlePointerUp = () => {
|
|
5582
5544
|
var t;
|
|
5583
5545
|
if (document.removeEventListener("pointermove", this.handlePointerMove), document.removeEventListener("pointerup", this.handlePointerUp), this.currentPoints.length > 1) {
|
|
@@ -5629,7 +5591,7 @@ class as {
|
|
|
5629
5591
|
);
|
|
5630
5592
|
n.setAttribute("fill", "none"), n.setAttribute("stroke", t), n.setAttribute("stroke-width", String(i)), n.setAttribute("stroke-linecap", "round"), n.setAttribute("stroke-linejoin", "round"), n.setAttribute(
|
|
5631
5593
|
"points",
|
|
5632
|
-
e.map((
|
|
5594
|
+
e.map((o) => `${o.x},${o.y}`).join(" ")
|
|
5633
5595
|
), n.style.willChange = "opacity", this.container.appendChild(n), this.scheduleFade(n);
|
|
5634
5596
|
}
|
|
5635
5597
|
scheduleFade(e) {
|
|
@@ -5643,11 +5605,11 @@ class as {
|
|
|
5643
5605
|
}
|
|
5644
5606
|
function ls(s) {
|
|
5645
5607
|
if (!s.rangeCount || s.isCollapsed) return null;
|
|
5646
|
-
const e = s.getRangeAt(0), t = e.startContainer, i = e.endContainer, n = ut(t),
|
|
5647
|
-
return !n || !
|
|
5608
|
+
const e = s.getRangeAt(0), t = e.startContainer, i = e.endContainer, n = ut(t), o = ut(i);
|
|
5609
|
+
return !n || !o ? null : {
|
|
5648
5610
|
startSelector: n,
|
|
5649
5611
|
startOffset: e.startOffset,
|
|
5650
|
-
endSelector:
|
|
5612
|
+
endSelector: o,
|
|
5651
5613
|
endOffset: e.endOffset
|
|
5652
5614
|
};
|
|
5653
5615
|
}
|
|
@@ -5656,8 +5618,8 @@ function cs(s) {
|
|
|
5656
5618
|
try {
|
|
5657
5619
|
const i = mt(s.startSelector), n = mt(s.endSelector);
|
|
5658
5620
|
if (!i || !n) return null;
|
|
5659
|
-
const
|
|
5660
|
-
return
|
|
5621
|
+
const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, l = n.nodeType === Node.TEXT_NODE ? ((t = n.textContent) == null ? void 0 : t.length) ?? 0 : n.childNodes.length;
|
|
5622
|
+
return o.setStart(i, Math.min(s.startOffset, r)), o.setEnd(n, Math.min(s.endOffset, l)), o;
|
|
5661
5623
|
} catch {
|
|
5662
5624
|
return null;
|
|
5663
5625
|
}
|
|
@@ -5682,14 +5644,14 @@ function ft(s) {
|
|
|
5682
5644
|
for (; t && t !== document.body && i < 10; ) {
|
|
5683
5645
|
const n = t.parentElement;
|
|
5684
5646
|
if (!n) break;
|
|
5685
|
-
const
|
|
5686
|
-
(a) => a.tagName ===
|
|
5647
|
+
const o = t.tagName.toLowerCase(), r = t.tagName, l = Array.from(n.children).filter(
|
|
5648
|
+
(a) => a.tagName === r
|
|
5687
5649
|
);
|
|
5688
5650
|
if (l.length === 1)
|
|
5689
|
-
e.unshift(
|
|
5651
|
+
e.unshift(o);
|
|
5690
5652
|
else {
|
|
5691
5653
|
const a = l.indexOf(t) + 1;
|
|
5692
|
-
e.unshift(`${
|
|
5654
|
+
e.unshift(`${o}:nth-of-type(${a})`);
|
|
5693
5655
|
}
|
|
5694
5656
|
if (n.id) {
|
|
5695
5657
|
e.unshift(`#${CSS.escape(n.id)}`);
|
|
@@ -5762,9 +5724,9 @@ class ds {
|
|
|
5762
5724
|
if (e === i || (this.clearSelection(e), !t)) return;
|
|
5763
5725
|
const n = cs(t);
|
|
5764
5726
|
if (!n) return;
|
|
5765
|
-
const
|
|
5727
|
+
const o = this.client.state.presence.find(
|
|
5766
5728
|
(a) => a.user.id === e
|
|
5767
|
-
),
|
|
5729
|
+
), r = (o == null ? void 0 : o.user.color) ?? "#6366f1";
|
|
5768
5730
|
try {
|
|
5769
5731
|
const a = n.getClientRects(), c = [];
|
|
5770
5732
|
for (let h = 0; h < a.length; h++) {
|
|
@@ -5775,7 +5737,7 @@ class ds {
|
|
|
5775
5737
|
top: `${p.top}px`,
|
|
5776
5738
|
width: `${p.width}px`,
|
|
5777
5739
|
height: `${p.height}px`,
|
|
5778
|
-
background:
|
|
5740
|
+
background: r,
|
|
5779
5741
|
opacity: "0.2",
|
|
5780
5742
|
borderRadius: "2px",
|
|
5781
5743
|
pointerEvents: "none"
|
|
@@ -5800,8 +5762,8 @@ class ds {
|
|
|
5800
5762
|
}
|
|
5801
5763
|
}
|
|
5802
5764
|
var hs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, qe = (s, e, t, i) => {
|
|
5803
|
-
for (var n = i > 1 ? void 0 : i ? ps(e, t) : e,
|
|
5804
|
-
(
|
|
5765
|
+
for (var n = i > 1 ? void 0 : i ? ps(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
5766
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
5805
5767
|
return i && n && hs(e, t, n), n;
|
|
5806
5768
|
};
|
|
5807
5769
|
let de = class extends S {
|
|
@@ -5894,7 +5856,7 @@ de.styles = [
|
|
|
5894
5856
|
ee,
|
|
5895
5857
|
me,
|
|
5896
5858
|
_e,
|
|
5897
|
-
|
|
5859
|
+
M`
|
|
5898
5860
|
:host {
|
|
5899
5861
|
display: block;
|
|
5900
5862
|
}
|
|
@@ -6098,11 +6060,11 @@ function fs(s, e) {
|
|
|
6098
6060
|
localStorage.setItem(`${Tt}${s}`, JSON.stringify(e));
|
|
6099
6061
|
}
|
|
6100
6062
|
var ms = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, L = (s, e, t, i) => {
|
|
6101
|
-
for (var n = i > 1 ? void 0 : i ? gs(e, t) : e,
|
|
6102
|
-
(
|
|
6063
|
+
for (var n = i > 1 ? void 0 : i ? gs(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
6064
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
6103
6065
|
return i && n && ms(e, t, n), n;
|
|
6104
6066
|
};
|
|
6105
|
-
let
|
|
6067
|
+
let I = class extends S {
|
|
6106
6068
|
constructor() {
|
|
6107
6069
|
super(...arguments), this.collapsed = !1, this.activePanel = null, this.pinModeActive = !1, this.featuresDisabled = !1, this.drawModeActive = !1, this.followingUserId = null, this.display = "floating", this.users = [], this.unreadCount = 0;
|
|
6108
6070
|
}
|
|
@@ -6155,7 +6117,7 @@ let M = class extends S {
|
|
|
6155
6117
|
if (this.collapsed)
|
|
6156
6118
|
return d`
|
|
6157
6119
|
<div class="toolbar collapsed ${s ? "inline" : ""}" @click=${this.fireToggle}>
|
|
6158
|
-
<span class="fab-icon">${C(
|
|
6120
|
+
<span class="fab-icon">${C(Ii, s ? 18 : 24)}</span>
|
|
6159
6121
|
</div>
|
|
6160
6122
|
`;
|
|
6161
6123
|
const e = this.users.slice(0, 3), t = this.users.length - 3;
|
|
@@ -6262,10 +6224,10 @@ let M = class extends S {
|
|
|
6262
6224
|
`;
|
|
6263
6225
|
}
|
|
6264
6226
|
};
|
|
6265
|
-
|
|
6227
|
+
I.styles = [
|
|
6266
6228
|
ee,
|
|
6267
6229
|
me,
|
|
6268
|
-
|
|
6230
|
+
M`
|
|
6269
6231
|
:host {
|
|
6270
6232
|
display: block;
|
|
6271
6233
|
}
|
|
@@ -6479,37 +6441,37 @@ M.styles = [
|
|
|
6479
6441
|
];
|
|
6480
6442
|
L([
|
|
6481
6443
|
g({ attribute: !1 })
|
|
6482
|
-
],
|
|
6444
|
+
], I.prototype, "client", 2);
|
|
6483
6445
|
L([
|
|
6484
6446
|
g({ type: Boolean })
|
|
6485
|
-
],
|
|
6447
|
+
], I.prototype, "collapsed", 2);
|
|
6486
6448
|
L([
|
|
6487
6449
|
g()
|
|
6488
|
-
],
|
|
6450
|
+
], I.prototype, "activePanel", 2);
|
|
6489
6451
|
L([
|
|
6490
6452
|
g({ type: Boolean })
|
|
6491
|
-
],
|
|
6453
|
+
], I.prototype, "pinModeActive", 2);
|
|
6492
6454
|
L([
|
|
6493
6455
|
g({ type: Boolean })
|
|
6494
|
-
],
|
|
6456
|
+
], I.prototype, "featuresDisabled", 2);
|
|
6495
6457
|
L([
|
|
6496
6458
|
g({ type: Boolean })
|
|
6497
|
-
],
|
|
6459
|
+
], I.prototype, "drawModeActive", 2);
|
|
6498
6460
|
L([
|
|
6499
6461
|
g()
|
|
6500
|
-
],
|
|
6462
|
+
], I.prototype, "followingUserId", 2);
|
|
6501
6463
|
L([
|
|
6502
6464
|
g()
|
|
6503
|
-
],
|
|
6465
|
+
], I.prototype, "display", 2);
|
|
6504
6466
|
L([
|
|
6505
6467
|
v()
|
|
6506
|
-
],
|
|
6468
|
+
], I.prototype, "users", 2);
|
|
6507
6469
|
L([
|
|
6508
6470
|
v()
|
|
6509
|
-
],
|
|
6510
|
-
|
|
6471
|
+
], I.prototype, "unreadCount", 2);
|
|
6472
|
+
I = L([
|
|
6511
6473
|
R("pulse-widget-toolbar")
|
|
6512
|
-
],
|
|
6474
|
+
], I);
|
|
6513
6475
|
class bs {
|
|
6514
6476
|
constructor(e) {
|
|
6515
6477
|
this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
|
|
@@ -6541,14 +6503,14 @@ class bs {
|
|
|
6541
6503
|
this.disable();
|
|
6542
6504
|
}
|
|
6543
6505
|
render() {
|
|
6544
|
-
var
|
|
6506
|
+
var r;
|
|
6545
6507
|
if (!this.container) return;
|
|
6546
6508
|
if (document.documentElement.scrollHeight <= window.innerHeight) {
|
|
6547
6509
|
for (const l of this.pillEls.values()) l.remove();
|
|
6548
6510
|
this.pillEls.clear();
|
|
6549
6511
|
return;
|
|
6550
6512
|
}
|
|
6551
|
-
const e = window.scrollY, t = window.innerHeight, i = document.documentElement.scrollHeight, n = (
|
|
6513
|
+
const e = window.scrollY, t = window.innerHeight, i = document.documentElement.scrollHeight, n = (r = this.client.state.user) == null ? void 0 : r.id, o = /* @__PURE__ */ new Set();
|
|
6552
6514
|
for (const [l, a] of this.client.state.viewports) {
|
|
6553
6515
|
if (l === n) continue;
|
|
6554
6516
|
const c = a.scrollY, h = a.scrollY + a.viewportHeight, p = e, m = e + t;
|
|
@@ -6557,7 +6519,7 @@ class bs {
|
|
|
6557
6519
|
k && (k.style.display = "none");
|
|
6558
6520
|
continue;
|
|
6559
6521
|
}
|
|
6560
|
-
|
|
6522
|
+
o.add(l);
|
|
6561
6523
|
const f = this.client.state.presence.find(
|
|
6562
6524
|
(k) => k.user.id === l
|
|
6563
6525
|
);
|
|
@@ -6582,15 +6544,15 @@ class bs {
|
|
|
6582
6544
|
}), this.container.appendChild($), this.pillEls.set(l, $)), $.style.display = "", $.style.background = f.user.color, $.style.top = `${_}px`, $.textContent = this.getInitials(f.user.name);
|
|
6583
6545
|
}
|
|
6584
6546
|
for (const [l, a] of this.pillEls)
|
|
6585
|
-
!
|
|
6547
|
+
!o.has(l) && !this.client.state.viewports.has(l) && (a.remove(), this.pillEls.delete(l));
|
|
6586
6548
|
}
|
|
6587
6549
|
getInitials(e) {
|
|
6588
6550
|
return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
|
|
6589
6551
|
}
|
|
6590
6552
|
}
|
|
6591
6553
|
var vs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, P = (s, e, t, i) => {
|
|
6592
|
-
for (var n = i > 1 ? void 0 : i ? xs(e, t) : e,
|
|
6593
|
-
(
|
|
6554
|
+
for (var n = i > 1 ? void 0 : i ? xs(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
6555
|
+
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
6594
6556
|
return i && n && vs(e, t, n), n;
|
|
6595
6557
|
};
|
|
6596
6558
|
let E = class extends S {
|
|
@@ -6682,14 +6644,14 @@ let E = class extends S {
|
|
|
6682
6644
|
), window.addEventListener("scroll", this.handleScroll), document.addEventListener("selectionchange", this.handleSelectionChange), this.client.connect();
|
|
6683
6645
|
}
|
|
6684
6646
|
teardownClient() {
|
|
6685
|
-
var s, e, t, i, n,
|
|
6686
|
-
this.unsubs.forEach((
|
|
6647
|
+
var s, e, t, i, n, o;
|
|
6648
|
+
this.unsubs.forEach((r) => r()), this.unsubs = [], window.removeEventListener("scroll", this.handleScroll), document.removeEventListener("selectionchange", this.handleSelectionChange), this._viewportThrottleTimer && (clearTimeout(this._viewportThrottleTimer), this._viewportThrottleTimer = null), this._selectionThrottleTimer && (clearTimeout(this._selectionThrottleTimer), this._selectionThrottleTimer = null), (s = this.cursorOverlay) == null || s.destroy(), (e = this.commentPins) == null || e.destroy(), (t = this.viewportOverlay) == null || t.destroy(), (i = this.selectionOverlay) == null || i.destroy(), (n = this.drawingOverlay) == null || n.destroy(), (o = this.client) == null || o.disconnect(), this.client = void 0, this.cursorOverlay = void 0, this.commentPins = void 0, this.viewportOverlay = void 0, this.selectionOverlay = void 0, this.drawingOverlay = void 0, this.clientConfigKey = "", this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this._wasDisconnected = !1, this._connectedFlashTimer && (clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = null);
|
|
6687
6649
|
}
|
|
6688
6650
|
handlePanelClose() {
|
|
6689
6651
|
this.activePanel = null, this.highlightThreadId = null;
|
|
6690
6652
|
}
|
|
6691
6653
|
handleToolbarAction(s) {
|
|
6692
|
-
var t, i, n,
|
|
6654
|
+
var t, i, n, o;
|
|
6693
6655
|
const e = s.detail;
|
|
6694
6656
|
if (!(!this.settings.enabled && e !== "settings"))
|
|
6695
6657
|
switch (e) {
|
|
@@ -6709,7 +6671,7 @@ let E = class extends S {
|
|
|
6709
6671
|
this.pinModeActive = !this.pinModeActive, this.pinModeActive ? (t = this.commentPins) == null || t.enterPinMode() : (i = this.commentPins) == null || i.exitPinMode();
|
|
6710
6672
|
break;
|
|
6711
6673
|
case "draw-mode":
|
|
6712
|
-
this.drawModeActive = !this.drawModeActive, this.drawModeActive ? (n = this.drawingOverlay) == null || n.enableDrawMode() : (
|
|
6674
|
+
this.drawModeActive = !this.drawModeActive, this.drawModeActive ? (n = this.drawingOverlay) == null || n.enableDrawMode() : (o = this.drawingOverlay) == null || o.disableDrawMode();
|
|
6713
6675
|
break;
|
|
6714
6676
|
}
|
|
6715
6677
|
}
|
|
@@ -6722,9 +6684,9 @@ let E = class extends S {
|
|
|
6722
6684
|
this.settings = e, fs(this.room, e), this.applySettings(e);
|
|
6723
6685
|
}
|
|
6724
6686
|
applySettings(s) {
|
|
6725
|
-
var e, t, i, n,
|
|
6687
|
+
var e, t, i, n, o, r, l, a, c, h, p, m, f, b, x, _, $;
|
|
6726
6688
|
if (!s.enabled) {
|
|
6727
|
-
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (n = this.drawingOverlay) == null || n.disable(), this.drawModeActive && ((
|
|
6689
|
+
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (n = this.drawingOverlay) == null || n.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (l = this.commentPins) == null || l.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((a = this.commentPins) == null || a.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
|
|
6728
6690
|
return;
|
|
6729
6691
|
}
|
|
6730
6692
|
this.applyCursorSettings(s), (c = this.client) == null || c.setAppearOffline(s.appearOffline), (h = this.commentPins) == null || h.setVisible(s.showCommentPins), s.showViewportIndicators ? (p = this.viewportOverlay) == null || p.enable() : (m = this.viewportOverlay) == null || m.disable(), s.showSelections ? (f = this.selectionOverlay) == null || f.enable() : (b = this.selectionOverlay) == null || b.disable(), s.showDrawings ? (x = this.drawingOverlay) == null || x.enable() : ((_ = this.drawingOverlay) == null || _.disable(), this.drawModeActive && (($ = this.drawingOverlay) == null || $.disableDrawMode(), this.drawModeActive = !1));
|
|
@@ -6744,10 +6706,10 @@ let E = class extends S {
|
|
|
6744
6706
|
var b, x, _, $;
|
|
6745
6707
|
const s = this.display === "inline", e = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".inline-trigger"), t = (x = this.shadowRoot) == null ? void 0 : x.querySelector("pulse-widget-toolbar"), i = s ? e : t;
|
|
6746
6708
|
if (!i) return;
|
|
6747
|
-
const n = i.getBoundingClientRect(),
|
|
6709
|
+
const n = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, l = 8, a = (_ = this.shadowRoot) == null ? void 0 : _.querySelector(".toolbar-popover");
|
|
6748
6710
|
if (a) {
|
|
6749
6711
|
Object.assign(a.style, { top: "auto", left: "auto" });
|
|
6750
|
-
const k = a.getBoundingClientRect(), A = this.computePosition(n, k,
|
|
6712
|
+
const k = a.getBoundingClientRect(), A = this.computePosition(n, k, o, r, l);
|
|
6751
6713
|
a.style.top = `${A.top}px`, a.style.left = `${A.left}px`;
|
|
6752
6714
|
}
|
|
6753
6715
|
const c = ($ = this.shadowRoot) == null ? void 0 : $.querySelector(".panel-container");
|
|
@@ -6755,13 +6717,13 @@ let E = class extends S {
|
|
|
6755
6717
|
Object.assign(c.style, { top: "auto", left: "auto" });
|
|
6756
6718
|
const h = a ?? t;
|
|
6757
6719
|
if (!h) return;
|
|
6758
|
-
const p = h.getBoundingClientRect(), m = c.getBoundingClientRect(), f = this.computePosition(p, m,
|
|
6720
|
+
const p = h.getBoundingClientRect(), m = c.getBoundingClientRect(), f = this.computePosition(p, m, o, r, l);
|
|
6759
6721
|
c.style.top = `${f.top}px`, c.style.left = `${f.left}px`;
|
|
6760
6722
|
}
|
|
6761
6723
|
computePosition(s, e, t, i, n) {
|
|
6762
|
-
const
|
|
6724
|
+
const o = s.top, r = i - s.bottom;
|
|
6763
6725
|
let l;
|
|
6764
|
-
|
|
6726
|
+
o >= e.height + n ? l = s.top - e.height - n : r >= e.height + n ? l = s.bottom + n : l = o >= r ? Math.max(n, s.top - e.height - n) : s.bottom + n;
|
|
6765
6727
|
let a;
|
|
6766
6728
|
const c = s.right - e.width;
|
|
6767
6729
|
return c >= n ? a = c : s.left + e.width + n <= t ? a = s.left : a = Math.max(n, Math.min(t - e.width - n, s.left)), l = Math.max(n, Math.min(i - e.height - n, l)), a = Math.max(n, Math.min(t - e.width - n, a)), { top: l, left: a };
|
|
@@ -6868,7 +6830,7 @@ let E = class extends S {
|
|
|
6868
6830
|
};
|
|
6869
6831
|
E.styles = [
|
|
6870
6832
|
ee,
|
|
6871
|
-
|
|
6833
|
+
M`
|
|
6872
6834
|
:host {
|
|
6873
6835
|
display: block;
|
|
6874
6836
|
}
|