import { F as e, g as t, j as n } from "./vidstack-D9mvYVIz-DesuYgKV.js";
//#region node_modules/vidstack/prod/chunks/vidstack-mvRkf9tF.js
function r(e, t) {
	let n = new URL(e);
	for (let e of Object.keys(t)) n.searchParams.set(e, t[e] + "");
	return n.toString();
}
function i(e, t = "preconnect") {
	if (!n(document.querySelector(`link[href="${e}"]`))) return !0;
	let r = document.createElement("link");
	return r.rel = t, r.href = e, r.crossOrigin = "true", document.head.append(r), !0;
}
var a = {};
function o(e) {
	if (a[e]) return a[e].promise;
	let r = t();
	if (!n(document.querySelector(`script[src="${e}"]`))) return r.resolve(), r.promise;
	a[e] = r;
	let i = document.createElement("script");
	return i.src = e, i.onload = () => {
		r.resolve(), delete a[e];
	}, i.onerror = () => {
		r.reject(), delete a[e];
	}, setTimeout(() => document.head.append(i), 0), r.promise;
}
function s(t) {
	return t === "use-credentials" ? "include" : e(t) ? "same-origin" : void 0;
}
//#endregion
export { i, s as n, o as r, r as t };
