"use client";
import { isOptionsGroup } from "../Combobox/OptionsDropdown/is-options-group.mjs";
//#region packages/@mantine/core/src/components/MultiSelect/filter-picked-values.ts
function normalizeValue(value) {
	return typeof value === "string" ? value.trim().toLowerCase() : value;
}
function filterPickedValues({ data, value }) {
	const normalizedValue = value.map(normalizeValue);
	return data.reduce((acc, item) => {
		if (isOptionsGroup(item)) acc.push({
			group: item.group,
			items: item.items.filter((option) => normalizedValue.indexOf(normalizeValue(option.value)) === -1)
		});
		else if (normalizedValue.indexOf(normalizeValue(item.value)) === -1) acc.push(item);
		return acc;
	}, []);
}
//#endregion
export { filterPickedValues };

//# sourceMappingURL=filter-picked-values.mjs.map