import { z } from "zod";
import { deserializeSiteVersion } from "../api/site-version";
import { MakeswiftClient } from "../client";
import { MAKESWIFT_CACHE_TAG } from "./cache";
const previewDataSchema = z.object({
  siteVersion: z.string()
});
class Makeswift extends MakeswiftClient {
  static getSiteVersion(previewData) {
    const parsedSiteVersion = previewDataSchema.safeParse(previewData);
    if (!parsedSiteVersion.success)
      return null;
    return deserializeSiteVersion(parsedSiteVersion.data.siteVersion);
  }
  static getPreviewMode(previewData) {
    return this.getSiteVersion(previewData) != null;
  }
  fetchOptions(_siteVersion) {
    return {
      next: {
        tags: [MAKESWIFT_CACHE_TAG]
      }
    };
  }
}
export {
  Makeswift
};
//# sourceMappingURL=client.js.map