import{EventTarget}from'./EventTarget.js';export class ObjectWrapper{constructor(){this._listeners;} addEventListener(eventType,listener,thisObject){if(!listener){console.assert(false);} if(!this._listeners){this._listeners=new Map();} if(!this._listeners.has(eventType)){this._listeners.set(eventType,[]);} this._listeners.get(eventType).push({thisObject:thisObject,listener:listener});return{eventTarget:this,eventType:eventType,thisObject:thisObject,listener:listener};} once(eventType){return new Promise(resolve=>{const descriptor=this.addEventListener(eventType,event=>{this.removeEventListener(eventType,descriptor.listener);resolve(event.data);});});} removeEventListener(eventType,listener,thisObject){console.assert(listener);if(!this._listeners||!this._listeners.has(eventType)){return;} const listeners=this._listeners.get(eventType);for(let i=0;i