define(["exports"],function(_exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,(EventEmitter.EventEmitter=EventEmitter).prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if("number"!=typeof n||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var handler,len,args,i,listeners,err,er;if((this._events||(this._events={}),"error"===type)&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length))throw(er=arguments[1])instanceof Error?er:((err=new Error('Uncaught, unspecified "error" event. ('+er+")")).context=er,err);if(void 0===(handler=this._events[type]))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),len=(listeners=handler.slice()).length,i=0;ilistener&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace)&&console.trace(),this;throw TypeError("listener must be a function")},EventEmitter.prototype.once=function(type,listener){var fired;if(isFunction(listener))return fired=!1,g.listener=listener,this.on(type,g),this;throw TypeError("listener must be a function");function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(this._events&&this._events[type])if(length=(list=this._events[type]).length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;0