function _define_property(a,n,i){return n in a?Object.defineProperty(a,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[n]=i,a}class AnimationManager{static getInstance(){return AnimationManager.instance||(AnimationManager.instance=new AnimationManager),AnimationManager.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(){_define_property(this,"callbacks",new Set),_define_property(this,"animationFrameId",null)}}_define_property(AnimationManager,"instance",void 0);var AnimationManager$1=AnimationManager.getInstance();export{AnimationManager$1 as default};
