"use strict";function _define_property(a,n,e){return n in a?Object.defineProperty(a,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[n]=e,a}Object.defineProperty(exports,"__esModule",{value:!0});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();exports.default=AnimationManager$1;
