import { formatFileSize as e } from "../internal/utils/strings.js";
//#region src/dropzone/dropzone.util.ts
function t(e) {
	return e.split(",").map((e) => {
		let t = e.trim();
		return t.startsWith(".") && (t = t.slice(1)), t.endsWith("/*") && (t = t.split("/")[0]), t.includes("/") && (t = t.split("/")[1]), t.includes("+") && (t = t.split("+")[0]), t;
	});
}
function n(t, n) {
	let r = n, i = t;
	return !i || !Array.isArray(i) || i.length === 0 ? { validity: { valid: !0 } } : i.filter((e) => e.size > r.maxFileSize).length > 0 ? {
		validity: {
			rangeOverflow: !0,
			valid: !1
		},
		message: `Some files exceed the maximum size of ${e(r.maxFileSize)}`
	} : { validity: { valid: !0 } };
}
function r(e, n) {
	let r = n, i = e;
	if (!i || !Array.isArray(i) || i.length === 0) return { validity: { valid: !0 } };
	let a = t(r.accept);
	return i.filter((e) => !a.some((t) => e.type.includes(t))).length > 0 ? {
		validity: {
			typeMismatch: !0,
			valid: !1
		},
		message: "Some files are not of accepted types"
	} : { validity: { valid: !0 } };
}
//#endregion
export { n as fileSizeValidator, r as fileTypeValidator, t as getFileTypeSpecifiers };

//# sourceMappingURL=dropzone.util.js.map