import { createContext } from "@lit/context";

//#region src/gui/tree/treeContext.ts
/**
* Lit context for tree components
*/
const treeContext = createContext("ef-tree-context");
/**
* Helper to collect all item IDs from a tree (for default expanded state)
*/
function collectAllIds(items) {
	const ids = /* @__PURE__ */ new Set();
	function traverse(item) {
		ids.add(item.id);
		if (item.children) for (const child of item.children) traverse(child);
	}
	for (const item of items) traverse(item);
	return ids;
}

//#endregion
export { collectAllIds, treeContext };
//# sourceMappingURL=treeContext.js.map