import { useState, useEffect } from 'react';
import { create } from 'zustand';
import { persist, createJSONStorage } from 'zustand/middleware';
import { h as HHG_CART_CARE_STORE_KEY } from './index-a8162282.js';

const useIsInit = () => {
    const [isInit, setIsInit] = useState(true);
    useEffect(() => {
        setIsInit(false);
    }, []);
    return isInit;
};

const useCartCareService = create()(persist((set, get) => ({
    href: null,
    setHref: (href) => {
        set({ href });
    },
    getHref: () => {
        var _a;
        return (_a = get().href) !== null && _a !== void 0 ? _a : null;
    },
    resetHref: () => {
        set({ href: null });
    },
}), {
    name: HHG_CART_CARE_STORE_KEY,
    storage: createJSONStorage(() => localStorage),
}));

export { useCartCareService as a, useIsInit as u };
