@banou/stub 0.0.18 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/.well-known/fkn.json +1 -1
- package/build/assets/lib-Preview-B6uZKyhl.js +82 -0
- package/build/assets/lib-account-BuVN6Bsx.js +41 -0
- package/build/assets/lib-account-Cw8yCZtf.js +2 -0
- package/build/assets/lib-api-DLvscoll-DhlBp9Wz.js +312 -0
- package/build/assets/lib-api-DVwR-22s.js +2 -0
- package/build/assets/lib-build-DEOZ3A7n.js +1846 -0
- package/build/assets/lib-compat-D8G4_Lzi.js +860 -0
- package/build/assets/lib-custom-media-element-CnANKrGl.js +217 -0
- package/build/assets/lib-dash.all.min-CDvdorbj.js +27251 -0
- package/build/assets/lib-dist-Dv8d3Kr0.js +7 -0
- package/build/assets/lib-dist-S8Gxnnq-.js +12468 -0
- package/build/assets/lib-dist-T0QlKbbk.js +18578 -0
- package/build/assets/lib-dist-xBHT3Lfz.js +911 -0
- package/build/assets/lib-react-BEg4mBBK.js +112 -0
- package/build/assets/lib-react-C0OCUIWX.js +434 -0
- package/build/assets/lib-react-CAkOlDha.js +367 -0
- package/build/assets/lib-react-CGlZXIjl.js +2187 -0
- package/build/assets/lib-react-CLVoi_ZM.js +334 -0
- package/build/assets/lib-react-DUxKSzCt.js +311 -0
- package/build/assets/lib-react-QvmpnEVK.js +334 -0
- package/build/assets/lib-react-WTnxAo6F.js +202 -0
- package/build/assets/lib-remote-DeY2A2G7.js +416 -0
- package/build/assets/lib-remote-DxEZmpd0.js +2 -0
- package/build/assets/lib-rolldown-runtime-B1bRi_D7.js +27 -0
- package/build/assets/lib-worker-anime-index-Jbe1K3rX.js +1 -0
- package/build/assets/lib-worker-anime-seasons-CVM0BQGM.js +1 -0
- package/build/assets/lib-worker-index-C7ynIZYg.js +1401 -0
- package/build/assets/{main-C8JOinyp.js → main-DejLBzlj.js} +1 -1
- package/build/fkn.json +1 -1
- package/build/index.html +1 -1
- package/build/index.js +40639 -0
- package/fkn.json +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { f as e, i as t } from "./lib-compat-D8G4_Lzi.js";
|
|
2
|
+
//#region node_modules/twitch-video-element/dist/twitch-video-element.js
|
|
3
|
+
e();
|
|
4
|
+
var n = "https://player.twitch.tv", r = /(?:www\.|go\.)?twitch\.tv\/(?:videos?\/|\?video=)(\d+)($|\?)/, i = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/, a = {
|
|
5
|
+
IDLE: "Idle",
|
|
6
|
+
READY: "Ready",
|
|
7
|
+
BUFFERING: "Buffering",
|
|
8
|
+
PLAYING: "Playing",
|
|
9
|
+
ENDED: "Ended"
|
|
10
|
+
}, o = {
|
|
11
|
+
DISABLE_CAPTIONS: 0,
|
|
12
|
+
ENABLE_CAPTIONS: 1,
|
|
13
|
+
PAUSE: 2,
|
|
14
|
+
PLAY: 3,
|
|
15
|
+
SEEK: 4,
|
|
16
|
+
SET_CHANNEL: 5,
|
|
17
|
+
SET_CHANNEL_ID: 6,
|
|
18
|
+
SET_COLLECTION: 7,
|
|
19
|
+
SET_QUALITY: 8,
|
|
20
|
+
SET_VIDEO: 9,
|
|
21
|
+
SET_MUTED: 10,
|
|
22
|
+
SET_VOLUME: 11
|
|
23
|
+
};
|
|
24
|
+
function s(e, t = {}) {
|
|
25
|
+
let n = {
|
|
26
|
+
src: c(e, t),
|
|
27
|
+
frameborder: "0",
|
|
28
|
+
width: "100%",
|
|
29
|
+
height: "100%",
|
|
30
|
+
allow: "accelerometer; fullscreen; autoplay; encrypted-media; picture-in-picture;",
|
|
31
|
+
sandbox: "allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",
|
|
32
|
+
scrolling: "no"
|
|
33
|
+
};
|
|
34
|
+
return t.config && (n["data-config"] = JSON.stringify(t.config)), `
|
|
35
|
+
<style>
|
|
36
|
+
:host {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
min-width: 300px;
|
|
39
|
+
min-height: 150px;
|
|
40
|
+
position: relative;
|
|
41
|
+
}
|
|
42
|
+
iframe {
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
}
|
|
49
|
+
:host(:not([controls])) {
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
53
|
+
<iframe${d(n)}></iframe>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
function c(e, t) {
|
|
57
|
+
if (!e.src) return;
|
|
58
|
+
let a = e.src.match(r), o = e.src.match(i), s = {
|
|
59
|
+
parent: globalThis.location?.hostname,
|
|
60
|
+
controls: e.controls === "" ? null : !1,
|
|
61
|
+
autoplay: e.autoplay === "" ? null : !1,
|
|
62
|
+
muted: e.muted,
|
|
63
|
+
preload: e.preload,
|
|
64
|
+
...t.config
|
|
65
|
+
};
|
|
66
|
+
return a ? `${n}/?video=v${a[1]}&${p(s)}` : o ? `${n}/?channel=${o[1]}&${p(s)}` : "";
|
|
67
|
+
}
|
|
68
|
+
var l = class extends (globalThis.HTMLElement ?? class {}) {
|
|
69
|
+
static getTemplateHTML = s;
|
|
70
|
+
static shadowRootOptions = { mode: "open" };
|
|
71
|
+
static observedAttributes = [
|
|
72
|
+
"autoplay",
|
|
73
|
+
"controls",
|
|
74
|
+
"loop",
|
|
75
|
+
"muted",
|
|
76
|
+
"playsinline",
|
|
77
|
+
"preload",
|
|
78
|
+
"src"
|
|
79
|
+
];
|
|
80
|
+
loadComplete = new h();
|
|
81
|
+
#loadRequested;
|
|
82
|
+
#hasLoaded;
|
|
83
|
+
#iframe;
|
|
84
|
+
#playerState = {};
|
|
85
|
+
#currentTime = 0;
|
|
86
|
+
#muted = !1;
|
|
87
|
+
#volume = 1;
|
|
88
|
+
#paused = !this.autoplay;
|
|
89
|
+
#seeking = !1;
|
|
90
|
+
#readyState = 0;
|
|
91
|
+
#config = null;
|
|
92
|
+
constructor() {
|
|
93
|
+
super(), this.#upgradeProperty("config");
|
|
94
|
+
}
|
|
95
|
+
get config() {
|
|
96
|
+
return this.#config;
|
|
97
|
+
}
|
|
98
|
+
set config(e) {
|
|
99
|
+
this.#config = e;
|
|
100
|
+
}
|
|
101
|
+
async load() {
|
|
102
|
+
if (this.#loadRequested) return;
|
|
103
|
+
this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
104
|
+
let e = !this.#hasLoaded;
|
|
105
|
+
if (this.#hasLoaded && (this.loadComplete = new h()), this.#hasLoaded = !0, await (this.#loadRequested = Promise.resolve()), this.#loadRequested = null, this.#readyState = 0, this.dispatchEvent(new Event("emptied")), !this.src) {
|
|
106
|
+
this.shadowRoot.innerHTML = "", globalThis.removeEventListener("message", this.#onMessage);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.dispatchEvent(new Event("loadstart"));
|
|
110
|
+
let t = this.shadowRoot.querySelector("iframe"), n = u(this.attributes);
|
|
111
|
+
e && t && (this.#config = JSON.parse(t.getAttribute("data-config") || "{}")), (!t?.src || t.src !== c(n, this)) && (this.shadowRoot.innerHTML = s(n, this), t = this.shadowRoot.querySelector("iframe")), this.#iframe = t, globalThis.addEventListener("message", this.#onMessage);
|
|
112
|
+
}
|
|
113
|
+
attributeChangedCallback(e, t, n) {
|
|
114
|
+
if (t !== n) switch (e) {
|
|
115
|
+
case "src":
|
|
116
|
+
case "controls":
|
|
117
|
+
this.load();
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
get src() {
|
|
122
|
+
return this.getAttribute("src");
|
|
123
|
+
}
|
|
124
|
+
set src(e) {
|
|
125
|
+
this.setAttribute("src", e);
|
|
126
|
+
}
|
|
127
|
+
get readyState() {
|
|
128
|
+
return this.#readyState;
|
|
129
|
+
}
|
|
130
|
+
get seeking() {
|
|
131
|
+
return this.#seeking;
|
|
132
|
+
}
|
|
133
|
+
get buffered() {
|
|
134
|
+
return g(0, this.#playerState.stats?.videoStats?.bufferSize ?? 0);
|
|
135
|
+
}
|
|
136
|
+
get paused() {
|
|
137
|
+
return this.#playerState.playback ? this.#playerState.playback === a.IDLE : this.#paused;
|
|
138
|
+
}
|
|
139
|
+
get ended() {
|
|
140
|
+
return this.#playerState.playback ? this.#playerState.playback === a.ENDED : !1;
|
|
141
|
+
}
|
|
142
|
+
get duration() {
|
|
143
|
+
return this.#playerState.duration ?? NaN;
|
|
144
|
+
}
|
|
145
|
+
get autoplay() {
|
|
146
|
+
return this.hasAttribute("autoplay");
|
|
147
|
+
}
|
|
148
|
+
set autoplay(e) {
|
|
149
|
+
this.autoplay != e && this.toggleAttribute("autoplay", !!e);
|
|
150
|
+
}
|
|
151
|
+
get controls() {
|
|
152
|
+
return this.hasAttribute("controls");
|
|
153
|
+
}
|
|
154
|
+
set controls(e) {
|
|
155
|
+
this.controls != e && this.toggleAttribute("controls", !!e);
|
|
156
|
+
}
|
|
157
|
+
get currentTime() {
|
|
158
|
+
return this.#playerState.currentTime ? this.#playerState.currentTime : this.#currentTime;
|
|
159
|
+
}
|
|
160
|
+
set currentTime(e) {
|
|
161
|
+
this.#currentTime = e, this.loadComplete.then(() => {
|
|
162
|
+
this.#sendCommand(o.SEEK, e);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
get defaultMuted() {
|
|
166
|
+
return this.hasAttribute("muted");
|
|
167
|
+
}
|
|
168
|
+
set defaultMuted(e) {
|
|
169
|
+
this.toggleAttribute("muted", !!e);
|
|
170
|
+
}
|
|
171
|
+
get loop() {
|
|
172
|
+
return this.hasAttribute("loop");
|
|
173
|
+
}
|
|
174
|
+
set loop(e) {
|
|
175
|
+
this.toggleAttribute("loop", !!e);
|
|
176
|
+
}
|
|
177
|
+
get muted() {
|
|
178
|
+
return this.#muted;
|
|
179
|
+
}
|
|
180
|
+
set muted(e) {
|
|
181
|
+
this.#muted = e, this.loadComplete.then(() => {
|
|
182
|
+
this.#sendCommand(o.SET_MUTED, e);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
get volume() {
|
|
186
|
+
return this.#volume;
|
|
187
|
+
}
|
|
188
|
+
set volume(e) {
|
|
189
|
+
this.#volume = e, this.loadComplete.then(() => {
|
|
190
|
+
this.#sendCommand(o.SET_VOLUME, e);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
get playsInline() {
|
|
194
|
+
return this.hasAttribute("playsinline");
|
|
195
|
+
}
|
|
196
|
+
set playsInline(e) {
|
|
197
|
+
this.toggleAttribute("playsinline", !!e);
|
|
198
|
+
}
|
|
199
|
+
play() {
|
|
200
|
+
this.#paused = !1, this.#sendCommand(o.PLAY);
|
|
201
|
+
}
|
|
202
|
+
pause() {
|
|
203
|
+
this.#paused = !0, this.#sendCommand(o.PAUSE);
|
|
204
|
+
}
|
|
205
|
+
#onMessage = async (e) => {
|
|
206
|
+
if (!this.#iframe.contentWindow) return;
|
|
207
|
+
let { data: t, source: n } = e;
|
|
208
|
+
if (n === this.#iframe.contentWindow) {
|
|
209
|
+
if (t.namespace === "twitch-embed") await new Promise((e) => setTimeout(e, 10)), t.eventName === "ready" ? (this.dispatchEvent(new Event("loadcomplete")), this.loadComplete.resolve(), this.#readyState = 1, this.dispatchEvent(new Event("loadedmetadata"))) : t.eventName === "seek" ? (this.#seeking = !0, this.dispatchEvent(new Event("seeking"))) : t.eventName === "playing" ? (this.#seeking && (this.#seeking = !1, this.dispatchEvent(new Event("seeked"))), this.#readyState = 3, this.dispatchEvent(new Event("playing"))) : this.dispatchEvent(new Event(t.eventName));
|
|
210
|
+
else if (t.namespace === "twitch-embed-player-proxy" && t.eventName === "UPDATE_STATE") {
|
|
211
|
+
let e = this.#playerState.duration, n = this.#playerState.currentTime, r = this.#playerState.volume, i = this.#playerState.muted, a = this.#playerState.stats?.videoStats?.bufferSize;
|
|
212
|
+
this.#playerState = {
|
|
213
|
+
...this.#playerState,
|
|
214
|
+
...t.params
|
|
215
|
+
}, e !== this.#playerState.duration && this.dispatchEvent(new Event("durationchange")), n !== this.#playerState.currentTime && this.dispatchEvent(new Event("timeupdate")), (r !== this.#playerState.volume || i !== this.#playerState.muted) && this.dispatchEvent(new Event("volumechange")), a !== this.#playerState.stats?.videoStats?.bufferSize && this.dispatchEvent(new Event("progress"));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
#sendCommand(e, t) {
|
|
220
|
+
if (!this.#iframe.contentWindow) return;
|
|
221
|
+
let r = {
|
|
222
|
+
eventName: e,
|
|
223
|
+
params: t,
|
|
224
|
+
namespace: "twitch-embed-player-proxy"
|
|
225
|
+
};
|
|
226
|
+
this.#iframe.contentWindow.postMessage(r, n);
|
|
227
|
+
}
|
|
228
|
+
#upgradeProperty(e) {
|
|
229
|
+
if (Object.prototype.hasOwnProperty.call(this, e)) {
|
|
230
|
+
let t = this[e];
|
|
231
|
+
delete this[e], this[e] = t;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
function u(e) {
|
|
236
|
+
let t = {};
|
|
237
|
+
for (let n of e) t[n.name] = n.value;
|
|
238
|
+
return t;
|
|
239
|
+
}
|
|
240
|
+
function d(e) {
|
|
241
|
+
let t = "";
|
|
242
|
+
for (let n in e) {
|
|
243
|
+
let r = e[n];
|
|
244
|
+
r === "" ? t += ` ${f(n)}` : t += ` ${f(n)}="${f(`${r}`)}"`;
|
|
245
|
+
}
|
|
246
|
+
return t;
|
|
247
|
+
}
|
|
248
|
+
function f(e) {
|
|
249
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, "`");
|
|
250
|
+
}
|
|
251
|
+
function p(e) {
|
|
252
|
+
return String(new URLSearchParams(m(e)));
|
|
253
|
+
}
|
|
254
|
+
function m(e) {
|
|
255
|
+
let t = {};
|
|
256
|
+
for (let n in e) {
|
|
257
|
+
let r = e[n];
|
|
258
|
+
r === !0 || r === "" ? t[n] = !0 : r === !1 ? t[n] = !1 : r != null && (t[n] = r);
|
|
259
|
+
}
|
|
260
|
+
return t;
|
|
261
|
+
}
|
|
262
|
+
var h = class extends Promise {
|
|
263
|
+
constructor(e = () => {}) {
|
|
264
|
+
let t, n;
|
|
265
|
+
super((r, i) => {
|
|
266
|
+
e(r, i), t = r, n = i;
|
|
267
|
+
}), this.resolve = t, this.reject = n;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
function g(e, t) {
|
|
271
|
+
return _(Array.isArray(e) ? e : e == null || t == null || e === 0 && t === 0 ? [[0, 0]] : [[e, t]]);
|
|
272
|
+
}
|
|
273
|
+
function _(e) {
|
|
274
|
+
return Object.defineProperties(e, {
|
|
275
|
+
start: { value: (t) => e[t][0] },
|
|
276
|
+
end: { value: (t) => e[t][1] }
|
|
277
|
+
}), e;
|
|
278
|
+
}
|
|
279
|
+
globalThis.customElements && !globalThis.customElements.get("twitch-video") && globalThis.customElements.define("twitch-video", l);
|
|
280
|
+
var v = l, y = /* @__PURE__ */ new Set([
|
|
281
|
+
"style",
|
|
282
|
+
"children",
|
|
283
|
+
"ref",
|
|
284
|
+
"key",
|
|
285
|
+
"suppressContentEditableWarning",
|
|
286
|
+
"suppressHydrationWarning",
|
|
287
|
+
"dangerouslySetInnerHTML"
|
|
288
|
+
]), b = {
|
|
289
|
+
className: "class",
|
|
290
|
+
htmlFor: "for"
|
|
291
|
+
};
|
|
292
|
+
function x(e) {
|
|
293
|
+
return e.toLowerCase();
|
|
294
|
+
}
|
|
295
|
+
function S(e) {
|
|
296
|
+
if (typeof e == "boolean") return e ? "" : void 0;
|
|
297
|
+
if (typeof e != "function" && !(typeof e == "object" && e)) return e;
|
|
298
|
+
}
|
|
299
|
+
function C({ react: e, tagName: t, elementClass: n, events: r, displayName: i, defaultProps: a, toAttributeName: o = x, toAttributeValue: s = S }) {
|
|
300
|
+
let c = Number.parseInt(e.version) >= 19, l = e.forwardRef((i, l) => {
|
|
301
|
+
let u = e.useRef(null), d = e.useRef(/* @__PURE__ */ new Map()), f = {}, p = {}, m = {}, h = {};
|
|
302
|
+
for (let [e, t] of Object.entries(i)) {
|
|
303
|
+
if (y.has(e)) {
|
|
304
|
+
m[e] = t;
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
let r = o(b[e] ?? e);
|
|
308
|
+
if (e in n.prototype && !(e in (globalThis.HTMLElement?.prototype ?? {})) && !n.observedAttributes?.some((e) => e === r)) {
|
|
309
|
+
h[e] = t;
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
if (e.startsWith("on")) {
|
|
313
|
+
f[e] = t;
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
let i = s(t);
|
|
317
|
+
r && i != null && (p[r] = String(i), c || (m[r] = i)), r && c && (i === S(t) ? m[r] = t : m[r] = i);
|
|
318
|
+
}
|
|
319
|
+
if (typeof window < "u") {
|
|
320
|
+
for (let t in f) {
|
|
321
|
+
let n = f[t], i = t.endsWith("Capture"), a = (r?.[t] ?? t.slice(2).toLowerCase()).slice(0, i ? -7 : void 0);
|
|
322
|
+
e.useLayoutEffect(() => {
|
|
323
|
+
let e = u?.current;
|
|
324
|
+
if (!(!e || typeof n != "function")) return e.addEventListener(a, n, i), () => {
|
|
325
|
+
e.removeEventListener(a, n, i);
|
|
326
|
+
};
|
|
327
|
+
}, [u?.current, n]);
|
|
328
|
+
}
|
|
329
|
+
e.useLayoutEffect(() => {
|
|
330
|
+
if (u.current === null) return;
|
|
331
|
+
let e = /* @__PURE__ */ new Map();
|
|
332
|
+
for (let t in h) w(u.current, t, h[t]), d.current.delete(t), e.set(t, h[t]);
|
|
333
|
+
for (let [e, t] of d.current) w(u.current, e, void 0);
|
|
334
|
+
d.current = e;
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
if (typeof window > "u" && n?.getTemplateHTML && n?.shadowRootOptions) {
|
|
338
|
+
let { mode: t, delegatesFocus: r } = n.shadowRootOptions;
|
|
339
|
+
m.children = [e.createElement("template", {
|
|
340
|
+
shadowrootmode: t,
|
|
341
|
+
shadowrootdelegatesfocus: r,
|
|
342
|
+
dangerouslySetInnerHTML: { __html: n.getTemplateHTML(p, i) }
|
|
343
|
+
}), m.children];
|
|
344
|
+
}
|
|
345
|
+
return e.createElement(t, {
|
|
346
|
+
...a,
|
|
347
|
+
...m,
|
|
348
|
+
ref: e.useCallback((e) => {
|
|
349
|
+
u.current = e, typeof l == "function" ? l(e) : l !== null && (l.current = e);
|
|
350
|
+
}, [l])
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
return l.displayName = i ?? n.name, l;
|
|
354
|
+
}
|
|
355
|
+
function w(e, t, n) {
|
|
356
|
+
e[t] = n, n == null && t in (globalThis.HTMLElement?.prototype ?? {}) && e.removeAttribute(t);
|
|
357
|
+
}
|
|
358
|
+
var T = C({
|
|
359
|
+
react: t,
|
|
360
|
+
tagName: "twitch-video",
|
|
361
|
+
elementClass: v,
|
|
362
|
+
toAttributeName(e) {
|
|
363
|
+
return e === "muted" ? "" : e === "defaultMuted" ? "muted" : x(e);
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
//#endregion
|
|
367
|
+
export { T as default };
|