class i {
  constructor() {
    this.listeners = /* @__PURE__ */ new Map();
  }
  emit(t, e) {
    return Array.from(this.getEventListenerSet(t)).map((s) => s(e));
  }
  register(t, e) {
    return this.getEventListenerSet(t).add(e), () => this.getEventListenerSet(t).delete(e);
  }
  unregister(t, e) {
    this.getEventListenerSet(t).delete(e);
  }
  getEventListenerSet(t) {
    let e = this.listeners.get(t);
    return e || (e = /* @__PURE__ */ new Set(), this.listeners.set(t, e)), e;
  }
}
export {
  i as BaseEvent
};
