import { zwitch } from "../zwitch/index.js";
import { comment } from "./lib-handle-comment.js";
import { doctype } from "./lib-handle-doctype.js";
import { element } from "./lib-handle-element.js";
import { raw } from "./lib-handle-raw.js";
import { root } from "./lib-handle-root.js";
import { text } from "./lib-handle-text.js";
const handle = zwitch("type", {
  invalid,
  unknown,
  handlers: { comment, doctype, element, raw, root, text }
});
function invalid(node) {
  throw new Error("Expected node, not `" + node + "`");
}
function unknown(node_) {
  const node = (
    /** @type {Nodes} */
    node_
  );
  throw new Error("Cannot compile unknown node `" + node.type + "`");
}
export {
  handle
};
//# sourceMappingURL=lib-handle-index.js.map
