import { t as e } from "./vidstack-BLEs9rMG-Agxpv9v8.js";
//#region node_modules/vidstack/prod/chunks/vidstack-IMa-zkAV.js
var t = /* @__PURE__ */ e({
	findYouTubePoster: () => o,
	resolveYouTubeVideoId: () => a
}), n = /(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)(?:\/shorts)?\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
function a(e) {
	return e.match(n)?.[1];
}
async function o(e, t) {
	if (r.has(e)) return r.get(e);
	if (i.has(e)) return i.get(e);
	let n = new Promise(async (n) => {
		for (let i of [
			"maxresdefault",
			"sddefault",
			"hqdefault"
		]) for (let a of [!0, !1]) {
			let o = s(e, i, a);
			if ((await fetch(o, {
				mode: "no-cors",
				signal: t.signal
			})).status < 400) {
				r.set(e, o), n(o);
				return;
			}
		}
	}).catch(() => "").finally(() => i.delete(e));
	return i.set(e, n), n;
}
function s(e, t, n) {
	return `https://i.ytimg.com/${n ? "vi_webp" : "vi"}/${e}/${t}.${n ? "webp" : "jpg"}`;
}
//#endregion
export { a as resolveYouTubeVideoId, t as utils_exports };
