//#region src/agent/skills/marketplace/marketplace-category-order.ts
const CATCH_ALL_ID = new Set([
	"other",
	"others",
	"misc",
	"miscellaneous"
]);
const CATCH_ALL_LABEL = new Set([
	"其他",
	"other",
	"others",
	"misc",
	"miscellaneous"
]);
function normalizeToken(value) {
	return value.trim().toLowerCase();
}
/** Catch-all marketplace category (e.g. SkillHub curated index "其他") — shown last in filter chips. */
function isMarketplaceCatchAllCategory(category) {
	const id = normalizeToken(category.id);
	const label = normalizeToken(category.label);
	return CATCH_ALL_ID.has(id) || CATCH_ALL_LABEL.has(label);
}
/** Stable sort: `compare` first, then pin catch-all categories to the end. */
function sortMarketplaceCategories(items, compare) {
	const regular = [];
	const catchAll = [];
	for (const item of items) (isMarketplaceCatchAllCategory(item) ? catchAll : regular).push(item);
	regular.sort(compare);
	catchAll.sort(compare);
	return [...regular, ...catchAll];
}
//#endregion
export { isMarketplaceCatchAllCategory, sortMarketplaceCategories };

//# sourceMappingURL=marketplace-category-order.js.map