function a(a,t,n){return t in a?Object.defineProperty(a,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[t]=n,a}let t=class t{static getInstance(){return t.instance||(t.instance=new t),t.instance}register(a){this.callbacks.add(a),null===this.animationFrameId&&this.start()}unregister(a){this.callbacks.delete(a),0===this.callbacks.size&&null!==this.animationFrameId&&this.stop()}start(){let a=()=>{this.callbacks.forEach(a=>a()),this.animationFrameId=requestAnimationFrame(a)};this.animationFrameId=requestAnimationFrame(a)}stop(){null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}constructor(){a(this,"callbacks",new Set),a(this,"animationFrameId",null)}};a(t,"instance",void 0);var n=t.getInstance();export{n as default};
