@moq/watch 0.2.14 → 0.2.15

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.
Files changed (49) hide show
  1. package/README.md +10 -9
  2. package/audio/source.d.ts.map +1 -1
  3. package/broadcast-jtLUfuyL.js +4291 -0
  4. package/broadcast-jtLUfuyL.js.map +1 -0
  5. package/broadcast.d.ts.map +1 -1
  6. package/dom-Yz3UT5ap.js +29 -0
  7. package/dom-Yz3UT5ap.js.map +1 -0
  8. package/element.js +162 -178
  9. package/element.js.map +1 -1
  10. package/index.d.ts +0 -4
  11. package/index.d.ts.map +1 -1
  12. package/index.js +5 -289
  13. package/libav-opus-af-CzuaKpJb.js +252 -0
  14. package/libav-opus-af-CzuaKpJb.js.map +1 -0
  15. package/main-bFFHfuX4.js +1999 -0
  16. package/main-bFFHfuX4.js.map +1 -0
  17. package/package.json +5 -4
  18. package/support/element.js +122 -172
  19. package/support/element.js.map +1 -1
  20. package/support/index.js +52 -53
  21. package/support/index.js.map +1 -1
  22. package/ui/element.js +335 -359
  23. package/ui/element.js.map +1 -1
  24. package/video/source.d.ts.map +1 -1
  25. package/broadcast-CLjMphZS.js +0 -5000
  26. package/broadcast-CLjMphZS.js.map +0 -1
  27. package/chat/index.d.ts +0 -17
  28. package/chat/index.d.ts.map +0 -1
  29. package/chat/message.d.ts +0 -16
  30. package/chat/message.d.ts.map +0 -1
  31. package/chat/typing.d.ts +0 -16
  32. package/chat/typing.d.ts.map +0 -1
  33. package/dom-BsFrLb_F.js +0 -35
  34. package/dom-BsFrLb_F.js.map +0 -1
  35. package/index.js.map +0 -1
  36. package/libav-opus-af-BlMWboA7.js +0 -368
  37. package/libav-opus-af-BlMWboA7.js.map +0 -1
  38. package/location/index.d.ts +0 -17
  39. package/location/index.d.ts.map +0 -1
  40. package/location/peers.d.ts +0 -16
  41. package/location/peers.d.ts.map +0 -1
  42. package/location/window.d.ts +0 -17
  43. package/location/window.d.ts.map +0 -1
  44. package/main-DGBFe0O7.js +0 -2301
  45. package/main-DGBFe0O7.js.map +0 -1
  46. package/preview.d.ts +0 -23
  47. package/preview.d.ts.map +0 -1
  48. package/user.d.ts +0 -17
  49. package/user.d.ts.map +0 -1
package/ui/element.js CHANGED
@@ -1,382 +1,358 @@
1
- import { Signal as R, Effect as T } from "@moq/signals";
2
- import { c as v, r as C } from "../dom-BsFrLb_F.js";
3
- const j = 0, E = 10, P = 4e3, F = 48;
4
- function S(o, t, e, r, a) {
5
- const n = o.getContext("2d");
6
- if (!n) return;
7
- const i = window.devicePixelRatio || 1, s = o.getBoundingClientRect(), l = s.width, c = s.height, p = Math.round(l * i), d = Math.round(c * i);
8
- if ((o.width !== p || o.height !== d) && (o.width = p, o.height = d), n.setTransform(i, 0, 0, i, 0, 0), n.clearRect(0, 0, l, c), e === void 0) return;
9
- const h = 2, f = c - h * 2, b = 2;
10
- for (let m = 0; m < t.length; m++) {
11
- const x = t[m], A = x.start - e, k = x.end - e, y = Math.max(0, A), N = Math.min(k, r);
12
- if (N <= y) continue;
13
- const u = y / r * l, g = Math.max(2, (N - y) / r * l);
14
- if (n.globalAlpha = 0.85, n.fillStyle = a ? "#f87171" : m > 0 ? "#facc15" : "#4ade80", typeof n.roundRect == "function" ? (n.beginPath(), n.roundRect(u, h, g, f, b), n.fill()) : n.fillRect(u, h, g, f), k > r) {
15
- const w = ((k - r) / 1e3).toFixed(1);
16
- n.globalAlpha = 0.7, n.fillStyle = "black", n.font = "500 9px system-ui, sans-serif", n.textAlign = "right", n.textBaseline = "middle", n.fillText(`+${w}s`, u + g - 4, c / 2);
17
- }
18
- }
1
+ import { n as e, t } from "../dom-Yz3UT5ap.js";
2
+ import { Effect as n, Signal as r } from "@moq/signals";
3
+ //#region src/ui/components/buffer-control.ts
4
+ var i = 0, a = 10, o = 4e3, s = 48;
5
+ function c(e, t, n, r, i) {
6
+ let a = e.getContext("2d");
7
+ if (!a) return;
8
+ let o = window.devicePixelRatio || 1, s = e.getBoundingClientRect(), c = s.width, l = s.height, u = Math.round(c * o), d = Math.round(l * o);
9
+ if ((e.width !== u || e.height !== d) && (e.width = u, e.height = d), a.setTransform(o, 0, 0, o, 0, 0), a.clearRect(0, 0, c, l), n === void 0) return;
10
+ let f = l - 4;
11
+ for (let e = 0; e < t.length; e++) {
12
+ let o = t[e], s = o.start - n, u = o.end - n, d = Math.max(0, s), p = Math.min(u, r);
13
+ if (p <= d) continue;
14
+ let m = d / r * c, h = Math.max(2, (p - d) / r * c);
15
+ if (a.globalAlpha = .85, a.fillStyle = i ? "#f87171" : e > 0 ? "#facc15" : "#4ade80", typeof a.roundRect == "function" ? (a.beginPath(), a.roundRect(m, 2, h, f, 2), a.fill()) : a.fillRect(m, 2, h, f), u > r) {
16
+ let e = ((u - r) / 1e3).toFixed(1);
17
+ a.globalAlpha = .7, a.fillStyle = "black", a.font = "500 9px system-ui, sans-serif", a.textAlign = "right", a.textBaseline = "middle", a.fillText(`+${e}s`, m + h - 4, l / 2);
18
+ }
19
+ }
19
20
  }
20
- function V(o, t, e = P) {
21
- const r = document.createElement("div");
22
- r.className = "buffer";
23
- const a = document.createElement("div");
24
- a.className = "buffer-visualization", a.setAttribute("role", "slider"), a.tabIndex = 0, a.setAttribute("aria-valuemin", j.toString()), a.setAttribute("aria-valuemax", e.toString()), a.setAttribute("aria-label", "Buffer jitter");
25
- const n = document.createElement("div");
26
- n.className = "buffer-playhead";
27
- const i = document.createElement("div");
28
- i.className = "buffer-track buffer-track--video";
29
- const s = document.createElement("span");
30
- s.className = "buffer-track-label", s.textContent = "Video";
31
- const l = document.createElement("canvas");
32
- l.className = "buffer-canvas", i.append(s, l);
33
- const c = document.createElement("div");
34
- c.className = "buffer-track buffer-track--audio";
35
- const p = document.createElement("span");
36
- p.className = "buffer-track-label", p.textContent = "Audio";
37
- const d = document.createElement("canvas");
38
- d.className = "buffer-canvas", c.append(p, d);
39
- const h = document.createElement("div");
40
- h.className = "buffer-target-area";
41
- const f = document.createElement("div");
42
- f.className = "buffer-target-line";
43
- const b = document.createElement("span");
44
- b.className = "buffer-target-label", f.appendChild(b), h.appendChild(f);
45
- const m = document.createElement("span");
46
- m.className = "buffer-help", m.textContent = "click to change latency", a.append(n, i, c, h, m), r.appendChild(a);
47
- let x = !1, A = !1;
48
- o.run((u) => {
49
- const g = u.get(t.backend.jitter), w = g / e * 100;
50
- f.style.left = `${w}%`, b.textContent = `${Math.round(g)}ms`, a.setAttribute("aria-valuenow", g.toString());
51
- });
52
- const k = (u) => {
53
- const g = a.getBoundingClientRect(), w = g.width - F, H = Math.max(0, Math.min(u - g.left - F, w)) / w * e, I = Math.round(H / E) * E, W = Math.max(j, Math.min(e, I));
54
- t.backend.latency.set(W);
55
- }, y = () => {
56
- A || (A = !0, m.style.display = "none");
57
- };
58
- o.event(a, "mousedown", (u) => {
59
- x = !0, a.classList.add("buffer-visualization--dragging"), y(), k(u.clientX);
60
- }), o.event(document, "mousemove", (u) => {
61
- x && k(u.clientX);
62
- }), o.event(document, "mouseup", () => {
63
- x && (x = !1, a.classList.remove("buffer-visualization--dragging"));
64
- }), o.event(a, "keydown", (u) => {
65
- let g = 0;
66
- if (u.key === "ArrowRight" || u.key === "ArrowUp")
67
- g = E;
68
- else if (u.key === "ArrowLeft" || u.key === "ArrowDown")
69
- g = -E;
70
- else
71
- return;
72
- u.preventDefault(), y();
73
- const w = t.backend.jitter.peek(), L = Math.max(j, Math.min(e, w + g));
74
- t.backend.latency.set(L);
75
- });
76
- const N = () => {
77
- const u = t.backend.sync.now(), g = t.backend.video.stalled.peek();
78
- S(l, t.backend.video.buffered.peek(), u, e, g), S(d, t.backend.audio.buffered.peek(), u, e, g), o.animate(N);
79
- };
80
- return o.animate(N), r;
21
+ function l(e, t, n = o) {
22
+ let r = document.createElement("div");
23
+ r.className = "buffer";
24
+ let l = document.createElement("div");
25
+ l.className = "buffer-visualization", l.setAttribute("role", "slider"), l.tabIndex = 0, l.setAttribute("aria-valuemin", i.toString()), l.setAttribute("aria-valuemax", n.toString()), l.setAttribute("aria-label", "Buffer jitter");
26
+ let u = document.createElement("div");
27
+ u.className = "buffer-playhead";
28
+ let d = document.createElement("div");
29
+ d.className = "buffer-track buffer-track--video";
30
+ let f = document.createElement("span");
31
+ f.className = "buffer-track-label", f.textContent = "Video";
32
+ let p = document.createElement("canvas");
33
+ p.className = "buffer-canvas", d.append(f, p);
34
+ let m = document.createElement("div");
35
+ m.className = "buffer-track buffer-track--audio";
36
+ let h = document.createElement("span");
37
+ h.className = "buffer-track-label", h.textContent = "Audio";
38
+ let g = document.createElement("canvas");
39
+ g.className = "buffer-canvas", m.append(h, g);
40
+ let _ = document.createElement("div");
41
+ _.className = "buffer-target-area";
42
+ let v = document.createElement("div");
43
+ v.className = "buffer-target-line";
44
+ let y = document.createElement("span");
45
+ y.className = "buffer-target-label", v.appendChild(y), _.appendChild(v);
46
+ let b = document.createElement("span");
47
+ b.className = "buffer-help", b.textContent = "click to change latency", l.append(u, d, m, _, b), r.appendChild(l);
48
+ let x = !1, S = !1;
49
+ e.run((e) => {
50
+ let r = e.get(t.backend.jitter), i = r / n * 100;
51
+ v.style.left = `${i}%`, y.textContent = `${Math.round(r)}ms`, l.setAttribute("aria-valuenow", r.toString());
52
+ });
53
+ let C = (e) => {
54
+ let r = l.getBoundingClientRect(), o = r.width - s, c = Math.max(0, Math.min(e - r.left - s, o)) / o * n, u = Math.round(c / a) * a, d = Math.max(i, Math.min(n, u));
55
+ t.backend.latency.set(d);
56
+ }, w = () => {
57
+ S || (S = !0, b.style.display = "none");
58
+ };
59
+ e.event(l, "mousedown", (e) => {
60
+ x = !0, l.classList.add("buffer-visualization--dragging"), w(), C(e.clientX);
61
+ }), e.event(document, "mousemove", (e) => {
62
+ x && C(e.clientX);
63
+ }), e.event(document, "mouseup", () => {
64
+ x && (x = !1, l.classList.remove("buffer-visualization--dragging"));
65
+ }), e.event(l, "keydown", (e) => {
66
+ let r = 0;
67
+ if (e.key === "ArrowRight" || e.key === "ArrowUp") r = a;
68
+ else if (e.key === "ArrowLeft" || e.key === "ArrowDown") r = -10;
69
+ else return;
70
+ e.preventDefault(), w();
71
+ let o = t.backend.jitter.peek(), s = Math.max(i, Math.min(n, o + r));
72
+ t.backend.latency.set(s);
73
+ });
74
+ let T = () => {
75
+ let r = t.backend.sync.now(), i = t.backend.video.stalled.peek();
76
+ c(p, t.backend.video.buffered.peek(), r, n, i), c(g, t.backend.audio.buffered.peek(), r, n, i), e.animate(T);
77
+ };
78
+ return e.animate(T), r;
81
79
  }
82
- function O(o, t) {
83
- const e = document.createElement("div");
84
- e.className = "buffering";
85
- const r = document.createElement("div");
86
- return r.className = "buffering-spinner", e.appendChild(r), o.run((a) => {
87
- const n = a.get(t.backend.video.stalled), i = a.get(t.broadcast.status) === "offline";
88
- e.style.display = n && !i ? "" : "none";
89
- }), e;
80
+ //#endregion
81
+ //#region src/ui/components/buffering-indicator.ts
82
+ function u(e, t) {
83
+ let n = document.createElement("div");
84
+ n.className = "buffering";
85
+ let r = document.createElement("div");
86
+ return r.className = "buffering-spinner", n.appendChild(r), e.run((e) => {
87
+ let r = e.get(t.backend.video.stalled), i = e.get(t.broadcast.status) === "offline";
88
+ n.style.display = r && !i ? "" : "none";
89
+ }), n;
90
90
  }
91
- const U = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
92
- <path d="M9 18V5l12-2v13" />
93
- <circle cx="6" cy="18" r="3" />
94
- <circle cx="18" cy="16" r="3" />
95
- </svg>`, D = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
96
- <path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" />
97
- </svg>`, _ = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
98
- <path d="M8 3H5a2 2 0 0 0-2 2v3" />
99
- <path d="M21 8V5a2 2 0 0 0-2-2h-3" />
100
- <path d="M3 16v3a2 2 0 0 0 2 2h3" />
101
- <path d="M16 21h3a2 2 0 0 0 2-2v-3" />
102
- </svg>`, X = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
103
- <path d="M8 3v3a2 2 0 0 1-2 2H3" />
104
- <path d="M21 8h-3a2 2 0 0 1-2-2V3" />
105
- <path d="M3 16h3a2 2 0 0 1 2 2v3" />
106
- <path d="M16 21v-3a2 2 0 0 1 2-2h3" />
107
- </svg>`, G = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
108
- <path d="M16 9a5 5 0 0 1 .95 2.293" />
109
- <path d="M19.364 5.636a9 9 0 0 1 1.889 9.96" />
110
- <path d="m2 2 20 20" />
111
- <path d="m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11" />
112
- <path d="M9.828 4.172A.686.686 0 0 1 11 4.657v.686" />
113
- </svg>`, Q = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
114
- <path d="M16.247 7.761a6 6 0 0 1 0 8.478" />
115
- <path d="M19.075 4.933a10 10 0 0 1 0 14.134" />
116
- <path d="M4.925 19.067a10 10 0 0 1 0-14.134" />
117
- <path d="M7.753 16.239a6 6 0 0 1 0-8.478" />
118
- <circle cx="12" cy="12" r="2" />
119
- </svg>`, J = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
120
- <rect x="14" y="3" width="5" height="18" rx="1" />
121
- <rect x="5" y="3" width="5" height="18" rx="1" />
122
- </svg>`, K = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
123
- <path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" />
124
- </svg>`, Y = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
125
- <path d="M5 21v-6" />
126
- <path d="M12 21V3" />
127
- <path d="M19 21V9" />
128
- </svg>`, Z = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
129
- <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" />
130
- <rect x="2" y="6" width="14" height="12" rx="2" />
131
- </svg>`, tt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
132
- <path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
133
- <path d="M16 9a5 5 0 0 1 0 6" />
134
- <path d="M19.364 18.364a9 9 0 0 0 0-12.728" />
135
- </svg>`, et = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
136
- <path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
137
- </svg>`, at = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="var(--color-white)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
138
- <path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
139
- <path d="M16 9a5 5 0 0 1 0 6" />
140
- </svg>`;
141
- function M(o) {
142
- const t = document.createElement("span");
143
- return t.className = "flex-center", t.setAttribute("role", "img"), t.setAttribute("aria-hidden", "true"), t.innerHTML = o, t;
91
+ //#endregion
92
+ //#region src/ui/icons/audio.svg?raw
93
+ var d = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n</svg>", f = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" />\n</svg>", p = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 3H5a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 8V5a2 2 0 0 0-2-2h-3\" />\n <path d=\"M3 16v3a2 2 0 0 0 2 2h3\" />\n <path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />\n</svg>", m = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 3v3a2 2 0 0 1-2 2H3\" />\n <path d=\"M21 8h-3a2 2 0 0 1-2-2V3\" />\n <path d=\"M3 16h3a2 2 0 0 1 2 2v3\" />\n <path d=\"M16 21v-3a2 2 0 0 1 2-2h3\" />\n</svg>", h = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M16 9a5 5 0 0 1 .95 2.293\" />\n <path d=\"M19.364 5.636a9 9 0 0 1 1.889 9.96\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11\" />\n <path d=\"M9.828 4.172A.686.686 0 0 1 11 4.657v.686\" />\n</svg>", g = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M16.247 7.761a6 6 0 0 1 0 8.478\" />\n <path d=\"M19.075 4.933a10 10 0 0 1 0 14.134\" />\n <path d=\"M4.925 19.067a10 10 0 0 1 0-14.134\" />\n <path d=\"M7.753 16.239a6 6 0 0 1 0-8.478\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n</svg>", _ = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n</svg>", v = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n</svg>", y = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M5 21v-6\" />\n <path d=\"M12 21V3\" />\n <path d=\"M19 21V9\" />\n</svg>", b = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <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\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n</svg>", x = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n <path d=\"M19.364 18.364a9 9 0 0 0 0-12.728\" />\n</svg>", S = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n</svg>", C = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"var(--color-white)\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n</svg>";
94
+ //#endregion
95
+ //#region src/ui/icons.ts
96
+ function w(e) {
97
+ let t = document.createElement("span");
98
+ return t.className = "flex-center", t.setAttribute("role", "img"), t.setAttribute("aria-hidden", "true"), t.innerHTML = e, t;
144
99
  }
145
- function ot(o, t) {
146
- const e = document.createElement("button");
147
- e.type = "button", e.className = "button flex-center", e.title = "Fullscreen", e.setAttribute("aria-label", "Fullscreen"), e.replaceChildren(M(_));
148
- const r = () => {
149
- const a = !!document.fullscreenElement;
150
- e.replaceChildren(M(a ? X : _));
151
- };
152
- return o.event(document, "fullscreenchange", r), o.event(e, "click", () => {
153
- document.fullscreenElement ? document.exitFullscreen() : t.requestFullscreen();
154
- }), e;
100
+ //#endregion
101
+ //#region src/ui/components/fullscreen-button.ts
102
+ function T(e, t) {
103
+ let n = document.createElement("button");
104
+ return n.type = "button", n.className = "button flex-center", n.title = "Fullscreen", n.setAttribute("aria-label", "Fullscreen"), n.replaceChildren(w(p)), e.event(document, "fullscreenchange", () => {
105
+ let e = !!document.fullscreenElement;
106
+ n.replaceChildren(w(e ? m : p));
107
+ }), e.event(n, "click", () => {
108
+ document.fullscreenElement ? document.exitFullscreen() : t.requestFullscreen();
109
+ }), n;
155
110
  }
156
- function nt(o, t) {
157
- const e = document.createElement("div");
158
- e.className = "watch-ui__offline-indicator", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite");
159
- const r = document.createElement("span");
160
- return r.className = "watch-ui__offline-text", r.textContent = "OFFLINE", e.appendChild(r), o.run((a) => {
161
- const n = a.get(t.broadcast.status) === "offline";
162
- e.style.display = n ? "" : "none";
163
- }), e;
111
+ //#endregion
112
+ //#region src/ui/components/offline-indicator.ts
113
+ function E(e, t) {
114
+ let n = document.createElement("div");
115
+ n.className = "watch-ui__offline-indicator", n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite");
116
+ let r = document.createElement("span");
117
+ return r.className = "watch-ui__offline-text", r.textContent = "OFFLINE", n.appendChild(r), e.run((e) => {
118
+ let r = e.get(t.broadcast.status) === "offline";
119
+ n.style.display = r ? "" : "none";
120
+ }), n;
164
121
  }
165
- function rt(o, t) {
166
- const e = document.createElement("button");
167
- return e.type = "button", e.className = "button button--playback flex-center", o.run((r) => {
168
- const a = r.get(t.backend.paused);
169
- e.title = a ? "Play" : "Pause", e.setAttribute("aria-label", a ? "Play" : "Pause"), e.replaceChildren(M(a ? K : J));
170
- }), o.event(e, "click", () => {
171
- t.paused = !t.paused;
172
- }), e;
122
+ //#endregion
123
+ //#region src/ui/components/play-pause.ts
124
+ function D(e, t) {
125
+ let n = document.createElement("button");
126
+ return n.type = "button", n.className = "button button--playback flex-center", e.run((e) => {
127
+ let r = e.get(t.backend.paused);
128
+ n.title = r ? "Play" : "Pause", n.setAttribute("aria-label", r ? "Play" : "Pause"), n.replaceChildren(w(r ? v : _));
129
+ }), e.event(n, "click", () => {
130
+ t.paused = !t.paused;
131
+ }), n;
173
132
  }
174
- function it(o) {
175
- return o >= 1e6 ? `${(o / 1e6).toFixed(1)} Mbps` : o >= 1e3 ? `${(o / 1e3).toFixed(0)} kbps` : `${o} bps`;
133
+ //#endregion
134
+ //#region src/ui/components/quality-selector.ts
135
+ function O(e) {
136
+ return e >= 1e6 ? `${(e / 1e6).toFixed(1)} Mbps` : e >= 1e3 ? `${(e / 1e3).toFixed(0)} kbps` : `${e} bps`;
176
137
  }
177
- function st(o, t) {
178
- const e = document.createElement("div");
179
- e.className = "quality-selector";
180
- const r = document.createElement("label");
181
- r.htmlFor = "moq-watch-quality-select", r.className = "quality-label", r.textContent = "Quality: ";
182
- const a = document.createElement("select");
183
- return a.id = "moq-watch-quality-select", a.className = "quality-select", e.append(r, a), o.run((n) => {
184
- const i = n.get(t.backend.video.source.catalog), s = n.get(t.backend.video.source.track), l = i?.renditions ?? {};
185
- a.replaceChildren();
186
- const c = document.createElement("option");
187
- c.value = "", c.textContent = "Auto", a.appendChild(c);
188
- for (const [p, d] of Object.entries(l)) {
189
- const h = document.createElement("option");
190
- h.value = p;
191
- const f = d.codedWidth && d.codedHeight ? ` (${d.codedWidth}x${d.codedHeight})` : "", b = d.bitrate ? ` ${it(d.bitrate)}` : "";
192
- h.textContent = `${p}${f}${b}`, a.appendChild(h);
193
- }
194
- a.value = s ?? "";
195
- }), o.event(a, "change", () => {
196
- const n = a.value || void 0;
197
- t.backend.video.source.target.update((i) => ({ ...i, name: n }));
198
- }), e;
138
+ function k(e, t) {
139
+ let n = document.createElement("div");
140
+ n.className = "quality-selector";
141
+ let r = document.createElement("label");
142
+ r.htmlFor = "moq-watch-quality-select", r.className = "quality-label", r.textContent = "Quality: ";
143
+ let i = document.createElement("select");
144
+ return i.id = "moq-watch-quality-select", i.className = "quality-select", n.append(r, i), e.run((e) => {
145
+ let n = e.get(t.backend.video.source.catalog), r = e.get(t.backend.video.source.track), a = n?.renditions ?? {};
146
+ i.replaceChildren();
147
+ let o = document.createElement("option");
148
+ o.value = "", o.textContent = "Auto", i.appendChild(o);
149
+ for (let [e, t] of Object.entries(a)) {
150
+ let n = document.createElement("option");
151
+ n.value = e, n.textContent = `${e}${t.codedWidth && t.codedHeight ? ` (${t.codedWidth}x${t.codedHeight})` : ""}${t.bitrate ? ` ${O(t.bitrate)}` : ""}`, i.appendChild(n);
152
+ }
153
+ i.value = r ?? "";
154
+ }), e.event(i, "change", () => {
155
+ let e = i.value || void 0;
156
+ t.backend.video.source.target.update((t) => ({
157
+ ...t,
158
+ name: e
159
+ }));
160
+ }), n;
199
161
  }
200
- function lt(o, t) {
201
- const e = document.createElement("button");
202
- return e.type = "button", e.className = "button flex-center", e.replaceChildren(M(Y)), o.run((r) => {
203
- const a = r.get(t);
204
- e.title = a ? "Hide stats" : "Show stats", e.setAttribute("aria-label", e.title);
205
- }), o.event(e, "click", () => {
206
- t.update((r) => !r);
207
- }), e;
162
+ //#endregion
163
+ //#region src/ui/components/stats-button.ts
164
+ function A(e, t) {
165
+ let n = document.createElement("button");
166
+ return n.type = "button", n.className = "button flex-center", n.replaceChildren(w(y)), e.run((e) => {
167
+ n.title = e.get(t) ? "Hide stats" : "Show stats", n.setAttribute("aria-label", n.title);
168
+ }), e.event(n, "click", () => {
169
+ t.update((e) => !e);
170
+ }), n;
208
171
  }
209
- function ct(o, t) {
210
- return t || o === 0 ? G : o <= 33 ? et : o <= 66 ? at : tt;
172
+ //#endregion
173
+ //#region src/ui/components/volume-slider.ts
174
+ function j(e, t) {
175
+ return t || e === 0 ? h : e <= 33 ? S : e <= 66 ? C : x;
211
176
  }
212
- function dt(o, t) {
213
- const e = document.createElement("div");
214
- e.className = "volume-slider flex-center";
215
- const r = document.createElement("button");
216
- r.type = "button", r.className = "button flex-center";
217
- const a = document.createElement("input");
218
- a.type = "range", a.min = "0", a.max = "100";
219
- const n = document.createElement("span");
220
- return n.className = "volume-label", e.append(r, a, n), o.run((i) => {
221
- const s = i.get(t.backend.audio.volume), l = i.get(t.backend.audio.muted), c = Math.round(s * 100);
222
- a.value = c.toString(), n.textContent = c.toString(), r.title = l ? "Unmute" : "Mute", r.setAttribute("aria-label", r.title), r.replaceChildren(M(ct(c, l)));
223
- }), o.event(a, "input", () => {
224
- t.backend.audio.volume.set(Number.parseFloat(a.value) / 100);
225
- }), o.event(r, "click", () => {
226
- t.backend.audio.muted.update((i) => !i);
227
- }), e;
177
+ function M(e, t) {
178
+ let n = document.createElement("div");
179
+ n.className = "volume-slider flex-center";
180
+ let r = document.createElement("button");
181
+ r.type = "button", r.className = "button flex-center";
182
+ let i = document.createElement("input");
183
+ i.type = "range", i.min = "0", i.max = "100";
184
+ let a = document.createElement("span");
185
+ return a.className = "volume-label", n.append(r, i, a), e.run((e) => {
186
+ let n = e.get(t.backend.audio.volume), o = e.get(t.backend.audio.muted), s = Math.round(n * 100);
187
+ i.value = s.toString(), a.textContent = s.toString(), r.title = o ? "Unmute" : "Mute", r.setAttribute("aria-label", r.title), r.replaceChildren(w(j(s, o)));
188
+ }), e.event(i, "input", () => {
189
+ t.backend.audio.volume.set(Number.parseFloat(i.value) / 100);
190
+ }), e.event(r, "click", () => {
191
+ t.backend.audio.muted.update((e) => !e);
192
+ }), n;
228
193
  }
229
- function ut(o, t, e) {
230
- return o ? t === "disconnected" ? { variant: "error", text: "Disconnected" } : t === "connecting" ? { variant: "connecting", text: "Connecting..." } : e === "offline" ? { variant: "error", text: "Offline" } : e === "loading" ? { variant: "loading", text: "Loading..." } : e === "live" ? { variant: "live", text: "Live" } : { variant: "connected", text: "Connected" } : { variant: "error", text: "No URL" };
194
+ //#endregion
195
+ //#region src/ui/components/watch-status-indicator.ts
196
+ function N(e, t, n) {
197
+ return e ? t === "disconnected" ? {
198
+ variant: "error",
199
+ text: "Disconnected"
200
+ } : t === "connecting" ? {
201
+ variant: "connecting",
202
+ text: "Connecting..."
203
+ } : n === "offline" ? {
204
+ variant: "error",
205
+ text: "Offline"
206
+ } : n === "loading" ? {
207
+ variant: "loading",
208
+ text: "Loading..."
209
+ } : n === "live" ? {
210
+ variant: "live",
211
+ text: "Live"
212
+ } : {
213
+ variant: "connected",
214
+ text: "Connected"
215
+ } : {
216
+ variant: "error",
217
+ text: "No URL"
218
+ };
231
219
  }
232
- function pt(o, t) {
233
- const e = document.createElement("div");
234
- e.className = "status-indicator flex-center";
235
- const r = document.createElement("span"), a = document.createElement("span");
236
- return e.append(r, a), o.run((n) => {
237
- const i = n.get(t.connection.url), s = n.get(t.connection.status), l = n.get(t.broadcast.status), { variant: c, text: p } = ut(i, s, l);
238
- r.className = `status-indicator-dot status-indicator-dot--${c}`, a.className = `status-indicator-text status-indicator-text--${c}`, a.textContent = p;
239
- }), e;
220
+ function P(e, t) {
221
+ let n = document.createElement("div");
222
+ n.className = "status-indicator flex-center";
223
+ let r = document.createElement("span"), i = document.createElement("span");
224
+ return n.append(r, i), e.run((e) => {
225
+ let { variant: n, text: a } = N(e.get(t.connection.url), e.get(t.connection.status), e.get(t.broadcast.status));
226
+ r.className = `status-indicator-dot status-indicator-dot--${n}`, i.className = `status-indicator-text status-indicator-text--${n}`, i.textContent = a;
227
+ }), n;
240
228
  }
241
- const $ = 250;
242
- function z(o, t, e) {
243
- const r = v("div", { className: `stats-item stats-item--${o}` }), a = v("div", { className: "stats-icon-wrapper" });
244
- a.appendChild(M(e));
245
- const n = v("span", { className: "stats-item-title" }, t), i = v("span", { className: "stats-item-data" }, "N/A"), s = v("div", { className: "stats-item-detail" });
246
- return s.append(n, i), r.append(a, s), { el: r, data: i };
229
+ //#endregion
230
+ //#region src/ui/stats.ts
231
+ var F = 250;
232
+ function I(e, n, r) {
233
+ let i = t("div", { className: `stats-item stats-item--${e}` }), a = t("div", { className: "stats-icon-wrapper" });
234
+ a.appendChild(w(r));
235
+ let o = t("span", { className: "stats-item-title" }, n), s = t("span", { className: "stats-item-data" }, "N/A"), c = t("div", { className: "stats-item-detail" });
236
+ return c.append(o, s), i.append(a, c), {
237
+ el: i,
238
+ data: s
239
+ };
247
240
  }
248
- function B(o) {
249
- return o >= 1e6 ? `${(o / 1e6).toFixed(1)}Mbps` : o >= 1e3 ? `${(o / 1e3).toFixed(0)}kbps` : `${o.toFixed(0)}bps`;
241
+ function L(e) {
242
+ return e >= 1e6 ? `${(e / 1e6).toFixed(1)}Mbps` : e >= 1e3 ? `${(e / 1e3).toFixed(0)}kbps` : `${e.toFixed(0)}bps`;
250
243
  }
251
- function q(o, t) {
252
- if (o === void 0 || o <= 0) return null;
253
- const e = t === "down" ? "↓" : "↑";
254
- return o >= 1e9 ? `${e} ${(o / 1e9).toFixed(1)}Gbps` : `${e} ${B(o)}`;
244
+ function R(e, t) {
245
+ if (e === void 0 || e <= 0) return null;
246
+ let n = t === "down" ? "↓" : "↑";
247
+ return e >= 1e9 ? `${n} ${(e / 1e9).toFixed(1)}Gbps` : `${n} ${L(e)}`;
255
248
  }
256
- function ht(o, t) {
257
- const { el: e, data: r } = z("network", "network", Q);
258
- return o.interval(() => {
259
- const a = t.connection.established.peek();
260
- if (!a) {
261
- r.textContent = "N/A";
262
- return;
263
- }
264
- const n = a.rtt?.peek(), i = [
265
- q(a.recvBandwidth?.peek(), "down"),
266
- q(a.sendBandwidth?.peek(), "up"),
267
- n !== void 0 && n > 0 ? `${n.toFixed(0)}ms` : null
268
- ].filter((s) => s !== null);
269
- r.textContent = i.length > 0 ? i.join(`
270
- `) : "N/A";
271
- }, $), e;
249
+ function z(e, t) {
250
+ let { el: n, data: r } = I("network", "network", g);
251
+ return e.interval(() => {
252
+ let e = t.connection.established.peek();
253
+ if (!e) {
254
+ r.textContent = "N/A";
255
+ return;
256
+ }
257
+ let n = e.rtt?.peek(), i = [
258
+ R(e.recvBandwidth?.peek(), "down"),
259
+ R(e.sendBandwidth?.peek(), "up"),
260
+ n !== void 0 && n > 0 ? `${n.toFixed(0)}ms` : null
261
+ ].filter((e) => e !== null);
262
+ r.textContent = i.length > 0 ? i.join("\n") : "N/A";
263
+ }, F), n;
272
264
  }
273
- function gt(o, t) {
274
- const { el: e, data: r } = z("video", "video", Z);
275
- let a = 0, n = 0, i = performance.now();
276
- return o.interval(() => {
277
- const s = t.backend.video.source.catalog.peek(), l = t.backend.video.stats.peek(), c = performance.now(), p = c - i;
278
- let d;
279
- if (l && a > 0 && p > 0) {
280
- const m = l.frameCount - a;
281
- m > 0 && (d = m / (p / 1e3));
282
- }
283
- let h;
284
- if (l && n > 0 && p > 0) {
285
- const m = l.bytesReceived - n;
286
- m > 0 && (h = B(m * 8 * (1e3 / p)));
287
- }
288
- l && (a = l.frameCount, n = l.bytesReceived, i = c);
289
- const { width: f, height: b } = s?.display ?? {};
290
- r.textContent = [
291
- f && b ? `${f}x${b}` : "N/A",
292
- d !== void 0 ? `@${d.toFixed(1)} fps` : "N/A",
293
- h ?? "N/A"
294
- ].join(`
295
- `);
296
- }, $), e;
265
+ function B(e, t) {
266
+ let { el: n, data: r } = I("video", "video", b), i = 0, a = 0, o = performance.now();
267
+ return e.interval(() => {
268
+ let e = t.backend.video.source.catalog.peek(), n = t.backend.video.stats.peek(), s = performance.now(), c = s - o, l;
269
+ if (n && i > 0 && c > 0) {
270
+ let e = n.frameCount - i;
271
+ e > 0 && (l = e / (c / 1e3));
272
+ }
273
+ let u;
274
+ if (n && a > 0 && c > 0) {
275
+ let e = n.bytesReceived - a;
276
+ e > 0 && (u = L(e * 8 * (1e3 / c)));
277
+ }
278
+ n && (i = n.frameCount, a = n.bytesReceived, o = s);
279
+ let { width: d, height: f } = e?.display ?? {};
280
+ r.textContent = [
281
+ d && f ? `${d}x${f}` : "N/A",
282
+ l === void 0 ? "N/A" : `@${l.toFixed(1)} fps`,
283
+ u ?? "N/A"
284
+ ].join("\n");
285
+ }, F), n;
297
286
  }
298
- function ft(o, t) {
299
- const { el: e, data: r } = z("audio", "audio", U);
300
- let a = 0, n = performance.now();
301
- return o.interval(() => {
302
- const i = t.backend.audio.source.track.peek(), s = t.backend.audio.source.config.peek(), l = t.backend.audio.stats.peek();
303
- if (!i || !s) {
304
- r.textContent = "N/A";
305
- return;
306
- }
307
- const c = performance.now();
308
- let p;
309
- if (l && a > 0) {
310
- const h = l.bytesReceived - a, f = c - n;
311
- h > 0 && f > 0 && (p = B(h * 8 * (1e3 / f)));
312
- }
313
- l && (a = l.bytesReceived, n = c);
314
- const d = [];
315
- s.sampleRate && d.push(`${(s.sampleRate / 1e3).toFixed(1)}kHz`), s.numberOfChannels && d.push(`${s.numberOfChannels}ch`), d.push(p ?? "N/A"), s.codec && d.push(s.codec), r.textContent = d.length > 0 ? d.join(`
316
- `) : "N/A";
317
- }, $), e;
287
+ function V(e, t) {
288
+ let { el: n, data: r } = I("audio", "audio", d), i = 0, a = performance.now();
289
+ return e.interval(() => {
290
+ let e = t.backend.audio.source.track.peek(), n = t.backend.audio.source.config.peek(), o = t.backend.audio.stats.peek();
291
+ if (!e || !n) {
292
+ r.textContent = "N/A";
293
+ return;
294
+ }
295
+ let s = performance.now(), c;
296
+ if (o && i > 0) {
297
+ let e = o.bytesReceived - i, t = s - a;
298
+ e > 0 && t > 0 && (c = L(e * 8 * (1e3 / t)));
299
+ }
300
+ o && (i = o.bytesReceived, a = s);
301
+ let l = [];
302
+ n.sampleRate && l.push(`${(n.sampleRate / 1e3).toFixed(1)}kHz`), n.numberOfChannels && l.push(`${n.numberOfChannels}ch`), l.push(c ?? "N/A"), n.codec && l.push(n.codec), r.textContent = l.length > 0 ? l.join("\n") : "N/A";
303
+ }, F), n;
318
304
  }
319
- function mt(o, t) {
320
- const { el: e, data: r } = z("buffer", "buffer", D);
321
- return o.run((a) => {
322
- const n = a.get(t.backend.jitter);
323
- r.textContent = `${Math.round(n)}ms`;
324
- }), e;
305
+ function H(e, t) {
306
+ let { el: n, data: r } = I("buffer", "buffer", f);
307
+ return e.run((e) => {
308
+ let n = e.get(t.backend.jitter);
309
+ r.textContent = `${Math.round(n)}ms`;
310
+ }), n;
325
311
  }
326
- function vt(o, t, e) {
327
- const r = v("div", { className: "stats" }), a = v("div", { className: "stats-panel" });
328
- return r.appendChild(a), o.run((n) => {
329
- const i = n.get(e);
330
- r.style.display = i ? "" : "none", i && (C(n, a, ht(n, t)), C(n, a, gt(n, t)), C(n, a, ft(n, t)), C(n, a, mt(n, t)));
331
- }), r;
312
+ function U(n, r, i) {
313
+ let a = t("div", { className: "stats" }), o = t("div", { className: "stats-panel" });
314
+ return a.appendChild(o), n.run((t) => {
315
+ let n = t.get(i);
316
+ a.style.display = n ? "" : "none", n && (e(t, o, z(t, r)), e(t, o, B(t, r)), e(t, o, V(t, r)), e(t, o, H(t, r)));
317
+ }), a;
332
318
  }
333
- const bt = ':host{--color-white: #ffffff;--color-white-alpha-05: rgba(255, 255, 255, .05);--color-white-alpha-10: rgba(255, 255, 255, .1);--color-white-alpha-15: rgba(255, 255, 255, .15);--color-white-alpha-20: rgba(255, 255, 255, .2);--color-white-alpha-25: rgba(255, 255, 255, .25);--color-white-alpha-30: rgba(255, 255, 255, .3);--color-white-alpha-40: rgba(255, 255, 255, .4);--color-white-alpha-70: rgba(255, 255, 255, .7);--color-white-alpha-90: rgba(255, 255, 255, .9);--color-gray-100: #9ca3af;--color-gray-950: #1a1a1a;--color-blue-400: #00dfff;--color-blue-500: #52a1ff;--color-blue-900: #1b3243;--color-purple-400: #a855f7;--color-purple-900: #31144a;--color-green-400: #65ee2e;--color-green-900: #3d4928;--color-yellow-400: #facc15;--color-orange-400: #ff9900;--color-orange-450: #fb923c;--color-orange-500: #f97316;--color-orange-900: #4d301b;--color-amber-600: #d97706;--color-orange-500-alpha-60: rgba(249, 115, 22, .6);--color-orange-500-alpha-80: rgba(249, 115, 22, .8);--color-black-alpha-08: rgba(0, 0, 0, .08);--color-black-alpha-10: rgba(0, 0, 0, .1);--color-black-alpha-40: rgba(0, 0, 0, .4);--color-black-alpha-85: rgba(0, 0, 0, .85);--spacing-1: .0625rem;--spacing-2: .125rem;--spacing-4: .25rem;--spacing-8: .5rem;--spacing-12: .75rem;--spacing-16: 1rem;--spacing-24: 1.5rem;--spacing-32: 2rem;--spacing-48: 3rem;--border-radius-sm: .5rem;--border-radius-md: .75rem;--border-radius-lg: 1rem}.flex-center{display:flex;justify-content:center;align-items:center}.flex-align-center{align-items:center}.button{color:var(--color-white);cursor:pointer;background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid var(--color-white-alpha-20);border-radius:50%;width:2.25rem;height:2.25rem;transform-origin:center;transition:transform .1s cubic-bezier(.4,0,.2,1)}.button:hover:not(:disabled){transform:scale(1.02);background-color:var(--color-white-alpha-20);box-shadow:0 var(--spacing-2) var(--spacing-8) var(--color-black-alpha-10)}.button:active:not(:disabled){transform:scale(.98);box-shadow:0 var(--spacing-1) var(--spacing-4) var(--color-black-alpha-08)}.button:disabled{opacity:.5;cursor:default;color:var(--color-gray-100)}.stats{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;pointer-events:none;z-index:2;width:100%;height:inherit;container-type:inline-size}.stats .stats-panel{position:absolute;display:flex;align-items:flex-start;justify-content:center;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-12);max-width:240px;width:100%;background-color:var(--color-black-alpha-85);border:1px solid var(--color-white-alpha-25);border-radius:8px;padding:var(--spacing-12);pointer-events:auto;top:8px}@container (width > 480px) and (width <= 768px){.stats .stats-panel{max-width:360px;padding:var(--spacing-24)}}@container (width > 768px){.stats .stats-panel{max-width:600px;padding:var(--spacing-24)}}.stats .stats-panel .stats-item{display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:row;height:auto;column-gap:var(--spacing-8);flex-basis:calc(50% - var(--spacing-12));flex-grow:1;flex-shrink:1}@container (width > 480px){.stats .stats-panel .stats-item{flex-basis:calc(25% - var(--spacing-12))}}.stats .stats-panel .stats-item .stats-icon-wrapper{display:none;padding:var(--spacing-8);border-radius:8px;width:fit-content;height:fit-content;flex-shrink:0}@container (width > 480px){.stats .stats-panel .stats-item .stats-icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-direction:row}}.stats .stats-panel .stats-item .stats-icon-wrapper svg{width:100%;height:100%}.stats .stats-panel .stats-item.stats-item--network .stats-icon-wrapper{background-color:var(--color-blue-900)}.stats .stats-panel .stats-item.stats-item--network,.stats .stats-panel .stats-item.stats-item--network .stats-item-data{color:var(--color-blue-400)}.stats .stats-panel .stats-item.stats-item--video .stats-icon-wrapper{background-color:var(--color-purple-900)}.stats .stats-panel .stats-item.stats-item--video,.stats .stats-panel .stats-item.stats-item--video .stats-item-data{color:var(--color-purple-400)}.stats .stats-panel .stats-item.stats-item--audio .stats-icon-wrapper{background-color:var(--color-green-900)}.stats .stats-panel .stats-item.stats-item--audio,.stats .stats-panel .stats-item.stats-item--audio .stats-item-data{color:var(--color-green-400)}.stats .stats-panel .stats-item.stats-item--buffer .stats-icon-wrapper{background-color:var(--color-orange-900)}.stats .stats-panel .stats-item.stats-item--buffer,.stats .stats-panel .stats-item.stats-item--buffer .stats-item-data{color:var(--color-orange-400)}.stats .stats-panel .stats-item .stats-item-detail{display:flex;align-items:flex-start;justify-content:space-evenly;flex-direction:column;gap:var(--spacing-4)}.stats .stats-panel .stats-item .stats-item-detail .stats-item-title{font-size:12px;font-weight:500;text-transform:capitalize;color:var(--color-gray-100);font-family:Segoe UI,Roboto,sans-serif;letter-spacing:1px;line-height:12px}.stats .stats-panel .stats-item .stats-item-detail .stats-item-data{font-size:16px;font-weight:700;font-family:Segoe UI,Roboto,sans-serif;white-space:pre-wrap;line-height:1.5}.video-container{display:block;position:relative;width:100%;height:auto;border-radius:var(--spacing-4);margin:0 auto;pointer-events:none}.controls{display:flex;flex-direction:column;gap:var(--spacing-24)}.button.button--playback{width:3rem;height:3rem;background:linear-gradient(to bottom right,var(--color-orange-400),var(--color-orange-500),var(--color-amber-600));box-shadow:0 0 var(--spacing-16) var(--color-orange-500-alpha-60);transition:box-shadow .15s cubic-bezier(.4,0,.2,1);position:relative;overflow:hidden}.button.button--playback:hover:not(:disabled){box-shadow:0 0 var(--spacing-24) var(--color-orange-500-alpha-80);transform:scale(1.02)}.button.button--playback:active:not(:disabled){transform:scale(.98)}.button.button--playback:before{content:"";position:absolute;inset:0;background:linear-gradient(to bottom right,var(--color-white-alpha-30),transparent);opacity:0;transition:opacity .15s cubic-bezier(.4,0,.2,1);pointer-events:none}.button.button--playback:hover:before{opacity:1}.button.button--playback:after{content:"";position:absolute;inset:0;background-color:var(--color-white-alpha-20);border-radius:50%;filter:blur(var(--spacing-24));pointer-events:none}.playback-controls{display:flex;place-content:center space-around;gap:var(--spacing-8);padding:var(--spacing-8) 0}.latency-controls{display:flex;flex-direction:column;gap:var(--spacing-16)}.volume-slider{gap:var(--spacing-4)}.volume-label{width:var(--spacing-16);text-align:right}.quality-selector{display:flex;align-items:center;gap:var(--spacing-8);background:transparent;border-radius:var(--spacing-8)}.quality-label{font-size:1.25rem;font-weight:500;color:var(--color-white);white-space:nowrap}.quality-select{flex:0 1 auto;font-size:1rem;padding:var(--spacing-8);border-radius:var(--spacing-4);background:var(--color-white-alpha-10);color:var(--color-white);border:var(--spacing-1) solid var(--color-white-alpha-20);cursor:pointer;transition:background .2s ease}.quality-select:hover{background:var(--color-white-alpha-15)}.quality-select:focus{outline:var(--spacing-2) solid var(--color-white-alpha-30);outline-offset:var(--spacing-2)}.quality-select option{background:var(--color-gray-950);color:var(--color-white)}.buffer{width:100%}.buffer-visualization{position:relative;width:100%;height:3.75rem;background:var(--color-white-alpha-10);border-radius:var(--spacing-4);cursor:pointer;user-select:none;padding-left:var(--spacing-48);box-sizing:border-box}.buffer-playhead{position:absolute;left:var(--spacing-48);top:0;bottom:0;width:var(--spacing-2);background:var(--color-white);z-index:3}.buffer-track{display:flex;align-items:center;position:absolute;left:var(--spacing-48);right:0;height:var(--spacing-24)}.buffer-track--video{top:var(--spacing-4)}.buffer-track--audio{top:var(--spacing-32)}.buffer-track-label{position:absolute;left:-2.875rem;width:2.5rem;font-size:.625rem;color:var(--color-white-alpha-70);text-align:right;padding-right:var(--spacing-4);pointer-events:none;box-sizing:border-box}.buffer-canvas{position:absolute;top:0;left:0;width:100%;height:100%}.buffer-target-area{position:absolute;top:0;bottom:0;left:var(--spacing-48);right:0;pointer-events:none}.buffer-target-line{position:absolute;top:0;bottom:0;width:.1875rem;background:var(--color-orange-400, var(--color-orange-450));z-index:2;cursor:ew-resize;border-radius:var(--spacing-1);pointer-events:auto}.buffer-target-label{position:absolute;bottom:100%;left:50%;transform:translate(-50%);font-size:.6875rem;font-weight:500;color:var(--color-orange-400, var(--color-orange-450));white-space:nowrap;margin-bottom:var(--spacing-2);opacity:0;transition:opacity .15s ease;pointer-events:none}.buffer-visualization:hover .buffer-target-label,.buffer-visualization--dragging .buffer-target-label{opacity:1}.buffer-help{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.75rem;color:var(--color-white-alpha-30, rgba(255, 255, 255, .3));pointer-events:none;white-space:nowrap}.buffering{position:absolute;display:flex;align-items:center;justify-content:center;width:100%;height:100%;top:0;left:0;z-index:1;background-color:var(--color-black-alpha-40);backdrop-filter:blur(var(--spacing-2));pointer-events:auto}.buffering-spinner{width:2.5rem;height:2.5rem;border:var(--spacing-4) solid var(--color-white-alpha-20);border-top:var(--spacing-4) solid var(--color-white);border-radius:50%;animation:buffer-spin 1s linear infinite}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.watch-ui__offline-indicator{position:absolute;bottom:1rem;right:1rem;padding:.5rem 1rem;display:flex;align-items:center;justify-content:center;background-color:#000;z-index:4;pointer-events:auto;border-radius:.25rem}.watch-ui__offline-text{font-size:.875rem;font-weight:700;color:#fff;letter-spacing:.08em;text-shadow:none}@media(max-width:768px){.watch-ui__offline-indicator{bottom:.75rem;right:.75rem;padding:.375rem .75rem}.watch-ui__offline-text{font-size:.75rem}}@media(max-width:480px){.watch-ui__offline-indicator{bottom:.5rem;right:.5rem;padding:.25rem .5rem}.watch-ui__offline-text{font-size:.75rem}}.status-indicator{gap:var(--spacing-12);backdrop-filter:blur(var(--spacing-16))}.status-indicator-dot{position:relative;width:.75rem;height:.75rem;border-radius:50%;flex-shrink:0;z-index:1}.status-indicator-dot:after{content:"";position:absolute;inset:0;border-radius:50%;background:currentcolor;transform:scale(1);opacity:.5;animation:status-pulse 1.5s ease-out infinite;z-index:-1}.status-indicator-dot:after{display:none}.status-indicator-dot--live:after,.status-indicator-dot--connected:after,.status-indicator-dot--loading:after,.status-indicator-dot--connecting:after{display:block}.status-indicator-dot--error{background:var(--color-gray-100);color:var(--color-gray-100)}.status-indicator-text--error{color:var(--color-gray-100)}.status-indicator-dot--connecting{background:var(--color-yellow-400);color:var(--color-yellow-400)}.status-indicator-text--connecting{color:var(--color-yellow-400)}.status-indicator-dot--loading{background:var(--color-yellow-400);color:var(--color-yellow-400)}.status-indicator-text--loading{color:var(--color-yellow-400)}.status-indicator-dot--live{background:var(--color-green-400);color:var(--color-green-400)}.status-indicator-text--live{color:var(--color-green-400)}.status-indicator-dot--connected{background:var(--color-blue-500);color:var(--color-blue-500)}.status-indicator-text--connected{color:var(--color-blue-500)}.status-indicator-text{font-size:1rem;letter-spacing:.1rem}@keyframes status-pulse{0%{transform:scale(1);opacity:.5}70%{opacity:.25}to{transform:scale(2.5);opacity:0}}';
334
- class wt extends HTMLElement {
335
- #e;
336
- #t;
337
- #o = new R(void 0);
338
- #a;
339
- constructor() {
340
- super(), this.#t = this.attachShadow({ mode: "open" });
341
- const t = document.createElement("style");
342
- t.textContent = bt, this.#t.appendChild(t), this.#a = new MutationObserver(() => this.#n());
343
- }
344
- connectedCallback() {
345
- this.#n(), this.#a.observe(this, { childList: !0 });
346
- const t = new T();
347
- this.#e = t, t.run(this.#r.bind(this));
348
- }
349
- disconnectedCallback() {
350
- this.#a.disconnect(), this.#e?.close(), this.#e = void 0;
351
- }
352
- #n() {
353
- const t = this.querySelector("moq-watch");
354
- this.#o.set(t ?? void 0);
355
- }
356
- #r(t) {
357
- const e = t.get(this.#o);
358
- if (!e) return;
359
- const r = new R(!1), a = v("div", { className: "video-container" });
360
- a.append(
361
- v("slot"),
362
- vt(t, e, r),
363
- O(t, e),
364
- nt(t, e)
365
- );
366
- const n = v("div", { className: "controls" }), i = v("div", { className: "playback-controls flex-align-center" });
367
- i.append(
368
- rt(t, e),
369
- dt(t, e),
370
- pt(t, e),
371
- lt(t, r),
372
- ot(t, e)
373
- );
374
- const s = v("div", { className: "latency-controls" });
375
- s.append(V(t, e), st(t, e)), n.append(i, s), C(t, this.#t, a), C(t, this.#t, n);
376
- }
377
- }
378
- customElements.define("moq-watch-ui", wt);
379
- export {
380
- wt as default
319
+ //#endregion
320
+ //#region src/ui/styles/index.css?inline
321
+ var W = ":host{--color-white:#fff;--color-white-alpha-05:#ffffff0d;--color-white-alpha-10:#ffffff1a;--color-white-alpha-15:#ffffff26;--color-white-alpha-20:#fff3;--color-white-alpha-25:#ffffff40;--color-white-alpha-30:#ffffff4d;--color-white-alpha-40:#fff6;--color-white-alpha-70:#ffffffb3;--color-white-alpha-90:#ffffffe6;--color-gray-100:#9ca3af;--color-gray-950:#1a1a1a;--color-blue-400:#00dfff;--color-blue-500:#52a1ff;--color-blue-900:#1b3243;--color-purple-400:#a855f7;--color-purple-900:#31144a;--color-green-400:#65ee2e;--color-green-900:#3d4928;--color-yellow-400:#facc15;--color-orange-400:#f90;--color-orange-450:#fb923c;--color-orange-500:#f97316;--color-orange-900:#4d301b;--color-amber-600:#d97706;--color-orange-500-alpha-60:#f9731699;--color-orange-500-alpha-80:#f97316cc;--color-black-alpha-08:#00000014;--color-black-alpha-10:#0000001a;--color-black-alpha-40:#0006;--color-black-alpha-85:#000000d9;--spacing-1:.0625rem;--spacing-2:.125rem;--spacing-4:.25rem;--spacing-8:.5rem;--spacing-12:.75rem;--spacing-16:1rem;--spacing-24:1.5rem;--spacing-32:2rem;--spacing-48:3rem;--border-radius-sm:.5rem;--border-radius-md:.75rem;--border-radius-lg:1rem}.flex-center{justify-content:center;align-items:center;display:flex}.flex-align-center{align-items:center}.button{color:var(--color-white);cursor:pointer;background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid var(--color-white-alpha-20);transform-origin:50%;border-radius:50%;width:2.25rem;height:2.25rem;transition:transform .1s cubic-bezier(.4,0,.2,1)}.button:hover:not(:disabled){background-color:var(--color-white-alpha-20);box-shadow:0 var(--spacing-2) var(--spacing-8) var(--color-black-alpha-10);transform:scale(1.02)}.button:active:not(:disabled){box-shadow:0 var(--spacing-1) var(--spacing-4) var(--color-black-alpha-08);transform:scale(.98)}.button:disabled{opacity:.5;cursor:default;color:var(--color-gray-100)}.stats{pointer-events:none;z-index:2;width:100%;height:inherit;justify-content:center;align-items:center;display:flex;position:absolute;inset:0;container-type:inline-size}.stats .stats-panel{justify-content:center;align-items:flex-start;gap:var(--spacing-12);background-color:var(--color-black-alpha-85);border:1px solid var(--color-white-alpha-25);width:100%;max-width:240px;padding:var(--spacing-12);pointer-events:auto;border-radius:8px;flex-flow:wrap;display:flex;position:absolute;top:8px}@container (width>480px) and (width<=768px){.stats .stats-panel{max-width:360px;padding:var(--spacing-24)}}@container (width>768px){.stats .stats-panel{max-width:600px;padding:var(--spacing-24)}}.stats .stats-panel .stats-item{justify-content:flex-start;align-items:flex-start;column-gap:var(--spacing-8);flex-direction:row;flex-basis:calc(50% - var(--spacing-12));flex-grow:1;flex-shrink:1;height:auto;display:flex}@container (width>480px){.stats .stats-panel .stats-item{flex-basis:calc(25% - var(--spacing-12))}}.stats .stats-panel .stats-item .stats-icon-wrapper{padding:var(--spacing-8);border-radius:8px;flex-shrink:0;width:fit-content;height:fit-content;display:none}@container (width>480px){.stats .stats-panel .stats-item .stats-icon-wrapper{flex-direction:row;justify-content:center;align-items:center;width:24px;height:24px;display:flex}}.stats .stats-panel .stats-item .stats-icon-wrapper svg{width:100%;height:100%}.stats .stats-panel .stats-item.stats-item--network .stats-icon-wrapper{background-color:var(--color-blue-900)}.stats .stats-panel .stats-item.stats-item--network,.stats .stats-panel .stats-item.stats-item--network .stats-item-data{color:var(--color-blue-400)}.stats .stats-panel .stats-item.stats-item--video .stats-icon-wrapper{background-color:var(--color-purple-900)}.stats .stats-panel .stats-item.stats-item--video,.stats .stats-panel .stats-item.stats-item--video .stats-item-data{color:var(--color-purple-400)}.stats .stats-panel .stats-item.stats-item--audio .stats-icon-wrapper{background-color:var(--color-green-900)}.stats .stats-panel .stats-item.stats-item--audio,.stats .stats-panel .stats-item.stats-item--audio .stats-item-data{color:var(--color-green-400)}.stats .stats-panel .stats-item.stats-item--buffer .stats-icon-wrapper{background-color:var(--color-orange-900)}.stats .stats-panel .stats-item.stats-item--buffer,.stats .stats-panel .stats-item.stats-item--buffer .stats-item-data{color:var(--color-orange-400)}.stats .stats-panel .stats-item .stats-item-detail{justify-content:space-evenly;align-items:flex-start;gap:var(--spacing-4);flex-direction:column;display:flex}.stats .stats-panel .stats-item .stats-item-detail .stats-item-title{text-transform:capitalize;color:var(--color-gray-100);letter-spacing:1px;font-family:Segoe UI,Roboto,sans-serif;font-size:12px;font-weight:500;line-height:12px}.stats .stats-panel .stats-item .stats-item-detail .stats-item-data{white-space:pre-wrap;font-family:Segoe UI,Roboto,sans-serif;font-size:16px;font-weight:700;line-height:1.5}.video-container{border-radius:var(--spacing-4);pointer-events:none;width:100%;height:auto;margin:0 auto;display:block;position:relative}.controls{gap:var(--spacing-24);flex-direction:column;display:flex}.button.button--playback{background:linear-gradient(to bottom right, var(--color-orange-400), var(--color-orange-500), var(--color-amber-600));width:3rem;height:3rem;box-shadow:0 0 var(--spacing-16) var(--color-orange-500-alpha-60);transition:box-shadow .15s cubic-bezier(.4,0,.2,1);position:relative;overflow:hidden}.button.button--playback:hover:not(:disabled){box-shadow:0 0 var(--spacing-24) var(--color-orange-500-alpha-80);transform:scale(1.02)}.button.button--playback:active:not(:disabled){transform:scale(.98)}.button.button--playback:before{content:\"\";background:linear-gradient(to bottom right, var(--color-white-alpha-30), transparent);opacity:0;pointer-events:none;transition:opacity .15s cubic-bezier(.4,0,.2,1);position:absolute;inset:0}.button.button--playback:hover:before{opacity:1}.button.button--playback:after{content:\"\";background-color:var(--color-white-alpha-20);filter:blur(var(--spacing-24));pointer-events:none;border-radius:50%;position:absolute;inset:0}.playback-controls{place-content:center space-around;gap:var(--spacing-8);padding:var(--spacing-8) 0;display:flex}.latency-controls{gap:var(--spacing-16);flex-direction:column;display:flex}.volume-slider{gap:var(--spacing-4)}.volume-label{width:var(--spacing-16);text-align:right}.quality-selector{align-items:center;gap:var(--spacing-8);border-radius:var(--spacing-8);background:0 0;display:flex}.quality-label{color:var(--color-white);white-space:nowrap;font-size:1.25rem;font-weight:500}.quality-select{padding:var(--spacing-8);border-radius:var(--spacing-4);background:var(--color-white-alpha-10);color:var(--color-white);border:var(--spacing-1) solid var(--color-white-alpha-20);cursor:pointer;flex:0 auto;font-size:1rem;transition:background .2s}.quality-select:hover{background:var(--color-white-alpha-15)}.quality-select:focus{outline:var(--spacing-2) solid var(--color-white-alpha-30);outline-offset:var(--spacing-2)}.quality-select option{background:var(--color-gray-950);color:var(--color-white)}.buffer{width:100%}.buffer-visualization{background:var(--color-white-alpha-10);border-radius:var(--spacing-4);cursor:pointer;user-select:none;width:100%;height:3.75rem;padding-left:var(--spacing-48);box-sizing:border-box;position:relative}.buffer-playhead{left:var(--spacing-48);width:var(--spacing-2);background:var(--color-white);z-index:3;position:absolute;top:0;bottom:0}.buffer-track{left:var(--spacing-48);height:var(--spacing-24);align-items:center;display:flex;position:absolute;right:0}.buffer-track--video{top:var(--spacing-4)}.buffer-track--audio{top:var(--spacing-32)}.buffer-track-label{width:2.5rem;color:var(--color-white-alpha-70);text-align:right;padding-right:var(--spacing-4);pointer-events:none;box-sizing:border-box;font-size:.625rem;position:absolute;left:-2.875rem}.buffer-canvas{width:100%;height:100%;position:absolute;top:0;left:0}.buffer-target-area{top:0;bottom:0;left:var(--spacing-48);pointer-events:none;position:absolute;right:0}.buffer-target-line{background:var(--color-orange-400,var(--color-orange-450));z-index:2;cursor:ew-resize;border-radius:var(--spacing-1);pointer-events:auto;width:.1875rem;position:absolute;top:0;bottom:0}.buffer-target-label{color:var(--color-orange-400,var(--color-orange-450));white-space:nowrap;margin-bottom:var(--spacing-2);opacity:0;pointer-events:none;font-size:.6875rem;font-weight:500;transition:opacity .15s;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.buffer-visualization:hover .buffer-target-label,.buffer-visualization--dragging .buffer-target-label{opacity:1}.buffer-help{color:var(--color-white-alpha-30,#ffffff4d);pointer-events:none;white-space:nowrap;font-size:.75rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.buffering{z-index:1;background-color:var(--color-black-alpha-40);width:100%;height:100%;backdrop-filter:blur(var(--spacing-2));pointer-events:auto;justify-content:center;align-items:center;display:flex;position:absolute;top:0;left:0}.buffering-spinner{border:var(--spacing-4) solid var(--color-white-alpha-20);border-top:var(--spacing-4) solid var(--color-white);border-radius:50%;width:2.5rem;height:2.5rem;animation:1s linear infinite buffer-spin}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.watch-ui__offline-indicator{z-index:4;pointer-events:auto;background-color:#000;border-radius:.25rem;justify-content:center;align-items:center;padding:.5rem 1rem;display:flex;position:absolute;bottom:1rem;right:1rem}.watch-ui__offline-text{color:#fff;letter-spacing:.08em;text-shadow:none;font-size:.875rem;font-weight:700}@media (width<=768px){.watch-ui__offline-indicator{padding:.375rem .75rem;bottom:.75rem;right:.75rem}.watch-ui__offline-text{font-size:.75rem}}@media (width<=480px){.watch-ui__offline-indicator{padding:.25rem .5rem;bottom:.5rem;right:.5rem}.watch-ui__offline-text{font-size:.75rem}}.status-indicator{gap:var(--spacing-12);backdrop-filter:blur(var(--spacing-16))}.status-indicator-dot{z-index:1;border-radius:50%;flex-shrink:0;width:.75rem;height:.75rem;position:relative}.status-indicator-dot:after{content:\"\";opacity:.5;z-index:-1;background:currentColor;border-radius:50%;animation:1.5s ease-out infinite status-pulse;display:none;position:absolute;inset:0;transform:scale(1)}.status-indicator-dot--live:after,.status-indicator-dot--connected:after,.status-indicator-dot--loading:after,.status-indicator-dot--connecting:after{display:block}.status-indicator-dot--error{background:var(--color-gray-100);color:var(--color-gray-100)}.status-indicator-text--error{color:var(--color-gray-100)}.status-indicator-dot--connecting{background:var(--color-yellow-400);color:var(--color-yellow-400)}.status-indicator-text--connecting{color:var(--color-yellow-400)}.status-indicator-dot--loading{background:var(--color-yellow-400);color:var(--color-yellow-400)}.status-indicator-text--loading{color:var(--color-yellow-400)}.status-indicator-dot--live{background:var(--color-green-400);color:var(--color-green-400)}.status-indicator-text--live{color:var(--color-green-400)}.status-indicator-dot--connected{background:var(--color-blue-500);color:var(--color-blue-500)}.status-indicator-text--connected{color:var(--color-blue-500)}.status-indicator-text{letter-spacing:.1rem;font-size:1rem}@keyframes status-pulse{0%{opacity:.5;transform:scale(1)}70%{opacity:.25}to{opacity:0;transform:scale(2.5)}}", G = class extends HTMLElement {
322
+ #e;
323
+ #t;
324
+ #n = new r(void 0);
325
+ #r;
326
+ constructor() {
327
+ super(), this.#t = this.attachShadow({ mode: "open" });
328
+ let e = document.createElement("style");
329
+ e.textContent = W, this.#t.appendChild(e), this.#r = new MutationObserver(() => this.#i());
330
+ }
331
+ connectedCallback() {
332
+ this.#i(), this.#r.observe(this, { childList: !0 });
333
+ let e = new n();
334
+ this.#e = e, e.run(this.#a.bind(this));
335
+ }
336
+ disconnectedCallback() {
337
+ this.#r.disconnect(), this.#e?.close(), this.#e = void 0;
338
+ }
339
+ #i() {
340
+ let e = this.querySelector("moq-watch");
341
+ this.#n.set(e ?? void 0);
342
+ }
343
+ #a(n) {
344
+ let i = n.get(this.#n);
345
+ if (!i) return;
346
+ let a = new r(!1), o = t("div", { className: "video-container" });
347
+ o.append(t("slot"), U(n, i, a), u(n, i), E(n, i));
348
+ let s = t("div", { className: "controls" }), c = t("div", { className: "playback-controls flex-align-center" });
349
+ c.append(D(n, i), M(n, i), P(n, i), A(n, a), T(n, i));
350
+ let d = t("div", { className: "latency-controls" });
351
+ d.append(l(n, i), k(n, i)), s.append(c, d), e(n, this.#t, o), e(n, this.#t, s);
352
+ }
381
353
  };
382
- //# sourceMappingURL=element.js.map
354
+ customElements.define("moq-watch-ui", G);
355
+ //#endregion
356
+ export { G as default };
357
+
358
+ //# sourceMappingURL=element.js.map