import { create } from 'zustand';
import { useGitStore } from './gitStore';
import { useSessionFilesStore } from './sessionFilesStore';
import { useSettingsStore } from './settingsStore';
import { useResearchStore } from './researchStore';
export const useTunnelStore = create((set) => ({
    isExpanded: false,
    status: 'idle',
    url: null,
    qrCode: null,
    error: null,
    progress: null,
    toggleSidebar: () => {
        set((state) => {
            const newExpanded = !state.isExpanded;
            if (newExpanded) {
                useGitStore.getState().collapseSidebar();
                useSessionFilesStore.getState().collapseSidebar();
                useSettingsStore.getState().collapseSidebar();
                useResearchStore.getState().collapseSidebar();
            }
            return { isExpanded: newExpanded };
        });
    },
    expandSidebar: () => {
        useGitStore.getState().collapseSidebar();
        useSessionFilesStore.getState().collapseSidebar();
        useSettingsStore.getState().collapseSidebar();
        useResearchStore.getState().collapseSidebar();
        set({ isExpanded: true });
    },
    collapseSidebar: () => set({ isExpanded: false }),
    setStatus: (status) => set({ status }),
    setUrl: (url) => set({ url }),
    setQrCode: (qrCode) => set({ qrCode }),
    setError: (error) => set({ error }),
    setProgress: (progress) => set({ progress }),
    reset: () => set({
        status: 'idle',
        url: null,
        qrCode: null,
        error: null,
        progress: null,
    }),
}));
//# sourceMappingURL=tunnelStore.js.map