import { zwitch } from "../../../zwitch/index.js";
import { comment } from "./comment.js";
import { doctype } from "./doctype.js";
import { element } from "./element.js";
import { text } from "./text.js";
import { raw } from "./raw.js";
import { root } from "./root.js";
const handle = zwitch("type", {
	invalid,
	unknown,
	handlers: {
		comment,
		doctype,
		element,
		raw,
		root,
		text
	}
});
function invalid(e) {
	throw Error("Expected node, not `" + e + "`");
}
function unknown(e) {
	let l = e;
	throw Error("Cannot compile unknown node `" + l.type + "`");
}
export { handle };
