import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
import { clientStorage, authStorage } from "./storage.js";
const loadClientFromStorage = (store) => {
  const storedClient = clientStorage().get();
  if (isClient(storedClient) && !store.workspace["x-scalar-default-client"]) {
    store.update("x-scalar-default-client", storedClient);
  }
};
const loadAuthFromStorage = (store, slug) => {
  const authPersistence = authStorage();
  const auth = authPersistence.getAuth(slug);
  store.auth.load({ [slug]: auth });
};
export {
  loadAuthFromStorage,
  loadClientFromStorage
};
