class SimpleEventEmitter{constructor(){this.listeners={}}on(s,t){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(t)}emit(s,t){this.listeners[s]&&this.listeners[s].forEach(s=>s(t))}}class TaskScheduler extends SimpleEventEmitter{constructor(s){super(),this.tasks=s,this.currentTaskIndex=0,this.setupTaskListeners()}setupTaskListeners(){this.tasks.forEach((s,t)=>{this.on("taskStarted",e=>{e===t&&(console.log(`Starting task ${t+1}`),s.task(()=>{const e=s.message||`Task ${t+1} completed with no custom message.`;console.log(e),this.emit("taskFinished")}))})}),this.on("taskFinished",()=>{this.currentTaskIndex++,this.currentTaskIndex