//#region src/features/panels/Image/core/imageTypes.ts
function e(e) {
	if (!(e instanceof Uint8Array)) return null;
	let t = new Uint8Array(e.byteLength);
	return t.set(e), {
		data: t,
		transfer: [t.buffer]
	};
}
function t(e) {
	return !!(e && typeof e == "object" && "format" in e && "data" in e && e.data instanceof Uint8Array);
}
function n(e) {
	return !!(e && typeof e == "object" && "format" in e && "data" in e && e.data instanceof Uint8Array);
}
function r(e) {
	return t(e) || n(e);
}
function i(e) {
	return e.format;
}
function a(e) {
	return r(e) ? c(i(e)) === "h264" : !1;
}
function o(e) {
	return !!(e && typeof e == "object" && "encoding" in e && "width" in e && "height" in e && "data" in e && e.data instanceof Uint8Array);
}
var s = /\b(jpeg|jpg|png|webp|gif|avif|bmp|h264)\b/i;
function c(e) {
	let t = e.trim().toLowerCase();
	if (t === "h264" || t.includes("h264")) return "h264";
	let n = e.match(s);
	if (!n || !n[1]) return null;
	let r = n[1].toLowerCase();
	return r === "jpg" || r === "jpeg" ? "jpeg" : r === "png" || r === "webp" || r === "gif" || r === "avif" || r === "bmp" ? r : r === "h264" ? "h264" : null;
}
function l(e) {
	let t = e.trim();
	if (!t) return !1;
	let n = t.toLowerCase();
	return n.includes("compressedimage") || n.includes("compressedvideo") ? !1 : /(^|\/)sensor_msgs\/(msg\/)?image$/i.test(t);
}
var u = [
	"image",
	"CompressedImage",
	"CompressedVideo"
];
//#endregion
export { o as a, a as i, i as n, l as o, r, e as s, u as t };
