var __defProp = Object.defineProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, {
      get: all[name],
      enumerable: true,
      configurable: true,
      set: (newValue) => all[name] = () => newValue
    });
};
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);

// src/renderer.ts
class BaseRenderer {
  nodes = new Map;
  getNode(id) {
    return this.nodes.get(id);
  }
  clear() {
    this.nodes.clear();
  }
  applyPatch(patch) {
    switch (patch.type) {
      case "create":
        this.onCreate(patch.id, patch.elementType, patch.props || {});
        break;
      case "setProp":
        this.onSetProp(patch.id, patch.name, patch.value);
        break;
      case "setText":
        this.onSetText(patch.id, patch.text);
        break;
      case "insert":
        this.onInsert(patch.parentId, patch.id, patch.beforeId);
        break;
      case "move":
        this.onMove(patch.parentId, patch.id, patch.beforeId);
        break;
      case "remove":
        this.onRemove(patch.id);
        break;
      case "attachEvent":
        this.onAttachEvent(patch.id, patch.eventName);
        break;
      case "detachEvent":
        this.onDetachEvent(patch.id, patch.eventName);
        break;
    }
  }
}

class ConsoleRenderer {
  applyPatches(patches) {
    console.group("Patches:");
    for (const patch of patches) {
      console.log(patch);
    }
    console.groupEnd();
  }
}
export {
  ConsoleRenderer,
  BaseRenderer
};

//# debugId=15FD0D9369E56E6C64756E2164756E21
