import { useEffect } from 'react';
import { create } from 'zustand';
import { devtools } from 'zustand/middleware';
export const useInquiryStore = create()(devtools((set) => ({
    title: '',
    setInquiryToolbarTitle: (title) => set((state) => ({ title: title })),
    workflowMap: {},
    setWorkflowMap: (workflowMap) => set((state) => ({
        workflowMap: Object.assign(Object.assign({}, state.workflowMap), workflowMap)
    })),
    workflowStarting: false,
    setWorkflowStarting: (workflowStarting) => set((state) => ({ workflowStarting })),
    inquiryMenuHidden: false,
    setInquiryMenuHidden: (inquiryMenuHidden) => set((state) => ({
        inquiryMenuHidden: inquiryMenuHidden
    }))
})));
export const useSetInitialInquiryMenuVisibility = () => {
    const searchParams = new URLSearchParams(window.location.search);
    const inquiryMenuHidden = searchParams.has('inquiryMenuHidden') === true
        ? searchParams.get('inquiryMenuHidden') === 'true'
            ? true
            : false
        : false;
    const setInquiryMenuHidden = useInquiryStore((state) => state.setInquiryMenuHidden);
    useEffect(() => {
        if (inquiryMenuHidden) {
            setInquiryMenuHidden(true);
        }
    }, [setInquiryMenuHidden, inquiryMenuHidden]);
};
//# sourceMappingURL=inquiryStore.js.map