@farm.js/core 0.1.0-beta.22 → 0.1.0-beta.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/agent-runtime.d.mts +2 -1
  2. package/dist/agent-runtime.d.ts +2 -1
  3. package/dist/{app-DwsTpyNZ.d.mts → app-DrFCUMHY.d.mts} +6 -3
  4. package/dist/app-markdown.d.mts +2 -1
  5. package/dist/app-markdown.d.ts +2 -1
  6. package/dist/{app-BB8GCH1g.d.ts → app-pwvKG2B1.d.ts} +6 -3
  7. package/dist/chunk-4IVNW5QD.mjs +82 -0
  8. package/dist/chunk-4IVNW5QD.mjs.map +1 -0
  9. package/dist/chunk-D42BNPZH.mjs +79 -0
  10. package/dist/chunk-D42BNPZH.mjs.map +1 -0
  11. package/dist/{chunk-LLPN5SEZ.mjs → chunk-DVPRBMU2.mjs} +2 -2
  12. package/dist/chunk-GQVQESLY.mjs +25 -0
  13. package/dist/chunk-GQVQESLY.mjs.map +1 -0
  14. package/dist/chunk-H53KVQUU.mjs +48 -0
  15. package/dist/chunk-H53KVQUU.mjs.map +1 -0
  16. package/dist/chunk-HCGQYYHI.mjs +1 -0
  17. package/dist/chunk-HCGQYYHI.mjs.map +1 -0
  18. package/dist/{chunk-XBKXKJX5.mjs → chunk-HVJHNKSP.mjs} +220 -63
  19. package/dist/chunk-HVJHNKSP.mjs.map +1 -0
  20. package/dist/{chunk-ZP73P4VR.mjs → chunk-HXE4VGH2.mjs} +79 -20
  21. package/dist/chunk-HXE4VGH2.mjs.map +1 -0
  22. package/dist/{chunk-UCYWGN2P.mjs → chunk-OHNSROHS.mjs} +1 -1
  23. package/dist/{chunk-FRPWCMMG.mjs → chunk-SBWOTAX4.mjs} +63 -2
  24. package/dist/chunk-SBWOTAX4.mjs.map +1 -0
  25. package/dist/{chunk-DAUR3WUZ.mjs → chunk-WO466YX5.mjs} +2 -2
  26. package/dist/chunk-WO466YX5.mjs.map +1 -0
  27. package/dist/{chunk-CEVMYGDL.mjs → chunk-YD5IRKVS.mjs} +13 -9
  28. package/dist/chunk-YD5IRKVS.mjs.map +1 -0
  29. package/dist/{client-plugins-QQntVkrv.d.mts → client-plugins-CCilIb_G.d.mts} +6 -2
  30. package/dist/{client-plugins-CbRum1fj.d.ts → client-plugins-DuuleQKk.d.ts} +6 -2
  31. package/dist/client-plugins.d.mts +2 -1
  32. package/dist/client-plugins.d.ts +2 -1
  33. package/dist/client.cjs +122 -35
  34. package/dist/client.cjs.map +1 -1
  35. package/dist/client.d.mts +2 -0
  36. package/dist/client.d.ts +2 -0
  37. package/dist/client.mjs +13 -2
  38. package/dist/config.d.mts +2 -1
  39. package/dist/config.d.ts +2 -1
  40. package/dist/{devtools-52FYXIEK.mjs → devtools-326RBQCN.mjs} +7 -6
  41. package/dist/{devtools-52FYXIEK.mjs.map → devtools-326RBQCN.mjs.map} +1 -1
  42. package/dist/docs.cjs.map +1 -1
  43. package/dist/docs.mjs +6 -5
  44. package/dist/index.cjs +910 -414
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.mts +10 -7
  47. package/dist/index.d.ts +10 -7
  48. package/dist/index.mjs +66 -49
  49. package/dist/index.mjs.map +1 -1
  50. package/dist/integrations.d.mts +2 -1
  51. package/dist/integrations.d.ts +2 -1
  52. package/dist/internal/build-runtime.cjs +720 -297
  53. package/dist/internal/build-runtime.cjs.map +1 -1
  54. package/dist/internal/build-runtime.d.mts +4 -3
  55. package/dist/internal/build-runtime.d.ts +4 -3
  56. package/dist/internal/build-runtime.mjs +15 -12
  57. package/dist/internal/config-runtime.cjs +41 -0
  58. package/dist/internal/config-runtime.cjs.map +1 -1
  59. package/dist/internal/config-runtime.d.mts +3 -2
  60. package/dist/internal/config-runtime.d.ts +3 -2
  61. package/dist/internal/config-runtime.mjs +5 -4
  62. package/dist/internal/production-runtime.cjs +178 -0
  63. package/dist/internal/production-runtime.cjs.map +1 -1
  64. package/dist/internal/production-runtime.d.mts +20 -6
  65. package/dist/internal/production-runtime.d.ts +20 -6
  66. package/dist/internal/production-runtime.mjs +13 -1
  67. package/dist/internal/production-runtime.mjs.map +1 -1
  68. package/dist/{metadata-B5jBJHq1.d.ts → metadata-DyPRG0wX.d.ts} +1 -1
  69. package/dist/{metadata-BxOJ4FJl.d.mts → metadata-_GHcAySx.d.mts} +1 -1
  70. package/dist/middleware.d.mts +4 -3
  71. package/dist/middleware.d.ts +4 -3
  72. package/dist/plugin.cjs +461 -155
  73. package/dist/plugin.cjs.map +1 -1
  74. package/dist/plugin.d.mts +2 -1
  75. package/dist/plugin.d.ts +2 -1
  76. package/dist/plugin.mjs +11 -8
  77. package/dist/{production-runtime-Bxua86uR.d.mts → production-runtime-C4cO3esK.d.mts} +1 -1
  78. package/dist/{production-runtime-CZqXjRVi.d.ts → production-runtime-DrEy8kBO.d.ts} +1 -1
  79. package/dist/{request-7V0GaZK_.d.mts → request-B2PpOxYK.d.mts} +1 -1
  80. package/dist/{request-B5XYBv5a.d.ts → request-D40lt6aN.d.ts} +1 -1
  81. package/dist/request.d.mts +3 -2
  82. package/dist/request.d.ts +3 -2
  83. package/dist/routes.d.mts +2 -1
  84. package/dist/routes.d.ts +2 -1
  85. package/dist/server-plugins.d.mts +3 -2
  86. package/dist/server-plugins.d.ts +3 -2
  87. package/dist/server.cjs +490 -167
  88. package/dist/server.cjs.map +1 -1
  89. package/dist/server.d.mts +8 -6
  90. package/dist/server.d.ts +8 -6
  91. package/dist/server.mjs +20 -11
  92. package/dist/server.mjs.map +1 -1
  93. package/dist/testing.d.mts +2 -1
  94. package/dist/testing.d.ts +2 -1
  95. package/dist/theme/client.cjs +115 -0
  96. package/dist/theme/client.cjs.map +1 -0
  97. package/dist/theme/client.d.mts +17 -0
  98. package/dist/theme/client.d.ts +17 -0
  99. package/dist/theme/client.mjs +16 -0
  100. package/dist/theme/client.mjs.map +1 -0
  101. package/dist/theme/index.cjs +71 -0
  102. package/dist/theme/index.cjs.map +1 -0
  103. package/dist/theme/index.d.mts +6 -0
  104. package/dist/theme/index.d.ts +6 -0
  105. package/dist/theme/index.mjs +9 -0
  106. package/dist/theme/index.mjs.map +1 -0
  107. package/dist/theme/server.cjs +191 -0
  108. package/dist/theme/server.cjs.map +1 -0
  109. package/dist/theme/server.d.mts +8 -0
  110. package/dist/theme/server.d.ts +8 -0
  111. package/dist/theme/server.mjs +18 -0
  112. package/dist/theme/server.mjs.map +1 -0
  113. package/dist/types-CsR8fpgF.d.mts +30 -0
  114. package/dist/types-CsR8fpgF.d.ts +30 -0
  115. package/dist/{utils-xTFxzu47.d.ts → utils-3sQgfkya.d.ts} +1 -1
  116. package/dist/{utils-s9pN0Yep.d.mts → utils-Bop7bly-.d.mts} +1 -1
  117. package/dist/version.cjs +1 -1
  118. package/dist/version.cjs.map +1 -1
  119. package/dist/version.mjs +1 -1
  120. package/dist/vite.cjs +485 -157
  121. package/dist/vite.cjs.map +1 -1
  122. package/dist/vite.d.mts +2 -1
  123. package/dist/vite.d.ts +2 -1
  124. package/dist/vite.mjs +11 -8
  125. package/package.json +25 -1
  126. package/dist/chunk-CEVMYGDL.mjs.map +0 -1
  127. package/dist/chunk-DAUR3WUZ.mjs.map +0 -1
  128. package/dist/chunk-FRPWCMMG.mjs.map +0 -1
  129. package/dist/chunk-XBKXKJX5.mjs.map +0 -1
  130. package/dist/chunk-ZP73P4VR.mjs.map +0 -1
  131. /package/dist/{chunk-LLPN5SEZ.mjs.map → chunk-DVPRBMU2.mjs.map} +0 -0
  132. /package/dist/{chunk-UCYWGN2P.mjs.map → chunk-OHNSROHS.mjs.map} +0 -0
@@ -869,4 +869,4 @@ export {
869
869
  createStore,
870
870
  Link
871
871
  };
872
- //# sourceMappingURL=chunk-UCYWGN2P.mjs.map
872
+ //# sourceMappingURL=chunk-OHNSROHS.mjs.map
@@ -1,3 +1,6 @@
1
+ import {
2
+ resolveFarmThemeConfig
3
+ } from "./chunk-H53KVQUU.mjs";
1
4
  import {
2
5
  __name
3
6
  } from "./chunk-CGILA3WO.mjs";
@@ -291,9 +294,67 @@ function escapeAttribute(value) {
291
294
  }
292
295
  __name(escapeAttribute, "escapeAttribute");
293
296
 
297
+ // src/theme/server-runtime.ts
298
+ var THEME_SCRIPT_ID = "farm-theme-script";
299
+ var THEME_STYLE_ID = "farm-theme-style";
300
+ function createFarmThemeDocumentParts(input, basePath = "/", serverTheme) {
301
+ const config = resolveFarmThemeConfig(input, basePath);
302
+ if (!config.enabled) return { attributes: "", head: "" };
303
+ const hydrationTheme = serverTheme ?? config.default;
304
+ const initialTheme = hydrationTheme === "system" ? "light" : hydrationTheme;
305
+ const script = createFarmThemeBootstrapScript(config, hydrationTheme);
306
+ return {
307
+ attributes: ` data-theme="${initialTheme}"`,
308
+ head: `<style id="${THEME_STYLE_ID}">:root[data-theme="light"]{color-scheme:light}:root[data-theme="dark"]{color-scheme:dark}</style><script id="${THEME_SCRIPT_ID}">${script}</script>`
309
+ };
310
+ }
311
+ __name(createFarmThemeDocumentParts, "createFarmThemeDocumentParts");
312
+ function createFarmThemeBootstrapScript(config, serverTheme = config.default) {
313
+ return `(function(config,serverTheme){
314
+ var isTheme=function(value){return value==="light"||value==="dark"||value==="system";};
315
+ var decode=function(value){try{return decodeURIComponent(value);}catch(_error){return value;}};
316
+ var readCookie=function(){var entries=document.cookie.split(";");for(var index=0;index<entries.length;index++){var entry=entries[index];var separator=entry.indexOf("=");if(separator<0)continue;if(decode(entry.slice(0,separator).trim())===config.storageKey)return decode(entry.slice(separator+1).trim());}};
317
+ var media=window.matchMedia("(prefers-color-scheme: dark)");
318
+ var resolveTheme=function(theme){return theme==="system"?(media.matches?"dark":"light"):theme;};
319
+ var storedTheme=readCookie();
320
+ var preference=isTheme(storedTheme)?storedTheme:config.default;
321
+ var serverSnapshot={theme:serverTheme,resolvedTheme:serverTheme==="system"?undefined:serverTheme,mounted:false};
322
+ var apply=function(){var resolvedTheme=resolveTheme(preference);document.documentElement.dataset.theme=resolvedTheme;var snapshot={theme:preference,resolvedTheme:resolvedTheme,mounted:true};if(window.__FARM_THEME__)window.__FARM_THEME__.snapshot=snapshot;return snapshot;};
323
+ var emit=function(){var snapshot=apply();window.dispatchEvent(new CustomEvent("farm:themechange",{detail:snapshot}));};
324
+ var persist=function(theme){var secure=window.location.protocol==="https:"?"; Secure":"";document.cookie=encodeURIComponent(config.storageKey)+"="+encodeURIComponent(theme)+"; Path="+config.cookiePath+"; Max-Age=31536000; SameSite=Lax"+secure;try{localStorage.setItem(config.storageKey,theme);}catch(_error){}};
325
+ var setTheme=function(theme){if(!isTheme(theme))throw new TypeError("Unknown FARMJS theme: "+String(theme));preference=theme;persist(theme);emit();};
326
+ var initialSnapshot={theme:preference,resolvedTheme:resolveTheme(preference),mounted:true};
327
+ window.__FARM_THEME__={config:config,serverSnapshot:serverSnapshot,snapshot:initialSnapshot,setTheme:setTheme};
328
+ document.documentElement.dataset.theme=initialSnapshot.resolvedTheme;
329
+ var handleSystemChange=function(){if(preference==="system")emit();};
330
+ if(typeof media.addEventListener==="function")media.addEventListener("change",handleSystemChange);else if(typeof media.addListener==="function")media.addListener(handleSystemChange);
331
+ window.addEventListener("storage",function(event){if(event.key!==config.storageKey||!isTheme(event.newValue))return;preference=event.newValue;persist(preference);emit();});
332
+ })(${serializeInlineValue(config)},${serializeInlineValue(serverTheme)});`;
333
+ }
334
+ __name(createFarmThemeBootstrapScript, "createFarmThemeBootstrapScript");
335
+ function applyFarmThemeDocument(html, input, basePath = "/", serverTheme) {
336
+ const parts = createFarmThemeDocumentParts(input, basePath, serverTheme);
337
+ if (!parts.head) return html;
338
+ let output = html.replace(/<html([^>]*)>/i, (_match, attributes) => {
339
+ const nextAttributes = attributes.replace(/\sdata-theme=(?:"[^"]*"|'[^']*'|[^\s>]+)/i, "");
340
+ return `<html${nextAttributes}${parts.attributes}>`;
341
+ });
342
+ if (!output.includes(`id="${THEME_SCRIPT_ID}"`)) {
343
+ output = output.replace(/<head([^>]*)>/i, `<head$1>${parts.head}`);
344
+ }
345
+ return output;
346
+ }
347
+ __name(applyFarmThemeDocument, "applyFarmThemeDocument");
348
+ function serializeInlineValue(value) {
349
+ return JSON.stringify(value).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
350
+ }
351
+ __name(serializeInlineValue, "serializeInlineValue");
352
+
294
353
  export {
295
354
  mergeMetadata,
296
355
  addMetadataImageReference,
297
- renderMetadataHead
356
+ renderMetadataHead,
357
+ createFarmThemeDocumentParts,
358
+ applyFarmThemeDocument
298
359
  };
299
- //# sourceMappingURL=chunk-FRPWCMMG.mjs.map
360
+ //# sourceMappingURL=chunk-SBWOTAX4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/metadata.ts","../src/theme/server-runtime.ts"],"sourcesContent":["import type { Metadata } from \"./types\";\n\nexport type MetadataImageKind = \"opengraph\" | \"twitter\";\n\nexport interface FarmMetadataImageReference {\n kind: MetadataImageKind;\n href: string;\n alt?: string;\n width?: number;\n height?: number;\n contentType?: string;\n}\n\nexport interface RenderedMetadataHead {\n title: string;\n tags: string;\n hasFavicon: boolean;\n}\n\ntype MetadataRecord = Metadata & Record<string, any>;\n\nexport function mergeMetadata(\n base: MetadataRecord | undefined,\n next: MetadataRecord | undefined,\n): MetadataRecord {\n if (!base) return next ? { ...next } : {};\n if (!next) return { ...base };\n\n return {\n ...base,\n ...next,\n openGraph: mergeNestedMetadata(base.openGraph, next.openGraph),\n twitter: mergeNestedMetadata(base.twitter, next.twitter),\n alternates: mergeNestedMetadata((base as any).alternates, (next as any).alternates),\n icons: mergeNestedMetadata((base as any).icons, (next as any).icons),\n };\n}\n\nexport function addMetadataImageReference(\n metadata: MetadataRecord,\n reference: FarmMetadataImageReference,\n): MetadataRecord {\n if (reference.kind === \"opengraph\") {\n const openGraph = { ...metadata.openGraph };\n if (!hasMetadataImages(openGraph.images) && !hasMetadataImages((openGraph as any).image)) {\n openGraph.images = [\n {\n url: reference.href,\n width: reference.width,\n height: reference.height,\n alt: reference.alt,\n type: reference.contentType,\n },\n ];\n }\n\n return {\n ...metadata,\n openGraph,\n };\n }\n\n const twitter = { ...metadata.twitter };\n if (!hasMetadataImages(twitter.images)) {\n twitter.images = [reference.href];\n twitter.card = twitter.card || \"summary_large_image\";\n }\n\n return {\n ...metadata,\n twitter,\n };\n}\n\nexport function renderMetadataHead(metadata: MetadataRecord | undefined): RenderedMetadataHead {\n const resolvedMetadata = metadata || {};\n const metadataBase = resolveMetadataBase(resolvedMetadata);\n const title = resolveMetadataTitle(resolvedMetadata.title) || \"Farm.js App\";\n const tags: string[] = [];\n\n appendMetaName(tags, \"description\", resolvedMetadata.description);\n appendMetaName(tags, \"keywords\", normalizeKeywords(resolvedMetadata.keywords));\n appendMetaName(tags, \"author\", (resolvedMetadata as any).author);\n\n if (Array.isArray(resolvedMetadata.authors)) {\n for (const author of resolvedMetadata.authors) {\n appendMetaName(tags, \"author\", author?.name);\n if (author?.url) {\n appendLink(tags, \"author\", resolveMetadataUrl(author.url, metadataBase));\n }\n }\n }\n\n appendMetaName(tags, \"creator\", resolvedMetadata.creator);\n appendMetaName(tags, \"publisher\", resolvedMetadata.publisher);\n appendMetaName(tags, \"robots\", normalizeRobots(resolvedMetadata.robots));\n\n const alternates = (resolvedMetadata as any).alternates;\n if (isRecord(alternates)) {\n appendLink(tags, \"canonical\", resolveMetadataUrl(alternates.canonical, metadataBase));\n\n if (isRecord(alternates.languages)) {\n for (const [language, href] of Object.entries(alternates.languages)) {\n appendLink(tags, \"alternate\", resolveMetadataUrl(href, metadataBase), {\n hreflang: language,\n });\n }\n }\n }\n\n const hasFavicon = appendIcons(tags, (resolvedMetadata as any).icons, metadataBase);\n\n if ((resolvedMetadata as any).manifest) {\n appendLink(\n tags,\n \"manifest\",\n resolveMetadataUrl((resolvedMetadata as any).manifest, metadataBase),\n );\n }\n\n appendOpenGraph(tags, resolvedMetadata.openGraph, metadataBase);\n appendTwitter(tags, resolvedMetadata.twitter, metadataBase);\n\n return {\n title: escapeText(title),\n tags: tags.length > 0 ? `\\n ${tags.join(\"\\n \")}` : \"\",\n hasFavicon,\n };\n}\n\nfunction mergeNestedMetadata(base: unknown, next: unknown): any {\n if (isRecord(base) && isRecord(next)) {\n return {\n ...base,\n ...next,\n };\n }\n\n return next ?? base;\n}\n\nfunction appendOpenGraph(tags: string[], openGraph: Metadata[\"openGraph\"], metadataBase?: string) {\n if (!isRecord(openGraph)) return;\n\n appendMetaProperty(tags, \"og:title\", openGraph.title);\n appendMetaProperty(tags, \"og:description\", openGraph.description);\n appendMetaProperty(tags, \"og:url\", resolveMetadataUrl(openGraph.url, metadataBase));\n appendMetaProperty(tags, \"og:site_name\", openGraph.siteName);\n appendMetaProperty(tags, \"og:type\", openGraph.type);\n appendMetaProperty(tags, \"og:locale\", (openGraph as any).locale);\n\n const images = normalizeMetadataImages(\n openGraph.images ?? (openGraph as any).image,\n metadataBase,\n );\n for (const image of images) {\n appendMetaProperty(tags, \"og:image\", image.url);\n appendMetaProperty(tags, \"og:image:width\", image.width);\n appendMetaProperty(tags, \"og:image:height\", image.height);\n appendMetaProperty(tags, \"og:image:alt\", image.alt);\n appendMetaProperty(tags, \"og:image:type\", image.type);\n }\n}\n\nfunction appendTwitter(tags: string[], twitter: Metadata[\"twitter\"], metadataBase?: string) {\n if (!isRecord(twitter)) return;\n\n appendMetaName(tags, \"twitter:card\", twitter.card);\n appendMetaName(tags, \"twitter:site\", twitter.site);\n appendMetaName(tags, \"twitter:creator\", twitter.creator);\n appendMetaName(tags, \"twitter:title\", twitter.title);\n appendMetaName(tags, \"twitter:description\", twitter.description);\n\n for (const image of normalizeMetadataImages(twitter.images, metadataBase)) {\n appendMetaName(tags, \"twitter:image\", image.url);\n appendMetaName(tags, \"twitter:image:alt\", image.alt);\n }\n}\n\nfunction appendIcons(tags: string[], icons: unknown, metadataBase?: string): boolean {\n if (!icons) return false;\n\n if (typeof icons === \"string\") {\n const initialTagCount = tags.length;\n appendLink(tags, \"icon\", resolveMetadataUrl(icons, metadataBase));\n return tags.length > initialTagCount;\n }\n\n if (!isRecord(icons)) return false;\n\n const initialTagCount = tags.length;\n appendIconList(tags, \"icon\", icons.icon, metadataBase);\n appendIconList(tags, \"shortcut icon\", icons.shortcut, metadataBase);\n const hasFavicon = tags.length > initialTagCount;\n appendIconList(tags, \"apple-touch-icon\", icons.apple, metadataBase);\n return hasFavicon;\n}\n\nfunction appendIconList(tags: string[], rel: string, value: unknown, metadataBase?: string) {\n for (const icon of normalizeArray(value)) {\n if (typeof icon === \"string\") {\n appendLink(tags, rel, resolveMetadataUrl(icon, metadataBase));\n continue;\n }\n\n if (!isRecord(icon)) continue;\n appendLink(tags, rel, resolveMetadataUrl(icon.url, metadataBase), {\n sizes: icon.sizes,\n type: icon.type,\n });\n }\n}\n\nfunction appendMetaName(tags: string[], name: string, content: unknown) {\n const normalized = normalizeContent(content);\n if (!normalized) return;\n tags.push(`<meta name=\"${escapeAttribute(name)}\" content=\"${escapeAttribute(normalized)}\">`);\n}\n\nfunction appendMetaProperty(tags: string[], property: string, content: unknown) {\n const normalized = normalizeContent(content);\n if (!normalized) return;\n tags.push(\n `<meta property=\"${escapeAttribute(property)}\" content=\"${escapeAttribute(normalized)}\">`,\n );\n}\n\nfunction appendLink(\n tags: string[],\n rel: string,\n href: unknown,\n attrs: Record<string, unknown> = {},\n) {\n const normalizedHref = normalizeContent(href);\n if (!normalizedHref) return;\n\n const attrText = Object.entries(attrs)\n .map(([key, value]) => {\n const normalized = normalizeContent(value);\n return normalized ? ` ${key}=\"${escapeAttribute(normalized)}\"` : \"\";\n })\n .join(\"\");\n\n tags.push(\n `<link rel=\"${escapeAttribute(rel)}\" href=\"${escapeAttribute(normalizedHref)}\"${attrText}>`,\n );\n}\n\nfunction normalizeMetadataImages(\n value: unknown,\n metadataBase?: string,\n): Array<{\n url: string;\n width?: number;\n height?: number;\n alt?: string;\n type?: string;\n}> {\n return normalizeArray(value)\n .map((item) => {\n if (typeof item === \"string\") {\n return { url: resolveMetadataUrl(item, metadataBase) || item };\n }\n\n if (!isRecord(item)) return null;\n const rawUrl = item.url || item.src;\n const url = resolveMetadataUrl(rawUrl, metadataBase);\n if (!url) return null;\n\n return {\n url,\n width: normalizeNumber(item.width),\n height: normalizeNumber(item.height),\n alt: typeof item.alt === \"string\" ? item.alt : undefined,\n type: typeof item.type === \"string\" ? item.type : undefined,\n };\n })\n .filter((item): item is NonNullable<typeof item> => item !== null);\n}\n\nfunction normalizeArray(value: unknown): unknown[] {\n if (value == null) return [];\n return Array.isArray(value) ? value : [value];\n}\n\nfunction hasMetadataImages(value: unknown): boolean {\n return normalizeMetadataImages(value).length > 0;\n}\n\nfunction resolveMetadataTitle(title: Metadata[\"title\"]): string | undefined {\n if (typeof title === \"string\") return title;\n if (isRecord(title)) {\n return normalizeContent(title.default);\n }\n return undefined;\n}\n\nfunction normalizeKeywords(keywords: Metadata[\"keywords\"]): string | undefined {\n if (Array.isArray(keywords)) return keywords.filter(Boolean).join(\", \");\n return keywords;\n}\n\nfunction normalizeRobots(robots: Metadata[\"robots\"]): string | undefined {\n if (typeof robots === \"string\") return robots;\n if (!isRecord(robots)) return undefined;\n\n const values: string[] = [];\n if (typeof robots.index === \"boolean\") values.push(robots.index ? \"index\" : \"noindex\");\n if (typeof robots.follow === \"boolean\") values.push(robots.follow ? \"follow\" : \"nofollow\");\n return values.join(\", \") || undefined;\n}\n\nfunction resolveMetadataBase(metadata: MetadataRecord): string | undefined {\n const base = metadata.metadataBase;\n if (!base) return undefined;\n return String(base);\n}\n\nfunction resolveMetadataUrl(value: unknown, metadataBase?: string): string | undefined {\n const normalized = normalizeContent(value);\n if (!normalized) return undefined;\n if (!metadataBase) return normalized;\n\n try {\n return new URL(normalized, metadataBase).toString();\n } catch {\n return normalized;\n }\n}\n\nfunction normalizeNumber(value: unknown): number | undefined {\n if (typeof value === \"number\" && Number.isFinite(value)) return value;\n if (typeof value === \"string\") {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n }\n return undefined;\n}\n\nfunction normalizeContent(value: unknown): string | undefined {\n if (value == null) return undefined;\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n if (value instanceof URL) return value.toString();\n return undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, any> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction escapeText(value: string): string {\n return value.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n}\n\nfunction escapeAttribute(value: string): string {\n return escapeText(value).replace(/\"/g, \"&quot;\");\n}\n","import { resolveFarmThemeConfig } from \"./config\";\nimport type {\n FarmThemeConfig,\n FarmThemePreference,\n FarmThemeRuntime,\n ResolvedFarmThemeConfig,\n} from \"./types\";\n\nconst THEME_SCRIPT_ID = \"farm-theme-script\";\nconst THEME_STYLE_ID = \"farm-theme-style\";\n\ndeclare global {\n interface Window {\n __FARM_THEME__?: FarmThemeRuntime;\n }\n}\n\nexport interface FarmThemeDocumentParts {\n attributes: string;\n head: string;\n}\n\nexport function createFarmThemeDocumentParts(\n input: FarmThemeConfig | ResolvedFarmThemeConfig | false | undefined,\n basePath = \"/\",\n serverTheme?: FarmThemePreference,\n): FarmThemeDocumentParts {\n const config = resolveFarmThemeConfig(input, basePath);\n if (!config.enabled) return { attributes: \"\", head: \"\" };\n\n const hydrationTheme = serverTheme ?? config.default;\n const initialTheme = hydrationTheme === \"system\" ? \"light\" : hydrationTheme;\n const script = createFarmThemeBootstrapScript(config, hydrationTheme);\n\n return {\n attributes: ` data-theme=\"${initialTheme}\"`,\n head: `<style id=\"${THEME_STYLE_ID}\">:root[data-theme=\"light\"]{color-scheme:light}:root[data-theme=\"dark\"]{color-scheme:dark}</style><script id=\"${THEME_SCRIPT_ID}\">${script}</script>`,\n };\n}\n\nexport function createFarmThemeBootstrapScript(\n config: ResolvedFarmThemeConfig,\n serverTheme: FarmThemePreference = config.default,\n): string {\n return `(function(config,serverTheme){\nvar isTheme=function(value){return value===\"light\"||value===\"dark\"||value===\"system\";};\nvar decode=function(value){try{return decodeURIComponent(value);}catch(_error){return value;}};\nvar readCookie=function(){var entries=document.cookie.split(\";\");for(var index=0;index<entries.length;index++){var entry=entries[index];var separator=entry.indexOf(\"=\");if(separator<0)continue;if(decode(entry.slice(0,separator).trim())===config.storageKey)return decode(entry.slice(separator+1).trim());}};\nvar media=window.matchMedia(\"(prefers-color-scheme: dark)\");\nvar resolveTheme=function(theme){return theme===\"system\"?(media.matches?\"dark\":\"light\"):theme;};\nvar storedTheme=readCookie();\nvar preference=isTheme(storedTheme)?storedTheme:config.default;\nvar serverSnapshot={theme:serverTheme,resolvedTheme:serverTheme===\"system\"?undefined:serverTheme,mounted:false};\nvar apply=function(){var resolvedTheme=resolveTheme(preference);document.documentElement.dataset.theme=resolvedTheme;var snapshot={theme:preference,resolvedTheme:resolvedTheme,mounted:true};if(window.__FARM_THEME__)window.__FARM_THEME__.snapshot=snapshot;return snapshot;};\nvar emit=function(){var snapshot=apply();window.dispatchEvent(new CustomEvent(\"farm:themechange\",{detail:snapshot}));};\nvar persist=function(theme){var secure=window.location.protocol===\"https:\"?\"; Secure\":\"\";document.cookie=encodeURIComponent(config.storageKey)+\"=\"+encodeURIComponent(theme)+\"; Path=\"+config.cookiePath+\"; Max-Age=31536000; SameSite=Lax\"+secure;try{localStorage.setItem(config.storageKey,theme);}catch(_error){}};\nvar setTheme=function(theme){if(!isTheme(theme))throw new TypeError(\"Unknown FARMJS theme: \"+String(theme));preference=theme;persist(theme);emit();};\nvar initialSnapshot={theme:preference,resolvedTheme:resolveTheme(preference),mounted:true};\nwindow.__FARM_THEME__={config:config,serverSnapshot:serverSnapshot,snapshot:initialSnapshot,setTheme:setTheme};\ndocument.documentElement.dataset.theme=initialSnapshot.resolvedTheme;\nvar handleSystemChange=function(){if(preference===\"system\")emit();};\nif(typeof media.addEventListener===\"function\")media.addEventListener(\"change\",handleSystemChange);else if(typeof media.addListener===\"function\")media.addListener(handleSystemChange);\nwindow.addEventListener(\"storage\",function(event){if(event.key!==config.storageKey||!isTheme(event.newValue))return;preference=event.newValue;persist(preference);emit();});\n})(${serializeInlineValue(config)},${serializeInlineValue(serverTheme)});`;\n}\n\nexport function applyFarmThemeDocument(\n html: string,\n input: FarmThemeConfig | ResolvedFarmThemeConfig | false | undefined,\n basePath = \"/\",\n serverTheme?: FarmThemePreference,\n): string {\n const parts = createFarmThemeDocumentParts(input, basePath, serverTheme);\n if (!parts.head) return html;\n\n let output = html.replace(/<html([^>]*)>/i, (_match, attributes: string) => {\n const nextAttributes = attributes.replace(/\\sdata-theme=(?:\"[^\"]*\"|'[^']*'|[^\\s>]+)/i, \"\");\n return `<html${nextAttributes}${parts.attributes}>`;\n });\n\n if (!output.includes(`id=\"${THEME_SCRIPT_ID}\"`)) {\n output = output.replace(/<head([^>]*)>/i, `<head$1>${parts.head}`);\n }\n\n return output;\n}\n\nfunction serializeInlineValue(value: unknown): string {\n return JSON.stringify(value)\n .replace(/</g, \"\\\\u003c\")\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n}\n"],"mappings":";;;;;;;;AAqBO,SAAS,cACd,MACA,MACgB;AAChB,MAAI,CAAC,KAAM,QAAO,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;AACxC,MAAI,CAAC,KAAM,QAAO,EAAE,GAAG,KAAK;AAE5B,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,WAAW,oBAAoB,KAAK,WAAW,KAAK,SAAS;AAAA,IAC7D,SAAS,oBAAoB,KAAK,SAAS,KAAK,OAAO;AAAA,IACvD,YAAY,oBAAqB,KAAa,YAAa,KAAa,UAAU;AAAA,IAClF,OAAO,oBAAqB,KAAa,OAAQ,KAAa,KAAK;AAAA,EACrE;AACF;AAfgB;AAiBT,SAAS,0BACd,UACA,WACgB;AAChB,MAAI,UAAU,SAAS,aAAa;AAClC,UAAM,YAAY,EAAE,GAAG,SAAS,UAAU;A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A,SAAO;AACT;AAnBgB;AAqBhB,SAAS,qBAAqB,OAAwB;AACpD,SAAO,KAAK,UAAU,KAAK,EACxB,QAAQ,MAAM,SAAS,EACvB,QAAQ,WAAW,SAAS,EAC5B,QAAQ,WAAW,SAAS;AACjC;AALS;","names":["initialTagCount"]}
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.1.0-beta.22";
2
+ var version = "0.1.0-beta.24";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -7,4 +7,4 @@ var FARM_VERSION = version;
7
7
  export {
8
8
  FARM_VERSION
9
9
  };
10
- //# sourceMappingURL=chunk-DAUR3WUZ.mjs.map
10
+ //# sourceMappingURL=chunk-WO466YX5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../package.json","../src/version.ts"],"sourcesContent":["{\n \"name\": \"@farm.js/core\",\n \"version\": \"0.1.0-beta.24\",\n \"description\": \"Core Farm.js framework for modern integrated apps\",\n \"keywords\": [\n \"@farm.js/core\",\n \"framework\",\n \"react\",\n \"rsc\",\n \"server-components\",\n \"ssr\",\n \"vite\"\n ],\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/farming-labs/farm.js\",\n \"directory\": \"packages/farm\"\n },\n \"files\": [\n \"dist\",\n \"types\"\n ],\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"typesVersions\": {\n \"*\": {\n \"middleware\": [\n \"./types/middleware.d.ts\",\n \"./dist/middleware.d.ts\"\n ],\n \"version\": [\n \"./dist/version.d.ts\"\n ],\n \"router\": [\n \"./dist/router.d.ts\"\n ],\n \"routes\": [\n \"./dist/routes.d.ts\"\n ],\n \"storage\": [\n \"./dist/storage.d.ts\"\n ],\n \"integrations\": [\n \"./dist/integrations.d.ts\"\n ],\n \"cache\": [\n \"./dist/cache.d.ts\"\n ],\n \"deferred\": [\n \"./dist/deferred.d.ts\"\n ],\n \"after\": [\n \"./dist/after.d.ts\"\n ],\n \"navigation\": [\n \"./dist/navigation.d.ts\"\n ],\n \"headers\": [\n \"./dist/headers.d.ts\"\n ],\n \"theme\": [\n \"./dist/theme/index.d.ts\"\n ],\n \"theme/client\": [\n \"./dist/theme/client.d.ts\"\n ],\n \"theme/server\": [\n \"./dist/theme/server.d.ts\"\n ],\n \"docs\": [\n \"./dist/docs.d.ts\"\n ],\n \"markdown\": [\n \"./dist/markdown.d.ts\"\n ],\n \"app-markdown\": [\n \"./dist/app-markdown.d.ts\"\n ],\n \"observability\": [\n \"./dist/observability.d.ts\"\n ],\n \"workflows\": [\n \"./dist/workflows.d.ts\"\n ],\n \"cron\": [\n \"./dist/cron.d.ts\"\n ],\n \"server-fn\": [\n \"./dist/server-fn.d.ts\"\n ],\n \"server-fn/client\": [\n \"./dist/server-fn-client.d.ts\"\n ],\n \"server-action-security\": [\n \"./dist/server-action-security.d.ts\"\n ],\n \"deployment\": [\n \"./dist/deployment.d.ts\"\n ],\n \"env\": [\n \"./dist/env.d.ts\"\n ],\n \"env-types\": [\n \"./dist/env-types.d.ts\"\n ],\n \"environment\": [\n \"./dist/environment.d.ts\"\n ],\n \"environment/vite\": [\n \"./dist/environment/vite.d.ts\"\n ],\n \"font\": [\n \"./dist/font.d.ts\"\n ],\n \"testing\": [\n \"./dist/testing.d.ts\"\n ],\n \"agent-runtime\": [\n \"./dist/agent-runtime.d.ts\"\n ],\n \"image\": [\n \"./types/image.d.ts\",\n \"./dist/image.d.ts\"\n ],\n \"image/server\": [\n \"./dist/image/server.d.ts\"\n ],\n \"image/sharp\": [\n \"./dist/image/sharp.d.ts\"\n ],\n \"i18n\": [\n \"./dist/i18n/index.d.ts\"\n ],\n \"i18n/server\": [\n \"./dist/i18n/server.d.ts\"\n ],\n \"i18n/client\": [\n \"./dist/i18n/client.d.ts\"\n ],\n \"internal/production-runtime\": [\n \"./dist/internal/production-runtime.d.ts\"\n ],\n \"internal/metadata-image-runtime\": [\n \"./dist/internal/metadata-image-runtime.d.ts\"\n ],\n \"internal/client-runtime\": [\n \"./dist/internal/client-runtime.d.ts\"\n ],\n \"internal/build-runtime\": [\n \"./dist/internal/build-runtime.d.ts\"\n ],\n \"internal/config-runtime\": [\n \"./dist/internal/config-runtime.d.ts\"\n ],\n \"internal/production-node-env\": [\n \"./dist/internal/production-node-env.d.ts\"\n ],\n \"config\": [\n \"./dist/config.d.ts\"\n ],\n \"api\": [\n \"./types/api.d.ts\",\n \"./dist/api.d.ts\"\n ],\n \"api/route-manager\": [\n \"./dist/api/route-manager.d.ts\"\n ],\n \"api/runtime\": [\n \"./dist/api/runtime.d.ts\"\n ],\n \"request\": [\n \"./dist/request.d.ts\"\n ],\n \"client\": [\n \"./types/client.d.ts\",\n \"./dist/client.d.ts\"\n ],\n \"server\": [\n \"./dist/server.d.ts\"\n ],\n \"vite\": [\n \"./dist/vite.d.ts\"\n ],\n \"plugin\": [\n \"./dist/plugin.d.ts\"\n ],\n \"query\": [\n \"./dist/query/index.d.ts\"\n ],\n \"*\": [\n \"./dist/*.d.ts\"\n ]\n }\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./version\": {\n \"types\": \"./dist/version.d.ts\",\n \"import\": \"./dist/version.mjs\",\n \"require\": \"./dist/version.cjs\"\n },\n \"./config\": {\n \"types\": \"./dist/config.d.ts\",\n \"import\": \"./dist/config.mjs\",\n \"require\": \"./dist/config.cjs\"\n },\n \"./server\": {\n \"types\": \"./dist/server.d.ts\",\n \"import\": \"./dist/server.mjs\",\n \"require\": \"./dist/server.cjs\"\n },\n \"./client\": {\n \"types\": \"./types/client.d.ts\",\n \"import\": \"./dist/client.mjs\",\n \"require\": \"./dist/client.cjs\"\n },\n \"./storage\": {\n \"types\": \"./dist/storage.d.ts\",\n \"import\": \"./dist/storage.mjs\",\n \"require\": \"./dist/storage.cjs\"\n },\n \"./integrations\": {\n \"types\": \"./dist/integrations.d.ts\",\n \"import\": \"./dist/integrations.mjs\",\n \"require\": \"./dist/integrations.cjs\"\n },\n \"./cache\": {\n \"types\": \"./dist/cache.d.ts\",\n \"import\": \"./dist/cache.mjs\",\n \"require\": \"./dist/cache.cjs\"\n },\n \"./deferred\": {\n \"types\": \"./dist/deferred.d.ts\",\n \"import\": \"./dist/deferred.mjs\",\n \"require\": \"./dist/deferred.cjs\"\n },\n \"./after\": {\n \"types\": \"./dist/after.d.ts\",\n \"import\": \"./dist/after.mjs\",\n \"require\": \"./dist/after.cjs\"\n },\n \"./navigation\": {\n \"types\": \"./dist/navigation.d.ts\",\n \"import\": \"./dist/navigation.mjs\",\n \"require\": \"./dist/navigation.cjs\"\n },\n \"./headers\": {\n \"types\": \"./dist/headers.d.ts\",\n \"import\": \"./dist/headers.mjs\",\n \"require\": \"./dist/headers.cjs\"\n },\n \"./theme\": {\n \"types\": \"./dist/theme/index.d.ts\",\n \"import\": \"./dist/theme/index.mjs\",\n \"require\": \"./dist/theme/index.cjs\"\n },\n \"./theme/client\": {\n \"types\": \"./dist/theme/client.d.ts\",\n \"import\": \"./dist/theme/client.mjs\",\n \"require\": \"./dist/theme/client.cjs\"\n },\n \"./theme/server\": {\n \"types\": \"./dist/theme/server.d.ts\",\n \"import\": \"./dist/theme/server.mjs\",\n \"require\": \"./dist/theme/server.cjs\"\n },\n \"./docs\": {\n \"types\": \"./dist/docs.d.ts\",\n \"import\": \"./dist/docs.mjs\",\n \"require\": \"./dist/docs.cjs\"\n },\n \"./markdown\": {\n \"types\": \"./dist/markdown.d.ts\",\n \"import\": \"./dist/markdown.mjs\",\n \"require\": \"./dist/markdown.cjs\"\n },\n \"./app-markdown\": {\n \"types\": \"./dist/app-markdown.d.ts\",\n \"import\": \"./dist/app-markdown.mjs\",\n \"require\": \"./dist/app-markdown.cjs\"\n },\n \"./observability\": {\n \"types\": \"./dist/observability.d.ts\",\n \"import\": \"./dist/observability.mjs\",\n \"require\": \"./dist/observability.cjs\"\n },\n \"./workflows\": {\n \"types\": \"./dist/workflows.d.ts\",\n \"import\": \"./dist/workflows.mjs\",\n \"require\": \"./dist/workflows.cjs\"\n },\n \"./cron\": {\n \"types\": \"./dist/cron.d.ts\",\n \"import\": \"./dist/cron.mjs\",\n \"require\": \"./dist/cron.cjs\"\n },\n \"./server-fn\": {\n \"types\": \"./dist/server-fn.d.ts\",\n \"import\": \"./dist/server-fn.mjs\",\n \"require\": \"./dist/server-fn.cjs\"\n },\n \"./server-fn/client\": {\n \"types\": \"./dist/server-fn-client.d.ts\",\n \"import\": \"./dist/server-fn-client.mjs\",\n \"require\": \"./dist/server-fn-client.cjs\"\n },\n \"./server-query\": {\n \"types\": \"./dist/server-query.d.ts\",\n \"import\": \"./dist/server-query.mjs\",\n \"require\": \"./dist/server-query.cjs\"\n },\n \"./server-query/client\": {\n \"types\": \"./dist/server-query-client.d.ts\",\n \"import\": \"./dist/server-query-client.mjs\",\n \"require\": \"./dist/server-query-client.cjs\"\n },\n \"./server-action-security\": {\n \"types\": \"./dist/server-action-security.d.ts\",\n \"import\": \"./dist/server-action-security.mjs\",\n \"require\": \"./dist/server-action-security.cjs\"\n },\n \"./deployment\": {\n \"types\": \"./dist/deployment.d.ts\",\n \"import\": \"./dist/deployment.mjs\",\n \"require\": \"./dist/deployment.cjs\"\n },\n \"./env\": {\n \"types\": \"./dist/env.d.ts\",\n \"import\": \"./dist/env.mjs\",\n \"require\": \"./dist/env.cjs\"\n },\n \"./env-types\": {\n \"types\": \"./dist/env-types.d.ts\",\n \"import\": \"./dist/env-types.mjs\",\n \"require\": \"./dist/env-types.cjs\"\n },\n \"./environment\": {\n \"types\": \"./dist/environment.d.ts\",\n \"import\": \"./dist/environment.mjs\",\n \"require\": \"./dist/environment.cjs\"\n },\n \"./environment/vite\": {\n \"types\": \"./dist/environment/vite.d.ts\",\n \"import\": \"./dist/environment/vite.mjs\",\n \"require\": \"./dist/environment/vite.cjs\"\n },\n \"./font\": {\n \"types\": \"./dist/font.d.ts\",\n \"import\": \"./dist/font.mjs\",\n \"require\": \"./dist/font.cjs\"\n },\n \"./vite\": {\n \"types\": \"./dist/vite.d.ts\",\n \"import\": \"./dist/vite.mjs\",\n \"require\": \"./dist/vite.cjs\"\n },\n \"./plugin\": {\n \"types\": \"./dist/plugin.d.ts\",\n \"import\": \"./dist/plugin.mjs\",\n \"require\": \"./dist/plugin.cjs\"\n },\n \"./plugin/server\": {\n \"types\": \"./dist/server-plugins.d.ts\",\n \"import\": \"./dist/server-plugins.mjs\",\n \"require\": \"./dist/server-plugins.cjs\"\n },\n \"./plugin/client\": {\n \"types\": \"./dist/client-plugins.d.ts\",\n \"import\": \"./dist/client-plugins.mjs\",\n \"require\": \"./dist/client-plugins.cjs\"\n },\n \"./query\": {\n \"types\": \"./dist/query/index.d.ts\",\n \"import\": \"./dist/query/index.mjs\",\n \"require\": \"./dist/query/index.cjs\"\n },\n \"./query/parsers\": {\n \"types\": \"./dist/query/parsers.d.ts\",\n \"import\": \"./dist/query/parsers.mjs\",\n \"require\": \"./dist/query/parsers.cjs\"\n },\n \"./query/client\": {\n \"types\": \"./dist/query/client.d.ts\",\n \"import\": \"./dist/query/client.mjs\",\n \"require\": \"./dist/query/client.cjs\"\n },\n \"./query/server\": {\n \"types\": \"./dist/query/server.d.ts\",\n \"import\": \"./dist/query/server.mjs\",\n \"require\": \"./dist/query/server.cjs\"\n },\n \"./middleware\": {\n \"types\": \"./dist/middleware.d.ts\",\n \"import\": \"./dist/middleware.mjs\",\n \"require\": \"./dist/middleware.cjs\"\n },\n \"./api\": {\n \"types\": \"./dist/api.d.ts\",\n \"import\": \"./dist/api.mjs\",\n \"require\": \"./dist/api.cjs\"\n },\n \"./api/route-manager\": {\n \"types\": \"./dist/api/route-manager.d.ts\",\n \"import\": \"./dist/api/route-manager.mjs\",\n \"require\": \"./dist/api/route-manager.cjs\"\n },\n \"./api/runtime\": {\n \"types\": \"./dist/api/runtime.d.ts\",\n \"import\": \"./dist/api/runtime.mjs\",\n \"require\": \"./dist/api/runtime.cjs\"\n },\n \"./request\": {\n \"types\": \"./dist/request.d.ts\",\n \"import\": \"./dist/request.mjs\",\n \"require\": \"./dist/request.cjs\"\n },\n \"./router\": {\n \"types\": \"./dist/router.d.ts\",\n \"import\": \"./dist/router.mjs\",\n \"require\": \"./dist/router.cjs\"\n },\n \"./routes\": {\n \"types\": \"./dist/routes.d.ts\",\n \"import\": \"./dist/routes.mjs\",\n \"require\": \"./dist/routes.cjs\"\n },\n \"./testing\": {\n \"types\": \"./dist/testing.d.ts\",\n \"import\": \"./dist/testing.mjs\",\n \"require\": \"./dist/testing.cjs\"\n },\n \"./agent-runtime\": {\n \"types\": \"./dist/agent-runtime.d.ts\",\n \"import\": \"./dist/agent-runtime.mjs\",\n \"require\": \"./dist/agent-runtime.cjs\"\n },\n \"./image\": {\n \"types\": \"./types/image.d.ts\",\n \"import\": \"./dist/image.mjs\",\n \"require\": \"./dist/image.cjs\"\n },\n \"./image/server\": {\n \"types\": \"./dist/image/server.d.ts\",\n \"import\": \"./dist/image/server.mjs\",\n \"require\": \"./dist/image/server.cjs\"\n },\n \"./image/sharp\": {\n \"types\": \"./dist/image/sharp.d.ts\",\n \"import\": \"./dist/image/sharp.mjs\",\n \"require\": \"./dist/image/sharp.cjs\"\n },\n \"./i18n\": {\n \"types\": \"./dist/i18n/index.d.ts\",\n \"import\": \"./dist/i18n/index.mjs\",\n \"require\": \"./dist/i18n/index.cjs\"\n },\n \"./i18n/server\": {\n \"types\": \"./dist/i18n/server.d.ts\",\n \"import\": \"./dist/i18n/server.mjs\",\n \"require\": \"./dist/i18n/server.cjs\"\n },\n \"./i18n/client\": {\n \"types\": \"./dist/i18n/client.d.ts\",\n \"import\": \"./dist/i18n/client.mjs\",\n \"require\": \"./dist/i18n/client.cjs\"\n },\n \"./internal/production-runtime\": {\n \"types\": \"./dist/internal/production-runtime.d.ts\",\n \"import\": \"./dist/internal/production-runtime.mjs\",\n \"require\": \"./dist/internal/production-runtime.cjs\"\n },\n \"./internal/metadata-image-runtime\": {\n \"types\": \"./dist/internal/metadata-image-runtime.d.ts\",\n \"import\": \"./dist/internal/metadata-image-runtime.mjs\",\n \"require\": \"./dist/internal/metadata-image-runtime.cjs\"\n },\n \"./internal/client-runtime\": {\n \"types\": \"./dist/internal/client-runtime.d.ts\",\n \"import\": \"./dist/internal/client-runtime.mjs\",\n \"require\": \"./dist/internal/client-runtime.cjs\"\n },\n \"./internal/build-runtime\": {\n \"types\": \"./dist/internal/build-runtime.d.ts\",\n \"import\": \"./dist/internal/build-runtime.mjs\",\n \"require\": \"./dist/internal/build-runtime.cjs\"\n },\n \"./internal/config-runtime\": {\n \"types\": \"./dist/internal/config-runtime.d.ts\",\n \"import\": \"./dist/internal/config-runtime.mjs\",\n \"require\": \"./dist/internal/config-runtime.cjs\"\n },\n \"./internal/production-node-env\": {\n \"types\": \"./dist/internal/production-node-env.d.ts\",\n \"import\": \"./dist/internal/production-node-env.mjs\",\n \"require\": \"./dist/internal/production-node-env.cjs\"\n }\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"build:runtime\": \"tsup --config tsup.runtime.config.ts\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"test:coverage\": \"vitest --coverage\",\n \"lint\": \"biome lint .\",\n \"lint:fix\": \"biome lint --write .\",\n \"format\": \"biome format --write .\",\n \"type-check\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\"\n },\n \"dependencies\": {\n \"@farming-labs/docs\": \"^0.2.44\",\n \"@farming-labs/orm\": \"0.0.62\",\n \"@farming-labs/orm-runtime\": \"0.0.62\",\n \"@formatjs/icu-messageformat-parser\": \"3.5.15\",\n \"@mdx-js/mdx\": \"^3.1.1\",\n \"@scalar/api-reference\": \"^1.38.1\",\n \"@scalar/openapi-parser\": \"^0.22.3\",\n \"@tailwindcss/vite\": \"4.1.18\",\n \"@vercel/og\": \"0.11.1\",\n \"@vitejs/plugin-react\": \"^4.2.1\",\n \"better-call\": \"^1.0.19\",\n \"db0\": \"^0.3.4\",\n \"esbuild\": \"^0.28.0\",\n \"fast-glob\": \"^3.3.2\",\n \"h3\": \"2.0.1-rc.5\",\n \"image-size\": \"^2.0.2\",\n \"intl-messageformat\": \"11.2.12\",\n \"marked\": \"^12.0.2\",\n \"nitro\": \"3.0.1-alpha.0\",\n \"pg\": \"^8.20.0\",\n \"picocolors\": \"^1.0.0\",\n \"remark-gfm\": \"^4.0.1\",\n \"sirv\": \"^2.0.4\",\n \"sugar-high\": \"^0.9.5\",\n \"supports-color\": \"^10.2.2\",\n \"tailwindcss\": \"4.1.18\",\n \"unstorage\": \"^2.0.0-alpha.3\",\n \"vite\": \"^5.0.10\",\n \"zod\": \"^4.1.12\"\n },\n \"devDependencies\": {\n \"@clerk/react\": \"^6.1.0\",\n \"@types/react\": \"^18.2.45\",\n \"@types/react-dom\": \"^18.2.18\",\n \"@vitest/coverage-v8\": \"^1.1.0\",\n \"jsdom\": \"^25.0.0\",\n \"react\": \"19.2.8\",\n \"react-dom\": \"19.2.8\",\n \"tsup\": \"^8.3.5\",\n \"typescript\": \"^5.3.3\",\n \"vitest\": \"^1.1.0\"\n },\n \"peerDependencies\": {\n \"react\": \"^18.2.0 || ^19.0.0\",\n \"react-dom\": \"^18.2.0 || ^19.0.0\"\n },\n \"optionalDependencies\": {\n \"rolldown\": \"1.2.0\",\n \"sharp\": \"^0.34.5\",\n \"vite-rolldown\": \"npm:vite@8.1.5\"\n }\n}\n","import { version } from \"../package.json\";\n\nexport const FARM_VERSION = version;\n"],"mappings":";AAEE,cAAW;;;ACAN,IAAM,eAAe;","names":[]}
@@ -20,27 +20,30 @@ import {
20
20
  loadFarmConfigFile,
21
21
  resolveFarmLayers
22
22
  } from "./chunk-74YTBPTY.mjs";
23
+ import {
24
+ resolveFarmImageConfig
25
+ } from "./chunk-GY2STC2S.mjs";
23
26
  import {
24
27
  resolveFarmPerformanceConfig
25
28
  } from "./chunk-7ZVN3YZI.mjs";
26
29
  import {
27
- resolveFarmImageConfig
28
- } from "./chunk-GY2STC2S.mjs";
30
+ resolveWorkflowsConfig
31
+ } from "./chunk-4E6VRJ6P.mjs";
32
+ import {
33
+ resolveCronConfig
34
+ } from "./chunk-GXASWWJU.mjs";
29
35
  import {
30
36
  resolveServerActionsConfig
31
37
  } from "./chunk-WORFTBLU.mjs";
38
+ import {
39
+ resolveFarmThemeConfig
40
+ } from "./chunk-H53KVQUU.mjs";
32
41
  import {
33
42
  resolveMdxConfig
34
43
  } from "./chunk-ZVWA4ZQ3.mjs";
35
44
  import {
36
45
  resolveMarkdownConfig
37
46
  } from "./chunk-7FBJLMQH.mjs";
38
- import {
39
- resolveWorkflowsConfig
40
- } from "./chunk-4E6VRJ6P.mjs";
41
- import {
42
- resolveCronConfig
43
- } from "./chunk-GXASWWJU.mjs";
44
47
  import {
45
48
  resolveIntegrationPlugins
46
49
  } from "./chunk-CRN3AH35.mjs";
@@ -406,6 +409,7 @@ async function resolveConfig(userConfig, mode) {
406
409
  routeRules,
407
410
  images: resolveFarmImageConfig(userConfig.images),
408
411
  performance: resolveFarmPerformanceConfig(userConfig.performance),
412
+ theme: resolveFarmThemeConfig(userConfig.theme, userConfig.basePath || "/"),
409
413
  publicDir: userConfig.publicDir || "public",
410
414
  i18n: resolveFarmI18nConfig(userConfig.i18n, { root, mode }),
411
415
  openapi: {
@@ -497,4 +501,4 @@ export {
497
501
  resolveConfig,
498
502
  loadConfig
499
503
  };
500
- //# sourceMappingURL=chunk-CEVMYGDL.mjs.map
504
+ //# sourceMappingURL=chunk-YD5IRKVS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config.ts"],"sourcesContent":["import type {\n FarmConfig as BaseFarmConfig,\n FarmMigrationCommand,\n FarmMigrationsConfig,\n FarmMigrationsUserConfig,\n ResolvedFarmMigrationsConfig,\n} from \"./types\";\nimport type { DocsConfig } from \"@farming-labs/docs\";\nimport type { FarmDocsResolvedConfig, FarmDocsUserConfig } from \"./docs/types\";\nimport type { FarmIntegrationsUserConfig } from \"./integrations\";\nimport type { FarmMarkdownResolvedConfig, FarmMarkdownUserConfig } from \"./markdown\";\nimport type { FarmObservabilityUserConfig } from \"./observability\";\nimport type { FarmMiddlewareConfig } from \"./middleware/types\";\nimport type { FarmPlugin } from \"./plugin\";\nimport type { FarmWorkflowsResolvedConfig, FarmWorkflowsUserConfig } from \"./workflows\";\nimport type { FarmCronResolvedConfig, FarmCronUserConfig } from \"./cron\";\nimport type { FarmEnvConfig, ResolvedFarmEnv } from \"./env\";\nimport type { UserConfig as ViteUserConfig } from \"vite\";\nimport { resolveIntegrationPlugins } from \"./integrations\";\nimport { resolveMarkdownConfig } from \"./markdown\";\nimport { resolveWorkflowsConfig } from \"./workflows\";\nimport { resolveCronConfig } from \"./cron\";\nimport { resolveEnv, setEnv } from \"./env\";\nimport {\n resolveMdxConfig,\n type FarmMdxResolvedConfig,\n type FarmMdxUserConfig,\n} from \"./app-markdown\";\nimport {\n normalizeRouteRules,\n routeRulesToHeaders,\n routeRulesToRedirects,\n type FarmRouteRules,\n} from \"./route-rules\";\nimport {\n resolveServerActionsConfig,\n type FarmServerActionsConfig,\n type ResolvedFarmServerActionsConfig,\n} from \"./server-action-security\";\nimport {\n resolveFarmServerConfig,\n type FarmServerConfig,\n type ResolvedFarmServerConfig,\n} from \"./server-http\";\nimport {\n loadFarmConfigFile,\n resolveFarmLayers,\n type FarmLayerEntry,\n type ResolvedFarmLayer,\n} from \"./layers\";\nimport path from \"path\";\nimport { normalizeFarmDeploymentId } from \"./deployment\";\nimport { resolveFarmDevtoolsConfig, type ResolvedFarmDevtoolsConfig } from \"./devtools-config\";\nimport {\n resolveFarmImageConfig,\n type FarmImageConfig,\n type ResolvedFarmImageConfig,\n} from \"./image-config\";\nimport { resolveFarmI18nConfig } from \"./i18n/config\";\nimport type { FarmI18nUserConfig, ResolvedFarmI18nConfig } from \"./i18n/types\";\nimport type { FarmCacheUserConfig } from \"./cache\";\nimport {\n resolveFarmAuthConfig,\n resolveFarmAuthIntegration,\n type FarmAuthUserConfig,\n type ResolvedFarmAuthConfig,\n} from \"./auth-config\";\nimport { resolveFarmPerformanceConfig, type ResolvedFarmPerformanceConfig } from \"./preload\";\nimport {\n getFarmSecurityHeader,\n resolveFarmSecurityConfig,\n type FarmCspConfig,\n type FarmCspDirectives,\n type FarmCspDirectiveValue,\n type FarmCspOptions,\n type FarmSecurityConfig,\n type ResolvedFarmCspConfig,\n type ResolvedFarmSecurityConfig,\n} from \"./security\";\nimport { resolveFarmThemeConfig } from \"./theme/config\";\nimport type { ResolvedFarmThemeConfig } from \"./theme/types\";\n\nconst FARM_RESOLVED_CUSTOM_CONTEXT = Symbol.for(\"farm.resolvedCustomContext\");\n\nexport type {\n FarmDocsConfigInput,\n FarmDocsNavigationConfig,\n FarmDocsResolvedConfig,\n FarmDocsSidebarItem,\n FarmDocsUserConfig,\n} from \"./docs/types\";\nexport type {\n FarmMarkdownResolvedConfig,\n FarmMarkdownRouteInput,\n FarmMarkdownUserConfig,\n} from \"./markdown\";\nexport type { FarmMdxComponents, FarmMdxResolvedConfig, FarmMdxUserConfig } from \"./app-markdown\";\nexport type {\n FarmMigrationCommand,\n FarmMigrationsConfig,\n FarmMigrationsUserConfig,\n ResolvedFarmMigrationsConfig,\n} from \"./types\";\nexport type { FarmWorkflowsResolvedConfig, FarmWorkflowsUserConfig } from \"./workflows\";\nexport type { FarmCronJobConfig, FarmCronResolvedConfig, FarmCronUserConfig } from \"./cron\";\nexport type {\n FarmRouteRule,\n FarmRouteRuleCors,\n FarmRouteRuleRedirect,\n FarmRouteRuleRenderMode,\n FarmRouteRules,\n} from \"./route-rules\";\nexport type {\n FarmServerActionsConfig,\n ResolvedFarmServerActionsConfig,\n} from \"./server-action-security\";\nexport type {\n FarmServerConfig,\n FarmServerDuration,\n FarmServerHealthConfig,\n ResolvedFarmServerConfig,\n ResolvedFarmServerHealthConfig,\n} from \"./server-http\";\nexport type { FarmLayerEntry, ResolvedFarmLayer } from \"./layers\";\nexport type {\n FarmDevtoolsConfig,\n FarmDevtoolsUserConfig,\n ResolvedFarmDevtoolsConfig,\n} from \"./devtools-config\";\nexport type {\n FarmPerformanceConfig,\n FarmPreloadMode,\n FarmPreloadUserConfig,\n ResolvedFarmPerformanceConfig,\n ResolvedFarmPreloadConfig,\n} from \"./preload\";\nexport type {\n FarmImageConfig,\n FarmImageFormat,\n FarmImageLocalPattern,\n FarmImageProvider,\n FarmImageRemotePattern,\n ResolvedFarmImageConfig,\n} from \"./image-config\";\nexport type {\n FarmI18nCookieConfig,\n FarmI18nDetectionSignal,\n FarmI18nDirection,\n FarmI18nRouting,\n FarmI18nUserConfig,\n ResolvedFarmI18nConfig,\n} from \"./i18n/types\";\nexport type {\n FarmAuthConfig,\n FarmAuthDatabaseConfig,\n FarmAuthEmailAndPasswordConfig,\n FarmAuthSessionConfig,\n FarmAuthUserConfig,\n ResolvedFarmAuthConfig,\n} from \"./auth-config\";\nexport type {\n FarmCspConfig,\n FarmCspDirectives,\n FarmCspDirectiveValue,\n FarmCspOptions,\n FarmSecurityConfig,\n ResolvedFarmCspConfig,\n ResolvedFarmSecurityConfig,\n} from \"./security\";\n\nexport interface RedirectConfig {\n source: string;\n destination: string;\n permanent?: boolean;\n statusCode?: number;\n}\n\nexport interface HeaderConfig {\n source: string;\n headers: Array<{\n key: string;\n value: string;\n }>;\n}\n\nexport interface RewriteConfig {\n source: string;\n destination: string;\n}\n\n/** @deprecated Use FarmImageConfig. */\nexport type ImageConfig = FarmImageConfig;\n\n/** @deprecated Use FarmI18nUserConfig. */\nexport type I18nConfig = FarmI18nUserConfig;\n\nexport interface OpenAPIConfig {\n enabled?: boolean;\n route?: string;\n title?: string;\n description?: string;\n version?: string;\n servers?: Array<{\n url: string;\n description?: string;\n }>;\n contact?: {\n name?: string;\n email?: string;\n url?: string;\n };\n license?: {\n name: string;\n url?: string;\n };\n}\n\nexport type MiddlewareConfig = FarmMiddlewareConfig;\n\nexport interface NotFoundConfig {\n /** Path to a custom 404 page component (e.g., \"./src/app/not-found.tsx\") */\n component?: string;\n}\n\nexport type FarmDeployTarget = \"vercel\" | \"cloudflare\" | \"netlify\" | \"node\" | string;\n\nexport interface FarmDeployConfig {\n /**\n * Deployment platform. When present, Farm picks the matching Nitro preset and\n * output directory unless explicitly overridden.\n */\n target?: FarmDeployTarget;\n /** Nitro preset override. Usually inferred from target. */\n preset?: BaseFarmConfig[\"preset\"];\n /** Deployable output directory, relative to project root unless absolute. */\n outputDir?: string;\n /** Alias for outputDir for terser config. */\n output?: string;\n /** Cloudflare Pages project name used by `farm deploy --cloudflare`. */\n projectName?: string;\n vercel?: {\n outputDirectory?: string;\n buildCommand?: string;\n installCommand?: string;\n framework?: string | null;\n };\n cloudflare?: {\n outputDir?: string;\n projectName?: string;\n };\n netlify?: {\n outputDir?: string;\n site?: string;\n };\n}\n\nexport interface ResolvedFarmDeployConfig extends Omit<FarmDeployConfig, \"output\"> {\n target?: FarmDeployTarget;\n preset: BaseFarmConfig[\"preset\"];\n outputDir: string;\n}\n\nexport interface FarmUserConfig extends Omit<BaseFarmConfig, \"vite\" | \"docs\" | \"env\" | \"layers\"> {\n /** Reusable Farm directories or installed packages, applied from left to right. */\n extends?: readonly FarmLayerEntry[];\n /** Global plugins. Integration-bound plugins must be contributed through an integration. */\n plugins?: FarmPlugin<any, any, any, any, unknown, false>[];\n integrations?: FarmIntegrationsUserConfig;\n /**\n * Farm-native authentication. `true` enables email/password auth with\n * server helpers from `@farm.js/auth/server` and React APIs from\n * `@farm.js/auth/client`.\n */\n auth?: FarmAuthUserConfig;\n /** Shared application data, route, ISR, and PPR cache. */\n cache?: FarmCacheUserConfig;\n migrations?: FarmMigrationsUserConfig;\n /** Map portable cron schedules to ordinary GET API routes. */\n cron?: FarmCronUserConfig | FarmCronResolvedConfig | false;\n workflows?: FarmWorkflowsUserConfig | boolean;\n preset?: BaseFarmConfig[\"preset\"];\n deploy?: FarmDeployConfig;\n docs?: FarmDocsUserConfig;\n md?: FarmMarkdownUserConfig | boolean;\n mdx?: FarmMdxUserConfig;\n observability?: FarmObservabilityUserConfig;\n\n trailingSlash?: boolean;\n redirects?: () => Promise<RedirectConfig[]> | RedirectConfig[];\n rewrites?: () => Promise<RewriteConfig[]> | RewriteConfig[];\n headers?: () => Promise<HeaderConfig[]> | HeaderConfig[];\n\n images?: ImageConfig;\n publicDir?: string;\n\n i18n?: FarmI18nUserConfig | false;\n openapi?: OpenAPIConfig;\n\n middleware?: FarmMiddlewareConfig;\n routeRules?: FarmRouteRules;\n context?: BaseFarmConfig[\"context\"];\n /** Server ingress and trusted-proxy policy. */\n server?: FarmServerConfig;\n serverActions?: FarmServerActionsConfig;\n /** Build identifier used to detect and recover from deployment version skew. */\n deploymentId?: string;\n\n notFound?: NotFoundConfig;\n\n output?: \"standalone\" | \"static\" | \"export\";\n distDir?: string;\n generateBuildId?: () => string | Promise<string>;\n compress?: boolean;\n\n devIndicators?: {\n buildActivity?: boolean;\n buildActivityPosition?: \"bottom-right\" | \"bottom-left\" | \"top-right\" | \"top-left\";\n };\n\n serverRuntimeConfig?: Record<string, any>;\n publicRuntimeConfig?: Record<string, any>;\n\n env?: FarmEnvConfig<any, any>;\n\n typescript?: {\n tsconfigPath?: string;\n ignoreBuildErrors?: boolean;\n };\n\n vite?: ViteUserConfig | ((config: ViteUserConfig) => ViteUserConfig);\n\n [key: string]: any;\n}\n\nexport interface ResolvedFarmConfig extends Required<\n Omit<\n FarmUserConfig,\n | \"extends\"\n | \"plugins\"\n | \"vite\"\n | \"deploy\"\n | \"docs\"\n | \"md\"\n | \"mdx\"\n | \"migrations\"\n | \"cron\"\n | \"workflows\"\n | \"env\"\n | \"server\"\n | \"serverActions\"\n | \"devtools\"\n | \"images\"\n | \"i18n\"\n | \"auth\"\n | \"performance\"\n | \"security\"\n | \"theme\"\n >\n> {\n /** @internal Tracks whether `context` came from user/layer config instead of the default noop. */\n [FARM_RESOLVED_CUSTOM_CONTEXT]?: boolean;\n extends: readonly FarmLayerEntry[];\n layers: ResolvedFarmLayer[];\n plugins: FarmPlugin[];\n vite: ViteUserConfig;\n deploy: ResolvedFarmDeployConfig;\n docs: FarmDocsResolvedConfig;\n md: FarmMarkdownResolvedConfig;\n mdx: FarmMdxResolvedConfig;\n migrations: ResolvedFarmMigrationsConfig;\n cron: FarmCronResolvedConfig;\n workflows: FarmWorkflowsResolvedConfig;\n env: ResolvedFarmEnv;\n server: ResolvedFarmServerConfig;\n serverActions: ResolvedFarmServerActionsConfig;\n devtools: ResolvedFarmDevtoolsConfig;\n images: ResolvedFarmImageConfig;\n i18n: ResolvedFarmI18nConfig;\n auth: ResolvedFarmAuthConfig;\n performance: ResolvedFarmPerformanceConfig;\n security: ResolvedFarmSecurityConfig;\n theme: ResolvedFarmThemeConfig;\n routeRules: FarmRouteRules;\n}\n\nexport function hasCustomFarmRouteContext(config: ResolvedFarmConfig): boolean {\n return config[FARM_RESOLVED_CUSTOM_CONTEXT] === true;\n}\n\nexport type FarmLayerConfig = Omit<\n FarmUserConfig,\n | \"root\"\n | \"outDir\"\n | \"distDir\"\n | \"deploy\"\n | \"output\"\n | \"preset\"\n | \"publicDir\"\n | \"generateBuildId\"\n | \"deploymentId\"\n>;\n\nexport { defineConfig, defineFarmConfig } from \"./config-entry\";\n\nexport function normalizeDeployTarget(target?: FarmDeployTarget): FarmDeployTarget | undefined {\n if (!target) return undefined;\n if (target === \"cloudflare-pages\" || target === \"cloudflare_pages\") return \"cloudflare\";\n if (target === \"node-server\" || target === \"nitro\") return \"node\";\n return target;\n}\n\nexport function getPresetForDeployTarget(\n target?: FarmDeployTarget,\n): BaseFarmConfig[\"preset\"] | undefined {\n switch (normalizeDeployTarget(target)) {\n case \"vercel\":\n return \"vercel\";\n case \"cloudflare\":\n return \"cloudflare-pages\";\n case \"netlify\":\n return \"netlify\";\n case \"node\":\n return \"node-server\";\n default:\n return undefined;\n }\n}\n\nexport function getDeployTargetForPreset(preset?: string): FarmDeployTarget | undefined {\n if (!preset) return undefined;\n if (preset === \"vercel\" || preset === \"vercel-edge\") return \"vercel\";\n if (preset === \"cloudflare\" || preset === \"cloudflare-pages\" || preset === \"cloudflare-module\") {\n return \"cloudflare\";\n }\n if (preset === \"netlify\" || preset === \"netlify-edge\") return \"netlify\";\n if (preset === \"node-server\") return \"node\";\n return undefined;\n}\n\nexport function getDefaultDeployOutputDir(\n target: FarmDeployTarget | undefined,\n preset: string | undefined,\n distDir: string,\n): string {\n const normalizedTarget = normalizeDeployTarget(target) || getDeployTargetForPreset(preset);\n if (normalizedTarget === \"vercel\") return \".vercel/output\";\n return `${distDir}/.output`;\n}\n\nexport function resolveDeployOutputPath(root: string, outputDir: string): string {\n return path.isAbsolute(outputDir) ? outputDir : path.join(root, outputDir);\n}\n\nexport function resolveDeployConfig(\n config: Pick<FarmUserConfig, \"deploy\" | \"preset\" | \"distDir\">,\n overrides: {\n target?: FarmDeployTarget;\n preset?: BaseFarmConfig[\"preset\"];\n outputDir?: string;\n } = {},\n): ResolvedFarmDeployConfig {\n const deploy = config.deploy || {};\n const distDir = config.distDir || \".farm\";\n const target = normalizeDeployTarget(overrides.target || deploy.target);\n const preset =\n overrides.preset ||\n deploy.preset ||\n config.preset ||\n getPresetForDeployTarget(target) ||\n \"node-server\";\n const resolvedTarget = target || getDeployTargetForPreset(preset);\n const platformOutput =\n resolvedTarget === \"vercel\"\n ? deploy.vercel?.outputDirectory\n : resolvedTarget === \"cloudflare\"\n ? deploy.cloudflare?.outputDir\n : resolvedTarget === \"netlify\"\n ? deploy.netlify?.outputDir\n : undefined;\n const outputDir =\n overrides.outputDir ||\n deploy.outputDir ||\n deploy.output ||\n platformOutput ||\n getDefaultDeployOutputDir(resolvedTarget, preset, distDir);\n\n return {\n ...deploy,\n target: resolvedTarget,\n preset,\n outputDir,\n };\n}\n\nexport function resolveMigrationsConfig(\n migrations: FarmMigrationsUserConfig | undefined,\n): ResolvedFarmMigrationsConfig {\n if (!migrations) return { commands: [] };\n if (Array.isArray(migrations)) return { commands: migrations };\n return { commands: migrations.commands || [] };\n}\n\nexport const DOCS_CONFIG_FILENAMES = [\n \"docs.config.ts\",\n \"docs.config.tsx\",\n \"docs.config.mts\",\n \"docs.config.cts\",\n \"docs.config.js\",\n \"docs.config.jsx\",\n \"docs.config.mjs\",\n \"docs.config.cjs\",\n \"docs.json\",\n];\n\nfunction normalizeDocsRoute(value: string | undefined, fallback = \"/docs\"): string {\n const raw = (value || fallback).trim();\n if (!raw || raw === \"/\") return \"/\";\n const normalized = raw\n .replace(/\\\\/g, \"/\")\n .replace(/\\/+/g, \"/\")\n .replace(/^\\/?/, \"/\")\n .replace(/\\/+$/, \"\");\n return normalized || \"/\";\n}\n\nfunction docsRouteToEntry(route: string): string {\n const entry = route.replace(/^\\/+/, \"\").replace(/\\/+$/, \"\");\n return entry || \"docs\";\n}\n\nfunction normalizeDocsContentDir(value: string | undefined): string | undefined {\n if (!value) return undefined;\n const normalized = value.replace(/\\\\/g, \"/\").replace(/^\\/+/, \"\").replace(/\\/+$/, \"\");\n return normalized || undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, any> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction cloneSerializable(value: unknown, seen = new WeakSet<object>()): any {\n if (value === null) return null;\n\n const valueType = typeof value;\n if (valueType === \"string\" || valueType === \"number\" || valueType === \"boolean\") {\n return value;\n }\n if (valueType === \"undefined\" || valueType === \"function\" || valueType === \"symbol\") {\n return undefined;\n }\n if (Array.isArray(value)) {\n return value.map((item) => cloneSerializable(item, seen)).filter((item) => item !== undefined);\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n if (isRecord(value)) {\n if (seen.has(value)) return undefined;\n seen.add(value);\n\n const output: Record<string, any> = {};\n for (const [key, nestedValue] of Object.entries(value)) {\n const clonedValue = cloneSerializable(nestedValue, seen);\n if (clonedValue !== undefined) {\n output[key] = clonedValue;\n }\n }\n return output;\n }\n\n return undefined;\n}\n\nfunction sanitizeDocsConfig(config: Partial<DocsConfig>): Partial<DocsConfig> {\n return cloneSerializable(config) || {};\n}\n\nexport async function findDocsConfigPath(\n rootDir: string,\n configPath?: string,\n): Promise<string | undefined> {\n const { existsSync } = await import(\"fs\");\n const root = path.resolve(rootDir || process.cwd());\n\n if (configPath) {\n const resolvedPath = path.isAbsolute(configPath) ? configPath : path.join(root, configPath);\n if (!existsSync(resolvedPath)) {\n throw new Error(`Could not find docs config at ${configPath}.`);\n }\n return path.resolve(resolvedPath);\n }\n\n for (const filename of DOCS_CONFIG_FILENAMES) {\n const resolvedPath = path.join(root, filename);\n if (existsSync(resolvedPath)) {\n return resolvedPath;\n }\n }\n\n return undefined;\n}\n\nexport async function loadDocsConfig(\n rootDir: string,\n configPath?: string,\n): Promise<{ config: Partial<DocsConfig>; configPath: string } | undefined> {\n const fs = await import(\"fs/promises\");\n const { pathToFileURL } = await import(\"url\");\n const root = path.resolve(rootDir || process.cwd());\n const resolvedPath = await findDocsConfigPath(root, configPath);\n\n if (!resolvedPath) return undefined;\n\n try {\n if (resolvedPath.endsWith(\".json\")) {\n const content = await fs.readFile(resolvedPath, \"utf8\");\n return { config: JSON.parse(content), configPath: resolvedPath };\n }\n\n const { build } = await import(\"esbuild\");\n const configCacheDir = path.join(root, \".farm\", \".config-loader\");\n await fs.mkdir(configCacheDir, { recursive: true });\n const modulePath = path.join(\n configCacheDir,\n `docs-config-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`,\n );\n\n await build({\n absWorkingDir: root,\n entryPoints: [resolvedPath],\n outfile: modulePath,\n bundle: true,\n format: \"esm\",\n platform: \"node\",\n target: `node${process.versions.node.split(\".\")[0]}`,\n packages: \"external\",\n jsx: \"automatic\",\n logLevel: \"silent\",\n sourcemap: \"inline\",\n });\n\n const moduleUrl = pathToFileURL(modulePath).href + `?t=${Date.now()}`;\n let importedConfig: any;\n\n try {\n importedConfig = await import(/* @vite-ignore */ moduleUrl);\n } finally {\n await fs.unlink(modulePath).catch(() => undefined);\n }\n\n return {\n config: importedConfig.default || importedConfig,\n configPath: resolvedPath,\n };\n } catch (error: any) {\n const relativePath = path.relative(root, resolvedPath) || resolvedPath;\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Failed to load docs config from ${relativePath}: ${message}`);\n }\n}\n\nexport async function resolveDocsConfig(\n userDocs: FarmDocsUserConfig | undefined,\n options: {\n root?: string;\n srcDir?: string;\n } = {},\n): Promise<FarmDocsResolvedConfig> {\n const root = options.root || process.cwd();\n\n if (userDocs === false) {\n return {\n enabled: false,\n entry: \"/docs\",\n config: { entry: \"docs\", docsPath: \"/docs\" },\n };\n }\n\n const docsOptions = isRecord(userDocs) ? userDocs : {};\n if (docsOptions.enabled === false) {\n return {\n enabled: false,\n entry: \"/docs\",\n config: { entry: \"docs\", docsPath: \"/docs\" },\n };\n }\n\n const loadedConfig = await loadDocsConfig(root, docsOptions.configPath);\n const hasExplicitDocsConfig = userDocs === true || isRecord(userDocs);\n\n if (!hasExplicitDocsConfig && !loadedConfig) {\n return {\n enabled: false,\n entry: \"/docs\",\n config: { entry: \"docs\", docsPath: \"/docs\" },\n };\n }\n\n const inlineDocsConfig = sanitizeDocsConfig(docsOptions.config || {});\n const directDocsConfig = sanitizeDocsConfig({\n ...docsOptions,\n enabled: undefined,\n config: undefined,\n configPath: undefined,\n } as Partial<DocsConfig>);\n const loadedDocsConfig = sanitizeDocsConfig(loadedConfig?.config || {});\n const mergedDocsConfig: Partial<DocsConfig> = {\n ...loadedDocsConfig,\n ...inlineDocsConfig,\n ...directDocsConfig,\n };\n\n const explicitRoute = typeof docsOptions.entry === \"string\" ? docsOptions.entry : undefined;\n const configuredDocsPath =\n typeof mergedDocsConfig.docsPath === \"string\" ? mergedDocsConfig.docsPath : undefined;\n const configuredEntry =\n typeof mergedDocsConfig.entry === \"string\" ? mergedDocsConfig.entry : undefined;\n const entryRoute = normalizeDocsRoute(\n configuredDocsPath || explicitRoute || (configuredEntry ? `/${configuredEntry}` : undefined),\n );\n const docsEntry =\n explicitRoute && explicitRoute.startsWith(\"/\")\n ? docsRouteToEntry(explicitRoute)\n : docsRouteToEntry(configuredEntry || entryRoute);\n const contentDir = normalizeDocsContentDir(docsOptions.contentDir || mergedDocsConfig.contentDir);\n\n return {\n enabled: true,\n entry: entryRoute,\n contentDir,\n configPath: loadedConfig?.configPath,\n config: {\n ...mergedDocsConfig,\n entry: docsEntry,\n docsPath: entryRoute,\n ...(contentDir ? { contentDir } : {}),\n },\n };\n}\n\nexport async function resolveConfig(\n userConfig: FarmUserConfig,\n mode: \"development\" | \"production\",\n): Promise<ResolvedFarmConfig> {\n const projectRoot = userConfig.root || process.cwd();\n const layerResolution = await resolveFarmLayers(userConfig, {\n root: projectRoot,\n mode,\n });\n userConfig = layerResolution.config;\n\n const redirects =\n typeof userConfig.redirects === \"function\"\n ? await userConfig.redirects()\n : userConfig.redirects || [];\n\n const rewrites =\n typeof userConfig.rewrites === \"function\"\n ? await userConfig.rewrites()\n : userConfig.rewrites || [];\n\n const headers =\n typeof userConfig.headers === \"function\"\n ? await userConfig.headers()\n : userConfig.headers || [];\n const routeRules = normalizeRouteRules(userConfig.routeRules);\n const routeRuleRedirects = routeRulesToRedirects(routeRules);\n const routeRuleHeaders = routeRulesToHeaders(routeRules);\n const security = resolveFarmSecurityConfig(userConfig.security);\n const securityHeader = getFarmSecurityHeader(security);\n\n const deploy = resolveDeployConfig(userConfig);\n const root = userConfig.root || process.cwd();\n const srcDir = userConfig.srcDir || \"src\";\n const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });\n const md = resolveMarkdownConfig(userConfig.md);\n const mdx = resolveMdxConfig(userConfig.mdx);\n const env = resolveEnv(userConfig.env, process.env);\n setEnv(env);\n const auth = resolveFarmAuthConfig(userConfig.auth);\n if (auth.enabled && userConfig.integrations?.auth) {\n throw new Error(\n \"Choose either the top-level `auth` config or `integrations.auth`; they cannot both own the auth route.\",\n );\n }\n const nativeAuthIntegration = await resolveFarmAuthIntegration(auth, {\n root,\n mode,\n });\n const integrations = nativeAuthIntegration\n ? { ...userConfig.integrations, auth: nativeAuthIntegration }\n : userConfig.integrations || {};\n const generateBuildId = userConfig.generateBuildId || (() => `build-${Date.now()}`);\n const deploymentId = normalizeFarmDeploymentId(\n userConfig.deploymentId ||\n process.env.FARM_DEPLOYMENT_ID ||\n process.env.VERCEL_GIT_COMMIT_SHA ||\n process.env.CF_PAGES_COMMIT_SHA ||\n (mode === \"production\" ? await generateBuildId() : \"development\"),\n );\n\n const resolved: ResolvedFarmConfig = {\n [FARM_RESOLVED_CUSTOM_CONTEXT]: typeof userConfig.context === \"function\",\n root,\n srcDir,\n extends: userConfig.extends || [],\n layers: layerResolution.layers,\n outDir: userConfig.outDir || \"dist\",\n basePath: userConfig.basePath || \"/\",\n preset: deploy.preset || \"node-server\",\n deploy,\n docs,\n md,\n mdx,\n migrations: resolveMigrationsConfig(userConfig.migrations),\n cron: resolveCronConfig(userConfig.cron),\n workflows: resolveWorkflowsConfig(userConfig.workflows),\n observability: userConfig.observability ?? false,\n devtools: resolveFarmDevtoolsConfig(userConfig.devtools, mode),\n storage: userConfig.storage || {},\n cache: userConfig.cache || {},\n auth,\n suppressLintOnLink: userConfig.suppressLintOnLink ?? false,\n experimental: {\n serverComponents: false,\n serverActions: false,\n ...userConfig.experimental,\n },\n plugins: [...resolveIntegrationPlugins(integrations), ...(userConfig.plugins || [])],\n integrations,\n trailingSlash: userConfig.trailingSlash ?? false,\n redirects: () => [...redirects, ...routeRuleRedirects],\n rewrites: () => rewrites,\n headers: () => [\n ...headers,\n ...routeRuleHeaders,\n ...(securityHeader ? [{ source: \"/*\", headers: [securityHeader] }] : []),\n ],\n routeRules,\n images: resolveFarmImageConfig(userConfig.images),\n performance: resolveFarmPerformanceConfig(userConfig.performance),\n theme: resolveFarmThemeConfig(userConfig.theme, userConfig.basePath || \"/\"),\n publicDir: userConfig.publicDir || \"public\",\n i18n: resolveFarmI18nConfig(userConfig.i18n, { root, mode }),\n openapi: {\n enabled: false,\n route: \"/docs/reference\",\n title: \"API Documentation\",\n description: \"Auto-generated API documentation\",\n version: \"1.0.0\",\n servers: [{ url: \"http://localhost:3000\", description: \"Development server\" }],\n ...userConfig.openapi,\n },\n middleware: userConfig.middleware || {},\n notFound: userConfig.notFound || {},\n context: userConfig.context || (() => undefined),\n server: resolveFarmServerConfig(userConfig.server),\n serverActions: resolveServerActionsConfig(userConfig.serverActions),\n security,\n deploymentId,\n output: userConfig.output || \"standalone\",\n distDir: userConfig.distDir || \".farm\",\n generateBuildId,\n compress: userConfig.compress ?? true,\n devIndicators: {\n buildActivity: true,\n buildActivityPosition: \"bottom-right\",\n ...userConfig.devIndicators,\n },\n serverRuntimeConfig: userConfig.serverRuntimeConfig || {},\n publicRuntimeConfig: userConfig.publicRuntimeConfig || {},\n env,\n typescript: {\n tsconfigPath: \"tsconfig.json\",\n ignoreBuildErrors: false,\n ...userConfig.typescript,\n },\n vite: typeof userConfig.vite === \"function\" ? userConfig.vite({}) : userConfig.vite || {},\n };\n\n return resolved;\n}\n\nexport async function loadConfig(\n rootDir?: string,\n configPath?: string,\n mode = process.env.NODE_ENV === \"production\" ? \"production\" : \"development\",\n loadEnvironment?: (typeof import(\"vite\"))[\"loadEnv\"],\n): Promise<FarmUserConfig | undefined> {\n const { existsSync } = await import(\"fs\");\n const loadEnv = loadEnvironment || (await import(\"vite\")).loadEnv;\n\n const root = rootDir || process.cwd();\n const loadedEnv = loadEnv(mode, root, \"\");\n for (const [key, value] of Object.entries(loadedEnv)) {\n if (process.env[key] === undefined) {\n process.env[key] = value;\n }\n }\n const searchPaths = [\n configPath,\n \"farm.config.ts\",\n \"farm.config.mts\",\n \"farm.config.js\",\n \"farm.config.mjs\",\n \"config.ts\",\n \"config.mts\",\n \"config.js\",\n \"config.mjs\",\n ].filter(Boolean) as string[];\n\n for (const relativePath of searchPaths) {\n try {\n // Use path.join for proper path construction\n const absolutePath = relativePath.startsWith(\"/\")\n ? relativePath\n : path.join(root, relativePath);\n\n // Normalize the path to handle any issues\n const normalizedPath = path.resolve(absolutePath);\n\n // Check if file exists before trying to import\n if (!existsSync(normalizedPath)) {\n continue;\n }\n\n const loadedConfig = await loadFarmConfigFile<FarmUserConfig>(normalizedPath, { root });\n return loadedConfig.root === undefined ? { ...loadedConfig, root } : loadedConfig;\n } catch (error: any) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Failed to load config from ${relativePath}: ${message}`);\n }\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,OAAO,UAAU;AAgCjB,IAAM,+BAA+B,uBAAO,IAAI,4BAA4B;AA+SrE,SAAS,0BAA0B,QAAqC;AAC7E,SAAO,OAAO,4BAA4B,MAAM;AAClD;AAFgB;AAmBT,SAAS,sBAAsB,QAAyD;AAC7F,MAAI,CAAC,OAAQ,QAAO;AACpB,MAAI,WAAW,sBAAsB,WAAW,mBAAoB,QAAO;AAC3E,MAAI,WAAW,iBAAiB,WAAW,QAAS,QAAO;AAC3D,SAAO;AACT;AALgB;AAOT,SAAS,yBACd,QACsC;AACtC,UAAQ,sBAAsB,MAAM,GAAG;AAAA,IACrC,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAfgB;AAiBT,SAAS,yBAAyB,QAA+C;AACtF,MAAI,CAAC,OAAQ,QAAO;AACpB,MAAI,WAAW,YAAY,WAAW,cAAe,QAAO;AAC5D,MAAI,WAAW,gBAAgB,WAAW,sBAAsB,WAAW,qBAAqB;AAC9F,WAAO;AAAA,EACT;AACA,MAAI,WAAW,aAAa,WAAW,eAAgB,QAAO;AAC9D,MAAI,WAAW,cAAe,QAAO;AACrC,SAAO;AACT;AATgB;AAWT,SAAS,0BACd,QACA,QACA,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AAQ,MAAM,UAAU,OAAO,KAAK;AACrE,YAAM,IAAI,MAAM,8BAA8B,YAAY,KAAK,OAAO,EAAE;AAAA,IAC1E;AAAA,EACF;AACA,SAAO;AACT;AAnDsB;","names":[]}
@@ -16,6 +16,7 @@ import { FarmServerActionsConfig, ResolvedFarmServerActionsConfig } from './serv
16
16
  import { F as FarmImageConfig, R as ResolvedFarmImageConfig } from './image-config-Duob7wER.mjs';
17
17
  import { k as FarmI18nUserConfig, R as ResolvedFarmI18nConfig } from './types-BMxWr97v.mjs';
18
18
  import { FarmCacheUserConfig } from './cache.mjs';
19
+ import { R as ResolvedFarmThemeConfig, d as FarmThemeConfig } from './types-CsR8fpgF.mjs';
19
20
  import { F as FarmRouteRuntimeConfig, a as FarmRouteRuntime, b as FarmRouteRegions, c as FarmRouteMaxDuration } from './route-runtime-DoOHzCAD.mjs';
20
21
  import { FarmLayoutFonts } from './font.mjs';
21
22
 
@@ -687,7 +688,7 @@ interface FarmUserConfig extends Omit<FarmConfig, "vite" | "docs" | "env" | "lay
687
688
  vite?: UserConfig | ((config: UserConfig) => UserConfig);
688
689
  [key: string]: any;
689
690
  }
690
- interface ResolvedFarmConfig extends Required<Omit<FarmUserConfig, "extends" | "plugins" | "vite" | "deploy" | "docs" | "md" | "mdx" | "migrations" | "cron" | "workflows" | "env" | "server" | "serverActions" | "devtools" | "images" | "i18n" | "auth" | "performance" | "security">> {
691
+ interface ResolvedFarmConfig extends Required<Omit<FarmUserConfig, "extends" | "plugins" | "vite" | "deploy" | "docs" | "md" | "mdx" | "migrations" | "cron" | "workflows" | "env" | "server" | "serverActions" | "devtools" | "images" | "i18n" | "auth" | "performance" | "security" | "theme">> {
691
692
  /** @internal Tracks whether `context` came from user/layer config instead of the default noop. */
692
693
  [FARM_RESOLVED_CUSTOM_CONTEXT]?: boolean;
693
694
  extends: readonly FarmLayerEntry[];
@@ -710,6 +711,7 @@ interface ResolvedFarmConfig extends Required<Omit<FarmUserConfig, "extends" | "
710
711
  auth: ResolvedFarmAuthConfig;
711
712
  performance: ResolvedFarmPerformanceConfig;
712
713
  security: ResolvedFarmSecurityConfig;
714
+ theme: ResolvedFarmThemeConfig;
713
715
  routeRules: FarmRouteRules;
714
716
  }
715
717
  type FarmLayerConfig = Omit<FarmUserConfig, "root" | "outDir" | "distDir" | "deploy" | "output" | "preset" | "publicDir" | "generateBuildId" | "deploymentId">;
@@ -1670,6 +1672,8 @@ interface FarmConfig {
1670
1672
  images?: FarmImageConfig;
1671
1673
  /** Browser resource scheduling and preload budgets. */
1672
1674
  performance?: FarmPerformanceConfig;
1675
+ /** Built-in light, dark, and system color-mode runtime. */
1676
+ theme?: FarmThemeConfig | ResolvedFarmThemeConfig | false;
1673
1677
  i18n?: FarmI18nUserConfig | ResolvedFarmI18nConfig | false;
1674
1678
  /** Build identifier used to detect stale clients during rolling deployments. */
1675
1679
  deploymentId?: string;
@@ -2085,4 +2089,4 @@ interface SSGCollectionResult {
2085
2089
  ssr: string[];
2086
2090
  }
2087
2091
 
2088
- export { type FarmPlugin as $, type AppRoutePattern as A, type RouteSegment as B, type ParsedRoute as C, type BuildOptions as D, type ErrorProps as E, type FarmConfig as F, type GenerateStaticParams as G, type SSGPage as H, type SSGCollectionResult as I, type FarmLayerEntry as J, type ResolvedFarmLayer as K, type LoadingProps as L, type MiddlewareProps as M, type NitroPreset as N, type FarmSourceRoot as O, type PageRouteParams as P, type ResolveFarmLayersOptions as Q, type ResolvedFarmMigrationsConfig as R, type StaticPathPrimitive as S, type FarmLayerResolution as T, resolveFarmLayers as U, getFarmSourceRoots as V, getFarmAppDirectories as W, getFarmLayerAliases as X, loadFarmConfigFile as Y, type FarmUserConfig as Z, type BundleResultPayload as _, type FarmMigrationCommand as a, type FarmPluginRouterHooks as a$, type FarmIntegration as a0, type ReadonlyMiddlewareStore as a1, type FarmMiddlewareConfig as a2, type MiddlewareModule as a3, manageFarmDocumentPreloads as a4, manageFarmHtmlPreloads as a5, manageFarmLinkHeaderPreloads as a6, reportFarmPreloadWarnings as a7, type FarmMdxResolvedConfig as a8, type ResolvedFarmDevtoolsConfig as a9, type FarmAuthConfig as aA, type FarmAuthDatabaseConfig as aB, type FarmAuthEmailAndPasswordConfig as aC, type FarmAuthSessionConfig as aD, type FarmAuthUserConfig as aE, type PluginRequestContext as aF, type FarmPluginContext as aG, type FarmPluginIntegrationContext as aH, type FarmPluginLifecycle as aI, type FarmRequestPluginContext as aJ, type FarmRequestStore as aK, type FarmPluginRuntimeKind as aL, type FarmPluginRouteRuntimePayload as aM, type FarmPluginSetupContext as aN, type FarmPluginStateContext as aO, type FarmPluginRuntimeBaseEvent as aP, type FarmPluginRuntimeContextEvent as aQ, type FarmPluginRuntimeBeforeEvent as aR, type FarmPluginRuntimeAfterEvent as aS, type FarmPluginRuntimeErrorEvent as aT, type FarmPluginRuntimeStartEvent as aU, type FarmPluginRuntimeCloseEvent as aV, type FarmPluginRuntimeHooks as aW, type FarmPluginRuntimeRequestOptions as aX, type FarmPluginRuntimeRequestHandler as aY, type FarmPluginRuntimeSession as aZ, type FarmPluginDiscoveredRoute as a_, type ResolvedFarmAuthConfig as aa, type ResolvedFarmPerformanceConfig as ab, type ResolvedFarmSecurityConfig as ac, type OpenAPIConfig as ad, definePlugin as ae, FarmRuntimeShutdownError as af, PluginManager as ag, resolveConfig as ah, loadConfig as ai, resolveDeployConfig as aj, resolveMigrationsConfig as ak, resolveDeployOutputPath as al, normalizeDeployTarget as am, getDeployTargetForPreset as an, getPresetForDeployTarget as ao, type FarmLayerConfig as ap, type FarmPerformanceConfig as aq, type FarmPreloadMode as ar, type FarmPreloadUserConfig as as, type ResolvedFarmPreloadConfig as at, type FarmCspConfig as au, type FarmCspDirectives as av, type FarmCspDirectiveValue as aw, type FarmCspOptions as ax, type FarmSecurityConfig as ay, type ResolvedFarmCspConfig as az, type FarmMigrationsConfig as b, type FarmIntegrationDocumentNavigation as b$, type FarmPluginRenderHooks as b0, type FarmPluginBuildHooks as b1, type FarmPluginDevHooks as b2, type FarmPluginClientConfig as b3, type RouteDiscoveredPayload as b4, type RoutesGeneratedPayload as b5, type MiddlewareDiscoveredPayload as b6, type APIRouteDiscoveredPayload as b7, type RouteMatchPayload as b8, type RouteMatchResultPayload as b9, type FarmIntegrationValidationErrorLike as bA, type FarmIntegrationValidationResult as bB, type FarmIntegrationStandardValidationResult as bC, type FarmIntegrationInputSchema as bD, type FarmIntegrationRouteInputSchemas as bE, type FarmIntegrationRequestContextStore as bF, FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY as bG, type FarmIntegrationRouteDb as bH, type FarmIntegrationRouteStorageArgs as bI, type FarmIntegrationRouteArgs as bJ, type FarmIntegrationConfigContext as bK, type FarmIntegrationConfigDefinition as bL, type FarmIntegrationConfigInput as bM, type FarmIntegrationLifecycleLogLevel as bN, type FarmIntegrationLifecycleLogger as bO, type FarmIntegrationLifecycleContext as bP, type FarmIntegrationLifecycleHook as bQ, type FarmIntegrationData as bR, type FarmIntegrationHandlerContext as bS, type FarmIntegrationRouteHookContext as bT, type FarmIntegrationRouteHook as bU, type FarmIntegrationRoute as bV, type FarmTypedIntegrationRoute as bW, type FarmIntegrationRouteMiddleware as bX, type FarmIntegrationMiddleware as bY, type FarmIntegrationProviderProps as bZ, type FarmIntegrationProvider as b_, type RenderLifecyclePayload as ba, type APIHandlerLifecyclePayload as bb, type ErrorLifecyclePayload as bc, type HMRUpdatePayload as bd, type BundleLifecyclePayload as be, type NitroBuildLifecyclePayload as bf, type ShutdownPayload as bg, type ResolvedFarmConfig as bh, type RedirectConfig as bi, type HeaderConfig as bj, type RewriteConfig as bk, type ImageConfig as bl, type I18nConfig as bm, type MiddlewareConfig as bn, type FarmDeployConfig as bo, type ResolvedFarmDeployConfig as bp, type FarmDeployTarget as bq, type FarmIntegrationCategory as br, type FarmIntegrationSlot as bs, type FarmIntegrationRouteParamValue as bt, type FarmIntegrationRouteParams as bu, type FarmIntegrationRouteMethod as bv, type FarmIntegrationRouteInputSource as bw, type FarmIntegrationValidationPathSegment as bx, type FarmIntegrationRouteInput as by, type FarmIntegrationValidationIssue as bz, type FarmMigrationsUserConfig as c, type MemoryRateLimitStorageOptions as c$, type FarmIntegrationSchemaFieldType as c0, type FarmIntegrationSchemaReference as c1, type FarmIntegrationSchemaField as c2, type FarmIntegrationSchemaConstraint as c3, type FarmIntegrationSchemaModel as c4, type FarmIntegrationSchemaModelExtension as c5, type FarmIntegrationSchemaModelOverride as c6, type FarmIntegrationSchema as c7, defineIntegrationSchema as c8, type FarmIntegrationLogPhase as c9, matchIntegrationRoute as cA, matchRegisteredIntegrationRoute as cB, getRegisteredIntegrationAPIManifest as cC, dispatchIntegrationRequest as cD, type FarmIntegrationOrmSchema as cE, type FarmIntegrationOrmClient as cF, type InferFarmIntegrationOrmField as cG, type InferFarmIntegrationOrmFields as cH, type InferFarmIntegrationOrmSchema as cI, type InferFarmIntegrationOrmClient as cJ, type CreateIntegrationOrmOptions as cK, createIntegrationOrm as cL, resolveIntegrationOrmRuntimeClient as cM, farmIntegrationSchemaToOrmSchema as cN, type IntegrationOrmModelNames as cO, type MiddlewareContext as cP, type MiddlewareFunction as cQ, type RequestMiddleware as cR, type RequestMiddlewareContext as cS, type MiddlewareStore as cT, type MiddlewareChain as cU, type CookieJar as cV, type CookieOptions as cW, type RateLimitConfig as cX, type RateLimitIncrementResult as cY, type RateLimitStorage as cZ, type RateLimitStatus as c_, type FarmIntegrationLogEvent as ca, type FarmIntegrationLogger as cb, type FarmIntegrationPluginOwner as cc, type FarmIntegrationContributedPlugin as cd, type FarmIntegrationsUserConfig as ce, getFarmIntegrationPluginServerRuntime as cf, getFarmIntegrationPluginOwner as cg, type FarmIntegrationRouteFactory as ch, type FarmIntegrationRoutesFactoryContext as ci, type FarmIntegrationRoutesFactory as cj, type FarmIntegrationEndpointValue as ck, type FarmIntegrationEndpoints as cl, type FarmIntegrationEndpointsFactoryContext as cm, type FarmIntegrationEndpointsFactory as cn, createIntegrationRoute as co, integrationRoute as cp, type DefinedIntegration as cq, defineIntegration as cr, isFarmIntegration as cs, resolveIntegrationPlugins as ct, getIntegrationProviders as cu, getIntegrationDocumentNavigationMatchers as cv, getIntegrationSchemas as cw, getRegisteredIntegrationRuntime as cx, getRegisteredIntegrations as cy, getRegisteredIntegrationSchemas as cz, defineConfig as d, type NextFunction as d0, type MiddlewareResult as d1, type FarmRouteRuleRenderMode as d2, type FarmRouteRuleRedirect as d3, type FarmRouteRuleCors as d4, type FarmRouteRule as d5, type FarmRouteRules as d6, normalizeRouteRules as d7, routeRulesToRedirects as d8, routeRulesToHeaders as d9, routeRulesToNitroRouteRules as da, type FarmMdxComponent as db, type FarmMdxComponents as dc, type FarmMdxUserConfig as dd, type FarmMarkdownPageSource as de, type FarmMarkdownPageModuleInput as df, resolveMdxConfig as dg, isFarmMarkdownPageFile as dh, normalizeFarmMarkdownRoutePath as di, parseMarkdownFrontmatter as dj, titleFromMarkdown as dk, createMarkdownMetadata as dl, createFarmMarkdownRouteModule as dm, createFarmMarkdownRouteModuleFromFile as dn, loadFarmMdxComponents as dp, createFarmMarkdownSourceResponse as dq, DEFAULT_FARM_DEVTOOLS_SHORTCUT as dr, FARM_DEVTOOLS_PATH as ds, FARM_DEVTOOLS_LAUNCH_PARAM as dt, type FarmDevtoolsConfig as du, type FarmDevtoolsUserConfig as dv, resolveFarmDevtoolsConfig as dw, type MiddlewareConfig$1 as dx, farmI18nClientBridgePlugin as dy, rewriteEarlySsrRelativeImports as dz, type FarmContextFactoryInput as e, farmPlugin as f, type FarmContextFactory as g, type FarmAppContext as h, type PluginContextProps as i, type PageProps as j, type PagePropsWithMiddleware as k, type LayoutProps as l, type MetadataProps as m, type LayoutMetadataProps as n, type Page as o, type Layout as p, type Loading as q, type ErrorBoundary as r, type RouteModule as s, type StaticPathParams as t, type StaticRouteParams as u, type LayoutModule as v, type Metadata as w, type FarmRequest as x, type FarmResponse as y, type ServerAction as z };
2092
+ export { type FarmPlugin as $, type AppRoutePattern as A, type RouteSegment as B, type ParsedRoute as C, type BuildOptions as D, type ErrorProps as E, type FarmConfig as F, type GenerateStaticParams as G, type SSGPage as H, type SSGCollectionResult as I, type FarmLayerEntry as J, type ResolvedFarmLayer as K, type LoadingProps as L, type MiddlewareProps as M, type NitroPreset as N, type FarmSourceRoot as O, type PageRouteParams as P, type ResolveFarmLayersOptions as Q, type ResolvedFarmMigrationsConfig as R, type StaticPathPrimitive as S, type FarmLayerResolution as T, resolveFarmLayers as U, getFarmSourceRoots as V, getFarmAppDirectories as W, getFarmLayerAliases as X, loadFarmConfigFile as Y, type FarmUserConfig as Z, type BundleResultPayload as _, type FarmMigrationCommand as a, type FarmPluginRouterHooks as a$, type FarmIntegration as a0, type ReadonlyMiddlewareStore as a1, type FarmMiddlewareConfig as a2, type MiddlewareModule as a3, type FarmMdxResolvedConfig as a4, type ResolvedFarmDevtoolsConfig as a5, type ResolvedFarmAuthConfig as a6, type ResolvedFarmPerformanceConfig as a7, type ResolvedFarmSecurityConfig as a8, manageFarmDocumentPreloads as a9, type FarmAuthConfig as aA, type FarmAuthDatabaseConfig as aB, type FarmAuthEmailAndPasswordConfig as aC, type FarmAuthSessionConfig as aD, type FarmAuthUserConfig as aE, type PluginRequestContext as aF, type FarmPluginContext as aG, type FarmPluginIntegrationContext as aH, type FarmPluginLifecycle as aI, type FarmRequestPluginContext as aJ, type FarmRequestStore as aK, type FarmPluginRuntimeKind as aL, type FarmPluginRouteRuntimePayload as aM, type FarmPluginSetupContext as aN, type FarmPluginStateContext as aO, type FarmPluginRuntimeBaseEvent as aP, type FarmPluginRuntimeContextEvent as aQ, type FarmPluginRuntimeBeforeEvent as aR, type FarmPluginRuntimeAfterEvent as aS, type FarmPluginRuntimeErrorEvent as aT, type FarmPluginRuntimeStartEvent as aU, type FarmPluginRuntimeCloseEvent as aV, type FarmPluginRuntimeHooks as aW, type FarmPluginRuntimeRequestOptions as aX, type FarmPluginRuntimeRequestHandler as aY, type FarmPluginRuntimeSession as aZ, type FarmPluginDiscoveredRoute as a_, manageFarmHtmlPreloads as aa, manageFarmLinkHeaderPreloads as ab, reportFarmPreloadWarnings as ac, type OpenAPIConfig as ad, definePlugin as ae, FarmRuntimeShutdownError as af, PluginManager as ag, resolveConfig as ah, loadConfig as ai, resolveDeployConfig as aj, resolveMigrationsConfig as ak, resolveDeployOutputPath as al, normalizeDeployTarget as am, getDeployTargetForPreset as an, getPresetForDeployTarget as ao, type FarmLayerConfig as ap, type FarmPerformanceConfig as aq, type FarmPreloadMode as ar, type FarmPreloadUserConfig as as, type ResolvedFarmPreloadConfig as at, type FarmCspConfig as au, type FarmCspDirectives as av, type FarmCspDirectiveValue as aw, type FarmCspOptions as ax, type FarmSecurityConfig as ay, type ResolvedFarmCspConfig as az, type FarmMigrationsConfig as b, type FarmIntegrationDocumentNavigation as b$, type FarmPluginRenderHooks as b0, type FarmPluginBuildHooks as b1, type FarmPluginDevHooks as b2, type FarmPluginClientConfig as b3, type RouteDiscoveredPayload as b4, type RoutesGeneratedPayload as b5, type MiddlewareDiscoveredPayload as b6, type APIRouteDiscoveredPayload as b7, type RouteMatchPayload as b8, type RouteMatchResultPayload as b9, type FarmIntegrationValidationErrorLike as bA, type FarmIntegrationValidationResult as bB, type FarmIntegrationStandardValidationResult as bC, type FarmIntegrationInputSchema as bD, type FarmIntegrationRouteInputSchemas as bE, type FarmIntegrationRequestContextStore as bF, FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY as bG, type FarmIntegrationRouteDb as bH, type FarmIntegrationRouteStorageArgs as bI, type FarmIntegrationRouteArgs as bJ, type FarmIntegrationConfigContext as bK, type FarmIntegrationConfigDefinition as bL, type FarmIntegrationConfigInput as bM, type FarmIntegrationLifecycleLogLevel as bN, type FarmIntegrationLifecycleLogger as bO, type FarmIntegrationLifecycleContext as bP, type FarmIntegrationLifecycleHook as bQ, type FarmIntegrationData as bR, type FarmIntegrationHandlerContext as bS, type FarmIntegrationRouteHookContext as bT, type FarmIntegrationRouteHook as bU, type FarmIntegrationRoute as bV, type FarmTypedIntegrationRoute as bW, type FarmIntegrationRouteMiddleware as bX, type FarmIntegrationMiddleware as bY, type FarmIntegrationProviderProps as bZ, type FarmIntegrationProvider as b_, type RenderLifecyclePayload as ba, type APIHandlerLifecyclePayload as bb, type ErrorLifecyclePayload as bc, type HMRUpdatePayload as bd, type BundleLifecyclePayload as be, type NitroBuildLifecyclePayload as bf, type ShutdownPayload as bg, type ResolvedFarmConfig as bh, type RedirectConfig as bi, type HeaderConfig as bj, type RewriteConfig as bk, type ImageConfig as bl, type I18nConfig as bm, type MiddlewareConfig as bn, type FarmDeployConfig as bo, type ResolvedFarmDeployConfig as bp, type FarmDeployTarget as bq, type FarmIntegrationCategory as br, type FarmIntegrationSlot as bs, type FarmIntegrationRouteParamValue as bt, type FarmIntegrationRouteParams as bu, type FarmIntegrationRouteMethod as bv, type FarmIntegrationRouteInputSource as bw, type FarmIntegrationValidationPathSegment as bx, type FarmIntegrationRouteInput as by, type FarmIntegrationValidationIssue as bz, type FarmMigrationsUserConfig as c, type MemoryRateLimitStorageOptions as c$, type FarmIntegrationSchemaFieldType as c0, type FarmIntegrationSchemaReference as c1, type FarmIntegrationSchemaField as c2, type FarmIntegrationSchemaConstraint as c3, type FarmIntegrationSchemaModel as c4, type FarmIntegrationSchemaModelExtension as c5, type FarmIntegrationSchemaModelOverride as c6, type FarmIntegrationSchema as c7, defineIntegrationSchema as c8, type FarmIntegrationLogPhase as c9, matchIntegrationRoute as cA, matchRegisteredIntegrationRoute as cB, getRegisteredIntegrationAPIManifest as cC, dispatchIntegrationRequest as cD, type FarmIntegrationOrmSchema as cE, type FarmIntegrationOrmClient as cF, type InferFarmIntegrationOrmField as cG, type InferFarmIntegrationOrmFields as cH, type InferFarmIntegrationOrmSchema as cI, type InferFarmIntegrationOrmClient as cJ, type CreateIntegrationOrmOptions as cK, createIntegrationOrm as cL, resolveIntegrationOrmRuntimeClient as cM, farmIntegrationSchemaToOrmSchema as cN, type IntegrationOrmModelNames as cO, type MiddlewareContext as cP, type MiddlewareFunction as cQ, type RequestMiddleware as cR, type RequestMiddlewareContext as cS, type MiddlewareStore as cT, type MiddlewareChain as cU, type CookieJar as cV, type CookieOptions as cW, type RateLimitConfig as cX, type RateLimitIncrementResult as cY, type RateLimitStorage as cZ, type RateLimitStatus as c_, type FarmIntegrationLogEvent as ca, type FarmIntegrationLogger as cb, type FarmIntegrationPluginOwner as cc, type FarmIntegrationContributedPlugin as cd, type FarmIntegrationsUserConfig as ce, getFarmIntegrationPluginServerRuntime as cf, getFarmIntegrationPluginOwner as cg, type FarmIntegrationRouteFactory as ch, type FarmIntegrationRoutesFactoryContext as ci, type FarmIntegrationRoutesFactory as cj, type FarmIntegrationEndpointValue as ck, type FarmIntegrationEndpoints as cl, type FarmIntegrationEndpointsFactoryContext as cm, type FarmIntegrationEndpointsFactory as cn, createIntegrationRoute as co, integrationRoute as cp, type DefinedIntegration as cq, defineIntegration as cr, isFarmIntegration as cs, resolveIntegrationPlugins as ct, getIntegrationProviders as cu, getIntegrationDocumentNavigationMatchers as cv, getIntegrationSchemas as cw, getRegisteredIntegrationRuntime as cx, getRegisteredIntegrations as cy, getRegisteredIntegrationSchemas as cz, defineConfig as d, type NextFunction as d0, type MiddlewareResult as d1, type FarmRouteRuleRenderMode as d2, type FarmRouteRuleRedirect as d3, type FarmRouteRuleCors as d4, type FarmRouteRule as d5, type FarmRouteRules as d6, normalizeRouteRules as d7, routeRulesToRedirects as d8, routeRulesToHeaders as d9, routeRulesToNitroRouteRules as da, type FarmMdxComponent as db, type FarmMdxComponents as dc, type FarmMdxUserConfig as dd, type FarmMarkdownPageSource as de, type FarmMarkdownPageModuleInput as df, resolveMdxConfig as dg, isFarmMarkdownPageFile as dh, normalizeFarmMarkdownRoutePath as di, parseMarkdownFrontmatter as dj, titleFromMarkdown as dk, createMarkdownMetadata as dl, createFarmMarkdownRouteModule as dm, createFarmMarkdownRouteModuleFromFile as dn, loadFarmMdxComponents as dp, createFarmMarkdownSourceResponse as dq, DEFAULT_FARM_DEVTOOLS_SHORTCUT as dr, FARM_DEVTOOLS_PATH as ds, FARM_DEVTOOLS_LAUNCH_PARAM as dt, type FarmDevtoolsConfig as du, type FarmDevtoolsUserConfig as dv, resolveFarmDevtoolsConfig as dw, type MiddlewareConfig$1 as dx, farmI18nClientBridgePlugin as dy, rewriteEarlySsrRelativeImports as dz, type FarmContextFactoryInput as e, farmPlugin as f, type FarmContextFactory as g, type FarmAppContext as h, type PluginContextProps as i, type PageProps as j, type PagePropsWithMiddleware as k, type LayoutProps as l, type MetadataProps as m, type LayoutMetadataProps as n, type Page as o, type Layout as p, type Loading as q, type ErrorBoundary as r, type RouteModule as s, type StaticPathParams as t, type StaticRouteParams as u, type LayoutModule as v, type Metadata as w, type FarmRequest as x, type FarmResponse as y, type ServerAction as z };
@@ -16,6 +16,7 @@ import { FarmServerActionsConfig, ResolvedFarmServerActionsConfig } from './serv
16
16
  import { F as FarmImageConfig, R as ResolvedFarmImageConfig } from './image-config-Duob7wER.js';
17
17
  import { k as FarmI18nUserConfig, R as ResolvedFarmI18nConfig } from './types-BMxWr97v.js';
18
18
  import { FarmCacheUserConfig } from './cache.js';
19
+ import { R as ResolvedFarmThemeConfig, d as FarmThemeConfig } from './types-CsR8fpgF.js';
19
20
  import { F as FarmRouteRuntimeConfig, a as FarmRouteRuntime, b as FarmRouteRegions, c as FarmRouteMaxDuration } from './route-runtime-DoOHzCAD.js';
20
21
  import { FarmLayoutFonts } from './font.js';
21
22
 
@@ -687,7 +688,7 @@ interface FarmUserConfig extends Omit<FarmConfig, "vite" | "docs" | "env" | "lay
687
688
  vite?: UserConfig | ((config: UserConfig) => UserConfig);
688
689
  [key: string]: any;
689
690
  }
690
- interface ResolvedFarmConfig extends Required<Omit<FarmUserConfig, "extends" | "plugins" | "vite" | "deploy" | "docs" | "md" | "mdx" | "migrations" | "cron" | "workflows" | "env" | "server" | "serverActions" | "devtools" | "images" | "i18n" | "auth" | "performance" | "security">> {
691
+ interface ResolvedFarmConfig extends Required<Omit<FarmUserConfig, "extends" | "plugins" | "vite" | "deploy" | "docs" | "md" | "mdx" | "migrations" | "cron" | "workflows" | "env" | "server" | "serverActions" | "devtools" | "images" | "i18n" | "auth" | "performance" | "security" | "theme">> {
691
692
  /** @internal Tracks whether `context` came from user/layer config instead of the default noop. */
692
693
  [FARM_RESOLVED_CUSTOM_CONTEXT]?: boolean;
693
694
  extends: readonly FarmLayerEntry[];
@@ -710,6 +711,7 @@ interface ResolvedFarmConfig extends Required<Omit<FarmUserConfig, "extends" | "
710
711
  auth: ResolvedFarmAuthConfig;
711
712
  performance: ResolvedFarmPerformanceConfig;
712
713
  security: ResolvedFarmSecurityConfig;
714
+ theme: ResolvedFarmThemeConfig;
713
715
  routeRules: FarmRouteRules;
714
716
  }
715
717
  type FarmLayerConfig = Omit<FarmUserConfig, "root" | "outDir" | "distDir" | "deploy" | "output" | "preset" | "publicDir" | "generateBuildId" | "deploymentId">;
@@ -1670,6 +1672,8 @@ interface FarmConfig {
1670
1672
  images?: FarmImageConfig;
1671
1673
  /** Browser resource scheduling and preload budgets. */
1672
1674
  performance?: FarmPerformanceConfig;
1675
+ /** Built-in light, dark, and system color-mode runtime. */
1676
+ theme?: FarmThemeConfig | ResolvedFarmThemeConfig | false;
1673
1677
  i18n?: FarmI18nUserConfig | ResolvedFarmI18nConfig | false;
1674
1678
  /** Build identifier used to detect stale clients during rolling deployments. */
1675
1679
  deploymentId?: string;
@@ -2085,4 +2089,4 @@ interface SSGCollectionResult {
2085
2089
  ssr: string[];
2086
2090
  }
2087
2091
 
2088
- export { type FarmPlugin as $, type AppRoutePattern as A, type RouteSegment as B, type ParsedRoute as C, type BuildOptions as D, type ErrorProps as E, type FarmConfig as F, type GenerateStaticParams as G, type SSGPage as H, type SSGCollectionResult as I, type FarmLayerEntry as J, type ResolvedFarmLayer as K, type LoadingProps as L, type MiddlewareProps as M, type NitroPreset as N, type FarmSourceRoot as O, type PageRouteParams as P, type ResolveFarmLayersOptions as Q, type ResolvedFarmMigrationsConfig as R, type StaticPathPrimitive as S, type FarmLayerResolution as T, resolveFarmLayers as U, getFarmSourceRoots as V, getFarmAppDirectories as W, getFarmLayerAliases as X, loadFarmConfigFile as Y, type FarmUserConfig as Z, type BundleResultPayload as _, type FarmMigrationCommand as a, type FarmPluginRouterHooks as a$, type FarmIntegration as a0, type ReadonlyMiddlewareStore as a1, type FarmMiddlewareConfig as a2, type MiddlewareModule as a3, manageFarmDocumentPreloads as a4, manageFarmHtmlPreloads as a5, manageFarmLinkHeaderPreloads as a6, reportFarmPreloadWarnings as a7, type FarmMdxResolvedConfig as a8, type ResolvedFarmDevtoolsConfig as a9, type FarmAuthConfig as aA, type FarmAuthDatabaseConfig as aB, type FarmAuthEmailAndPasswordConfig as aC, type FarmAuthSessionConfig as aD, type FarmAuthUserConfig as aE, type PluginRequestContext as aF, type FarmPluginContext as aG, type FarmPluginIntegrationContext as aH, type FarmPluginLifecycle as aI, type FarmRequestPluginContext as aJ, type FarmRequestStore as aK, type FarmPluginRuntimeKind as aL, type FarmPluginRouteRuntimePayload as aM, type FarmPluginSetupContext as aN, type FarmPluginStateContext as aO, type FarmPluginRuntimeBaseEvent as aP, type FarmPluginRuntimeContextEvent as aQ, type FarmPluginRuntimeBeforeEvent as aR, type FarmPluginRuntimeAfterEvent as aS, type FarmPluginRuntimeErrorEvent as aT, type FarmPluginRuntimeStartEvent as aU, type FarmPluginRuntimeCloseEvent as aV, type FarmPluginRuntimeHooks as aW, type FarmPluginRuntimeRequestOptions as aX, type FarmPluginRuntimeRequestHandler as aY, type FarmPluginRuntimeSession as aZ, type FarmPluginDiscoveredRoute as a_, type ResolvedFarmAuthConfig as aa, type ResolvedFarmPerformanceConfig as ab, type ResolvedFarmSecurityConfig as ac, type OpenAPIConfig as ad, definePlugin as ae, FarmRuntimeShutdownError as af, PluginManager as ag, resolveConfig as ah, loadConfig as ai, resolveDeployConfig as aj, resolveMigrationsConfig as ak, resolveDeployOutputPath as al, normalizeDeployTarget as am, getDeployTargetForPreset as an, getPresetForDeployTarget as ao, type FarmLayerConfig as ap, type FarmPerformanceConfig as aq, type FarmPreloadMode as ar, type FarmPreloadUserConfig as as, type ResolvedFarmPreloadConfig as at, type FarmCspConfig as au, type FarmCspDirectives as av, type FarmCspDirectiveValue as aw, type FarmCspOptions as ax, type FarmSecurityConfig as ay, type ResolvedFarmCspConfig as az, type FarmMigrationsConfig as b, type FarmIntegrationDocumentNavigation as b$, type FarmPluginRenderHooks as b0, type FarmPluginBuildHooks as b1, type FarmPluginDevHooks as b2, type FarmPluginClientConfig as b3, type RouteDiscoveredPayload as b4, type RoutesGeneratedPayload as b5, type MiddlewareDiscoveredPayload as b6, type APIRouteDiscoveredPayload as b7, type RouteMatchPayload as b8, type RouteMatchResultPayload as b9, type FarmIntegrationValidationErrorLike as bA, type FarmIntegrationValidationResult as bB, type FarmIntegrationStandardValidationResult as bC, type FarmIntegrationInputSchema as bD, type FarmIntegrationRouteInputSchemas as bE, type FarmIntegrationRequestContextStore as bF, FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY as bG, type FarmIntegrationRouteDb as bH, type FarmIntegrationRouteStorageArgs as bI, type FarmIntegrationRouteArgs as bJ, type FarmIntegrationConfigContext as bK, type FarmIntegrationConfigDefinition as bL, type FarmIntegrationConfigInput as bM, type FarmIntegrationLifecycleLogLevel as bN, type FarmIntegrationLifecycleLogger as bO, type FarmIntegrationLifecycleContext as bP, type FarmIntegrationLifecycleHook as bQ, type FarmIntegrationData as bR, type FarmIntegrationHandlerContext as bS, type FarmIntegrationRouteHookContext as bT, type FarmIntegrationRouteHook as bU, type FarmIntegrationRoute as bV, type FarmTypedIntegrationRoute as bW, type FarmIntegrationRouteMiddleware as bX, type FarmIntegrationMiddleware as bY, type FarmIntegrationProviderProps as bZ, type FarmIntegrationProvider as b_, type RenderLifecyclePayload as ba, type APIHandlerLifecyclePayload as bb, type ErrorLifecyclePayload as bc, type HMRUpdatePayload as bd, type BundleLifecyclePayload as be, type NitroBuildLifecyclePayload as bf, type ShutdownPayload as bg, type ResolvedFarmConfig as bh, type RedirectConfig as bi, type HeaderConfig as bj, type RewriteConfig as bk, type ImageConfig as bl, type I18nConfig as bm, type MiddlewareConfig as bn, type FarmDeployConfig as bo, type ResolvedFarmDeployConfig as bp, type FarmDeployTarget as bq, type FarmIntegrationCategory as br, type FarmIntegrationSlot as bs, type FarmIntegrationRouteParamValue as bt, type FarmIntegrationRouteParams as bu, type FarmIntegrationRouteMethod as bv, type FarmIntegrationRouteInputSource as bw, type FarmIntegrationValidationPathSegment as bx, type FarmIntegrationRouteInput as by, type FarmIntegrationValidationIssue as bz, type FarmMigrationsUserConfig as c, type MemoryRateLimitStorageOptions as c$, type FarmIntegrationSchemaFieldType as c0, type FarmIntegrationSchemaReference as c1, type FarmIntegrationSchemaField as c2, type FarmIntegrationSchemaConstraint as c3, type FarmIntegrationSchemaModel as c4, type FarmIntegrationSchemaModelExtension as c5, type FarmIntegrationSchemaModelOverride as c6, type FarmIntegrationSchema as c7, defineIntegrationSchema as c8, type FarmIntegrationLogPhase as c9, matchIntegrationRoute as cA, matchRegisteredIntegrationRoute as cB, getRegisteredIntegrationAPIManifest as cC, dispatchIntegrationRequest as cD, type FarmIntegrationOrmSchema as cE, type FarmIntegrationOrmClient as cF, type InferFarmIntegrationOrmField as cG, type InferFarmIntegrationOrmFields as cH, type InferFarmIntegrationOrmSchema as cI, type InferFarmIntegrationOrmClient as cJ, type CreateIntegrationOrmOptions as cK, createIntegrationOrm as cL, resolveIntegrationOrmRuntimeClient as cM, farmIntegrationSchemaToOrmSchema as cN, type IntegrationOrmModelNames as cO, type MiddlewareContext as cP, type MiddlewareFunction as cQ, type RequestMiddleware as cR, type RequestMiddlewareContext as cS, type MiddlewareStore as cT, type MiddlewareChain as cU, type CookieJar as cV, type CookieOptions as cW, type RateLimitConfig as cX, type RateLimitIncrementResult as cY, type RateLimitStorage as cZ, type RateLimitStatus as c_, type FarmIntegrationLogEvent as ca, type FarmIntegrationLogger as cb, type FarmIntegrationPluginOwner as cc, type FarmIntegrationContributedPlugin as cd, type FarmIntegrationsUserConfig as ce, getFarmIntegrationPluginServerRuntime as cf, getFarmIntegrationPluginOwner as cg, type FarmIntegrationRouteFactory as ch, type FarmIntegrationRoutesFactoryContext as ci, type FarmIntegrationRoutesFactory as cj, type FarmIntegrationEndpointValue as ck, type FarmIntegrationEndpoints as cl, type FarmIntegrationEndpointsFactoryContext as cm, type FarmIntegrationEndpointsFactory as cn, createIntegrationRoute as co, integrationRoute as cp, type DefinedIntegration as cq, defineIntegration as cr, isFarmIntegration as cs, resolveIntegrationPlugins as ct, getIntegrationProviders as cu, getIntegrationDocumentNavigationMatchers as cv, getIntegrationSchemas as cw, getRegisteredIntegrationRuntime as cx, getRegisteredIntegrations as cy, getRegisteredIntegrationSchemas as cz, defineConfig as d, type NextFunction as d0, type MiddlewareResult as d1, type FarmRouteRuleRenderMode as d2, type FarmRouteRuleRedirect as d3, type FarmRouteRuleCors as d4, type FarmRouteRule as d5, type FarmRouteRules as d6, normalizeRouteRules as d7, routeRulesToRedirects as d8, routeRulesToHeaders as d9, routeRulesToNitroRouteRules as da, type FarmMdxComponent as db, type FarmMdxComponents as dc, type FarmMdxUserConfig as dd, type FarmMarkdownPageSource as de, type FarmMarkdownPageModuleInput as df, resolveMdxConfig as dg, isFarmMarkdownPageFile as dh, normalizeFarmMarkdownRoutePath as di, parseMarkdownFrontmatter as dj, titleFromMarkdown as dk, createMarkdownMetadata as dl, createFarmMarkdownRouteModule as dm, createFarmMarkdownRouteModuleFromFile as dn, loadFarmMdxComponents as dp, createFarmMarkdownSourceResponse as dq, DEFAULT_FARM_DEVTOOLS_SHORTCUT as dr, FARM_DEVTOOLS_PATH as ds, FARM_DEVTOOLS_LAUNCH_PARAM as dt, type FarmDevtoolsConfig as du, type FarmDevtoolsUserConfig as dv, resolveFarmDevtoolsConfig as dw, type MiddlewareConfig$1 as dx, farmI18nClientBridgePlugin as dy, rewriteEarlySsrRelativeImports as dz, type FarmContextFactoryInput as e, farmPlugin as f, type FarmContextFactory as g, type FarmAppContext as h, type PluginContextProps as i, type PageProps as j, type PagePropsWithMiddleware as k, type LayoutProps as l, type MetadataProps as m, type LayoutMetadataProps as n, type Page as o, type Layout as p, type Loading as q, type ErrorBoundary as r, type RouteModule as s, type StaticPathParams as t, type StaticRouteParams as u, type LayoutModule as v, type Metadata as w, type FarmRequest as x, type FarmResponse as y, type ServerAction as z };
2092
+ export { type FarmPlugin as $, type AppRoutePattern as A, type RouteSegment as B, type ParsedRoute as C, type BuildOptions as D, type ErrorProps as E, type FarmConfig as F, type GenerateStaticParams as G, type SSGPage as H, type SSGCollectionResult as I, type FarmLayerEntry as J, type ResolvedFarmLayer as K, type LoadingProps as L, type MiddlewareProps as M, type NitroPreset as N, type FarmSourceRoot as O, type PageRouteParams as P, type ResolveFarmLayersOptions as Q, type ResolvedFarmMigrationsConfig as R, type StaticPathPrimitive as S, type FarmLayerResolution as T, resolveFarmLayers as U, getFarmSourceRoots as V, getFarmAppDirectories as W, getFarmLayerAliases as X, loadFarmConfigFile as Y, type FarmUserConfig as Z, type BundleResultPayload as _, type FarmMigrationCommand as a, type FarmPluginRouterHooks as a$, type FarmIntegration as a0, type ReadonlyMiddlewareStore as a1, type FarmMiddlewareConfig as a2, type MiddlewareModule as a3, type FarmMdxResolvedConfig as a4, type ResolvedFarmDevtoolsConfig as a5, type ResolvedFarmAuthConfig as a6, type ResolvedFarmPerformanceConfig as a7, type ResolvedFarmSecurityConfig as a8, manageFarmDocumentPreloads as a9, type FarmAuthConfig as aA, type FarmAuthDatabaseConfig as aB, type FarmAuthEmailAndPasswordConfig as aC, type FarmAuthSessionConfig as aD, type FarmAuthUserConfig as aE, type PluginRequestContext as aF, type FarmPluginContext as aG, type FarmPluginIntegrationContext as aH, type FarmPluginLifecycle as aI, type FarmRequestPluginContext as aJ, type FarmRequestStore as aK, type FarmPluginRuntimeKind as aL, type FarmPluginRouteRuntimePayload as aM, type FarmPluginSetupContext as aN, type FarmPluginStateContext as aO, type FarmPluginRuntimeBaseEvent as aP, type FarmPluginRuntimeContextEvent as aQ, type FarmPluginRuntimeBeforeEvent as aR, type FarmPluginRuntimeAfterEvent as aS, type FarmPluginRuntimeErrorEvent as aT, type FarmPluginRuntimeStartEvent as aU, type FarmPluginRuntimeCloseEvent as aV, type FarmPluginRuntimeHooks as aW, type FarmPluginRuntimeRequestOptions as aX, type FarmPluginRuntimeRequestHandler as aY, type FarmPluginRuntimeSession as aZ, type FarmPluginDiscoveredRoute as a_, manageFarmHtmlPreloads as aa, manageFarmLinkHeaderPreloads as ab, reportFarmPreloadWarnings as ac, type OpenAPIConfig as ad, definePlugin as ae, FarmRuntimeShutdownError as af, PluginManager as ag, resolveConfig as ah, loadConfig as ai, resolveDeployConfig as aj, resolveMigrationsConfig as ak, resolveDeployOutputPath as al, normalizeDeployTarget as am, getDeployTargetForPreset as an, getPresetForDeployTarget as ao, type FarmLayerConfig as ap, type FarmPerformanceConfig as aq, type FarmPreloadMode as ar, type FarmPreloadUserConfig as as, type ResolvedFarmPreloadConfig as at, type FarmCspConfig as au, type FarmCspDirectives as av, type FarmCspDirectiveValue as aw, type FarmCspOptions as ax, type FarmSecurityConfig as ay, type ResolvedFarmCspConfig as az, type FarmMigrationsConfig as b, type FarmIntegrationDocumentNavigation as b$, type FarmPluginRenderHooks as b0, type FarmPluginBuildHooks as b1, type FarmPluginDevHooks as b2, type FarmPluginClientConfig as b3, type RouteDiscoveredPayload as b4, type RoutesGeneratedPayload as b5, type MiddlewareDiscoveredPayload as b6, type APIRouteDiscoveredPayload as b7, type RouteMatchPayload as b8, type RouteMatchResultPayload as b9, type FarmIntegrationValidationErrorLike as bA, type FarmIntegrationValidationResult as bB, type FarmIntegrationStandardValidationResult as bC, type FarmIntegrationInputSchema as bD, type FarmIntegrationRouteInputSchemas as bE, type FarmIntegrationRequestContextStore as bF, FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY as bG, type FarmIntegrationRouteDb as bH, type FarmIntegrationRouteStorageArgs as bI, type FarmIntegrationRouteArgs as bJ, type FarmIntegrationConfigContext as bK, type FarmIntegrationConfigDefinition as bL, type FarmIntegrationConfigInput as bM, type FarmIntegrationLifecycleLogLevel as bN, type FarmIntegrationLifecycleLogger as bO, type FarmIntegrationLifecycleContext as bP, type FarmIntegrationLifecycleHook as bQ, type FarmIntegrationData as bR, type FarmIntegrationHandlerContext as bS, type FarmIntegrationRouteHookContext as bT, type FarmIntegrationRouteHook as bU, type FarmIntegrationRoute as bV, type FarmTypedIntegrationRoute as bW, type FarmIntegrationRouteMiddleware as bX, type FarmIntegrationMiddleware as bY, type FarmIntegrationProviderProps as bZ, type FarmIntegrationProvider as b_, type RenderLifecyclePayload as ba, type APIHandlerLifecyclePayload as bb, type ErrorLifecyclePayload as bc, type HMRUpdatePayload as bd, type BundleLifecyclePayload as be, type NitroBuildLifecyclePayload as bf, type ShutdownPayload as bg, type ResolvedFarmConfig as bh, type RedirectConfig as bi, type HeaderConfig as bj, type RewriteConfig as bk, type ImageConfig as bl, type I18nConfig as bm, type MiddlewareConfig as bn, type FarmDeployConfig as bo, type ResolvedFarmDeployConfig as bp, type FarmDeployTarget as bq, type FarmIntegrationCategory as br, type FarmIntegrationSlot as bs, type FarmIntegrationRouteParamValue as bt, type FarmIntegrationRouteParams as bu, type FarmIntegrationRouteMethod as bv, type FarmIntegrationRouteInputSource as bw, type FarmIntegrationValidationPathSegment as bx, type FarmIntegrationRouteInput as by, type FarmIntegrationValidationIssue as bz, type FarmMigrationsUserConfig as c, type MemoryRateLimitStorageOptions as c$, type FarmIntegrationSchemaFieldType as c0, type FarmIntegrationSchemaReference as c1, type FarmIntegrationSchemaField as c2, type FarmIntegrationSchemaConstraint as c3, type FarmIntegrationSchemaModel as c4, type FarmIntegrationSchemaModelExtension as c5, type FarmIntegrationSchemaModelOverride as c6, type FarmIntegrationSchema as c7, defineIntegrationSchema as c8, type FarmIntegrationLogPhase as c9, matchIntegrationRoute as cA, matchRegisteredIntegrationRoute as cB, getRegisteredIntegrationAPIManifest as cC, dispatchIntegrationRequest as cD, type FarmIntegrationOrmSchema as cE, type FarmIntegrationOrmClient as cF, type InferFarmIntegrationOrmField as cG, type InferFarmIntegrationOrmFields as cH, type InferFarmIntegrationOrmSchema as cI, type InferFarmIntegrationOrmClient as cJ, type CreateIntegrationOrmOptions as cK, createIntegrationOrm as cL, resolveIntegrationOrmRuntimeClient as cM, farmIntegrationSchemaToOrmSchema as cN, type IntegrationOrmModelNames as cO, type MiddlewareContext as cP, type MiddlewareFunction as cQ, type RequestMiddleware as cR, type RequestMiddlewareContext as cS, type MiddlewareStore as cT, type MiddlewareChain as cU, type CookieJar as cV, type CookieOptions as cW, type RateLimitConfig as cX, type RateLimitIncrementResult as cY, type RateLimitStorage as cZ, type RateLimitStatus as c_, type FarmIntegrationLogEvent as ca, type FarmIntegrationLogger as cb, type FarmIntegrationPluginOwner as cc, type FarmIntegrationContributedPlugin as cd, type FarmIntegrationsUserConfig as ce, getFarmIntegrationPluginServerRuntime as cf, getFarmIntegrationPluginOwner as cg, type FarmIntegrationRouteFactory as ch, type FarmIntegrationRoutesFactoryContext as ci, type FarmIntegrationRoutesFactory as cj, type FarmIntegrationEndpointValue as ck, type FarmIntegrationEndpoints as cl, type FarmIntegrationEndpointsFactoryContext as cm, type FarmIntegrationEndpointsFactory as cn, createIntegrationRoute as co, integrationRoute as cp, type DefinedIntegration as cq, defineIntegration as cr, isFarmIntegration as cs, resolveIntegrationPlugins as ct, getIntegrationProviders as cu, getIntegrationDocumentNavigationMatchers as cv, getIntegrationSchemas as cw, getRegisteredIntegrationRuntime as cx, getRegisteredIntegrations as cy, getRegisteredIntegrationSchemas as cz, defineConfig as d, type NextFunction as d0, type MiddlewareResult as d1, type FarmRouteRuleRenderMode as d2, type FarmRouteRuleRedirect as d3, type FarmRouteRuleCors as d4, type FarmRouteRule as d5, type FarmRouteRules as d6, normalizeRouteRules as d7, routeRulesToRedirects as d8, routeRulesToHeaders as d9, routeRulesToNitroRouteRules as da, type FarmMdxComponent as db, type FarmMdxComponents as dc, type FarmMdxUserConfig as dd, type FarmMarkdownPageSource as de, type FarmMarkdownPageModuleInput as df, resolveMdxConfig as dg, isFarmMarkdownPageFile as dh, normalizeFarmMarkdownRoutePath as di, parseMarkdownFrontmatter as dj, titleFromMarkdown as dk, createMarkdownMetadata as dl, createFarmMarkdownRouteModule as dm, createFarmMarkdownRouteModuleFromFile as dn, loadFarmMdxComponents as dp, createFarmMarkdownSourceResponse as dq, DEFAULT_FARM_DEVTOOLS_SHORTCUT as dr, FARM_DEVTOOLS_PATH as ds, FARM_DEVTOOLS_LAUNCH_PARAM as dt, type FarmDevtoolsConfig as du, type FarmDevtoolsUserConfig as dv, resolveFarmDevtoolsConfig as dw, type MiddlewareConfig$1 as dx, farmI18nClientBridgePlugin as dy, rewriteEarlySsrRelativeImports as dz, type FarmContextFactoryInput as e, farmPlugin as f, type FarmContextFactory as g, type FarmAppContext as h, type PluginContextProps as i, type PageProps as j, type PagePropsWithMiddleware as k, type LayoutProps as l, type MetadataProps as m, type LayoutMetadataProps as n, type Page as o, type Layout as p, type Loading as q, type ErrorBoundary as r, type RouteModule as s, type StaticPathParams as t, type StaticRouteParams as u, type LayoutModule as v, type Metadata as w, type FarmRequest as x, type FarmResponse as y, type ServerAction as z };
@@ -1,5 +1,5 @@
1
1
  export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, F as FarmClientPluginManager, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './plugin-BJDf43dc.mjs';
2
- export { $ as FarmPlugin, aG as FarmPluginContext, aJ as FarmRequestPluginContext, aK as FarmRequestStore } from './client-plugins-QQntVkrv.mjs';
2
+ export { $ as FarmPlugin, aG as FarmPluginContext, aJ as FarmRequestPluginContext, aK as FarmRequestStore } from './client-plugins-CCilIb_G.mjs';
3
3
  import 'react';
4
4
  import 'http';
5
5
  import './types-D1A6-XvH.mjs';
@@ -20,5 +20,6 @@ import './server-fn-error-DDh14a0V.mjs';
20
20
  import './image-config-Duob7wER.mjs';
21
21
  import './types-BMxWr97v.mjs';
22
22
  import './cache.mjs';
23
+ import './types-CsR8fpgF.mjs';
23
24
  import './route-runtime-DoOHzCAD.mjs';
24
25
  import './font.mjs';
@@ -1,5 +1,5 @@
1
1
  export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, F as FarmClientPluginManager, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './plugin-BJDf43dc.js';
2
- export { $ as FarmPlugin, aG as FarmPluginContext, aJ as FarmRequestPluginContext, aK as FarmRequestStore } from './client-plugins-CbRum1fj.js';
2
+ export { $ as FarmPlugin, aG as FarmPluginContext, aJ as FarmRequestPluginContext, aK as FarmRequestStore } from './client-plugins-DuuleQKk.js';
3
3
  import 'react';
4
4
  import 'http';
5
5
  import './types-D1A6-XvH.js';
@@ -20,5 +20,6 @@ import './server-fn-error-DDh14a0V.js';
20
20
  import './image-config-Duob7wER.js';
21
21
  import './types-BMxWr97v.js';
22
22
  import './cache.js';
23
+ import './types-CsR8fpgF.js';
23
24
  import './route-runtime-DoOHzCAD.js';
24
25
  import './font.js';