tor('.delete-popup');
        if (popup) {
            popup.remove();
        }
    }

    function confirmDelete(id) {
        const numericId = parseInt(id);
        const history = JSON.parse(localStorage.getItem('mindmap-history') || '[]');
        const updatedHistory = history.filter(item => item.id !== numericId);
        localStorage.setItem('mindmap-history', JSON.stringify(updatedHistory));
        loadMindmaps();
        closeDeletePopup();
    }
    document.addEventListener('DOMContentLoaded',