diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..741a56c --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +# Cloudflare Browser Run credentials for `npm run og` (copy to .env) +CF_ACCOUNT_ID= +CF_API_TOKEN= diff --git a/.vercel/output/_functions/chunks/_virtual_astro_server-island-manifest_C1Q2srgE.mjs b/.vercel/output/_functions/chunks/_virtual_astro_server-island-manifest_C1Q2srgE.mjs new file mode 100644 index 0000000..40da8ab --- /dev/null +++ b/.vercel/output/_functions/chunks/_virtual_astro_server-island-manifest_C1Q2srgE.mjs @@ -0,0 +1,5 @@ +//#region \0virtual:astro:server-island-manifest +var serverIslandMap = /* @__PURE__ */ new Map([]); +var serverIslandNameMap = /* @__PURE__ */ new Map([]); +//#endregion +export { serverIslandMap, serverIslandNameMap }; diff --git a/.vercel/output/_functions/chunks/_virtual_astro_session-driver_C-PI1Pas.mjs b/.vercel/output/_functions/chunks/_virtual_astro_session-driver_C-PI1Pas.mjs new file mode 100644 index 0000000..f90803a --- /dev/null +++ b/.vercel/output/_functions/chunks/_virtual_astro_session-driver_C-PI1Pas.mjs @@ -0,0 +1,4 @@ +//#region \0virtual:astro:session-driver +var _virtual_astro_session_driver_default = null; +//#endregion +export { _virtual_astro_session_driver_default as default }; diff --git a/.vercel/output/_functions/chunks/compiler_DiXpMM4i.mjs b/.vercel/output/_functions/chunks/compiler_DiXpMM4i.mjs new file mode 100644 index 0000000..fcb57df --- /dev/null +++ b/.vercel/output/_functions/chunks/compiler_DiXpMM4i.mjs @@ -0,0 +1,47 @@ +import { Z as AstroError, y as InvalidComponentArgs } from "./errors-data_zYnyWRO_.mjs"; +import "./jsx-runtime_DseUv9uh.mjs"; +//#region \0rolldown/runtime.js +var __defProp = Object.defineProperty; +var __exportAll = (all, no_symbols) => { + let target = {}; + for (var name in all) __defProp(target, name, { + get: all[name], + enumerable: true + }); + if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); + return target; +}; +//#endregion +//#region node_modules/astro/dist/runtime/server/astro-component.js +function validateArgs(args) { + if (args.length !== 3) return false; + if (!args[0] || typeof args[0] !== "object") return false; + return true; +} +function baseCreateComponent(cb, moduleId, propagation) { + const name = moduleId?.split("/").pop()?.replace(".astro", "") ?? ""; + const fn = (...args) => { + if (!validateArgs(args)) throw new AstroError({ + ...InvalidComponentArgs, + message: InvalidComponentArgs.message(name) + }); + return cb(...args); + }; + Object.defineProperty(fn, "name", { + value: name, + writable: false + }); + fn.isAstroComponentFactory = true; + fn.moduleId = moduleId; + fn.propagation = propagation; + return fn; +} +function createComponentWithOptions(opts) { + return baseCreateComponent(opts.factory, opts.moduleId, opts.propagation); +} +function createComponent(arg1, moduleId, propagation) { + if (typeof arg1 === "function") return baseCreateComponent(arg1, moduleId, propagation); + else return createComponentWithOptions(arg1); +} +//#endregion +export { __exportAll as n, createComponent as t }; diff --git a/.vercel/output/_functions/chunks/errors-data_zYnyWRO_.mjs b/.vercel/output/_functions/chunks/errors-data_zYnyWRO_.mjs new file mode 100644 index 0000000..eb1f995 --- /dev/null +++ b/.vercel/output/_functions/chunks/errors-data_zYnyWRO_.mjs @@ -0,0 +1,386 @@ +//#region node_modules/astro/dist/core/errors/utils.js +function normalizeLF(code) { + return code.replace(/\r\n|\r(?!\n)|\n/g, "\n"); +} +//#endregion +//#region node_modules/astro/dist/core/errors/printer.js +function codeFrame(src, loc) { + if (!loc || loc.line === void 0 || loc.column === void 0) return ""; + const lines = normalizeLF(src).split("\n").map((ln) => ln.replace(/\t/g, " ")); + const visibleLines = []; + for (let n = -2; n <= 2; n++) if (lines[loc.line + n]) visibleLines.push(loc.line + n); + let gutterWidth = 0; + for (const lineNo of visibleLines) { + let w = `> ${lineNo}`; + if (w.length > gutterWidth) gutterWidth = w.length; + } + let output = ""; + for (const lineNo of visibleLines) { + const isFocusedLine = lineNo === loc.line - 1; + output += isFocusedLine ? "> " : " "; + output += `${lineNo + 1} | ${lines[lineNo]} +`; + if (isFocusedLine) output += `${Array.from({ length: gutterWidth }).join(" ")} | ${Array.from({ length: loc.column }).join(" ")}^ +`; + } + return output; +} +//#endregion +//#region node_modules/astro/dist/core/errors/errors.js +function isAstroError(e) { + return e != null && (e instanceof AstroError || AstroError.is(e)); +} +var AstroError = class extends Error { + loc; + title; + hint; + frame; + type = "AstroError"; + constructor(props, options) { + const { name, title, message, stack, location, hint, frame } = props; + super(message, options); + this.title = title; + this.name = name; + if (message) this.message = message; + this.stack = stack ? stack : this.stack; + this.loc = location; + this.hint = hint; + this.frame = frame; + } + setLocation(location) { + this.loc = location; + } + setName(name) { + this.name = name; + } + setMessage(message) { + this.message = message; + } + setHint(hint) { + this.hint = hint; + } + setFrame(source, location) { + this.frame = codeFrame(source, location); + } + static is(err) { + return err?.type === "AstroError"; + } +}; +var AstroUserError = class extends Error { + type = "AstroUserError"; + /** + * A message that explains to the user how they can fix the error. + */ + hint; + name = "AstroUserError"; + constructor(message, hint) { + super(); + this.message = message; + this.hint = hint; + } + static is(err) { + return err?.type === "AstroUserError"; + } +}; +//#endregion +//#region node_modules/astro/dist/core/errors/errors-data.js +var ClientAddressNotAvailable = { + name: "ClientAddressNotAvailable", + title: "`Astro.clientAddress` is not available in current adapter.", + message: (adapterName) => `\`Astro.clientAddress\` is not available in the \`${adapterName}\` adapter. File an issue with the adapter to add support.` +}; +var PrerenderClientAddressNotAvailable = { + name: "PrerenderClientAddressNotAvailable", + title: "`Astro.clientAddress` cannot be used inside prerendered routes.", + message: (name) => `\`Astro.clientAddress\` cannot be used inside prerendered route ${name}.` +}; +var StaticClientAddressNotAvailable = { + name: "StaticClientAddressNotAvailable", + title: "`Astro.clientAddress` is not available in prerendered pages.", + message: "`Astro.clientAddress` is only available on pages that are server-rendered.", + hint: "See https://docs.astro.build/en/guides/on-demand-rendering/ for more information on how to enable SSR." +}; +var NoMatchingStaticPathFound = { + name: "NoMatchingStaticPathFound", + title: "No static path found for requested path.", + message: (pathName) => `A \`getStaticPaths()\` route pattern was matched, but no matching static path was found for requested path \`${pathName}\`.`, + hint: (possibleRoutes) => `Possible dynamic routes being matched: ${possibleRoutes.join(", ")}.` +}; +var OnlyResponseCanBeReturned = { + name: "OnlyResponseCanBeReturned", + title: "Invalid type returned by Astro page.", + message: (route, returnedValue) => `Route \`${route ? route : ""}\` returned a \`${returnedValue}\`. Only a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned from Astro files.`, + hint: "See https://docs.astro.build/en/guides/on-demand-rendering/#response for more information." +}; +var MissingMediaQueryDirective = { + name: "MissingMediaQueryDirective", + title: "Missing value for `client:media` directive.", + message: "Media query not provided for `client:media` directive. A media query similar to `client:media=\"(max-width: 600px)\"` must be provided." +}; +var NoMatchingRenderer = { + name: "NoMatchingRenderer", + title: "No matching renderer found.", + message: (componentName, componentExtension, plural, validRenderersCount) => `Unable to render \`${componentName}\`. + +${validRenderersCount > 0 ? `There ${plural ? "are" : "is"} ${validRenderersCount} renderer${plural ? "s" : ""} configured in your \`astro.config.mjs\` file, +but ${plural ? "none were" : "it was not"} able to server-side render \`${componentName}\`.` : `No valid renderer was found ${componentExtension ? `for the \`.${componentExtension}\` file extension.` : `for this file extension.`}`}`, + hint: (probableRenderers) => `Did you mean to enable the ${probableRenderers} integration? + +See https://docs.astro.build/en/guides/framework-components/ for more information on how to install and configure integrations.` +}; +var NoClientOnlyHint = { + name: "NoClientOnlyHint", + title: "Missing hint on client:only directive.", + message: (componentName) => `Unable to render \`${componentName}\`. When using the \`client:only\` hydration strategy, Astro needs a hint to use the correct renderer.`, + hint: (probableRenderers) => `Did you mean to pass \`client:only="${probableRenderers}"\`? See https://docs.astro.build/en/reference/directives-reference/#clientonly for more information on \`client:only\`.` +}; +var InvalidGetStaticPathsEntry = { + name: "InvalidGetStaticPathsEntry", + title: "Invalid entry inside `getStaticPaths()`'s return value.", + message: (entryType) => `Invalid entry returned by \`getStaticPaths()\`. Expected an object, got \`${entryType}\`.`, + hint: "If you're using a `.map` call, you might be looking for `.flatMap()` instead. See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`." +}; +var InvalidGetStaticPathsReturn = { + name: "InvalidGetStaticPathsReturn", + title: "Invalid value returned by `getStaticPaths()`.", + message: (returnType) => `Invalid type returned by \`getStaticPaths()\`. Expected an \`array\`, got \`${returnType}\`.`, + hint: "See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`." +}; +var GetStaticPathsExpectedParams = { + name: "GetStaticPathsExpectedParams", + title: "Missing params property on `getStaticPaths()` route.", + message: "Missing or empty required `params` property on `getStaticPaths()` route.", + hint: "See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`." +}; +var GetStaticPathsInvalidRouteParam = { + name: "GetStaticPathsInvalidRouteParam", + title: "Invalid route parameter returned by `getStaticPaths()`.", + message: (key, value, valueType) => `Invalid \`getStaticPaths()\` route parameter for \`${key}\`. Expected a string or undefined, received \`${valueType}\` (\`${value}\`).`, + hint: "See https://docs.astro.build/en/reference/routing-reference/#getstaticpaths for more information on `getStaticPaths()`." +}; +var GetStaticPathsRequired = { + name: "GetStaticPathsRequired", + title: "`getStaticPaths()` function required for dynamic routes.", + message: "`getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths()` function from your dynamic route.", + hint: `See https://docs.astro.build/en/guides/routing/#dynamic-routes for more information on dynamic routes. + + If you meant for this route to be server-rendered, set \`export const prerender = false;\` in the page.` +}; +var ReservedSlotName = { + name: "ReservedSlotName", + title: "Invalid slot name.", + message: (slotName) => `Unable to create a slot named \`${slotName}\`. \`${slotName}\` is a reserved slot name. Please update the name of this slot.` +}; +var NoMatchingImport = { + name: "NoMatchingImport", + title: "No import found for component.", + message: (componentName) => `Could not render \`${componentName}\`. No matching import has been found for \`${componentName}\`.`, + hint: "Please make sure the component is properly imported." +}; +var InvalidComponentArgs = { + name: "InvalidComponentArgs", + title: "Invalid component arguments.", + message: (name) => `Invalid arguments passed to${name ? ` <${name}>` : ""} component.`, + hint: "Astro components cannot be rendered directly via function call, such as `Component()` or `{items.map(Component)}`." +}; +var PageNumberParamNotFound = { + name: "PageNumberParamNotFound", + title: "Page number param not found.", + message: (paramName) => `[paginate()] page number param \`${paramName}\` not found in your filepath.`, + hint: "Rename your file to `[page].astro` or `[...page].astro`." +}; +var ImageMissingAlt = { + name: "ImageMissingAlt", + title: "Image missing required \"alt\" property.", + message: "Image missing \"alt\" property. \"alt\" text is required to describe important images on the page.", + hint: "Use an empty string (\"\") for decorative images." +}; +var InvalidImageService = { + name: "InvalidImageService", + title: "Error while loading image service.", + message: "There was an error loading the configured image service. Please see the stack trace for more information." +}; +var MissingImageDimension = { + name: "MissingImageDimension", + title: "Missing image dimensions.", + message: (missingDimension, imageURL) => `Missing ${missingDimension === "both" ? "width and height attributes" : `${missingDimension} attribute`} for ${imageURL}. When using remote images, both dimensions are required in order to avoid CLS.`, + hint: "If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](https://docs.astro.build/en/guides/imports/#other-assets). You can also use `inferSize={true}` for remote images to get the original dimensions." +}; +var FailedToFetchRemoteImageDimensions = { + name: "FailedToFetchRemoteImageDimensions", + title: "Failed to retrieve remote image dimensions.", + message: (imageURL) => `Failed to get the dimensions for ${imageURL}.`, + hint: "Verify your remote image URL is accurate, and that you are not using `inferSize` with a file located in your `public/` folder." +}; +var RemoteImageNotAllowed = { + name: "RemoteImageNotAllowed", + title: "Remote image is not allowed.", + message: (imageURL) => `Remote image ${imageURL} is not allowed by your image configuration.`, + hint: "Update `image.domains` or `image.remotePatterns`, or remove `inferSize` for this image." +}; +var UnsupportedImageFormat = { + name: "UnsupportedImageFormat", + title: "Unsupported image format.", + message: (format, imagePath, supportedFormats) => `Received unsupported format \`${format}\` from \`${imagePath}\`. Currently only ${supportedFormats.join(", ")} are supported by our image services.`, + hint: "Using an `img` tag directly instead of the `Image` component might be what you're looking for." +}; +var UnsupportedImageConversion = { + name: "UnsupportedImageConversion", + title: "Unsupported image conversion.", + message: "Converting between vector (such as SVGs) and raster (such as PNGs and JPEGs) images is not currently supported." +}; +var PrerenderDynamicEndpointPathCollide = { + name: "PrerenderDynamicEndpointPathCollide", + title: "Prerendered dynamic endpoint has path collision.", + message: (pathname) => `Could not render \`${pathname}\` with an \`undefined\` param as the generated path will collide during prerendering. Prevent passing \`undefined\` as \`params\` for the endpoint's \`getStaticPaths()\` function, or add an additional extension to the endpoint's filename.`, + hint: (filename) => `Rename \`${filename}\` to \`${filename.replace(/\.(?:js|ts)/, (m) => `.json` + m)}\`` +}; +var ExpectedImage = { + name: "ExpectedImage", + title: "Expected src to be an image.", + message: (src, typeofOptions, fullOptions) => `Expected \`src\` property for \`getImage\` or \`\` to be either an ESM imported image or a string with the path of a remote image. Received \`${src}\` (type: \`${typeofOptions}\`). + +Full serialized options received: \`${fullOptions}\`.`, + hint: "This error can often happen because of a wrong path. Make sure the path to your image is correct. If you're passing an async function, make sure to call and await it." +}; +var ExpectedImageOptions = { + name: "ExpectedImageOptions", + title: "Expected image options.", + message: (options) => `Expected \`getImage()\` parameter to be an object. Received \`${options}\`.` +}; +var ExpectedNotESMImage = { + name: "ExpectedNotESMImage", + title: "Expected image options, not an ESM-imported image.", + message: "An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.", + hint: "Try changing `getImage(myImage)` to `getImage({ src: myImage })`" +}; +var IncompatibleDescriptorOptions = { + name: "IncompatibleDescriptorOptions", + title: "Cannot set both `densities` and `widths`.", + message: "Only one of `densities` or `widths` can be specified. In most cases, you'll probably want to use only `widths` if you require specific widths.", + hint: "Those attributes are used to construct a `srcset` attribute, which cannot have both `x` and `w` descriptors." +}; +var NoImageMetadata = { + name: "NoImageMetadata", + title: "Could not process image metadata.", + message: (imagePath) => `Could not process image metadata${imagePath ? ` for \`${imagePath}\`` : ""}.`, + hint: "This is often caused by a corrupted or malformed image. Re-exporting the image from your image editor may fix this issue." +}; +var ResponseSentError = { + name: "ResponseSentError", + title: "Unable to set response.", + message: "The response has already been sent to the browser and cannot be altered." +}; +var MiddlewareNoDataOrNextCalled = { + name: "MiddlewareNoDataOrNextCalled", + title: "The middleware didn't return a `Response`.", + message: "Make sure your middleware returns a `Response` object, either directly or by returning the `Response` from calling the `next` function." +}; +var MiddlewareNotAResponse = { + name: "MiddlewareNotAResponse", + title: "The middleware returned something that is not a `Response` object.", + message: "Any data returned from middleware must be a valid `Response` object." +}; +var EndpointDidNotReturnAResponse = { + name: "EndpointDidNotReturnAResponse", + title: "The endpoint did not return a `Response`.", + message: "An endpoint must return either a `Response`, or a `Promise` that resolves with a `Response`." +}; +var LocalsNotAnObject = { + name: "LocalsNotAnObject", + title: "Value assigned to `locals` is not accepted.", + message: "`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.", + hint: "If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`." +}; +var LocalsReassigned = { + name: "LocalsReassigned", + title: "`locals` must not be reassigned.", + message: "`locals` cannot be assigned directly.", + hint: "Set a `locals` property instead." +}; +var AstroResponseHeadersReassigned = { + name: "AstroResponseHeadersReassigned", + title: "`Astro.response.headers` must not be reassigned.", + message: "Individual headers can be added to and removed from `Astro.response.headers`, but it must not be replaced with another instance of `Headers` altogether.", + hint: "Consider using `Astro.response.headers.add()`, and `Astro.response.headers.delete()`." +}; +var LocalImageUsedWrongly = { + name: "LocalImageUsedWrongly", + title: "Local images must be imported.", + message: (imageFilePath) => `\`Image\`'s and \`getImage\`'s \`src\` parameter must be an imported image or a URL, it cannot be a string filepath. Received \`${imageFilePath}\`.`, + hint: "If you want to use an image from your `src` folder, you need to either import it or if the image is coming from a content collection, use the [image() schema helper](https://docs.astro.build/en/guides/images/#images-in-content-collections). See https://docs.astro.build/en/reference/modules/astro-assets/#src-required for more information on the `src` property." +}; +var MissingSharp = { + name: "MissingSharp", + title: "Could not find Sharp.", + message: "Could not find Sharp. Please install Sharp (`sharp`) manually into your project or migrate to another image service.", + hint: "See Sharp's installation instructions for more information: https://sharp.pixelplumbing.com/install. If you are not relying on `astro:assets` to optimize, transform, or process any images, you can configure a passthrough image service instead of installing Sharp. See https://docs.astro.build/en/reference/errors/missing-sharp for more information.\n\nSee https://docs.astro.build/en/guides/images/#default-image-service for more information on how to migrate to another image service." +}; +var i18nNoLocaleFoundInPath = { + name: "i18nNoLocaleFoundInPath", + title: "The path doesn't contain any locale.", + message: "You tried to use an i18n utility on a path that doesn't contain any locale. You can use `pathHasLocale` first to determine if the path has a locale." +}; +var RewriteWithBodyUsed = { + name: "RewriteWithBodyUsed", + title: "Cannot use `Astro.rewrite()` after the request body has been read.", + message: "`Astro.rewrite()` cannot be used if the request body has already been read. If you need to read the body, first clone the request." +}; +var ForbiddenRewrite = { + name: "ForbiddenRewrite", + title: "Forbidden rewrite to a static route.", + message: (from, to, component) => `You tried to rewrite the on-demand route '${from}' with the static route '${to}', when using the 'server' output. + +The static route '${to}' is rendered by the component +'${component}', which is marked as prerendered. This is a forbidden operation because during the build, the component '${component}' is compiled to an +HTML file, which can't be retrieved at runtime by Astro.`, + hint: (component) => `Add \`export const prerender = false\` to the component '${component}', or use \`Astro.redirect()\`.` +}; +var FontFamilyNotFound = { + name: "FontFamilyNotFound", + title: "Font family not found.", + message: (family) => `No data was found for the \`"${family}"\` family passed to the \`\` component.`, + hint: "This is often caused by a typo. Check that the `` component is using a `cssVariable` specified in your config." +}; +var FontFileUrlNotFound = { + name: "FontFileUrlNotFound", + title: "Font file URL not found.", + message: (url) => `The \`"${url}"\` URL passed to the \`experimental_getFontFileURL()\` function is invalid.`, + hint: "Make sure you pass a valid URL, obtained via the `fontData` object." +}; +var MissingGetFontFileRequestUrl = { + name: "MissingGetFontFileRequestUrl", + title: "`experimental_getFontFileURL()` requires the request URL with on-demand rendering.", + hint: "Pass the request URL as the 2nd argument, for example `Astro.url`." +}; +var UnavailableAstroGlobal = { + name: "UnavailableAstroGlobal", + title: "Unavailable Astro global in `getStaticPaths()`.", + message: (name) => `The Astro global is not available in this scope. Please remove \`Astro.${name}\` from your \`getStaticPaths()\` function.` +}; +var NoManifestAvailable = { + name: "NoManifestAvailableError", + title: "No manifest available.", + message: "`new FetchState(request)` was called outside of an Astro server, so no manifest is available.", + hint: "Make sure this code runs as part of your Astro app, such as its fetch entrypoint. If this error occurred inside an Astro-built server, please open an issue at https://github.com/withastro/astro/issues." +}; +var ActionsReturnedInvalidDataError = { + name: "ActionsReturnedInvalidDataError", + title: "Action handler returned invalid data.", + message: (error) => `Action handler returned invalid data. Handlers should return serializable data types like objects, arrays, strings, and numbers. Parse error: ${error}`, + hint: "See the devalue library for all supported types: https://github.com/rich-harris/devalue" +}; +var ActionNotFoundError = { + name: "ActionNotFoundError", + title: "Action not found.", + message: (actionName) => `The server received a request for an action named \`${actionName}\` but could not find a match. If you renamed an action, check that you've updated your \`actions/index\` file and your calling code to match.`, + hint: "You can run `astro check` to detect type errors caused by mismatched action names." +}; +var CacheNotEnabled = { + name: "CacheNotEnabled", + title: "Cache is not enabled.", + message: "`Astro.cache` is not available because the cache feature is not enabled. To use caching, configure a cache provider in your Astro config under `cache`.", + hint: "Use an adapter that provides a default cache provider, or set one explicitly: `cache: { provider: \"...\" }`. See https://docs.astro.build/en/guides/caching/." +}; +//#endregion +export { isAstroError as $, MissingMediaQueryDirective as A, PrerenderClientAddressNotAvailable as B, LocalImageUsedWrongly as C, MiddlewareNotAResponse as D, MiddlewareNoDataOrNextCalled as E, NoMatchingImport as F, RewriteWithBodyUsed as G, RemoteImageNotAllowed as H, NoMatchingRenderer as I, UnsupportedImageConversion as J, StaticClientAddressNotAvailable as K, NoMatchingStaticPathFound as L, NoClientOnlyHint as M, NoImageMetadata as N, MissingGetFontFileRequestUrl as O, NoManifestAvailable as P, AstroUserError as Q, OnlyResponseCanBeReturned as R, InvalidImageService as S, LocalsReassigned as T, ReservedSlotName as U, PrerenderDynamicEndpointPathCollide as V, ResponseSentError as W, i18nNoLocaleFoundInPath as X, UnsupportedImageFormat as Y, AstroError as Z, ImageMissingAlt as _, ClientAddressNotAvailable as a, InvalidGetStaticPathsEntry as b, ExpectedImageOptions as c, FontFamilyNotFound as d, FontFileUrlNotFound as f, GetStaticPathsRequired as g, GetStaticPathsInvalidRouteParam as h, CacheNotEnabled as i, MissingSharp as j, MissingImageDimension as k, ExpectedNotESMImage as l, GetStaticPathsExpectedParams as m, ActionsReturnedInvalidDataError as n, EndpointDidNotReturnAResponse as o, ForbiddenRewrite as p, UnavailableAstroGlobal as q, AstroResponseHeadersReassigned as r, ExpectedImage as s, ActionNotFoundError as t, FailedToFetchRemoteImageDimensions as u, IncompatibleDescriptorOptions as v, LocalsNotAnObject as w, InvalidGetStaticPathsReturn as x, InvalidComponentArgs as y, PageNumberParamNotFound as z }; diff --git a/.vercel/output/_functions/chunks/generic_DKF9tBMu.mjs b/.vercel/output/_functions/chunks/generic_DKF9tBMu.mjs new file mode 100644 index 0000000..e2804bc --- /dev/null +++ b/.vercel/output/_functions/chunks/generic_DKF9tBMu.mjs @@ -0,0 +1,720 @@ +import { n as __exportAll, t as createComponent } from "./compiler_DiXpMM4i.mjs"; +import { C as LocalImageUsedWrongly, H as RemoteImageNotAllowed, J as UnsupportedImageConversion, O as MissingGetFontFileRequestUrl, S as InvalidImageService, Y as UnsupportedImageFormat, Z as AstroError, _ as ImageMissingAlt, c as ExpectedImageOptions, d as FontFamilyNotFound, k as MissingImageDimension, l as ExpectedNotESMImage, s as ExpectedImage, v as IncompatibleDescriptorOptions } from "./errors-data_zYnyWRO_.mjs"; +import { _ as inferRemoteSize$1, b as isRemoteAllowed, c as isRemotePath, f as removeQueryString, l as joinPaths, v as fetchWithRedirects } from "./path_BQC-SKOp.mjs"; +import { S as unescapeHTML, _ as addAttribute, h as maybeRenderHead, m as renderTemplate, r as spreadAttributes, w as createAstro } from "./jsx-runtime_DseUv9uh.mjs"; +import * as mime from "mrmime"; +//#region node_modules/astro/dist/assets/utils/imageKind.js +function isESMImportedImage(src) { + return typeof src === "object" || typeof src === "function" && "src" in src; +} +function isRemoteImage(src) { + return typeof src === "string"; +} +async function resolveSrc(src) { + if (typeof src === "object" && "then" in src) { + const resource = await src; + return resource.default ?? resource; + } + return src; +} +var VALID_SUPPORTED_FORMATS = [ + "jpeg", + "jpg", + "png", + "tiff", + "webp", + "gif", + "svg", + "avif" +]; +var DEFAULT_OUTPUT_FORMAT = "webp"; +var DEFAULT_HASH_PROPS = [ + "src", + "width", + "height", + "format", + "quality", + "fit", + "position", + "background" +]; +//#endregion +//#region node_modules/astro/dist/assets/layout.js +var DEFAULT_RESOLUTIONS = [ + 640, + 750, + 828, + 960, + 1080, + 1280, + 1668, + 1920, + 2048, + 2560, + 3200, + 3840, + 4480, + 5120, + 6016 +]; +var LIMITED_RESOLUTIONS = [ + 640, + 750, + 828, + 1080, + 1280, + 1668, + 2048, + 2560 +]; +var getWidths = ({ width, layout, breakpoints = DEFAULT_RESOLUTIONS, originalWidth }) => { + const smallerThanOriginal = (w) => !originalWidth || w <= originalWidth; + if (layout === "full-width") return breakpoints.filter(smallerThanOriginal); + if (!width) return []; + const doubleWidth = width * 2; + const maxSize = originalWidth ? Math.min(doubleWidth, originalWidth) : doubleWidth; + if (layout === "fixed") return originalWidth && width > originalWidth ? [originalWidth] : [width, maxSize]; + if (layout === "constrained") return [ + width, + doubleWidth, + ...breakpoints + ].filter((w) => w <= maxSize).sort((a, b) => a - b); + return []; +}; +var getSizesAttribute = ({ width, layout }) => { + if (!width || !layout) return; + switch (layout) { + case "constrained": return `(min-width: ${width}px) ${width}px, 100vw`; + case "fixed": return `${width}px`; + case "full-width": return `100vw`; + default: return; + } +}; +//#endregion +//#region node_modules/astro/dist/assets/utils/inferSourceFormat.js +var DATA_PREFIX = "data:"; +function inferSourceFormat(src) { + if (src.startsWith(DATA_PREFIX)) { + const sepIndex = src.indexOf(";"); + const commaIndex = src.indexOf(","); + const mimeEnd = sepIndex === -1 ? commaIndex : commaIndex === -1 ? sepIndex : Math.min(sepIndex, commaIndex); + if (mimeEnd === -1) return void 0; + const mime = src.slice(5, mimeEnd); + if (mime === "image/svg+xml") return "svg"; + return mime.split("/")[1] || void 0; + } + try { + const cleanSrc = removeQueryString(src).split("#")[0]; + const lastSlash = cleanSrc.lastIndexOf("/"); + const basename = lastSlash === -1 ? cleanSrc : cleanSrc.slice(lastSlash + 1); + const lastDot = basename.lastIndexOf("."); + if (lastDot === -1) return void 0; + return basename.slice(lastDot + 1).toLowerCase(); + } catch { + return; + } +} +function resolveDefaultOutputFormat(sourceFormat) { + return sourceFormat === "svg" ? "svg" : DEFAULT_OUTPUT_FORMAT; +} +//#endregion +//#region node_modules/astro/dist/assets/services/service.js +function isLocalService(service) { + if (!service) return false; + return "transform" in service; +} +function parseQuality(quality) { + let result = Number.parseInt(quality); + if (Number.isNaN(result)) return quality; + return result; +} +var sortNumeric = (a, b) => a - b; +function verifyOptions(options) { + if (!options.src || !isRemoteImage(options.src) && !isESMImportedImage(options.src)) throw new AstroError({ + ...ExpectedImage, + message: ExpectedImage.message(JSON.stringify(options.src), typeof options.src, JSON.stringify(options, (_, v) => v === void 0 ? null : v)) + }); + if (!isESMImportedImage(options.src)) { + if (options.src.startsWith("/@fs/") || !isRemotePath(options.src) && !options.src.startsWith("/")) throw new AstroError({ + ...LocalImageUsedWrongly, + message: LocalImageUsedWrongly.message(options.src) + }); + let missingDimension; + if (!options.width && !options.height) missingDimension = "both"; + else if (!options.width && options.height) missingDimension = "width"; + else if (options.width && !options.height) missingDimension = "height"; + if (missingDimension) throw new AstroError({ + ...MissingImageDimension, + message: MissingImageDimension.message(missingDimension, options.src) + }); + } else { + if (!VALID_SUPPORTED_FORMATS.includes(options.src.format)) throw new AstroError({ + ...UnsupportedImageFormat, + message: UnsupportedImageFormat.message(options.src.format, options.src.src, VALID_SUPPORTED_FORMATS) + }); + if (options.widths && options.densities) throw new AstroError(IncompatibleDescriptorOptions); + if (options.src.format !== "svg" && options.format === "svg") throw new AstroError(UnsupportedImageConversion); + } +} +var baseService = { + propertiesToHash: DEFAULT_HASH_PROPS, + validateOptions(options) { + verifyOptions(options); + if (!options.format) { + if (isESMImportedImage(options.src)) options.format = resolveDefaultOutputFormat(options.src.format); + else { + const inferred = inferSourceFormat(options.src); + if (inferred) options.format = resolveDefaultOutputFormat(inferred); + } + } + if (options.width) options.width = Math.round(options.width); + if (options.height) options.height = Math.round(options.height); + if (options.layout) delete options.layout; + if (options.fit === "none") delete options.fit; + return options; + }, + getHTMLAttributes(options) { + const { targetWidth, targetHeight } = getTargetDimensions(options); + const { src, width, height, format, quality, densities, widths, formats, layout, priority, fit, position, background, ...attributes } = options; + return { + ...attributes, + width: targetWidth, + height: targetHeight, + loading: attributes.loading ?? "lazy", + decoding: attributes.decoding ?? "async" + }; + }, + getSrcSet(options) { + const { targetWidth, targetHeight } = getTargetDimensions(options); + const aspectRatio = targetWidth / targetHeight; + const { widths, densities } = options; + const targetFormat = options.format; + let transformedWidths = (widths ?? []).sort(sortNumeric); + let imageWidth = options.width; + let maxWidth = Number.POSITIVE_INFINITY; + if (isESMImportedImage(options.src)) { + imageWidth = options.src.width; + maxWidth = imageWidth; + if (transformedWidths.length > 0 && transformedWidths.at(-1) > maxWidth) { + transformedWidths = transformedWidths.filter((width) => width <= maxWidth); + transformedWidths.push(maxWidth); + } + } + transformedWidths = Array.from(new Set(transformedWidths)); + const { width: transformWidth, height: transformHeight, ...transformWithoutDimensions } = options; + let allWidths = []; + if (densities) { + const densityValues = densities.map((density) => { + if (typeof density === "number") return density; + else return Number.parseFloat(density); + }); + allWidths = densityValues.sort(sortNumeric).map((density) => Math.round(targetWidth * density)).map((width, index) => ({ + width, + descriptor: `${densityValues[index]}x` + })); + } else if (transformedWidths.length > 0) allWidths = transformedWidths.map((width) => ({ + width, + descriptor: `${width}w` + })); + return allWidths.map(({ width, descriptor }) => { + const height = Math.round(width / aspectRatio); + return { + transform: { + ...transformWithoutDimensions, + width, + height + }, + descriptor, + attributes: targetFormat ? { type: `image/${targetFormat}` } : {} + }; + }); + }, + getURL(options, imageConfig) { + const searchParams = new URLSearchParams(); + if (isESMImportedImage(options.src)) searchParams.append("href", options.src.src); + else if (isRemoteAllowed(options.src, imageConfig)) searchParams.append("href", options.src); + else return options.src; + Object.entries({ + w: "width", + h: "height", + q: "quality", + f: "format", + fit: "fit", + position: "position", + background: "background" + }).forEach(([param, key]) => { + options[key] && searchParams.append(param, options[key].toString()); + }); + let url = `${joinPaths("/", imageConfig.endpoint.route)}?${searchParams}`; + if (imageConfig.assetQueryParams) { + const assetQueryString = imageConfig.assetQueryParams.toString(); + if (assetQueryString) url += "&" + assetQueryString; + } + return url; + }, + parseURL(url) { + const params = url.searchParams; + if (!params.has("href")) return; + return { + src: params.get("href"), + width: params.has("w") ? Number.parseInt(params.get("w")) : void 0, + height: params.has("h") ? Number.parseInt(params.get("h")) : void 0, + format: params.has("f") ? params.get("f") : void 0, + quality: params.get("q"), + fit: params.get("fit"), + position: params.get("position") ?? void 0, + background: params.get("background") ?? void 0 + }; + }, + getRemoteSize(url, imageConfig) { + return inferRemoteSize$1(url, imageConfig); + } +}; +function getTargetDimensions(options) { + let targetWidth = options.width; + let targetHeight = options.height; + if (isESMImportedImage(options.src)) { + const aspectRatio = options.src.width / options.src.height; + if (targetHeight && !targetWidth) targetWidth = Math.round(targetHeight * aspectRatio); + else if (targetWidth && !targetHeight) targetHeight = Math.round(targetWidth / aspectRatio); + else if (!targetWidth && !targetHeight) { + targetWidth = options.src.width; + targetHeight = options.src.height; + } + } + return { + targetWidth, + targetHeight + }; +} +//#endregion +//#region node_modules/astro/dist/assets/types.js +function isImageMetadata(src) { + return src.fsPath && !("fsPath" in src); +} +//#endregion +//#region node_modules/astro/dist/assets/utils/url.js +var PLACEHOLDER_BASE = "astro://placeholder"; +function createPlaceholderURL(pathOrUrl) { + return new URL(pathOrUrl, PLACEHOLDER_BASE); +} +function stringifyPlaceholderURL(url) { + return url.href.replace(PLACEHOLDER_BASE, ""); +} +//#endregion +//#region node_modules/astro/dist/assets/internal.js +var cssFitValues = [ + "fill", + "contain", + "cover", + "scale-down" +]; +async function getConfiguredImageService() { + if (!globalThis?.astroAsset?.imageService) { + const { default: service } = await import("./sharp_BQ57rSWH.mjs").catch((e) => { + const error = new AstroError(InvalidImageService); + error.cause = e; + throw error; + }); + if (!globalThis.astroAsset) globalThis.astroAsset = {}; + globalThis.astroAsset.imageService = service; + return service; + } + return globalThis.astroAsset.imageService; +} +async function getImage$1(options, imageConfig) { + if (!options || typeof options !== "object") throw new AstroError({ + ...ExpectedImageOptions, + message: ExpectedImageOptions.message(JSON.stringify(options)) + }); + if (typeof options.src === "undefined") throw new AstroError({ + ...ExpectedImage, + message: ExpectedImage.message(options.src, "undefined", JSON.stringify(options)) + }); + if (isImageMetadata(options)) throw new AstroError(ExpectedNotESMImage); + const service = await getConfiguredImageService(); + const resolvedOptions = { + ...options, + src: await resolveSrc(options.src) + }; + let originalWidth; + let originalHeight; + if (resolvedOptions.inferSize) { + delete resolvedOptions.inferSize; + if (isRemoteImage(resolvedOptions.src) && isRemotePath(resolvedOptions.src)) { + if (!isRemoteAllowed(resolvedOptions.src, imageConfig)) throw new AstroError({ + ...RemoteImageNotAllowed, + message: RemoteImageNotAllowed.message(resolvedOptions.src) + }); + const getRemoteSize = (url) => service.getRemoteSize?.(url, imageConfig) ?? inferRemoteSize$1(url, imageConfig); + const result = await getRemoteSize(resolvedOptions.src); + resolvedOptions.width ??= result.width; + resolvedOptions.height ??= result.height; + if (result.format) resolvedOptions.format ??= resolveDefaultOutputFormat(result.format); + originalWidth = result.width; + originalHeight = result.height; + } + } + const originalFilePath = isESMImportedImage(resolvedOptions.src) ? resolvedOptions.src.fsPath : void 0; + const clonedSrc = isESMImportedImage(resolvedOptions.src) ? resolvedOptions.src.clone ?? resolvedOptions.src : resolvedOptions.src; + if (isESMImportedImage(clonedSrc)) { + originalWidth = clonedSrc.width; + originalHeight = clonedSrc.height; + } + if (originalWidth && originalHeight) { + const aspectRatio = originalWidth / originalHeight; + if (resolvedOptions.height && !resolvedOptions.width) resolvedOptions.width = Math.round(resolvedOptions.height * aspectRatio); + else if (resolvedOptions.width && !resolvedOptions.height) resolvedOptions.height = Math.round(resolvedOptions.width / aspectRatio); + else if (!resolvedOptions.width && !resolvedOptions.height) { + resolvedOptions.width = originalWidth; + resolvedOptions.height = originalHeight; + } + } + resolvedOptions.src = clonedSrc; + const layout = options.layout ?? imageConfig.layout ?? "none"; + if (resolvedOptions.priority) { + resolvedOptions.loading ??= "eager"; + resolvedOptions.decoding ??= "sync"; + resolvedOptions.fetchpriority ??= "high"; + delete resolvedOptions.priority; + } else { + resolvedOptions.loading ??= "lazy"; + resolvedOptions.decoding ??= "async"; + resolvedOptions.fetchpriority ??= void 0; + } + if (layout !== "none") { + resolvedOptions.widths ||= getWidths({ + width: resolvedOptions.width, + layout, + originalWidth, + breakpoints: imageConfig.breakpoints?.length ? imageConfig.breakpoints : isLocalService(service) ? LIMITED_RESOLUTIONS : DEFAULT_RESOLUTIONS + }); + resolvedOptions.sizes ||= getSizesAttribute({ + width: resolvedOptions.width, + layout + }); + delete resolvedOptions.densities; + resolvedOptions["data-astro-image"] = layout; + if (resolvedOptions.fit && cssFitValues.includes(resolvedOptions.fit)) resolvedOptions["data-astro-image-fit"] = resolvedOptions.fit; + resolvedOptions["data-astro-image-pos"] = (resolvedOptions.position || "center").replace(/\s+/g, "-"); + } + const validatedOptions = service.validateOptions ? await service.validateOptions(resolvedOptions, imageConfig) : resolvedOptions; + validatedOptions.format ??= await peekRemoteFormatForStaticEmit(validatedOptions, imageConfig, service); + const srcSetTransforms = service.getSrcSet ? await service.getSrcSet(validatedOptions, imageConfig) : []; + const lazyImageURLFactory = (getValue) => { + let cached = null; + return () => cached ??= getValue(); + }; + const initialImageURL = await service.getURL(validatedOptions, imageConfig); + let lazyImageURL = lazyImageURLFactory(() => initialImageURL); + const matchesValidatedTransform = (transform) => transform.width === validatedOptions.width && transform.height === validatedOptions.height && transform.format === validatedOptions.format; + let srcSets = await Promise.all(srcSetTransforms.map(async (srcSet) => { + return { + transform: srcSet.transform, + url: matchesValidatedTransform(srcSet.transform) ? initialImageURL : await service.getURL(srcSet.transform, imageConfig), + descriptor: srcSet.descriptor, + attributes: srcSet.attributes + }; + })); + if (isLocalService(service) && globalThis.astroAsset.addStaticImage && !(isRemoteImage(validatedOptions.src) && initialImageURL === validatedOptions.src)) { + const propsToHash = service.propertiesToHash ?? DEFAULT_HASH_PROPS; + lazyImageURL = lazyImageURLFactory(() => globalThis.astroAsset.addStaticImage(validatedOptions, propsToHash, originalFilePath)); + srcSets = srcSetTransforms.map((srcSet) => { + return { + transform: srcSet.transform, + url: matchesValidatedTransform(srcSet.transform) ? lazyImageURL() : globalThis.astroAsset.addStaticImage(srcSet.transform, propsToHash, originalFilePath), + descriptor: srcSet.descriptor, + attributes: srcSet.attributes + }; + }); + } else if (imageConfig.assetQueryParams) { + const imageURLObj = createPlaceholderURL(initialImageURL); + imageConfig.assetQueryParams.forEach((value, key) => { + imageURLObj.searchParams.set(key, value); + }); + lazyImageURL = lazyImageURLFactory(() => stringifyPlaceholderURL(imageURLObj)); + srcSets = srcSets.map((srcSet) => { + const urlObj = createPlaceholderURL(srcSet.url); + imageConfig.assetQueryParams.forEach((value, key) => { + urlObj.searchParams.set(key, value); + }); + return { + ...srcSet, + url: stringifyPlaceholderURL(urlObj) + }; + }); + } + return { + rawOptions: resolvedOptions, + options: validatedOptions, + get src() { + return lazyImageURL(); + }, + srcSet: { + values: srcSets, + attribute: srcSets.map((srcSet) => `${srcSet.url} ${srcSet.descriptor}`).join(", ") + }, + attributes: service.getHTMLAttributes !== void 0 ? await service.getHTMLAttributes(validatedOptions, imageConfig) : {} + }; +} +async function peekRemoteFormatForStaticEmit(options, imageConfig, service) { + if (!isRemoteImage(options.src) || !isRemoteAllowed(options.src, imageConfig) || !globalThis.astroAsset?.addStaticImage || !isLocalService(service) || !service.getRemoteSize) return; + try { + return resolveDefaultOutputFormat((await service.getRemoteSize(options.src, imageConfig)).format); + } catch { + return; + } +} +Function.prototype.toString.call(Object); +//#endregion +//#region node_modules/astro/components/Image.astro +createAstro("https://gabeefran.co"); +var $$Image = createComponent(async ($$result, $$props, $$slots) => { + const Astro2 = $$result.createAstro($$props, $$slots); + Astro2.self = $$Image; + const props = Astro2.props; + if (props.alt === void 0 || props.alt === null) throw new AstroError(ImageMissingAlt); + if (typeof props.width === "string") props.width = Number.parseInt(props.width); + if (typeof props.height === "string") props.height = Number.parseInt(props.height); + if ((props.layout ?? imageConfig.layout ?? "none") !== "none") { + props.layout ??= imageConfig.layout; + props.fit ??= imageConfig.objectFit ?? "cover"; + props.position ??= imageConfig.objectPosition ?? "center"; + } else if (imageConfig.objectFit || imageConfig.objectPosition) { + props.fit ??= imageConfig.objectFit; + props.position ??= imageConfig.objectPosition; + } + const image = await getImage(props); + const additionalAttributes = {}; + if (image.srcSet.values.length > 0) additionalAttributes.srcset = image.srcSet.attribute; + const { class: className, ...attributes } = { + ...additionalAttributes, + ...image.attributes + }; + return renderTemplate`${maybeRenderHead($$result)}`; +}, "/home/gabe/src/gabeefran.co-blog/node_modules/astro/components/Image.astro", void 0); +//#endregion +//#region node_modules/astro/components/Picture.astro +createAstro("https://gabeefran.co"); +var $$Picture = createComponent(async ($$result, $$props, $$slots) => { + const Astro2 = $$result.createAstro($$props, $$slots); + Astro2.self = $$Picture; + const defaultFormats = ["webp"]; + const defaultFallbackFormat = "png"; + const specialFormatsFallback = [ + "gif", + "svg", + "jpg", + "jpeg" + ]; + const { formats = defaultFormats, pictureAttributes = {}, fallbackFormat, ...props } = Astro2.props; + if (props.alt === void 0 || props.alt === null) throw new AstroError(ImageMissingAlt); + const scopedStyleClass = props.class?.match(/\bastro-\w{8}\b/)?.[0]; + if (scopedStyleClass) { + if (pictureAttributes.class) pictureAttributes.class = `${pictureAttributes.class} ${scopedStyleClass}`; + else pictureAttributes.class = scopedStyleClass; + } + const useResponsive = (props.layout ?? imageConfig.layout ?? "none") !== "none"; + if (useResponsive) { + props.layout ??= imageConfig.layout; + props.fit ??= imageConfig.objectFit ?? "cover"; + props.position ??= imageConfig.objectPosition ?? "center"; + } else if (imageConfig.objectFit || imageConfig.objectPosition) { + props.fit ??= imageConfig.objectFit; + props.position ??= imageConfig.objectPosition; + } + for (const key in props) if (key.startsWith("data-astro-cid")) pictureAttributes[key] = props[key]; + const originalSrc = await resolveSrc(props.src); + if (props.inferSize && isRemoteImage(originalSrc)) { + const remoteSize = await inferRemoteSize(originalSrc); + delete props.inferSize; + props.width ??= remoteSize.width; + props.height ??= remoteSize.height; + } + const optimizedImages = await Promise.all(formats.map(async (format) => await getImage({ + ...props, + src: originalSrc, + format, + widths: props.widths, + densities: props.densities + }))); + const clonedSrc = isESMImportedImage(originalSrc) ? originalSrc.clone ?? originalSrc : originalSrc; + let resultFallbackFormat = fallbackFormat ?? defaultFallbackFormat; + if (!fallbackFormat && isESMImportedImage(clonedSrc) && specialFormatsFallback.includes(clonedSrc.format)) resultFallbackFormat = clonedSrc.format; + const fallbackImage = await getImage({ + ...props, + format: resultFallbackFormat, + widths: props.widths, + densities: props.densities + }); + const imgAdditionalAttributes = {}; + const sourceAdditionalAttributes = {}; + if (props.sizes) sourceAdditionalAttributes.sizes = props.sizes; + if (fallbackImage.srcSet.values.length > 0) imgAdditionalAttributes.srcset = fallbackImage.srcSet.attribute; + const { class: className, ...attributes } = { + ...imgAdditionalAttributes, + ...fallbackImage.attributes + }; + return renderTemplate`${maybeRenderHead($$result)}${Object.entries(optimizedImages).map(([_, image]) => { + const srcsetAttribute = props.densities || !props.densities && !props.widths && !useResponsive ? `${image.src}${image.srcSet.values.length > 0 ? ", " + image.srcSet.attribute : ""}` : image.srcSet.attribute; + return renderTemplate``; + })}`; +}, "/home/gabe/src/gabeefran.co-blog/node_modules/astro/components/Picture.astro", void 0); +//#endregion +//#region \0virtual:astro:assets/fonts/internal +var componentDataByCssVariable = /* @__PURE__ */ new Map([]); +//#endregion +//#region node_modules/astro/dist/assets/fonts/core/filter-preloads.js +function filterPreloads(data, preload) { + if (!preload) return null; + if (preload === true) return data; + return data.filter(({ weight, style, subset }) => preload.some((p) => { + if (p.weight !== void 0 && weight !== void 0 && !checkWeight(p.weight.toString(), weight)) return false; + if (p.style !== void 0 && p.style !== style) return false; + if (p.subset !== void 0 && p.subset !== subset) return false; + return true; + })); +} +function checkWeight(input, target) { + const trimmedInput = input.trim(); + if (trimmedInput.includes(" ")) return trimmedInput === target; + if (target.includes(" ")) { + const [a, b] = target.split(" "); + const parsedInput = Number.parseInt(input); + return parsedInput >= Number.parseInt(a) && parsedInput <= Number.parseInt(b); + } + return input === target; +} +//#endregion +//#region node_modules/astro/components/Font.astro +createAstro("https://gabeefran.co"); +var $$Font = createComponent(($$result, $$props, $$slots) => { + const Astro = $$result.createAstro($$props, $$slots); + Astro.self = $$Font; + const { cssVariable, preload = false } = Astro.props; + const data = componentDataByCssVariable.get(cssVariable); + if (!data) throw new AstroError({ + ...FontFamilyNotFound, + message: FontFamilyNotFound.message(cssVariable) + }); + const filteredPreloadData = filterPreloads(data.preloads, preload); + return renderTemplate`${filteredPreloadData?.map(({ url, type }) => renderTemplate``)}`; +}, "/home/gabe/src/gabeefran.co-blog/node_modules/astro/components/Font.astro", void 0); +//#endregion +//#region node_modules/astro/dist/assets/fonts/infra/ssr-runtime-font-file-url-resolver.js +var SsrRuntimeFontFileUrlResolver = class { + #urls; + constructor({ urls }) { + this.#urls = urls; + } + resolve(url, requestUrl) { + if (!this.#urls.has(url)) return null; + if (!url.startsWith("/")) return url; + if (!requestUrl) throw new AstroError(MissingGetFontFileRequestUrl); + return `${requestUrl.origin}${url}`; + } +}; +new SsrRuntimeFontFileUrlResolver({ urls: /* @__PURE__ */ new Set([]) }); +//#endregion +//#region \0astro:assets +var assetQueryParams = void 0; +var imageConfig = { + "endpoint": { "route": "/_image" }, + "service": { + "entrypoint": "astro/assets/services/sharp", + "config": {} + }, + "dangerouslyProcessSVG": false, + "domains": [], + "remotePatterns": [], + "responsiveStyles": false +}; +Object.defineProperty(imageConfig, "assetQueryParams", { + value: assetQueryParams, + enumerable: false, + configurable: true +}); +var inferRemoteSize = async (url) => { + return (await getConfiguredImageService()).getRemoteSize?.(url, imageConfig) ?? inferRemoteSize$1(url, imageConfig); +}; +var getImage = async (options) => await getImage$1(options, imageConfig); +//#endregion +//#region node_modules/astro/dist/assets/utils/etag.js +var fnv1a52 = (str) => { + const len = str.length; + let i = 0, t0 = 0, v0 = 8997, t1 = 0, v1 = 33826, t2 = 0, v2 = 40164, t3 = 0, v3 = 52210; + while (i < len) { + v0 ^= str.charCodeAt(i++); + t0 = v0 * 435; + t1 = v1 * 435; + t2 = v2 * 435; + t3 = v3 * 435; + t2 += v0 << 8; + t3 += v1 << 8; + t1 += t0 >>> 16; + v0 = t0 & 65535; + t2 += t1 >>> 16; + v1 = t1 & 65535; + v3 = t3 + (t2 >>> 16) & 65535; + v2 = t2 & 65535; + } + return (v3 & 15) * 281474976710656 + v2 * 4294967296 + v1 * 65536 + (v0 ^ v3 >> 4); +}; +var etag = (payload, weak = false) => { + return (weak ? "W/\"" : "\"") + fnv1a52(payload).toString(36) + payload.length.toString(36) + "\""; +}; +//#endregion +//#region node_modules/astro/dist/assets/endpoint/loadImage.js +async function loadImage(src, headers, imageConfig, isRemote, fetchFn) { + try { + const res = await fetchWithRedirects({ + url: src, + headers, + imageConfig, + fetchFn + }); + if (isRemote && !isRemoteAllowed(res.url, imageConfig)) return; + if (!res.ok) return; + return await res.arrayBuffer(); + } catch { + return; + } +} +//#endregion +//#region node_modules/astro/dist/assets/endpoint/generic.js +var generic_exports = /* @__PURE__ */ __exportAll({ GET: () => GET }); +var GET = async ({ request }) => { + try { + const imageService = await getConfiguredImageService(); + if (!("transform" in imageService)) throw new Error("Configured image service is not a local service"); + const url = new URL(request.url); + const transform = await imageService.parseURL(url, imageConfig); + if (!transform?.src) throw new Error("Incorrect transform returned by `parseURL`"); + let inputBuffer = void 0; + const isRemoteImage = isRemotePath(transform.src); + if (isRemoteImage && isRemoteAllowed(transform.src, imageConfig) === false) return new Response("Forbidden", { status: 403 }); + const sourceUrl = new URL(transform.src, url.origin); + if (!isRemoteImage && sourceUrl.origin !== url.origin) return new Response("Forbidden", { status: 403 }); + inputBuffer = await loadImage(sourceUrl, isRemoteImage ? new Headers() : request.headers, imageConfig, isRemoteImage); + if (!inputBuffer) return new Response("Not Found", { status: 404 }); + const { data, format } = await imageService.transform(new Uint8Array(inputBuffer), transform, imageConfig); + return new Response(data, { + status: 200, + headers: { + "Content-Type": mime.lookup(format) ?? `image/${format}`, + "Cache-Control": "public, max-age=31536000", + ETag: etag(data.toString()), + Date: (/* @__PURE__ */ new Date()).toUTCString() + } + }); + } catch (err) { + console.error("Could not process image request:", err); + return new Response("Internal Server Error", { status: 500 }); + } +}; +//#endregion +//#region \0virtual:astro:page:node_modules/astro/dist/assets/endpoint/generic@_@js +var generic___js_exports = /* @__PURE__ */ __exportAll({ page: () => page }); +var page = () => generic_exports; +//#endregion +export { resolveDefaultOutputFormat as i, baseService as n, page, parseQuality as r, generic___js_exports as t }; diff --git a/.vercel/output/_functions/chunks/jsx-runtime_DseUv9uh.mjs b/.vercel/output/_functions/chunks/jsx-runtime_DseUv9uh.mjs new file mode 100644 index 0000000..5b39b05 --- /dev/null +++ b/.vercel/output/_functions/chunks/jsx-runtime_DseUv9uh.mjs @@ -0,0 +1,2396 @@ +import { A as MissingMediaQueryDirective, F as NoMatchingImport, I as NoMatchingRenderer, M as NoClientOnlyHint, R as OnlyResponseCanBeReturned, W as ResponseSentError, Z as AstroError, o as EndpointDidNotReturnAResponse, q as UnavailableAstroGlobal } from "./errors-data_zYnyWRO_.mjs"; +import { decodeBase64, decodeHex, encodeBase64, encodeHexUpperCase } from "@oslojs/encoding"; +import * as z from "zod/v4"; +import colors from "piccolore"; +import { escape } from "html-escaper"; +import { clsx } from "clsx"; +//#region node_modules/astro/dist/core/csp/config.js +var ALGORITHMS = { + "SHA-256": "sha256-", + "SHA-384": "sha384-", + "SHA-512": "sha512-" +}; +var ALGORITHM_VALUES = Object.values(ALGORITHMS); +z.enum(Object.keys(ALGORITHMS)).optional().default("SHA-256"); +var cspHashSchema = z.custom((value) => { + if (typeof value !== "string") return false; + return ALGORITHM_VALUES.some((allowedValue) => { + return value.startsWith(allowedValue); + }); +}); +var cspKindSchema = z.enum([ + "element", + "attribute", + "default" +]); +var ATTRIBUTE_ALLOWED_RESOURCES = [ + "'none'", + "'unsafe-hashes'", + "'unsafe-inline'", + "'report-sample'" +]; +z.union([z.string(), z.object({ + resource: z.string(), + kind: cspKindSchema +})]).superRefine((value, ctx) => { + const resource = typeof value === "string" ? value : value.resource; + const kind = typeof value === "string" ? "default" : value.kind; + if (kind === "element" && resource === "'unsafe-hashes'") ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: `The source \`'unsafe-hashes'\` is not valid for \`element\` resources (it is rejected by \`script-src-elem\`/\`style-src-elem\`).`, + fatal: true + }); + else if (kind === "attribute" && !ATTRIBUTE_ALLOWED_RESOURCES.includes(resource)) ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: `The source \`${resource}\` is not valid for \`attribute\` resources. \`script-src-attr\`/\`style-src-attr\` only accept: ${ATTRIBUTE_ALLOWED_RESOURCES.join(", ")}.`, + fatal: true + }); +}); +z.union([cspHashSchema, z.object({ + hash: cspHashSchema, + kind: cspKindSchema +})]); +var ALLOWED_DIRECTIVES = [ + "base-uri", + "child-src", + "connect-src", + "default-src", + "fenced-frame-src", + "font-src", + "form-action", + "frame-ancestors", + "frame-src", + "img-src", + "manifest-src", + "media-src", + "object-src", + "referrer", + "report-to", + "report-uri", + "require-trusted-types-for", + "sandbox", + "trusted-types", + "upgrade-insecure-requests", + "worker-src" +]; +z.custom((v) => typeof v === "string").superRefine((value, ctx) => { + if (!ALLOWED_DIRECTIVES.some((allowedValue) => { + return value.startsWith(allowedValue); + })) { + if (value.startsWith("script-src") || value.startsWith("style-src")) ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: `Directives \`script-src\` and \`style-src\` (including their \`-elem\`/\`-attr\` variants) are not allowed in \`security.csp.directives\`. Please use \`security.csp.scriptDirective\` and \`security.csp.styleDirective\` instead, scoping resources/hashes to the more specific directives with the \`kind\` option (\`"element"\` or \`"attribute"\`).`, + fatal: true + }); + else ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: `Invalid directive: "${value}". Allowed directives are: ${ALLOWED_DIRECTIVES.join(", ")}`, + fatal: true + }); + } +}); +//#endregion +//#region node_modules/astro/dist/core/encryption.js +var ALGORITHM = "AES-GCM"; +async function decodeKey(encoded) { + const bytes = decodeBase64(encoded); + return crypto.subtle.importKey("raw", bytes.buffer, ALGORITHM, true, ["encrypt", "decrypt"]); +} +var encoder$1 = new TextEncoder(); +var decoder$1 = new TextDecoder(); +var IV_LENGTH = 24; +async function encryptString(key, raw, additionalData) { + const iv = crypto.getRandomValues(new Uint8Array(IV_LENGTH / 2)); + const data = encoder$1.encode(raw); + const params = { + name: ALGORITHM, + iv + }; + if (additionalData) params.additionalData = encoder$1.encode(additionalData); + const buffer = await crypto.subtle.encrypt(params, key, data); + return encodeHexUpperCase(iv) + encodeBase64(new Uint8Array(buffer)); +} +async function decryptString(key, encoded, additionalData) { + const iv = decodeHex(encoded.slice(0, IV_LENGTH)); + const dataArray = decodeBase64(encoded.slice(IV_LENGTH)); + const params = { + name: ALGORITHM, + iv + }; + if (additionalData) params.additionalData = encoder$1.encode(additionalData); + const decryptedBuffer = await crypto.subtle.decrypt(params, key, dataArray); + return decoder$1.decode(decryptedBuffer); +} +async function generateCspDigest(data, algorithm) { + const hashBuffer = await crypto.subtle.digest(algorithm, encoder$1.encode(data)); + const hash = encodeBase64(new Uint8Array(hashBuffer)); + return `${ALGORITHMS[algorithm]}${hash}`; +} +var ASTRO_GENERATOR = `Astro v7.2.10`; +var ASTRO_ERROR_HEADER = "X-Astro-Error"; +var DEFAULT_404_COMPONENT = "astro-default-404.astro"; +var REDIRECT_STATUS_CODES = [ + 301, + 302, + 303, + 307, + 308, + 300, + 304 +]; +var REROUTABLE_STATUS_CODES = [404, 500]; +var clientAddressSymbol = /* @__PURE__ */ Symbol.for("astro.clientAddress"); +var originPathnameSymbol = /* @__PURE__ */ Symbol.for("astro.originPathname"); +var fetchStateSymbol = /* @__PURE__ */ Symbol.for("astro.fetchState"); +var responseSentSymbol = /* @__PURE__ */ Symbol.for("astro.responseSent"); +//#endregion +//#region node_modules/astro/dist/runtime/server/astro-global.js +function createError(name) { + return new AstroError({ + ...UnavailableAstroGlobal, + message: UnavailableAstroGlobal.message(name) + }); +} +function createAstro(site) { + return { + get site() { + console.warn(`Astro.site inside getStaticPaths is deprecated and will be removed in a future major version of Astro. Use import.meta.env.SITE instead`); + return site ? new URL(site) : void 0; + }, + get generator() { + console.warn(`Astro.generator inside getStaticPaths is deprecated and will be removed in a future major version of Astro.`); + return ASTRO_GENERATOR; + }, + get callAction() { + throw createError("callAction"); + }, + get clientAddress() { + throw createError("clientAddress"); + }, + get cookies() { + throw createError("cookies"); + }, + get csp() { + throw createError("csp"); + }, + get currentLocale() { + throw createError("currentLocale"); + }, + get getActionResult() { + throw createError("getActionResult"); + }, + get isPrerendered() { + throw createError("isPrerendered"); + }, + get locals() { + throw createError("locals"); + }, + get originPathname() { + throw createError("originPathname"); + }, + get params() { + throw createError("params"); + }, + get preferredLocale() { + throw createError("preferredLocale"); + }, + get preferredLocaleList() { + throw createError("preferredLocaleList"); + }, + get props() { + throw createError("props"); + }, + get redirect() { + throw createError("redirect"); + }, + get request() { + throw createError("request"); + }, + get response() { + throw createError("response"); + }, + get rewrite() { + throw createError("rewrite"); + }, + get routePattern() { + throw createError("routePattern"); + }, + get self() { + throw createError("self"); + }, + get slots() { + throw createError("slots"); + }, + get url() { + throw createError("url"); + }, + get session() { + throw createError("session"); + }, + get cache() { + throw createError("cache"); + }, + get logger() { + throw createError("logger"); + } + }; +} +//#endregion +//#region node_modules/astro/dist/runtime/server/endpoint.js +async function renderEndpoint(mod, context, isPrerendered, logger, state) { + const { request, url } = context; + const method = request.method.toUpperCase(); + let handler = mod[method] ?? mod["ALL"]; + if (!handler && method === "HEAD" && mod["GET"]) handler = mod["GET"]; + if (isPrerendered && !["GET", "HEAD"].includes(method)) logger.warn("router", `${url.pathname} ${colors.bold(method)} requests are not available in static endpoints. Mark this page as server-rendered (\`export const prerender = false;\`) or update your config to \`output: 'server'\` to make all your pages server-rendered by default.`); + if (handler === void 0) { + logger.warn("router", `No API Route handler exists for the method "${method}" for the route "${url.pathname}". +Found handlers: ${Object.keys(mod).map((exp) => JSON.stringify(exp)).join(", ")} +` + ("all" in mod ? `One of the exported handlers is "all" (lowercase), did you mean to export 'ALL'? +` : "")); + return new Response(null, { status: 404 }); + } + if (typeof handler !== "function") { + logger.error("router", `The route "${url.pathname}" exports a value for the method "${method}", but it is of the type ${typeof handler} instead of a function.`); + return new Response(null, { status: 500 }); + } + let response = await handler.call(mod, context); + if (!response || response instanceof Response === false) throw new AstroError(EndpointDidNotReturnAResponse); + if (state && REROUTABLE_STATUS_CODES.includes(response.status)) state.skipErrorReroute = true; + if (method === "HEAD") return new Response(null, response); + return response; +} +//#endregion +//#region node_modules/astro/dist/runtime/server/util.js +function isPromise(value) { + return !!value && typeof value === "object" && "then" in value && typeof value.then === "function"; +} +async function* streamAsyncIterator(stream) { + const reader = stream.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) return; + yield value; + } + } finally { + reader.releaseLock(); + } +} +//#endregion +//#region node_modules/astro/dist/runtime/server/escape.js +var escapeHTML = escape; +function stringifyForScript(value) { + return JSON.stringify(value)?.replace(/ { + if (isHTMLString(value)) return value; + if (typeof value === "string") return new HTMLString(value); + return value; +}; +function isHTMLString(value) { + return !!value?.[htmlStringSymbol]; +} +function markHTMLBytes(bytes) { + return new HTMLBytes(bytes); +} +function hasGetReader(obj) { + return typeof obj.getReader === "function"; +} +async function* unescapeChunksAsync(iterable) { + if (hasGetReader(iterable)) for await (const chunk of streamAsyncIterator(iterable)) yield unescapeHTML(chunk); + else for await (const chunk of iterable) yield unescapeHTML(chunk); +} +function* unescapeChunks(iterable) { + for (const chunk of iterable) yield unescapeHTML(chunk); +} +function unescapeHTML(str) { + if (!!str && typeof str === "object") { + if (str instanceof Uint8Array) return markHTMLBytes(str); + else if (str instanceof Response && str.body) { + const body = str.body; + return unescapeChunksAsync(body); + } else if (typeof str.then === "function") return Promise.resolve(str).then((value) => { + return unescapeHTML(value); + }); + else if (str[/* @__PURE__ */ Symbol.for("astro:slot-string")]) return str; + else if (Symbol.iterator in str) return unescapeChunks(str); + else if (Symbol.asyncIterator in str || hasGetReader(str)) return unescapeChunksAsync(str); + } + return markHTMLString(str); +} +//#endregion +//#region node_modules/astro/dist/core/head-propagation/resolver.js +function isPropagatingHint(hint) { + return hint === "self" || hint === "in-tree"; +} +//#endregion +//#region node_modules/astro/dist/runtime/server/render/astro/factory.js +function isAstroComponentFactory(obj) { + return obj == null ? false : obj.isAstroComponentFactory === true; +} +//#endregion +//#region node_modules/astro/dist/runtime/server/serialize.js +var PROP_TYPE = { + Value: 0, + JSON: 1, + RegExp: 2, + Date: 3, + Map: 4, + Set: 5, + BigInt: 6, + URL: 7, + Uint8Array: 8, + Uint16Array: 9, + Uint32Array: 10, + Infinity: 11 +}; +function serializeArray(value, metadata = {}, parents = /* @__PURE__ */ new WeakSet()) { + if (parents.has(value)) throw new Error(`Cyclic reference detected while serializing props for <${metadata.displayName} client:${metadata.hydrate}>! + +Cyclic references cannot be safely serialized for client-side usage. Please remove the cyclic reference.`); + parents.add(value); + const serialized = value.map((v) => { + return convertToSerializedForm(v, metadata, parents); + }); + parents.delete(value); + return serialized; +} +function serializeObject(value, metadata = {}, parents = /* @__PURE__ */ new WeakSet()) { + if (parents.has(value)) throw new Error(`Cyclic reference detected while serializing props for <${metadata.displayName} client:${metadata.hydrate}>! + +Cyclic references cannot be safely serialized for client-side usage. Please remove the cyclic reference.`); + parents.add(value); + const serialized = Object.fromEntries(Object.entries(value).map(([k, v]) => { + return [k, convertToSerializedForm(v, metadata, parents)]; + })); + parents.delete(value); + return serialized; +} +function convertToSerializedForm(value, metadata = {}, parents = /* @__PURE__ */ new WeakSet()) { + switch (Object.prototype.toString.call(value)) { + case "[object Date]": return [PROP_TYPE.Date, value.toISOString()]; + case "[object RegExp]": return [PROP_TYPE.RegExp, value.source]; + case "[object Map]": return [PROP_TYPE.Map, serializeArray(Array.from(value), metadata, parents)]; + case "[object Set]": return [PROP_TYPE.Set, serializeArray(Array.from(value), metadata, parents)]; + case "[object BigInt]": return [PROP_TYPE.BigInt, value.toString()]; + case "[object URL]": return [PROP_TYPE.URL, value.toString()]; + case "[object Array]": return [PROP_TYPE.JSON, serializeArray(value, metadata, parents)]; + case "[object Uint8Array]": return [PROP_TYPE.Uint8Array, Array.from(value)]; + case "[object Uint16Array]": return [PROP_TYPE.Uint16Array, Array.from(value)]; + case "[object Uint32Array]": return [PROP_TYPE.Uint32Array, Array.from(value)]; + default: + if (value !== null && typeof value === "object") return [PROP_TYPE.Value, serializeObject(value, metadata, parents)]; + if (value === Number.POSITIVE_INFINITY) return [PROP_TYPE.Infinity, 1]; + if (value === Number.NEGATIVE_INFINITY) return [PROP_TYPE.Infinity, -1]; + if (value === void 0) return [PROP_TYPE.Value]; + return [PROP_TYPE.Value, value]; + } +} +function serializeProps(props, metadata) { + return JSON.stringify(serializeObject(props, metadata)); +} +//#endregion +//#region node_modules/astro/dist/runtime/server/hydration.js +var transitionDirectivesToCopyOnIsland = Object.freeze([ + "data-astro-transition-scope", + "data-astro-transition-persist", + "data-astro-transition-persist-props" +]); +function extractDirectives(inputProps, clientDirectives) { + let extracted = { + isPage: false, + hydration: null, + props: {}, + propsWithoutTransitionAttributes: {} + }; + for (const [key, value] of Object.entries(inputProps)) { + if (key.startsWith("server:")) { + if (key === "server:root") extracted.isPage = true; + } + if (key.startsWith("client:")) { + if (!extracted.hydration) extracted.hydration = { + directive: "", + value: "", + componentUrl: "", + componentExport: { value: "" } + }; + switch (key) { + case "client:component-path": + extracted.hydration.componentUrl = value; + break; + case "client:component-export": + extracted.hydration.componentExport.value = value; + break; + case "client:component-hydration": break; + case "client:display-name": break; + default: + extracted.hydration.directive = key.split(":")[1]; + extracted.hydration.value = value; + if (!clientDirectives.has(extracted.hydration.directive)) { + const hydrationMethods = Array.from(clientDirectives.keys()).map((d) => `client:${d}`).join(", "); + throw new Error(`Error: invalid hydration directive "${key}". Supported hydration methods: ${hydrationMethods}`); + } + if (extracted.hydration.directive === "media" && typeof extracted.hydration.value !== "string") throw new AstroError(MissingMediaQueryDirective); + } + } else { + extracted.props[key] = value; + if (!transitionDirectivesToCopyOnIsland.includes(key)) extracted.propsWithoutTransitionAttributes[key] = value; + } + } + for (const sym of Object.getOwnPropertySymbols(inputProps)) { + extracted.props[sym] = inputProps[sym]; + extracted.propsWithoutTransitionAttributes[sym] = inputProps[sym]; + } + return extracted; +} +async function generateHydrateScript(scriptOptions, metadata) { + const { renderer, result, astroId, props, attrs } = scriptOptions; + const { hydrate, componentUrl, componentExport } = metadata; + if (!componentExport.value) throw new AstroError({ + ...NoMatchingImport, + message: NoMatchingImport.message(metadata.displayName) + }); + const island = { + children: "", + props: { uid: astroId } + }; + if (attrs) for (const [key, value] of Object.entries(attrs)) island.props[key] = escapeHTML(value); + island.props["component-url"] = await result.resolve(decodeURI(componentUrl)); + if (renderer.clientEntrypoint) { + island.props["component-export"] = componentExport.value; + island.props["renderer-url"] = await result.resolve(decodeURI(renderer.clientEntrypoint.toString())); + island.props["props"] = escapeHTML(serializeProps(props, metadata)); + } + island.props["ssr"] = ""; + island.props["client"] = hydrate; + let beforeHydrationUrl = await result.resolve("astro:scripts/before-hydration.js"); + if (beforeHydrationUrl.length) island.props["before-hydration-url"] = beforeHydrationUrl; + island.props["opts"] = escapeHTML(JSON.stringify({ + name: metadata.displayName, + value: metadata.hydrateArgs || "" + })); + transitionDirectivesToCopyOnIsland.forEach((name) => { + if (typeof props[name] !== "undefined") island.props[name] = escapeHTML(String(props[name])); + }); + return island; +} +//#endregion +//#region node_modules/astro/dist/runtime/server/shorthash.js +/** +* shortdash - https://github.com/bibig/node-shorthash +* +* @license +* +* (The MIT License) +* +* Copyright (c) 2013 Bibig +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +*/ +var dictionary = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY"; +var binary = 61; +function bitwise(str) { + let hash = 0; + if (str.length === 0) return hash; + for (let i = 0; i < str.length; i++) { + const ch = str.charCodeAt(i); + hash = (hash << 5) - hash + ch; + hash = hash & hash; + } + return hash; +} +function shorthash(text) { + let num; + let result = ""; + let integer = bitwise(text); + const sign = integer < 0 ? "Z" : ""; + integer = Math.abs(integer); + while (integer >= binary) { + num = integer % binary; + integer = Math.floor(integer / binary); + result = dictionary[num] + result; + } + if (integer > 0) result = dictionary[integer] + result; + return sign + result; +} +//#endregion +//#region node_modules/astro/dist/runtime/server/render/astro/head-and-content.js +var headAndContentSym = /* @__PURE__ */ Symbol.for("astro.headAndContent"); +function isHeadAndContent(obj) { + return typeof obj === "object" && obj !== null && !!obj[headAndContentSym]; +} +function createThinHead() { + return { [headAndContentSym]: true }; +} +//#endregion +//#region node_modules/astro/dist/runtime/server/astro-island.prebuilt.js +var astro_island_prebuilt_default = `(()=>{var g=Object.defineProperty;var w=(a,s,c)=>s in a?g(a,s,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[s]=c;var l=(a,s,c)=>w(a,typeof s!="symbol"?s+"":s,c);var E=new Set(["__proto__","constructor","prototype"]);{let a={0:t=>y(t),1:t=>c(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(c(t)),5:t=>new Set(c(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>Number.POSITIVE_INFINITY*t},s=t=>{let[p,e]=t;return p in a?a[p](e):void 0},c=t=>t.map(s),y=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([p,e])=>[p,s(e)]));class f extends HTMLElement{constructor(){super(...arguments);l(this,"Component");l(this,"hydrator");l(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let r=this.querySelectorAll("astro-slot"),n={},d=this.querySelectorAll("template[data-astro-template]");for(let o of d){let i=o.closest(this.tagName);i!=null&&i.isSameNode(this)&&(n[o.getAttribute("data-astro-template")||"default"]=o.innerHTML,o.remove())}for(let o of r){let i=o.closest(this.tagName);i!=null&&i.isSameNode(this)&&(n[o.getAttribute("name")||"default"]=o.innerHTML)}let u;try{u=this.hasAttribute("props")?y(JSON.parse(this.getAttribute("props"))):{}}catch(o){let i=this.getAttribute("component-url")||"",v=this.getAttribute("component-export");throw v&&(i+=\` (export \${v})\`),console.error(\`[hydrate] Error parsing props for component \${i}\`,this.getAttribute("props"),o),o}let h;await this.hydrator(this)(this.Component,u,n,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});l(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),r.disconnect(),this.childrenConnectedCallback()},r=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});r.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}getRetryImportUrl(e){let r=new URL(e,document.baseURI);return r.searchParams.set("astro-retry",Date.now().toString()),r.toString()}async importWithRetry(e){try{return await import(e)}catch(r){return await new Promise(n=>setTimeout(n,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let r=this.getAttribute("component-url"),n=new CustomEvent("astro:hydration-error",{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:r}});this.dispatchEvent(n)&&console.error(\`[astro-island] Error hydrating \${r}\`,e)}async start(){let e=JSON.parse(this.getAttribute("opts")),r=this.getAttribute("client");if(Astro[r]===void 0){window.addEventListener(\`astro:\${r}\`,()=>this.start(),{once:!0});return}try{await Astro[r](async()=>{let n=this.getAttribute("renderer-url");try{let[d,{default:u}]=await Promise.all([this.importWithRetry(this.getAttribute("component-url")),n?this.importWithRetry(n):Promise.resolve({default:()=>()=>{}})]),h=this.getAttribute("component-export")||"default";if(h.includes(".")){this.Component=d;for(let m of h.split(".")){if(E.has(m)||!this.Component||typeof this.Component!="object"&&typeof this.Component!="function"||!Object.hasOwn(this.Component,m))throw new Error(\`Invalid component export path: \${h}\`);this.Component=this.Component[m]}}else{if(E.has(h))throw new Error(\`Invalid component export path: \${h}\`);this.Component=d[h]}return this.hydrator=u,this.hydrate}catch(d){return this.handleHydrationError(d),()=>{}}},e,this)}catch(n){this.handleHydrationError(n)}}attributeChangedCallback(){this.hydrate()}}l(f,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",f)}})();`; +//#endregion +//#region node_modules/astro/dist/runtime/server/astro-island.prebuilt-dev.js +var astro_island_prebuilt_dev_default = `(()=>{var g=Object.defineProperty;var w=(c,s,d)=>s in c?g(c,s,{enumerable:!0,configurable:!0,writable:!0,value:d}):c[s]=d;var l=(c,s,d)=>w(c,typeof s!="symbol"?s+"":s,d);var E=new Set(["__proto__","constructor","prototype"]);{let c={0:t=>y(t),1:t=>d(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(d(t)),5:t=>new Set(d(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>Number.POSITIVE_INFINITY*t},s=t=>{let[p,e]=t;return p in c?c[p](e):void 0},d=t=>t.map(s),y=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([p,e])=>[p,s(e)]));class f extends HTMLElement{constructor(){super(...arguments);l(this,"Component");l(this,"hydrator");l(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let r=this.querySelectorAll("astro-slot"),n={},h=this.querySelectorAll("template[data-astro-template]");for(let o of h){let a=o.closest(this.tagName);a!=null&&a.isSameNode(this)&&(n[o.getAttribute("data-astro-template")||"default"]=o.innerHTML,o.remove())}for(let o of r){let a=o.closest(this.tagName);a!=null&&a.isSameNode(this)&&(n[o.getAttribute("name")||"default"]=o.innerHTML)}let m;try{m=this.hasAttribute("props")?y(JSON.parse(this.getAttribute("props"))):{}}catch(o){let a=this.getAttribute("component-url")||"",v=this.getAttribute("component-export");throw v&&(a+=\` (export \${v})\`),console.error(\`[hydrate] Error parsing props for component \${a}\`,this.getAttribute("props"),o),o}let i,u=this.hydrator(this);i=performance.now(),await u(this.Component,m,n,{client:this.getAttribute("client")}),i&&this.setAttribute("client-render-time",(performance.now()-i).toString()),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});l(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),r.disconnect(),this.childrenConnectedCallback()},r=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});r.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}getRetryImportUrl(e){let r=new URL(e,document.baseURI);return r.searchParams.set("astro-retry",Date.now().toString()),r.toString()}async importWithRetry(e){try{return await import(e)}catch(r){return await new Promise(n=>setTimeout(n,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let r=this.getAttribute("component-url"),n=new CustomEvent("astro:hydration-error",{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:r}});this.dispatchEvent(n)&&console.error(\`[astro-island] Error hydrating \${r}\`,e)}async start(){let e=JSON.parse(this.getAttribute("opts")),r=this.getAttribute("client");if(Astro[r]===void 0){window.addEventListener(\`astro:\${r}\`,()=>this.start(),{once:!0});return}try{await Astro[r](async()=>{let n=this.getAttribute("renderer-url");try{let[h,{default:m}]=await Promise.all([this.importWithRetry(this.getAttribute("component-url")),n?this.importWithRetry(n):Promise.resolve({default:()=>()=>{}})]),i=this.getAttribute("component-export")||"default";if(i.includes(".")){this.Component=h;for(let u of i.split(".")){if(E.has(u)||!this.Component||typeof this.Component!="object"&&typeof this.Component!="function"||!Object.hasOwn(this.Component,u))throw new Error(\`Invalid component export path: \${i}\`);this.Component=this.Component[u]}}else{if(E.has(i))throw new Error(\`Invalid component export path: \${i}\`);this.Component=h[i]}return this.hydrator=m,this.hydrate}catch(h){return this.handleHydrationError(h),()=>{}}},e,this)}catch(n){this.handleHydrationError(n)}}attributeChangedCallback(){this.hydrate()}}l(f,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",f)}})();`; +//#endregion +//#region node_modules/astro/dist/runtime/server/astro-island-styles.js +var ISLAND_STYLES = "astro-island,astro-slot,astro-static-slot{display:contents}"; +//#endregion +//#region node_modules/astro/dist/runtime/server/scripts.js +function determineIfNeedsHydrationScript(result) { + if (result._metadata.templateDepth > 0) return !result._metadata.hasHydrationScript; + if (result._metadata.hasHydrationScript) return false; + return result._metadata.hasHydrationScript = true; +} +function determinesIfNeedsDirectiveScript(result, directive) { + if (result._metadata.templateDepth > 0) return !result._metadata.hasDirectives.has(directive); + if (result._metadata.hasDirectives.has(directive)) return false; + result._metadata.hasDirectives.add(directive); + return true; +} +function getDirectiveScriptText(result, directive) { + const clientDirective = result.clientDirectives.get(directive); + if (!clientDirective) throw new Error(`Unknown directive: ${directive}`); + return clientDirective; +} +function getPrescripts(result, type, directive) { + switch (type) { + case "both": return `gabeefrancoSwitch language: PortuguêsToggle color themeHomePostsAboutSwitch language: PortuguêsToggle color themeHomePostsAbout404Page not foundThere’s nothing here. Let’s get you back home.Back to homePágina não encontradaNão há nada aqui. Vamos te levar de volta para o início.Voltar para o início
404
There’s nothing here. Let’s get you back home.
Não há nada aqui. Vamos te levar de volta para o início.