class ViewportManager {
    reactFlowInstance = null;
    currentViewport = {
        x: 0,
        y: 0,
        zoom: 1
    };
    setReactFlowInstance(instance) {
        this.reactFlowInstance = instance;
    }
    getReactFlowInstance() {
        return this.reactFlowInstance;
    }
    setCurrentViewport(viewport) {
        this.currentViewport = viewport;
    }
    getCurrentViewport() {
        if (this.reactFlowInstance) return this.reactFlowInstance.getViewport();
        return this.currentViewport;
    }
    restoreViewport(viewport) {
        if (this.reactFlowInstance) this.reactFlowInstance.setViewport(viewport);
    }
}
const viewportManager = new ViewportManager();
export { viewportManager };
