diff --git a/.gitignore b/.gitignore index 339d30d..e4887ed 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,5 @@ next-env.d.ts # cloudflare .open-next/ +.open-next 2/ .wrangler/ diff --git a/.open-next 2/.build/cache.cjs b/.open-next 2/.build/cache.cjs deleted file mode 100644 index 701912c..0000000 --- a/.open-next 2/.build/cache.cjs +++ /dev/null @@ -1,539 +0,0 @@ -globalThis.disableIncrementalCache = false;globalThis.disableDynamoDBCache = false;globalThis.isNextAfter15 = true;globalThis.openNextDebug = false;globalThis.openNextVersion = "3.9.12"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/@opennextjs/aws/dist/adapters/cache.js -var cache_exports = {}; -__export(cache_exports, { - SOFT_TAG_PREFIX: () => SOFT_TAG_PREFIX, - default: () => Cache -}); -module.exports = __toCommonJS(cache_exports); - -// node_modules/@opennextjs/aws/dist/utils/error.js -function isOpenNextError(e) { - try { - return "__openNextInternal" in e; - } catch { - return false; - } -} - -// node_modules/@opennextjs/aws/dist/adapters/logger.js -function debug(...args) { - if (globalThis.openNextDebug) { - console.log(...args); - } -} -function warn(...args) { - console.warn(...args); -} -var DOWNPLAYED_ERROR_LOGS = [ - { - clientName: "S3Client", - commandName: "GetObjectCommand", - errorName: "NoSuchKey" - } -]; -var isDownplayedErrorLog = (errorLog) => DOWNPLAYED_ERROR_LOGS.some((downplayedInput) => downplayedInput.clientName === errorLog?.clientName && downplayedInput.commandName === errorLog?.commandName && (downplayedInput.errorName === errorLog?.error?.name || downplayedInput.errorName === errorLog?.error?.Code)); -function error(...args) { - if (args.some((arg) => isDownplayedErrorLog(arg))) { - return debug(...args); - } - if (args.some((arg) => isOpenNextError(arg))) { - const error2 = args.find((arg) => isOpenNextError(arg)); - if (error2.logLevel < getOpenNextErrorLogLevel()) { - return; - } - if (error2.logLevel === 0) { - return console.log(...args.map((arg) => isOpenNextError(arg) ? `${arg.name}: ${arg.message}` : arg)); - } - if (error2.logLevel === 1) { - return warn(...args.map((arg) => isOpenNextError(arg) ? `${arg.name}: ${arg.message}` : arg)); - } - return console.error(...args); - } - console.error(...args); -} -function getOpenNextErrorLogLevel() { - const strLevel = process.env.OPEN_NEXT_ERROR_LOG_LEVEL ?? "1"; - switch (strLevel.toLowerCase()) { - case "debug": - case "0": - return 0; - case "error": - case "2": - return 2; - default: - return 1; - } -} - -// node_modules/@opennextjs/aws/dist/utils/cache.js -async function hasBeenRevalidated(key, tags, cacheEntry) { - if (globalThis.openNextConfig.dangerous?.disableTagCache) { - return false; - } - const value = cacheEntry.value; - if (!value) { - return true; - } - if ("type" in cacheEntry && cacheEntry.type === "page") { - return false; - } - const lastModified = cacheEntry.lastModified ?? Date.now(); - if (globalThis.tagCache.mode === "nextMode") { - return tags.length === 0 ? false : await globalThis.tagCache.hasBeenRevalidated(tags, lastModified); - } - const _lastModified = await globalThis.tagCache.getLastModified(key, lastModified); - return _lastModified === -1; -} -function getTagsFromValue(value) { - if (!value) { - return []; - } - try { - const cacheTags = value.meta?.headers?.["x-next-cache-tags"]?.split(",") ?? []; - delete value.meta?.headers?.["x-next-cache-tags"]; - return cacheTags; - } catch (e) { - return []; - } -} -function getTagKey(tag) { - if (typeof tag === "string") { - return tag; - } - return JSON.stringify({ - tag: tag.tag, - path: tag.path - }); -} -async function writeTags(tags) { - const store = globalThis.__openNextAls.getStore(); - debug("Writing tags", tags, store); - if (!store || globalThis.openNextConfig.dangerous?.disableTagCache) { - return; - } - const tagsToWrite = tags.filter((t) => { - const tagKey = getTagKey(t); - const shouldWrite = !store.writtenTags.has(tagKey); - if (shouldWrite) { - store.writtenTags.add(tagKey); - } - return shouldWrite; - }); - if (tagsToWrite.length === 0) { - return; - } - await globalThis.tagCache.writeTags(tagsToWrite); -} - -// node_modules/@opennextjs/aws/dist/utils/binary.js -var commonBinaryMimeTypes = /* @__PURE__ */ new Set([ - "application/octet-stream", - // Docs - "application/epub+zip", - "application/msword", - "application/pdf", - "application/rtf", - "application/vnd.amazon.ebook", - "application/vnd.ms-excel", - "application/vnd.ms-powerpoint", - "application/vnd.openxmlformats-officedocument.presentationml.presentation", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - // Fonts - "font/otf", - "font/woff", - "font/woff2", - // Images - "image/bmp", - "image/gif", - "image/jpeg", - "image/png", - "image/tiff", - "image/vnd.microsoft.icon", - "image/webp", - // Audio - "audio/3gpp", - "audio/aac", - "audio/basic", - "audio/flac", - "audio/mpeg", - "audio/ogg", - "audio/wavaudio/webm", - "audio/x-aiff", - "audio/x-midi", - "audio/x-wav", - // Video - "video/3gpp", - "video/mp2t", - "video/mpeg", - "video/ogg", - "video/quicktime", - "video/webm", - "video/x-msvideo", - // Archives - "application/java-archive", - "application/vnd.apple.installer+xml", - "application/x-7z-compressed", - "application/x-apple-diskimage", - "application/x-bzip", - "application/x-bzip2", - "application/x-gzip", - "application/x-java-archive", - "application/x-rar-compressed", - "application/x-tar", - "application/x-zip", - "application/zip", - // Serialized data - "application/x-protobuf" -]); -function isBinaryContentType(contentType) { - if (!contentType) - return false; - const value = contentType.split(";")[0]; - return commonBinaryMimeTypes.has(value); -} - -// node_modules/@opennextjs/aws/dist/adapters/cache.js -var SOFT_TAG_PREFIX = "_N_T_/"; -function isFetchCache(options) { - if (typeof options === "boolean") { - return options; - } - if (typeof options === "object") { - return options.kindHint === "fetch" || options.fetchCache || options.kind === "FETCH"; - } - return false; -} -var Cache = class { - async get(key, options) { - if (globalThis.openNextConfig.dangerous?.disableIncrementalCache) { - return null; - } - const softTags = typeof options === "object" ? options.softTags : []; - const tags = typeof options === "object" ? options.tags : []; - return isFetchCache(options) ? this.getFetchCache(key, softTags, tags) : this.getIncrementalCache(key); - } - async getFetchCache(key, softTags, tags) { - debug("get fetch cache", { key, softTags, tags }); - try { - const cachedEntry = await globalThis.incrementalCache.get(key, "fetch"); - if (cachedEntry?.value === void 0) - return null; - const _tags = [...tags ?? [], ...softTags ?? []]; - const _lastModified = cachedEntry.lastModified ?? Date.now(); - const _hasBeenRevalidated = cachedEntry.shouldBypassTagCache ? false : await hasBeenRevalidated(key, _tags, cachedEntry); - if (_hasBeenRevalidated) - return null; - if ((tags ?? []).length === 0) { - const path = softTags?.find((tag) => tag.startsWith(SOFT_TAG_PREFIX) && !tag.endsWith("layout") && !tag.endsWith("page")); - if (path) { - const hasPathBeenUpdated = cachedEntry.shouldBypassTagCache ? false : await hasBeenRevalidated(path.replace(SOFT_TAG_PREFIX, ""), [], cachedEntry); - if (hasPathBeenUpdated) { - return null; - } - } - } - return { - lastModified: _lastModified, - value: cachedEntry.value - }; - } catch (e) { - debug("Failed to get fetch cache", e); - return null; - } - } - async getIncrementalCache(key) { - try { - const cachedEntry = await globalThis.incrementalCache.get(key, "cache"); - if (!cachedEntry?.value) { - return null; - } - const cacheData = cachedEntry.value; - const meta = cacheData.meta; - const tags = getTagsFromValue(cacheData); - const _lastModified = cachedEntry.lastModified ?? Date.now(); - const _hasBeenRevalidated = cachedEntry.shouldBypassTagCache ? false : await hasBeenRevalidated(key, tags, cachedEntry); - if (_hasBeenRevalidated) - return null; - const store = globalThis.__openNextAls.getStore(); - if (store) { - store.lastModified = _lastModified; - } - if (cacheData?.type === "route") { - return { - lastModified: _lastModified, - value: { - kind: globalThis.isNextAfter15 ? "APP_ROUTE" : "ROUTE", - body: Buffer.from(cacheData.body ?? Buffer.alloc(0), isBinaryContentType(String(meta?.headers?.["content-type"])) ? "base64" : "utf8"), - status: meta?.status, - headers: meta?.headers - } - }; - } - if (cacheData?.type === "page" || cacheData?.type === "app") { - if (globalThis.isNextAfter15 && cacheData?.type === "app") { - const segmentData = /* @__PURE__ */ new Map(); - if (cacheData.segmentData) { - for (const [segmentPath, segmentContent] of Object.entries(cacheData.segmentData ?? {})) { - segmentData.set(segmentPath, Buffer.from(segmentContent)); - } - } - return { - lastModified: _lastModified, - value: { - kind: "APP_PAGE", - html: cacheData.html, - rscData: Buffer.from(cacheData.rsc), - status: meta?.status, - headers: meta?.headers, - postponed: meta?.postponed, - segmentData - } - }; - } - return { - lastModified: _lastModified, - value: { - kind: globalThis.isNextAfter15 ? "PAGES" : "PAGE", - html: cacheData.html, - pageData: cacheData.type === "page" ? cacheData.json : cacheData.rsc, - status: meta?.status, - headers: meta?.headers - } - }; - } - if (cacheData?.type === "redirect") { - return { - lastModified: _lastModified, - value: { - kind: "REDIRECT", - props: cacheData.props - } - }; - } - warn("Unknown cache type", cacheData); - return null; - } catch (e) { - debug("Failed to get body cache", e); - return null; - } - } - async set(key, data, ctx) { - if (globalThis.openNextConfig.dangerous?.disableIncrementalCache) { - return; - } - const detachedPromise = globalThis.__openNextAls.getStore()?.pendingPromiseRunner.withResolvers(); - try { - if (data === null || data === void 0) { - await globalThis.incrementalCache.delete(key); - } else { - const revalidate = this.extractRevalidateForSet(ctx); - switch (data.kind) { - case "ROUTE": - case "APP_ROUTE": { - const { body, status, headers } = data; - await globalThis.incrementalCache.set(key, { - type: "route", - body: body.toString(isBinaryContentType(String(headers["content-type"])) ? "base64" : "utf8"), - meta: { - status, - headers - }, - revalidate - }, "cache"); - break; - } - case "PAGE": - case "PAGES": { - const { html, pageData, status, headers } = data; - const isAppPath = typeof pageData === "string"; - if (isAppPath) { - await globalThis.incrementalCache.set(key, { - type: "app", - html, - rsc: pageData, - meta: { - status, - headers - }, - revalidate - }, "cache"); - } else { - await globalThis.incrementalCache.set(key, { - type: "page", - html, - json: pageData, - revalidate - }, "cache"); - } - break; - } - case "APP_PAGE": { - const { html, rscData, headers, status } = data; - await globalThis.incrementalCache.set(key, { - type: "app", - html, - rsc: rscData.toString("utf8"), - meta: { - status, - headers - }, - revalidate - }, "cache"); - break; - } - case "FETCH": - await globalThis.incrementalCache.set(key, data, "fetch"); - break; - case "REDIRECT": - await globalThis.incrementalCache.set(key, { - type: "redirect", - props: data.props, - revalidate - }, "cache"); - break; - case "IMAGE": - break; - } - } - await this.updateTagsOnSet(key, data, ctx); - debug("Finished setting cache"); - } catch (e) { - error("Failed to set cache", e); - } finally { - detachedPromise?.resolve(); - } - } - async revalidateTag(tags) { - const config = globalThis.openNextConfig.dangerous; - if (config?.disableTagCache || config?.disableIncrementalCache) { - return; - } - const _tags = Array.isArray(tags) ? tags : [tags]; - if (_tags.length === 0) { - return; - } - try { - if (globalThis.tagCache.mode === "nextMode") { - const paths = await globalThis.tagCache.getPathsByTags?.(_tags) ?? []; - await writeTags(_tags); - if (paths.length > 0) { - await globalThis.cdnInvalidationHandler.invalidatePaths(paths.map((path) => ({ - initialPath: path, - rawPath: path, - resolvedRoutes: [ - { - route: path, - // TODO: ideally here we should check if it's an app router page or route - type: "app" - } - ] - }))); - } - return; - } - for (const tag of _tags) { - debug("revalidateTag", tag); - const paths = await globalThis.tagCache.getByTag(tag); - debug("Items", paths); - const toInsert = paths.map((path) => ({ - path, - tag - })); - if (tag.startsWith(SOFT_TAG_PREFIX)) { - for (const path of paths) { - const _tags2 = await globalThis.tagCache.getByPath(path); - const hardTags = _tags2.filter((t) => !t.startsWith(SOFT_TAG_PREFIX)); - for (const hardTag of hardTags) { - const _paths = await globalThis.tagCache.getByTag(hardTag); - debug({ hardTag, _paths }); - toInsert.push(..._paths.map((path2) => ({ - path: path2, - tag: hardTag - }))); - } - } - } - await writeTags(toInsert); - const uniquePaths = Array.from(new Set(toInsert.filter((t) => t.tag.startsWith(SOFT_TAG_PREFIX)).map((t) => `/${t.path}`))); - if (uniquePaths.length > 0) { - await globalThis.cdnInvalidationHandler.invalidatePaths(uniquePaths.map((path) => ({ - initialPath: path, - rawPath: path, - resolvedRoutes: [ - { - route: path, - // TODO: ideally here we should check if it's an app router page or route - type: "app" - } - ] - }))); - } - } - } catch (e) { - error("Failed to revalidate tag", e); - } - } - // TODO: We should delete/update tags in this method - // This will require an update to the tag cache interface - async updateTagsOnSet(key, data, ctx) { - if (globalThis.openNextConfig.dangerous?.disableTagCache || globalThis.tagCache.mode === "nextMode" || // Here it means it's a delete - !data) { - return; - } - const derivedTags = data?.kind === "FETCH" ? ( - //@ts-expect-error - On older versions of next, ctx was a number, but for these cases we use data?.data?.tags - ctx?.tags ?? data?.data?.tags ?? [] - ) : data?.kind === "PAGE" ? data.headers?.["x-next-cache-tags"]?.split(",") ?? [] : []; - debug("derivedTags", derivedTags); - const storedTags = await globalThis.tagCache.getByPath(key); - const tagsToWrite = derivedTags.filter((tag) => !storedTags.includes(tag)); - if (tagsToWrite.length > 0) { - await writeTags(tagsToWrite.map((tag) => ({ - path: key, - tag, - // In case the tags are not there we just need to create them - // but we don't want them to return from `getLastModified` as they are not stale - revalidatedAt: 1 - }))); - } - } - extractRevalidateForSet(ctx) { - if (ctx === void 0) { - return void 0; - } - if (typeof ctx === "number" || ctx === false) { - return ctx; - } - if ("revalidate" in ctx) { - return ctx.revalidate; - } - if ("cacheControl" in ctx) { - return ctx.cacheControl?.revalidate; - } - return void 0; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - SOFT_TAG_PREFIX -}); diff --git a/.open-next 2/.build/composable-cache.cjs b/.open-next 2/.build/composable-cache.cjs deleted file mode 100644 index e8a4eec..0000000 --- a/.open-next 2/.build/composable-cache.cjs +++ /dev/null @@ -1,195 +0,0 @@ -globalThis.disableIncrementalCache = false;globalThis.disableDynamoDBCache = false;globalThis.isNextAfter15 = true;globalThis.openNextDebug = false;globalThis.openNextVersion = "3.9.12"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/@opennextjs/aws/dist/adapters/composable-cache.js -var composable_cache_exports = {}; -__export(composable_cache_exports, { - default: () => composable_cache_default -}); -module.exports = __toCommonJS(composable_cache_exports); - -// node_modules/@opennextjs/aws/dist/adapters/logger.js -function debug(...args) { - if (globalThis.openNextDebug) { - console.log(...args); - } -} - -// node_modules/@opennextjs/aws/dist/utils/cache.js -function getTagKey(tag) { - if (typeof tag === "string") { - return tag; - } - return JSON.stringify({ - tag: tag.tag, - path: tag.path - }); -} -async function writeTags(tags) { - const store = globalThis.__openNextAls.getStore(); - debug("Writing tags", tags, store); - if (!store || globalThis.openNextConfig.dangerous?.disableTagCache) { - return; - } - const tagsToWrite = tags.filter((t) => { - const tagKey = getTagKey(t); - const shouldWrite = !store.writtenTags.has(tagKey); - if (shouldWrite) { - store.writtenTags.add(tagKey); - } - return shouldWrite; - }); - if (tagsToWrite.length === 0) { - return; - } - await globalThis.tagCache.writeTags(tagsToWrite); -} - -// node_modules/@opennextjs/aws/dist/utils/stream.js -var import_web = require("node:stream/web"); -async function fromReadableStream(stream, base64) { - const chunks = []; - let totalLength = 0; - for await (const chunk of stream) { - chunks.push(chunk); - totalLength += chunk.length; - } - if (chunks.length === 0) { - return ""; - } - if (chunks.length === 1) { - return Buffer.from(chunks[0]).toString(base64 ? "base64" : "utf8"); - } - const buffer = Buffer.alloc(totalLength); - let offset = 0; - for (const chunk of chunks) { - buffer.set(chunk, offset); - offset += chunk.length; - } - return buffer.toString(base64 ? "base64" : "utf8"); -} -function toReadableStream(value, isBase64) { - return new import_web.ReadableStream({ - pull(controller) { - controller.enqueue(Buffer.from(value, isBase64 ? "base64" : "utf8")); - controller.close(); - } - }, { highWaterMark: 0 }); -} - -// node_modules/@opennextjs/aws/dist/adapters/composable-cache.js -var pendingWritePromiseMap = /* @__PURE__ */ new Map(); -var composable_cache_default = { - async get(cacheKey) { - try { - if (pendingWritePromiseMap.has(cacheKey)) { - const stored = pendingWritePromiseMap.get(cacheKey); - if (stored) { - return stored.then((entry) => ({ - ...entry, - value: toReadableStream(entry.value) - })); - } - } - const result = await globalThis.incrementalCache.get(cacheKey, "composable"); - if (!result?.value?.value) { - return void 0; - } - debug("composable cache result", result); - if (globalThis.tagCache.mode === "nextMode" && result.value.tags.length > 0) { - const hasBeenRevalidated = result.shouldBypassTagCache ? false : await globalThis.tagCache.hasBeenRevalidated(result.value.tags, result.lastModified); - if (hasBeenRevalidated) - return void 0; - } else if (globalThis.tagCache.mode === "original" || globalThis.tagCache.mode === void 0) { - const hasBeenRevalidated = result.shouldBypassTagCache ? false : await globalThis.tagCache.getLastModified(cacheKey, result.lastModified) === -1; - if (hasBeenRevalidated) - return void 0; - } - return { - ...result.value, - value: toReadableStream(result.value.value) - }; - } catch (e) { - debug("Cannot read composable cache entry"); - return void 0; - } - }, - async set(cacheKey, pendingEntry) { - const promiseEntry = pendingEntry.then(async (entry2) => ({ - ...entry2, - value: await fromReadableStream(entry2.value) - })); - pendingWritePromiseMap.set(cacheKey, promiseEntry); - const entry = await promiseEntry.finally(() => { - pendingWritePromiseMap.delete(cacheKey); - }); - await globalThis.incrementalCache.set(cacheKey, { - ...entry, - value: entry.value - }, "composable"); - if (globalThis.tagCache.mode === "original") { - const storedTags = await globalThis.tagCache.getByPath(cacheKey); - const tagsToWrite = entry.tags.filter((tag) => !storedTags.includes(tag)); - if (tagsToWrite.length > 0) { - await writeTags(tagsToWrite.map((tag) => ({ tag, path: cacheKey }))); - } - } - }, - async refreshTags() { - return; - }, - /** - * The signature has changed in Next.js 16 - * - Before Next.js 16, the method takes `...tags: string[]` - * - From Next.js 16, the method takes `tags: string[]` - */ - async getExpiration(...tags) { - if (globalThis.tagCache.mode === "nextMode") { - return globalThis.tagCache.getLastRevalidated(tags.flat()); - } - return 0; - }, - /** - * This method is only used before Next.js 16 - */ - async expireTags(...tags) { - if (globalThis.tagCache.mode === "nextMode") { - return writeTags(tags); - } - const tagCache = globalThis.tagCache; - const revalidatedAt = Date.now(); - const pathsToUpdate = await Promise.all(tags.map(async (tag) => { - const paths = await tagCache.getByTag(tag); - return paths.map((path) => ({ - path, - tag, - revalidatedAt - })); - })); - const setToWrite = /* @__PURE__ */ new Set(); - for (const entry of pathsToUpdate.flat()) { - setToWrite.add(entry); - } - await writeTags(Array.from(setToWrite)); - }, - // This one is necessary for older versions of next - async receiveExpiredTags(...tags) { - return; - } -}; diff --git a/.open-next 2/.build/durable-objects/bucket-cache-purge.js b/.open-next 2/.build/durable-objects/bucket-cache-purge.js deleted file mode 100644 index efce710..0000000 --- a/.open-next 2/.build/durable-objects/bucket-cache-purge.js +++ /dev/null @@ -1,169 +0,0 @@ -globalThis.openNextDebug = false;globalThis.openNextVersion = "3.9.12"; - -// node_modules/@opennextjs/cloudflare/dist/api/durable-objects/bucket-cache-purge.js -import { DurableObject } from "cloudflare:workers"; - -// node_modules/@opennextjs/aws/dist/utils/error.js -function isOpenNextError(e) { - try { - return "__openNextInternal" in e; - } catch { - return false; - } -} - -// node_modules/@opennextjs/aws/dist/adapters/logger.js -function debug(...args) { - if (globalThis.openNextDebug) { - console.log(...args); - } -} -function warn(...args) { - console.warn(...args); -} -var DOWNPLAYED_ERROR_LOGS = [ - { - clientName: "S3Client", - commandName: "GetObjectCommand", - errorName: "NoSuchKey" - } -]; -var isDownplayedErrorLog = (errorLog) => DOWNPLAYED_ERROR_LOGS.some((downplayedInput) => downplayedInput.clientName === errorLog?.clientName && downplayedInput.commandName === errorLog?.commandName && (downplayedInput.errorName === errorLog?.error?.name || downplayedInput.errorName === errorLog?.error?.Code)); -function error(...args) { - if (args.some((arg) => isDownplayedErrorLog(arg))) { - return debug(...args); - } - if (args.some((arg) => isOpenNextError(arg))) { - const error2 = args.find((arg) => isOpenNextError(arg)); - if (error2.logLevel < getOpenNextErrorLogLevel()) { - return; - } - if (error2.logLevel === 0) { - return console.log(...args.map((arg) => isOpenNextError(arg) ? `${arg.name}: ${arg.message}` : arg)); - } - if (error2.logLevel === 1) { - return warn(...args.map((arg) => isOpenNextError(arg) ? `${arg.name}: ${arg.message}` : arg)); - } - return console.error(...args); - } - console.error(...args); -} -function getOpenNextErrorLogLevel() { - const strLevel = process.env.OPEN_NEXT_ERROR_LOG_LEVEL ?? "1"; - switch (strLevel.toLowerCase()) { - case "debug": - case "0": - return 0; - case "error": - case "2": - return 2; - default: - return 1; - } -} - -// node_modules/@opennextjs/cloudflare/dist/api/cloudflare-context.js -var cloudflareContextSymbol = Symbol.for("__cloudflare-context__"); - -// node_modules/@opennextjs/cloudflare/dist/api/overrides/internal.js -var debugCache = (name, ...args) => { - if (process.env.NEXT_PRIVATE_DEBUG_CACHE) { - console.log(`[${name}] `, ...args); - } -}; -async function internalPurgeCacheByTags(env, tags) { - if (!env.CACHE_PURGE_ZONE_ID || !env.CACHE_PURGE_API_TOKEN) { - error("No cache zone ID or API token provided. Skipping cache purge."); - return "missing-credentials"; - } - let response; - try { - response = await fetch(`https://api.cloudflare.com/client/v4/zones/${env.CACHE_PURGE_ZONE_ID}/purge_cache`, { - headers: { - Authorization: `Bearer ${env.CACHE_PURGE_API_TOKEN}`, - "Content-Type": "application/json" - }, - method: "POST", - body: JSON.stringify({ - tags - }) - }); - if (response.status === 429) { - error("purgeCacheByTags: Rate limit exceeded. Skipping cache purge."); - return "rate-limit-exceeded"; - } - const bodyResponse = await response.json(); - if (!bodyResponse.success) { - error("purgeCacheByTags: Cache purge failed. Errors:", bodyResponse.errors.map((error2) => `${error2.code}: ${error2.message}`)); - return "purge-failed"; - } - debugCache("purgeCacheByTags", "Cache purged successfully for tags:", tags); - return "purge-success"; - } catch (error2) { - console.error("Error purging cache by tags:", error2); - return "purge-failed"; - } finally { - try { - await response?.body?.cancel(); - } catch { - } - } -} - -// node_modules/@opennextjs/cloudflare/dist/api/durable-objects/bucket-cache-purge.js -var DEFAULT_BUFFER_TIME_IN_SECONDS = 5; -var MAX_NUMBER_OF_TAGS_PER_PURGE = 100; -var BucketCachePurge = class extends DurableObject { - bufferTimeInSeconds; - constructor(state, env) { - super(state, env); - this.bufferTimeInSeconds = env.NEXT_CACHE_DO_PURGE_BUFFER_TIME_IN_SECONDS ? parseInt(env.NEXT_CACHE_DO_PURGE_BUFFER_TIME_IN_SECONDS) : DEFAULT_BUFFER_TIME_IN_SECONDS; - state.blockConcurrencyWhile(async () => { - state.storage.sql.exec(` - CREATE TABLE IF NOT EXISTS cache_purge ( - tag TEXT NOT NULL - ); - CREATE UNIQUE INDEX IF NOT EXISTS tag_index ON cache_purge (tag); - `); - }); - } - async purgeCacheByTags(tags) { - for (const tag of tags) { - this.ctx.storage.sql.exec(` - INSERT OR REPLACE INTO cache_purge (tag) - VALUES (?)`, [tag]); - } - const nextAlarm = await this.ctx.storage.getAlarm(); - if (!nextAlarm) { - this.ctx.storage.setAlarm(Date.now() + this.bufferTimeInSeconds * 1e3); - } - } - async alarm() { - let tags = this.ctx.storage.sql.exec(` - SELECT * FROM cache_purge LIMIT ${MAX_NUMBER_OF_TAGS_PER_PURGE} - `).toArray(); - do { - if (tags.length === 0) { - return; - } - const result = await internalPurgeCacheByTags(this.env, tags.map((row) => row.tag)); - if (result === "rate-limit-exceeded") { - throw new Error("Rate limit exceeded"); - } - this.ctx.storage.sql.exec(` - DELETE FROM cache_purge - WHERE tag IN (${tags.map(() => "?").join(",")}) - `, tags.map((row) => row.tag)); - if (tags.length < MAX_NUMBER_OF_TAGS_PER_PURGE) { - tags = []; - } else { - tags = this.ctx.storage.sql.exec(` - SELECT * FROM cache_purge LIMIT ${MAX_NUMBER_OF_TAGS_PER_PURGE} - `).toArray(); - } - } while (tags.length >= 0); - } -}; -export { - BucketCachePurge -}; diff --git a/.open-next 2/.build/durable-objects/queue.js b/.open-next 2/.build/durable-objects/queue.js deleted file mode 100644 index 065083c..0000000 --- a/.open-next 2/.build/durable-objects/queue.js +++ /dev/null @@ -1,283 +0,0 @@ -globalThis.openNextDebug = false;globalThis.openNextVersion = "3.9.12"; - -// node_modules/@opennextjs/aws/dist/utils/error.js -var IgnorableError = class extends Error { - __openNextInternal = true; - canIgnore = true; - logLevel = 0; - constructor(message) { - super(message); - this.name = "IgnorableError"; - } -}; -var RecoverableError = class extends Error { - __openNextInternal = true; - canIgnore = true; - logLevel = 1; - constructor(message) { - super(message); - this.name = "RecoverableError"; - } -}; -var FatalError = class extends Error { - __openNextInternal = true; - canIgnore = false; - logLevel = 2; - constructor(message) { - super(message); - this.name = "FatalError"; - } -}; -function isOpenNextError(e) { - try { - return "__openNextInternal" in e; - } catch { - return false; - } -} - -// node_modules/@opennextjs/aws/dist/adapters/logger.js -function debug(...args) { - if (globalThis.openNextDebug) { - console.log(...args); - } -} -function warn(...args) { - console.warn(...args); -} -var DOWNPLAYED_ERROR_LOGS = [ - { - clientName: "S3Client", - commandName: "GetObjectCommand", - errorName: "NoSuchKey" - } -]; -var isDownplayedErrorLog = (errorLog) => DOWNPLAYED_ERROR_LOGS.some((downplayedInput) => downplayedInput.clientName === errorLog?.clientName && downplayedInput.commandName === errorLog?.commandName && (downplayedInput.errorName === errorLog?.error?.name || downplayedInput.errorName === errorLog?.error?.Code)); -function error(...args) { - if (args.some((arg) => isDownplayedErrorLog(arg))) { - return debug(...args); - } - if (args.some((arg) => isOpenNextError(arg))) { - const error2 = args.find((arg) => isOpenNextError(arg)); - if (error2.logLevel < getOpenNextErrorLogLevel()) { - return; - } - if (error2.logLevel === 0) { - return console.log(...args.map((arg) => isOpenNextError(arg) ? `${arg.name}: ${arg.message}` : arg)); - } - if (error2.logLevel === 1) { - return warn(...args.map((arg) => isOpenNextError(arg) ? `${arg.name}: ${arg.message}` : arg)); - } - return console.error(...args); - } - console.error(...args); -} -function getOpenNextErrorLogLevel() { - const strLevel = process.env.OPEN_NEXT_ERROR_LOG_LEVEL ?? "1"; - switch (strLevel.toLowerCase()) { - case "debug": - case "0": - return 0; - case "error": - case "2": - return 2; - default: - return 1; - } -} - -// node_modules/@opennextjs/cloudflare/dist/api/durable-objects/queue.js -import { DurableObject } from "cloudflare:workers"; -var DEFAULT_MAX_REVALIDATION = 5; -var DEFAULT_REVALIDATION_TIMEOUT_MS = 1e4; -var DEFAULT_RETRY_INTERVAL_MS = 2e3; -var DEFAULT_MAX_RETRIES = 6; -var DOQueueHandler = class extends DurableObject { - // Ongoing revalidations are deduped by the deduplication id - // Since this is running in waitUntil, we expect the durable object state to persist this during the duration of the revalidation - // TODO: handle incremental cache with only eventual consistency (i.e. KV or R2/D1 with the optional cache layer on top) - ongoingRevalidations = /* @__PURE__ */ new Map(); - sql; - routeInFailedState = /* @__PURE__ */ new Map(); - service; - // Configurable params - maxRevalidations; - revalidationTimeout; - revalidationRetryInterval; - maxRetries; - disableSQLite; - constructor(ctx, env) { - super(ctx, env); - this.service = env.WORKER_SELF_REFERENCE; - if (!this.service) - throw new IgnorableError("No service binding for cache revalidation worker"); - this.sql = ctx.storage.sql; - this.maxRevalidations = env.NEXT_CACHE_DO_QUEUE_MAX_REVALIDATION ? parseInt(env.NEXT_CACHE_DO_QUEUE_MAX_REVALIDATION) : DEFAULT_MAX_REVALIDATION; - this.revalidationTimeout = env.NEXT_CACHE_DO_QUEUE_REVALIDATION_TIMEOUT_MS ? parseInt(env.NEXT_CACHE_DO_QUEUE_REVALIDATION_TIMEOUT_MS) : DEFAULT_REVALIDATION_TIMEOUT_MS; - this.revalidationRetryInterval = env.NEXT_CACHE_DO_QUEUE_RETRY_INTERVAL_MS ? parseInt(env.NEXT_CACHE_DO_QUEUE_RETRY_INTERVAL_MS) : DEFAULT_RETRY_INTERVAL_MS; - this.maxRetries = env.NEXT_CACHE_DO_QUEUE_MAX_RETRIES ? parseInt(env.NEXT_CACHE_DO_QUEUE_MAX_RETRIES) : DEFAULT_MAX_RETRIES; - this.disableSQLite = env.NEXT_CACHE_DO_QUEUE_DISABLE_SQLITE === "true"; - ctx.blockConcurrencyWhile(async () => { - debug(`Restoring the state of the durable object`); - await this.initState(); - }); - debug(`Durable object initialized`); - } - async revalidate(msg) { - if (this.ongoingRevalidations.size > 2 * this.maxRevalidations) { - warn(`Your durable object has 2 times the maximum number of revalidations (${this.maxRevalidations}) in progress. If this happens often, you should consider increasing the NEXT_CACHE_DO_QUEUE_MAX_REVALIDATION or the number of durable objects with the MAX_REVALIDATE_CONCURRENCY env var.`); - } - if (this.ongoingRevalidations.has(msg.MessageDeduplicationId)) - return; - if (this.routeInFailedState.has(msg.MessageDeduplicationId)) - return; - if (this.checkSyncTable(msg)) - return; - if (this.ongoingRevalidations.size >= this.maxRevalidations) { - debug(`The maximum number of revalidations (${this.maxRevalidations}) is reached. Blocking until one of the revalidations finishes.`); - while (this.ongoingRevalidations.size >= this.maxRevalidations) { - const ongoingRevalidations = this.ongoingRevalidations.values(); - debug(`Waiting for one of the revalidations to finish`); - await Promise.race(ongoingRevalidations); - } - } - const revalidationPromise = this.executeRevalidation(msg); - this.ongoingRevalidations.set(msg.MessageDeduplicationId, revalidationPromise); - this.ctx.waitUntil(revalidationPromise); - } - async executeRevalidation(msg) { - let response; - try { - debug(`Revalidating ${msg.MessageBody.host}${msg.MessageBody.url}`); - const { MessageBody: { host, url } } = msg; - const protocol = host.includes("localhost") ? "http" : "https"; - response = await this.service.fetch(`${protocol}://${host}${url}`, { - method: "HEAD", - headers: { - // This is defined during build - "x-prerender-revalidate": "9212b8c54d8f2aaa5cb15dca46a16684", - "x-isr": "1" - }, - // This one is kind of problematic, it will always show the wall time of the revalidation to `this.revalidationTimeout` - signal: AbortSignal.timeout(this.revalidationTimeout) - }); - if (response.status === 200 && response.headers.get("x-nextjs-cache") !== "REVALIDATED") { - this.routeInFailedState.delete(msg.MessageDeduplicationId); - throw new FatalError(`The revalidation for ${host}${url} cannot be done. This error should never happen.`); - } else if (response.status === 404) { - this.routeInFailedState.delete(msg.MessageDeduplicationId); - throw new IgnorableError(`The revalidation for ${host}${url} cannot be done because the page is not found. It's either expected or an error in user code itself`); - } else if (response.status === 500) { - await this.addToFailedState(msg); - throw new IgnorableError(`Something went wrong while revalidating ${host}${url}`); - } else if (response.status !== 200) { - await this.addToFailedState(msg); - throw new RecoverableError(`An unknown error occurred while revalidating ${host}${url}`); - } - if (!this.disableSQLite) { - this.sql.exec( - "INSERT OR REPLACE INTO sync (id, lastSuccess, buildId) VALUES (?, unixepoch(), ?)", - // We cannot use the deduplication id because it's not unique per route - every time a route is revalidated, the deduplication id is different. - `${host}${url}`, - "Bi3XXPy0fxaJxYXDBsshm" - ); - } - this.routeInFailedState.delete(msg.MessageDeduplicationId); - } catch (e) { - if (!isOpenNextError(e)) { - await this.addToFailedState(msg); - } - error(e); - } finally { - this.ongoingRevalidations.delete(msg.MessageDeduplicationId); - try { - await response?.body?.cancel(); - } catch { - } - } - } - async alarm() { - const currentDateTime = Date.now(); - const nextEventToRetry = Array.from(this.routeInFailedState.values()).filter(({ nextAlarmMs }) => nextAlarmMs > currentDateTime).sort(({ nextAlarmMs: a }, { nextAlarmMs: b }) => a - b)[0]; - const expiredEvents = Array.from(this.routeInFailedState.values()).filter(({ nextAlarmMs }) => nextAlarmMs <= currentDateTime); - const allEventsToRetry = nextEventToRetry ? [nextEventToRetry, ...expiredEvents] : expiredEvents; - for (const event of allEventsToRetry) { - debug(`Retrying revalidation for ${event.msg.MessageBody.host}${event.msg.MessageBody.url}`); - await this.executeRevalidation(event.msg); - } - } - async addToFailedState(msg) { - debug(`Adding ${msg.MessageBody.host}${msg.MessageBody.url} to the failed state`); - const existingFailedState = this.routeInFailedState.get(msg.MessageDeduplicationId); - let updatedFailedState; - if (existingFailedState) { - if (existingFailedState.retryCount >= this.maxRetries) { - error(`The revalidation for ${msg.MessageBody.host}${msg.MessageBody.url} has failed after ${this.maxRetries} retries. It will not be tried again, but subsequent ISR requests will retry.`); - this.routeInFailedState.delete(msg.MessageDeduplicationId); - return; - } - const nextAlarmMs = Date.now() + Math.pow(2, existingFailedState.retryCount + 1) * this.revalidationRetryInterval; - updatedFailedState = { - ...existingFailedState, - retryCount: existingFailedState.retryCount + 1, - nextAlarmMs - }; - } else { - updatedFailedState = { - msg, - retryCount: 1, - nextAlarmMs: Date.now() + 2e3 - }; - } - this.routeInFailedState.set(msg.MessageDeduplicationId, updatedFailedState); - if (!this.disableSQLite) { - this.sql.exec("INSERT OR REPLACE INTO failed_state (id, data, buildId) VALUES (?, ?, ?)", msg.MessageDeduplicationId, JSON.stringify(updatedFailedState), "Bi3XXPy0fxaJxYXDBsshm"); - } - await this.addAlarm(); - } - async addAlarm() { - const existingAlarm = await this.ctx.storage.getAlarm({ allowConcurrency: false }); - if (existingAlarm) - return; - if (this.routeInFailedState.size === 0) - return; - let nextAlarmToSetup = Math.min(...Array.from(this.routeInFailedState.values()).map(({ nextAlarmMs }) => nextAlarmMs)); - if (nextAlarmToSetup < Date.now()) { - nextAlarmToSetup = Date.now() + this.revalidationRetryInterval; - } - await this.ctx.storage.setAlarm(nextAlarmToSetup); - } - // This function is used to restore the state of the durable object - // We don't restore the ongoing revalidations because we cannot know in which state they are - // We only restore the failed state and the alarm - async initState() { - if (this.disableSQLite) - return; - this.sql.exec("CREATE TABLE IF NOT EXISTS failed_state (id TEXT PRIMARY KEY, data TEXT, buildId TEXT)"); - this.sql.exec("CREATE TABLE IF NOT EXISTS sync (id TEXT PRIMARY KEY, lastSuccess INTEGER, buildId TEXT)"); - this.sql.exec("DELETE FROM failed_state WHERE buildId != ?", "Bi3XXPy0fxaJxYXDBsshm"); - this.sql.exec("DELETE FROM sync WHERE buildId != ?", "Bi3XXPy0fxaJxYXDBsshm"); - const failedStateCursor = this.sql.exec("SELECT * FROM failed_state"); - for (const row of failedStateCursor) { - this.routeInFailedState.set(row.id, JSON.parse(row.data)); - } - await this.addAlarm(); - } - /** - * - * @param msg - * @returns `true` if the route has been revalidated since the lastModified from the message, `false` otherwise - */ - checkSyncTable(msg) { - try { - if (this.disableSQLite) - return false; - return this.sql.exec("SELECT 1 FROM sync WHERE id = ? AND lastSuccess > ? LIMIT 1", `${msg.MessageBody.host}${msg.MessageBody.url}`, Math.round(msg.MessageBody.lastModified / 1e3)).toArray().length > 0; - } catch { - return false; - } - } -}; -export { - DOQueueHandler -}; diff --git a/.open-next 2/.build/durable-objects/sharded-tag-cache.js b/.open-next 2/.build/durable-objects/sharded-tag-cache.js deleted file mode 100644 index c429ac5..0000000 --- a/.open-next 2/.build/durable-objects/sharded-tag-cache.js +++ /dev/null @@ -1,55 +0,0 @@ -globalThis.openNextDebug = false;globalThis.openNextVersion = "3.9.12"; - -// node_modules/@opennextjs/cloudflare/dist/api/durable-objects/sharded-tag-cache.js -import { DurableObject } from "cloudflare:workers"; - -// node_modules/@opennextjs/cloudflare/dist/api/cloudflare-context.js -var cloudflareContextSymbol = Symbol.for("__cloudflare-context__"); - -// node_modules/@opennextjs/cloudflare/dist/api/overrides/internal.js -var debugCache = (name, ...args) => { - if (process.env.NEXT_PRIVATE_DEBUG_CACHE) { - console.log(`[${name}] `, ...args); - } -}; - -// node_modules/@opennextjs/cloudflare/dist/api/durable-objects/sharded-tag-cache.js -var DOShardedTagCache = class extends DurableObject { - sql; - constructor(state, env) { - super(state, env); - this.sql = state.storage.sql; - state.blockConcurrencyWhile(async () => { - this.sql.exec(`CREATE TABLE IF NOT EXISTS revalidations (tag TEXT PRIMARY KEY, revalidatedAt INTEGER)`); - }); - } - async getLastRevalidated(tags) { - try { - const result = this.sql.exec(`SELECT MAX(revalidatedAt) AS time FROM revalidations WHERE tag IN (${tags.map(() => "?").join(", ")})`, ...tags).toArray(); - const timeMs = result[0]?.time ?? 0; - debugCache("DOShardedTagCache", `getLastRevalidated tags=${tags} -> time=${timeMs}`); - return timeMs; - } catch (e) { - console.error(e); - return 0; - } - } - async hasBeenRevalidated(tags, lastModified) { - const revalidated = this.sql.exec(`SELECT 1 FROM revalidations WHERE tag IN (${tags.map(() => "?").join(", ")}) AND revalidatedAt > ? LIMIT 1`, ...tags, lastModified ?? Date.now()).toArray().length > 0; - debugCache("DOShardedTagCache", `hasBeenRevalidated tags=${tags} -> revalidated=${revalidated}`); - return revalidated; - } - async writeTags(tags, lastModified) { - debugCache("DOShardedTagCache", `writeTags tags=${tags} time=${lastModified}`); - tags.forEach((tag) => { - this.sql.exec(`INSERT OR REPLACE INTO revalidations (tag, revalidatedAt) VALUES (?, ?)`, tag, lastModified); - }); - } - async getRevalidationTimes(tags) { - const result = this.sql.exec(`SELECT tag, revalidatedAt FROM revalidations WHERE tag IN (${tags.map(() => "?").join(", ")})`, ...tags).toArray(); - return Object.fromEntries(result.map((row) => [row.tag, row.revalidatedAt])); - } -}; -export { - DOShardedTagCache -}; diff --git a/.open-next 2/.build/open-next.config.edge.mjs b/.open-next 2/.build/open-next.config.edge.mjs deleted file mode 100644 index 4638007..0000000 --- a/.open-next 2/.build/open-next.config.edge.mjs +++ /dev/null @@ -1,29 +0,0 @@ -// open-next.config.ts -var config = { - default: { - override: { - wrapper: "cloudflare-node", - converter: "edge", - proxyExternalRequest: "fetch", - incrementalCache: "dummy", - tagCache: "dummy", - queue: "dummy" - } - }, - edgeExternals: ["node:crypto"], - middleware: { - external: true, - override: { - wrapper: "cloudflare-edge", - converter: "edge", - proxyExternalRequest: "fetch", - incrementalCache: "dummy", - tagCache: "dummy", - queue: "dummy" - } - } -}; -var open_next_config_default = config; -export { - open_next_config_default as default -}; diff --git a/.open-next 2/.build/open-next.config.mjs b/.open-next 2/.build/open-next.config.mjs deleted file mode 100644 index 287d45c..0000000 --- a/.open-next 2/.build/open-next.config.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import { createRequire as topLevelCreateRequire } from 'module';const require = topLevelCreateRequire(import.meta.url);import bannerUrl from 'url';const __dirname = bannerUrl.fileURLToPath(new URL('.', import.meta.url)); - -// open-next.config.ts -var config = { - default: { - override: { - wrapper: "cloudflare-node", - converter: "edge", - proxyExternalRequest: "fetch", - incrementalCache: "dummy", - tagCache: "dummy", - queue: "dummy" - } - }, - edgeExternals: ["node:crypto"], - middleware: { - external: true, - override: { - wrapper: "cloudflare-edge", - converter: "edge", - proxyExternalRequest: "fetch", - incrementalCache: "dummy", - tagCache: "dummy", - queue: "dummy" - } - } -}; -var open_next_config_default = config; -export { - open_next_config_default as default -}; diff --git a/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/_global-error.cache b/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/_global-error.cache deleted file mode 100644 index 9aede10..0000000 --- a/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/_global-error.cache +++ /dev/null @@ -1 +0,0 @@ -{"type":"app","meta":{"status":500,"headers":{"x-nextjs-stale-time":"300","x-nextjs-prerender":"1","x-next-cache-tags":"_N_T_/layout,_N_T_/_global-error/layout,_N_T_/_global-error/page,_N_T_/_global-error"},"segmentPaths":["/_tree","/_full","/__PAGE__","/_index","/_head"]},"html":"500: Internal Server Error.

500

Internal Server Error.

","rsc":"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n0:{\"P\":null,\"b\":\"Bi3XXPy0fxaJxYXDBsshm\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/ff1a16fafef87110.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/8fce7824b757d4d7.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\na:[]\n","segmentData":{"/_tree":"0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"tree\":{\"name\":\"\",\"paramType\":null,\"paramKey\":\"\",\"hasRuntimePrefetch\":false,\"slots\":{\"children\":{\"name\":\"__PAGE__\",\"paramType\":null,\"paramKey\":\"__PAGE__\",\"hasRuntimePrefetch\":false,\"slots\":null,\"isRootLayout\":false}},\"isRootLayout\":false},\"staleTime\":300}\n","/_full":"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n0:{\"P\":null,\"b\":\"Bi3XXPy0fxaJxYXDBsshm\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/ff1a16fafef87110.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/8fce7824b757d4d7.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\na:[]\n","/__PAGE__":"1:\"$Sreact.fragment\"\n2:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\n3:\"$Sreact.suspense\"\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/ff1a16fafef87110.js\",\"async\":true}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/8fce7824b757d4d7.js\",\"async\":true}]],[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$3\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@4\"}]}]]}],\"loading\":null,\"isPartial\":false}\n4:null\n","/_index":"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"template\":[\"$\",\"$L3\",null,{}]}]]}],\"loading\":null,\"isPartial\":false}\n","/_head":"1:\"$Sreact.fragment\"\n2:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\n3:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\n4:\"$Sreact.suspense\"\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$4\",null,{\"name\":\"Next.Metadata\",\"children\":[]}]}]}],null]}],\"loading\":null,\"isPartial\":false}\n"}} \ No newline at end of file diff --git a/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/_not-found.cache b/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/_not-found.cache deleted file mode 100644 index 136dac1..0000000 --- a/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/_not-found.cache +++ /dev/null @@ -1 +0,0 @@ -{"type":"app","meta":{"status":404,"headers":{"x-nextjs-stale-time":"300","x-nextjs-prerender":"1","x-next-cache-tags":"_N_T_/layout,_N_T_/_not-found/layout,_N_T_/_not-found/page,_N_T_/_not-found"},"segmentPaths":["/_tree","/_full","/_not-found/__PAGE__","/_not-found","/_index","/_head"]},"html":"404: This page could not be found.QuitTraq - Track Your Journey to Quit Smoking

404

This page could not be found.

","rsc":"1:\"$Sreact.fragment\"\n2:I[30824,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"Providers\"]\n3:I[39756,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n5:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n:HL[\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"style\"]\n0:{\"P\":null,\"b\":\"Bi3XXPy0fxaJxYXDBsshm\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/8fce7824b757d4d7.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"link\",null,{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"meta\",null,{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",null,{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}]]}],[\"$\",\"body\",null,{\"className\":\"antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",\"$undefined\"],\"S\":true}\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#8b5cf6\"}]]\nd:I[27201,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"QuitTraq - Track Your Journey to Quit Smoking\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Track and manage your smoking habits, set goals, and quit safely with personalized plans.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"QuitTraq\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"$Ld\",\"7\",{}]]\n","segmentData":{"/_tree":":HL[\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"style\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"tree\":{\"name\":\"\",\"paramType\":null,\"paramKey\":\"\",\"hasRuntimePrefetch\":false,\"slots\":{\"children\":{\"name\":\"/_not-found\",\"paramType\":null,\"paramKey\":\"/_not-found\",\"hasRuntimePrefetch\":false,\"slots\":{\"children\":{\"name\":\"__PAGE__\",\"paramType\":null,\"paramKey\":\"__PAGE__\",\"hasRuntimePrefetch\":false,\"slots\":null,\"isRootLayout\":false}},\"isRootLayout\":false}},\"isRootLayout\":true},\"staleTime\":300}\n","/_full":"1:\"$Sreact.fragment\"\n2:I[30824,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"Providers\"]\n3:I[39756,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n5:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n:HL[\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"style\"]\n0:{\"P\":null,\"b\":\"Bi3XXPy0fxaJxYXDBsshm\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/8fce7824b757d4d7.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"link\",null,{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"meta\",null,{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",null,{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}]]}],[\"$\",\"body\",null,{\"className\":\"antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",\"$undefined\"],\"S\":true}\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#8b5cf6\"}]]\nd:I[27201,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"QuitTraq - Track Your Journey to Quit Smoking\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Track and manage your smoking habits, set goals, and quit safely with personalized plans.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"QuitTraq\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"$Ld\",\"7\",{}]]\n","/_not-found/__PAGE__":"1:\"$Sreact.fragment\"\n2:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\n3:\"$Sreact.suspense\"\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$3\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@4\"}]}]]}],\"loading\":null,\"isPartial\":false}\n4:null\n","/_not-found":"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"template\":[\"$\",\"$L3\",null,{}]}]]}],\"loading\":null,\"isPartial\":false}\n","/_index":"1:\"$Sreact.fragment\"\n2:I[30824,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"Providers\"]\n3:I[39756,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n:HL[\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"style\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"precedence\":\"next\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"async\":true}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/8fce7824b757d4d7.js\",\"async\":true}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"link\",null,{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"meta\",null,{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",null,{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}]]}],[\"$\",\"body\",null,{\"className\":\"antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"template\":[\"$\",\"$L4\",null,{}],\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]]}]}]}]]}]]}],\"loading\":null,\"isPartial\":false}\n","/_head":"1:\"$Sreact.fragment\"\n2:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\n3:I[97367,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\n4:\"$Sreact.suspense\"\n5:I[27201,[\"/_next/static/chunks/41d73173ebc6cdbb.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"IconMark\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#8b5cf6\"}]]}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$4\",null,{\"name\":\"Next.Metadata\",\"children\":[[\"$\",\"title\",\"0\",{\"children\":\"QuitTraq - Track Your Journey to Quit Smoking\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Track and manage your smoking habits, set goals, and quit safely with personalized plans.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"QuitTraq\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"$L5\",\"7\",{}]]}]}]}],null]}],\"loading\":null,\"isPartial\":false}\n"}} \ No newline at end of file diff --git a/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/login.cache b/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/login.cache deleted file mode 100644 index a04bc80..0000000 --- a/.open-next 2/cache/Bi3XXPy0fxaJxYXDBsshm/login.cache +++ /dev/null @@ -1 +0,0 @@ -{"type":"app","meta":{"headers":{"x-nextjs-stale-time":"300","x-nextjs-prerender":"1","x-next-cache-tags":"_N_T_/layout,_N_T_/login/layout,_N_T_/login/page,_N_T_/login"},"segmentPaths":["/_tree","/_full","/login/__PAGE__","/login","/_index","/_head"]},"html":"QuitTraq - Track Your Journey to Quit Smoking
QuitTraq
Track your journey to a smoke-free life

By continuing, you agree to our Terms of Service and Privacy Policy

","rsc":"1:\"$Sreact.fragment\"\n2:I[30824,[\"/_next/static/chunks/a0ff6dd38141152b.js\"],\"Providers\"]\n3:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n5:I[47257,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ClientPageRoot\"]\n6:I[94542,[\"/_next/static/chunks/a0ff6dd38141152b.js\",\"/_next/static/chunks/463bea44120aa692.js\",\"/_next/static/chunks/e9f3a725bb07b154.js\"],\"default\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\na:\"$Sreact.suspense\"\nc:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\ne:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\n10:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n:HL[\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"style\"]\n0:{\"P\":null,\"b\":\"Bi3XXPy0fxaJxYXDBsshm\",\"c\":[\"\",\"login\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"login\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/a0ff6dd38141152b.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"link\",null,{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"meta\",null,{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",null,{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}]]}],[\"$\",\"body\",null,{\"className\":\"antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L5\",null,{\"Component\":\"$6\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@7\",\"$@8\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/463bea44120aa692.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/e9f3a725bb07b154.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@b\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Le\",null,{\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true}\n7:{}\n8:\"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params\"\nd:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#8b5cf6\"}]]\n11:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"IconMark\"]\nb:null\nf:[[\"$\",\"title\",\"0\",{\"children\":\"QuitTraq - Track Your Journey to Quit Smoking\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Track and manage your smoking habits, set goals, and quit safely with personalized plans.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"QuitTraq\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"$L11\",\"7\",{}]]\n","segmentData":{"/_tree":":HL[\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"style\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"tree\":{\"name\":\"\",\"paramType\":null,\"paramKey\":\"\",\"hasRuntimePrefetch\":false,\"slots\":{\"children\":{\"name\":\"login\",\"paramType\":null,\"paramKey\":\"login\",\"hasRuntimePrefetch\":false,\"slots\":{\"children\":{\"name\":\"__PAGE__\",\"paramType\":null,\"paramKey\":\"__PAGE__\",\"hasRuntimePrefetch\":false,\"slots\":null,\"isRootLayout\":false}},\"isRootLayout\":false}},\"isRootLayout\":true},\"staleTime\":300}\n","/_full":"1:\"$Sreact.fragment\"\n2:I[30824,[\"/_next/static/chunks/a0ff6dd38141152b.js\"],\"Providers\"]\n3:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n5:I[47257,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ClientPageRoot\"]\n6:I[94542,[\"/_next/static/chunks/a0ff6dd38141152b.js\",\"/_next/static/chunks/463bea44120aa692.js\",\"/_next/static/chunks/e9f3a725bb07b154.js\"],\"default\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\na:\"$Sreact.suspense\"\nc:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\ne:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\n10:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n:HL[\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"style\"]\n0:{\"P\":null,\"b\":\"Bi3XXPy0fxaJxYXDBsshm\",\"c\":[\"\",\"login\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"login\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/a0ff6dd38141152b.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"link\",null,{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"meta\",null,{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",null,{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}]]}],[\"$\",\"body\",null,{\"className\":\"antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L5\",null,{\"Component\":\"$6\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@7\",\"$@8\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/463bea44120aa692.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/e9f3a725bb07b154.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@b\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Le\",null,{\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true}\n7:{}\n8:\"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params\"\nd:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#8b5cf6\"}]]\n11:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"IconMark\"]\nb:null\nf:[[\"$\",\"title\",\"0\",{\"children\":\"QuitTraq - Track Your Journey to Quit Smoking\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Track and manage your smoking habits, set goals, and quit safely with personalized plans.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"QuitTraq\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"$L11\",\"7\",{}]]\n","/login/__PAGE__":"1:\"$Sreact.fragment\"\n2:I[47257,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ClientPageRoot\"]\n3:I[94542,[\"/_next/static/chunks/a0ff6dd38141152b.js\",\"/_next/static/chunks/463bea44120aa692.js\",\"/_next/static/chunks/e9f3a725bb07b154.js\"],\"default\"]\n6:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L2\",null,{\"Component\":\"$3\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@4\",\"$@5\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/463bea44120aa692.js\",\"async\":true}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/e9f3a725bb07b154.js\",\"async\":true}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],\"loading\":null,\"isPartial\":false}\n4:{}\n5:\"$0:rsc:props:children:0:props:serverProvidedParams:params\"\n8:null\n","/login":"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"template\":[\"$\",\"$L3\",null,{}]}]]}],\"loading\":null,\"isPartial\":false}\n","/_index":"1:\"$Sreact.fragment\"\n2:I[30824,[\"/_next/static/chunks/a0ff6dd38141152b.js\"],\"Providers\"]\n3:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"default\"]\n:HL[\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"style\"]\n:HL[\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"style\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/3ec6b440530ac1e8.css\",\"precedence\":\"next\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/a0ff6dd38141152b.js\",\"async\":true}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap\",\"rel\":\"stylesheet\"}],[\"$\",\"link\",null,{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"meta\",null,{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",null,{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}]]}],[\"$\",\"body\",null,{\"className\":\"antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"template\":[\"$\",\"$L4\",null,{}],\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]]}]}]}]]}]]}],\"loading\":null,\"isPartial\":false}\n","/_head":"1:\"$Sreact.fragment\"\n2:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"ViewportBoundary\"]\n3:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"MetadataBoundary\"]\n4:\"$Sreact.suspense\"\n5:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/8fce7824b757d4d7.js\"],\"IconMark\"]\n0:{\"buildId\":\"Bi3XXPy0fxaJxYXDBsshm\",\"rsc\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#8b5cf6\"}]]}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$4\",null,{\"name\":\"Next.Metadata\",\"children\":[[\"$\",\"title\",\"0\",{\"children\":\"QuitTraq - Track Your Journey to Quit Smoking\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Track and manage your smoking habits, set goals, and quit safely with personalized plans.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"QuitTraq\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png\"}],[\"$\",\"$L5\",\"7\",{}]]}]}]}],null]}],\"loading\":null,\"isPartial\":false}\n"}} \ No newline at end of file diff --git a/.open-next 2/cloudflare-templates/images.d.ts b/.open-next 2/cloudflare-templates/images.d.ts deleted file mode 100644 index ce09593..0000000 --- a/.open-next 2/cloudflare-templates/images.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -export type RemotePattern = { - protocol?: "http" | "https"; - hostname: string; - port?: string; - pathname: string; - search?: string; -}; -export type LocalPattern = { - pathname: string; - search?: string; -}; -/** - * Handles requests to /_next/image(/), including image optimizations. - * - * Image optimization is disabled and the original image is returned if `env.IMAGES` is undefined. - * - * Throws an exception on unexpected errors. - * - * @param requestURL - * @param requestHeaders - * @param env - * @returns A promise that resolves to the resolved request. - */ -export declare function handleImageRequest(requestURL: URL, requestHeaders: Headers, env: CloudflareEnv): Promise; -export type OptimizedImageFormat = "image/avif" | "image/webp"; -export declare function matchLocalPattern(pattern: LocalPattern, url: { - pathname: string; - search: string; -}): boolean; -export declare function matchRemotePattern(pattern: RemotePattern, url: URL): boolean; -type ImageContentType = "image/avif" | "image/webp" | "image/png" | "image/jpeg" | "image/jxl" | "image/jp2" | "image/heic" | "image/gif" | "image/svg+xml" | "image/x-icon" | "image/x-icns" | "image/tiff" | "image/bmp"; -/** - * Detects the content type by looking at the first few bytes of a file - * - * Based on https://github.com/vercel/next.js/blob/72c9635/packages/next/src/server/image-optimizer.ts#L155 - * - * @param buffer The image bytes - * @returns a content type of undefined for unsupported content - */ -export declare function detectImageContentType(buffer: Uint8Array): ImageContentType | null; -declare global { - var __IMAGES_REMOTE_PATTERNS__: RemotePattern[]; - var __IMAGES_LOCAL_PATTERNS__: LocalPattern[]; - var __IMAGES_DEVICE_SIZES__: number[]; - var __IMAGES_IMAGE_SIZES__: number[]; - var __IMAGES_QUALITIES__: number[]; - var __IMAGES_FORMATS__: NextConfigImageFormat[]; - var __IMAGES_MINIMUM_CACHE_TTL_SEC__: number; - var __IMAGES_ALLOW_SVG__: boolean; - var __IMAGES_CONTENT_SECURITY_POLICY__: string; - var __IMAGES_CONTENT_DISPOSITION__: string; - var __IMAGES_MAX_REDIRECTS__: number; - type NextConfigImageFormat = "image/avif" | "image/webp"; -} -export {}; diff --git a/.open-next 2/cloudflare-templates/images.js b/.open-next 2/cloudflare-templates/images.js deleted file mode 100644 index e9b59bf..0000000 --- a/.open-next 2/cloudflare-templates/images.js +++ /dev/null @@ -1,573 +0,0 @@ -import { error, warn } from "@opennextjs/aws/adapters/logger.js"; -/** - * Handles requests to /_next/image(/), including image optimizations. - * - * Image optimization is disabled and the original image is returned if `env.IMAGES` is undefined. - * - * Throws an exception on unexpected errors. - * - * @param requestURL - * @param requestHeaders - * @param env - * @returns A promise that resolves to the resolved request. - */ -export async function handleImageRequest(requestURL, requestHeaders, env) { - const parseResult = parseImageRequest(requestURL, requestHeaders); - if (!parseResult.ok) { - return new Response(parseResult.message, { - status: 400, - }); - } - let imageResponse; - if (parseResult.url.startsWith("/")) { - if (env.ASSETS === undefined) { - error("env.ASSETS binding is not defined"); - return new Response('"url" parameter is valid but upstream response is invalid', { - status: 404, - }); - } - const absoluteURL = new URL(parseResult.url, requestURL); - imageResponse = await env.ASSETS.fetch(absoluteURL); - } - else { - let fetchImageResult; - try { - fetchImageResult = await fetchWithRedirects(parseResult.url, 7_000, __IMAGES_MAX_REDIRECTS__); - } - catch (e) { - throw new Error("Failed to fetch image", { cause: e }); - } - if (!fetchImageResult.ok) { - if (fetchImageResult.error === "timed_out") { - return new Response('"url" parameter is valid but upstream response timed out', { - status: 504, - }); - } - if (fetchImageResult.error === "too_many_redirects") { - return new Response('"url" parameter is valid but upstream response is invalid', { - status: 508, - }); - } - throw new Error("Failed to fetch image"); - } - imageResponse = fetchImageResult.response; - } - if (!imageResponse.ok || imageResponse.body === null) { - return new Response('"url" parameter is valid but upstream response is invalid', { - status: imageResponse.status, - }); - } - let immutable = false; - if (parseResult.static) { - immutable = true; - } - else { - const cacheControlHeader = imageResponse.headers.get("Cache-Control"); - if (cacheControlHeader !== null) { - // TODO: Properly parse header - immutable = cacheControlHeader.includes("immutable"); - } - } - const [contentTypeImageStream, imageStream] = imageResponse.body.tee(); - const imageHeaderBytes = new Uint8Array(32); - const contentTypeImageReader = contentTypeImageStream.getReader({ - mode: "byob", - }); - const readImageHeaderBytesResult = await contentTypeImageReader.readAtLeast(32, imageHeaderBytes); - if (readImageHeaderBytesResult.value === undefined) { - await imageResponse.body.cancel(); - return new Response('"url" parameter is valid but upstream response is invalid', { - status: 400, - }); - } - const contentType = detectImageContentType(readImageHeaderBytesResult.value); - if (contentType === null) { - warn(`Failed to detect content type of "${parseResult.url}"`); - return new Response('"url" parameter is valid but image type is not allowed', { - status: 400, - }); - } - if (contentType === SVG) { - if (!__IMAGES_ALLOW_SVG__) { - return new Response('"url" parameter is valid but image type is not allowed', { - status: 400, - }); - } - const response = createImageResponse(imageStream, contentType, { - immutable, - }); - return response; - } - if (contentType === GIF) { - if (env.IMAGES === undefined) { - warn("env.IMAGES binding is not defined"); - const response = createImageResponse(imageStream, contentType, { - immutable, - }); - return response; - } - const imageSource = env.IMAGES.input(imageStream); - const imageTransformationResult = await imageSource - .transform({ - width: parseResult.width, - fit: "scale-down", - }) - .output({ - quality: parseResult.quality, - format: GIF, - }); - const outputImageStream = imageTransformationResult.image(); - const response = createImageResponse(outputImageStream, GIF, { - immutable, - }); - return response; - } - if (contentType === AVIF || contentType === WEBP || contentType === JPEG || contentType === PNG) { - if (env.IMAGES === undefined) { - warn("env.IMAGES binding is not defined"); - const response = createImageResponse(imageStream, contentType, { - immutable, - }); - return response; - } - const outputFormat = parseResult.format ?? contentType; - const imageSource = env.IMAGES.input(imageStream); - const imageTransformationResult = await imageSource - .transform({ - width: parseResult.width, - fit: "scale-down", - }) - .output({ - quality: parseResult.quality, - format: outputFormat, - }); - const outputImageStream = imageTransformationResult.image(); - const response = createImageResponse(outputImageStream, outputFormat, { - immutable, - }); - return response; - } - warn(`Image content type ${contentType} not supported`); - const response = createImageResponse(imageStream, contentType, { - immutable, - }); - return response; -} -/** - * Fetch call with max redirects and timeouts. - * - * Re-throws the exception thrown by a fetch call. - * @param url - * @param timeoutMS Timeout for a single fetch call. - * @param maxRedirectCount - * @returns - */ -async function fetchWithRedirects(url, timeoutMS, maxRedirectCount) { - // TODO: Add dangerouslyAllowLocalIP support - let response; - try { - response = await fetch(url, { - signal: AbortSignal.timeout(timeoutMS), - redirect: "manual", - }); - } - catch (e) { - if (e instanceof Error && e.name === "TimeoutError") { - const result = { - ok: false, - error: "timed_out", - }; - return result; - } - throw e; - } - if (redirectResponseStatuses.includes(response.status)) { - const locationHeader = response.headers.get("Location"); - if (locationHeader !== null) { - if (maxRedirectCount < 1) { - const result = { - ok: false, - error: "too_many_redirects", - }; - return result; - } - let redirectTarget; - if (locationHeader.startsWith("/")) { - redirectTarget = new URL(locationHeader, url).href; - } - else { - redirectTarget = locationHeader; - } - const result = await fetchWithRedirects(redirectTarget, timeoutMS, maxRedirectCount - 1); - return result; - } - } - const result = { - ok: true, - response: response, - }; - return result; -} -const redirectResponseStatuses = [301, 302, 303, 307, 308]; -function createImageResponse(image, contentType, imageResponseFlags) { - const response = new Response(image, { - headers: { - Vary: "Accept", - "Content-Type": contentType, - "Content-Disposition": __IMAGES_CONTENT_DISPOSITION__, - "Content-Security-Policy": __IMAGES_CONTENT_SECURITY_POLICY__, - }, - }); - if (imageResponseFlags.immutable) { - response.headers.set("Cache-Control", "public, max-age=315360000, immutable"); - } - return response; -} -/** - * Parses the image request URL and headers. - * - * This function validates the parameters and returns either the parsed result or an error message. - * - * @param requestURL request URL - * @param requestHeaders request headers - * @returns an instance of `ParseImageRequestURLSuccessResult` when successful, or an instance of `ErrorResult` when failed. - */ -function parseImageRequest(requestURL, requestHeaders) { - const formats = __IMAGES_FORMATS__; - const parsedUrlOrError = validateUrlQueryParameter(requestURL); - if (!("url" in parsedUrlOrError)) { - return parsedUrlOrError; - } - const widthOrError = validateWidthQueryParameter(requestURL); - if (typeof widthOrError !== "number") { - return widthOrError; - } - const qualityOrError = validateQualityQueryParameter(requestURL); - if (typeof qualityOrError !== "number") { - return qualityOrError; - } - const acceptHeader = requestHeaders.get("Accept") ?? ""; - let format = null; - // Find a more specific format that the client accepts. - for (const allowedFormat of formats) { - if (acceptHeader.includes(allowedFormat)) { - format = allowedFormat; - break; - } - } - const result = { - ok: true, - url: parsedUrlOrError.url, - width: widthOrError, - quality: qualityOrError, - format, - static: parsedUrlOrError.static, - }; - return result; -} -/** - * Validates that there is exactly one "url" query parameter. - * - * @returns the validated URL or an error result. - */ -function validateUrlQueryParameter(requestURL) { - // There should be a single "url" parameter. - const urls = requestURL.searchParams.getAll("url"); - if (urls.length < 1) { - const result = { - ok: false, - message: '"url" parameter is required', - }; - return result; - } - if (urls.length > 1) { - const result = { - ok: false, - message: '"url" parameter cannot be an array', - }; - return result; - } - // The url parameter value should be a valid URL or a valid relative URL. - const url = urls[0]; - if (url.length > 3072) { - const result = { - ok: false, - message: '"url" parameter is too long', - }; - return result; - } - if (url.startsWith("//")) { - const result = { - ok: false, - message: '"url" parameter cannot be a protocol-relative URL (//)', - }; - return result; - } - if (url.startsWith("/")) { - const staticAsset = url.startsWith(`${__NEXT_BASE_PATH__ || ""}/_next/static/media`); - const pathname = getPathnameFromRelativeURL(url); - if (/\/_next\/image($|\/)/.test(decodeURIComponent(pathname))) { - const result = { - ok: false, - message: '"url" parameter cannot be recursive', - }; - return result; - } - if (!staticAsset) { - if (!hasLocalMatch(__IMAGES_LOCAL_PATTERNS__, url)) { - const result = { ok: false, message: '"url" parameter is not allowed' }; - return result; - } - } - return { url, static: staticAsset }; - } - let parsedURL; - try { - parsedURL = new URL(url); - } - catch { - const result = { ok: false, message: '"url" parameter is invalid' }; - return result; - } - const validProtocols = ["http:", "https:"]; - if (!validProtocols.includes(parsedURL.protocol)) { - const result = { - ok: false, - message: '"url" parameter is invalid', - }; - return result; - } - if (!hasRemoteMatch(__IMAGES_REMOTE_PATTERNS__, parsedURL)) { - const result = { - ok: false, - message: '"url" parameter is not allowed', - }; - return result; - } - return { url: parsedURL.href, static: false }; -} -/** - * Validates the "w" (width) query parameter. - * - * @returns the validated width number or an error result. - */ -function validateWidthQueryParameter(requestURL) { - const widthQueryValues = requestURL.searchParams.getAll("w"); - if (widthQueryValues.length < 1) { - const result = { - ok: false, - message: '"w" parameter (width) is required', - }; - return result; - } - if (widthQueryValues.length > 1) { - const result = { - ok: false, - message: '"w" parameter (width) cannot be an array', - }; - return result; - } - const widthQueryValue = widthQueryValues[0]; - if (!/^[0-9]+$/.test(widthQueryValue)) { - const result = { - ok: false, - message: '"w" parameter (width) must be an integer greater than 0', - }; - return result; - } - const width = parseInt(widthQueryValue, 10); - if (width <= 0 || isNaN(width)) { - const result = { - ok: false, - message: '"w" parameter (width) must be an integer greater than 0', - }; - return result; - } - const sizeValid = __IMAGES_DEVICE_SIZES__.includes(width) || __IMAGES_IMAGE_SIZES__.includes(width); - if (!sizeValid) { - const result = { - ok: false, - message: `"w" parameter (width) of ${width} is not allowed`, - }; - return result; - } - return width; -} -/** - * Validates the "q" (quality) query parameter. - * - * @returns the validated quality number or an error result. - */ -function validateQualityQueryParameter(requestURL) { - const qualityQueryValues = requestURL.searchParams.getAll("q"); - if (qualityQueryValues.length < 1) { - const result = { - ok: false, - message: '"q" parameter (quality) is required', - }; - return result; - } - if (qualityQueryValues.length > 1) { - const result = { - ok: false, - message: '"q" parameter (quality) cannot be an array', - }; - return result; - } - const qualityQueryValue = qualityQueryValues[0]; - if (!/^[0-9]+$/.test(qualityQueryValue)) { - const result = { - ok: false, - message: '"q" parameter (quality) must be an integer between 1 and 100', - }; - return result; - } - const quality = parseInt(qualityQueryValue, 10); - if (isNaN(quality) || quality < 1 || quality > 100) { - const result = { - ok: false, - message: '"q" parameter (quality) must be an integer between 1 and 100', - }; - return result; - } - if (!__IMAGES_QUALITIES__.includes(quality)) { - const result = { - ok: false, - message: `"q" parameter (quality) of ${quality} is not allowed`, - }; - return result; - } - return quality; -} -function getPathnameFromRelativeURL(relativeURL) { - return relativeURL.split("?")[0]; -} -function hasLocalMatch(localPatterns, relativeURL) { - const parseRelativeURLResult = parseRelativeURL(relativeURL); - for (const localPattern of localPatterns) { - const matched = matchLocalPattern(localPattern, parseRelativeURLResult); - if (matched) { - return true; - } - } - return false; -} -function parseRelativeURL(relativeURL) { - if (!relativeURL.includes("?")) { - const result = { - pathname: relativeURL, - search: "", - }; - return result; - } - const parts = relativeURL.split("?"); - const pathname = parts[0]; - const search = "?" + parts.slice(1).join("?"); - const result = { - pathname, - search, - }; - return result; -} -export function matchLocalPattern(pattern, url) { - if (pattern.search !== undefined && pattern.search !== url.search) { - return false; - } - return new RegExp(pattern.pathname).test(url.pathname); -} -function hasRemoteMatch(remotePatterns, url) { - for (const remotePattern of remotePatterns) { - const matched = matchRemotePattern(remotePattern, url); - if (matched) { - return true; - } - } - return false; -} -export function matchRemotePattern(pattern, url) { - // https://github.com/vercel/next.js/blob/d76f0b1/packages/next/src/shared/lib/match-remote-pattern.ts - if (pattern.protocol !== undefined && - pattern.protocol.replace(/:$/, "") !== url.protocol.replace(/:$/, "")) { - return false; - } - if (pattern.port !== undefined && pattern.port !== url.port) { - return false; - } - if (pattern.hostname === undefined || !new RegExp(pattern.hostname).test(url.hostname)) { - return false; - } - if (pattern.search !== undefined && pattern.search !== url.search) { - return false; - } - // Should be the same as writeImagesManifest() - return new RegExp(pattern.pathname).test(url.pathname); -} -const AVIF = "image/avif"; -const WEBP = "image/webp"; -const PNG = "image/png"; -const JPEG = "image/jpeg"; -const JXL = "image/jxl"; -const JP2 = "image/jp2"; -const HEIC = "image/heic"; -const GIF = "image/gif"; -const SVG = "image/svg+xml"; -const ICO = "image/x-icon"; -const ICNS = "image/x-icns"; -const TIFF = "image/tiff"; -const BMP = "image/bmp"; -/** - * Detects the content type by looking at the first few bytes of a file - * - * Based on https://github.com/vercel/next.js/blob/72c9635/packages/next/src/server/image-optimizer.ts#L155 - * - * @param buffer The image bytes - * @returns a content type of undefined for unsupported content - */ -export function detectImageContentType(buffer) { - if ([0xff, 0xd8, 0xff].every((b, i) => buffer[i] === b)) { - return JPEG; - } - if ([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a].every((b, i) => buffer[i] === b)) { - return PNG; - } - if ([0x47, 0x49, 0x46, 0x38].every((b, i) => buffer[i] === b)) { - return GIF; - } - if ([0x52, 0x49, 0x46, 0x46, 0, 0, 0, 0, 0x57, 0x45, 0x42, 0x50].every((b, i) => !b || buffer[i] === b)) { - return WEBP; - } - if ([0x3c, 0x3f, 0x78, 0x6d, 0x6c].every((b, i) => buffer[i] === b)) { - return SVG; - } - if ([0x3c, 0x73, 0x76, 0x67].every((b, i) => buffer[i] === b)) { - return SVG; - } - if ([0, 0, 0, 0, 0x66, 0x74, 0x79, 0x70, 0x61, 0x76, 0x69, 0x66].every((b, i) => !b || buffer[i] === b)) { - return AVIF; - } - if ([0x00, 0x00, 0x01, 0x00].every((b, i) => buffer[i] === b)) { - return ICO; - } - if ([0x69, 0x63, 0x6e, 0x73].every((b, i) => buffer[i] === b)) { - return ICNS; - } - if ([0x49, 0x49, 0x2a, 0x00].every((b, i) => buffer[i] === b)) { - return TIFF; - } - if ([0x42, 0x4d].every((b, i) => buffer[i] === b)) { - return BMP; - } - if ([0xff, 0x0a].every((b, i) => buffer[i] === b)) { - return JXL; - } - if ([0x00, 0x00, 0x00, 0x0c, 0x4a, 0x58, 0x4c, 0x20, 0x0d, 0x0a, 0x87, 0x0a].every((b, i) => buffer[i] === b)) { - return JXL; - } - if ([0, 0, 0, 0, 0x66, 0x74, 0x79, 0x70, 0x68, 0x65, 0x69, 0x63].every((b, i) => !b || buffer[i] === b)) { - return HEIC; - } - if ([0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a].every((b, i) => buffer[i] === b)) { - return JP2; - } - return null; -} diff --git a/.open-next 2/cloudflare-templates/init.d.ts b/.open-next 2/cloudflare-templates/init.d.ts deleted file mode 100644 index 3869aee..0000000 --- a/.open-next 2/cloudflare-templates/init.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Initialization for the workerd runtime. - * - * The file must be imported at the top level the worker. - */ -/** - * Executes the handler with the Cloudflare context. - */ -export declare function runWithCloudflareRequestContext(request: Request, env: CloudflareEnv, ctx: ExecutionContext, handler: () => Promise): Promise; -declare global { - var __BUILD_TIMESTAMP_MS__: number; - var __NEXT_BASE_PATH__: string; - var __ASSETS_RUN_WORKER_FIRST__: boolean | string[] | undefined; - var __DEPLOYMENT_ID__: string; - var __TRAILING_SLASH__: boolean; -} diff --git a/.open-next 2/cloudflare-templates/init.js b/.open-next 2/cloudflare-templates/init.js deleted file mode 100644 index 3fc82cd..0000000 --- a/.open-next 2/cloudflare-templates/init.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Initialization for the workerd runtime. - * - * The file must be imported at the top level the worker. - */ -import { AsyncLocalStorage } from "node:async_hooks"; -import process from "node:process"; -import stream from "node:stream"; -// @ts-expect-error: resolved by wrangler build -import * as nextEnvVars from "./next-env.mjs"; -const cloudflareContextALS = new AsyncLocalStorage(); -// Note: this symbol needs to be kept in sync with `src/api/get-cloudflare-context.ts` -Object.defineProperty(globalThis, Symbol.for("__cloudflare-context__"), { - get() { - return cloudflareContextALS.getStore(); - }, -}); -/** - * Executes the handler with the Cloudflare context. - */ -export async function runWithCloudflareRequestContext(request, env, ctx, handler) { - init(request, env); - return cloudflareContextALS.run({ env, ctx, cf: request.cf }, handler); -} -let initialized = false; -/** - * Initializes the runtime on the first call, - * no-op on subsequent invocations. - */ -function init(request, env) { - if (initialized) { - return; - } - initialized = true; - const url = new URL(request.url); - initRuntime(); - populateProcessEnv(url, env); -} -function initRuntime() { - // Some packages rely on `process.version` and `process.versions.node` (i.e. Jose@4) - // TODO: Remove when https://github.com/unjs/unenv/pull/493 is merged - Object.assign(process, { version: process.version || "v22.14.0" }); - // @ts-expect-error Node type does not match workerd - Object.assign(process.versions, { node: "22.14.0", ...process.versions }); - globalThis.__dirname ??= ""; - globalThis.__filename ??= ""; - // Some packages rely on `import.meta.url` but it is undefined in workerd - // For example it causes a bunch of issues, and will make even import crash with payload - import.meta.url ??= "file:///worker.js"; - // Do not crash on cache not supported - // https://github.com/cloudflare/workerd/pull/2434 - // compatibility flag "cache_option_enabled" -> does not support "force-cache" - const __original_fetch = globalThis.fetch; - globalThis.fetch = (input, init) => { - if (init) { - delete init.cache; - } - return __original_fetch(input, init); - }; - const CustomRequest = class extends globalThis.Request { - constructor(input, init) { - if (init) { - delete init.cache; - // https://github.com/cloudflare/workerd/issues/2746 - // https://github.com/cloudflare/workerd/issues/3245 - Object.defineProperty(init, "body", { - // @ts-ignore - value: init.body instanceof stream.Readable ? ReadableStream.from(init.body) : init.body, - }); - } - super(input, init); - } - }; - Object.assign(globalThis, { - Request: CustomRequest, - __BUILD_TIMESTAMP_MS__, - __NEXT_BASE_PATH__, - __ASSETS_RUN_WORKER_FIRST__, - __TRAILING_SLASH__, - // The external middleware will use the convertTo function of the `edge` converter - // by default it will try to fetch the request, but since we are running everything in the same worker - // we need to use the request as is. - __dangerous_ON_edge_converter_returns_request: true, - }); -} -/** - * Populate process.env with: - * - the environment variables and secrets from the cloudflare platform - * - the variables from Next .env* files - * - the origin resolver information - */ -function populateProcessEnv(url, env) { - for (const [key, value] of Object.entries(env)) { - if (typeof value === "string") { - process.env[key] = value; - } - } - const mode = env.NEXTJS_ENV ?? "production"; - if (nextEnvVars[mode]) { - for (const key in nextEnvVars[mode]) { - process.env[key] ??= nextEnvVars[mode][key]; - } - } - // Set the default Origin for the origin resolver. - // This is only needed for an external middleware bundle - process.env.OPEN_NEXT_ORIGIN = JSON.stringify({ - default: { - host: url.hostname, - protocol: url.protocol.slice(0, -1), - port: url.port, - }, - }); - /* We need to set this environment variable to make redirects work properly in preview mode. - * Next sets this in standalone mode during `startServer`. Without this the protocol would always be `https` here: - * https://github.com/vercel/next.js/blob/6b1e48080e896e0d44a05fe009cb79d2d3f91774/packages/next/src/server/app-render/action-handler.ts#L307-L316 - */ - process.env.__NEXT_PRIVATE_ORIGIN = url.origin; - // `__DEPLOYMENT_ID__` is a string (passed via ESBuild). - if (__DEPLOYMENT_ID__) { - process.env.DEPLOYMENT_ID = __DEPLOYMENT_ID__; - } -} diff --git a/.open-next 2/cloudflare-templates/shims/empty.d.ts b/.open-next 2/cloudflare-templates/shims/empty.d.ts deleted file mode 100644 index d87c485..0000000 --- a/.open-next 2/cloudflare-templates/shims/empty.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: {}; -export default _default; diff --git a/.open-next 2/cloudflare-templates/shims/empty.js b/.open-next 2/cloudflare-templates/shims/empty.js deleted file mode 100644 index ff8b4c5..0000000 --- a/.open-next 2/cloudflare-templates/shims/empty.js +++ /dev/null @@ -1 +0,0 @@ -export default {}; diff --git a/.open-next 2/cloudflare-templates/shims/env.d.ts b/.open-next 2/cloudflare-templates/shims/env.d.ts deleted file mode 100644 index 34c3f1f..0000000 --- a/.open-next 2/cloudflare-templates/shims/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function loadEnvConfig(): void; diff --git a/.open-next 2/cloudflare-templates/shims/env.js b/.open-next 2/cloudflare-templates/shims/env.js deleted file mode 100644 index bb9094a..0000000 --- a/.open-next 2/cloudflare-templates/shims/env.js +++ /dev/null @@ -1 +0,0 @@ -export function loadEnvConfig() { } diff --git a/.open-next 2/cloudflare-templates/shims/fetch.d.ts b/.open-next 2/cloudflare-templates/shims/fetch.d.ts deleted file mode 100644 index 709bc44..0000000 --- a/.open-next 2/cloudflare-templates/shims/fetch.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default fetch; diff --git a/.open-next 2/cloudflare-templates/shims/fetch.js b/.open-next 2/cloudflare-templates/shims/fetch.js deleted file mode 100644 index 709bc44..0000000 --- a/.open-next 2/cloudflare-templates/shims/fetch.js +++ /dev/null @@ -1 +0,0 @@ -export default fetch; diff --git a/.open-next 2/cloudflare-templates/shims/throw.d.ts b/.open-next 2/cloudflare-templates/shims/throw.d.ts deleted file mode 100644 index d87c485..0000000 --- a/.open-next 2/cloudflare-templates/shims/throw.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: {}; -export default _default; diff --git a/.open-next 2/cloudflare-templates/shims/throw.js b/.open-next 2/cloudflare-templates/shims/throw.js deleted file mode 100644 index dcdf198..0000000 --- a/.open-next 2/cloudflare-templates/shims/throw.js +++ /dev/null @@ -1,2 +0,0 @@ -throw "OpenNext shim"; -export default {}; diff --git a/.open-next 2/cloudflare-templates/skew-protection.d.ts b/.open-next 2/cloudflare-templates/skew-protection.d.ts deleted file mode 100644 index 960258b..0000000 --- a/.open-next 2/cloudflare-templates/skew-protection.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** Name of the env var containing the mapping */ -export declare const DEPLOYMENT_MAPPING_ENV_NAME = "CF_DEPLOYMENT_MAPPING"; -/** Version used for the latest worker */ -export declare const CURRENT_VERSION_ID = "current"; -/** - * Routes the request to the requested deployment. - * - * A specific deployment can be requested via: - * - the `dpl` search parameter for assets - * - the `x-deployment-id` for other requests - * - * When a specific deployment is requested, we route to that deployment via the preview URLs. - * See https://developers.cloudflare.com/workers/configuration/previews/ - * - * When the requested deployment is not supported a 400 response is returned. - * - * Notes: - * - The re-routing is only active for the deployed version of the app (on a custom domain) - * - Assets are also handled when `run_worker_first` is enabled. - * See https://developers.cloudflare.com/workers/static-assets/binding/#run_worker_first - * - * @param request - * @returns - */ -export declare function maybeGetSkewProtectionResponse(request: Request): Promise | Response | undefined; -declare global { - var __SKEW_PROTECTION_ENABLED__: boolean; -} diff --git a/.open-next 2/cloudflare-templates/skew-protection.js b/.open-next 2/cloudflare-templates/skew-protection.js deleted file mode 100644 index e25549a..0000000 --- a/.open-next 2/cloudflare-templates/skew-protection.js +++ /dev/null @@ -1,60 +0,0 @@ -import process from "node:process"; -/** Name of the env var containing the mapping */ -export const DEPLOYMENT_MAPPING_ENV_NAME = "CF_DEPLOYMENT_MAPPING"; -/** Version used for the latest worker */ -export const CURRENT_VERSION_ID = "current"; -let deploymentMapping; -/** - * Routes the request to the requested deployment. - * - * A specific deployment can be requested via: - * - the `dpl` search parameter for assets - * - the `x-deployment-id` for other requests - * - * When a specific deployment is requested, we route to that deployment via the preview URLs. - * See https://developers.cloudflare.com/workers/configuration/previews/ - * - * When the requested deployment is not supported a 400 response is returned. - * - * Notes: - * - The re-routing is only active for the deployed version of the app (on a custom domain) - * - Assets are also handled when `run_worker_first` is enabled. - * See https://developers.cloudflare.com/workers/static-assets/binding/#run_worker_first - * - * @param request - * @returns - */ -export function maybeGetSkewProtectionResponse(request) { - // no early return as esbuild would not treeshake the code. - if (__SKEW_PROTECTION_ENABLED__) { - const url = new URL(request.url); - // Skew protection is only active for the latest version of the app served on a custom domain. - if (url.hostname === "localhost" || url.hostname.endsWith(".workers.dev")) { - return undefined; - } - const requestDeploymentId = request.headers.get("x-deployment-id") ?? url.searchParams.get("dpl"); - if (!requestDeploymentId || requestDeploymentId === process.env.DEPLOYMENT_ID) { - // The request does not specify a deployment id or it is the current deployment id - return undefined; - } - deploymentMapping ??= process.env[DEPLOYMENT_MAPPING_ENV_NAME] - ? JSON.parse(process.env[DEPLOYMENT_MAPPING_ENV_NAME]) - : {}; - if (!(requestDeploymentId in deploymentMapping)) { - // Unknown deployment id, serve the current version - return undefined; - } - const version = deploymentMapping[requestDeploymentId]; - if (!version || version === CURRENT_VERSION_ID) { - return undefined; - } - const versionDomain = version.split("-")[0]; - const hostname = `${versionDomain}-${process.env.CF_WORKER_NAME}.${process.env.CF_PREVIEW_DOMAIN}.workers.dev`; - url.hostname = hostname; - const requestToOlderDeployment = new Request(url, request); - // Remove the origin header to prevent an error with POST requests - const headers = new Headers(request.headers); - headers.delete("origin"); - return fetch(requestToOlderDeployment, { headers }); - } -} diff --git a/.open-next 2/cloudflare-templates/worker.d.ts b/.open-next 2/cloudflare-templates/worker.d.ts deleted file mode 100644 index 8a0cb84..0000000 --- a/.open-next 2/cloudflare-templates/worker.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -declare const _default: { - fetch(request: Request>, env: CloudflareEnv, ctx: ExecutionContext): Promise; -}; -export default _default; diff --git a/.open-next 2/cloudflare-templates/worker.js b/.open-next 2/cloudflare-templates/worker.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/cloudflare-templates/worker.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/cloudflare/cache-assets-manifest.sql b/.open-next 2/cloudflare/cache-assets-manifest.sql deleted file mode 100644 index 494a553..0000000 --- a/.open-next 2/cloudflare/cache-assets-manifest.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE TABLE IF NOT EXISTS tags (tag TEXT NOT NULL, path TEXT NOT NULL, UNIQUE(tag, path) ON CONFLICT REPLACE); - CREATE TABLE IF NOT EXISTS revalidations (tag TEXT NOT NULL, revalidatedAt INTEGER NOT NULL, UNIQUE(tag) ON CONFLICT REPLACE); -INSERT INTO tags (tag, path) VALUES ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/layout", "Bi3XXPy0fxaJxYXDBsshm/_global-error"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/_global-error/layout", "Bi3XXPy0fxaJxYXDBsshm/_global-error"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/_global-error/page", "Bi3XXPy0fxaJxYXDBsshm/_global-error"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/_global-error", "Bi3XXPy0fxaJxYXDBsshm/_global-error"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/layout", "Bi3XXPy0fxaJxYXDBsshm/_not-found"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/_not-found/layout", "Bi3XXPy0fxaJxYXDBsshm/_not-found"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/_not-found/page", "Bi3XXPy0fxaJxYXDBsshm/_not-found"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/_not-found", "Bi3XXPy0fxaJxYXDBsshm/_not-found"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/layout", "Bi3XXPy0fxaJxYXDBsshm/login"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/login/layout", "Bi3XXPy0fxaJxYXDBsshm/login"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/login/page", "Bi3XXPy0fxaJxYXDBsshm/login"), ("Bi3XXPy0fxaJxYXDBsshm/_N_T_/login", "Bi3XXPy0fxaJxYXDBsshm/login"); \ No newline at end of file diff --git a/.open-next 2/cloudflare/images.js b/.open-next 2/cloudflare/images.js deleted file mode 100644 index 374752b..0000000 --- a/.open-next 2/cloudflare/images.js +++ /dev/null @@ -1,585 +0,0 @@ -// -var define_IMAGES_DEVICE_SIZES_default = [640, 750, 828, 1080, 1200, 1920, 2048, 3840]; - -// -var define_IMAGES_FORMATS_default = ["image/webp"]; - -// -var define_IMAGES_IMAGE_SIZES_default = [32, 48, 64, 96, 128, 256, 384]; - -// -var define_IMAGES_LOCAL_PATTERNS_default = [{ pathname: "^(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$))(?:(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$)).)*?)\\/?)$", search: "" }]; - -// -var define_IMAGES_QUALITIES_default = [75]; - -// -var define_IMAGES_REMOTE_PATTERNS_default = [{ protocol: "https", hostname: "^(?:^(?:m\\.media\\-amazon\\.com)$)$", pathname: "^(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$))(?:(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$)).)*?)\\/?)$" }]; - -// node_modules/@opennextjs/aws/dist/utils/error.js -function isOpenNextError(e) { - try { - return "__openNextInternal" in e; - } catch { - return false; - } -} - -// node_modules/@opennextjs/aws/dist/adapters/logger.js -function debug(...args) { - if (globalThis.openNextDebug) { - console.log(...args); - } -} -function warn(...args) { - console.warn(...args); -} -var DOWNPLAYED_ERROR_LOGS = [ - { - clientName: "S3Client", - commandName: "GetObjectCommand", - errorName: "NoSuchKey" - } -]; -var isDownplayedErrorLog = (errorLog) => DOWNPLAYED_ERROR_LOGS.some((downplayedInput) => downplayedInput.clientName === errorLog?.clientName && downplayedInput.commandName === errorLog?.commandName && (downplayedInput.errorName === errorLog?.error?.name || downplayedInput.errorName === errorLog?.error?.Code)); -function error(...args) { - if (args.some((arg) => isDownplayedErrorLog(arg))) { - return debug(...args); - } - if (args.some((arg) => isOpenNextError(arg))) { - const error2 = args.find((arg) => isOpenNextError(arg)); - if (error2.logLevel < getOpenNextErrorLogLevel()) { - return; - } - if (error2.logLevel === 0) { - return console.log(...args.map((arg) => isOpenNextError(arg) ? `${arg.name}: ${arg.message}` : arg)); - } - if (error2.logLevel === 1) { - return warn(...args.map((arg) => isOpenNextError(arg) ? `${arg.name}: ${arg.message}` : arg)); - } - return console.error(...args); - } - console.error(...args); -} -function getOpenNextErrorLogLevel() { - const strLevel = process.env.OPEN_NEXT_ERROR_LOG_LEVEL ?? "1"; - switch (strLevel.toLowerCase()) { - case "debug": - case "0": - return 0; - case "error": - case "2": - return 2; - default: - return 1; - } -} - -// node_modules/@opennextjs/cloudflare/dist/cli/templates/images.js -async function handleImageRequest(requestURL, requestHeaders, env) { - const parseResult = parseImageRequest(requestURL, requestHeaders); - if (!parseResult.ok) { - return new Response(parseResult.message, { - status: 400 - }); - } - let imageResponse; - if (parseResult.url.startsWith("/")) { - if (env.ASSETS === void 0) { - error("env.ASSETS binding is not defined"); - return new Response('"url" parameter is valid but upstream response is invalid', { - status: 404 - }); - } - const absoluteURL = new URL(parseResult.url, requestURL); - imageResponse = await env.ASSETS.fetch(absoluteURL); - } else { - let fetchImageResult; - try { - fetchImageResult = await fetchWithRedirects(parseResult.url, 7e3, 3); - } catch (e) { - throw new Error("Failed to fetch image", { cause: e }); - } - if (!fetchImageResult.ok) { - if (fetchImageResult.error === "timed_out") { - return new Response('"url" parameter is valid but upstream response timed out', { - status: 504 - }); - } - if (fetchImageResult.error === "too_many_redirects") { - return new Response('"url" parameter is valid but upstream response is invalid', { - status: 508 - }); - } - throw new Error("Failed to fetch image"); - } - imageResponse = fetchImageResult.response; - } - if (!imageResponse.ok || imageResponse.body === null) { - return new Response('"url" parameter is valid but upstream response is invalid', { - status: imageResponse.status - }); - } - let immutable = false; - if (parseResult.static) { - immutable = true; - } else { - const cacheControlHeader = imageResponse.headers.get("Cache-Control"); - if (cacheControlHeader !== null) { - immutable = cacheControlHeader.includes("immutable"); - } - } - const [contentTypeImageStream, imageStream] = imageResponse.body.tee(); - const imageHeaderBytes = new Uint8Array(32); - const contentTypeImageReader = contentTypeImageStream.getReader({ - mode: "byob" - }); - const readImageHeaderBytesResult = await contentTypeImageReader.readAtLeast(32, imageHeaderBytes); - if (readImageHeaderBytesResult.value === void 0) { - await imageResponse.body.cancel(); - return new Response('"url" parameter is valid but upstream response is invalid', { - status: 400 - }); - } - const contentType = detectImageContentType(readImageHeaderBytesResult.value); - if (contentType === null) { - warn(`Failed to detect content type of "${parseResult.url}"`); - return new Response('"url" parameter is valid but image type is not allowed', { - status: 400 - }); - } - if (contentType === SVG) { - if (true) { - return new Response('"url" parameter is valid but image type is not allowed', { - status: 400 - }); - } - const response2 = createImageResponse(imageStream, contentType, { - immutable - }); - return response2; - } - if (contentType === GIF) { - if (env.IMAGES === void 0) { - warn("env.IMAGES binding is not defined"); - const response3 = createImageResponse(imageStream, contentType, { - immutable - }); - return response3; - } - const imageSource = env.IMAGES.input(imageStream); - const imageTransformationResult = await imageSource.transform({ - width: parseResult.width, - fit: "scale-down" - }).output({ - quality: parseResult.quality, - format: GIF - }); - const outputImageStream = imageTransformationResult.image(); - const response2 = createImageResponse(outputImageStream, GIF, { - immutable - }); - return response2; - } - if (contentType === AVIF || contentType === WEBP || contentType === JPEG || contentType === PNG) { - if (env.IMAGES === void 0) { - warn("env.IMAGES binding is not defined"); - const response3 = createImageResponse(imageStream, contentType, { - immutable - }); - return response3; - } - const outputFormat = parseResult.format ?? contentType; - const imageSource = env.IMAGES.input(imageStream); - const imageTransformationResult = await imageSource.transform({ - width: parseResult.width, - fit: "scale-down" - }).output({ - quality: parseResult.quality, - format: outputFormat - }); - const outputImageStream = imageTransformationResult.image(); - const response2 = createImageResponse(outputImageStream, outputFormat, { - immutable - }); - return response2; - } - warn(`Image content type ${contentType} not supported`); - const response = createImageResponse(imageStream, contentType, { - immutable - }); - return response; -} -async function fetchWithRedirects(url, timeoutMS, maxRedirectCount) { - let response; - try { - response = await fetch(url, { - signal: AbortSignal.timeout(timeoutMS), - redirect: "manual" - }); - } catch (e) { - if (e instanceof Error && e.name === "TimeoutError") { - const result2 = { - ok: false, - error: "timed_out" - }; - return result2; - } - throw e; - } - if (redirectResponseStatuses.includes(response.status)) { - const locationHeader = response.headers.get("Location"); - if (locationHeader !== null) { - if (maxRedirectCount < 1) { - const result3 = { - ok: false, - error: "too_many_redirects" - }; - return result3; - } - let redirectTarget; - if (locationHeader.startsWith("/")) { - redirectTarget = new URL(locationHeader, url).href; - } else { - redirectTarget = locationHeader; - } - const result2 = await fetchWithRedirects(redirectTarget, timeoutMS, maxRedirectCount - 1); - return result2; - } - } - const result = { - ok: true, - response - }; - return result; -} -var redirectResponseStatuses = [301, 302, 303, 307, 308]; -function createImageResponse(image, contentType, imageResponseFlags) { - const response = new Response(image, { - headers: { - Vary: "Accept", - "Content-Type": contentType, - "Content-Disposition": "attachment", - "Content-Security-Policy": "script-src 'none'; frame-src 'none'; sandbox;" - } - }); - if (imageResponseFlags.immutable) { - response.headers.set("Cache-Control", "public, max-age=315360000, immutable"); - } - return response; -} -function parseImageRequest(requestURL, requestHeaders) { - const formats = define_IMAGES_FORMATS_default; - const parsedUrlOrError = validateUrlQueryParameter(requestURL); - if (!("url" in parsedUrlOrError)) { - return parsedUrlOrError; - } - const widthOrError = validateWidthQueryParameter(requestURL); - if (typeof widthOrError !== "number") { - return widthOrError; - } - const qualityOrError = validateQualityQueryParameter(requestURL); - if (typeof qualityOrError !== "number") { - return qualityOrError; - } - const acceptHeader = requestHeaders.get("Accept") ?? ""; - let format = null; - for (const allowedFormat of formats) { - if (acceptHeader.includes(allowedFormat)) { - format = allowedFormat; - break; - } - } - const result = { - ok: true, - url: parsedUrlOrError.url, - width: widthOrError, - quality: qualityOrError, - format, - static: parsedUrlOrError.static - }; - return result; -} -function validateUrlQueryParameter(requestURL) { - const urls = requestURL.searchParams.getAll("url"); - if (urls.length < 1) { - const result = { - ok: false, - message: '"url" parameter is required' - }; - return result; - } - if (urls.length > 1) { - const result = { - ok: false, - message: '"url" parameter cannot be an array' - }; - return result; - } - const url = urls[0]; - if (url.length > 3072) { - const result = { - ok: false, - message: '"url" parameter is too long' - }; - return result; - } - if (url.startsWith("//")) { - const result = { - ok: false, - message: '"url" parameter cannot be a protocol-relative URL (//)' - }; - return result; - } - if (url.startsWith("/")) { - const staticAsset = url.startsWith(`${__NEXT_BASE_PATH__ || ""}/_next/static/media`); - const pathname = getPathnameFromRelativeURL(url); - if (/\/_next\/image($|\/)/.test(decodeURIComponent(pathname))) { - const result = { - ok: false, - message: '"url" parameter cannot be recursive' - }; - return result; - } - if (!staticAsset) { - if (!hasLocalMatch(define_IMAGES_LOCAL_PATTERNS_default, url)) { - const result = { ok: false, message: '"url" parameter is not allowed' }; - return result; - } - } - return { url, static: staticAsset }; - } - let parsedURL; - try { - parsedURL = new URL(url); - } catch { - const result = { ok: false, message: '"url" parameter is invalid' }; - return result; - } - const validProtocols = ["http:", "https:"]; - if (!validProtocols.includes(parsedURL.protocol)) { - const result = { - ok: false, - message: '"url" parameter is invalid' - }; - return result; - } - if (!hasRemoteMatch(define_IMAGES_REMOTE_PATTERNS_default, parsedURL)) { - const result = { - ok: false, - message: '"url" parameter is not allowed' - }; - return result; - } - return { url: parsedURL.href, static: false }; -} -function validateWidthQueryParameter(requestURL) { - const widthQueryValues = requestURL.searchParams.getAll("w"); - if (widthQueryValues.length < 1) { - const result = { - ok: false, - message: '"w" parameter (width) is required' - }; - return result; - } - if (widthQueryValues.length > 1) { - const result = { - ok: false, - message: '"w" parameter (width) cannot be an array' - }; - return result; - } - const widthQueryValue = widthQueryValues[0]; - if (!/^[0-9]+$/.test(widthQueryValue)) { - const result = { - ok: false, - message: '"w" parameter (width) must be an integer greater than 0' - }; - return result; - } - const width = parseInt(widthQueryValue, 10); - if (width <= 0 || isNaN(width)) { - const result = { - ok: false, - message: '"w" parameter (width) must be an integer greater than 0' - }; - return result; - } - const sizeValid = define_IMAGES_DEVICE_SIZES_default.includes(width) || define_IMAGES_IMAGE_SIZES_default.includes(width); - if (!sizeValid) { - const result = { - ok: false, - message: `"w" parameter (width) of ${width} is not allowed` - }; - return result; - } - return width; -} -function validateQualityQueryParameter(requestURL) { - const qualityQueryValues = requestURL.searchParams.getAll("q"); - if (qualityQueryValues.length < 1) { - const result = { - ok: false, - message: '"q" parameter (quality) is required' - }; - return result; - } - if (qualityQueryValues.length > 1) { - const result = { - ok: false, - message: '"q" parameter (quality) cannot be an array' - }; - return result; - } - const qualityQueryValue = qualityQueryValues[0]; - if (!/^[0-9]+$/.test(qualityQueryValue)) { - const result = { - ok: false, - message: '"q" parameter (quality) must be an integer between 1 and 100' - }; - return result; - } - const quality = parseInt(qualityQueryValue, 10); - if (isNaN(quality) || quality < 1 || quality > 100) { - const result = { - ok: false, - message: '"q" parameter (quality) must be an integer between 1 and 100' - }; - return result; - } - if (!define_IMAGES_QUALITIES_default.includes(quality)) { - const result = { - ok: false, - message: `"q" parameter (quality) of ${quality} is not allowed` - }; - return result; - } - return quality; -} -function getPathnameFromRelativeURL(relativeURL) { - return relativeURL.split("?")[0]; -} -function hasLocalMatch(localPatterns, relativeURL) { - const parseRelativeURLResult = parseRelativeURL(relativeURL); - for (const localPattern of localPatterns) { - const matched = matchLocalPattern(localPattern, parseRelativeURLResult); - if (matched) { - return true; - } - } - return false; -} -function parseRelativeURL(relativeURL) { - if (!relativeURL.includes("?")) { - const result2 = { - pathname: relativeURL, - search: "" - }; - return result2; - } - const parts = relativeURL.split("?"); - const pathname = parts[0]; - const search = "?" + parts.slice(1).join("?"); - const result = { - pathname, - search - }; - return result; -} -function matchLocalPattern(pattern, url) { - if (pattern.search !== void 0 && pattern.search !== url.search) { - return false; - } - return new RegExp(pattern.pathname).test(url.pathname); -} -function hasRemoteMatch(remotePatterns, url) { - for (const remotePattern of remotePatterns) { - const matched = matchRemotePattern(remotePattern, url); - if (matched) { - return true; - } - } - return false; -} -function matchRemotePattern(pattern, url) { - if (pattern.protocol !== void 0 && pattern.protocol.replace(/:$/, "") !== url.protocol.replace(/:$/, "")) { - return false; - } - if (pattern.port !== void 0 && pattern.port !== url.port) { - return false; - } - if (pattern.hostname === void 0 || !new RegExp(pattern.hostname).test(url.hostname)) { - return false; - } - if (pattern.search !== void 0 && pattern.search !== url.search) { - return false; - } - return new RegExp(pattern.pathname).test(url.pathname); -} -var AVIF = "image/avif"; -var WEBP = "image/webp"; -var PNG = "image/png"; -var JPEG = "image/jpeg"; -var JXL = "image/jxl"; -var JP2 = "image/jp2"; -var HEIC = "image/heic"; -var GIF = "image/gif"; -var SVG = "image/svg+xml"; -var ICO = "image/x-icon"; -var ICNS = "image/x-icns"; -var TIFF = "image/tiff"; -var BMP = "image/bmp"; -function detectImageContentType(buffer) { - if ([255, 216, 255].every((b, i) => buffer[i] === b)) { - return JPEG; - } - if ([137, 80, 78, 71, 13, 10, 26, 10].every((b, i) => buffer[i] === b)) { - return PNG; - } - if ([71, 73, 70, 56].every((b, i) => buffer[i] === b)) { - return GIF; - } - if ([82, 73, 70, 70, 0, 0, 0, 0, 87, 69, 66, 80].every((b, i) => !b || buffer[i] === b)) { - return WEBP; - } - if ([60, 63, 120, 109, 108].every((b, i) => buffer[i] === b)) { - return SVG; - } - if ([60, 115, 118, 103].every((b, i) => buffer[i] === b)) { - return SVG; - } - if ([0, 0, 0, 0, 102, 116, 121, 112, 97, 118, 105, 102].every((b, i) => !b || buffer[i] === b)) { - return AVIF; - } - if ([0, 0, 1, 0].every((b, i) => buffer[i] === b)) { - return ICO; - } - if ([105, 99, 110, 115].every((b, i) => buffer[i] === b)) { - return ICNS; - } - if ([73, 73, 42, 0].every((b, i) => buffer[i] === b)) { - return TIFF; - } - if ([66, 77].every((b, i) => buffer[i] === b)) { - return BMP; - } - if ([255, 10].every((b, i) => buffer[i] === b)) { - return JXL; - } - if ([0, 0, 0, 12, 74, 88, 76, 32, 13, 10, 135, 10].every((b, i) => buffer[i] === b)) { - return JXL; - } - if ([0, 0, 0, 0, 102, 116, 121, 112, 104, 101, 105, 99].every((b, i) => !b || buffer[i] === b)) { - return HEIC; - } - if ([0, 0, 0, 12, 106, 80, 32, 32, 13, 10, 135, 10].every((b, i) => buffer[i] === b)) { - return JP2; - } - return null; -} -export { - detectImageContentType, - handleImageRequest, - matchLocalPattern, - matchRemotePattern -}; diff --git a/.open-next 2/cloudflare/init.js b/.open-next 2/cloudflare/init.js deleted file mode 100644 index dc67455..0000000 --- a/.open-next 2/cloudflare/init.js +++ /dev/null @@ -1,88 +0,0 @@ -import { AsyncLocalStorage } from "node:async_hooks"; -import process from "node:process"; -import stream from "node:stream"; -import * as nextEnvVars from "./next-env.mjs"; -const cloudflareContextALS = new AsyncLocalStorage(); -Object.defineProperty(globalThis, Symbol.for("__cloudflare-context__"), { - get() { - return cloudflareContextALS.getStore(); - } -}); -async function runWithCloudflareRequestContext(request, env, ctx, handler) { - init(request, env); - return cloudflareContextALS.run({ env, ctx, cf: request.cf }, handler); -} -let initialized = false; -function init(request, env) { - if (initialized) { - return; - } - initialized = true; - const url = new URL(request.url); - initRuntime(); - populateProcessEnv(url, env); -} -function initRuntime() { - Object.assign(process, { version: process.version || "v22.14.0" }); - Object.assign(process.versions, { node: "22.14.0", ...process.versions }); - globalThis.__dirname ??= ""; - globalThis.__filename ??= ""; - import.meta.url ??= "file:///worker.js"; - const __original_fetch = globalThis.fetch; - globalThis.fetch = (input, init2) => { - if (init2) { - delete init2.cache; - } - return __original_fetch(input, init2); - }; - const CustomRequest = class extends globalThis.Request { - constructor(input, init2) { - if (init2) { - delete init2.cache; - Object.defineProperty(init2, "body", { - // @ts-ignore - value: init2.body instanceof stream.Readable ? ReadableStream.from(init2.body) : init2.body - }); - } - super(input, init2); - } - }; - Object.assign(globalThis, { - Request: CustomRequest, - __BUILD_TIMESTAMP_MS__: 1769585780929, - __NEXT_BASE_PATH__: "", - __ASSETS_RUN_WORKER_FIRST__: false, - __TRAILING_SLASH__: false, - // The external middleware will use the convertTo function of the `edge` converter - // by default it will try to fetch the request, but since we are running everything in the same worker - // we need to use the request as is. - __dangerous_ON_edge_converter_returns_request: true - }); -} -function populateProcessEnv(url, env) { - for (const [key, value] of Object.entries(env)) { - if (typeof value === "string") { - process.env[key] = value; - } - } - const mode = env.NEXTJS_ENV ?? "production"; - if (nextEnvVars[mode]) { - for (const key in nextEnvVars[mode]) { - process.env[key] ??= nextEnvVars[mode][key]; - } - } - process.env.OPEN_NEXT_ORIGIN = JSON.stringify({ - default: { - host: url.hostname, - protocol: url.protocol.slice(0, -1), - port: url.port - } - }); - process.env.__NEXT_PRIVATE_ORIGIN = url.origin; - if ("") { - process.env.DEPLOYMENT_ID = ""; - } -} -export { - runWithCloudflareRequestContext -}; diff --git a/.open-next 2/cloudflare/next-env.mjs b/.open-next 2/cloudflare/next-env.mjs deleted file mode 100644 index cc8a8bf..0000000 --- a/.open-next 2/cloudflare/next-env.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export const production = {"DATABASE_URL":"file:./prisma/dev.db","WORKOS_CLIENT_ID":"client_01KFPE94C2VGN7KHB59DD4RR52","WORKOS_API_KEY":"sk_test_a2V5XzAxS0ZWU1AyWTFDNkNDS1BSV1lKMERaNkNXLDBmUU5TN0RKYzJXNlFUeUR6Qk96cTY2ZVg","WORKOS_REDIRECT_URI":"http://localhost:3000/api/auth/callback","NEXT_PUBLIC_VAPID_PUBLIC_KEY":"BG7JgPf8BGBj-msDaGWl3osAa8OSbNjUm1ktC_0oNuyqNPzd6XJ91VT40RaPzyC5n91HkGifLLYxSG-Uj5DBh94","VAPID_PRIVATE_KEY":"f6Vd3ECXGOB3FTuNl1y2q77NzjK-Xq5Z0pekcD8qTVY","VAPID_SUBJECT":"mailto:admin@quittraq.com"}; -export const development = {"DATABASE_URL":"file:./prisma/dev.db","WORKOS_CLIENT_ID":"client_01KFPE94C2VGN7KHB59DD4RR52","WORKOS_API_KEY":"sk_test_a2V5XzAxS0ZWU1AyWTFDNkNDS1BSV1lKMERaNkNXLDBmUU5TN0RKYzJXNlFUeUR6Qk96cTY2ZVg","WORKOS_REDIRECT_URI":"http://localhost:3000/api/auth/callback","NEXT_PUBLIC_VAPID_PUBLIC_KEY":"BG7JgPf8BGBj-msDaGWl3osAa8OSbNjUm1ktC_0oNuyqNPzd6XJ91VT40RaPzyC5n91HkGifLLYxSG-Uj5DBh94","VAPID_PRIVATE_KEY":"f6Vd3ECXGOB3FTuNl1y2q77NzjK-Xq5Z0pekcD8qTVY","VAPID_SUBJECT":"mailto:admin@quittraq.com"}; -export const test = {"DATABASE_URL":"file:./dev.db"}; diff --git a/.open-next 2/cloudflare/skew-protection.js b/.open-next 2/cloudflare/skew-protection.js deleted file mode 100644 index 8d89317..0000000 --- a/.open-next 2/cloudflare/skew-protection.js +++ /dev/null @@ -1,36 +0,0 @@ -import process from "node:process"; -const DEPLOYMENT_MAPPING_ENV_NAME = "CF_DEPLOYMENT_MAPPING"; -const CURRENT_VERSION_ID = "current"; -let deploymentMapping; -function maybeGetSkewProtectionResponse(request) { - if (false) { - const url = new URL(request.url); - if (url.hostname === "localhost" || url.hostname.endsWith(".workers.dev")) { - return void 0; - } - const requestDeploymentId = request.headers.get("x-deployment-id") ?? url.searchParams.get("dpl"); - if (!requestDeploymentId || requestDeploymentId === process.env.DEPLOYMENT_ID) { - return void 0; - } - deploymentMapping ??= process.env[DEPLOYMENT_MAPPING_ENV_NAME] ? JSON.parse(process.env[DEPLOYMENT_MAPPING_ENV_NAME]) : {}; - if (!(requestDeploymentId in deploymentMapping)) { - return void 0; - } - const version = deploymentMapping[requestDeploymentId]; - if (!version || version === CURRENT_VERSION_ID) { - return void 0; - } - const versionDomain = version.split("-")[0]; - const hostname = `${versionDomain}-${process.env.CF_WORKER_NAME}.${process.env.CF_PREVIEW_DOMAIN}.workers.dev`; - url.hostname = hostname; - const requestToOlderDeployment = new Request(url, request); - const headers = new Headers(request.headers); - headers.delete("origin"); - return fetch(requestToOlderDeployment, { headers }); - } -} -export { - CURRENT_VERSION_ID, - DEPLOYMENT_MAPPING_ENV_NAME, - maybeGetSkewProtectionResponse -}; diff --git a/.open-next 2/dynamodb-provider/dynamodb-cache.json b/.open-next 2/dynamodb-provider/dynamodb-cache.json deleted file mode 100644 index d7e3e14..0000000 --- a/.open-next 2/dynamodb-provider/dynamodb-cache.json +++ /dev/null @@ -1 +0,0 @@ -[{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/layout"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/_global-error"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/_global-error/layout"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/_global-error"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/_global-error/page"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/_global-error"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/_global-error"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/_global-error"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/layout"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/_not-found"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/_not-found/layout"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/_not-found"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/_not-found/page"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/_not-found"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/_not-found"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/_not-found"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/layout"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/login"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/login/layout"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/login"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/login/page"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/login"},"revalidatedAt":{"N":"1"}},{"tag":{"S":"Bi3XXPy0fxaJxYXDBsshm/_N_T_/login"},"path":{"S":"Bi3XXPy0fxaJxYXDBsshm/login"},"revalidatedAt":{"N":"1"}}] \ No newline at end of file diff --git a/.open-next 2/dynamodb-provider/open-next.config.mjs b/.open-next 2/dynamodb-provider/open-next.config.mjs deleted file mode 100644 index 287d45c..0000000 --- a/.open-next 2/dynamodb-provider/open-next.config.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import { createRequire as topLevelCreateRequire } from 'module';const require = topLevelCreateRequire(import.meta.url);import bannerUrl from 'url';const __dirname = bannerUrl.fileURLToPath(new URL('.', import.meta.url)); - -// open-next.config.ts -var config = { - default: { - override: { - wrapper: "cloudflare-node", - converter: "edge", - proxyExternalRequest: "fetch", - incrementalCache: "dummy", - tagCache: "dummy", - queue: "dummy" - } - }, - edgeExternals: ["node:crypto"], - middleware: { - external: true, - override: { - wrapper: "cloudflare-edge", - converter: "edge", - proxyExternalRequest: "fetch", - incrementalCache: "dummy", - tagCache: "dummy", - queue: "dummy" - } - } -}; -var open_next_config_default = config; -export { - open_next_config_default as default -}; diff --git a/.open-next 2/worker 10.js b/.open-next 2/worker 10.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 10.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 11.js b/.open-next 2/worker 11.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 11.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 12.js b/.open-next 2/worker 12.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 12.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 13.js b/.open-next 2/worker 13.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 13.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 14.js b/.open-next 2/worker 14.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 14.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 15.js b/.open-next 2/worker 15.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 15.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 4.js b/.open-next 2/worker 4.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 4.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 5.js b/.open-next 2/worker 5.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 5.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 7.js b/.open-next 2/worker 7.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 7.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 8.js b/.open-next 2/worker 8.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 8.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker 9.js b/.open-next 2/worker 9.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker 9.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -}; diff --git a/.open-next 2/worker.js b/.open-next 2/worker.js deleted file mode 100644 index 0e5a82a..0000000 --- a/.open-next 2/worker.js +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-expect-error: Will be resolved by wrangler build -import { handleImageRequest } from "./cloudflare/images.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { runWithCloudflareRequestContext } from "./cloudflare/init.js"; -//@ts-expect-error: Will be resolved by wrangler build -import { maybeGetSkewProtectionResponse } from "./cloudflare/skew-protection.js"; -// @ts-expect-error: Will be resolved by wrangler build -import { handler as middlewareHandler } from "./middleware/handler.mjs"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOQueueHandler } from "./.build/durable-objects/queue.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js"; -//@ts-expect-error: Will be resolved by wrangler build -export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; -export default { - async fetch(request, env, ctx) { - return runWithCloudflareRequestContext(request, env, ctx, async () => { - const response = maybeGetSkewProtectionResponse(request); - if (response) { - return response; - } - const url = new URL(request.url); - // Serve images in development. - // Note: "/cdn-cgi/image/..." requests do not reach production workers. - if (url.pathname.startsWith("/cdn-cgi/image/")) { - const m = url.pathname.match(/\/cdn-cgi\/image\/.+?\/(?.+)$/); - if (m === null) { - return new Response("Not Found!", { status: 404 }); - } - const imageUrl = m.groups.url; - return imageUrl.match(/^https?:\/\//) - ? fetch(imageUrl, { cf: { cacheEverything: true } }) - : env.ASSETS?.fetch(new URL(`/${imageUrl}`, url)); - } - // Fallback for the Next default image loader. - if (url.pathname === - `${globalThis.__NEXT_BASE_PATH__}/_next/image${globalThis.__TRAILING_SLASH__ ? "/" : ""}`) { - return await handleImageRequest(url, request.headers, env); - } - // - `Request`s are handled by the Next server - const reqOrResp = await middlewareHandler(request, env, ctx); - if (reqOrResp instanceof Response) { - return reqOrResp; - } - // @ts-expect-error: resolved by wrangler build - const { handler } = await import("./server-functions/default/handler.mjs"); - return handler(reqOrResp, env, ctx, request.signal); - }); - }, -};