class SpoilerManager {
  constructor() {
    this.spoilers = {};
    this.registerSpoiler = (id, notifySpoiler) => {
      if (!this.spoilers[id]) {
        this.spoilers[id] = { isActive: true, notifiers: [] };
      }
      this.spoilers[id].notifiers.push(notifySpoiler);
    };
    this.toggleSpoiler = (id) => {
      this.spoilers[id].isActive = !this.spoilers[id].isActive;
      this.spoilers[id].notifiers.forEach((notifySpoiler) => notifySpoiler());
    };
    this.isActive = (id) => this.spoilers[id]?.isActive;
  }
}
export {
  SpoilerManager
};
//# sourceMappingURL=spoiler-manager.js.map
