@gamention/pulse-elements 0.1.15 → 0.1.16
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 +223 -223
- package/dist/pulse-elements.js +1128 -1069
- package/package.json +1 -1
package/dist/pulse-elements.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
let
|
|
6
|
+
let wt = class extends Event {
|
|
7
7
|
constructor(e, t, i, s) {
|
|
8
8
|
super("context-request", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t, this.callback = i, this.subscribe = s ?? !1;
|
|
9
9
|
}
|
|
@@ -18,7 +18,7 @@ let yt = class extends Event {
|
|
|
18
18
|
* Copyright 2021 Google LLC
|
|
19
19
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
20
|
*/
|
|
21
|
-
let
|
|
21
|
+
let Ke = class {
|
|
22
22
|
constructor(e, t, i, s) {
|
|
23
23
|
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, r) => {
|
|
24
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;
|
|
@@ -35,7 +35,7 @@ let Ye = class {
|
|
|
35
35
|
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
36
36
|
}
|
|
37
37
|
dispatchRequest() {
|
|
38
|
-
this.host.dispatchEvent(new
|
|
38
|
+
this.host.dispatchEvent(new wt(this.context, this.host, this.t, this.subscribe));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
@@ -43,7 +43,7 @@ let Ye = class {
|
|
|
43
43
|
* Copyright 2021 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
45
|
*/
|
|
46
|
-
let
|
|
46
|
+
let Ot = class {
|
|
47
47
|
get value() {
|
|
48
48
|
return this.o;
|
|
49
49
|
}
|
|
@@ -76,21 +76,21 @@ let It = class {
|
|
|
76
76
|
* Copyright 2021 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
78
|
*/
|
|
79
|
-
let
|
|
79
|
+
let Rt = class extends Event {
|
|
80
80
|
constructor(e, t) {
|
|
81
81
|
super("context-provider", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, Ge = class extends Ot {
|
|
84
84
|
constructor(e, t, i) {
|
|
85
85
|
var s, o;
|
|
86
86
|
super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
|
|
87
87
|
if (r.context !== this.context) return;
|
|
88
|
-
const
|
|
89
|
-
|
|
88
|
+
const a = r.contextTarget ?? r.composedPath()[0];
|
|
89
|
+
a !== this.host && (r.stopPropagation(), this.addCallback(r.callback, a, r.subscribe));
|
|
90
90
|
}, this.onProviderRequest = (r) => {
|
|
91
91
|
if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
|
|
92
|
-
const
|
|
93
|
-
for (const [
|
|
92
|
+
const a = /* @__PURE__ */ new Set();
|
|
93
|
+
for (const [l, { consumerHost: d }] of this.subscriptions) a.has(l) || (a.add(l), d.dispatchEvent(new wt(this.context, d, l, !0)));
|
|
94
94
|
r.stopPropagation();
|
|
95
95
|
}, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (o = (s = this.host).addController) == null || o.call(s, this);
|
|
96
96
|
}
|
|
@@ -98,7 +98,7 @@ let Mt = class extends Event {
|
|
|
98
98
|
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
99
99
|
}
|
|
100
100
|
hostConnected() {
|
|
101
|
-
this.host.dispatchEvent(new
|
|
101
|
+
this.host.dispatchEvent(new Rt(this.context, this.host));
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
@@ -106,7 +106,7 @@ let Mt = class extends Event {
|
|
|
106
106
|
* Copyright 2017 Google LLC
|
|
107
107
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
108
|
*/
|
|
109
|
-
function
|
|
109
|
+
function Lt({ context: n }) {
|
|
110
110
|
return (e, t) => {
|
|
111
111
|
const i = /* @__PURE__ */ new WeakMap();
|
|
112
112
|
if (typeof t == "object") return { get() {
|
|
@@ -114,11 +114,11 @@ function Ot({ context: n }) {
|
|
|
114
114
|
}, set(s) {
|
|
115
115
|
return i.get(this).setValue(s), e.set.call(this, s);
|
|
116
116
|
}, init(s) {
|
|
117
|
-
return i.set(this, new
|
|
117
|
+
return i.set(this, new Ge(this, { context: n, initialValue: s })), s;
|
|
118
118
|
} };
|
|
119
119
|
{
|
|
120
120
|
e.constructor.addInitializer(((r) => {
|
|
121
|
-
i.set(r, new
|
|
121
|
+
i.set(r, new Ge(r, { context: n }));
|
|
122
122
|
}));
|
|
123
123
|
const s = Object.getOwnPropertyDescriptor(e, t);
|
|
124
124
|
let o;
|
|
@@ -126,13 +126,13 @@ function Ot({ context: n }) {
|
|
|
126
126
|
const r = /* @__PURE__ */ new WeakMap();
|
|
127
127
|
o = { get() {
|
|
128
128
|
return r.get(this);
|
|
129
|
-
}, set(
|
|
130
|
-
i.get(this).setValue(
|
|
129
|
+
}, set(a) {
|
|
130
|
+
i.get(this).setValue(a), r.set(this, a);
|
|
131
131
|
}, configurable: !0, enumerable: !0 };
|
|
132
132
|
} else {
|
|
133
133
|
const r = s.set;
|
|
134
|
-
o = { ...s, set(
|
|
135
|
-
i.get(this).setValue(
|
|
134
|
+
o = { ...s, set(a) {
|
|
135
|
+
i.get(this).setValue(a), r == null || r.call(this, a);
|
|
136
136
|
} };
|
|
137
137
|
}
|
|
138
138
|
return void Object.defineProperty(e, t, o);
|
|
@@ -144,24 +144,24 @@ function Ot({ context: n }) {
|
|
|
144
144
|
* Copyright 2022 Google LLC
|
|
145
145
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
146
146
|
*/
|
|
147
|
-
function
|
|
147
|
+
function fe({ context: n, subscribe: e }) {
|
|
148
148
|
return (t, i) => {
|
|
149
149
|
typeof i == "object" ? i.addInitializer((function() {
|
|
150
|
-
new
|
|
150
|
+
new Ke(this, { context: n, callback: (s) => {
|
|
151
151
|
t.set.call(this, s);
|
|
152
152
|
}, subscribe: e });
|
|
153
153
|
})) : t.constructor.addInitializer(((s) => {
|
|
154
|
-
new
|
|
154
|
+
new Ke(s, { context: n, callback: (o) => {
|
|
155
155
|
s[i] = o;
|
|
156
156
|
}, subscribe: e });
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var
|
|
161
|
-
const
|
|
162
|
-
let
|
|
160
|
+
var jt = Object.defineProperty, zt = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, k = (n, e, t) => zt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
161
|
+
const Ut = "ws://localhost:4567";
|
|
162
|
+
let De = class {
|
|
163
163
|
constructor() {
|
|
164
|
-
|
|
164
|
+
k(this, "handlers", /* @__PURE__ */ new Map());
|
|
165
165
|
}
|
|
166
166
|
on(e, t) {
|
|
167
167
|
this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set());
|
|
@@ -179,9 +179,9 @@ let Ue = class {
|
|
|
179
179
|
removeAll() {
|
|
180
180
|
this.handlers.clear();
|
|
181
181
|
}
|
|
182
|
-
},
|
|
182
|
+
}, Dt = class extends De {
|
|
183
183
|
constructor(e) {
|
|
184
|
-
super(),
|
|
184
|
+
super(), k(this, "ws", null), k(this, "endpoint"), k(this, "reconnectAttempt", 0), k(this, "reconnectTimer", null), k(this, "_state", "disconnected"), this.endpoint = e ?? Ut;
|
|
185
185
|
}
|
|
186
186
|
get state() {
|
|
187
187
|
return this._state;
|
|
@@ -216,9 +216,9 @@ let Ue = class {
|
|
|
216
216
|
this.reconnectTimer = null, this.connect();
|
|
217
217
|
}, e);
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, Ht = class extends De {
|
|
220
220
|
constructor() {
|
|
221
|
-
super(...arguments),
|
|
221
|
+
super(...arguments), k(this, "baseUrl", ""), k(this, "_user", null), k(this, "_users", /* @__PURE__ */ new Map()), k(this, "_presence", /* @__PURE__ */ new Map()), k(this, "_threads", /* @__PURE__ */ new Map()), k(this, "_reactions", /* @__PURE__ */ new Map()), k(this, "_notifications", []), k(this, "_activityLogs", []), k(this, "_typing", /* @__PURE__ */ new Map()), k(this, "_viewports", /* @__PURE__ */ new Map()), k(this, "_selections", /* @__PURE__ */ new Map());
|
|
222
222
|
}
|
|
223
223
|
get user() {
|
|
224
224
|
return this._user;
|
|
@@ -426,12 +426,12 @@ let Ue = class {
|
|
|
426
426
|
reset() {
|
|
427
427
|
this._user = null, this._users.clear(), this._presence.clear(), this._threads.clear(), this._reactions.clear(), this._notifications = [], this._activityLogs = [], this._typing.clear(), this._viewports.clear(), this._selections.clear();
|
|
428
428
|
}
|
|
429
|
-
},
|
|
429
|
+
}, $t = class extends De {
|
|
430
430
|
constructor(e) {
|
|
431
431
|
var t;
|
|
432
|
-
super(),
|
|
432
|
+
super(), k(this, "state"), k(this, "connection"), k(this, "config"), k(this, "heartbeatTimer", null), k(this, "lastCursorSend", 0), k(this, "pendingCursor", null), k(this, "cursorTimer", null), this.config = e, this.state = new Ht(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
|
|
433
433
|
const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
|
|
434
|
-
this.connection = new
|
|
434
|
+
this.connection = new Dt(i), this.connection.on("message", (s) => {
|
|
435
435
|
this.state.handleMessage(s), this.emit(s.type, s);
|
|
436
436
|
}), this.connection.on("state", (s) => {
|
|
437
437
|
this.emit("connection", s), s === "connected" ? (this.authenticate(), this.startHeartbeat()) : s === "disconnected" && this.stopHeartbeat();
|
|
@@ -575,18 +575,18 @@ let Ue = class {
|
|
|
575
575
|
* Copyright 2019 Google LLC
|
|
576
576
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
577
577
|
*/
|
|
578
|
-
const
|
|
579
|
-
let
|
|
578
|
+
const ye = globalThis, He = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Be = Symbol(), Je = /* @__PURE__ */ new WeakMap();
|
|
579
|
+
let kt = class {
|
|
580
580
|
constructor(e, t, i) {
|
|
581
|
-
if (this._$cssResult$ = !0, i !==
|
|
581
|
+
if (this._$cssResult$ = !0, i !== Be) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
582
582
|
this.cssText = e, this.t = t;
|
|
583
583
|
}
|
|
584
584
|
get styleSheet() {
|
|
585
585
|
let e = this.o;
|
|
586
586
|
const t = this.t;
|
|
587
|
-
if (
|
|
587
|
+
if (He && e === void 0) {
|
|
588
588
|
const i = t !== void 0 && t.length === 1;
|
|
589
|
-
i && (e =
|
|
589
|
+
i && (e = Je.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Je.set(t, e));
|
|
590
590
|
}
|
|
591
591
|
return e;
|
|
592
592
|
}
|
|
@@ -594,33 +594,33 @@ let $t = class {
|
|
|
594
594
|
return this.cssText;
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
|
-
const
|
|
597
|
+
const Bt = (n) => new kt(typeof n == "string" ? n : n + "", void 0, Be), M = (n, ...e) => {
|
|
598
598
|
const t = n.length === 1 ? n[0] : e.reduce((i, s, o) => i + ((r) => {
|
|
599
599
|
if (r._$cssResult$ === !0) return r.cssText;
|
|
600
600
|
if (typeof r == "number") return r;
|
|
601
601
|
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.");
|
|
602
602
|
})(s) + n[o + 1], n[0]);
|
|
603
|
-
return new
|
|
604
|
-
},
|
|
605
|
-
if (
|
|
603
|
+
return new kt(t, n, Be);
|
|
604
|
+
}, Nt = (n, e) => {
|
|
605
|
+
if (He) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
606
606
|
else for (const t of e) {
|
|
607
|
-
const i = document.createElement("style"), s =
|
|
607
|
+
const i = document.createElement("style"), s = ye.litNonce;
|
|
608
608
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, n.appendChild(i);
|
|
609
609
|
}
|
|
610
|
-
}, Ze =
|
|
610
|
+
}, Ze = He ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
|
|
611
611
|
let t = "";
|
|
612
612
|
for (const i of e.cssRules) t += i.cssText;
|
|
613
|
-
return
|
|
613
|
+
return Bt(t);
|
|
614
614
|
})(n) : n;
|
|
615
615
|
/**
|
|
616
616
|
* @license
|
|
617
617
|
* Copyright 2017 Google LLC
|
|
618
618
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
619
619
|
*/
|
|
620
|
-
const { is:
|
|
620
|
+
const { is: Ft, defineProperty: qt, getOwnPropertyDescriptor: Vt, getOwnPropertyNames: Wt, getOwnPropertySymbols: Xt, getPrototypeOf: Yt } = Object, H = globalThis, Qe = H.trustedTypes, Kt = Qe ? Qe.emptyScript : "", _e = H.reactiveElementPolyfillSupport, ne = (n, e) => n, ke = { toAttribute(n, e) {
|
|
621
621
|
switch (e) {
|
|
622
622
|
case Boolean:
|
|
623
|
-
n = n ?
|
|
623
|
+
n = n ? Kt : null;
|
|
624
624
|
break;
|
|
625
625
|
case Object:
|
|
626
626
|
case Array:
|
|
@@ -645,44 +645,44 @@ const { is: Nt, defineProperty: Ft, getOwnPropertyDescriptor: Bt, getOwnProperty
|
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
return t;
|
|
648
|
-
} }, Ne = (n, e) => !
|
|
649
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
650
|
-
let
|
|
648
|
+
} }, Ne = (n, e) => !Ft(n, e), et = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Ne };
|
|
649
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), H.litPropertyMetadata ?? (H.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
650
|
+
let G = class extends HTMLElement {
|
|
651
651
|
static addInitializer(e) {
|
|
652
652
|
this._$Ei(), (this.l ?? (this.l = [])).push(e);
|
|
653
653
|
}
|
|
654
654
|
static get observedAttributes() {
|
|
655
655
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
656
656
|
}
|
|
657
|
-
static createProperty(e, t =
|
|
657
|
+
static createProperty(e, t = et) {
|
|
658
658
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
659
659
|
const i = Symbol(), s = this.getPropertyDescriptor(e, i, t);
|
|
660
|
-
s !== void 0 &&
|
|
660
|
+
s !== void 0 && qt(this.prototype, e, s);
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
static getPropertyDescriptor(e, t, i) {
|
|
664
|
-
const { get: s, set: o } =
|
|
664
|
+
const { get: s, set: o } = Vt(this.prototype, e) ?? { get() {
|
|
665
665
|
return this[t];
|
|
666
666
|
}, set(r) {
|
|
667
667
|
this[t] = r;
|
|
668
668
|
} };
|
|
669
669
|
return { get: s, set(r) {
|
|
670
|
-
const
|
|
671
|
-
o == null || o.call(this, r), this.requestUpdate(e,
|
|
670
|
+
const a = s == null ? void 0 : s.call(this);
|
|
671
|
+
o == null || o.call(this, r), this.requestUpdate(e, a, i);
|
|
672
672
|
}, configurable: !0, enumerable: !0 };
|
|
673
673
|
}
|
|
674
674
|
static getPropertyOptions(e) {
|
|
675
|
-
return this.elementProperties.get(e) ??
|
|
675
|
+
return this.elementProperties.get(e) ?? et;
|
|
676
676
|
}
|
|
677
677
|
static _$Ei() {
|
|
678
|
-
if (this.hasOwnProperty(
|
|
679
|
-
const e =
|
|
678
|
+
if (this.hasOwnProperty(ne("elementProperties"))) return;
|
|
679
|
+
const e = Yt(this);
|
|
680
680
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
681
681
|
}
|
|
682
682
|
static finalize() {
|
|
683
|
-
if (this.hasOwnProperty(
|
|
684
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
685
|
-
const t = this.properties, i = [...
|
|
683
|
+
if (this.hasOwnProperty(ne("finalized"))) return;
|
|
684
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ne("properties"))) {
|
|
685
|
+
const t = this.properties, i = [...Wt(t), ...Xt(t)];
|
|
686
686
|
for (const s of i) this.createProperty(s, t[s]);
|
|
687
687
|
}
|
|
688
688
|
const e = this[Symbol.metadata];
|
|
@@ -731,7 +731,7 @@ let K = class extends HTMLElement {
|
|
|
731
731
|
}
|
|
732
732
|
createRenderRoot() {
|
|
733
733
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
734
|
-
return
|
|
734
|
+
return Nt(e, this.constructor.elementStyles), e;
|
|
735
735
|
}
|
|
736
736
|
connectedCallback() {
|
|
737
737
|
var e;
|
|
@@ -756,7 +756,7 @@ let K = class extends HTMLElement {
|
|
|
756
756
|
var o;
|
|
757
757
|
const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
|
|
758
758
|
if (s !== void 0 && i.reflect === !0) {
|
|
759
|
-
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter :
|
|
759
|
+
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : ke).toAttribute(t, i.type);
|
|
760
760
|
this._$Em = e, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$Em = null;
|
|
761
761
|
}
|
|
762
762
|
}
|
|
@@ -764,17 +764,17 @@ let K = class extends HTMLElement {
|
|
|
764
764
|
var o, r;
|
|
765
765
|
const i = this.constructor, s = i._$Eh.get(e);
|
|
766
766
|
if (s !== void 0 && this._$Em !== s) {
|
|
767
|
-
const
|
|
767
|
+
const a = i.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : ke;
|
|
768
768
|
this._$Em = s;
|
|
769
|
-
const
|
|
770
|
-
this[s] =
|
|
769
|
+
const d = l.fromAttribute(t, a.type);
|
|
770
|
+
this[s] = d ?? ((r = this._$Ej) == null ? void 0 : r.get(s)) ?? d, this._$Em = null;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
requestUpdate(e, t, i, s = !1, o) {
|
|
774
774
|
var r;
|
|
775
775
|
if (e !== void 0) {
|
|
776
|
-
const
|
|
777
|
-
if (s === !1 && (o = this[e]), i ?? (i =
|
|
776
|
+
const a = this.constructor;
|
|
777
|
+
if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ?? Ne)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(a._$Eu(e, i)))) return;
|
|
778
778
|
this.C(e, t, i);
|
|
779
779
|
}
|
|
780
780
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -805,8 +805,8 @@ let K = class extends HTMLElement {
|
|
|
805
805
|
}
|
|
806
806
|
const s = this.constructor.elementProperties;
|
|
807
807
|
if (s.size > 0) for (const [o, r] of s) {
|
|
808
|
-
const { wrapped:
|
|
809
|
-
|
|
808
|
+
const { wrapped: a } = r, l = this[o];
|
|
809
|
+
a !== !0 || this._$AL.has(o) || l === void 0 || this.C(o, void 0, r, l);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
812
|
let e = !1;
|
|
@@ -850,76 +850,76 @@ let K = class extends HTMLElement {
|
|
|
850
850
|
firstUpdated(e) {
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
|
-
|
|
853
|
+
G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[ne("elementProperties")] = /* @__PURE__ */ new Map(), G[ne("finalized")] = /* @__PURE__ */ new Map(), _e == null || _e({ ReactiveElement: G }), (H.reactiveElementVersions ?? (H.reactiveElementVersions = [])).push("2.1.2");
|
|
854
854
|
/**
|
|
855
855
|
* @license
|
|
856
856
|
* Copyright 2017 Google LLC
|
|
857
857
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
858
858
|
*/
|
|
859
|
-
const
|
|
860
|
-
\f\r]`,
|
|
861
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
862
|
-
function
|
|
859
|
+
const oe = globalThis, tt = (n) => n, Ee = oe.trustedTypes, it = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Et = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, Ct = "?" + D, Gt = `<${Ct}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, Jt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Ie = `[
|
|
860
|
+
\f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, nt = />/g, N = RegExp(`>|${Ie}(?:([^\\s"'>=/]+)(${Ie}*=${Ie}*(?:[^
|
|
861
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, rt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, St = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = St(1), Zt = St(2), W = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
|
|
862
|
+
function Pt(n, e) {
|
|
863
863
|
if (!Fe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
864
|
-
return
|
|
864
|
+
return it !== void 0 ? it.createHTML(e) : e;
|
|
865
865
|
}
|
|
866
|
-
const
|
|
866
|
+
const Qt = (n, e) => {
|
|
867
867
|
const t = n.length - 1, i = [];
|
|
868
|
-
let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r =
|
|
869
|
-
for (let
|
|
870
|
-
const
|
|
871
|
-
let c, h
|
|
872
|
-
for (;
|
|
873
|
-
const
|
|
874
|
-
o += r ===
|
|
875
|
-
}
|
|
876
|
-
return [
|
|
868
|
+
let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = se;
|
|
869
|
+
for (let a = 0; a < t; a++) {
|
|
870
|
+
const l = n[a];
|
|
871
|
+
let d, c, h = -1, p = 0;
|
|
872
|
+
for (; p < l.length && (r.lastIndex = p, c = r.exec(l), c !== null); ) p = r.lastIndex, r === se ? c[1] === "!--" ? r = st : c[1] !== void 0 ? r = nt : c[2] !== void 0 ? (Tt.test(c[2]) && (s = RegExp("</" + c[2], "g")), r = N) : c[3] !== void 0 && (r = N) : r === N ? c[0] === ">" ? (r = s ?? se, h = -1) : c[1] === void 0 ? h = -2 : (h = r.lastIndex - c[2].length, d = c[1], r = c[3] === void 0 ? N : c[3] === '"' ? rt : ot) : r === rt || r === ot ? r = N : r === st || r === nt ? r = se : (r = N, s = void 0);
|
|
873
|
+
const m = r === N && n[a + 1].startsWith("/>") ? " " : "";
|
|
874
|
+
o += r === se ? l + Gt : h >= 0 ? (i.push(d), l.slice(0, h) + Et + l.slice(h) + D + m) : l + D + (h === -2 ? a : m);
|
|
875
|
+
}
|
|
876
|
+
return [Pt(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
877
877
|
};
|
|
878
|
-
class
|
|
878
|
+
class ce {
|
|
879
879
|
constructor({ strings: e, _$litType$: t }, i) {
|
|
880
880
|
let s;
|
|
881
881
|
this.parts = [];
|
|
882
882
|
let o = 0, r = 0;
|
|
883
|
-
const
|
|
884
|
-
if (this.el =
|
|
885
|
-
const
|
|
886
|
-
|
|
883
|
+
const a = e.length - 1, l = this.parts, [d, c] = Qt(e, t);
|
|
884
|
+
if (this.el = ce.createElement(d, i), F.currentNode = this.el.content, t === 2 || t === 3) {
|
|
885
|
+
const h = this.el.content.firstChild;
|
|
886
|
+
h.replaceWith(...h.childNodes);
|
|
887
887
|
}
|
|
888
|
-
for (; (s = F.nextNode()) !== null &&
|
|
888
|
+
for (; (s = F.nextNode()) !== null && l.length < a; ) {
|
|
889
889
|
if (s.nodeType === 1) {
|
|
890
|
-
if (s.hasAttributes()) for (const
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
} else
|
|
894
|
-
if (
|
|
895
|
-
const
|
|
896
|
-
if (
|
|
897
|
-
s.textContent =
|
|
898
|
-
for (let
|
|
899
|
-
s.append(p
|
|
890
|
+
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Et)) {
|
|
891
|
+
const p = c[r++], m = s.getAttribute(h).split(D), g = /([.?@])?(.*)/.exec(p);
|
|
892
|
+
l.push({ type: 1, index: o, name: g[2], strings: m, ctor: g[1] === "." ? ti : g[1] === "?" ? ii : g[1] === "@" ? si : Se }), s.removeAttribute(h);
|
|
893
|
+
} else h.startsWith(D) && (l.push({ type: 6, index: o }), s.removeAttribute(h));
|
|
894
|
+
if (Tt.test(s.tagName)) {
|
|
895
|
+
const h = s.textContent.split(D), p = h.length - 1;
|
|
896
|
+
if (p > 0) {
|
|
897
|
+
s.textContent = Ee ? Ee.emptyScript : "";
|
|
898
|
+
for (let m = 0; m < p; m++) s.append(h[m], ae()), F.nextNode(), l.push({ type: 2, index: ++o });
|
|
899
|
+
s.append(h[p], ae());
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
902
|
+
} else if (s.nodeType === 8) if (s.data === Ct) l.push({ type: 2, index: o });
|
|
903
903
|
else {
|
|
904
|
-
let
|
|
905
|
-
for (; (
|
|
904
|
+
let h = -1;
|
|
905
|
+
for (; (h = s.data.indexOf(D, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += D.length - 1;
|
|
906
906
|
}
|
|
907
907
|
o++;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
910
|
static createElement(e, t) {
|
|
911
|
-
const i =
|
|
911
|
+
const i = V.createElement("template");
|
|
912
912
|
return i.innerHTML = e, i;
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
|
-
function
|
|
916
|
-
var r,
|
|
917
|
-
if (e ===
|
|
915
|
+
function J(n, e, t = n, i) {
|
|
916
|
+
var r, a;
|
|
917
|
+
if (e === W) return e;
|
|
918
918
|
let s = i !== void 0 ? (r = t._$Co) == null ? void 0 : r[i] : t._$Cl;
|
|
919
|
-
const o =
|
|
920
|
-
return (s == null ? void 0 : s.constructor) !== o && ((
|
|
919
|
+
const o = le(e) ? void 0 : e._$litDirective$;
|
|
920
|
+
return (s == null ? void 0 : s.constructor) !== o && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), o === void 0 ? s = void 0 : (s = new o(n), s._$AT(n, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = J(n, s._$AS(n, e.values), s, i)), e;
|
|
921
921
|
}
|
|
922
|
-
class
|
|
922
|
+
class ei {
|
|
923
923
|
constructor(e, t) {
|
|
924
924
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
925
925
|
}
|
|
@@ -930,30 +930,30 @@ class Jt {
|
|
|
930
930
|
return this._$AM._$AU;
|
|
931
931
|
}
|
|
932
932
|
u(e) {
|
|
933
|
-
const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ??
|
|
933
|
+
const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? V).importNode(t, !0);
|
|
934
934
|
F.currentNode = s;
|
|
935
|
-
let o = F.nextNode(), r = 0,
|
|
936
|
-
for (;
|
|
937
|
-
if (r ===
|
|
938
|
-
let
|
|
939
|
-
|
|
935
|
+
let o = F.nextNode(), r = 0, a = 0, l = i[0];
|
|
936
|
+
for (; l !== void 0; ) {
|
|
937
|
+
if (r === l.index) {
|
|
938
|
+
let d;
|
|
939
|
+
l.type === 2 ? d = new me(o, o.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (d = new ni(o, this, e)), this._$AV.push(d), l = i[++a];
|
|
940
940
|
}
|
|
941
|
-
r !== (
|
|
941
|
+
r !== (l == null ? void 0 : l.index) && (o = F.nextNode(), r++);
|
|
942
942
|
}
|
|
943
|
-
return F.currentNode =
|
|
943
|
+
return F.currentNode = V, s;
|
|
944
944
|
}
|
|
945
945
|
p(e) {
|
|
946
946
|
let t = 0;
|
|
947
947
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, t), t += i.strings.length - 2) : i._$AI(e[t])), t++;
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
class
|
|
950
|
+
class me {
|
|
951
951
|
get _$AU() {
|
|
952
952
|
var e;
|
|
953
953
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
954
954
|
}
|
|
955
955
|
constructor(e, t, i, s) {
|
|
956
|
-
this.type = 2, this._$AH =
|
|
956
|
+
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
|
957
957
|
}
|
|
958
958
|
get parentNode() {
|
|
959
959
|
let e = this._$AA.parentNode;
|
|
@@ -967,7 +967,7 @@ class fe {
|
|
|
967
967
|
return this._$AB;
|
|
968
968
|
}
|
|
969
969
|
_$AI(e, t = this) {
|
|
970
|
-
e =
|
|
970
|
+
e = J(this, e, t), le(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Jt(e) ? this.k(e) : this._(e);
|
|
971
971
|
}
|
|
972
972
|
O(e) {
|
|
973
973
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -976,33 +976,33 @@ class fe {
|
|
|
976
976
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
977
977
|
}
|
|
978
978
|
_(e) {
|
|
979
|
-
this._$AH !==
|
|
979
|
+
this._$AH !== b && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
|
|
980
980
|
}
|
|
981
981
|
$(e) {
|
|
982
982
|
var o;
|
|
983
|
-
const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el =
|
|
983
|
+
const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(Pt(i.h, i.h[0]), this.options)), i);
|
|
984
984
|
if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(t);
|
|
985
985
|
else {
|
|
986
|
-
const r = new
|
|
987
|
-
r.p(t), this.T(
|
|
986
|
+
const r = new ei(s, this), a = r.u(this.options);
|
|
987
|
+
r.p(t), this.T(a), this._$AH = r;
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
990
|
_$AC(e) {
|
|
991
|
-
let t =
|
|
992
|
-
return t === void 0 &&
|
|
991
|
+
let t = at.get(e.strings);
|
|
992
|
+
return t === void 0 && at.set(e.strings, t = new ce(e)), t;
|
|
993
993
|
}
|
|
994
994
|
k(e) {
|
|
995
995
|
Fe(this._$AH) || (this._$AH = [], this._$AR());
|
|
996
996
|
const t = this._$AH;
|
|
997
997
|
let i, s = 0;
|
|
998
|
-
for (const o of e) s === t.length ? t.push(i = new
|
|
998
|
+
for (const o of e) s === t.length ? t.push(i = new me(this.O(ae()), this.O(ae()), this, this.options)) : i = t[s], i._$AI(o), s++;
|
|
999
999
|
s < t.length && (this._$AR(i && i._$AB.nextSibling, s), t.length = s);
|
|
1000
1000
|
}
|
|
1001
1001
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
1002
1002
|
var i;
|
|
1003
1003
|
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, t); e !== this._$AB; ) {
|
|
1004
|
-
const s =
|
|
1005
|
-
|
|
1004
|
+
const s = tt(e).nextSibling;
|
|
1005
|
+
tt(e).remove(), e = s;
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
setConnected(e) {
|
|
@@ -1010,7 +1010,7 @@ class fe {
|
|
|
1010
1010
|
this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
|
-
class
|
|
1013
|
+
class Se {
|
|
1014
1014
|
get tagName() {
|
|
1015
1015
|
return this.element.tagName;
|
|
1016
1016
|
}
|
|
@@ -1018,46 +1018,46 @@ class Te {
|
|
|
1018
1018
|
return this._$AM._$AU;
|
|
1019
1019
|
}
|
|
1020
1020
|
constructor(e, t, i, s, o) {
|
|
1021
|
-
this.type = 1, this._$AH =
|
|
1021
|
+
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = b;
|
|
1022
1022
|
}
|
|
1023
1023
|
_$AI(e, t = this, i, s) {
|
|
1024
1024
|
const o = this.strings;
|
|
1025
1025
|
let r = !1;
|
|
1026
|
-
if (o === void 0) e =
|
|
1026
|
+
if (o === void 0) e = J(this, e, t, 0), r = !le(e) || e !== this._$AH && e !== W, r && (this._$AH = e);
|
|
1027
1027
|
else {
|
|
1028
|
-
const
|
|
1029
|
-
let
|
|
1030
|
-
for (e = o[0],
|
|
1028
|
+
const a = e;
|
|
1029
|
+
let l, d;
|
|
1030
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === b ? e = b : e !== b && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
|
|
1031
1031
|
}
|
|
1032
1032
|
r && !s && this.j(e);
|
|
1033
1033
|
}
|
|
1034
1034
|
j(e) {
|
|
1035
|
-
e ===
|
|
1035
|
+
e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
-
class
|
|
1038
|
+
class ti extends Se {
|
|
1039
1039
|
constructor() {
|
|
1040
1040
|
super(...arguments), this.type = 3;
|
|
1041
1041
|
}
|
|
1042
1042
|
j(e) {
|
|
1043
|
-
this.element[this.name] = e ===
|
|
1043
|
+
this.element[this.name] = e === b ? void 0 : e;
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
|
-
class
|
|
1046
|
+
class ii extends Se {
|
|
1047
1047
|
constructor() {
|
|
1048
1048
|
super(...arguments), this.type = 4;
|
|
1049
1049
|
}
|
|
1050
1050
|
j(e) {
|
|
1051
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
1051
|
+
this.element.toggleAttribute(this.name, !!e && e !== b);
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
class
|
|
1054
|
+
class si extends Se {
|
|
1055
1055
|
constructor(e, t, i, s, o) {
|
|
1056
1056
|
super(e, t, i, s, o), this.type = 5;
|
|
1057
1057
|
}
|
|
1058
1058
|
_$AI(e, t = this) {
|
|
1059
|
-
if ((e =
|
|
1060
|
-
const i = this._$AH, s = e ===
|
|
1059
|
+
if ((e = J(this, e, t, 0) ?? b) === W) return;
|
|
1060
|
+
const i = this._$AH, s = e === b && i !== b || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== b && (i === b || s);
|
|
1061
1061
|
s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
1062
1062
|
}
|
|
1063
1063
|
handleEvent(e) {
|
|
@@ -1065,7 +1065,7 @@ class ti extends Te {
|
|
|
1065
1065
|
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
|
-
class
|
|
1068
|
+
class ni {
|
|
1069
1069
|
constructor(e, t, i) {
|
|
1070
1070
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
|
|
1071
1071
|
}
|
|
@@ -1073,17 +1073,17 @@ class ii {
|
|
|
1073
1073
|
return this._$AM._$AU;
|
|
1074
1074
|
}
|
|
1075
1075
|
_$AI(e) {
|
|
1076
|
-
|
|
1076
|
+
J(this, e);
|
|
1077
1077
|
}
|
|
1078
1078
|
}
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
const
|
|
1079
|
+
const Me = oe.litHtmlPolyfillSupport;
|
|
1080
|
+
Me == null || Me(ce, me), (oe.litHtmlVersions ?? (oe.litHtmlVersions = [])).push("3.3.2");
|
|
1081
|
+
const oi = (n, e, t) => {
|
|
1082
1082
|
const i = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
1083
1083
|
let s = i._$litPart$;
|
|
1084
1084
|
if (s === void 0) {
|
|
1085
1085
|
const o = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
1086
|
-
i._$litPart$ = s = new
|
|
1086
|
+
i._$litPart$ = s = new me(e.insertBefore(ae(), o), o, void 0, t ?? {});
|
|
1087
1087
|
}
|
|
1088
1088
|
return s._$AI(n), s;
|
|
1089
1089
|
};
|
|
@@ -1092,8 +1092,8 @@ const si = (n, e, t) => {
|
|
|
1092
1092
|
* Copyright 2017 Google LLC
|
|
1093
1093
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1094
1094
|
*/
|
|
1095
|
-
const
|
|
1096
|
-
let P = class extends
|
|
1095
|
+
const q = globalThis;
|
|
1096
|
+
let P = class extends G {
|
|
1097
1097
|
constructor() {
|
|
1098
1098
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1099
1099
|
}
|
|
@@ -1104,7 +1104,7 @@ let P = class extends K {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
update(e) {
|
|
1106
1106
|
const t = this.render();
|
|
1107
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
1107
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = oi(t, this.renderRoot, this.renderOptions);
|
|
1108
1108
|
}
|
|
1109
1109
|
connectedCallback() {
|
|
1110
1110
|
var e;
|
|
@@ -1115,14 +1115,14 @@ let P = class extends K {
|
|
|
1115
1115
|
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
|
|
1116
1116
|
}
|
|
1117
1117
|
render() {
|
|
1118
|
-
return
|
|
1118
|
+
return W;
|
|
1119
1119
|
}
|
|
1120
1120
|
};
|
|
1121
|
-
var
|
|
1122
|
-
P._$litElement$ = !0, P.finalized = !0, (
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1125
|
-
(
|
|
1121
|
+
var yt;
|
|
1122
|
+
P._$litElement$ = !0, P.finalized = !0, (yt = q.litElementHydrateSupport) == null || yt.call(q, { LitElement: P });
|
|
1123
|
+
const Oe = q.litElementPolyfillSupport;
|
|
1124
|
+
Oe == null || Oe({ LitElement: P });
|
|
1125
|
+
(q.litElementVersions ?? (q.litElementVersions = [])).push("4.2.2");
|
|
1126
1126
|
/**
|
|
1127
1127
|
* @license
|
|
1128
1128
|
* Copyright 2017 Google LLC
|
|
@@ -1138,29 +1138,29 @@ const L = (n) => (e, t) => {
|
|
|
1138
1138
|
* Copyright 2017 Google LLC
|
|
1139
1139
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1140
1140
|
*/
|
|
1141
|
-
const
|
|
1141
|
+
const ri = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Ne }, ai = (n = ri, e, t) => {
|
|
1142
1142
|
const { kind: i, metadata: s } = t;
|
|
1143
1143
|
let o = globalThis.litPropertyMetadata.get(s);
|
|
1144
1144
|
if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((n = Object.create(n)).wrapped = !0), o.set(t.name, n), i === "accessor") {
|
|
1145
1145
|
const { name: r } = t;
|
|
1146
|
-
return { set(
|
|
1147
|
-
const
|
|
1148
|
-
e.set.call(this,
|
|
1149
|
-
}, init(
|
|
1150
|
-
return
|
|
1146
|
+
return { set(a) {
|
|
1147
|
+
const l = e.get.call(this);
|
|
1148
|
+
e.set.call(this, a), this.requestUpdate(r, l, n, !0, a);
|
|
1149
|
+
}, init(a) {
|
|
1150
|
+
return a !== void 0 && this.C(r, void 0, n, a), a;
|
|
1151
1151
|
} };
|
|
1152
1152
|
}
|
|
1153
1153
|
if (i === "setter") {
|
|
1154
1154
|
const { name: r } = t;
|
|
1155
|
-
return function(
|
|
1156
|
-
const
|
|
1157
|
-
e.call(this,
|
|
1155
|
+
return function(a) {
|
|
1156
|
+
const l = this[r];
|
|
1157
|
+
e.call(this, a), this.requestUpdate(r, l, n, !0, a);
|
|
1158
1158
|
};
|
|
1159
1159
|
}
|
|
1160
1160
|
throw Error("Unsupported decorator location: " + i);
|
|
1161
1161
|
};
|
|
1162
|
-
function
|
|
1163
|
-
return (e, t) => typeof t == "object" ?
|
|
1162
|
+
function x(n) {
|
|
1163
|
+
return (e, t) => typeof t == "object" ? ai(n, e, t) : ((i, s, o) => {
|
|
1164
1164
|
const r = s.hasOwnProperty(o);
|
|
1165
1165
|
return s.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(s, o) : void 0;
|
|
1166
1166
|
})(n, e, t);
|
|
@@ -1170,16 +1170,16 @@ function v(n) {
|
|
|
1170
1170
|
* Copyright 2017 Google LLC
|
|
1171
1171
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1172
1172
|
*/
|
|
1173
|
-
function
|
|
1174
|
-
return
|
|
1173
|
+
function $(n) {
|
|
1174
|
+
return x({ ...n, state: !0, attribute: !1 });
|
|
1175
1175
|
}
|
|
1176
|
-
const
|
|
1177
|
-
var
|
|
1178
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1176
|
+
const Q = "pulse-client";
|
|
1177
|
+
var li = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
|
|
1178
|
+
for (var s = i > 1 ? void 0 : i ? ci(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1179
1179
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1180
|
-
return i && s &&
|
|
1180
|
+
return i && s && li(e, t, s), s;
|
|
1181
1181
|
};
|
|
1182
|
-
let
|
|
1182
|
+
let X = class extends P {
|
|
1183
1183
|
constructor() {
|
|
1184
1184
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "";
|
|
1185
1185
|
}
|
|
@@ -1191,38 +1191,38 @@ let W = class extends P {
|
|
|
1191
1191
|
room: this.room,
|
|
1192
1192
|
endpoint: this.endpoint
|
|
1193
1193
|
};
|
|
1194
|
-
this.client = new
|
|
1194
|
+
this.client = new $t(n), this.client.connect();
|
|
1195
1195
|
}
|
|
1196
1196
|
disconnectedCallback() {
|
|
1197
1197
|
var n;
|
|
1198
1198
|
super.disconnectedCallback(), (n = this.client) == null || n.disconnect();
|
|
1199
1199
|
}
|
|
1200
1200
|
render() {
|
|
1201
|
-
return
|
|
1201
|
+
return u`<slot></slot>`;
|
|
1202
1202
|
}
|
|
1203
1203
|
};
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
],
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
],
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
],
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
],
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
],
|
|
1219
|
-
|
|
1204
|
+
ee([
|
|
1205
|
+
x({ attribute: "api-key" })
|
|
1206
|
+
], X.prototype, "apiKey", 2);
|
|
1207
|
+
ee([
|
|
1208
|
+
x()
|
|
1209
|
+
], X.prototype, "token", 2);
|
|
1210
|
+
ee([
|
|
1211
|
+
x()
|
|
1212
|
+
], X.prototype, "room", 2);
|
|
1213
|
+
ee([
|
|
1214
|
+
x()
|
|
1215
|
+
], X.prototype, "endpoint", 2);
|
|
1216
|
+
ee([
|
|
1217
|
+
Lt({ context: Q })
|
|
1218
|
+
], X.prototype, "client", 2);
|
|
1219
|
+
X = ee([
|
|
1220
1220
|
L("pulse-provider")
|
|
1221
|
-
],
|
|
1222
|
-
var
|
|
1223
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1221
|
+
], X);
|
|
1222
|
+
var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, Pe = (n, e, t, i) => {
|
|
1223
|
+
for (var s = i > 1 ? void 0 : i ? hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1224
1224
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1225
|
-
return i && s &&
|
|
1225
|
+
return i && s && di(e, t, s), s;
|
|
1226
1226
|
};
|
|
1227
1227
|
let Z = class extends P {
|
|
1228
1228
|
constructor() {
|
|
@@ -1249,16 +1249,16 @@ let Z = class extends P {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
render() {
|
|
1251
1251
|
const n = this.users.slice(0, this.maxVisible), e = this.users.length - this.maxVisible;
|
|
1252
|
-
return
|
|
1252
|
+
return u`
|
|
1253
1253
|
<div class="avatars">
|
|
1254
|
-
${e > 0 ?
|
|
1254
|
+
${e > 0 ? u`<div class="overflow">+${e}</div>` : null}
|
|
1255
1255
|
${n.map(
|
|
1256
|
-
(t) =>
|
|
1256
|
+
(t) => u`
|
|
1257
1257
|
<div
|
|
1258
1258
|
class="avatar"
|
|
1259
1259
|
style="background:${t.user.color}"
|
|
1260
1260
|
>
|
|
1261
|
-
${t.user.avatar ?
|
|
1261
|
+
${t.user.avatar ? u`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
|
|
1262
1262
|
<span class="status-ring ${t.status}"></span>
|
|
1263
1263
|
<span class="tooltip">${t.user.name}</span>
|
|
1264
1264
|
</div>
|
|
@@ -1268,7 +1268,7 @@ let Z = class extends P {
|
|
|
1268
1268
|
`;
|
|
1269
1269
|
}
|
|
1270
1270
|
};
|
|
1271
|
-
Z.styles =
|
|
1271
|
+
Z.styles = M`
|
|
1272
1272
|
:host {
|
|
1273
1273
|
display: inline-flex;
|
|
1274
1274
|
align-items: center;
|
|
@@ -1372,25 +1372,25 @@ Z.styles = O`
|
|
|
1372
1372
|
opacity: 1;
|
|
1373
1373
|
}
|
|
1374
1374
|
`;
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1375
|
+
Pe([
|
|
1376
|
+
fe({ context: Q, subscribe: !0 }),
|
|
1377
|
+
x({ attribute: !1 })
|
|
1378
1378
|
], Z.prototype, "client", 2);
|
|
1379
|
-
|
|
1380
|
-
|
|
1379
|
+
Pe([
|
|
1380
|
+
x({ type: Number, attribute: "max-visible" })
|
|
1381
1381
|
], Z.prototype, "maxVisible", 2);
|
|
1382
|
-
|
|
1383
|
-
|
|
1382
|
+
Pe([
|
|
1383
|
+
$()
|
|
1384
1384
|
], Z.prototype, "users", 2);
|
|
1385
|
-
Z =
|
|
1385
|
+
Z = Pe([
|
|
1386
1386
|
L("pulse-presence")
|
|
1387
1387
|
], Z);
|
|
1388
|
-
var
|
|
1389
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1388
|
+
var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, qe = (n, e, t, i) => {
|
|
1389
|
+
for (var s = i > 1 ? void 0 : i ? ui(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1390
1390
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1391
|
-
return i && s &&
|
|
1391
|
+
return i && s && pi(e, t, s), s;
|
|
1392
1392
|
};
|
|
1393
|
-
let
|
|
1393
|
+
let de = class extends P {
|
|
1394
1394
|
constructor() {
|
|
1395
1395
|
super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (n) => {
|
|
1396
1396
|
var e;
|
|
@@ -1444,9 +1444,9 @@ let ce = class extends P {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
render() {
|
|
1446
1446
|
const n = [...this.cursors.values()];
|
|
1447
|
-
return
|
|
1447
|
+
return u`
|
|
1448
1448
|
${n.map(
|
|
1449
|
-
(e) =>
|
|
1449
|
+
(e) => u`
|
|
1450
1450
|
<div
|
|
1451
1451
|
class="cursor"
|
|
1452
1452
|
style="transform:translate(${e.position.x}px,${e.position.y}px)"
|
|
@@ -1467,7 +1467,7 @@ let ce = class extends P {
|
|
|
1467
1467
|
`;
|
|
1468
1468
|
}
|
|
1469
1469
|
};
|
|
1470
|
-
|
|
1470
|
+
de.styles = M`
|
|
1471
1471
|
:host {
|
|
1472
1472
|
position: fixed;
|
|
1473
1473
|
top: 0;
|
|
@@ -1504,22 +1504,22 @@ ce.styles = O`
|
|
|
1504
1504
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
1505
1505
|
}
|
|
1506
1506
|
`;
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
],
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
],
|
|
1514
|
-
|
|
1507
|
+
qe([
|
|
1508
|
+
fe({ context: Q, subscribe: !0 }),
|
|
1509
|
+
x({ attribute: !1 })
|
|
1510
|
+
], de.prototype, "client", 2);
|
|
1511
|
+
qe([
|
|
1512
|
+
$()
|
|
1513
|
+
], de.prototype, "cursors", 2);
|
|
1514
|
+
de = qe([
|
|
1515
1515
|
L("pulse-cursors")
|
|
1516
|
-
],
|
|
1517
|
-
var
|
|
1518
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1516
|
+
], de);
|
|
1517
|
+
var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, ge = (n, e, t, i) => {
|
|
1518
|
+
for (var s = i > 1 ? void 0 : i ? mi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1519
1519
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1520
|
-
return i && s &&
|
|
1520
|
+
return i && s && fi(e, t, s), s;
|
|
1521
1521
|
};
|
|
1522
|
-
let
|
|
1522
|
+
let Y = class extends P {
|
|
1523
1523
|
constructor() {
|
|
1524
1524
|
super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
|
|
1525
1525
|
}
|
|
@@ -1541,7 +1541,7 @@ let X = class extends P {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
parseMentions(n) {
|
|
1543
1543
|
return n.split(/(@\w+)/g).map(
|
|
1544
|
-
(t) => t.startsWith("@") ?
|
|
1544
|
+
(t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
|
|
1545
1545
|
);
|
|
1546
1546
|
}
|
|
1547
1547
|
getInitials(n) {
|
|
@@ -1567,9 +1567,9 @@ let X = class extends P {
|
|
|
1567
1567
|
}
|
|
1568
1568
|
render() {
|
|
1569
1569
|
const n = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
|
|
1570
|
-
return
|
|
1570
|
+
return u`
|
|
1571
1571
|
<div class="threads">
|
|
1572
|
-
${n.length === 0 ?
|
|
1572
|
+
${n.length === 0 ? u`<div class="empty">
|
|
1573
1573
|
<div class="empty-icon">💬</div>
|
|
1574
1574
|
No comments yet.<br>Start a conversation below.
|
|
1575
1575
|
</div>` : n.map((e) => this.renderThread(e))}
|
|
@@ -1583,12 +1583,12 @@ let X = class extends P {
|
|
|
1583
1583
|
`;
|
|
1584
1584
|
}
|
|
1585
1585
|
renderThread(n) {
|
|
1586
|
-
return
|
|
1586
|
+
return u`
|
|
1587
1587
|
<div class="thread ${n.resolved ? "resolved" : ""}">
|
|
1588
1588
|
${n.comments.map((e, t) => {
|
|
1589
1589
|
const i = this.getUserForComment(e.userId);
|
|
1590
|
-
return
|
|
1591
|
-
${t > 0 ?
|
|
1590
|
+
return u`
|
|
1591
|
+
${t > 0 ? u`<div class="divider"></div>` : b}
|
|
1592
1592
|
<div class="comment">
|
|
1593
1593
|
<div class="comment-header">
|
|
1594
1594
|
<div
|
|
@@ -1620,12 +1620,12 @@ let X = class extends P {
|
|
|
1620
1620
|
${n.resolved ? "Reopen" : "Resolve"}
|
|
1621
1621
|
</button>
|
|
1622
1622
|
</div>
|
|
1623
|
-
${this.replyingTo === n.id ?
|
|
1623
|
+
${this.replyingTo === n.id ? u`
|
|
1624
1624
|
<form class="reply-form" @submit=${(e) => this.handleReply(n.id, e)}>
|
|
1625
1625
|
<input type="text" placeholder="Write a reply..." />
|
|
1626
1626
|
<button type="submit">Send</button>
|
|
1627
1627
|
</form>
|
|
1628
|
-
` :
|
|
1628
|
+
` : b}
|
|
1629
1629
|
</div>
|
|
1630
1630
|
`;
|
|
1631
1631
|
}
|
|
@@ -1637,7 +1637,7 @@ let X = class extends P {
|
|
|
1637
1637
|
return o < 24 ? `${o}h ago` : e.toLocaleDateString();
|
|
1638
1638
|
}
|
|
1639
1639
|
};
|
|
1640
|
-
|
|
1640
|
+
Y.styles = M`
|
|
1641
1641
|
:host {
|
|
1642
1642
|
display: block;
|
|
1643
1643
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -1849,41 +1849,41 @@ X.styles = O`
|
|
|
1849
1849
|
opacity: 0.4;
|
|
1850
1850
|
}
|
|
1851
1851
|
`;
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
],
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
],
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
],
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
],
|
|
1865
|
-
|
|
1852
|
+
ge([
|
|
1853
|
+
fe({ context: Q, subscribe: !0 }),
|
|
1854
|
+
x({ attribute: !1 })
|
|
1855
|
+
], Y.prototype, "client", 2);
|
|
1856
|
+
ge([
|
|
1857
|
+
x({ type: Boolean, attribute: "show-resolved" })
|
|
1858
|
+
], Y.prototype, "showResolved", 2);
|
|
1859
|
+
ge([
|
|
1860
|
+
$()
|
|
1861
|
+
], Y.prototype, "threads", 2);
|
|
1862
|
+
ge([
|
|
1863
|
+
$()
|
|
1864
|
+
], Y.prototype, "replyingTo", 2);
|
|
1865
|
+
Y = ge([
|
|
1866
1866
|
L("pulse-comments")
|
|
1867
|
-
],
|
|
1868
|
-
var
|
|
1869
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1867
|
+
], Y);
|
|
1868
|
+
var gi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
|
|
1869
|
+
for (var s = i > 1 ? void 0 : i ? bi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1870
1870
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1871
|
-
return i && s &&
|
|
1871
|
+
return i && s && gi(e, t, s), s;
|
|
1872
1872
|
};
|
|
1873
|
-
const
|
|
1873
|
+
const vi = {
|
|
1874
1874
|
"comment:created": "left a comment",
|
|
1875
1875
|
"comment:mention": "mentioned you",
|
|
1876
1876
|
"comment:reply": "replied to your comment",
|
|
1877
1877
|
"thread:resolved": "resolved a thread",
|
|
1878
1878
|
"reaction:added": "reacted to your comment"
|
|
1879
|
-
},
|
|
1879
|
+
}, xi = {
|
|
1880
1880
|
"comment:created": "💬",
|
|
1881
1881
|
"comment:mention": "📣",
|
|
1882
1882
|
"comment:reply": "↩️",
|
|
1883
1883
|
"thread:resolved": "✅",
|
|
1884
1884
|
"reaction:added": "🎉"
|
|
1885
1885
|
};
|
|
1886
|
-
let
|
|
1886
|
+
let he = class extends P {
|
|
1887
1887
|
constructor() {
|
|
1888
1888
|
super(...arguments), this.notifications = [];
|
|
1889
1889
|
}
|
|
@@ -1930,31 +1930,31 @@ let de = class extends P {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
render() {
|
|
1932
1932
|
const n = this.notifications.filter((e) => !e.read).length;
|
|
1933
|
-
return
|
|
1933
|
+
return u`
|
|
1934
1934
|
<div class="header">
|
|
1935
1935
|
<span class="title">
|
|
1936
1936
|
Notifications
|
|
1937
|
-
${n > 0 ?
|
|
1937
|
+
${n > 0 ? u`<span class="badge">${n}</span>` : b}
|
|
1938
1938
|
</span>
|
|
1939
|
-
${n > 0 ?
|
|
1939
|
+
${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
1940
1940
|
Mark all read
|
|
1941
|
-
</button>` :
|
|
1941
|
+
</button>` : b}
|
|
1942
1942
|
</div>
|
|
1943
1943
|
<div class="list">
|
|
1944
|
-
${this.notifications.length === 0 ?
|
|
1944
|
+
${this.notifications.length === 0 ? u`<div class="empty">
|
|
1945
1945
|
<div class="empty-icon">🔔</div>
|
|
1946
1946
|
No notifications yet
|
|
1947
1947
|
</div>` : this.notifications.map(
|
|
1948
|
-
(e) =>
|
|
1948
|
+
(e) => u`
|
|
1949
1949
|
<div
|
|
1950
1950
|
class="item ${e.read ? "" : "unread"}"
|
|
1951
1951
|
@click=${() => this.handleClick(e)}
|
|
1952
1952
|
>
|
|
1953
|
-
<span class="icon">${
|
|
1953
|
+
<span class="icon">${xi[e.type] ?? "🔔"}</span>
|
|
1954
1954
|
<div class="content">
|
|
1955
1955
|
<div class="text">
|
|
1956
1956
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
1957
|
-
${
|
|
1957
|
+
${vi[e.type] ?? e.type}
|
|
1958
1958
|
</div>
|
|
1959
1959
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
1960
1960
|
</div>
|
|
@@ -1966,7 +1966,7 @@ let de = class extends P {
|
|
|
1966
1966
|
`;
|
|
1967
1967
|
}
|
|
1968
1968
|
};
|
|
1969
|
-
|
|
1969
|
+
he.styles = M`
|
|
1970
1970
|
:host {
|
|
1971
1971
|
display: block;
|
|
1972
1972
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -2107,23 +2107,23 @@ de.styles = O`
|
|
|
2107
2107
|
opacity: 0.4;
|
|
2108
2108
|
}
|
|
2109
2109
|
`;
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
],
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
],
|
|
2117
|
-
|
|
2110
|
+
Ve([
|
|
2111
|
+
fe({ context: Q, subscribe: !0 }),
|
|
2112
|
+
x({ attribute: !1 })
|
|
2113
|
+
], he.prototype, "client", 2);
|
|
2114
|
+
Ve([
|
|
2115
|
+
$()
|
|
2116
|
+
], he.prototype, "notifications", 2);
|
|
2117
|
+
he = Ve([
|
|
2118
2118
|
L("pulse-notifications")
|
|
2119
|
-
],
|
|
2120
|
-
var
|
|
2121
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
2119
|
+
], he);
|
|
2120
|
+
var yi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, te = (n, e, t, i) => {
|
|
2121
|
+
for (var s = i > 1 ? void 0 : i ? wi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
2122
2122
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
2123
|
-
return i && s &&
|
|
2123
|
+
return i && s && yi(e, t, s), s;
|
|
2124
2124
|
};
|
|
2125
|
-
const
|
|
2126
|
-
let
|
|
2125
|
+
const $i = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
2126
|
+
let B = class extends P {
|
|
2127
2127
|
constructor() {
|
|
2128
2128
|
super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
|
|
2129
2129
|
}
|
|
@@ -2163,9 +2163,9 @@ let H = class extends P {
|
|
|
2163
2163
|
}
|
|
2164
2164
|
render() {
|
|
2165
2165
|
const n = this.groupReactions();
|
|
2166
|
-
return
|
|
2166
|
+
return u`
|
|
2167
2167
|
${n.map(
|
|
2168
|
-
(e) =>
|
|
2168
|
+
(e) => u`
|
|
2169
2169
|
<button
|
|
2170
2170
|
class="reaction ${e.userReactionId ? "active" : ""}"
|
|
2171
2171
|
@click=${() => this.toggleReaction(e)}
|
|
@@ -2182,22 +2182,22 @@ let H = class extends P {
|
|
|
2182
2182
|
>
|
|
2183
2183
|
+
|
|
2184
2184
|
</button>
|
|
2185
|
-
${this.showPicker ?
|
|
2185
|
+
${this.showPicker ? u`
|
|
2186
2186
|
<div class="picker">
|
|
2187
|
-
${
|
|
2188
|
-
(e) =>
|
|
2187
|
+
${$i.map(
|
|
2188
|
+
(e) => u`
|
|
2189
2189
|
<button @click=${() => this.addEmoji(e)}>
|
|
2190
2190
|
${e}
|
|
2191
2191
|
</button>
|
|
2192
2192
|
`
|
|
2193
2193
|
)}
|
|
2194
2194
|
</div>
|
|
2195
|
-
` :
|
|
2195
|
+
` : b}
|
|
2196
2196
|
</div>
|
|
2197
2197
|
`;
|
|
2198
2198
|
}
|
|
2199
2199
|
};
|
|
2200
|
-
|
|
2200
|
+
B.styles = M`
|
|
2201
2201
|
:host {
|
|
2202
2202
|
display: inline-flex;
|
|
2203
2203
|
align-items: center;
|
|
@@ -2309,32 +2309,32 @@ H.styles = O`
|
|
|
2309
2309
|
transform: scale(1.2);
|
|
2310
2310
|
}
|
|
2311
2311
|
`;
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
],
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
],
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
],
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
],
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
],
|
|
2328
|
-
|
|
2312
|
+
te([
|
|
2313
|
+
fe({ context: Q, subscribe: !0 }),
|
|
2314
|
+
x({ attribute: !1 })
|
|
2315
|
+
], B.prototype, "client", 2);
|
|
2316
|
+
te([
|
|
2317
|
+
x({ attribute: "target-id" })
|
|
2318
|
+
], B.prototype, "targetId", 2);
|
|
2319
|
+
te([
|
|
2320
|
+
x({ attribute: "target-type" })
|
|
2321
|
+
], B.prototype, "targetType", 2);
|
|
2322
|
+
te([
|
|
2323
|
+
$()
|
|
2324
|
+
], B.prototype, "reactions", 2);
|
|
2325
|
+
te([
|
|
2326
|
+
$()
|
|
2327
|
+
], B.prototype, "showPicker", 2);
|
|
2328
|
+
B = te([
|
|
2329
2329
|
L("pulse-reactions")
|
|
2330
|
-
],
|
|
2330
|
+
], B);
|
|
2331
2331
|
/**
|
|
2332
2332
|
* @license
|
|
2333
2333
|
* Copyright 2017 Google LLC
|
|
2334
2334
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2335
2335
|
*/
|
|
2336
|
-
const
|
|
2337
|
-
class
|
|
2336
|
+
const ki = { CHILD: 2 }, Ei = (n) => (...e) => ({ _$litDirective$: n, values: e });
|
|
2337
|
+
class Ci {
|
|
2338
2338
|
constructor(e) {
|
|
2339
2339
|
}
|
|
2340
2340
|
get _$AU() {
|
|
@@ -2355,13 +2355,13 @@ class ki {
|
|
|
2355
2355
|
* Copyright 2017 Google LLC
|
|
2356
2356
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2357
2357
|
*/
|
|
2358
|
-
class
|
|
2358
|
+
class Re extends Ci {
|
|
2359
2359
|
constructor(e) {
|
|
2360
|
-
if (super(e), this.it =
|
|
2360
|
+
if (super(e), this.it = b, e.type !== ki.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2361
2361
|
}
|
|
2362
2362
|
render(e) {
|
|
2363
|
-
if (e ===
|
|
2364
|
-
if (e ===
|
|
2363
|
+
if (e === b || e == null) return this._t = void 0, this.it = e;
|
|
2364
|
+
if (e === W) return e;
|
|
2365
2365
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
2366
2366
|
if (e === this.it) return this._t;
|
|
2367
2367
|
this.it = e;
|
|
@@ -2369,23 +2369,23 @@ class Oe extends ki {
|
|
|
2369
2369
|
return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
|
-
|
|
2372
|
+
Re.directiveName = "unsafeHTML", Re.resultType = 1;
|
|
2373
2373
|
/**
|
|
2374
2374
|
* @license
|
|
2375
2375
|
* Copyright 2017 Google LLC
|
|
2376
2376
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2377
2377
|
*/
|
|
2378
|
-
class
|
|
2378
|
+
class Le extends Re {
|
|
2379
2379
|
}
|
|
2380
|
-
|
|
2381
|
-
const
|
|
2380
|
+
Le.directiveName = "unsafeSVG", Le.resultType = 2;
|
|
2381
|
+
const Ti = Ei(Le);
|
|
2382
2382
|
/**
|
|
2383
2383
|
* @license lucide v0.577.0 - ISC
|
|
2384
2384
|
*
|
|
2385
2385
|
* This source code is licensed under the ISC license.
|
|
2386
2386
|
* See the LICENSE file in the root directory of this source tree.
|
|
2387
2387
|
*/
|
|
2388
|
-
const
|
|
2388
|
+
const Si = [
|
|
2389
2389
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0" }],
|
|
2390
2390
|
[
|
|
2391
2391
|
"path",
|
|
@@ -2400,7 +2400,7 @@ const Ci = [
|
|
|
2400
2400
|
* This source code is licensed under the ISC license.
|
|
2401
2401
|
* See the LICENSE file in the root directory of this source tree.
|
|
2402
2402
|
*/
|
|
2403
|
-
const
|
|
2403
|
+
const Pi = [
|
|
2404
2404
|
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
2405
2405
|
["path", { d: "M12 6v6l4 2" }]
|
|
2406
2406
|
];
|
|
@@ -2410,7 +2410,7 @@ const Ti = [
|
|
|
2410
2410
|
* This source code is licensed under the ISC license.
|
|
2411
2411
|
* See the LICENSE file in the root directory of this source tree.
|
|
2412
2412
|
*/
|
|
2413
|
-
const
|
|
2413
|
+
const Ai = [
|
|
2414
2414
|
[
|
|
2415
2415
|
"path",
|
|
2416
2416
|
{
|
|
@@ -2424,7 +2424,7 @@ const _i = [
|
|
|
2424
2424
|
* This source code is licensed under the ISC license.
|
|
2425
2425
|
* See the LICENSE file in the root directory of this source tree.
|
|
2426
2426
|
*/
|
|
2427
|
-
const
|
|
2427
|
+
const _i = [
|
|
2428
2428
|
["path", { d: "M12 19v3" }],
|
|
2429
2429
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }],
|
|
2430
2430
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" }]
|
|
@@ -2435,7 +2435,7 @@ const Si = [
|
|
|
2435
2435
|
* This source code is licensed under the ISC license.
|
|
2436
2436
|
* See the LICENSE file in the root directory of this source tree.
|
|
2437
2437
|
*/
|
|
2438
|
-
const
|
|
2438
|
+
const Ii = [
|
|
2439
2439
|
[
|
|
2440
2440
|
"path",
|
|
2441
2441
|
{
|
|
@@ -2449,7 +2449,7 @@ const Pi = [
|
|
|
2449
2449
|
* This source code is licensed under the ISC license.
|
|
2450
2450
|
* See the LICENSE file in the root directory of this source tree.
|
|
2451
2451
|
*/
|
|
2452
|
-
const
|
|
2452
|
+
const Mi = [
|
|
2453
2453
|
[
|
|
2454
2454
|
"path",
|
|
2455
2455
|
{
|
|
@@ -2471,7 +2471,7 @@ const Ai = [
|
|
|
2471
2471
|
* This source code is licensed under the ISC license.
|
|
2472
2472
|
* See the LICENSE file in the root directory of this source tree.
|
|
2473
2473
|
*/
|
|
2474
|
-
const
|
|
2474
|
+
const Oi = [
|
|
2475
2475
|
[
|
|
2476
2476
|
"path",
|
|
2477
2477
|
{
|
|
@@ -2486,7 +2486,7 @@ const Ii = [
|
|
|
2486
2486
|
* This source code is licensed under the ISC license.
|
|
2487
2487
|
* See the LICENSE file in the root directory of this source tree.
|
|
2488
2488
|
*/
|
|
2489
|
-
const
|
|
2489
|
+
const At = [
|
|
2490
2490
|
["path", { d: "M12 17v5" }],
|
|
2491
2491
|
[
|
|
2492
2492
|
"path",
|
|
@@ -2501,7 +2501,7 @@ const St = [
|
|
|
2501
2501
|
* This source code is licensed under the ISC license.
|
|
2502
2502
|
* See the LICENSE file in the root directory of this source tree.
|
|
2503
2503
|
*/
|
|
2504
|
-
const
|
|
2504
|
+
const Ri = [
|
|
2505
2505
|
[
|
|
2506
2506
|
"path",
|
|
2507
2507
|
{
|
|
@@ -2516,7 +2516,7 @@ const Mi = [
|
|
|
2516
2516
|
* This source code is licensed under the ISC license.
|
|
2517
2517
|
* See the LICENSE file in the root directory of this source tree.
|
|
2518
2518
|
*/
|
|
2519
|
-
const
|
|
2519
|
+
const Li = [
|
|
2520
2520
|
["path", { d: "M10 11v6" }],
|
|
2521
2521
|
["path", { d: "M14 11v6" }],
|
|
2522
2522
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }],
|
|
@@ -2529,7 +2529,7 @@ const Oi = [
|
|
|
2529
2529
|
* This source code is licensed under the ISC license.
|
|
2530
2530
|
* See the LICENSE file in the root directory of this source tree.
|
|
2531
2531
|
*/
|
|
2532
|
-
const
|
|
2532
|
+
const ji = [
|
|
2533
2533
|
["path", { d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" }],
|
|
2534
2534
|
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
|
|
2535
2535
|
];
|
|
@@ -2539,7 +2539,7 @@ const Ri = [
|
|
|
2539
2539
|
* This source code is licensed under the ISC license.
|
|
2540
2540
|
* See the LICENSE file in the root directory of this source tree.
|
|
2541
2541
|
*/
|
|
2542
|
-
const
|
|
2542
|
+
const be = [
|
|
2543
2543
|
["path", { d: "M18 6 6 18" }],
|
|
2544
2544
|
["path", { d: "m6 6 12 12" }]
|
|
2545
2545
|
];
|
|
@@ -2549,7 +2549,7 @@ const ge = [
|
|
|
2549
2549
|
* This source code is licensed under the ISC license.
|
|
2550
2550
|
* See the LICENSE file in the root directory of this source tree.
|
|
2551
2551
|
*/
|
|
2552
|
-
const
|
|
2552
|
+
const zi = [
|
|
2553
2553
|
[
|
|
2554
2554
|
"path",
|
|
2555
2555
|
{
|
|
@@ -2557,14 +2557,14 @@ const Li = [
|
|
|
2557
2557
|
}
|
|
2558
2558
|
]
|
|
2559
2559
|
];
|
|
2560
|
-
function
|
|
2560
|
+
function Ui(n) {
|
|
2561
2561
|
return n.map(([e, t]) => {
|
|
2562
2562
|
const i = Object.entries(t).filter(([, s]) => s != null).map(([s, o]) => `${s}="${o}"`).join(" ");
|
|
2563
2563
|
return `<${e} ${i}/>`;
|
|
2564
2564
|
}).join("");
|
|
2565
2565
|
}
|
|
2566
2566
|
function C(n, e = 18) {
|
|
2567
|
-
return
|
|
2567
|
+
return Zt`<svg
|
|
2568
2568
|
xmlns="http://www.w3.org/2000/svg"
|
|
2569
2569
|
width="${e}"
|
|
2570
2570
|
height="${e}"
|
|
@@ -2574,9 +2574,9 @@ function C(n, e = 18) {
|
|
|
2574
2574
|
stroke-width="2"
|
|
2575
2575
|
stroke-linecap="round"
|
|
2576
2576
|
stroke-linejoin="round"
|
|
2577
|
-
>${
|
|
2577
|
+
>${Ti(Ui(n))}</svg>`;
|
|
2578
2578
|
}
|
|
2579
|
-
const
|
|
2579
|
+
const ie = M`
|
|
2580
2580
|
* {
|
|
2581
2581
|
box-sizing: border-box;
|
|
2582
2582
|
margin: 0;
|
|
@@ -2619,7 +2619,7 @@ const te = O`
|
|
|
2619
2619
|
--pw-shadow: var(--pulse-shadow);
|
|
2620
2620
|
--pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
2621
2621
|
}
|
|
2622
|
-
`,
|
|
2622
|
+
`, ve = M`
|
|
2623
2623
|
.pw-btn {
|
|
2624
2624
|
display: inline-flex;
|
|
2625
2625
|
align-items: center;
|
|
@@ -2663,7 +2663,7 @@ const te = O`
|
|
|
2663
2663
|
width: 18px;
|
|
2664
2664
|
height: 18px;
|
|
2665
2665
|
}
|
|
2666
|
-
`,
|
|
2666
|
+
`, Ae = M`
|
|
2667
2667
|
.pw-scrollable::-webkit-scrollbar {
|
|
2668
2668
|
width: 4px;
|
|
2669
2669
|
}
|
|
@@ -2675,12 +2675,12 @@ const te = O`
|
|
|
2675
2675
|
background: transparent;
|
|
2676
2676
|
}
|
|
2677
2677
|
`;
|
|
2678
|
-
var
|
|
2679
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
2678
|
+
var Di = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
|
|
2679
|
+
for (var s = i > 1 ? void 0 : i ? Hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
2680
2680
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
2681
|
-
return i && s &&
|
|
2681
|
+
return i && s && Di(e, t, s), s;
|
|
2682
2682
|
};
|
|
2683
|
-
let
|
|
2683
|
+
let K = class extends P {
|
|
2684
2684
|
constructor() {
|
|
2685
2685
|
super(...arguments), this.items = [], this.unsubs = [], this.counter = 0;
|
|
2686
2686
|
}
|
|
@@ -2709,7 +2709,7 @@ let Y = class extends P {
|
|
|
2709
2709
|
userId: n.userId,
|
|
2710
2710
|
description: n.description,
|
|
2711
2711
|
timestamp: new Date(n.createdAt).getTime(),
|
|
2712
|
-
color:
|
|
2712
|
+
color: K.TYPE_COLORS[n.type] ?? "#94a3b8"
|
|
2713
2713
|
};
|
|
2714
2714
|
}
|
|
2715
2715
|
getUserName(n) {
|
|
@@ -2726,18 +2726,18 @@ let Y = class extends P {
|
|
|
2726
2726
|
);
|
|
2727
2727
|
}
|
|
2728
2728
|
render() {
|
|
2729
|
-
return
|
|
2729
|
+
return u`
|
|
2730
2730
|
<div class="panel">
|
|
2731
2731
|
<div class="panel-header">
|
|
2732
2732
|
<span class="panel-title">Activity</span>
|
|
2733
2733
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
2734
|
-
${C(
|
|
2734
|
+
${C(be, 16)}
|
|
2735
2735
|
</button>
|
|
2736
2736
|
</div>
|
|
2737
2737
|
|
|
2738
2738
|
<div class="panel-body pw-scrollable">
|
|
2739
|
-
${this.items.length === 0 ?
|
|
2740
|
-
(n) =>
|
|
2739
|
+
${this.items.length === 0 ? u`<div class="empty">No activity yet</div>` : this.items.map(
|
|
2740
|
+
(n) => u`
|
|
2741
2741
|
<div class="activity-item">
|
|
2742
2742
|
<div
|
|
2743
2743
|
class="activity-dot"
|
|
@@ -2745,7 +2745,7 @@ let Y = class extends P {
|
|
|
2745
2745
|
></div>
|
|
2746
2746
|
<div class="activity-content">
|
|
2747
2747
|
<div class="activity-text">
|
|
2748
|
-
${n.userId ?
|
|
2748
|
+
${n.userId ? u`<span class="activity-user"
|
|
2749
2749
|
>${this.getUserName(n.userId)}</span
|
|
2750
2750
|
>
|
|
2751
2751
|
${n.description}` : n.description}
|
|
@@ -2762,11 +2762,11 @@ let Y = class extends P {
|
|
|
2762
2762
|
`;
|
|
2763
2763
|
}
|
|
2764
2764
|
};
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2765
|
+
K.styles = [
|
|
2766
|
+
ie,
|
|
2767
|
+
ve,
|
|
2768
|
+
Ae,
|
|
2769
|
+
M`
|
|
2770
2770
|
:host {
|
|
2771
2771
|
display: block;
|
|
2772
2772
|
}
|
|
@@ -2884,28 +2884,28 @@ Y.styles = [
|
|
|
2884
2884
|
}
|
|
2885
2885
|
`
|
|
2886
2886
|
];
|
|
2887
|
-
|
|
2887
|
+
K.TYPE_COLORS = {
|
|
2888
2888
|
join: "#22c55e",
|
|
2889
2889
|
leave: "#94a3b8",
|
|
2890
2890
|
thread: "var(--pw-accent, #6366f1)",
|
|
2891
2891
|
comment: "#3b82f6",
|
|
2892
2892
|
resolve: "#22c55e"
|
|
2893
2893
|
};
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
],
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
],
|
|
2900
|
-
|
|
2894
|
+
We([
|
|
2895
|
+
x({ attribute: !1 })
|
|
2896
|
+
], K.prototype, "client", 2);
|
|
2897
|
+
We([
|
|
2898
|
+
$()
|
|
2899
|
+
], K.prototype, "items", 2);
|
|
2900
|
+
K = We([
|
|
2901
2901
|
L("pulse-widget-activity-panel")
|
|
2902
|
-
],
|
|
2903
|
-
const
|
|
2904
|
-
function
|
|
2902
|
+
], K);
|
|
2903
|
+
const Bi = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", lt = "#6366f1", ct = "#e2e8f0", Ni = "#f8fafc", Fi = "#e2e8f0", dt = "#64748b", we = 28, qi = Array.from({ length: we }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
|
|
2904
|
+
function ht(n) {
|
|
2905
2905
|
const e = Math.max(0, Math.floor(n)), t = Math.floor(e / 60), i = e % 60;
|
|
2906
2906
|
return `${t}:${i.toString().padStart(2, "0")}`;
|
|
2907
2907
|
}
|
|
2908
|
-
class
|
|
2908
|
+
class je {
|
|
2909
2909
|
/**
|
|
2910
2910
|
* Create and return a fully self-contained inline audio player element.
|
|
2911
2911
|
*
|
|
@@ -2918,31 +2918,31 @@ class Le {
|
|
|
2918
2918
|
let i = !1, s = t != null ? t / 1e3 : 0, o = 0;
|
|
2919
2919
|
const r = document.createElement("audio");
|
|
2920
2920
|
r.preload = "metadata", r.src = e;
|
|
2921
|
-
const
|
|
2922
|
-
Object.assign(
|
|
2921
|
+
const a = document.createElement("div");
|
|
2922
|
+
Object.assign(a.style, {
|
|
2923
2923
|
display: "inline-flex",
|
|
2924
2924
|
alignItems: "center",
|
|
2925
2925
|
gap: "10px",
|
|
2926
2926
|
width: "220px",
|
|
2927
2927
|
height: "44px",
|
|
2928
2928
|
padding: "0 10px",
|
|
2929
|
-
background:
|
|
2929
|
+
background: Ni,
|
|
2930
2930
|
borderRadius: "12px",
|
|
2931
|
-
border: `1px solid ${
|
|
2932
|
-
fontFamily:
|
|
2931
|
+
border: `1px solid ${Fi}`,
|
|
2932
|
+
fontFamily: Bi,
|
|
2933
2933
|
fontSize: "11px",
|
|
2934
|
-
color:
|
|
2934
|
+
color: dt,
|
|
2935
2935
|
userSelect: "none",
|
|
2936
2936
|
boxSizing: "border-box"
|
|
2937
2937
|
});
|
|
2938
|
-
const
|
|
2939
|
-
Object.assign(
|
|
2938
|
+
const l = document.createElement("button");
|
|
2939
|
+
Object.assign(l.style, {
|
|
2940
2940
|
width: "28px",
|
|
2941
2941
|
height: "28px",
|
|
2942
2942
|
minWidth: "28px",
|
|
2943
2943
|
borderRadius: "50%",
|
|
2944
2944
|
border: "none",
|
|
2945
|
-
background:
|
|
2945
|
+
background: lt,
|
|
2946
2946
|
cursor: "pointer",
|
|
2947
2947
|
display: "flex",
|
|
2948
2948
|
alignItems: "center",
|
|
@@ -2951,27 +2951,27 @@ class Le {
|
|
|
2951
2951
|
outline: "none",
|
|
2952
2952
|
flexShrink: "0"
|
|
2953
2953
|
});
|
|
2954
|
-
const
|
|
2955
|
-
Object.assign(
|
|
2954
|
+
const d = document.createElement("span");
|
|
2955
|
+
Object.assign(d.style, {
|
|
2956
2956
|
display: "block",
|
|
2957
2957
|
width: "10px",
|
|
2958
2958
|
height: "12px",
|
|
2959
2959
|
lineHeight: "0"
|
|
2960
2960
|
});
|
|
2961
|
-
function
|
|
2962
|
-
|
|
2961
|
+
function c() {
|
|
2962
|
+
d.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2963
2963
|
<path d="M1 1L9 6L1 11V1Z" fill="white" stroke="white" stroke-width="1" stroke-linejoin="round"/>
|
|
2964
2964
|
</svg>`;
|
|
2965
2965
|
}
|
|
2966
|
-
function
|
|
2967
|
-
|
|
2966
|
+
function h() {
|
|
2967
|
+
d.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2968
2968
|
<rect x="1" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
|
|
2969
2969
|
<rect x="6.5" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
|
|
2970
2970
|
</svg>`;
|
|
2971
2971
|
}
|
|
2972
|
-
|
|
2973
|
-
const
|
|
2974
|
-
Object.assign(
|
|
2972
|
+
c(), l.appendChild(d);
|
|
2973
|
+
const p = document.createElement("div");
|
|
2974
|
+
Object.assign(p.style, {
|
|
2975
2975
|
flex: "1",
|
|
2976
2976
|
display: "flex",
|
|
2977
2977
|
flexDirection: "column",
|
|
@@ -2979,69 +2979,69 @@ class Le {
|
|
|
2979
2979
|
overflow: "hidden",
|
|
2980
2980
|
minWidth: "0"
|
|
2981
2981
|
});
|
|
2982
|
-
const
|
|
2983
|
-
Object.assign(
|
|
2982
|
+
const m = document.createElement("div");
|
|
2983
|
+
Object.assign(m.style, {
|
|
2984
2984
|
display: "flex",
|
|
2985
2985
|
alignItems: "center",
|
|
2986
2986
|
gap: "1.5px",
|
|
2987
2987
|
height: "22px",
|
|
2988
2988
|
cursor: "pointer"
|
|
2989
2989
|
});
|
|
2990
|
-
const
|
|
2991
|
-
for (let E = 0; E <
|
|
2992
|
-
const
|
|
2993
|
-
Object.assign(
|
|
2990
|
+
const g = [];
|
|
2991
|
+
for (let E = 0; E < we; E++) {
|
|
2992
|
+
const I = document.createElement("div"), z = Math.round(qi[E] * 20);
|
|
2993
|
+
Object.assign(I.style, {
|
|
2994
2994
|
flex: "1",
|
|
2995
|
-
height: `${Math.max(3,
|
|
2995
|
+
height: `${Math.max(3, z)}px`,
|
|
2996
2996
|
borderRadius: "1px",
|
|
2997
|
-
background:
|
|
2997
|
+
background: ct,
|
|
2998
2998
|
transition: "background 0.1s ease",
|
|
2999
2999
|
minWidth: "0"
|
|
3000
|
-
}),
|
|
3000
|
+
}), g.push(I), m.appendChild(I);
|
|
3001
3001
|
}
|
|
3002
|
-
const
|
|
3003
|
-
Object.assign(
|
|
3002
|
+
const y = document.createElement("div");
|
|
3003
|
+
Object.assign(y.style, {
|
|
3004
3004
|
fontSize: "10px",
|
|
3005
|
-
color:
|
|
3005
|
+
color: dt,
|
|
3006
3006
|
whiteSpace: "nowrap",
|
|
3007
3007
|
lineHeight: "1"
|
|
3008
3008
|
});
|
|
3009
|
-
function
|
|
3010
|
-
const E =
|
|
3011
|
-
|
|
3009
|
+
function v() {
|
|
3010
|
+
const E = ht(o), I = ht(s);
|
|
3011
|
+
y.textContent = `${E} / ${I}`;
|
|
3012
3012
|
}
|
|
3013
|
-
|
|
3014
|
-
function
|
|
3015
|
-
const E = s > 0 ? o / s : 0,
|
|
3016
|
-
for (let
|
|
3017
|
-
|
|
3013
|
+
v(), p.appendChild(m), p.appendChild(y), a.appendChild(l), a.appendChild(p);
|
|
3014
|
+
function w() {
|
|
3015
|
+
const E = s > 0 ? o / s : 0, I = Math.floor(E * we);
|
|
3016
|
+
for (let z = 0; z < we; z++)
|
|
3017
|
+
g[z].style.background = z <= I ? lt : ct;
|
|
3018
3018
|
}
|
|
3019
|
-
return
|
|
3019
|
+
return m.addEventListener("click", (E) => {
|
|
3020
3020
|
if (s <= 0) return;
|
|
3021
|
-
const
|
|
3021
|
+
const I = m.getBoundingClientRect(), z = Math.min(
|
|
3022
3022
|
1,
|
|
3023
|
-
Math.max(0, (E.clientX -
|
|
3023
|
+
Math.max(0, (E.clientX - I.left) / I.width)
|
|
3024
3024
|
);
|
|
3025
|
-
r.currentTime =
|
|
3026
|
-
}),
|
|
3025
|
+
r.currentTime = z * s, o = r.currentTime, w(), v();
|
|
3026
|
+
}), l.addEventListener("click", () => {
|
|
3027
3027
|
i ? r.pause() : r.play().catch(() => {
|
|
3028
3028
|
});
|
|
3029
3029
|
}), r.addEventListener("play", () => {
|
|
3030
|
-
i = !0,
|
|
3030
|
+
i = !0, h();
|
|
3031
3031
|
}), r.addEventListener("pause", () => {
|
|
3032
|
-
i = !1,
|
|
3032
|
+
i = !1, c();
|
|
3033
3033
|
}), r.addEventListener("ended", () => {
|
|
3034
|
-
i = !1,
|
|
3034
|
+
i = !1, c(), o = 0, w(), v();
|
|
3035
3035
|
}), r.addEventListener("timeupdate", () => {
|
|
3036
|
-
o = r.currentTime,
|
|
3036
|
+
o = r.currentTime, w(), v();
|
|
3037
3037
|
}), r.addEventListener("loadedmetadata", () => {
|
|
3038
|
-
r.duration && isFinite(r.duration) && (s = r.duration,
|
|
3038
|
+
r.duration && isFinite(r.duration) && (s = r.duration, v());
|
|
3039
3039
|
}), r.addEventListener("durationchange", () => {
|
|
3040
|
-
r.duration && isFinite(r.duration) && (s = r.duration,
|
|
3041
|
-
}),
|
|
3040
|
+
r.duration && isFinite(r.duration) && (s = r.duration, v());
|
|
3041
|
+
}), a;
|
|
3042
3042
|
}
|
|
3043
3043
|
}
|
|
3044
|
-
class
|
|
3044
|
+
class ze {
|
|
3045
3045
|
constructor() {
|
|
3046
3046
|
this.container = null, this.stream = null, this.recorder = null, this.analyser = null, this.audioCtx = null, this.recording = !1, this.animFrame = null, this.startTime = 0, this.maxDuration = 12e4, this.maxTimer = null, this.canvas = null, this.timerEl = null, this.resolve = null, this.animate = () => {
|
|
3047
3047
|
this.recording && (this.drawWaveform(), this.updateTimer(), this.animFrame = requestAnimationFrame(this.animate));
|
|
@@ -3058,16 +3058,16 @@ class je {
|
|
|
3058
3058
|
const i = this.detectMimeType(), s = {};
|
|
3059
3059
|
i && (s.mimeType = i), this.recorder = new MediaRecorder(this.stream, s);
|
|
3060
3060
|
const o = [];
|
|
3061
|
-
this.recorder.ondataavailable = (
|
|
3062
|
-
|
|
3061
|
+
this.recorder.ondataavailable = (a) => {
|
|
3062
|
+
a.data.size > 0 && o.push(a.data);
|
|
3063
3063
|
}, this.buildUI(e);
|
|
3064
|
-
const r = new Promise((
|
|
3065
|
-
this.resolve =
|
|
3064
|
+
const r = new Promise((a) => {
|
|
3065
|
+
this.resolve = a;
|
|
3066
3066
|
});
|
|
3067
3067
|
return this.recorder.onstop = () => {
|
|
3068
|
-
var
|
|
3069
|
-
const
|
|
3070
|
-
(
|
|
3068
|
+
var d, c;
|
|
3069
|
+
const a = ((d = this.recorder) == null ? void 0 : d.mimeType) || i || "audio/webm", l = new Blob(o, { type: a });
|
|
3070
|
+
(c = this.resolve) == null || c.call(this, l), this.resolve = null, this.cleanupResources();
|
|
3071
3071
|
}, this.recorder.start(), this.recording = !0, this.startTime = Date.now(), this.maxTimer = setTimeout(() => {
|
|
3072
3072
|
this.stopRecording();
|
|
3073
3073
|
}, this.maxDuration), this.animate(), r;
|
|
@@ -3170,10 +3170,10 @@ class je {
|
|
|
3170
3170
|
if (!e) return;
|
|
3171
3171
|
const t = this.canvas.width, i = this.canvas.height, s = this.analyser.frequencyBinCount, o = new Uint8Array(s);
|
|
3172
3172
|
this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
|
|
3173
|
-
const r = s,
|
|
3174
|
-
for (let
|
|
3175
|
-
const
|
|
3176
|
-
e.fillStyle = `rgba(99, 102, 241, ${
|
|
3173
|
+
const r = s, a = Math.max(2, t / r * 0.7), l = (t - a * r) / (r - 1 || 1);
|
|
3174
|
+
for (let d = 0; d < r; d++) {
|
|
3175
|
+
const c = o[d] / 255, h = Math.max(2, c * i * 0.85), p = d * (a + l), m = (i - h) / 2, g = 0.4 + c * 0.6;
|
|
3176
|
+
e.fillStyle = `rgba(99, 102, 241, ${g})`, e.beginPath(), e.roundRect(p, m, a, h, 1), e.fill();
|
|
3177
3177
|
}
|
|
3178
3178
|
}
|
|
3179
3179
|
updateTimer() {
|
|
@@ -3191,7 +3191,7 @@ class je {
|
|
|
3191
3191
|
this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
|
-
const
|
|
3194
|
+
const Vi = 180, Wi = 120, Xi = "#e2e8f0", Yi = `
|
|
3195
3195
|
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3196
3196
|
<circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
|
|
3197
3197
|
<polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
|
|
@@ -3200,18 +3200,18 @@ const ht = 80, Bi = "#e2e8f0", qi = `
|
|
|
3200
3200
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3201
3201
|
<line x1="23" y1="9" x2="17" y2="15"/>
|
|
3202
3202
|
<line x1="17" y1="9" x2="23" y2="15"/>
|
|
3203
|
-
</svg>`,
|
|
3203
|
+
</svg>`, Ki = `
|
|
3204
3204
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
|
3205
3205
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3206
3206
|
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
|
|
3207
3207
|
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
|
|
3208
|
-
</svg>`,
|
|
3208
|
+
</svg>`, Gi = `
|
|
3209
3209
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
|
3210
3210
|
<polyline points="15,3 21,3 21,9"/><line x1="21" y1="3" x2="14" y2="10"/>
|
|
3211
3211
|
<polyline points="9,21 3,21 3,15"/><line x1="3" y1="21" x2="10" y2="14"/>
|
|
3212
|
-
</svg>`,
|
|
3212
|
+
</svg>`, S = class S {
|
|
3213
3213
|
/**
|
|
3214
|
-
* Renders an inline
|
|
3214
|
+
* Renders an inline rectangular video player and returns the root container.
|
|
3215
3215
|
* @param url - Video source URL
|
|
3216
3216
|
* @param posterUrl - Optional poster/thumbnail image URL
|
|
3217
3217
|
*/
|
|
@@ -3221,10 +3221,10 @@ const ht = 80, Bi = "#e2e8f0", qi = `
|
|
|
3221
3221
|
Object.assign(o.style, {
|
|
3222
3222
|
position: "relative",
|
|
3223
3223
|
display: "inline-block",
|
|
3224
|
-
width: `${
|
|
3225
|
-
height: `${
|
|
3226
|
-
borderRadius: "
|
|
3227
|
-
border: `
|
|
3224
|
+
width: `${Vi}px`,
|
|
3225
|
+
height: `${Wi}px`,
|
|
3226
|
+
borderRadius: "8px",
|
|
3227
|
+
border: `1px solid ${Xi}`,
|
|
3228
3228
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
3229
3229
|
overflow: "hidden",
|
|
3230
3230
|
cursor: "pointer",
|
|
@@ -3238,10 +3238,10 @@ const ht = 80, Bi = "#e2e8f0", qi = `
|
|
|
3238
3238
|
height: "100%",
|
|
3239
3239
|
objectFit: "cover",
|
|
3240
3240
|
display: "block",
|
|
3241
|
-
borderRadius: "
|
|
3241
|
+
borderRadius: "8px"
|
|
3242
3242
|
}), r.src = e, r.loop = !0, r.muted = !0, r.playsInline = !0, r.preload = "metadata", t && (r.poster = t), o.appendChild(r);
|
|
3243
|
-
const
|
|
3244
|
-
Object.assign(
|
|
3243
|
+
const a = document.createElement("div");
|
|
3244
|
+
Object.assign(a.style, {
|
|
3245
3245
|
position: "absolute",
|
|
3246
3246
|
top: "0",
|
|
3247
3247
|
left: "0",
|
|
@@ -3250,13 +3250,13 @@ const ht = 80, Bi = "#e2e8f0", qi = `
|
|
|
3250
3250
|
display: "flex",
|
|
3251
3251
|
alignItems: "center",
|
|
3252
3252
|
justifyContent: "center",
|
|
3253
|
-
borderRadius: "
|
|
3253
|
+
borderRadius: "8px",
|
|
3254
3254
|
transition: "opacity 0.25s ease",
|
|
3255
3255
|
opacity: "1",
|
|
3256
3256
|
pointerEvents: "none"
|
|
3257
|
-
}),
|
|
3258
|
-
const
|
|
3259
|
-
Object.assign(
|
|
3257
|
+
}), a.innerHTML = Yi, o.appendChild(a);
|
|
3258
|
+
const l = document.createElement("div");
|
|
3259
|
+
Object.assign(l.style, {
|
|
3260
3260
|
position: "absolute",
|
|
3261
3261
|
bottom: "2px",
|
|
3262
3262
|
right: "2px",
|
|
@@ -3269,9 +3269,9 @@ const ht = 80, Bi = "#e2e8f0", qi = `
|
|
|
3269
3269
|
justifyContent: "center",
|
|
3270
3270
|
pointerEvents: "none",
|
|
3271
3271
|
transition: "opacity 0.2s ease"
|
|
3272
|
-
}),
|
|
3273
|
-
const
|
|
3274
|
-
Object.assign(
|
|
3272
|
+
}), l.innerHTML = pt, o.appendChild(l);
|
|
3273
|
+
const d = document.createElement("div");
|
|
3274
|
+
Object.assign(d.style, {
|
|
3275
3275
|
position: "absolute",
|
|
3276
3276
|
top: "2px",
|
|
3277
3277
|
right: "2px",
|
|
@@ -3285,28 +3285,28 @@ const ht = 80, Bi = "#e2e8f0", qi = `
|
|
|
3285
3285
|
cursor: "pointer",
|
|
3286
3286
|
pointerEvents: "auto",
|
|
3287
3287
|
transition: "opacity 0.2s ease, background 0.15s ease"
|
|
3288
|
-
}),
|
|
3289
|
-
|
|
3290
|
-
}),
|
|
3291
|
-
|
|
3292
|
-
}),
|
|
3293
|
-
|
|
3294
|
-
}), o.appendChild(
|
|
3295
|
-
function
|
|
3296
|
-
|
|
3288
|
+
}), d.innerHTML = Gi, d.title = "Fullscreen", d.addEventListener("mouseenter", () => {
|
|
3289
|
+
d.style.background = "rgba(0,0,0,0.7)";
|
|
3290
|
+
}), d.addEventListener("mouseleave", () => {
|
|
3291
|
+
d.style.background = "rgba(0,0,0,0.45)";
|
|
3292
|
+
}), d.addEventListener("click", (p) => {
|
|
3293
|
+
p.stopPropagation(), S.openFullscreen(e, t);
|
|
3294
|
+
}), o.appendChild(d);
|
|
3295
|
+
function c() {
|
|
3296
|
+
a.style.opacity = i ? "0" : "1";
|
|
3297
3297
|
}
|
|
3298
|
-
function
|
|
3299
|
-
|
|
3298
|
+
function h() {
|
|
3299
|
+
l.style.display = i ? "flex" : "none", l.innerHTML = s ? pt : Ki, d.style.display = i ? "flex" : "none";
|
|
3300
3300
|
}
|
|
3301
|
-
return o.addEventListener("click", (
|
|
3302
|
-
|
|
3303
|
-
}), i = !0),
|
|
3301
|
+
return o.addEventListener("click", (p) => {
|
|
3302
|
+
p.stopPropagation(), i ? s ? (r.muted = !1, s = !1) : (r.pause(), i = !1, s = !0, r.muted = !0) : (r.muted = !0, s = !0, r.play().catch(() => {
|
|
3303
|
+
}), i = !0), c(), h();
|
|
3304
3304
|
}), r.addEventListener("pause", () => {
|
|
3305
|
-
i && (i = !1, s = !0, r.muted = !0,
|
|
3305
|
+
i && (i = !1, s = !0, r.muted = !0, c(), h());
|
|
3306
3306
|
}), o;
|
|
3307
3307
|
}
|
|
3308
3308
|
static openFullscreen(e, t) {
|
|
3309
|
-
|
|
3309
|
+
S.closeFullscreen();
|
|
3310
3310
|
const i = document.createElement("div");
|
|
3311
3311
|
Object.assign(i.style, {
|
|
3312
3312
|
position: "fixed",
|
|
@@ -3347,8 +3347,8 @@ const ht = 80, Bi = "#e2e8f0", qi = `
|
|
|
3347
3347
|
s.style.background = "rgba(255,255,255,0.3)";
|
|
3348
3348
|
}), s.addEventListener("mouseleave", () => {
|
|
3349
3349
|
s.style.background = "rgba(255,255,255,0.15)";
|
|
3350
|
-
}), s.addEventListener("click", (
|
|
3351
|
-
|
|
3350
|
+
}), s.addEventListener("click", (a) => {
|
|
3351
|
+
a.stopPropagation(), S.closeFullscreen();
|
|
3352
3352
|
});
|
|
3353
3353
|
const o = document.createElement("video");
|
|
3354
3354
|
Object.assign(o.style, {
|
|
@@ -3357,25 +3357,25 @@ const ht = 80, Bi = "#e2e8f0", qi = `
|
|
|
3357
3357
|
borderRadius: "8px",
|
|
3358
3358
|
outline: "none",
|
|
3359
3359
|
cursor: "default"
|
|
3360
|
-
}), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (
|
|
3361
|
-
const r = (
|
|
3362
|
-
|
|
3360
|
+
}), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (a) => a.stopPropagation()), i.appendChild(s), i.appendChild(o), i.addEventListener("click", () => S.closeFullscreen());
|
|
3361
|
+
const r = (a) => {
|
|
3362
|
+
a.key === "Escape" && S.closeFullscreen();
|
|
3363
3363
|
};
|
|
3364
|
-
document.addEventListener("keydown", r),
|
|
3364
|
+
document.addEventListener("keydown", r), S.fullscreenOverlay = i, S.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
|
|
3365
3365
|
i.style.opacity = "1";
|
|
3366
3366
|
});
|
|
3367
3367
|
}
|
|
3368
3368
|
static closeFullscreen() {
|
|
3369
|
-
if (!
|
|
3370
|
-
const e =
|
|
3371
|
-
|
|
3369
|
+
if (!S.fullscreenOverlay) return;
|
|
3370
|
+
const e = S.fullscreenOverlay;
|
|
3371
|
+
S.fullscreenKeyHandler && (document.removeEventListener("keydown", S.fullscreenKeyHandler), S.fullscreenKeyHandler = null);
|
|
3372
3372
|
const t = e.querySelector("video");
|
|
3373
|
-
t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()),
|
|
3373
|
+
t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), S.fullscreenOverlay = null;
|
|
3374
3374
|
}
|
|
3375
3375
|
};
|
|
3376
|
-
|
|
3377
|
-
let
|
|
3378
|
-
const ut = 60,
|
|
3376
|
+
S.fullscreenOverlay = null, S.fullscreenKeyHandler = null;
|
|
3377
|
+
let Ce = S;
|
|
3378
|
+
const ut = 60, Ji = `
|
|
3379
3379
|
.vr-overlay {
|
|
3380
3380
|
display: flex;
|
|
3381
3381
|
flex-direction: column;
|
|
@@ -3485,11 +3485,11 @@ const ut = 60, Xi = `
|
|
|
3485
3485
|
function ft(n) {
|
|
3486
3486
|
return n.toString().padStart(2, "0");
|
|
3487
3487
|
}
|
|
3488
|
-
function
|
|
3488
|
+
function Zi(n) {
|
|
3489
3489
|
const e = Math.floor(n / 60), t = n % 60;
|
|
3490
3490
|
return `${ft(e)}:${ft(t)}`;
|
|
3491
3491
|
}
|
|
3492
|
-
function
|
|
3492
|
+
function Qi() {
|
|
3493
3493
|
const n = [
|
|
3494
3494
|
"video/webm;codecs=vp9,opus",
|
|
3495
3495
|
"video/webm;codecs=vp8,opus",
|
|
@@ -3500,7 +3500,7 @@ function Ki() {
|
|
|
3500
3500
|
if (MediaRecorder.isTypeSupported(e)) return e;
|
|
3501
3501
|
return "";
|
|
3502
3502
|
}
|
|
3503
|
-
function
|
|
3503
|
+
function es(n) {
|
|
3504
3504
|
return new Promise((e, t) => {
|
|
3505
3505
|
const i = URL.createObjectURL(n), s = document.createElement("video");
|
|
3506
3506
|
s.muted = !0, s.playsInline = !0, s.preload = "auto", s.src = i, s.addEventListener("loadeddata", () => {
|
|
@@ -3508,8 +3508,8 @@ function Gi(n) {
|
|
|
3508
3508
|
}), s.addEventListener("seeked", () => {
|
|
3509
3509
|
const o = document.createElement("canvas");
|
|
3510
3510
|
o.width = s.videoWidth || 240, o.height = s.videoHeight || 240, o.getContext("2d").drawImage(s, 0, 0, o.width, o.height), URL.revokeObjectURL(i), o.toBlob(
|
|
3511
|
-
(
|
|
3512
|
-
|
|
3511
|
+
(a) => {
|
|
3512
|
+
a ? e(a) : t(new Error("Failed to generate poster frame"));
|
|
3513
3513
|
},
|
|
3514
3514
|
"image/jpeg",
|
|
3515
3515
|
0.85
|
|
@@ -3519,7 +3519,7 @@ function Gi(n) {
|
|
|
3519
3519
|
}), s.load();
|
|
3520
3520
|
});
|
|
3521
3521
|
}
|
|
3522
|
-
class
|
|
3522
|
+
class Ue {
|
|
3523
3523
|
constructor() {
|
|
3524
3524
|
this.recording = !1, this.container = null, this.stream = null, this.mediaRecorder = null, this.chunks = [], this.timerInterval = null, this.elapsed = 0, this.resolvePromise = null, this.root = null, this.styleEl = null, this.videoEl = null, this.timerEl = null;
|
|
3525
3525
|
}
|
|
@@ -3536,7 +3536,7 @@ class ze {
|
|
|
3536
3536
|
}
|
|
3537
3537
|
this.stream = t, this.container = e, this.recording = !0, this.elapsed = 0, this.chunks = [], this.buildUI(e), this.videoEl && (this.videoEl.srcObject = t, this.videoEl.play().catch(() => {
|
|
3538
3538
|
}));
|
|
3539
|
-
const i =
|
|
3539
|
+
const i = Qi(), s = {};
|
|
3540
3540
|
i && (s.mimeType = i);
|
|
3541
3541
|
const o = new MediaRecorder(t, s);
|
|
3542
3542
|
return this.mediaRecorder = o, o.ondataavailable = (r) => {
|
|
@@ -3561,7 +3561,7 @@ class ze {
|
|
|
3561
3561
|
}
|
|
3562
3562
|
// ── Private ──
|
|
3563
3563
|
buildUI(e) {
|
|
3564
|
-
this.styleEl = document.createElement("style"), this.styleEl.textContent =
|
|
3564
|
+
this.styleEl = document.createElement("style"), this.styleEl.textContent = Ji, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
|
|
3565
3565
|
const t = document.createElement("div");
|
|
3566
3566
|
t.className = "vr-circle-wrapper";
|
|
3567
3567
|
const i = document.createElement("div");
|
|
@@ -3572,24 +3572,24 @@ class ze {
|
|
|
3572
3572
|
o.className = "vr-actions";
|
|
3573
3573
|
const r = document.createElement("button");
|
|
3574
3574
|
r.className = "vr-btn vr-btn-stop", r.textContent = "Stop", r.addEventListener("click", () => this.stopRecording()), o.appendChild(r);
|
|
3575
|
-
const
|
|
3576
|
-
|
|
3575
|
+
const a = document.createElement("button");
|
|
3576
|
+
a.className = "vr-btn vr-btn-cancel", a.textContent = "Cancel", a.addEventListener("click", () => this.cancelRecording()), o.appendChild(a), this.root.appendChild(o), e.appendChild(this.root);
|
|
3577
3577
|
}
|
|
3578
3578
|
updateTimer() {
|
|
3579
3579
|
if (!this.timerEl) return;
|
|
3580
3580
|
const e = ut - this.elapsed;
|
|
3581
|
-
this.timerEl.textContent =
|
|
3581
|
+
this.timerEl.textContent = Zi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
|
|
3582
3582
|
}
|
|
3583
3583
|
async handleRecordingComplete() {
|
|
3584
3584
|
var s, o;
|
|
3585
3585
|
const e = ((s = this.mediaRecorder) == null ? void 0 : s.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
|
|
3586
3586
|
let i;
|
|
3587
3587
|
try {
|
|
3588
|
-
i = await
|
|
3588
|
+
i = await es(t);
|
|
3589
3589
|
} catch {
|
|
3590
3590
|
const r = document.createElement("canvas");
|
|
3591
|
-
r.width = 1, r.height = 1, i = await new Promise((
|
|
3592
|
-
r.toBlob((
|
|
3591
|
+
r.width = 1, r.height = 1, i = await new Promise((a) => {
|
|
3592
|
+
r.toBlob((l) => a(l), "image/png");
|
|
3593
3593
|
});
|
|
3594
3594
|
}
|
|
3595
3595
|
this.cleanup(), (o = this.resolvePromise) == null || o.call(this, { blob: t, posterBlob: i }), this.resolvePromise = null;
|
|
@@ -3608,12 +3608,35 @@ class ze {
|
|
|
3608
3608
|
this.videoEl && (this.videoEl.srcObject = null, this.videoEl = null), this.root && this.root.parentElement && this.root.parentElement.removeChild(this.root), this.root = null, this.styleEl && this.styleEl.parentElement && this.styleEl.parentElement.removeChild(this.styleEl), this.styleEl = null, this.chunks = [], this.elapsed = 0;
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
|
-
const
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3611
|
+
const mt = {
|
|
3612
|
+
position: "absolute",
|
|
3613
|
+
top: "50%",
|
|
3614
|
+
transform: "translateY(-50%)",
|
|
3615
|
+
width: "44px",
|
|
3616
|
+
height: "44px",
|
|
3617
|
+
border: "none",
|
|
3618
|
+
borderRadius: "50%",
|
|
3619
|
+
background: "rgba(255,255,255,0.15)",
|
|
3620
|
+
color: "#fff",
|
|
3621
|
+
fontSize: "22px",
|
|
3622
|
+
cursor: "pointer",
|
|
3623
|
+
padding: "0",
|
|
3624
|
+
display: "flex",
|
|
3625
|
+
alignItems: "center",
|
|
3626
|
+
justifyContent: "center",
|
|
3627
|
+
transition: "background 150ms ease",
|
|
3628
|
+
zIndex: "1"
|
|
3629
|
+
}, f = class f {
|
|
3630
|
+
/**
|
|
3631
|
+
* Opens a fullscreen lightbox overlay.
|
|
3632
|
+
* @param imageUrl - Single image URL (backwards-compatible)
|
|
3633
|
+
* @param allUrls - Optional array of all image URLs for navigation
|
|
3634
|
+
* @param startIndex - Index in allUrls to start at (default 0)
|
|
3635
|
+
*/
|
|
3636
|
+
static open(e, t, i) {
|
|
3637
|
+
f.close(), f.urls = t && t.length > 1 ? t : [e], f.currentIndex = i ?? 0;
|
|
3638
|
+
const s = f.urls.length > 1, o = document.createElement("div");
|
|
3639
|
+
o.id = "pulse-widget-lightbox", Object.assign(o.style, {
|
|
3617
3640
|
position: "fixed",
|
|
3618
3641
|
top: "0",
|
|
3619
3642
|
left: "0",
|
|
@@ -3629,8 +3652,8 @@ const S = class S {
|
|
|
3629
3652
|
cursor: "pointer",
|
|
3630
3653
|
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
|
|
3631
3654
|
});
|
|
3632
|
-
const
|
|
3633
|
-
|
|
3655
|
+
const r = document.createElement("button");
|
|
3656
|
+
r.textContent = "×", Object.assign(r.style, {
|
|
3634
3657
|
position: "absolute",
|
|
3635
3658
|
top: "16px",
|
|
3636
3659
|
right: "16px",
|
|
@@ -3641,54 +3664,86 @@ const S = class S {
|
|
|
3641
3664
|
background: "rgba(255,255,255,0.15)",
|
|
3642
3665
|
color: "#fff",
|
|
3643
3666
|
fontSize: "24px",
|
|
3644
|
-
lineHeight: "40px",
|
|
3645
|
-
textAlign: "center",
|
|
3646
3667
|
cursor: "pointer",
|
|
3647
3668
|
padding: "0",
|
|
3648
|
-
fontFamily: "inherit",
|
|
3649
3669
|
display: "flex",
|
|
3650
3670
|
alignItems: "center",
|
|
3651
3671
|
justifyContent: "center",
|
|
3652
|
-
transition: "background 150ms ease"
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3672
|
+
transition: "background 150ms ease",
|
|
3673
|
+
zIndex: "1"
|
|
3674
|
+
}), r.addEventListener("mouseenter", () => {
|
|
3675
|
+
r.style.background = "rgba(255,255,255,0.3)";
|
|
3676
|
+
}), r.addEventListener("mouseleave", () => {
|
|
3677
|
+
r.style.background = "rgba(255,255,255,0.15)";
|
|
3678
|
+
}), r.addEventListener("click", (d) => {
|
|
3679
|
+
d.stopPropagation(), f.close();
|
|
3680
|
+
}), o.appendChild(r);
|
|
3681
|
+
const a = document.createElement("img");
|
|
3682
|
+
if (a.src = f.urls[f.currentIndex], a.alt = "Lightbox image", Object.assign(a.style, {
|
|
3662
3683
|
maxWidth: "90vw",
|
|
3663
|
-
maxHeight: "
|
|
3684
|
+
maxHeight: "85vh",
|
|
3664
3685
|
borderRadius: "8px",
|
|
3665
3686
|
objectFit: "contain",
|
|
3666
3687
|
cursor: "default",
|
|
3667
|
-
userSelect: "none"
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3688
|
+
userSelect: "none",
|
|
3689
|
+
transition: "opacity 150ms ease"
|
|
3690
|
+
}), a.addEventListener("click", (d) => d.stopPropagation()), o.appendChild(a), f.imgEl = a, s) {
|
|
3691
|
+
const d = document.createElement("button");
|
|
3692
|
+
d.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15,18 9,12 15,6"/></svg>', Object.assign(d.style, { ...mt, left: "16px" }), d.addEventListener("mouseenter", () => {
|
|
3693
|
+
d.style.background = "rgba(255,255,255,0.3)";
|
|
3694
|
+
}), d.addEventListener("mouseleave", () => {
|
|
3695
|
+
d.style.background = "rgba(255,255,255,0.15)";
|
|
3696
|
+
}), d.addEventListener("click", (p) => {
|
|
3697
|
+
p.stopPropagation(), f.navigate(-1);
|
|
3698
|
+
}), o.appendChild(d), f.prevBtn = d;
|
|
3699
|
+
const c = document.createElement("button");
|
|
3700
|
+
c.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9,18 15,12 9,6"/></svg>', Object.assign(c.style, { ...mt, right: "16px" }), c.addEventListener("mouseenter", () => {
|
|
3701
|
+
c.style.background = "rgba(255,255,255,0.3)";
|
|
3702
|
+
}), c.addEventListener("mouseleave", () => {
|
|
3703
|
+
c.style.background = "rgba(255,255,255,0.15)";
|
|
3704
|
+
}), c.addEventListener("click", (p) => {
|
|
3705
|
+
p.stopPropagation(), f.navigate(1);
|
|
3706
|
+
}), o.appendChild(c), f.nextBtn = c;
|
|
3707
|
+
const h = document.createElement("span");
|
|
3708
|
+
Object.assign(h.style, {
|
|
3709
|
+
position: "absolute",
|
|
3710
|
+
bottom: "20px",
|
|
3711
|
+
left: "50%",
|
|
3712
|
+
transform: "translateX(-50%)",
|
|
3713
|
+
color: "rgba(255,255,255,0.7)",
|
|
3714
|
+
fontSize: "13px",
|
|
3715
|
+
fontWeight: "500",
|
|
3716
|
+
pointerEvents: "none"
|
|
3717
|
+
}), o.appendChild(h), f.counterEl = h, f.updateNav();
|
|
3718
|
+
}
|
|
3719
|
+
o.addEventListener("click", () => f.close());
|
|
3720
|
+
const l = (d) => {
|
|
3721
|
+
d.key === "Escape" && f.close(), s && d.key === "ArrowLeft" && f.navigate(-1), s && d.key === "ArrowRight" && f.navigate(1);
|
|
3675
3722
|
};
|
|
3676
|
-
document.addEventListener("keydown",
|
|
3677
|
-
|
|
3723
|
+
document.addEventListener("keydown", l), f.overlay = o, f.onKeyDown = l, document.body.appendChild(o), requestAnimationFrame(() => {
|
|
3724
|
+
o.style.opacity = "1";
|
|
3678
3725
|
});
|
|
3679
3726
|
}
|
|
3727
|
+
static navigate(e) {
|
|
3728
|
+
const t = f.urls.length;
|
|
3729
|
+
f.currentIndex = (f.currentIndex + e + t) % t, f.imgEl && (f.imgEl.style.opacity = "0", setTimeout(() => {
|
|
3730
|
+
f.imgEl && (f.imgEl.src = f.urls[f.currentIndex], f.imgEl.style.opacity = "1");
|
|
3731
|
+
}, 100)), f.updateNav();
|
|
3732
|
+
}
|
|
3733
|
+
static updateNav() {
|
|
3734
|
+
const e = f.currentIndex, t = f.urls.length;
|
|
3735
|
+
f.counterEl && (f.counterEl.textContent = `${e + 1} / ${t}`);
|
|
3736
|
+
}
|
|
3680
3737
|
/** Closes the lightbox if open. */
|
|
3681
3738
|
static close() {
|
|
3682
|
-
if (!
|
|
3683
|
-
const e =
|
|
3684
|
-
|
|
3685
|
-
e.remove();
|
|
3686
|
-
}), S.overlay = null;
|
|
3739
|
+
if (!f.overlay) return;
|
|
3740
|
+
const e = f.overlay;
|
|
3741
|
+
f.onKeyDown && (document.removeEventListener("keydown", f.onKeyDown), f.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), f.overlay = null, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null, f.urls = [], f.currentIndex = 0;
|
|
3687
3742
|
}
|
|
3688
3743
|
};
|
|
3689
|
-
|
|
3690
|
-
let
|
|
3691
|
-
class
|
|
3744
|
+
f.overlay = null, f.onKeyDown = null, f.urls = [], f.currentIndex = 0, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null;
|
|
3745
|
+
let Te = f;
|
|
3746
|
+
class re {
|
|
3692
3747
|
constructor(e) {
|
|
3693
3748
|
this.uploading = !1, this.client = e, this.input = document.createElement("input"), this.input.type = "file", this.input.style.display = "none", document.body.appendChild(this.input);
|
|
3694
3749
|
}
|
|
@@ -3702,19 +3757,19 @@ class oe {
|
|
|
3702
3757
|
const i = () => {
|
|
3703
3758
|
o(), t(null);
|
|
3704
3759
|
}, s = async () => {
|
|
3705
|
-
var
|
|
3760
|
+
var a;
|
|
3706
3761
|
o();
|
|
3707
|
-
const r = (
|
|
3762
|
+
const r = (a = this.input.files) == null ? void 0 : a[0];
|
|
3708
3763
|
if (!r) {
|
|
3709
3764
|
t(null);
|
|
3710
3765
|
return;
|
|
3711
3766
|
}
|
|
3712
3767
|
this.uploading = !0;
|
|
3713
3768
|
try {
|
|
3714
|
-
const
|
|
3715
|
-
t(
|
|
3716
|
-
} catch (
|
|
3717
|
-
console.error("[Pulse] File upload failed:",
|
|
3769
|
+
const l = await this.client.uploadFile(r);
|
|
3770
|
+
t(l);
|
|
3771
|
+
} catch (l) {
|
|
3772
|
+
console.error("[Pulse] File upload failed:", l), t(null);
|
|
3718
3773
|
} finally {
|
|
3719
3774
|
this.uploading = !1;
|
|
3720
3775
|
}
|
|
@@ -3735,24 +3790,24 @@ class oe {
|
|
|
3735
3790
|
r(), i([]);
|
|
3736
3791
|
}, o = async () => {
|
|
3737
3792
|
r();
|
|
3738
|
-
const
|
|
3739
|
-
if (!
|
|
3793
|
+
const a = this.input.files;
|
|
3794
|
+
if (!a || a.length === 0) {
|
|
3740
3795
|
i([]);
|
|
3741
3796
|
return;
|
|
3742
3797
|
}
|
|
3743
|
-
const
|
|
3798
|
+
const l = Array.from(a).slice(0, t);
|
|
3744
3799
|
this.uploading = !0;
|
|
3745
3800
|
try {
|
|
3746
|
-
const
|
|
3747
|
-
|
|
3801
|
+
const d = await Promise.all(
|
|
3802
|
+
l.map(async (c) => {
|
|
3748
3803
|
try {
|
|
3749
|
-
return await this.client.uploadFile(
|
|
3750
|
-
} catch (
|
|
3751
|
-
return console.error("[Pulse] File upload failed:",
|
|
3804
|
+
return await this.client.uploadFile(c);
|
|
3805
|
+
} catch (h) {
|
|
3806
|
+
return console.error("[Pulse] File upload failed:", h), null;
|
|
3752
3807
|
}
|
|
3753
3808
|
})
|
|
3754
3809
|
);
|
|
3755
|
-
i(
|
|
3810
|
+
i(d.filter((c) => c !== null));
|
|
3756
3811
|
} finally {
|
|
3757
3812
|
this.uploading = !1, this.input.multiple = !1;
|
|
3758
3813
|
}
|
|
@@ -3782,7 +3837,7 @@ class oe {
|
|
|
3782
3837
|
this.input.remove();
|
|
3783
3838
|
}
|
|
3784
3839
|
}
|
|
3785
|
-
const
|
|
3840
|
+
const ts = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", is = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>', ss = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>', gt = `<button class="pulse-close-btn" style="
|
|
3786
3841
|
border:none;background:none;cursor:pointer;color:#94a3b8;padding:4px;
|
|
3787
3842
|
border-radius:6px;display:flex;align-items:center;justify-content:center;
|
|
3788
3843
|
transition:all 0.15s;flex-shrink:0;
|
|
@@ -3790,7 +3845,7 @@ const Zi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], ve = "-apple-syst
|
|
|
3790
3845
|
onmouseout="this.style.background='none';this.style.color='#94a3b8'">
|
|
3791
3846
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
|
3792
3847
|
</button>`;
|
|
3793
|
-
class
|
|
3848
|
+
class ns {
|
|
3794
3849
|
constructor(e, t = {}) {
|
|
3795
3850
|
this.container = null, this.overlay = null, this.form = null, this.popover = null, this.threads = [], this.pinEls = /* @__PURE__ */ new Map(), this._pinModeActive = !1, this.editingPopoverCommentId = null, this.popoverPickerOpen = null, this.lastTypingSendPins = /* @__PURE__ */ new Map(), this.repositionDebounce = null, this.mutationObserver = null, this.upload = null, this.audioRecorder = null, this.videoRecorder = null, this.pendingAttachmentIds = [], this.handleReposition = () => {
|
|
3796
3851
|
this.repositionDebounce || (this.repositionDebounce = setTimeout(() => {
|
|
@@ -3813,13 +3868,13 @@ class es {
|
|
|
3813
3868
|
y: i.clientY / o,
|
|
3814
3869
|
scrollX: window.scrollX,
|
|
3815
3870
|
scrollY: window.scrollY
|
|
3816
|
-
},
|
|
3871
|
+
}, a = this.overlay.style.pointerEvents;
|
|
3817
3872
|
this.overlay.style.pointerEvents = "none";
|
|
3818
|
-
const
|
|
3819
|
-
if (this.overlay.style.pointerEvents =
|
|
3820
|
-
r.selector = this.getSelector(
|
|
3821
|
-
const
|
|
3822
|
-
|
|
3873
|
+
const l = document.elementFromPoint(i.clientX, i.clientY);
|
|
3874
|
+
if (this.overlay.style.pointerEvents = a, l) {
|
|
3875
|
+
r.selector = this.getSelector(l);
|
|
3876
|
+
const d = l.getBoundingClientRect();
|
|
3877
|
+
d.width > 0 && d.height > 0 && (r.elementOffsetX = (i.clientX - d.left) / d.width, r.elementOffsetY = (i.clientY - d.top) / d.height);
|
|
3823
3878
|
}
|
|
3824
3879
|
this.showPinForm(i.clientX, i.clientY, r);
|
|
3825
3880
|
}, this.pickerEl = null, this.client = e, this.onPinModeExit = t.onPinModeExit, this.init();
|
|
@@ -3897,14 +3952,14 @@ class es {
|
|
|
3897
3952
|
t.unshift(`#${i.id}`);
|
|
3898
3953
|
break;
|
|
3899
3954
|
}
|
|
3900
|
-
const s = i.tagName.toLowerCase(), o = [...i.classList].filter((
|
|
3955
|
+
const s = i.tagName.toLowerCase(), o = [...i.classList].filter((l) => !l.startsWith("pulse-")).slice(0, 2);
|
|
3901
3956
|
let r = o.length > 0 ? `${s}.${o.join(".")}` : s;
|
|
3902
|
-
const
|
|
3903
|
-
if (
|
|
3904
|
-
const
|
|
3905
|
-
if (
|
|
3906
|
-
const
|
|
3907
|
-
r += `:nth-child(${
|
|
3957
|
+
const a = i.parentElement;
|
|
3958
|
+
if (a) {
|
|
3959
|
+
const l = [...a.children].filter((d) => d.tagName === i.tagName);
|
|
3960
|
+
if (l.length > 1) {
|
|
3961
|
+
const d = l.indexOf(i) + 1;
|
|
3962
|
+
r += `:nth-child(${d})`;
|
|
3908
3963
|
}
|
|
3909
3964
|
}
|
|
3910
3965
|
if (t.unshift(r), i = i.parentElement, t.length >= 4) break;
|
|
@@ -3914,11 +3969,11 @@ class es {
|
|
|
3914
3969
|
showPinForm(e, t, i) {
|
|
3915
3970
|
this.form = document.createElement("div");
|
|
3916
3971
|
const s = Math.min(280, window.innerWidth - 32), o = 120;
|
|
3917
|
-
let r = e + 16,
|
|
3918
|
-
r + s > window.innerWidth - 16 && (r = e - s - 16),
|
|
3972
|
+
let r = e + 16, a = t - 10;
|
|
3973
|
+
r + s > window.innerWidth - 16 && (r = e - s - 16), a + o > window.innerHeight - 16 && (a = window.innerHeight - o - 16), a < 16 && (a = 16), Object.assign(this.form.style, {
|
|
3919
3974
|
position: "fixed",
|
|
3920
3975
|
left: `${r}px`,
|
|
3921
|
-
top: `${
|
|
3976
|
+
top: `${a}px`,
|
|
3922
3977
|
width: `${s}px`,
|
|
3923
3978
|
zIndex: "10001",
|
|
3924
3979
|
background: "#fff",
|
|
@@ -3926,11 +3981,11 @@ class es {
|
|
|
3926
3981
|
boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
|
|
3927
3982
|
border: "1px solid #e2e8f0",
|
|
3928
3983
|
padding: "14px",
|
|
3929
|
-
fontFamily:
|
|
3984
|
+
fontFamily: xe
|
|
3930
3985
|
}), this.form.innerHTML = `
|
|
3931
3986
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">
|
|
3932
3987
|
<span style="font-size:13px;font-weight:600;color:#0f172a;">Add a comment here</span>
|
|
3933
|
-
${
|
|
3988
|
+
${gt}
|
|
3934
3989
|
</div>
|
|
3935
3990
|
<textarea
|
|
3936
3991
|
placeholder="Write a comment..."
|
|
@@ -3962,13 +4017,13 @@ class es {
|
|
|
3962
4017
|
</div>
|
|
3963
4018
|
<div class="pin-attachments-preview" style="margin-top:6px;display:flex;flex-wrap:wrap;gap:6px;"></div>
|
|
3964
4019
|
`;
|
|
3965
|
-
const
|
|
3966
|
-
|
|
3967
|
-
const
|
|
3968
|
-
const
|
|
3969
|
-
Object.assign(
|
|
3970
|
-
const
|
|
3971
|
-
|
|
4020
|
+
const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit");
|
|
4021
|
+
d.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
|
|
4022
|
+
const h = this.form.querySelector(".pin-attachments-preview"), p = (g, y) => {
|
|
4023
|
+
const v = document.createElement("div");
|
|
4024
|
+
Object.assign(v.style, { position: "relative", display: "inline-block" }), v.appendChild(y);
|
|
4025
|
+
const w = document.createElement("button");
|
|
4026
|
+
w.innerHTML = "×", Object.assign(w.style, {
|
|
3972
4027
|
position: "absolute",
|
|
3973
4028
|
top: "-4px",
|
|
3974
4029
|
right: "-4px",
|
|
@@ -3986,62 +4041,62 @@ class es {
|
|
|
3986
4041
|
justifyContent: "center",
|
|
3987
4042
|
padding: "0",
|
|
3988
4043
|
fontWeight: "700"
|
|
3989
|
-
}),
|
|
3990
|
-
const E = this.pendingAttachmentIds.indexOf(
|
|
3991
|
-
E !== -1 && this.pendingAttachmentIds.splice(E, 1),
|
|
3992
|
-
}),
|
|
3993
|
-
},
|
|
4044
|
+
}), w.addEventListener("click", () => {
|
|
4045
|
+
const E = this.pendingAttachmentIds.indexOf(g);
|
|
4046
|
+
E !== -1 && this.pendingAttachmentIds.splice(E, 1), v.remove();
|
|
4047
|
+
}), v.appendChild(w), h.appendChild(v);
|
|
4048
|
+
}, m = 5;
|
|
3994
4049
|
this.form.querySelector(".attach-img").addEventListener("click", async () => {
|
|
3995
|
-
const
|
|
3996
|
-
if (
|
|
3997
|
-
const
|
|
3998
|
-
for (const
|
|
3999
|
-
this.pendingAttachmentIds.push(
|
|
4000
|
-
const
|
|
4001
|
-
|
|
4050
|
+
const g = m - this.pendingAttachmentIds.length;
|
|
4051
|
+
if (g <= 0) return;
|
|
4052
|
+
const y = await this.upload.pickFiles("image/*", g);
|
|
4053
|
+
for (const v of y) {
|
|
4054
|
+
this.pendingAttachmentIds.push(v.id);
|
|
4055
|
+
const w = document.createElement("img");
|
|
4056
|
+
w.src = v.thumbnailUrl || v.url, Object.assign(w.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), p(v.id, w);
|
|
4002
4057
|
}
|
|
4003
4058
|
}), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
|
|
4004
|
-
if (this.pendingAttachmentIds.length >=
|
|
4005
|
-
this.audioRecorder || (this.audioRecorder = new
|
|
4006
|
-
const
|
|
4007
|
-
if (
|
|
4008
|
-
const
|
|
4009
|
-
if (
|
|
4010
|
-
this.pendingAttachmentIds.push(
|
|
4011
|
-
const
|
|
4012
|
-
Object.assign(
|
|
4059
|
+
if (this.pendingAttachmentIds.length >= m) return;
|
|
4060
|
+
this.audioRecorder || (this.audioRecorder = new ze());
|
|
4061
|
+
const g = await this.audioRecorder.startRecording(h);
|
|
4062
|
+
if (g) {
|
|
4063
|
+
const y = await this.upload.uploadBlob(g, "audio.webm");
|
|
4064
|
+
if (y) {
|
|
4065
|
+
this.pendingAttachmentIds.push(y.id);
|
|
4066
|
+
const v = document.createElement("span");
|
|
4067
|
+
Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎤 Audio", p(y.id, v);
|
|
4013
4068
|
}
|
|
4014
4069
|
}
|
|
4015
4070
|
}), this.form.querySelector(".attach-video").addEventListener("click", async () => {
|
|
4016
|
-
if (this.pendingAttachmentIds.length >=
|
|
4017
|
-
this.videoRecorder || (this.videoRecorder = new
|
|
4018
|
-
const
|
|
4019
|
-
if (
|
|
4020
|
-
const
|
|
4021
|
-
if (
|
|
4022
|
-
this.pendingAttachmentIds.push(
|
|
4023
|
-
const
|
|
4024
|
-
Object.assign(
|
|
4071
|
+
if (this.pendingAttachmentIds.length >= m) return;
|
|
4072
|
+
this.videoRecorder || (this.videoRecorder = new Ue());
|
|
4073
|
+
const g = await this.videoRecorder.startRecording(h);
|
|
4074
|
+
if (g) {
|
|
4075
|
+
const y = await this.upload.uploadBlob(g.blob, "video.webm");
|
|
4076
|
+
if (y) {
|
|
4077
|
+
this.pendingAttachmentIds.push(y.id);
|
|
4078
|
+
const v = document.createElement("span");
|
|
4079
|
+
Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎥 Video", p(y.id, v);
|
|
4025
4080
|
}
|
|
4026
4081
|
}
|
|
4027
|
-
}),
|
|
4028
|
-
const
|
|
4029
|
-
if (!
|
|
4030
|
-
const
|
|
4031
|
-
this.client.createThread(
|
|
4032
|
-
}),
|
|
4033
|
-
|
|
4034
|
-
}), document.body.appendChild(this.form), requestAnimationFrame(() =>
|
|
4082
|
+
}), c.addEventListener("click", () => {
|
|
4083
|
+
const g = l.value.trim();
|
|
4084
|
+
if (!g && this.pendingAttachmentIds.length === 0) return;
|
|
4085
|
+
const y = [...(g || "").matchAll(/@(\w+)/g)].map((v) => v[1]);
|
|
4086
|
+
this.client.createThread(g, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
4087
|
+
}), l.addEventListener("keydown", (g) => {
|
|
4088
|
+
g.key === "Escape" && this.exitPinMode(), g.stopPropagation();
|
|
4089
|
+
}), document.body.appendChild(this.form), requestAnimationFrame(() => l.focus());
|
|
4035
4090
|
}
|
|
4036
4091
|
// ── Inline thread popover (shown when a pin dot is clicked) ──
|
|
4037
4092
|
showThreadPopover(e, t) {
|
|
4038
4093
|
this.closePopover(), this.popover = document.createElement("div"), this.popover.dataset.threadId = e.id;
|
|
4039
4094
|
const i = window.innerWidth <= 480, s = i ? window.innerWidth : 300, o = t.getBoundingClientRect();
|
|
4040
|
-
let r,
|
|
4041
|
-
i ? (r = 0,
|
|
4095
|
+
let r, a;
|
|
4096
|
+
i ? (r = 0, a = window.innerHeight * 0.4) : (r = o.right + 10, a = o.top - 8, r + s > window.innerWidth - 16 && (r = o.left - s - 10), a < 16 && (a = 16)), Object.assign(this.popover.style, {
|
|
4042
4097
|
position: "fixed",
|
|
4043
4098
|
left: `${r}px`,
|
|
4044
|
-
top: `${
|
|
4099
|
+
top: `${a}px`,
|
|
4045
4100
|
width: i ? "100vw" : `${s}px`,
|
|
4046
4101
|
maxHeight: i ? "60vh" : "360px",
|
|
4047
4102
|
zIndex: "10001",
|
|
@@ -4049,36 +4104,36 @@ class es {
|
|
|
4049
4104
|
borderRadius: i ? "16px 16px 0 0" : "12px",
|
|
4050
4105
|
boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
|
|
4051
4106
|
border: "1px solid #e2e8f0",
|
|
4052
|
-
fontFamily:
|
|
4107
|
+
fontFamily: xe,
|
|
4053
4108
|
display: "flex",
|
|
4054
4109
|
flexDirection: "column",
|
|
4055
4110
|
overflow: "hidden",
|
|
4056
4111
|
pointerEvents: "auto",
|
|
4057
4112
|
...i ? { bottom: "0", top: "auto" } : {}
|
|
4058
4113
|
});
|
|
4059
|
-
const
|
|
4060
|
-
Object.assign(
|
|
4114
|
+
const l = document.createElement("div");
|
|
4115
|
+
Object.assign(l.style, {
|
|
4061
4116
|
display: "flex",
|
|
4062
4117
|
alignItems: "center",
|
|
4063
4118
|
justifyContent: "space-between",
|
|
4064
4119
|
padding: "10px 14px",
|
|
4065
4120
|
borderBottom: "1px solid #f1f5f9",
|
|
4066
4121
|
flexShrink: "0"
|
|
4067
|
-
}),
|
|
4122
|
+
}), l.innerHTML = `
|
|
4068
4123
|
<span style="font-size:13px;font-weight:700;color:#0f172a;">Thread</span>
|
|
4069
|
-
${
|
|
4070
|
-
`,
|
|
4124
|
+
${gt}
|
|
4125
|
+
`, l.querySelector(".pulse-close-btn").addEventListener("click", () => {
|
|
4071
4126
|
this.closePopover();
|
|
4072
|
-
}), this.popover.appendChild(
|
|
4073
|
-
const
|
|
4074
|
-
|
|
4127
|
+
}), this.popover.appendChild(l), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
|
|
4128
|
+
const d = this.popover.getBoundingClientRect();
|
|
4129
|
+
d.bottom > window.innerHeight - 16 && (this.popover.style.top = `${Math.max(16, window.innerHeight - d.height - 16)}px`), requestAnimationFrame(() => {
|
|
4075
4130
|
document.addEventListener("pointerdown", this.handlePopoverOutsideClick), document.addEventListener("keydown", this.handlePopoverEscape);
|
|
4076
4131
|
});
|
|
4077
4132
|
}
|
|
4078
4133
|
refreshPopoverComments(e) {
|
|
4079
|
-
var
|
|
4134
|
+
var d;
|
|
4080
4135
|
if (!this.popover) return;
|
|
4081
|
-
this.removePickerEl(), this.editingPopoverCommentId && !e.comments.find((
|
|
4136
|
+
this.removePickerEl(), this.editingPopoverCommentId && !e.comments.find((c) => c.id === this.editingPopoverCommentId) && (this.editingPopoverCommentId = null);
|
|
4082
4137
|
let t = this.popover.querySelector(
|
|
4083
4138
|
".popover-comments"
|
|
4084
4139
|
);
|
|
@@ -4089,21 +4144,21 @@ class es {
|
|
|
4089
4144
|
padding: "12px 14px",
|
|
4090
4145
|
minHeight: "0"
|
|
4091
4146
|
});
|
|
4092
|
-
const
|
|
4093
|
-
|
|
4147
|
+
const c = this.popover.firstElementChild;
|
|
4148
|
+
c && c.nextSibling ? this.popover.insertBefore(t, c.nextSibling) : this.popover.appendChild(t);
|
|
4094
4149
|
}
|
|
4095
|
-
const i = (
|
|
4096
|
-
t.innerHTML = e.comments.map((
|
|
4097
|
-
const
|
|
4098
|
-
if (this.editingPopoverCommentId ===
|
|
4150
|
+
const i = (d = this.client.state.user) == null ? void 0 : d.id;
|
|
4151
|
+
t.innerHTML = e.comments.map((c) => {
|
|
4152
|
+
const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((O) => O[0]).join("").toUpperCase().slice(0, 2) : "?", m = (h == null ? void 0 : h.color) ?? "#94a3b8", g = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), y = this.formatTime(c.createdAt), v = i === c.userId, w = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
|
|
4153
|
+
if (this.editingPopoverCommentId === c.id)
|
|
4099
4154
|
return `
|
|
4100
|
-
<div style="margin-bottom:10px;" data-comment-id="${
|
|
4155
|
+
<div style="margin-bottom:10px;" data-comment-id="${c.id}">
|
|
4101
4156
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:4px;">
|
|
4102
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
4103
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
4157
|
+
<div style="width:22px;height:22px;border-radius:50%;background:${m};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
|
|
4158
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
|
|
4104
4159
|
</div>
|
|
4105
4160
|
<div style="margin-left:29px;">
|
|
4106
|
-
<textarea class="edit-textarea" style="width:100%;padding:6px 10px;border:1.5px solid #e2e8f0;border-radius:6px;font-size:12px;font-family:inherit;outline:none;resize:vertical;min-height:48px;color:#0f172a;box-sizing:border-box;">${this.escapeHtml(
|
|
4161
|
+
<textarea class="edit-textarea" style="width:100%;padding:6px 10px;border:1.5px solid #e2e8f0;border-radius:6px;font-size:12px;font-family:inherit;outline:none;resize:vertical;min-height:48px;color:#0f172a;box-sizing:border-box;">${this.escapeHtml(c.body)}</textarea>
|
|
4107
4162
|
<div style="display:flex;gap:6px;margin-top:6px;">
|
|
4108
4163
|
<button class="edit-save" style="padding:4px 10px;background:#6366f1;color:#fff;border:none;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;font-family:inherit;">Save</button>
|
|
4109
4164
|
<button class="edit-cancel" style="padding:4px 10px;border:1px solid #e2e8f0;border-radius:6px;font-size:11px;font-weight:500;cursor:pointer;background:#fff;font-family:inherit;color:#64748b;">Cancel</button>
|
|
@@ -4111,90 +4166,92 @@ class es {
|
|
|
4111
4166
|
</div>
|
|
4112
4167
|
</div>
|
|
4113
4168
|
`;
|
|
4114
|
-
const
|
|
4169
|
+
const E = c.body && c.body !== "(attachment)" ? c.body.replace(
|
|
4115
4170
|
/@(\w+)/g,
|
|
4116
4171
|
'<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
|
|
4117
|
-
) : "",
|
|
4118
|
-
if (
|
|
4119
|
-
const
|
|
4120
|
-
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(
|
|
4121
|
-
<img src="${this.escapeHtml(
|
|
4172
|
+
) : "", I = (c.attachments ?? []).map((O) => {
|
|
4173
|
+
if (O.type === "image") {
|
|
4174
|
+
const Mt = O.thumbnailUrl || O.url;
|
|
4175
|
+
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(O.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
|
|
4176
|
+
<img src="${this.escapeHtml(Mt)}" alt="${this.escapeHtml(O.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
|
|
4122
4177
|
</div>`;
|
|
4123
4178
|
}
|
|
4124
|
-
return
|
|
4125
|
-
}).join(""),
|
|
4126
|
-
<button class="edit-btn" data-comment-id="${
|
|
4179
|
+
return O.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(O.url)}" data-duration="${O.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : O.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(O.url)}" data-poster="${this.escapeHtml(O.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
|
|
4180
|
+
}).join(""), z = v ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
|
|
4181
|
+
<button class="edit-btn" data-comment-id="${c.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Edit"
|
|
4127
4182
|
onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
|
|
4128
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
4129
|
-
<button class="delete-btn" data-comment-id="${
|
|
4183
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${is}</button>
|
|
4184
|
+
<button class="delete-btn" data-comment-id="${c.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Delete"
|
|
4130
4185
|
onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
|
|
4131
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
4132
|
-
</div>` : "",
|
|
4186
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${ss}</button>
|
|
4187
|
+
</div>` : "", It = this.buildReactionPillsHtml(c.id);
|
|
4133
4188
|
return `
|
|
4134
|
-
<div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${
|
|
4189
|
+
<div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${c.id}">
|
|
4135
4190
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
|
|
4136
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
4137
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
4138
|
-
<span style="font-size:10px;color:#94a3b8;">${
|
|
4139
|
-
${
|
|
4191
|
+
<div style="width:22px;height:22px;border-radius:50%;background:${m};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
|
|
4192
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
|
|
4193
|
+
<span style="font-size:10px;color:#94a3b8;">${y}</span>
|
|
4194
|
+
${w}
|
|
4140
4195
|
</div>
|
|
4141
|
-
${
|
|
4142
|
-
${
|
|
4143
|
-
${
|
|
4144
|
-
${
|
|
4196
|
+
${E ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${E}</div>` : ""}
|
|
4197
|
+
${I}
|
|
4198
|
+
${z}
|
|
4199
|
+
${It}
|
|
4145
4200
|
</div>
|
|
4146
4201
|
`;
|
|
4147
|
-
}).join(""), t.querySelectorAll(".edit-btn").forEach((
|
|
4148
|
-
|
|
4149
|
-
this.editingPopoverCommentId =
|
|
4202
|
+
}).join(""), t.querySelectorAll(".edit-btn").forEach((c) => {
|
|
4203
|
+
c.addEventListener("click", () => {
|
|
4204
|
+
this.editingPopoverCommentId = c.dataset.commentId, this.refreshPopoverComments(e);
|
|
4150
4205
|
});
|
|
4151
|
-
}), t.querySelectorAll(".delete-btn").forEach((
|
|
4152
|
-
|
|
4153
|
-
this.client.deleteComment(
|
|
4206
|
+
}), t.querySelectorAll(".delete-btn").forEach((c) => {
|
|
4207
|
+
c.addEventListener("click", () => {
|
|
4208
|
+
this.client.deleteComment(c.dataset.commentId);
|
|
4154
4209
|
});
|
|
4155
4210
|
});
|
|
4156
4211
|
const s = t.querySelector(".edit-save"), o = t.querySelector(".edit-cancel"), r = t.querySelector(
|
|
4157
4212
|
".edit-textarea"
|
|
4158
4213
|
);
|
|
4159
4214
|
s && r && s.addEventListener("click", () => {
|
|
4160
|
-
const
|
|
4161
|
-
if (!
|
|
4162
|
-
const
|
|
4215
|
+
const c = r.value.trim();
|
|
4216
|
+
if (!c) return;
|
|
4217
|
+
const h = [...c.matchAll(/@(\w+)/g)].map((p) => p[1]);
|
|
4163
4218
|
this.client.editComment(
|
|
4164
4219
|
this.editingPopoverCommentId,
|
|
4165
|
-
|
|
4166
|
-
|
|
4220
|
+
c,
|
|
4221
|
+
h
|
|
4167
4222
|
), this.editingPopoverCommentId = null;
|
|
4168
4223
|
}), o && o.addEventListener("click", () => {
|
|
4169
4224
|
this.editingPopoverCommentId = null, this.refreshPopoverComments(e);
|
|
4170
|
-
}), t.querySelectorAll("[data-reaction-emoji]").forEach((
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
const
|
|
4174
|
-
|
|
4225
|
+
}), t.querySelectorAll("[data-reaction-emoji]").forEach((c) => {
|
|
4226
|
+
c.addEventListener("click", (h) => {
|
|
4227
|
+
h.stopPropagation();
|
|
4228
|
+
const p = c.dataset.reactionEmoji, m = c.dataset.reactionTarget, g = c.dataset.reactionId;
|
|
4229
|
+
g ? this.client.removeReaction(g) : this.client.addReaction(m, "comment", p);
|
|
4175
4230
|
});
|
|
4176
|
-
}), t.querySelectorAll(".popover-reaction-add").forEach((
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
const
|
|
4180
|
-
this.popoverPickerOpen ===
|
|
4231
|
+
}), t.querySelectorAll(".popover-reaction-add").forEach((c) => {
|
|
4232
|
+
c.addEventListener("click", (h) => {
|
|
4233
|
+
h.stopPropagation();
|
|
4234
|
+
const p = c.dataset.commentId;
|
|
4235
|
+
this.popoverPickerOpen === p ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = p, this.showPickerForButton(c, p));
|
|
4181
4236
|
});
|
|
4182
|
-
})
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4237
|
+
});
|
|
4238
|
+
const a = t.querySelectorAll(".popover-attachment-img"), l = Array.from(a).map((c) => c.dataset.fullUrl).filter(Boolean);
|
|
4239
|
+
a.forEach((c, h) => {
|
|
4240
|
+
c.addEventListener("click", () => {
|
|
4241
|
+
const p = c.dataset.fullUrl;
|
|
4242
|
+
p && Te.open(p, l, h);
|
|
4186
4243
|
});
|
|
4187
|
-
}), t.querySelectorAll(".popover-attachment-audio").forEach((
|
|
4188
|
-
const
|
|
4189
|
-
if (
|
|
4190
|
-
const
|
|
4191
|
-
|
|
4192
|
-
}
|
|
4193
|
-
}), t.querySelectorAll(".popover-attachment-video").forEach((
|
|
4194
|
-
const
|
|
4195
|
-
if (
|
|
4196
|
-
const
|
|
4197
|
-
|
|
4244
|
+
}), t.querySelectorAll(".popover-attachment-audio").forEach((c) => {
|
|
4245
|
+
const h = c.dataset.url;
|
|
4246
|
+
if (h) {
|
|
4247
|
+
const p = c.dataset.duration ? parseInt(c.dataset.duration) : void 0, m = je.render(h, p);
|
|
4248
|
+
c.appendChild(m);
|
|
4249
|
+
}
|
|
4250
|
+
}), t.querySelectorAll(".popover-attachment-video").forEach((c) => {
|
|
4251
|
+
const h = c.dataset.url;
|
|
4252
|
+
if (h) {
|
|
4253
|
+
const p = c.dataset.poster || void 0, m = Ce.render(h, p);
|
|
4254
|
+
c.appendChild(m);
|
|
4198
4255
|
}
|
|
4199
4256
|
}), t.scrollTop = t.scrollHeight;
|
|
4200
4257
|
}
|
|
@@ -4225,13 +4282,13 @@ class es {
|
|
|
4225
4282
|
<div class="reply-attachments-preview" style="flex:1;display:flex;gap:4px;flex-wrap:wrap;margin-left:4px;"></div>
|
|
4226
4283
|
</div>
|
|
4227
4284
|
`;
|
|
4228
|
-
const o = t.querySelector("input"), r = t.querySelector(".reply-send"),
|
|
4229
|
-
this.upload || (this.upload = new
|
|
4230
|
-
const
|
|
4231
|
-
const
|
|
4232
|
-
Object.assign(
|
|
4233
|
-
const
|
|
4234
|
-
|
|
4285
|
+
const o = t.querySelector("input"), r = t.querySelector(".reply-send"), a = t.querySelector(".reply-attachments-preview");
|
|
4286
|
+
this.upload || (this.upload = new re(this.client));
|
|
4287
|
+
const l = [], d = (p, m) => {
|
|
4288
|
+
const g = document.createElement("span");
|
|
4289
|
+
Object.assign(g.style, { position: "relative", display: "inline-flex", alignItems: "center", padding: "2px 18px 2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), g.textContent = m;
|
|
4290
|
+
const y = document.createElement("button");
|
|
4291
|
+
y.innerHTML = "×", Object.assign(y.style, {
|
|
4235
4292
|
position: "absolute",
|
|
4236
4293
|
top: "-3px",
|
|
4237
4294
|
right: "-3px",
|
|
@@ -4249,45 +4306,45 @@ class es {
|
|
|
4249
4306
|
justifyContent: "center",
|
|
4250
4307
|
padding: "0",
|
|
4251
4308
|
fontWeight: "700"
|
|
4252
|
-
}),
|
|
4253
|
-
const
|
|
4254
|
-
|
|
4255
|
-
}),
|
|
4256
|
-
},
|
|
4309
|
+
}), y.addEventListener("click", () => {
|
|
4310
|
+
const v = l.indexOf(p);
|
|
4311
|
+
v !== -1 && l.splice(v, 1), g.remove();
|
|
4312
|
+
}), g.appendChild(y), a.appendChild(g);
|
|
4313
|
+
}, c = 5;
|
|
4257
4314
|
t.querySelector(".reply-attach-img").addEventListener("click", async () => {
|
|
4258
|
-
const
|
|
4259
|
-
if (
|
|
4260
|
-
const
|
|
4261
|
-
for (const
|
|
4262
|
-
|
|
4315
|
+
const p = c - l.length;
|
|
4316
|
+
if (p <= 0) return;
|
|
4317
|
+
const m = await this.upload.pickFiles("image/*", p);
|
|
4318
|
+
for (const g of m)
|
|
4319
|
+
l.push(g.id), d(g.id, "📎 Image");
|
|
4263
4320
|
}), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
|
|
4264
|
-
if (
|
|
4265
|
-
this.audioRecorder || (this.audioRecorder = new
|
|
4266
|
-
const
|
|
4267
|
-
if (
|
|
4268
|
-
const
|
|
4269
|
-
|
|
4321
|
+
if (l.length >= c) return;
|
|
4322
|
+
this.audioRecorder || (this.audioRecorder = new ze());
|
|
4323
|
+
const p = await this.audioRecorder.startRecording(t);
|
|
4324
|
+
if (p) {
|
|
4325
|
+
const m = await this.upload.uploadBlob(p, "audio.webm");
|
|
4326
|
+
m && (l.push(m.id), d(m.id, "🎤 Audio"));
|
|
4270
4327
|
}
|
|
4271
4328
|
}), t.querySelector(".reply-attach-video").addEventListener("click", async () => {
|
|
4272
|
-
if (
|
|
4273
|
-
this.videoRecorder || (this.videoRecorder = new
|
|
4274
|
-
const
|
|
4275
|
-
if (
|
|
4276
|
-
const
|
|
4277
|
-
|
|
4329
|
+
if (l.length >= c) return;
|
|
4330
|
+
this.videoRecorder || (this.videoRecorder = new Ue());
|
|
4331
|
+
const p = await this.videoRecorder.startRecording(t);
|
|
4332
|
+
if (p) {
|
|
4333
|
+
const m = await this.upload.uploadBlob(p.blob, "video.webm");
|
|
4334
|
+
m && (l.push(m.id), d(m.id, "🎥 Video"));
|
|
4278
4335
|
}
|
|
4279
4336
|
});
|
|
4280
|
-
const
|
|
4281
|
-
const
|
|
4282
|
-
if (!
|
|
4283
|
-
const
|
|
4284
|
-
this.client.reply(e.id,
|
|
4337
|
+
const h = () => {
|
|
4338
|
+
const p = o.value.trim();
|
|
4339
|
+
if (!p && l.length === 0) return;
|
|
4340
|
+
const m = [...(p || "").matchAll(/@(\w+)/g)].map((g) => g[1]);
|
|
4341
|
+
this.client.reply(e.id, p, m, l.length > 0 ? [...l] : void 0), o.value = "", l.length = 0, a.innerHTML = "";
|
|
4285
4342
|
};
|
|
4286
|
-
r.addEventListener("click",
|
|
4287
|
-
const
|
|
4288
|
-
|
|
4289
|
-
}), o.addEventListener("keydown", (
|
|
4290
|
-
|
|
4343
|
+
r.addEventListener("click", h), o.addEventListener("input", () => {
|
|
4344
|
+
const p = Date.now(), m = this.lastTypingSendPins.get(e.id) ?? 0;
|
|
4345
|
+
p - m >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, p));
|
|
4346
|
+
}), o.addEventListener("keydown", (p) => {
|
|
4347
|
+
p.key === "Enter" && (p.preventDefault(), h()), p.key === "Escape" && this.closePopover(), p.stopPropagation();
|
|
4291
4348
|
}), this.popover.appendChild(t);
|
|
4292
4349
|
}
|
|
4293
4350
|
removePickerEl() {
|
|
@@ -4310,9 +4367,9 @@ class es {
|
|
|
4310
4367
|
borderRadius: "8px",
|
|
4311
4368
|
boxShadow: "0 4px 24px rgba(0,0,0,0.12)",
|
|
4312
4369
|
zIndex: "10002",
|
|
4313
|
-
fontFamily:
|
|
4370
|
+
fontFamily: xe
|
|
4314
4371
|
});
|
|
4315
|
-
for (const s of
|
|
4372
|
+
for (const s of ts) {
|
|
4316
4373
|
const o = document.createElement("button");
|
|
4317
4374
|
Object.assign(o.style, {
|
|
4318
4375
|
border: "none",
|
|
@@ -4324,33 +4381,33 @@ class es {
|
|
|
4324
4381
|
lineHeight: "1"
|
|
4325
4382
|
}), o.textContent = s, o.addEventListener("click", (r) => {
|
|
4326
4383
|
r.stopPropagation();
|
|
4327
|
-
const
|
|
4328
|
-
(
|
|
4329
|
-
var
|
|
4330
|
-
return
|
|
4384
|
+
const l = this.client.state.getReactions(t).find(
|
|
4385
|
+
(d) => {
|
|
4386
|
+
var c;
|
|
4387
|
+
return d.emoji === s && d.userId === ((c = this.client.state.user) == null ? void 0 : c.id);
|
|
4331
4388
|
}
|
|
4332
4389
|
);
|
|
4333
|
-
|
|
4390
|
+
l ? this.client.removeReaction(l.id) : this.client.addReaction(t, "comment", s), this.popoverPickerOpen = null, this.removePickerEl();
|
|
4334
4391
|
}), this.pickerEl.appendChild(o);
|
|
4335
4392
|
}
|
|
4336
4393
|
document.body.appendChild(this.pickerEl);
|
|
4337
4394
|
}
|
|
4338
4395
|
buildReactionPillsHtml(e) {
|
|
4339
|
-
var
|
|
4340
|
-
const t = this.client.state.getReactions(e), i = (
|
|
4341
|
-
for (const
|
|
4342
|
-
const
|
|
4343
|
-
|
|
4396
|
+
var l;
|
|
4397
|
+
const t = this.client.state.getReactions(e), i = (l = this.client.state.user) == null ? void 0 : l.id, s = /* @__PURE__ */ new Map();
|
|
4398
|
+
for (const d of t) {
|
|
4399
|
+
const c = s.get(d.emoji) ?? { count: 0, ownId: null };
|
|
4400
|
+
c.count++, d.userId === i && (c.ownId = d.id), s.set(d.emoji, c);
|
|
4344
4401
|
}
|
|
4345
4402
|
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;";
|
|
4346
|
-
let
|
|
4347
|
-
for (const [
|
|
4348
|
-
const
|
|
4349
|
-
|
|
4350
|
-
<span>${
|
|
4403
|
+
let a = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
|
|
4404
|
+
for (const [d, { count: c, ownId: h }] of s) {
|
|
4405
|
+
const p = h ? r : o;
|
|
4406
|
+
a += `<button data-reaction-emoji="${d}" data-reaction-target="${e}" ${h ? `data-reaction-id="${h}"` : ""} style="${p}">
|
|
4407
|
+
<span>${d}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${c}</span>
|
|
4351
4408
|
</button>`;
|
|
4352
4409
|
}
|
|
4353
|
-
return
|
|
4410
|
+
return a += `<button class="popover-reaction-add" data-comment-id="${e}" style="display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px dashed #e2e8f0;background:none;cursor:pointer;color:#94a3b8;font-size:14px;">+</button>`, a += "</div>", a;
|
|
4354
4411
|
}
|
|
4355
4412
|
updatePopoverTyping(e) {
|
|
4356
4413
|
if (!this.popover) return;
|
|
@@ -4422,7 +4479,7 @@ class es {
|
|
|
4422
4479
|
justifyContent: "center",
|
|
4423
4480
|
fontSize: "11px",
|
|
4424
4481
|
fontWeight: "700",
|
|
4425
|
-
fontFamily:
|
|
4482
|
+
fontFamily: xe,
|
|
4426
4483
|
cursor: "pointer",
|
|
4427
4484
|
pointerEvents: "auto",
|
|
4428
4485
|
boxShadow: "0 2px 8px rgba(99,102,241,0.4)",
|
|
@@ -4439,20 +4496,20 @@ class es {
|
|
|
4439
4496
|
this.closePopover();
|
|
4440
4497
|
return;
|
|
4441
4498
|
}
|
|
4442
|
-
const
|
|
4443
|
-
|
|
4499
|
+
const l = this.threads.find((d) => d.id === i.id);
|
|
4500
|
+
l && this.showThreadPopover(l, r);
|
|
4444
4501
|
}), this.container.appendChild(r), this.pinEls.set(i.id, r)), r.textContent = `${s + 1}`;
|
|
4445
|
-
const
|
|
4446
|
-
r.style.left = `${
|
|
4502
|
+
const a = this.resolvePosition(o);
|
|
4503
|
+
r.style.left = `${a.x}px`, r.style.top = `${a.y}px`;
|
|
4447
4504
|
});
|
|
4448
4505
|
}
|
|
4449
4506
|
}
|
|
4450
|
-
var
|
|
4451
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
4507
|
+
var os = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, U = (n, e, t, i) => {
|
|
4508
|
+
for (var s = i > 1 ? void 0 : i ? rs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
4452
4509
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
4453
|
-
return i && s &&
|
|
4510
|
+
return i && s && os(e, t, s), s;
|
|
4454
4511
|
};
|
|
4455
|
-
const
|
|
4512
|
+
const as = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
4456
4513
|
let A = class extends P {
|
|
4457
4514
|
constructor() {
|
|
4458
4515
|
super(...arguments), this.highlightThreadId = null, this.threadsVersion = 0, 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(), this.replyAttachmentIds = [];
|
|
@@ -4477,12 +4534,12 @@ let A = class extends P {
|
|
|
4477
4534
|
const s = i.dataset.url;
|
|
4478
4535
|
if (s) {
|
|
4479
4536
|
const o = i.dataset.duration ? parseInt(i.dataset.duration) : void 0;
|
|
4480
|
-
i.appendChild(
|
|
4537
|
+
i.appendChild(je.render(s, o));
|
|
4481
4538
|
}
|
|
4482
4539
|
}), (t = this.shadowRoot) == null || t.querySelectorAll(".video-player-host").forEach((i) => {
|
|
4483
4540
|
if (i.children.length > 0) return;
|
|
4484
4541
|
const s = i.dataset.url;
|
|
4485
|
-
s && i.appendChild(
|
|
4542
|
+
s && i.appendChild(Ce.render(s, i.dataset.poster || void 0));
|
|
4486
4543
|
});
|
|
4487
4544
|
}
|
|
4488
4545
|
teardownListeners() {
|
|
@@ -4550,7 +4607,7 @@ let A = class extends P {
|
|
|
4550
4607
|
}
|
|
4551
4608
|
parseMentions(n) {
|
|
4552
4609
|
return n.split(/(@\w+)/g).map(
|
|
4553
|
-
(t) => t.startsWith("@") ?
|
|
4610
|
+
(t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
|
|
4554
4611
|
);
|
|
4555
4612
|
}
|
|
4556
4613
|
getInitials(n) {
|
|
@@ -4567,7 +4624,7 @@ let A = class extends P {
|
|
|
4567
4624
|
return o < 24 ? `${o}h` : e.toLocaleDateString();
|
|
4568
4625
|
}
|
|
4569
4626
|
async handleAttachImage() {
|
|
4570
|
-
this.upload || (this.upload = new
|
|
4627
|
+
this.upload || (this.upload = new re(this.client));
|
|
4571
4628
|
const n = A.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
|
|
4572
4629
|
if (n <= 0) return;
|
|
4573
4630
|
const e = await this.upload.pickFiles("image/*", n);
|
|
@@ -4576,7 +4633,7 @@ let A = class extends P {
|
|
|
4576
4633
|
async handleRecordAudio(n) {
|
|
4577
4634
|
var i;
|
|
4578
4635
|
if (this.replyAttachmentIds.length >= A.MAX_ATTACHMENTS) return;
|
|
4579
|
-
this.upload || (this.upload = new
|
|
4636
|
+
this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new ze());
|
|
4580
4637
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
|
|
4581
4638
|
if (t) {
|
|
4582
4639
|
const s = await this.upload.uploadBlob(t, "audio.webm");
|
|
@@ -4586,7 +4643,7 @@ let A = class extends P {
|
|
|
4586
4643
|
async handleRecordVideo(n) {
|
|
4587
4644
|
var i;
|
|
4588
4645
|
if (this.replyAttachmentIds.length >= A.MAX_ATTACHMENTS) return;
|
|
4589
|
-
this.upload || (this.upload = new
|
|
4646
|
+
this.upload || (this.upload = new re(this.client)), this.videoRecorder || (this.videoRecorder = new Ue());
|
|
4590
4647
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
|
|
4591
4648
|
if (t) {
|
|
4592
4649
|
const s = await this.upload.uploadBlob(t.blob, "video.webm");
|
|
@@ -4623,7 +4680,7 @@ let A = class extends P {
|
|
|
4623
4680
|
this.client.deleteComment(n);
|
|
4624
4681
|
}
|
|
4625
4682
|
renderEditForm(n) {
|
|
4626
|
-
return
|
|
4683
|
+
return u`
|
|
4627
4684
|
<div class="edit-form">
|
|
4628
4685
|
<textarea
|
|
4629
4686
|
.value=${this.editBody}
|
|
@@ -4644,14 +4701,14 @@ let A = class extends P {
|
|
|
4644
4701
|
const e = this.client.state.getReactions(n.id), t = (s = this.client.state.user) == null ? void 0 : s.id, i = /* @__PURE__ */ new Map();
|
|
4645
4702
|
for (const o of e)
|
|
4646
4703
|
i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
|
|
4647
|
-
return
|
|
4704
|
+
return u`
|
|
4648
4705
|
<div class="comment-reactions">
|
|
4649
4706
|
${[...i.entries()].map(
|
|
4650
4707
|
([o, r]) => {
|
|
4651
|
-
const
|
|
4652
|
-
return
|
|
4708
|
+
const a = r.some((l) => l.userId === t);
|
|
4709
|
+
return u`
|
|
4653
4710
|
<button
|
|
4654
|
-
class="reaction-pill ${
|
|
4711
|
+
class="reaction-pill ${a ? "own" : ""}"
|
|
4655
4712
|
@click=${() => this.toggleReaction(n.id, o)}
|
|
4656
4713
|
>
|
|
4657
4714
|
<span>${o}</span>
|
|
@@ -4668,26 +4725,26 @@ let A = class extends P {
|
|
|
4668
4725
|
title="Add reaction"
|
|
4669
4726
|
>
|
|
4670
4727
|
+
|
|
4671
|
-
${this.pickerOpenForComment === n.id ?
|
|
4728
|
+
${this.pickerOpenForComment === n.id ? u`
|
|
4672
4729
|
<div class="emoji-picker">
|
|
4673
|
-
${
|
|
4674
|
-
(o) =>
|
|
4730
|
+
${as.map(
|
|
4731
|
+
(o) => u`
|
|
4675
4732
|
<button @click=${(r) => {
|
|
4676
4733
|
r.stopPropagation(), this.toggleReaction(n.id, o);
|
|
4677
4734
|
}}>${o}</button>
|
|
4678
4735
|
`
|
|
4679
4736
|
)}
|
|
4680
4737
|
</div>
|
|
4681
|
-
` :
|
|
4738
|
+
` : b}
|
|
4682
4739
|
</button>
|
|
4683
4740
|
</div>
|
|
4684
4741
|
`;
|
|
4685
4742
|
}
|
|
4686
4743
|
renderTypingIndicator(n) {
|
|
4687
4744
|
const e = this.typingByThread.get(n) ?? [];
|
|
4688
|
-
if (e.length === 0) return
|
|
4745
|
+
if (e.length === 0) return b;
|
|
4689
4746
|
const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
|
|
4690
|
-
return
|
|
4747
|
+
return u`<div class="typing-indicator">${t}</div>`;
|
|
4691
4748
|
}
|
|
4692
4749
|
sortedThreads() {
|
|
4693
4750
|
return [...this.threads].sort((n, e) => {
|
|
@@ -4698,7 +4755,7 @@ let A = class extends P {
|
|
|
4698
4755
|
}
|
|
4699
4756
|
render() {
|
|
4700
4757
|
const n = this.sortedThreads();
|
|
4701
|
-
return
|
|
4758
|
+
return u`
|
|
4702
4759
|
<div class="panel">
|
|
4703
4760
|
<div class="panel-header">
|
|
4704
4761
|
<span class="panel-title">
|
|
@@ -4706,12 +4763,12 @@ let A = class extends P {
|
|
|
4706
4763
|
<span class="thread-count">${this.threads.length}</span>
|
|
4707
4764
|
</span>
|
|
4708
4765
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
4709
|
-
${C(
|
|
4766
|
+
${C(be, 16)}
|
|
4710
4767
|
</button>
|
|
4711
4768
|
</div>
|
|
4712
4769
|
|
|
4713
4770
|
<div class="panel-body pw-scrollable">
|
|
4714
|
-
${n.length === 0 ?
|
|
4771
|
+
${n.length === 0 ? u`<div class="empty">
|
|
4715
4772
|
<div class="empty-icon">💬</div>
|
|
4716
4773
|
No comments yet
|
|
4717
4774
|
</div>` : n.map((e) => this.renderThread(e))}
|
|
@@ -4724,55 +4781,57 @@ let A = class extends P {
|
|
|
4724
4781
|
`;
|
|
4725
4782
|
}
|
|
4726
4783
|
renderAttachments(n) {
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4784
|
+
if (!n || n.length === 0) return b;
|
|
4785
|
+
const e = n.filter((t) => t.type === "image").map((t) => t.url);
|
|
4786
|
+
return u`
|
|
4787
|
+
${n.map((t) => {
|
|
4788
|
+
if (t.type === "image") {
|
|
4789
|
+
const i = t.thumbnailUrl || t.url, s = e.indexOf(t.url);
|
|
4790
|
+
return u`
|
|
4732
4791
|
<div class="comment-attachment-media">
|
|
4733
4792
|
<img
|
|
4734
4793
|
class="comment-attachment-img"
|
|
4735
|
-
src=${
|
|
4736
|
-
alt=${
|
|
4737
|
-
@click=${() =>
|
|
4794
|
+
src=${i}
|
|
4795
|
+
alt=${t.filename}
|
|
4796
|
+
@click=${() => Te.open(t.url, e, s)}
|
|
4738
4797
|
/>
|
|
4739
4798
|
</div>
|
|
4740
4799
|
`;
|
|
4741
4800
|
}
|
|
4742
|
-
return
|
|
4743
|
-
<div class="comment-attachment-media" id="audio-${
|
|
4744
|
-
${this.renderAudioPlayer(
|
|
4801
|
+
return t.type === "audio" ? u`
|
|
4802
|
+
<div class="comment-attachment-media" id="audio-${t.id}">
|
|
4803
|
+
${this.renderAudioPlayer(t)}
|
|
4745
4804
|
</div>
|
|
4746
|
-
` :
|
|
4747
|
-
<div class="comment-attachment-media" id="video-${
|
|
4748
|
-
${this.renderVideoPlayer(
|
|
4805
|
+
` : t.type === "video" ? u`
|
|
4806
|
+
<div class="comment-attachment-media" id="video-${t.id}">
|
|
4807
|
+
${this.renderVideoPlayer(t)}
|
|
4749
4808
|
</div>
|
|
4750
|
-
` :
|
|
4809
|
+
` : b;
|
|
4751
4810
|
})}
|
|
4752
4811
|
`;
|
|
4753
4812
|
}
|
|
4754
4813
|
renderAudioPlayer(n) {
|
|
4755
|
-
const e = document.createElement("div"), t =
|
|
4756
|
-
return e.appendChild(t),
|
|
4814
|
+
const e = document.createElement("div"), t = je.render(n.url, n.durationMs);
|
|
4815
|
+
return e.appendChild(t), u`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
|
|
4757
4816
|
}
|
|
4758
4817
|
renderVideoPlayer(n) {
|
|
4759
|
-
return
|
|
4818
|
+
return u`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
|
|
4760
4819
|
}
|
|
4761
4820
|
renderThread(n) {
|
|
4762
4821
|
const e = this.highlightThreadId === n.id;
|
|
4763
|
-
return
|
|
4822
|
+
return u`
|
|
4764
4823
|
<div
|
|
4765
4824
|
class="thread ${n.resolved ? "resolved" : ""} ${e ? "highlighted" : ""}"
|
|
4766
4825
|
data-thread-id=${n.id}
|
|
4767
4826
|
>
|
|
4768
|
-
${n.position ?
|
|
4769
|
-
${C(
|
|
4827
|
+
${n.position ? u`<div class="pin-badge">
|
|
4828
|
+
${C(At, 12)}
|
|
4770
4829
|
Pinned
|
|
4771
|
-
</div>` :
|
|
4830
|
+
</div>` : b}
|
|
4772
4831
|
${n.comments.map((t, i) => {
|
|
4773
4832
|
const s = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
|
|
4774
|
-
return
|
|
4775
|
-
${i > 0 ?
|
|
4833
|
+
return u`
|
|
4834
|
+
${i > 0 ? u`<div class="comment-divider"></div>` : b}
|
|
4776
4835
|
<div class="comment">
|
|
4777
4836
|
<div class="comment-header">
|
|
4778
4837
|
<div
|
|
@@ -4783,16 +4842,16 @@ let A = class extends P {
|
|
|
4783
4842
|
</div>
|
|
4784
4843
|
<span class="comment-author">${(s == null ? void 0 : s.name) ?? "Unknown"}</span>
|
|
4785
4844
|
<span class="comment-time">${this.formatTime(t.createdAt)}</span>
|
|
4786
|
-
${t.editedAt ?
|
|
4845
|
+
${t.editedAt ? u`<span class="edited-badge">(edited)</span>` : b}
|
|
4787
4846
|
</div>
|
|
4788
|
-
${r ? this.renderEditForm(t) :
|
|
4789
|
-
${t.body && t.body !== "(attachment)" ?
|
|
4847
|
+
${r ? this.renderEditForm(t) : u`
|
|
4848
|
+
${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` : b}
|
|
4790
4849
|
${this.renderAttachments(t.attachments ?? [])}
|
|
4791
4850
|
`}
|
|
4792
|
-
${o && !r ?
|
|
4793
|
-
<button @click=${() => this.startEdit(t)} title="Edit">${C(
|
|
4794
|
-
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(
|
|
4795
|
-
</div>` :
|
|
4851
|
+
${o && !r ? u`<div class="comment-actions">
|
|
4852
|
+
<button @click=${() => this.startEdit(t)} title="Edit">${C(Oi, 14)}</button>
|
|
4853
|
+
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Li, 14)}</button>
|
|
4854
|
+
</div>` : b}
|
|
4796
4855
|
${this.renderReactions(t)}
|
|
4797
4856
|
</div>
|
|
4798
4857
|
`;
|
|
@@ -4813,7 +4872,7 @@ let A = class extends P {
|
|
|
4813
4872
|
|
|
4814
4873
|
${this.renderTypingIndicator(n.id)}
|
|
4815
4874
|
|
|
4816
|
-
${this.replyingTo === n.id ?
|
|
4875
|
+
${this.replyingTo === n.id ? u`
|
|
4817
4876
|
<form
|
|
4818
4877
|
class="reply-form"
|
|
4819
4878
|
@submit=${(t) => this.handleReply(n.id, t)}
|
|
@@ -4832,22 +4891,22 @@ let A = class extends P {
|
|
|
4832
4891
|
class="reply-media-btn"
|
|
4833
4892
|
title="Attach image"
|
|
4834
4893
|
@click=${() => this.handleAttachImage()}
|
|
4835
|
-
>${C(
|
|
4894
|
+
>${C(Ii, 16)}</button>
|
|
4836
4895
|
<button
|
|
4837
4896
|
type="button"
|
|
4838
4897
|
class="reply-media-btn"
|
|
4839
4898
|
title="Record audio"
|
|
4840
4899
|
@click=${() => this.handleRecordAudio(n.id)}
|
|
4841
|
-
>${C(
|
|
4900
|
+
>${C(_i, 16)}</button>
|
|
4842
4901
|
<button
|
|
4843
4902
|
type="button"
|
|
4844
4903
|
class="reply-media-btn"
|
|
4845
4904
|
title="Record video"
|
|
4846
4905
|
@click=${() => this.handleRecordVideo(n.id)}
|
|
4847
|
-
>${C(
|
|
4906
|
+
>${C(ji, 16)}</button>
|
|
4848
4907
|
<div class="reply-preview">
|
|
4849
4908
|
${this.replyAttachmentIds.map(
|
|
4850
|
-
(t, i) =>
|
|
4909
|
+
(t, i) => u`<span class="reply-preview-badge">
|
|
4851
4910
|
Attached #${i + 1}
|
|
4852
4911
|
<button
|
|
4853
4912
|
type="button"
|
|
@@ -4859,16 +4918,16 @@ let A = class extends P {
|
|
|
4859
4918
|
</div>
|
|
4860
4919
|
</div>
|
|
4861
4920
|
</form>
|
|
4862
|
-
` :
|
|
4921
|
+
` : b}
|
|
4863
4922
|
</div>
|
|
4864
4923
|
`;
|
|
4865
4924
|
}
|
|
4866
4925
|
};
|
|
4867
4926
|
A.styles = [
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4927
|
+
ie,
|
|
4928
|
+
ve,
|
|
4929
|
+
Ae,
|
|
4930
|
+
M`
|
|
4872
4931
|
:host {
|
|
4873
4932
|
display: block;
|
|
4874
4933
|
}
|
|
@@ -5409,55 +5468,55 @@ A.styles = [
|
|
|
5409
5468
|
`
|
|
5410
5469
|
];
|
|
5411
5470
|
A.MAX_ATTACHMENTS = 5;
|
|
5412
|
-
|
|
5413
|
-
|
|
5471
|
+
U([
|
|
5472
|
+
x({ attribute: !1 })
|
|
5414
5473
|
], A.prototype, "client", 2);
|
|
5415
|
-
|
|
5416
|
-
|
|
5474
|
+
U([
|
|
5475
|
+
x()
|
|
5417
5476
|
], A.prototype, "highlightThreadId", 2);
|
|
5418
|
-
|
|
5419
|
-
|
|
5477
|
+
U([
|
|
5478
|
+
$()
|
|
5420
5479
|
], A.prototype, "threadsVersion", 2);
|
|
5421
|
-
|
|
5422
|
-
|
|
5480
|
+
U([
|
|
5481
|
+
$()
|
|
5423
5482
|
], A.prototype, "replyingTo", 2);
|
|
5424
|
-
|
|
5425
|
-
|
|
5483
|
+
U([
|
|
5484
|
+
$()
|
|
5426
5485
|
], A.prototype, "editingCommentId", 2);
|
|
5427
|
-
|
|
5428
|
-
|
|
5486
|
+
U([
|
|
5487
|
+
$()
|
|
5429
5488
|
], A.prototype, "editBody", 2);
|
|
5430
|
-
|
|
5431
|
-
|
|
5489
|
+
U([
|
|
5490
|
+
$()
|
|
5432
5491
|
], A.prototype, "pickerOpenForComment", 2);
|
|
5433
|
-
|
|
5434
|
-
|
|
5492
|
+
U([
|
|
5493
|
+
$()
|
|
5435
5494
|
], A.prototype, "typingByThread", 2);
|
|
5436
|
-
|
|
5437
|
-
|
|
5495
|
+
U([
|
|
5496
|
+
$()
|
|
5438
5497
|
], A.prototype, "reactionsVersion", 2);
|
|
5439
|
-
A =
|
|
5498
|
+
A = U([
|
|
5440
5499
|
L("pulse-widget-comments-panel")
|
|
5441
5500
|
], A);
|
|
5442
|
-
var
|
|
5443
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
5501
|
+
var ls = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
|
|
5502
|
+
for (var s = i > 1 ? void 0 : i ? cs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
5444
5503
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
5445
|
-
return i && s &&
|
|
5504
|
+
return i && s && ls(e, t, s), s;
|
|
5446
5505
|
};
|
|
5447
|
-
const
|
|
5506
|
+
const ds = {
|
|
5448
5507
|
"comment:created": "left a comment",
|
|
5449
5508
|
"comment:mention": "mentioned you",
|
|
5450
5509
|
"comment:reply": "replied to your comment",
|
|
5451
5510
|
"thread:resolved": "resolved a thread",
|
|
5452
5511
|
"reaction:added": "reacted to your comment"
|
|
5453
|
-
},
|
|
5512
|
+
}, hs = {
|
|
5454
5513
|
"comment:created": "💬",
|
|
5455
5514
|
"comment:mention": "📣",
|
|
5456
5515
|
"comment:reply": "↩️",
|
|
5457
5516
|
"thread:resolved": "✅",
|
|
5458
5517
|
"reaction:added": "🎉"
|
|
5459
5518
|
};
|
|
5460
|
-
let
|
|
5519
|
+
let pe = class extends P {
|
|
5461
5520
|
constructor() {
|
|
5462
5521
|
super(...arguments), this.notifications = [];
|
|
5463
5522
|
}
|
|
@@ -5501,38 +5560,38 @@ let he = class extends P {
|
|
|
5501
5560
|
}
|
|
5502
5561
|
render() {
|
|
5503
5562
|
const n = this.notifications.filter((e) => !e.read).length;
|
|
5504
|
-
return
|
|
5563
|
+
return u`
|
|
5505
5564
|
<div class="panel">
|
|
5506
5565
|
<div class="panel-header">
|
|
5507
5566
|
<span class="panel-title">
|
|
5508
5567
|
Notifications
|
|
5509
|
-
${n > 0 ?
|
|
5568
|
+
${n > 0 ? u`<span class="unread-badge">${n}</span>` : b}
|
|
5510
5569
|
</span>
|
|
5511
5570
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
5512
|
-
${n > 0 ?
|
|
5571
|
+
${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
5513
5572
|
Mark all read
|
|
5514
|
-
</button>` :
|
|
5573
|
+
</button>` : b}
|
|
5515
5574
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5516
|
-
${C(
|
|
5575
|
+
${C(be, 16)}
|
|
5517
5576
|
</button>
|
|
5518
5577
|
</div>
|
|
5519
5578
|
</div>
|
|
5520
5579
|
|
|
5521
5580
|
<div class="panel-body pw-scrollable">
|
|
5522
|
-
${this.notifications.length === 0 ?
|
|
5581
|
+
${this.notifications.length === 0 ? u`<div class="empty">
|
|
5523
5582
|
<div class="empty-icon">🔔</div>
|
|
5524
5583
|
No notifications
|
|
5525
5584
|
</div>` : this.notifications.map(
|
|
5526
|
-
(e) =>
|
|
5585
|
+
(e) => u`
|
|
5527
5586
|
<div
|
|
5528
5587
|
class="item ${e.read ? "" : "unread"}"
|
|
5529
5588
|
@click=${() => this.handleClick(e)}
|
|
5530
5589
|
>
|
|
5531
|
-
<span class="icon">${
|
|
5590
|
+
<span class="icon">${hs[e.type] ?? "🔔"}</span>
|
|
5532
5591
|
<div class="content">
|
|
5533
5592
|
<div class="text">
|
|
5534
5593
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
5535
|
-
${
|
|
5594
|
+
${ds[e.type] ?? e.type}
|
|
5536
5595
|
</div>
|
|
5537
5596
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
5538
5597
|
</div>
|
|
@@ -5545,11 +5604,11 @@ let he = class extends P {
|
|
|
5545
5604
|
`;
|
|
5546
5605
|
}
|
|
5547
5606
|
};
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5607
|
+
pe.styles = [
|
|
5608
|
+
ie,
|
|
5609
|
+
ve,
|
|
5610
|
+
Ae,
|
|
5611
|
+
M`
|
|
5553
5612
|
:host {
|
|
5554
5613
|
display: block;
|
|
5555
5614
|
}
|
|
@@ -5742,17 +5801,17 @@ he.styles = [
|
|
|
5742
5801
|
}
|
|
5743
5802
|
`
|
|
5744
5803
|
];
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
],
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
],
|
|
5751
|
-
|
|
5804
|
+
Xe([
|
|
5805
|
+
x({ attribute: !1 })
|
|
5806
|
+
], pe.prototype, "client", 2);
|
|
5807
|
+
Xe([
|
|
5808
|
+
$()
|
|
5809
|
+
], pe.prototype, "notifications", 2);
|
|
5810
|
+
pe = Xe([
|
|
5752
5811
|
L("pulse-widget-notifications-panel")
|
|
5753
|
-
],
|
|
5754
|
-
const
|
|
5755
|
-
class
|
|
5812
|
+
], pe);
|
|
5813
|
+
const ps = 3e3;
|
|
5814
|
+
class us {
|
|
5756
5815
|
constructor(e) {
|
|
5757
5816
|
this.container = null, this.cursors = /* @__PURE__ */ new Map(), this.cursorEls = /* @__PURE__ */ new Map(), this.cursorLastSeen = /* @__PURE__ */ new Map(), this.unsubs = [], this.enabled = !1, this.sending = !1, this.staleTimer = null, this.handleLocalCursor = (t) => {
|
|
5758
5817
|
t.pointerType !== "touch" && this.client.moveCursor({
|
|
@@ -5804,7 +5863,7 @@ class cs {
|
|
|
5804
5863
|
), this.setSending(!0), this.staleTimer = setInterval(() => {
|
|
5805
5864
|
const e = Date.now();
|
|
5806
5865
|
for (const [t, i] of this.cursorLastSeen)
|
|
5807
|
-
if (e - i >
|
|
5866
|
+
if (e - i > ps) {
|
|
5808
5867
|
this.cursors.delete(t);
|
|
5809
5868
|
const s = this.cursorEls.get(t);
|
|
5810
5869
|
s && s.remove(), this.cursorEls.delete(t), this.cursorLastSeen.delete(t);
|
|
@@ -5900,11 +5959,11 @@ class cs {
|
|
|
5900
5959
|
i.style.transform = `translate(${t.position.x}px, ${t.position.y}px)`;
|
|
5901
5960
|
}
|
|
5902
5961
|
}
|
|
5903
|
-
class
|
|
5962
|
+
class fs {
|
|
5904
5963
|
constructor(e) {
|
|
5905
5964
|
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) => {
|
|
5906
|
-
var
|
|
5907
|
-
t.preventDefault(), (
|
|
5965
|
+
var a, l, d;
|
|
5966
|
+
t.preventDefault(), (l = (a = t.target) == null ? void 0 : a.setPointerCapture) == null || l.call(a, t.pointerId), this.currentPoints = [{ x: t.clientX, y: t.clientY }], this.lastPoint = { x: t.clientX, y: t.clientY };
|
|
5908
5967
|
const i = this.client.state.user, s = (i == null ? void 0 : i.color) ?? "#6366f1", r = 2 + (t.pressure > 0 ? t.pressure : 0.5) * 4;
|
|
5909
5968
|
this.currentPath = document.createElementNS(
|
|
5910
5969
|
"http://www.w3.org/2000/svg",
|
|
@@ -5912,7 +5971,7 @@ class ds {
|
|
|
5912
5971
|
), this.currentPath.setAttribute("fill", "none"), this.currentPath.setAttribute("stroke", s), this.currentPath.setAttribute("stroke-width", String(r)), this.currentPath.setAttribute("stroke-linecap", "round"), this.currentPath.setAttribute("stroke-linejoin", "round"), this.currentPath.setAttribute(
|
|
5913
5972
|
"points",
|
|
5914
5973
|
`${t.clientX},${t.clientY}`
|
|
5915
|
-
), (
|
|
5974
|
+
), (d = this.container) == null || d.appendChild(this.currentPath), document.addEventListener("pointermove", this.handlePointerMove), document.addEventListener("pointerup", this.handlePointerUp);
|
|
5916
5975
|
}, this.handlePointerMove = (t) => {
|
|
5917
5976
|
if (!this.currentPath || !this.lastPoint) return;
|
|
5918
5977
|
const i = t.clientX - this.lastPoint.x, s = t.clientY - this.lastPoint.y;
|
|
@@ -5983,9 +6042,9 @@ class ds {
|
|
|
5983
6042
|
this.fadeTimers.set(e, t);
|
|
5984
6043
|
}
|
|
5985
6044
|
}
|
|
5986
|
-
function
|
|
6045
|
+
function ms(n) {
|
|
5987
6046
|
if (!n.rangeCount || n.isCollapsed) return null;
|
|
5988
|
-
const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s =
|
|
6047
|
+
const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = bt(t), o = bt(i);
|
|
5989
6048
|
return !s || !o ? null : {
|
|
5990
6049
|
startSelector: s,
|
|
5991
6050
|
startOffset: e.startOffset,
|
|
@@ -5993,29 +6052,29 @@ function hs(n) {
|
|
|
5993
6052
|
endOffset: e.endOffset
|
|
5994
6053
|
};
|
|
5995
6054
|
}
|
|
5996
|
-
function
|
|
6055
|
+
function gs(n) {
|
|
5997
6056
|
var e, t;
|
|
5998
6057
|
try {
|
|
5999
|
-
const i =
|
|
6058
|
+
const i = xt(n.startSelector), s = xt(n.endSelector);
|
|
6000
6059
|
if (!i || !s) return null;
|
|
6001
|
-
const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length,
|
|
6002
|
-
return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset,
|
|
6060
|
+
const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, a = s.nodeType === Node.TEXT_NODE ? ((t = s.textContent) == null ? void 0 : t.length) ?? 0 : s.childNodes.length;
|
|
6061
|
+
return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset, a)), o;
|
|
6003
6062
|
} catch {
|
|
6004
6063
|
return null;
|
|
6005
6064
|
}
|
|
6006
6065
|
}
|
|
6007
|
-
function
|
|
6066
|
+
function bt(n) {
|
|
6008
6067
|
if (n.nodeType === Node.TEXT_NODE) {
|
|
6009
6068
|
const e = n.parentElement;
|
|
6010
6069
|
if (!e) return null;
|
|
6011
|
-
const t =
|
|
6070
|
+
const t = vt(e);
|
|
6012
6071
|
if (!t) return null;
|
|
6013
6072
|
const i = Array.from(e.childNodes).indexOf(n);
|
|
6014
6073
|
return `${t}::text(${i})`;
|
|
6015
6074
|
}
|
|
6016
|
-
return n.nodeType === Node.ELEMENT_NODE ?
|
|
6075
|
+
return n.nodeType === Node.ELEMENT_NODE ? vt(n) : null;
|
|
6017
6076
|
}
|
|
6018
|
-
function
|
|
6077
|
+
function vt(n) {
|
|
6019
6078
|
if (!n || n === document.documentElement) return "html";
|
|
6020
6079
|
if (n === document.body) return "body";
|
|
6021
6080
|
if (n.id) return `#${CSS.escape(n.id)}`;
|
|
@@ -6024,14 +6083,14 @@ function bt(n) {
|
|
|
6024
6083
|
for (; t && t !== document.body && i < 10; ) {
|
|
6025
6084
|
const s = t.parentElement;
|
|
6026
6085
|
if (!s) break;
|
|
6027
|
-
const o = t.tagName.toLowerCase(), r = t.tagName,
|
|
6028
|
-
(
|
|
6086
|
+
const o = t.tagName.toLowerCase(), r = t.tagName, a = Array.from(s.children).filter(
|
|
6087
|
+
(l) => l.tagName === r
|
|
6029
6088
|
);
|
|
6030
|
-
if (
|
|
6089
|
+
if (a.length === 1)
|
|
6031
6090
|
e.unshift(o);
|
|
6032
6091
|
else {
|
|
6033
|
-
const
|
|
6034
|
-
e.unshift(`${o}:nth-of-type(${
|
|
6092
|
+
const l = a.indexOf(t) + 1;
|
|
6093
|
+
e.unshift(`${o}:nth-of-type(${l})`);
|
|
6035
6094
|
}
|
|
6036
6095
|
if (s.id) {
|
|
6037
6096
|
e.unshift(`#${CSS.escape(s.id)}`);
|
|
@@ -6041,7 +6100,7 @@ function bt(n) {
|
|
|
6041
6100
|
}
|
|
6042
6101
|
return e.length > 0 ? e.join(" > ") : null;
|
|
6043
6102
|
}
|
|
6044
|
-
function
|
|
6103
|
+
function xt(n) {
|
|
6045
6104
|
const e = n.match(/^(.+)::text\((\d+)\)$/);
|
|
6046
6105
|
if (e) {
|
|
6047
6106
|
const t = e[1], i = parseInt(e[2], 10);
|
|
@@ -6058,7 +6117,7 @@ function vt(n) {
|
|
|
6058
6117
|
return null;
|
|
6059
6118
|
}
|
|
6060
6119
|
}
|
|
6061
|
-
class
|
|
6120
|
+
class bs {
|
|
6062
6121
|
constructor(e) {
|
|
6063
6122
|
this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
|
|
6064
6123
|
}
|
|
@@ -6098,32 +6157,32 @@ class us {
|
|
|
6098
6157
|
this.disable();
|
|
6099
6158
|
}
|
|
6100
6159
|
renderSelection(e, t) {
|
|
6101
|
-
var
|
|
6160
|
+
var a;
|
|
6102
6161
|
if (!this.container) return;
|
|
6103
|
-
const i = (
|
|
6162
|
+
const i = (a = this.client.state.user) == null ? void 0 : a.id;
|
|
6104
6163
|
if (e === i || (this.clearSelection(e), !t)) return;
|
|
6105
|
-
const s =
|
|
6164
|
+
const s = gs(t);
|
|
6106
6165
|
if (!s) return;
|
|
6107
6166
|
const o = this.client.state.presence.find(
|
|
6108
|
-
(
|
|
6167
|
+
(l) => l.user.id === e
|
|
6109
6168
|
), r = (o == null ? void 0 : o.user.color) ?? "#6366f1";
|
|
6110
6169
|
try {
|
|
6111
|
-
const
|
|
6112
|
-
for (let
|
|
6113
|
-
const
|
|
6114
|
-
Object.assign(
|
|
6170
|
+
const l = s.getClientRects(), d = [];
|
|
6171
|
+
for (let c = 0; c < l.length; c++) {
|
|
6172
|
+
const h = l[c], p = document.createElement("div");
|
|
6173
|
+
Object.assign(p.style, {
|
|
6115
6174
|
position: "absolute",
|
|
6116
|
-
left: `${
|
|
6117
|
-
top: `${
|
|
6118
|
-
width: `${
|
|
6119
|
-
height: `${
|
|
6175
|
+
left: `${h.left}px`,
|
|
6176
|
+
top: `${h.top}px`,
|
|
6177
|
+
width: `${h.width}px`,
|
|
6178
|
+
height: `${h.height}px`,
|
|
6120
6179
|
background: r,
|
|
6121
6180
|
opacity: "0.2",
|
|
6122
6181
|
borderRadius: "2px",
|
|
6123
6182
|
pointerEvents: "none"
|
|
6124
|
-
}), this.container.appendChild(
|
|
6183
|
+
}), this.container.appendChild(p), d.push(p);
|
|
6125
6184
|
}
|
|
6126
|
-
this.selectionEls.set(e,
|
|
6185
|
+
this.selectionEls.set(e, d);
|
|
6127
6186
|
} catch {
|
|
6128
6187
|
}
|
|
6129
6188
|
this.clearTimers.has(e) && clearTimeout(this.clearTimers.get(e)), this.clearTimers.set(
|
|
@@ -6141,12 +6200,12 @@ class us {
|
|
|
6141
6200
|
}
|
|
6142
6201
|
}
|
|
6143
6202
|
}
|
|
6144
|
-
var
|
|
6145
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
6203
|
+
var vs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
|
|
6204
|
+
for (var s = i > 1 ? void 0 : i ? xs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6146
6205
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6147
|
-
return i && s &&
|
|
6206
|
+
return i && s && vs(e, t, s), s;
|
|
6148
6207
|
};
|
|
6149
|
-
let
|
|
6208
|
+
let ue = class extends P {
|
|
6150
6209
|
constructor() {
|
|
6151
6210
|
super(...arguments), this.roomId = "";
|
|
6152
6211
|
}
|
|
@@ -6166,7 +6225,7 @@ let pe = class extends P {
|
|
|
6166
6225
|
);
|
|
6167
6226
|
}
|
|
6168
6227
|
renderToggle(n, e) {
|
|
6169
|
-
return
|
|
6228
|
+
return u`
|
|
6170
6229
|
<div class="setting-row">
|
|
6171
6230
|
<span class="setting-label">${n}</span>
|
|
6172
6231
|
<label class="toggle">
|
|
@@ -6182,12 +6241,12 @@ let pe = class extends P {
|
|
|
6182
6241
|
}
|
|
6183
6242
|
render() {
|
|
6184
6243
|
const n = !this.settings.enabled;
|
|
6185
|
-
return
|
|
6244
|
+
return u`
|
|
6186
6245
|
<div class="panel">
|
|
6187
6246
|
<div class="panel-header">
|
|
6188
6247
|
<span class="panel-title">Settings</span>
|
|
6189
6248
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
6190
|
-
${C(
|
|
6249
|
+
${C(be, 16)}
|
|
6191
6250
|
</button>
|
|
6192
6251
|
</div>
|
|
6193
6252
|
|
|
@@ -6232,11 +6291,11 @@ let pe = class extends P {
|
|
|
6232
6291
|
`;
|
|
6233
6292
|
}
|
|
6234
6293
|
};
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6294
|
+
ue.styles = [
|
|
6295
|
+
ie,
|
|
6296
|
+
ve,
|
|
6297
|
+
Ae,
|
|
6298
|
+
M`
|
|
6240
6299
|
:host {
|
|
6241
6300
|
display: block;
|
|
6242
6301
|
}
|
|
@@ -6407,16 +6466,16 @@ pe.styles = [
|
|
|
6407
6466
|
}
|
|
6408
6467
|
`
|
|
6409
6468
|
];
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
],
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
],
|
|
6416
|
-
|
|
6469
|
+
Ye([
|
|
6470
|
+
x({ attribute: !1 })
|
|
6471
|
+
], ue.prototype, "settings", 2);
|
|
6472
|
+
Ye([
|
|
6473
|
+
x()
|
|
6474
|
+
], ue.prototype, "roomId", 2);
|
|
6475
|
+
ue = Ye([
|
|
6417
6476
|
L("pulse-widget-settings-panel")
|
|
6418
|
-
],
|
|
6419
|
-
const
|
|
6477
|
+
], ue);
|
|
6478
|
+
const $e = {
|
|
6420
6479
|
enabled: !0,
|
|
6421
6480
|
showMyCursor: !0,
|
|
6422
6481
|
showOthersCursors: !0,
|
|
@@ -6427,22 +6486,22 @@ const we = {
|
|
|
6427
6486
|
showViewportIndicators: !0,
|
|
6428
6487
|
showSelections: !0,
|
|
6429
6488
|
showDrawings: !0
|
|
6430
|
-
},
|
|
6431
|
-
function
|
|
6489
|
+
}, _t = "pulse:settings:";
|
|
6490
|
+
function ys(n) {
|
|
6432
6491
|
try {
|
|
6433
|
-
const e = localStorage.getItem(`${
|
|
6434
|
-
return e ? {
|
|
6492
|
+
const e = localStorage.getItem(`${_t}${n}`);
|
|
6493
|
+
return e ? { ...$e, ...JSON.parse(e) } : { ...$e };
|
|
6435
6494
|
} catch {
|
|
6436
|
-
return {
|
|
6495
|
+
return { ...$e };
|
|
6437
6496
|
}
|
|
6438
6497
|
}
|
|
6439
|
-
function
|
|
6440
|
-
localStorage.setItem(`${
|
|
6498
|
+
function ws(n, e) {
|
|
6499
|
+
localStorage.setItem(`${_t}${n}`, JSON.stringify(e));
|
|
6441
6500
|
}
|
|
6442
|
-
var
|
|
6443
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
6501
|
+
var $s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
|
|
6502
|
+
for (var s = i > 1 ? void 0 : i ? ks(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6444
6503
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6445
|
-
return i && s &&
|
|
6504
|
+
return i && s && $s(e, t, s), s;
|
|
6446
6505
|
};
|
|
6447
6506
|
let R = class extends P {
|
|
6448
6507
|
constructor() {
|
|
@@ -6495,35 +6554,35 @@ let R = class extends P {
|
|
|
6495
6554
|
render() {
|
|
6496
6555
|
const n = this.display === "inline";
|
|
6497
6556
|
if (this.collapsed)
|
|
6498
|
-
return
|
|
6557
|
+
return u`
|
|
6499
6558
|
<div class="toolbar collapsed ${n ? "inline" : ""}" @click=${this.fireToggle}>
|
|
6500
|
-
<span class="fab-icon">${C(
|
|
6559
|
+
<span class="fab-icon">${C(zi, n ? 18 : 24)}</span>
|
|
6501
6560
|
</div>
|
|
6502
6561
|
`;
|
|
6503
6562
|
const e = this.users.slice(0, 3), t = this.users.length - 3;
|
|
6504
|
-
return
|
|
6563
|
+
return u`
|
|
6505
6564
|
<div class="toolbar ${n ? "inline" : ""}"
|
|
6506
6565
|
<!-- Presence avatars -->
|
|
6507
|
-
${this.users.length > 0 ?
|
|
6566
|
+
${this.users.length > 0 ? u`
|
|
6508
6567
|
<div class="presence">
|
|
6509
|
-
${t > 0 ?
|
|
6568
|
+
${t > 0 ? u`<div class="presence-overflow">+${t}</div>` : b}
|
|
6510
6569
|
${e.map(
|
|
6511
|
-
(i) =>
|
|
6570
|
+
(i) => u`
|
|
6512
6571
|
<div
|
|
6513
6572
|
class="presence-avatar clickable ${this.followingUserId === i.user.id ? "following" : ""}"
|
|
6514
6573
|
style="background:${i.user.color}"
|
|
6515
6574
|
@click=${() => this.fireFollow(i.user.id)}
|
|
6516
6575
|
title="Click to follow ${i.user.name}"
|
|
6517
6576
|
>
|
|
6518
|
-
${i.user.avatar ?
|
|
6577
|
+
${i.user.avatar ? u`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
|
|
6519
6578
|
<span class="presence-tooltip">${i.user.name}</span>
|
|
6520
|
-
${i.deviceType && i.deviceType !== "desktop" ?
|
|
6579
|
+
${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : b}
|
|
6521
6580
|
</div>
|
|
6522
6581
|
`
|
|
6523
6582
|
)}
|
|
6524
6583
|
</div>
|
|
6525
6584
|
<div class="separator"></div>
|
|
6526
|
-
` :
|
|
6585
|
+
` : b}
|
|
6527
6586
|
|
|
6528
6587
|
<!-- Pin comment (primary) -->
|
|
6529
6588
|
<button
|
|
@@ -6533,7 +6592,7 @@ let R = class extends P {
|
|
|
6533
6592
|
?disabled=${this.featuresDisabled}
|
|
6534
6593
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6535
6594
|
>
|
|
6536
|
-
${C(
|
|
6595
|
+
${C(At)}
|
|
6537
6596
|
</button>
|
|
6538
6597
|
|
|
6539
6598
|
<!-- View comments -->
|
|
@@ -6544,7 +6603,7 @@ let R = class extends P {
|
|
|
6544
6603
|
?disabled=${this.featuresDisabled}
|
|
6545
6604
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6546
6605
|
>
|
|
6547
|
-
${C(
|
|
6606
|
+
${C(Ai)}
|
|
6548
6607
|
</button>
|
|
6549
6608
|
|
|
6550
6609
|
<!-- Activity feed -->
|
|
@@ -6555,7 +6614,7 @@ let R = class extends P {
|
|
|
6555
6614
|
?disabled=${this.featuresDisabled}
|
|
6556
6615
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6557
6616
|
>
|
|
6558
|
-
${C(
|
|
6617
|
+
${C(Pi)}
|
|
6559
6618
|
</button>
|
|
6560
6619
|
|
|
6561
6620
|
<!-- Draw mode -->
|
|
@@ -6566,7 +6625,7 @@ let R = class extends P {
|
|
|
6566
6625
|
?disabled=${this.featuresDisabled}
|
|
6567
6626
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6568
6627
|
>
|
|
6569
|
-
${C(
|
|
6628
|
+
${C(Mi)}
|
|
6570
6629
|
</button>
|
|
6571
6630
|
|
|
6572
6631
|
<!-- Notifications -->
|
|
@@ -6577,8 +6636,8 @@ let R = class extends P {
|
|
|
6577
6636
|
?disabled=${this.featuresDisabled}
|
|
6578
6637
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
|
|
6579
6638
|
>
|
|
6580
|
-
${C(
|
|
6581
|
-
${this.unreadCount > 0 ?
|
|
6639
|
+
${C(Si)}
|
|
6640
|
+
${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : b}
|
|
6582
6641
|
</button>
|
|
6583
6642
|
|
|
6584
6643
|
<!-- Settings -->
|
|
@@ -6587,7 +6646,7 @@ let R = class extends P {
|
|
|
6587
6646
|
@click=${() => this.fire("settings")}
|
|
6588
6647
|
title="Settings"
|
|
6589
6648
|
>
|
|
6590
|
-
${C(
|
|
6649
|
+
${C(Ri)}
|
|
6591
6650
|
</button>
|
|
6592
6651
|
|
|
6593
6652
|
<div class="separator"></div>
|
|
@@ -6598,16 +6657,16 @@ let R = class extends P {
|
|
|
6598
6657
|
@click=${this.fireToggle}
|
|
6599
6658
|
title="Collapse"
|
|
6600
6659
|
>
|
|
6601
|
-
${C(
|
|
6660
|
+
${C(be, 14)}
|
|
6602
6661
|
</button>
|
|
6603
6662
|
</div>
|
|
6604
6663
|
`;
|
|
6605
6664
|
}
|
|
6606
6665
|
};
|
|
6607
6666
|
R.styles = [
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6667
|
+
ie,
|
|
6668
|
+
ve,
|
|
6669
|
+
M`
|
|
6611
6670
|
:host {
|
|
6612
6671
|
display: block;
|
|
6613
6672
|
}
|
|
@@ -6820,39 +6879,39 @@ R.styles = [
|
|
|
6820
6879
|
`
|
|
6821
6880
|
];
|
|
6822
6881
|
j([
|
|
6823
|
-
|
|
6882
|
+
x({ attribute: !1 })
|
|
6824
6883
|
], R.prototype, "client", 2);
|
|
6825
6884
|
j([
|
|
6826
|
-
|
|
6885
|
+
x({ type: Boolean })
|
|
6827
6886
|
], R.prototype, "collapsed", 2);
|
|
6828
6887
|
j([
|
|
6829
|
-
|
|
6888
|
+
x()
|
|
6830
6889
|
], R.prototype, "activePanel", 2);
|
|
6831
6890
|
j([
|
|
6832
|
-
|
|
6891
|
+
x({ type: Boolean })
|
|
6833
6892
|
], R.prototype, "pinModeActive", 2);
|
|
6834
6893
|
j([
|
|
6835
|
-
|
|
6894
|
+
x({ type: Boolean })
|
|
6836
6895
|
], R.prototype, "featuresDisabled", 2);
|
|
6837
6896
|
j([
|
|
6838
|
-
|
|
6897
|
+
x({ type: Boolean })
|
|
6839
6898
|
], R.prototype, "drawModeActive", 2);
|
|
6840
6899
|
j([
|
|
6841
|
-
|
|
6900
|
+
x()
|
|
6842
6901
|
], R.prototype, "followingUserId", 2);
|
|
6843
6902
|
j([
|
|
6844
|
-
|
|
6903
|
+
x()
|
|
6845
6904
|
], R.prototype, "display", 2);
|
|
6846
6905
|
j([
|
|
6847
|
-
|
|
6906
|
+
$()
|
|
6848
6907
|
], R.prototype, "users", 2);
|
|
6849
6908
|
j([
|
|
6850
|
-
|
|
6909
|
+
$()
|
|
6851
6910
|
], R.prototype, "unreadCount", 2);
|
|
6852
6911
|
R = j([
|
|
6853
6912
|
L("pulse-widget-toolbar")
|
|
6854
6913
|
], R);
|
|
6855
|
-
class
|
|
6914
|
+
class Es {
|
|
6856
6915
|
constructor(e) {
|
|
6857
6916
|
this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
|
|
6858
6917
|
}
|
|
@@ -6886,30 +6945,30 @@ class ys {
|
|
|
6886
6945
|
var r;
|
|
6887
6946
|
if (!this.container) return;
|
|
6888
6947
|
if (document.documentElement.scrollHeight <= window.innerHeight) {
|
|
6889
|
-
for (const
|
|
6948
|
+
for (const a of this.pillEls.values()) a.remove();
|
|
6890
6949
|
this.pillEls.clear();
|
|
6891
6950
|
return;
|
|
6892
6951
|
}
|
|
6893
6952
|
const e = window.scrollY, t = window.innerHeight, i = document.documentElement.scrollHeight, s = (r = this.client.state.user) == null ? void 0 : r.id, o = /* @__PURE__ */ new Set();
|
|
6894
|
-
for (const [
|
|
6895
|
-
if (
|
|
6896
|
-
const
|
|
6897
|
-
if (
|
|
6898
|
-
const E = this.pillEls.get(
|
|
6953
|
+
for (const [a, l] of this.client.state.viewports) {
|
|
6954
|
+
if (a === s) continue;
|
|
6955
|
+
const d = l.scrollY, c = l.scrollY + l.viewportHeight, h = e, p = e + t;
|
|
6956
|
+
if (d >= h && c <= p) {
|
|
6957
|
+
const E = this.pillEls.get(a);
|
|
6899
6958
|
E && (E.style.display = "none");
|
|
6900
6959
|
continue;
|
|
6901
6960
|
}
|
|
6902
|
-
o.add(
|
|
6903
|
-
const
|
|
6904
|
-
(E) => E.user.id ===
|
|
6961
|
+
o.add(a);
|
|
6962
|
+
const m = this.client.state.presence.find(
|
|
6963
|
+
(E) => E.user.id === a
|
|
6905
6964
|
);
|
|
6906
|
-
if (!
|
|
6907
|
-
const
|
|
6965
|
+
if (!m) continue;
|
|
6966
|
+
const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0, v = Math.max(
|
|
6908
6967
|
8,
|
|
6909
|
-
Math.min(t - 28,
|
|
6968
|
+
Math.min(t - 28, y * t)
|
|
6910
6969
|
);
|
|
6911
|
-
let
|
|
6912
|
-
|
|
6970
|
+
let w = this.pillEls.get(a);
|
|
6971
|
+
w || (w = document.createElement("div"), Object.assign(w.style, {
|
|
6913
6972
|
position: "absolute",
|
|
6914
6973
|
right: "8px",
|
|
6915
6974
|
padding: "2px 6px",
|
|
@@ -6921,23 +6980,23 @@ class ys {
|
|
|
6921
6980
|
whiteSpace: "nowrap",
|
|
6922
6981
|
pointerEvents: "none",
|
|
6923
6982
|
transition: "top 0.3s ease"
|
|
6924
|
-
}), this.container.appendChild(
|
|
6983
|
+
}), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${v}px`, w.textContent = this.getInitials(m.user.name);
|
|
6925
6984
|
}
|
|
6926
|
-
for (const [
|
|
6927
|
-
!o.has(
|
|
6985
|
+
for (const [a, l] of this.pillEls)
|
|
6986
|
+
!o.has(a) && !this.client.state.viewports.has(a) && (l.remove(), this.pillEls.delete(a));
|
|
6928
6987
|
}
|
|
6929
6988
|
getInitials(e) {
|
|
6930
6989
|
return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
|
|
6931
6990
|
}
|
|
6932
6991
|
}
|
|
6933
|
-
var
|
|
6934
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
6992
|
+
var Cs = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, _ = (n, e, t, i) => {
|
|
6993
|
+
for (var s = i > 1 ? void 0 : i ? Ts(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6935
6994
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6936
|
-
return i && s &&
|
|
6995
|
+
return i && s && Cs(e, t, s), s;
|
|
6937
6996
|
};
|
|
6938
6997
|
let T = class extends P {
|
|
6939
6998
|
constructor() {
|
|
6940
|
-
super(...arguments), this.apiKey = "", this.token = "", this.room = "", this.position = "bottom-right", this.display = "floating", this.collapsed = !0, this.activePanel = null, this.pinModeActive = !1, this.highlightThreadId = null, this.settings = {
|
|
6999
|
+
super(...arguments), this.apiKey = "", this.token = "", this.room = "", this.position = "bottom-right", this.display = "floating", this.collapsed = !0, this.activePanel = null, this.pinModeActive = !1, this.highlightThreadId = null, this.settings = { ...$e }, this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
|
|
6941
7000
|
!this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
|
|
6942
7001
|
var n;
|
|
6943
7002
|
this._viewportThrottleTimer = null, (n = this.client) == null || n.updateViewport({
|
|
@@ -6958,7 +7017,7 @@ let T = class extends P {
|
|
|
6958
7017
|
(t = this.client) == null || t.updateSelection(null);
|
|
6959
7018
|
return;
|
|
6960
7019
|
}
|
|
6961
|
-
const e =
|
|
7020
|
+
const e = ms(n);
|
|
6962
7021
|
(i = this.client) == null || i.updateSelection(e);
|
|
6963
7022
|
}, 500));
|
|
6964
7023
|
}, this.handleDocumentClick = (n) => {
|
|
@@ -6990,11 +7049,11 @@ let T = class extends P {
|
|
|
6990
7049
|
room: this.room,
|
|
6991
7050
|
endpoint: this.endpoint
|
|
6992
7051
|
};
|
|
6993
|
-
this.client = new
|
|
7052
|
+
this.client = new $t(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new us(this.client), this.commentPins = new ns(this.client, {
|
|
6994
7053
|
onPinModeExit: () => {
|
|
6995
7054
|
this.pinModeActive = !1;
|
|
6996
7055
|
}
|
|
6997
|
-
}), this.viewportOverlay = new
|
|
7056
|
+
}), this.viewportOverlay = new Es(this.client), this.selectionOverlay = new bs(this.client), this.drawingOverlay = new fs(this.client), this.settings = ys(this.room), this.applySettings(this.settings), this.unsubs.push(
|
|
6998
7057
|
this.client.on("connection", (e) => {
|
|
6999
7058
|
this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
|
|
7000
7059
|
this.showConnectedFlash = !1, this._connectedFlashTimer = null;
|
|
@@ -7061,15 +7120,15 @@ let T = class extends P {
|
|
|
7061
7120
|
}
|
|
7062
7121
|
handleSettingsChange(n) {
|
|
7063
7122
|
const e = n.detail;
|
|
7064
|
-
this.settings = e,
|
|
7123
|
+
this.settings = e, ws(this.room, e), this.applySettings(e);
|
|
7065
7124
|
}
|
|
7066
7125
|
applySettings(n) {
|
|
7067
|
-
var e, t, i, s, o, r, l,
|
|
7126
|
+
var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y, v, w;
|
|
7068
7127
|
if (!n.enabled) {
|
|
7069
|
-
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (
|
|
7128
|
+
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (a = this.commentPins) == null || a.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((l = this.commentPins) == null || l.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
|
|
7070
7129
|
return;
|
|
7071
7130
|
}
|
|
7072
|
-
this.applyCursorSettings(n), (
|
|
7131
|
+
this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (p = this.viewportOverlay) == null || p.disable(), n.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (g = this.selectionOverlay) == null || g.disable(), n.showDrawings ? (y = this.drawingOverlay) == null || y.enable() : ((v = this.drawingOverlay) == null || v.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
|
|
7073
7132
|
}
|
|
7074
7133
|
applyCursorSettings(n) {
|
|
7075
7134
|
if (!this.cursorOverlay) return;
|
|
@@ -7083,30 +7142,30 @@ let T = class extends P {
|
|
|
7083
7142
|
* the trigger element, flipping vertically/horizontally as needed.
|
|
7084
7143
|
*/
|
|
7085
7144
|
positionPopups() {
|
|
7086
|
-
var
|
|
7087
|
-
const n = this.display === "inline", e = (
|
|
7145
|
+
var g, y, v, w;
|
|
7146
|
+
const n = this.display === "inline", e = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".inline-trigger"), t = (y = this.shadowRoot) == null ? void 0 : y.querySelector("pulse-widget-toolbar"), i = n ? e : t;
|
|
7088
7147
|
if (!i) return;
|
|
7089
|
-
const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight,
|
|
7090
|
-
if (
|
|
7091
|
-
Object.assign(
|
|
7092
|
-
const E =
|
|
7093
|
-
|
|
7094
|
-
}
|
|
7095
|
-
const
|
|
7148
|
+
const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (v = this.shadowRoot) == null ? void 0 : v.querySelector(".toolbar-popover");
|
|
7149
|
+
if (l) {
|
|
7150
|
+
Object.assign(l.style, { top: "auto", left: "auto" });
|
|
7151
|
+
const E = l.getBoundingClientRect(), I = this.computePosition(s, E, o, r, a);
|
|
7152
|
+
l.style.top = `${I.top}px`, l.style.left = `${I.left}px`;
|
|
7153
|
+
}
|
|
7154
|
+
const d = (w = this.shadowRoot) == null ? void 0 : w.querySelector(".panel-container");
|
|
7155
|
+
if (!d) return;
|
|
7156
|
+
Object.assign(d.style, { top: "auto", left: "auto" });
|
|
7157
|
+
const c = l ?? t;
|
|
7096
7158
|
if (!c) return;
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
if (!h) return;
|
|
7100
|
-
const p = h.getBoundingClientRect(), u = c.getBoundingClientRect(), f = this.computePosition(p, u, o, r, l);
|
|
7101
|
-
c.style.top = `${f.top}px`, c.style.left = `${f.left}px`;
|
|
7159
|
+
const h = c.getBoundingClientRect(), p = d.getBoundingClientRect(), m = this.computePosition(h, p, o, r, a);
|
|
7160
|
+
d.style.top = `${m.top}px`, d.style.left = `${m.left}px`;
|
|
7102
7161
|
}
|
|
7103
7162
|
computePosition(n, e, t, i, s) {
|
|
7104
7163
|
const o = n.top, r = i - n.bottom;
|
|
7105
|
-
let l;
|
|
7106
|
-
o >= e.height + s ? l = n.top - e.height - s : r >= e.height + s ? l = n.bottom + s : l = o >= r ? Math.max(s, n.top - e.height - s) : n.bottom + s;
|
|
7107
7164
|
let a;
|
|
7108
|
-
|
|
7109
|
-
|
|
7165
|
+
o >= e.height + s ? a = n.top - e.height - s : r >= e.height + s ? a = n.bottom + s : a = o >= r ? Math.max(s, n.top - e.height - s) : n.bottom + s;
|
|
7166
|
+
let l;
|
|
7167
|
+
const d = n.right - e.width;
|
|
7168
|
+
return d >= s ? l = d : n.left + e.width + s <= t ? l = n.left : l = Math.max(s, Math.min(t - e.width - s, n.left)), a = Math.max(s, Math.min(i - e.height - s, a)), l = Math.max(s, Math.min(t - e.width - s, l)), { top: a, left: l };
|
|
7110
7169
|
}
|
|
7111
7170
|
getFollowUserName() {
|
|
7112
7171
|
var e;
|
|
@@ -7117,13 +7176,13 @@ let T = class extends P {
|
|
|
7117
7176
|
return (n == null ? void 0 : n.user.name) ?? "user";
|
|
7118
7177
|
}
|
|
7119
7178
|
renderConnectionBanner() {
|
|
7120
|
-
return this.showConnectedFlash ?
|
|
7179
|
+
return this.showConnectedFlash ? u`<div class="connection-banner connected">
|
|
7121
7180
|
<span class="connection-dot"></span>Connected
|
|
7122
|
-
</div>` : this.connectionState === "connecting" ?
|
|
7181
|
+
</div>` : this.connectionState === "connecting" ? u`<div class="connection-banner connecting">
|
|
7123
7182
|
<span class="connection-dot"></span>Reconnecting...
|
|
7124
|
-
</div>` : this.connectionState === "disconnected" && this.client ?
|
|
7183
|
+
</div>` : this.connectionState === "disconnected" && this.client ? u`<div class="connection-banner disconnected">
|
|
7125
7184
|
<span class="connection-dot"></span>Disconnected
|
|
7126
|
-
</div>` :
|
|
7185
|
+
</div>` : b;
|
|
7127
7186
|
}
|
|
7128
7187
|
handleToolbarToggle() {
|
|
7129
7188
|
this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
|
|
@@ -7131,38 +7190,38 @@ let T = class extends P {
|
|
|
7131
7190
|
render() {
|
|
7132
7191
|
const n = this.display === "inline";
|
|
7133
7192
|
if (n && this.collapsed)
|
|
7134
|
-
return
|
|
7193
|
+
return u`
|
|
7135
7194
|
<div class="widget-root">
|
|
7136
7195
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
7137
7196
|
<slot>Collaborate</slot>
|
|
7138
7197
|
</div>
|
|
7139
7198
|
</div>
|
|
7140
7199
|
`;
|
|
7141
|
-
const e = this.activePanel ?
|
|
7200
|
+
const e = this.activePanel ? u`
|
|
7142
7201
|
<div class="panel-container anchored" @panel-close=${this.handlePanelClose}>
|
|
7143
|
-
${this.activePanel === "comments" ?
|
|
7202
|
+
${this.activePanel === "comments" ? u`<pulse-widget-comments-panel
|
|
7144
7203
|
.client=${this.client}
|
|
7145
7204
|
.highlightThreadId=${this.highlightThreadId}
|
|
7146
|
-
></pulse-widget-comments-panel>` :
|
|
7147
|
-
${this.activePanel === "settings" ?
|
|
7205
|
+
></pulse-widget-comments-panel>` : b}
|
|
7206
|
+
${this.activePanel === "settings" ? u`<pulse-widget-settings-panel
|
|
7148
7207
|
.settings=${this.settings}
|
|
7149
7208
|
.roomId=${this.room}
|
|
7150
7209
|
@settings-change=${this.handleSettingsChange}
|
|
7151
|
-
></pulse-widget-settings-panel>` :
|
|
7152
|
-
${this.activePanel === "notifications" ?
|
|
7210
|
+
></pulse-widget-settings-panel>` : b}
|
|
7211
|
+
${this.activePanel === "notifications" ? u`<pulse-widget-notifications-panel
|
|
7153
7212
|
.client=${this.client}
|
|
7154
|
-
></pulse-widget-notifications-panel>` :
|
|
7155
|
-
${this.activePanel === "activity" ?
|
|
7213
|
+
></pulse-widget-notifications-panel>` : b}
|
|
7214
|
+
${this.activePanel === "activity" ? u`<pulse-widget-activity-panel
|
|
7156
7215
|
.client=${this.client}
|
|
7157
|
-
></pulse-widget-activity-panel>` :
|
|
7216
|
+
></pulse-widget-activity-panel>` : b}
|
|
7158
7217
|
</div>
|
|
7159
|
-
` :
|
|
7218
|
+
` : b, t = this.followingUserId ? u`<div class="follow-banner">
|
|
7160
7219
|
Following ${this.getFollowUserName()}
|
|
7161
7220
|
<button @click=${() => {
|
|
7162
7221
|
this.followingUserId = null;
|
|
7163
7222
|
}}>Stop</button>
|
|
7164
|
-
</div>` :
|
|
7165
|
-
return n ?
|
|
7223
|
+
</div>` : b;
|
|
7224
|
+
return n ? u`
|
|
7166
7225
|
${t}
|
|
7167
7226
|
<div class="widget-root">
|
|
7168
7227
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
@@ -7186,7 +7245,7 @@ let T = class extends P {
|
|
|
7186
7245
|
</div>
|
|
7187
7246
|
${e}
|
|
7188
7247
|
</div>
|
|
7189
|
-
` :
|
|
7248
|
+
` : u`
|
|
7190
7249
|
${t}
|
|
7191
7250
|
<div class="widget-root">
|
|
7192
7251
|
${e}
|
|
@@ -7209,8 +7268,8 @@ let T = class extends P {
|
|
|
7209
7268
|
}
|
|
7210
7269
|
};
|
|
7211
7270
|
T.styles = [
|
|
7212
|
-
|
|
7213
|
-
|
|
7271
|
+
ie,
|
|
7272
|
+
M`
|
|
7214
7273
|
:host {
|
|
7215
7274
|
display: block;
|
|
7216
7275
|
}
|
|
@@ -7386,60 +7445,60 @@ T.styles = [
|
|
|
7386
7445
|
}
|
|
7387
7446
|
`
|
|
7388
7447
|
];
|
|
7389
|
-
|
|
7390
|
-
|
|
7448
|
+
_([
|
|
7449
|
+
x({ attribute: "api-key" })
|
|
7391
7450
|
], T.prototype, "apiKey", 2);
|
|
7392
|
-
|
|
7393
|
-
|
|
7451
|
+
_([
|
|
7452
|
+
x()
|
|
7394
7453
|
], T.prototype, "token", 2);
|
|
7395
|
-
|
|
7396
|
-
|
|
7454
|
+
_([
|
|
7455
|
+
x()
|
|
7397
7456
|
], T.prototype, "room", 2);
|
|
7398
|
-
|
|
7399
|
-
|
|
7457
|
+
_([
|
|
7458
|
+
x()
|
|
7400
7459
|
], T.prototype, "endpoint", 2);
|
|
7401
|
-
|
|
7402
|
-
|
|
7460
|
+
_([
|
|
7461
|
+
x({ reflect: !0 })
|
|
7403
7462
|
], T.prototype, "position", 2);
|
|
7404
|
-
|
|
7405
|
-
|
|
7463
|
+
_([
|
|
7464
|
+
x({ reflect: !0 })
|
|
7406
7465
|
], T.prototype, "display", 2);
|
|
7407
|
-
|
|
7408
|
-
|
|
7466
|
+
_([
|
|
7467
|
+
$()
|
|
7409
7468
|
], T.prototype, "collapsed", 2);
|
|
7410
|
-
|
|
7411
|
-
|
|
7469
|
+
_([
|
|
7470
|
+
$()
|
|
7412
7471
|
], T.prototype, "activePanel", 2);
|
|
7413
|
-
|
|
7414
|
-
|
|
7472
|
+
_([
|
|
7473
|
+
$()
|
|
7415
7474
|
], T.prototype, "pinModeActive", 2);
|
|
7416
|
-
|
|
7417
|
-
|
|
7475
|
+
_([
|
|
7476
|
+
$()
|
|
7418
7477
|
], T.prototype, "highlightThreadId", 2);
|
|
7419
|
-
|
|
7420
|
-
|
|
7478
|
+
_([
|
|
7479
|
+
$()
|
|
7421
7480
|
], T.prototype, "settings", 2);
|
|
7422
|
-
|
|
7423
|
-
|
|
7481
|
+
_([
|
|
7482
|
+
$()
|
|
7424
7483
|
], T.prototype, "followingUserId", 2);
|
|
7425
|
-
|
|
7426
|
-
|
|
7484
|
+
_([
|
|
7485
|
+
$()
|
|
7427
7486
|
], T.prototype, "drawModeActive", 2);
|
|
7428
|
-
|
|
7429
|
-
|
|
7487
|
+
_([
|
|
7488
|
+
$()
|
|
7430
7489
|
], T.prototype, "connectionState", 2);
|
|
7431
|
-
|
|
7432
|
-
|
|
7490
|
+
_([
|
|
7491
|
+
$()
|
|
7433
7492
|
], T.prototype, "showConnectedFlash", 2);
|
|
7434
|
-
T =
|
|
7493
|
+
T = _([
|
|
7435
7494
|
L("pulse-widget")
|
|
7436
7495
|
], T);
|
|
7437
7496
|
export {
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7497
|
+
Y as PulseComments,
|
|
7498
|
+
de as PulseCursors,
|
|
7499
|
+
he as PulseNotifications,
|
|
7441
7500
|
Z as PulsePresence,
|
|
7442
|
-
|
|
7443
|
-
|
|
7501
|
+
X as PulseProvider,
|
|
7502
|
+
B as PulseReactions,
|
|
7444
7503
|
T as PulseWidget
|
|
7445
7504
|
};
|