@linktr.ee/messaging-react 1.26.1 → 1.28.0-rc-1776225927

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 (58) hide show
  1. package/dist/Creator-D38dWn2X.js +318 -0
  2. package/dist/Creator-D38dWn2X.js.map +1 -0
  3. package/dist/MediaPlayer-DE9MC6k6.js +599 -0
  4. package/dist/MediaPlayer-DE9MC6k6.js.map +1 -0
  5. package/dist/Preview-DqAv16NS.js +87 -0
  6. package/dist/Preview-DqAv16NS.js.map +1 -0
  7. package/dist/Visitor-BG-9-3HU.js +199 -0
  8. package/dist/Visitor-BG-9-3HU.js.map +1 -0
  9. package/dist/dash.all.min-Duv4lvGS.js +18858 -0
  10. package/dist/dash.all.min-Duv4lvGS.js.map +1 -0
  11. package/dist/hls-Bogc7CBn.js +21710 -0
  12. package/dist/hls-Bogc7CBn.js.map +1 -0
  13. package/dist/index-Da-xN4Yq.js +16142 -0
  14. package/dist/index-Da-xN4Yq.js.map +1 -0
  15. package/dist/index-Dj9rqWcU.js +69 -0
  16. package/dist/index-Dj9rqWcU.js.map +1 -0
  17. package/dist/index.d.ts +74 -10
  18. package/dist/index.js +979 -934
  19. package/dist/index.js.map +1 -1
  20. package/dist/mixin-B6jYfIcp.js +808 -0
  21. package/dist/mixin-B6jYfIcp.js.map +1 -0
  22. package/dist/react-BxlQMOfz.js +419 -0
  23. package/dist/react-BxlQMOfz.js.map +1 -0
  24. package/dist/react-COAP-MIW.js +377 -0
  25. package/dist/react-COAP-MIW.js.map +1 -0
  26. package/dist/react-Cn4WlMcl.js +3108 -0
  27. package/dist/react-Cn4WlMcl.js.map +1 -0
  28. package/dist/react-CwTJArKY.js +459 -0
  29. package/dist/react-CwTJArKY.js.map +1 -0
  30. package/dist/react-DkfS_atT.js +373 -0
  31. package/dist/react-DkfS_atT.js.map +1 -0
  32. package/dist/react-Pea5fum1.js +286 -0
  33. package/dist/react-Pea5fum1.js.map +1 -0
  34. package/dist/react-RiBbsUDd.js +534 -0
  35. package/dist/react-RiBbsUDd.js.map +1 -0
  36. package/dist/react-dS1WBxxz.js +238 -0
  37. package/dist/react-dS1WBxxz.js.map +1 -0
  38. package/package.json +2 -1
  39. package/src/components/ChannelView.tsx +12 -2
  40. package/src/components/CustomMessage/CustomMessage.stories.tsx +173 -41
  41. package/src/components/CustomMessage/MessageTag.tsx +5 -0
  42. package/src/components/CustomMessage/index.tsx +43 -4
  43. package/src/components/LockedAttachment/LockedAttachment.stories.tsx +343 -0
  44. package/src/components/LockedAttachment/components/Creator.tsx +469 -0
  45. package/src/components/LockedAttachment/components/MediaPlayer.tsx +359 -0
  46. package/src/components/LockedAttachment/components/Visitor.tsx +356 -0
  47. package/src/components/LockedAttachment/index.tsx +39 -0
  48. package/src/components/LockedAttachment/types.ts +17 -0
  49. package/src/components/LockedAttachment/utils/icons.ts +53 -0
  50. package/src/components/LockedAttachment/utils/mimeType.test.ts +119 -0
  51. package/src/components/LockedAttachment/utils/mimeType.ts +37 -0
  52. package/src/components/ParticipantPicker/index.tsx +8 -1
  53. package/src/hooks/useParticipants.ts +3 -2
  54. package/src/index.ts +4 -0
  55. package/src/stories/decorators/storyUser.tsx +37 -0
  56. package/src/stream-custom-data.ts +9 -3
  57. package/src/types.ts +20 -1
  58. package/src/utils/isDevBuild.ts +10 -0
@@ -0,0 +1,808 @@
1
+ var At = Object.defineProperty;
2
+ var pt = (i) => {
3
+ throw TypeError(i);
4
+ };
5
+ var xt = (i, e, t) => e in i ? At(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
6
+ var v = (i, e, t) => xt(i, typeof e != "symbol" ? e + "" : e, t), et = (i, e, t) => e.has(i) || pt("Cannot " + t);
7
+ var r = (i, e, t) => (et(i, e, "read from private field"), t ? t.call(i) : e.get(i)), p = (i, e, t) => e.has(i) ? pt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), h = (i, e, t, n) => (et(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t), b = (i, e, t) => (et(i, e, "access private method"), t);
8
+ const qt = [
9
+ "abort",
10
+ "canplay",
11
+ "canplaythrough",
12
+ "durationchange",
13
+ "emptied",
14
+ "encrypted",
15
+ "ended",
16
+ "error",
17
+ "loadeddata",
18
+ "loadedmetadata",
19
+ "loadstart",
20
+ "pause",
21
+ "play",
22
+ "playing",
23
+ "progress",
24
+ "ratechange",
25
+ "seeked",
26
+ "seeking",
27
+ "stalled",
28
+ "suspend",
29
+ "timeupdate",
30
+ "volumechange",
31
+ "waiting",
32
+ "waitingforkey",
33
+ "resize",
34
+ "enterpictureinpicture",
35
+ "leavepictureinpicture",
36
+ "webkitbeginfullscreen",
37
+ "webkitendfullscreen",
38
+ "webkitpresentationmodechanged"
39
+ ], mt = [
40
+ "autopictureinpicture",
41
+ "disablepictureinpicture",
42
+ "disableremoteplayback",
43
+ "autoplay",
44
+ "controls",
45
+ "controlslist",
46
+ "crossorigin",
47
+ "loop",
48
+ "muted",
49
+ "playsinline",
50
+ "poster",
51
+ "preload",
52
+ "src"
53
+ ];
54
+ function Ot(i) {
55
+ return (
56
+ /*html*/
57
+ `
58
+ <style>
59
+ :host {
60
+ display: inline-flex;
61
+ line-height: 0;
62
+ flex-direction: column;
63
+ justify-content: end;
64
+ }
65
+
66
+ audio {
67
+ width: 100%;
68
+ }
69
+ </style>
70
+ <slot name="media">
71
+ <audio${wt(i)}></audio>
72
+ </slot>
73
+ <slot></slot>
74
+ `
75
+ );
76
+ }
77
+ function jt(i) {
78
+ return (
79
+ /*html*/
80
+ `
81
+ <style>
82
+ :host {
83
+ display: inline-block;
84
+ line-height: 0;
85
+ }
86
+
87
+ video {
88
+ max-width: 100%;
89
+ max-height: 100%;
90
+ min-width: 100%;
91
+ min-height: 100%;
92
+ object-fit: var(--media-object-fit, contain);
93
+ object-position: var(--media-object-position, 50% 50%);
94
+ }
95
+
96
+ video::-webkit-media-text-track-container {
97
+ transform: var(--media-webkit-text-track-transform);
98
+ transition: var(--media-webkit-text-track-transition);
99
+ }
100
+ </style>
101
+ <slot name="media">
102
+ <video${wt(i)}></video>
103
+ </slot>
104
+ <slot></slot>
105
+ `
106
+ );
107
+ }
108
+ function Rt(i, { tag: e, is: t }) {
109
+ var c, a, f, y, X, yt, K, z, E, I, R, k, C, it, nt, bt, rt, Tt, Et;
110
+ const n = (a = (c = globalThis.document) == null ? void 0 : c.createElement) == null ? void 0 : a.call(c, e, { is: t }), d = n ? Pt(n) : [];
111
+ return f = class extends i {
112
+ constructor() {
113
+ super(...arguments);
114
+ p(this, k);
115
+ // Private fields
116
+ p(this, K, !1);
117
+ p(this, z, null);
118
+ p(this, E, /* @__PURE__ */ new Map());
119
+ p(this, I);
120
+ p(this, R);
121
+ v(this, "get");
122
+ v(this, "set");
123
+ v(this, "call");
124
+ }
125
+ static get observedAttributes() {
126
+ var u, m;
127
+ return b(u = f, X, yt).call(u), [
128
+ ...((m = n == null ? void 0 : n.constructor) == null ? void 0 : m.observedAttributes) ?? [],
129
+ ...mt
130
+ ];
131
+ }
132
+ // If the custom element is defined before the custom element's HTML is parsed
133
+ // no attributes will be available in the constructor (construction process).
134
+ // Wait until initializing in the attributeChangedCallback or
135
+ // connectedCallback or accessing any properties.
136
+ get nativeEl() {
137
+ var s;
138
+ return b(this, k, C).call(this), r(this, z) ?? this.querySelector(":scope > [slot=media]") ?? this.querySelector(e) ?? ((s = this.shadowRoot) == null ? void 0 : s.querySelector(e)) ?? null;
139
+ }
140
+ set nativeEl(s) {
141
+ h(this, z, s);
142
+ }
143
+ get defaultMuted() {
144
+ return this.hasAttribute("muted");
145
+ }
146
+ set defaultMuted(s) {
147
+ this.toggleAttribute("muted", s);
148
+ }
149
+ get src() {
150
+ return this.getAttribute("src");
151
+ }
152
+ set src(s) {
153
+ this.setAttribute("src", `${s}`);
154
+ }
155
+ get preload() {
156
+ var s;
157
+ return this.getAttribute("preload") ?? ((s = this.nativeEl) == null ? void 0 : s.preload);
158
+ }
159
+ set preload(s) {
160
+ this.setAttribute("preload", `${s}`);
161
+ }
162
+ init() {
163
+ if (!this.shadowRoot) {
164
+ this.attachShadow({ mode: "open" });
165
+ const s = $t(this.attributes);
166
+ t && (s.is = t), e && (s.part = e), this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(s);
167
+ }
168
+ this.nativeEl.muted = this.hasAttribute("muted");
169
+ for (const s of d)
170
+ b(this, k, Tt).call(this, s);
171
+ b(this, k, it).call(this);
172
+ }
173
+ handleEvent(s) {
174
+ s.target === this.nativeEl && this.dispatchEvent(new CustomEvent(s.type, { detail: s.detail }));
175
+ }
176
+ attributeChangedCallback(s, u, m) {
177
+ b(this, k, C).call(this), b(this, k, Et).call(this, s, u, m);
178
+ }
179
+ connectedCallback() {
180
+ b(this, k, C).call(this), r(this, R) || b(this, k, it).call(this);
181
+ }
182
+ disconnectedCallback() {
183
+ var s, u, m;
184
+ (s = r(this, I)) == null || s.disconnect(), h(this, I, void 0), r(this, R) && ((u = this.shadowRoot) == null || u.removeEventListener("slotchange", r(this, R)), h(this, R, void 0));
185
+ for (const g of this.constructor.Events)
186
+ (m = this.shadowRoot) == null || m.removeEventListener(g, this, !0);
187
+ r(this, E).forEach((g) => g.remove()), r(this, E).clear(), h(this, z, null);
188
+ }
189
+ }, y = new WeakMap(), X = new WeakSet(), yt = function() {
190
+ if (r(this, y)) return;
191
+ h(this, y, !0);
192
+ const s = new Set(this.observedAttributes);
193
+ s.delete("muted");
194
+ for (const u of d)
195
+ if (!(u in this.prototype))
196
+ if (typeof n[u] == "function")
197
+ this.prototype[u] = function(...m) {
198
+ return b(this, k, C).call(this), (() => {
199
+ var T;
200
+ if (this.call) return this.call(u, ...m);
201
+ const l = (T = this.nativeEl) == null ? void 0 : T[u];
202
+ return l == null ? void 0 : l.apply(this.nativeEl, m);
203
+ })();
204
+ };
205
+ else {
206
+ const m = {
207
+ get() {
208
+ var l, T;
209
+ b(this, k, C).call(this);
210
+ const g = u.toLowerCase();
211
+ if (s.has(g)) {
212
+ const B = this.getAttribute(g);
213
+ return B === null ? !1 : B === "" ? !0 : B;
214
+ }
215
+ return ((l = this.get) == null ? void 0 : l.call(this, u)) ?? ((T = this.nativeEl) == null ? void 0 : T[u]);
216
+ }
217
+ };
218
+ u !== u.toUpperCase() && (m.set = function(g) {
219
+ b(this, k, C).call(this);
220
+ const l = u.toLowerCase();
221
+ if (s.has(l)) {
222
+ g === !0 || g === !1 || g == null ? this.toggleAttribute(l, !!g) : this.setAttribute(l, g);
223
+ return;
224
+ }
225
+ if (this.set) {
226
+ this.set(u, g);
227
+ return;
228
+ }
229
+ this.nativeEl && (this.nativeEl[u] = g);
230
+ }), Object.defineProperty(this.prototype, u, m);
231
+ }
232
+ }, K = new WeakMap(), z = new WeakMap(), E = new WeakMap(), I = new WeakMap(), R = new WeakMap(), k = new WeakSet(), C = function() {
233
+ r(this, K) || (h(this, K, !0), this.init());
234
+ }, it = function() {
235
+ var s, u;
236
+ h(this, I, new MutationObserver(b(this, k, bt).bind(this))), h(this, R, () => b(this, k, nt).call(this)), (s = this.shadowRoot) == null || s.addEventListener("slotchange", r(this, R)), b(this, k, nt).call(this);
237
+ for (const m of this.constructor.Events)
238
+ (u = this.shadowRoot) == null || u.addEventListener(m, this, !0);
239
+ }, nt = function() {
240
+ var g;
241
+ const s = new Map(r(this, E)), u = (g = this.shadowRoot) == null ? void 0 : g.querySelector("slot:not([name])");
242
+ (u == null ? void 0 : u.assignedElements({ flatten: !0 }).filter((l) => ["track", "source"].includes(l.localName))).forEach((l) => {
243
+ var B, lt;
244
+ s.delete(l);
245
+ let T = r(this, E).get(l);
246
+ T || (T = l.cloneNode(), r(this, E).set(l, T), (B = r(this, I)) == null || B.observe(l, { attributes: !0 })), (lt = this.nativeEl) == null || lt.append(T), b(this, k, rt).call(this, T);
247
+ }), s.forEach((l, T) => {
248
+ l.remove(), r(this, E).delete(T);
249
+ });
250
+ }, bt = function(s) {
251
+ for (const u of s)
252
+ if (u.type === "attributes") {
253
+ const { target: m, attributeName: g } = u, l = r(this, E).get(m);
254
+ l && g && (l.setAttribute(g, m.getAttribute(g) ?? ""), b(this, k, rt).call(this, l));
255
+ }
256
+ }, rt = function(s) {
257
+ s && s.localName === "track" && s.default && (s.kind === "chapters" || s.kind === "metadata") && s.track.mode === "disabled" && (s.track.mode = "hidden");
258
+ }, Tt = function(s) {
259
+ if (Object.prototype.hasOwnProperty.call(this, s)) {
260
+ const u = this[s];
261
+ delete this[s], this[s] = u;
262
+ }
263
+ }, Et = function(s, u, m) {
264
+ var g, l, T;
265
+ ["id", "class"].includes(s) || !f.observedAttributes.includes(s) && this.constructor.observedAttributes.includes(s) || (m === null ? (g = this.nativeEl) == null || g.removeAttribute(s) : ((l = this.nativeEl) == null ? void 0 : l.getAttribute(s)) !== m && ((T = this.nativeEl) == null || T.setAttribute(s, m)));
266
+ }, p(f, X), v(f, "getTemplateHTML", e.endsWith("audio") ? Ot : jt), v(f, "shadowRootOptions", { mode: "open" }), v(f, "Events", qt), p(f, y, !1), f;
267
+ }
268
+ function Pt(i) {
269
+ const e = [];
270
+ for (let t = Object.getPrototypeOf(i); t && t !== HTMLElement.prototype; t = Object.getPrototypeOf(t)) {
271
+ const n = Object.getOwnPropertyNames(t);
272
+ e.push(...n);
273
+ }
274
+ return e;
275
+ }
276
+ function wt(i) {
277
+ let e = "";
278
+ for (const t in i) {
279
+ if (!mt.includes(t)) continue;
280
+ const n = i[t];
281
+ n === "" ? e += ` ${t}` : e += ` ${t}="${n}"`;
282
+ }
283
+ return e;
284
+ }
285
+ function $t(i) {
286
+ const e = {};
287
+ for (const t of i)
288
+ e[t.name] = t.value;
289
+ return e;
290
+ }
291
+ const Qt = Rt(globalThis.HTMLElement ?? class {
292
+ }, {
293
+ tag: "video"
294
+ });
295
+ Rt(globalThis.HTMLElement ?? class {
296
+ }, {
297
+ tag: "audio"
298
+ });
299
+ class _ extends Event {
300
+ constructor(t, n) {
301
+ super(t);
302
+ v(this, "track");
303
+ this.track = n.track;
304
+ }
305
+ }
306
+ const ot = /* @__PURE__ */ new WeakMap();
307
+ function o(i) {
308
+ return ot.get(i) ?? Mt(i, {});
309
+ }
310
+ function Mt(i, e) {
311
+ let t = ot.get(i);
312
+ return t || ot.set(i, t = {}), Object.assign(t, e);
313
+ }
314
+ function st(i, e) {
315
+ const t = i.videoTracks;
316
+ o(e).media = new WeakRef(i), o(e).renditionSet || (o(e).renditionSet = /* @__PURE__ */ new Set());
317
+ const n = o(t).trackSet;
318
+ n.add(e);
319
+ const d = n.size - 1;
320
+ d in at.prototype || Object.defineProperty(at.prototype, d, {
321
+ get() {
322
+ return [...o(this).trackSet][d];
323
+ }
324
+ }), queueMicrotask(() => {
325
+ t.dispatchEvent(new _("addtrack", { track: e }));
326
+ });
327
+ }
328
+ function dt(i) {
329
+ var n, d;
330
+ const e = (d = (n = o(i).media) == null ? void 0 : n.deref()) == null ? void 0 : d.videoTracks;
331
+ if (!e) return;
332
+ o(e).trackSet.delete(i), queueMicrotask(() => {
333
+ e.dispatchEvent(new _("removetrack", { track: i }));
334
+ });
335
+ }
336
+ function Vt(i) {
337
+ var n, d;
338
+ const e = ((d = (n = o(i).media) == null ? void 0 : n.deref()) == null ? void 0 : d.videoTracks) ?? [];
339
+ let t = !1;
340
+ for (const c of e)
341
+ c !== i && (c.selected = !1, t = !0);
342
+ if (t) {
343
+ if (o(e).changeRequested) return;
344
+ o(e).changeRequested = !0, queueMicrotask(() => {
345
+ delete o(e).changeRequested, e.dispatchEvent(new Event("change"));
346
+ });
347
+ }
348
+ }
349
+ var w, L, S, H, Q;
350
+ class at extends EventTarget {
351
+ constructor() {
352
+ super();
353
+ p(this, H);
354
+ p(this, w);
355
+ p(this, L);
356
+ p(this, S);
357
+ o(this).trackSet = /* @__PURE__ */ new Set();
358
+ }
359
+ [Symbol.iterator]() {
360
+ return r(this, H, Q).values();
361
+ }
362
+ get length() {
363
+ return r(this, H, Q).size;
364
+ }
365
+ getTrackById(t) {
366
+ return [...r(this, H, Q)].find((n) => n.id === t) ?? null;
367
+ }
368
+ get selectedIndex() {
369
+ return [...r(this, H, Q)].findIndex((t) => t.selected);
370
+ }
371
+ get onaddtrack() {
372
+ return r(this, w);
373
+ }
374
+ set onaddtrack(t) {
375
+ r(this, w) && (this.removeEventListener("addtrack", r(this, w)), h(this, w, void 0)), typeof t == "function" && (h(this, w, t), this.addEventListener("addtrack", t));
376
+ }
377
+ get onremovetrack() {
378
+ return r(this, L);
379
+ }
380
+ set onremovetrack(t) {
381
+ r(this, L) && (this.removeEventListener("removetrack", r(this, L)), h(this, L, void 0)), typeof t == "function" && (h(this, L, t), this.addEventListener("removetrack", t));
382
+ }
383
+ get onchange() {
384
+ return r(this, S);
385
+ }
386
+ set onchange(t) {
387
+ r(this, S) && (this.removeEventListener("change", r(this, S)), h(this, S, void 0)), typeof t == "function" && (h(this, S, t), this.addEventListener("change", t));
388
+ }
389
+ }
390
+ w = new WeakMap(), L = new WeakMap(), S = new WeakMap(), H = new WeakSet(), Q = function() {
391
+ return o(this).trackSet;
392
+ };
393
+ class tt extends Event {
394
+ constructor(t, n) {
395
+ super(t);
396
+ v(this, "rendition");
397
+ this.rendition = n.rendition;
398
+ }
399
+ }
400
+ function It(i, e) {
401
+ var c, a;
402
+ const t = (a = (c = o(i).media) == null ? void 0 : c.deref()) == null ? void 0 : a.videoRenditions;
403
+ o(e).media = o(i).media, o(e).track = i;
404
+ const n = o(i).renditionSet;
405
+ n.add(e);
406
+ const d = n.size - 1;
407
+ d in ct.prototype || Object.defineProperty(ct.prototype, d, {
408
+ get() {
409
+ return W(this)[d];
410
+ }
411
+ }), queueMicrotask(() => {
412
+ !t || !i.selected || t.dispatchEvent(new tt("addrendition", { rendition: e }));
413
+ });
414
+ }
415
+ function Ct(i) {
416
+ var d, c;
417
+ const e = (c = (d = o(i).media) == null ? void 0 : d.deref()) == null ? void 0 : c.videoRenditions, t = o(i).track;
418
+ o(t).renditionSet.delete(i), queueMicrotask(() => {
419
+ const a = o(i).track;
420
+ !e || !a.selected || e.dispatchEvent(new tt("removerendition", { rendition: i }));
421
+ });
422
+ }
423
+ function Ht(i) {
424
+ var t, n;
425
+ const e = (n = (t = o(i).media) == null ? void 0 : t.deref()) == null ? void 0 : n.videoRenditions;
426
+ !e || o(e).changeRequested || (o(e).changeRequested = !0, queueMicrotask(() => {
427
+ delete o(e).changeRequested, o(i).track.selected && e.dispatchEvent(new Event("change"));
428
+ }));
429
+ }
430
+ function W(i) {
431
+ var t;
432
+ const e = (t = o(i).media) == null ? void 0 : t.deref();
433
+ return e ? [...e.videoTracks].filter((n) => n.selected).flatMap((n) => [...o(n).renditionSet]) : [];
434
+ }
435
+ var A, x, q;
436
+ class ct extends EventTarget {
437
+ constructor() {
438
+ super(...arguments);
439
+ p(this, A);
440
+ p(this, x);
441
+ p(this, q);
442
+ }
443
+ [Symbol.iterator]() {
444
+ return W(this).values();
445
+ }
446
+ get length() {
447
+ return W(this).length;
448
+ }
449
+ getRenditionById(t) {
450
+ return W(this).find((n) => `${n.id}` == `${t}`) ?? null;
451
+ }
452
+ get selectedIndex() {
453
+ return W(this).findIndex((t) => t.selected);
454
+ }
455
+ set selectedIndex(t) {
456
+ for (const [n, d] of W(this).entries())
457
+ d.selected = n === t;
458
+ }
459
+ get onaddrendition() {
460
+ return r(this, A);
461
+ }
462
+ set onaddrendition(t) {
463
+ r(this, A) && (this.removeEventListener("addrendition", r(this, A)), h(this, A, void 0)), typeof t == "function" && (h(this, A, t), this.addEventListener("addrendition", t));
464
+ }
465
+ get onremoverendition() {
466
+ return r(this, x);
467
+ }
468
+ set onremoverendition(t) {
469
+ r(this, x) && (this.removeEventListener("removerendition", r(this, x)), h(this, x, void 0)), typeof t == "function" && (h(this, x, t), this.addEventListener("removerendition", t));
470
+ }
471
+ get onchange() {
472
+ return r(this, q);
473
+ }
474
+ set onchange(t) {
475
+ r(this, q) && (this.removeEventListener("change", r(this, q)), h(this, q, void 0)), typeof t == "function" && (h(this, q, t), this.addEventListener("change", t));
476
+ }
477
+ }
478
+ A = new WeakMap(), x = new WeakMap(), q = new WeakMap();
479
+ var D;
480
+ class zt {
481
+ constructor() {
482
+ v(this, "src");
483
+ v(this, "id");
484
+ v(this, "width");
485
+ v(this, "height");
486
+ v(this, "bitrate");
487
+ v(this, "frameRate");
488
+ v(this, "codec");
489
+ p(this, D, !1);
490
+ }
491
+ get selected() {
492
+ return r(this, D);
493
+ }
494
+ set selected(e) {
495
+ r(this, D) !== e && (h(this, D, e), Ht(this));
496
+ }
497
+ }
498
+ D = new WeakMap();
499
+ var N;
500
+ class Lt {
501
+ constructor() {
502
+ v(this, "id");
503
+ v(this, "kind");
504
+ v(this, "label", "");
505
+ v(this, "language", "");
506
+ v(this, "sourceBuffer");
507
+ p(this, N, !1);
508
+ }
509
+ addRendition(e, t, n, d, c, a) {
510
+ const f = new zt();
511
+ return f.src = e, f.width = t, f.height = n, f.frameRate = a, f.bitrate = c, f.codec = d, It(this, f), f;
512
+ }
513
+ removeRendition(e) {
514
+ Ct(e);
515
+ }
516
+ get selected() {
517
+ return r(this, N);
518
+ }
519
+ set selected(e) {
520
+ r(this, N) !== e && (h(this, N, e), e === !0 && Vt(this));
521
+ }
522
+ }
523
+ N = new WeakMap();
524
+ function Bt(i, e) {
525
+ var c, a;
526
+ const t = (a = (c = o(i).media) == null ? void 0 : c.deref()) == null ? void 0 : a.audioRenditions;
527
+ o(e).media = o(i).media, o(e).track = i;
528
+ const n = o(i).renditionSet;
529
+ n.add(e);
530
+ const d = n.size - 1;
531
+ d in ht.prototype || Object.defineProperty(ht.prototype, d, {
532
+ get() {
533
+ return F(this)[d];
534
+ }
535
+ }), queueMicrotask(() => {
536
+ !t || !i.enabled || t.dispatchEvent(new tt("addrendition", { rendition: e }));
537
+ });
538
+ }
539
+ function Wt(i) {
540
+ var d, c;
541
+ const e = (c = (d = o(i).media) == null ? void 0 : d.deref()) == null ? void 0 : c.audioRenditions, t = o(i).track;
542
+ o(t).renditionSet.delete(i), queueMicrotask(() => {
543
+ const a = o(i).track;
544
+ !e || !a.enabled || e.dispatchEvent(new tt("removerendition", { rendition: i }));
545
+ });
546
+ }
547
+ function Ft(i) {
548
+ var t, n;
549
+ const e = (n = (t = o(i).media) == null ? void 0 : t.deref()) == null ? void 0 : n.audioRenditions;
550
+ !e || o(e).changeRequested || (o(e).changeRequested = !0, queueMicrotask(() => {
551
+ delete o(e).changeRequested, o(i).track.enabled && e.dispatchEvent(new Event("change"));
552
+ }));
553
+ }
554
+ function F(i) {
555
+ var t;
556
+ const e = (t = o(i).media) == null ? void 0 : t.deref();
557
+ return e ? [...e.audioTracks].filter((n) => n.enabled).flatMap((n) => [...o(n).renditionSet]) : [];
558
+ }
559
+ var O, j, P;
560
+ class ht extends EventTarget {
561
+ constructor() {
562
+ super(...arguments);
563
+ p(this, O);
564
+ p(this, j);
565
+ p(this, P);
566
+ }
567
+ [Symbol.iterator]() {
568
+ return F(this).values();
569
+ }
570
+ get length() {
571
+ return F(this).length;
572
+ }
573
+ getRenditionById(t) {
574
+ return F(this).find((n) => `${n.id}` == `${t}`) ?? null;
575
+ }
576
+ get selectedIndex() {
577
+ return F(this).findIndex((t) => t.selected);
578
+ }
579
+ set selectedIndex(t) {
580
+ for (const [n, d] of F(this).entries())
581
+ d.selected = n === t;
582
+ }
583
+ get onaddrendition() {
584
+ return r(this, O);
585
+ }
586
+ set onaddrendition(t) {
587
+ r(this, O) && (this.removeEventListener("addrendition", r(this, O)), h(this, O, void 0)), typeof t == "function" && (h(this, O, t), this.addEventListener("addrendition", t));
588
+ }
589
+ get onremoverendition() {
590
+ return r(this, j);
591
+ }
592
+ set onremoverendition(t) {
593
+ r(this, j) && (this.removeEventListener("removerendition", r(this, j)), h(this, j, void 0)), typeof t == "function" && (h(this, j, t), this.addEventListener("removerendition", t));
594
+ }
595
+ get onchange() {
596
+ return r(this, P);
597
+ }
598
+ set onchange(t) {
599
+ r(this, P) && (this.removeEventListener("change", r(this, P)), h(this, P, void 0)), typeof t == "function" && (h(this, P, t), this.addEventListener("change", t));
600
+ }
601
+ }
602
+ O = new WeakMap(), j = new WeakMap(), P = new WeakMap();
603
+ var U;
604
+ class Dt {
605
+ constructor() {
606
+ v(this, "src");
607
+ v(this, "id");
608
+ v(this, "bitrate");
609
+ v(this, "codec");
610
+ p(this, U, !1);
611
+ }
612
+ get selected() {
613
+ return r(this, U);
614
+ }
615
+ set selected(e) {
616
+ r(this, U) !== e && (h(this, U, e), Ft(this));
617
+ }
618
+ }
619
+ U = new WeakMap();
620
+ function ut(i, e) {
621
+ const t = i.audioTracks;
622
+ o(e).media = new WeakRef(i), o(e).renditionSet || (o(e).renditionSet = /* @__PURE__ */ new Set());
623
+ const n = o(t).trackSet;
624
+ n.add(e);
625
+ const d = n.size - 1;
626
+ d in vt.prototype || Object.defineProperty(vt.prototype, d, {
627
+ get() {
628
+ return [...o(this).trackSet][d];
629
+ }
630
+ }), queueMicrotask(() => {
631
+ t.dispatchEvent(new _("addtrack", { track: e }));
632
+ });
633
+ }
634
+ function ft(i) {
635
+ var n, d;
636
+ const e = (d = (n = o(i).media) == null ? void 0 : n.deref()) == null ? void 0 : d.audioTracks;
637
+ if (!e) return;
638
+ o(e).trackSet.delete(i), queueMicrotask(() => {
639
+ e.dispatchEvent(new _("removetrack", { track: i }));
640
+ });
641
+ }
642
+ function Nt(i) {
643
+ var t, n;
644
+ const e = (n = (t = o(i).media) == null ? void 0 : t.deref()) == null ? void 0 : n.audioTracks;
645
+ !e || o(e).changeRequested || (o(e).changeRequested = !0, queueMicrotask(() => {
646
+ delete o(e).changeRequested, e.dispatchEvent(new Event("change"));
647
+ }));
648
+ }
649
+ var $, M, V, G, Y;
650
+ class vt extends EventTarget {
651
+ constructor() {
652
+ super();
653
+ p(this, G);
654
+ p(this, $);
655
+ p(this, M);
656
+ p(this, V);
657
+ o(this).trackSet = /* @__PURE__ */ new Set();
658
+ }
659
+ [Symbol.iterator]() {
660
+ return r(this, G, Y).values();
661
+ }
662
+ get length() {
663
+ return r(this, G, Y).size;
664
+ }
665
+ getTrackById(t) {
666
+ return [...r(this, G, Y)].find((n) => n.id === t) ?? null;
667
+ }
668
+ get onaddtrack() {
669
+ return r(this, $);
670
+ }
671
+ set onaddtrack(t) {
672
+ r(this, $) && (this.removeEventListener("addtrack", r(this, $)), h(this, $, void 0)), typeof t == "function" && (h(this, $, t), this.addEventListener("addtrack", t));
673
+ }
674
+ get onremovetrack() {
675
+ return r(this, M);
676
+ }
677
+ set onremovetrack(t) {
678
+ r(this, M) && (this.removeEventListener("removetrack", r(this, M)), h(this, M, void 0)), typeof t == "function" && (h(this, M, t), this.addEventListener("removetrack", t));
679
+ }
680
+ get onchange() {
681
+ return r(this, V);
682
+ }
683
+ set onchange(t) {
684
+ r(this, V) && (this.removeEventListener("change", r(this, V)), h(this, V, void 0)), typeof t == "function" && (h(this, V, t), this.addEventListener("change", t));
685
+ }
686
+ }
687
+ $ = new WeakMap(), M = new WeakMap(), V = new WeakMap(), G = new WeakSet(), Y = function() {
688
+ return o(this).trackSet;
689
+ };
690
+ var J;
691
+ class St {
692
+ constructor() {
693
+ v(this, "id");
694
+ v(this, "kind");
695
+ v(this, "label", "");
696
+ v(this, "language", "");
697
+ v(this, "sourceBuffer");
698
+ p(this, J, !1);
699
+ }
700
+ addRendition(e, t, n) {
701
+ const d = new Dt();
702
+ return d.src = e, d.codec = t, d.bitrate = n, Bt(this, d), d;
703
+ }
704
+ removeRendition(e) {
705
+ Wt(e);
706
+ }
707
+ get enabled() {
708
+ return r(this, J);
709
+ }
710
+ set enabled(e) {
711
+ r(this, J) !== e && (h(this, J, e), Nt(this));
712
+ }
713
+ }
714
+ J = new WeakMap();
715
+ const gt = Z(globalThis.HTMLMediaElement, "video"), kt = Z(globalThis.HTMLMediaElement, "audio");
716
+ function Xt(i) {
717
+ if (!(i != null && i.prototype)) return i;
718
+ const e = Z(i, "video");
719
+ (!e || `${e}`.includes("[native code]")) && Object.defineProperty(i.prototype, "videoTracks", {
720
+ get() {
721
+ return Ut(this);
722
+ }
723
+ });
724
+ const t = Z(i, "audio");
725
+ (!t || `${t}`.includes("[native code]")) && Object.defineProperty(i.prototype, "audioTracks", {
726
+ get() {
727
+ return Gt(this);
728
+ }
729
+ }), "addVideoTrack" in i.prototype || (i.prototype.addVideoTrack = function(c, a = "", f = "") {
730
+ const y = new Lt();
731
+ return y.kind = c, y.label = a, y.language = f, st(this, y), y;
732
+ }), "removeVideoTrack" in i.prototype || (i.prototype.removeVideoTrack = dt), "addAudioTrack" in i.prototype || (i.prototype.addAudioTrack = function(c, a = "", f = "") {
733
+ const y = new St();
734
+ return y.kind = c, y.label = a, y.language = f, ut(this, y), y;
735
+ }), "removeAudioTrack" in i.prototype || (i.prototype.removeAudioTrack = ft), "videoRenditions" in i.prototype || Object.defineProperty(i.prototype, "videoRenditions", {
736
+ get() {
737
+ return n(this);
738
+ }
739
+ });
740
+ const n = (c) => {
741
+ let a = o(c).videoRenditions;
742
+ return a || (a = new ct(), o(a).media = new WeakRef(c), o(c).videoRenditions = a), a;
743
+ };
744
+ "audioRenditions" in i.prototype || Object.defineProperty(i.prototype, "audioRenditions", {
745
+ get() {
746
+ return d(this);
747
+ }
748
+ });
749
+ const d = (c) => {
750
+ let a = o(c).audioRenditions;
751
+ return a || (a = new ht(), o(a).media = new WeakRef(c), o(c).audioRenditions = a), a;
752
+ };
753
+ return i;
754
+ }
755
+ function Z(i, e) {
756
+ var t;
757
+ if (i != null && i.prototype)
758
+ return (t = Object.getOwnPropertyDescriptor(i.prototype, `${e}Tracks`)) == null ? void 0 : t.get;
759
+ }
760
+ function Ut(i) {
761
+ let e = o(i).videoTracks;
762
+ if (!e && (e = new at(), o(i).videoTracks = e, gt)) {
763
+ const t = gt.call(i.nativeEl ?? i);
764
+ for (const a of t)
765
+ st(i, a);
766
+ const n = () => {
767
+ e.dispatchEvent(new Event("change"));
768
+ }, d = (a) => {
769
+ if ([...e].some((f) => f instanceof Lt)) {
770
+ for (const f of t)
771
+ dt(f);
772
+ return;
773
+ }
774
+ st(i, a.track);
775
+ }, c = (a) => {
776
+ dt(a.track);
777
+ };
778
+ t.addEventListener("change", n), t.addEventListener("addtrack", d), t.addEventListener("removetrack", c);
779
+ }
780
+ return e;
781
+ }
782
+ function Gt(i) {
783
+ let e = o(i).audioTracks;
784
+ if (!e && (e = new vt(), o(i).audioTracks = e, kt)) {
785
+ const t = kt.call(i.nativeEl ?? i);
786
+ for (const a of t)
787
+ ut(i, a);
788
+ const n = () => {
789
+ e.dispatchEvent(new Event("change"));
790
+ }, d = (a) => {
791
+ if ([...e].some((f) => f instanceof St)) {
792
+ for (const f of t)
793
+ ft(f);
794
+ return;
795
+ }
796
+ ut(i, a.track);
797
+ }, c = (a) => {
798
+ ft(a.track);
799
+ };
800
+ t.addEventListener("change", n), t.addEventListener("addtrack", d), t.addEventListener("removetrack", c);
801
+ }
802
+ return e;
803
+ }
804
+ export {
805
+ Qt as C,
806
+ Xt as M
807
+ };
808
+ //# sourceMappingURL=mixin-B6jYfIcp.js.map