/**
 * Next.js shim constants
 * Static HTML/JS strings used by NextDevServer for browser-side Next.js emulation.
 * These are injected into generated HTML pages as inline scripts or served as virtual modules.
 */
/**
 * Tailwind CSS CDN script for runtime JIT compilation
 */
export declare const TAILWIND_CDN_SCRIPT = "<script src=\"https://cdn.tailwindcss.com\"></script>";
/**
 * CORS Proxy script - provides proxyFetch function in the iframe
 * Reads proxy URL from localStorage (set by parent window)
 */
export declare const CORS_PROXY_SCRIPT = "\n<script>\n  // CORS Proxy support for external API calls\n  window.__getCorsProxy = function() {\n    return localStorage.getItem('__corsProxyUrl') || null;\n  };\n\n  window.__setCorsProxy = function(url) {\n    if (url) {\n      localStorage.setItem('__corsProxyUrl', url);\n    } else {\n      localStorage.removeItem('__corsProxyUrl');\n    }\n  };\n\n  window.__proxyFetch = async function(url, options) {\n    const proxyUrl = window.__getCorsProxy();\n    if (proxyUrl) {\n      const proxiedUrl = proxyUrl + encodeURIComponent(url);\n      return fetch(proxiedUrl, options);\n    }\n    return fetch(url, options);\n  };\n</script>\n";
/**
 * React Refresh preamble - MUST run before React is loaded
 */
export declare const REACT_REFRESH_PREAMBLE = "\n<script type=\"module\">\n// Block until React Refresh is loaded and initialized\nconst RefreshRuntime = await import('https://esm.sh/react-refresh@0.14.0/runtime').then(m => m.default || m);\n\nRefreshRuntime.injectIntoGlobalHook(window);\nwindow.$RefreshRuntime$ = RefreshRuntime;\nwindow.$RefreshRegCount$ = 0;\n\nwindow.$RefreshReg$ = (type, id) => {\n  window.$RefreshRegCount$++;\n  RefreshRuntime.register(type, id);\n};\n\nwindow.$RefreshSig$ = () => (type) => type;\n\nconsole.log('[HMR] React Refresh initialized');\n</script>\n";
/**
 * HMR client script for Next.js
 */
export declare const HMR_CLIENT_SCRIPT = "\n<script type=\"module\">\n(function() {\n  const hotModules = new Map();\n  const pendingUpdates = new Map();\n\n  window.__vite_hot_context__ = function createHotContext(ownerPath) {\n    if (hotModules.has(ownerPath)) {\n      return hotModules.get(ownerPath);\n    }\n\n    const hot = {\n      data: {},\n      accept(callback) {\n        hot._acceptCallback = callback;\n      },\n      dispose(callback) {\n        hot._disposeCallback = callback;\n      },\n      invalidate() {\n        location.reload();\n      },\n      prune(callback) {\n        hot._pruneCallback = callback;\n      },\n      on(event, cb) {},\n      off(event, cb) {},\n      send(event, data) {},\n      _acceptCallback: null,\n      _disposeCallback: null,\n      _pruneCallback: null,\n    };\n\n    hotModules.set(ownerPath, hot);\n    return hot;\n  };\n\n  // This preview's own virtual port: with several sandboxes live, updates\n  // from another sandbox's dev server must be ignored even if a stale HMR\n  // target still points at this window.\n  var __hmrPortMatch = location.pathname.match(/\\/__virtual__\\/(\\d+)\\//);\n  var __hmrOwnPort = __hmrPortMatch ? Number(__hmrPortMatch[1]) : null;\n\n  // Listen for HMR updates via postMessage (works with sandboxed iframes)\n  window.addEventListener('message', async (event) => {\n    // Filter for HMR messages only\n    if (!event.data || event.data.channel !== 'next-hmr') return;\n    if (\n      __hmrOwnPort !== null &&\n      typeof event.data.port === 'number' &&\n      event.data.port !== __hmrOwnPort\n    ) return;\n    const { type, path, timestamp } = event.data;\n\n    if (type === 'update') {\n      console.log('[HMR] Update:', path);\n\n      if (path.endsWith('.css')) {\n        const links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n        links.forEach(link => {\n          const href = link.getAttribute('href');\n          if (href && href.includes(path.replace(/^\\//, ''))) {\n            link.href = href.split('?')[0] + '?t=' + timestamp;\n          }\n        });\n\n        const styles = document.querySelectorAll('style[data-next-dev-id]');\n        styles.forEach(style => {\n          const id = style.getAttribute('data-next-dev-id');\n          if (id && id.includes(path.replace(/^\\//, ''))) {\n            import(path + '?t=' + timestamp).catch(() => {});\n          }\n        });\n      } else if (path.match(/\\.(jsx?|tsx?)$/)) {\n        await handleJSUpdate(path, timestamp);\n      }\n    } else if (type === 'full-reload') {\n      console.log('[HMR] Full reload');\n      location.reload();\n    }\n  });\n\n  async function handleJSUpdate(path, timestamp) {\n    const normalizedPath = path.startsWith('/') ? path : '/' + path;\n    const hot = hotModules.get(normalizedPath);\n\n    try {\n      if (hot && hot._disposeCallback) {\n        hot._disposeCallback(hot.data);\n      }\n\n      if (window.$RefreshRuntime$) {\n        pendingUpdates.set(normalizedPath, timestamp);\n\n        if (pendingUpdates.size === 1) {\n          setTimeout(async () => {\n            try {\n              for (const [modulePath, ts] of pendingUpdates) {\n                const moduleUrl = '.' + modulePath + '?t=' + ts;\n                await import(moduleUrl);\n              }\n\n              window.$RefreshRuntime$.performReactRefresh();\n              console.log('[HMR] Updated', pendingUpdates.size, 'module(s)');\n\n              pendingUpdates.clear();\n            } catch (error) {\n              console.error('[HMR] Failed to apply update:', error);\n              pendingUpdates.clear();\n              location.reload();\n            }\n          }, 30);\n        }\n      } else {\n        console.log('[HMR] React Refresh not available, reloading page');\n        location.reload();\n      }\n    } catch (error) {\n      console.error('[HMR] Update failed:', error);\n      location.reload();\n    }\n  }\n\n  console.log('[HMR] Next.js client ready');\n})();\n</script>\n";
/**
 * Next.js Link shim code
 */
export declare const NEXT_LINK_SHIM = "\nimport React from 'react';\n\nconst getVirtualBasePath = () => {\n  const match = window.location.pathname.match(/^.*\\/__virtual__\\/\\d+(?:\\/|$)/);\n  if (!match) return '';\n  return match[0].endsWith('/') ? match[0] : match[0] + '/';\n};\n\nconst getBasePath = () => window.__NEXT_BASE_PATH__ || '';\n\nconst applyVirtualBase = (url) => {\n  if (typeof url !== 'string') return url;\n  if (!url || url.startsWith('#') || url.startsWith('?')) return url;\n  if (/^(https?:)?\\/\\//.test(url)) return url;\n\n  // Apply basePath first\n  const bp = getBasePath();\n  if (bp && url.startsWith('/') && !url.startsWith(bp + '/') && url !== bp) {\n    url = bp + url;\n  }\n\n  const base = getVirtualBasePath();\n  if (!base) return url;\n  if (url.startsWith(base)) return url;\n  if (url.startsWith('/')) return base + url.slice(1);\n  return base + url;\n};\n\nexport default function Link({ href, children, ...props }) {\n  const handleClick = (e) => {\n    console.log('[Link] Click handler called, href:', href);\n\n    if (props.onClick) {\n      props.onClick(e);\n    }\n\n    // Allow cmd/ctrl click to open in new tab\n    if (e.metaKey || e.ctrlKey) {\n      console.log('[Link] Meta/Ctrl key pressed, allowing default behavior');\n      return;\n    }\n\n    if (typeof href !== 'string' || !href || href.startsWith('#') || href.startsWith('?')) {\n      console.log('[Link] Skipping navigation for href:', href);\n      return;\n    }\n\n    if (/^(https?:)?\\/\\//.test(href)) {\n      console.log('[Link] External URL, allowing default behavior:', href);\n      return;\n    }\n\n    e.preventDefault();\n    const resolvedHref = applyVirtualBase(href);\n    console.log('[Link] Navigating to:', resolvedHref);\n    window.history.pushState({}, '', resolvedHref);\n    window.dispatchEvent(new PopStateEvent('popstate'));\n  };\n\n  return React.createElement('a', { href, onClick: handleClick, ...props }, children);\n}\n\nexport { Link };\n";
/**
 * Next.js Router shim code
 */
export declare const NEXT_ROUTER_SHIM = "\nimport React, { useState, useEffect, createContext, useContext } from 'react';\n\nconst RouterContext = createContext(null);\n\nconst getVirtualBasePath = () => {\n  const match = window.location.pathname.match(/^.*\\/__virtual__\\/\\d+(?:\\/|$)/);\n  if (!match) return '';\n  return match[0].endsWith('/') ? match[0] : match[0] + '/';\n};\n\nconst applyVirtualBase = (url) => {\n  if (typeof url !== 'string') return url;\n  if (!url || url.startsWith('#') || url.startsWith('?')) return url;\n  if (/^(https?:)?\\/\\//.test(url)) return url;\n\n  const base = getVirtualBasePath();\n  if (!base) return url;\n  if (url.startsWith(base)) return url;\n  if (url.startsWith('/')) return base + url.slice(1);\n  return base + url;\n};\n\nconst stripVirtualBase = (pathname) => {\n  const match = pathname.match(/^.*\\/__virtual__\\/\\d+(?:\\/|$)/);\n  if (!match) return pathname;\n  return '/' + pathname.slice(match[0].length);\n};\n\nexport function useRouter() {\n  const [pathname, setPathname] = useState(\n    typeof window !== 'undefined' ? stripVirtualBase(window.location.pathname) : '/'\n  );\n  const [query, setQuery] = useState({});\n\n  useEffect(() => {\n    const updateRoute = () => {\n      setPathname(stripVirtualBase(window.location.pathname));\n      setQuery(Object.fromEntries(new URLSearchParams(window.location.search)));\n    };\n\n    window.addEventListener('popstate', updateRoute);\n    updateRoute();\n\n    return () => window.removeEventListener('popstate', updateRoute);\n  }, []);\n\n  return {\n    pathname,\n    query,\n    asPath: pathname + window.location.search,\n    push: (url, as, options) => {\n      if (typeof url === 'string' && /^(https?:)?\\/\\//.test(url)) {\n        window.location.href = url;\n        return Promise.resolve(true);\n      }\n      const resolvedUrl = applyVirtualBase(url);\n      window.history.pushState({}, '', resolvedUrl);\n      window.dispatchEvent(new PopStateEvent('popstate'));\n      return Promise.resolve(true);\n    },\n    replace: (url, as, options) => {\n      if (typeof url === 'string' && /^(https?:)?\\/\\//.test(url)) {\n        window.location.href = url;\n        return Promise.resolve(true);\n      }\n      const resolvedUrl = applyVirtualBase(url);\n      window.history.replaceState({}, '', resolvedUrl);\n      window.dispatchEvent(new PopStateEvent('popstate'));\n      return Promise.resolve(true);\n    },\n    prefetch: () => Promise.resolve(),\n    back: () => window.history.back(),\n    forward: () => window.history.forward(),\n    reload: () => window.location.reload(),\n    events: {\n      on: () => {},\n      off: () => {},\n      emit: () => {},\n    },\n    isFallback: false,\n    isReady: true,\n    isPreview: false,\n  };\n}\n\nexport const Router = {\n  events: {\n    on: () => {},\n    off: () => {},\n    emit: () => {},\n  },\n  push: (url) => {\n    if (typeof url === 'string' && /^(https?:)?\\/\\//.test(url)) {\n      window.location.href = url;\n      return Promise.resolve(true);\n    }\n    const resolvedUrl = applyVirtualBase(url);\n    window.history.pushState({}, '', resolvedUrl);\n    window.dispatchEvent(new PopStateEvent('popstate'));\n    return Promise.resolve(true);\n  },\n  replace: (url) => {\n    if (typeof url === 'string' && /^(https?:)?\\/\\//.test(url)) {\n      window.location.href = url;\n      return Promise.resolve(true);\n    }\n    const resolvedUrl = applyVirtualBase(url);\n    window.history.replaceState({}, '', resolvedUrl);\n    window.dispatchEvent(new PopStateEvent('popstate'));\n    return Promise.resolve(true);\n  },\n};\n\nexport default { useRouter, Router };\n";
/**
 * Next.js Navigation shim code (App Router)
 *
 * This shim provides App Router-specific navigation hooks from 'next/navigation'.
 * These are DIFFERENT from the Pages Router hooks in 'next/router':
 *
 * Pages Router (next/router):
 *   - useRouter() returns { pathname, query, push, replace, events, ... }
 *   - Has router.events for route change subscriptions
 *   - query object contains URL params
 *
 * App Router (next/navigation):
 *   - useRouter() returns { push, replace, back, forward, refresh, prefetch }
 *   - usePathname() for current path
 *   - useSearchParams() for URL search params
 *   - useParams() for dynamic route segments
 *   - No events - use useEffect with pathname/searchParams instead
 *
 * @see https://nextjs.org/docs/app/api-reference/functions/use-router
 */
export declare const NEXT_NAVIGATION_SHIM = "\nimport React, { useState, useEffect, useCallback, useMemo } from 'react';\n\nconst getVirtualBasePath = () => {\n  const match = window.location.pathname.match(/^.*\\/__virtual__\\/\\d+(?:\\/|$)/);\n  if (!match) return '';\n  return match[0].endsWith('/') ? match[0] : match[0] + '/';\n};\n\nconst applyVirtualBase = (url) => {\n  if (typeof url !== 'string') return url;\n  if (!url || url.startsWith('#') || url.startsWith('?')) return url;\n  if (/^(https?:)?\\/\\//.test(url)) return url;\n\n  const base = getVirtualBasePath();\n  if (!base) return url;\n  if (url.startsWith(base)) return url;\n  if (url.startsWith('/')) return base + url.slice(1);\n  return base + url;\n};\n\nconst stripVirtualBase = (pathname) => {\n  const match = pathname.match(/^.*\\/__virtual__\\/\\d+(?:\\/|$)/);\n  if (!match) return pathname;\n  return '/' + pathname.slice(match[0].length);\n};\n\n/**\n * App Router's useRouter hook\n * Returns navigation methods only (no pathname, no query)\n * Use usePathname() and useSearchParams() for URL info\n */\nexport function useRouter() {\n  const push = useCallback((url, options) => {\n    if (typeof url === 'string' && /^(https?:)?\\/\\//.test(url)) {\n      window.location.href = url;\n      return;\n    }\n    const resolvedUrl = applyVirtualBase(url);\n    window.history.pushState({}, '', resolvedUrl);\n    window.dispatchEvent(new PopStateEvent('popstate'));\n  }, []);\n\n  const replace = useCallback((url, options) => {\n    if (typeof url === 'string' && /^(https?:)?\\/\\//.test(url)) {\n      window.location.href = url;\n      return;\n    }\n    const resolvedUrl = applyVirtualBase(url);\n    window.history.replaceState({}, '', resolvedUrl);\n    window.dispatchEvent(new PopStateEvent('popstate'));\n  }, []);\n\n  const back = useCallback(() => window.history.back(), []);\n  const forward = useCallback(() => window.history.forward(), []);\n  const refresh = useCallback(() => window.location.reload(), []);\n  const prefetch = useCallback(() => Promise.resolve(), []);\n\n  return useMemo(() => ({\n    push,\n    replace,\n    back,\n    forward,\n    refresh,\n    prefetch,\n  }), [push, replace, back, forward, refresh, prefetch]);\n}\n\n/**\n * usePathname - Returns the current URL pathname\n * Reactively updates when navigation occurs\n * @example const pathname = usePathname(); // '/dashboard/settings'\n */\nexport function usePathname() {\n  const [pathname, setPathname] = useState(\n    typeof window !== 'undefined' ? stripVirtualBase(window.location.pathname) : '/'\n  );\n\n  useEffect(() => {\n    const handler = () => setPathname(stripVirtualBase(window.location.pathname));\n    window.addEventListener('popstate', handler);\n    return () => window.removeEventListener('popstate', handler);\n  }, []);\n\n  return pathname;\n}\n\n/**\n * useSearchParams - Returns the current URL search parameters\n * @example const searchParams = useSearchParams();\n *          const query = searchParams.get('q'); // '?q=hello' -> 'hello'\n */\nexport function useSearchParams() {\n  const [searchParams, setSearchParams] = useState(() => {\n    if (typeof window === 'undefined') return new URLSearchParams();\n    return new URLSearchParams(window.location.search);\n  });\n\n  useEffect(() => {\n    const handler = () => {\n      setSearchParams(new URLSearchParams(window.location.search));\n    };\n    window.addEventListener('popstate', handler);\n    return () => window.removeEventListener('popstate', handler);\n  }, []);\n\n  return searchParams;\n}\n\n/**\n * useParams - Returns dynamic route parameters\n * For route /users/[id]/page.jsx with URL /users/123:\n * @example const { id } = useParams(); // { id: '123' }\n *\n * Fetches params from the server's route-info endpoint for dynamic routes.\n */\nexport function useParams() {\n  const [params, setParams] = useState(() => {\n    // Check if initial params were embedded by the server\n    if (typeof window !== 'undefined' && window.__NEXT_ROUTE_PARAMS__) {\n      return window.__NEXT_ROUTE_PARAMS__;\n    }\n    return {};\n  });\n\n  useEffect(() => {\n    let cancelled = false;\n\n    const fetchParams = async () => {\n      const pathname = stripVirtualBase(window.location.pathname);\n      const base = getVirtualBasePath();\n      const baseUrl = base ? base.replace(/\\/$/, '') : '';\n\n      try {\n        const response = await fetch(baseUrl + '/_next/route-info?pathname=' + encodeURIComponent(pathname));\n        const info = await response.json();\n        if (!cancelled && info.params) {\n          setParams(info.params);\n        }\n      } catch (e) {\n        // Silently fail - static routes won't have params\n      }\n    };\n\n    fetchParams();\n\n    const handler = () => fetchParams();\n    window.addEventListener('popstate', handler);\n    return () => {\n      cancelled = true;\n      window.removeEventListener('popstate', handler);\n    };\n  }, []);\n\n  return params;\n}\n\n/**\n * useSelectedLayoutSegment - Returns the active child segment one level below\n * Useful for styling active nav items in layouts\n * @example For /dashboard/settings, returns 'settings' in dashboard layout\n */\nexport function useSelectedLayoutSegment() {\n  const pathname = usePathname();\n  const segments = pathname.split('/').filter(Boolean);\n  return segments[0] || null;\n}\n\n/**\n * useSelectedLayoutSegments - Returns all active child segments\n * @example For /dashboard/settings/profile, returns ['dashboard', 'settings', 'profile']\n */\nexport function useSelectedLayoutSegments() {\n  const pathname = usePathname();\n  return pathname.split('/').filter(Boolean);\n}\n\n/**\n * redirect - Programmatic redirect (typically used in Server Components)\n * In this browser implementation, performs immediate navigation\n */\nexport function redirect(url) {\n  if (typeof url === 'string' && /^(https?:)?\\/\\//.test(url)) {\n    window.location.href = url;\n    return;\n  }\n  window.location.href = applyVirtualBase(url);\n}\n\n/**\n * notFound - Trigger the not-found UI\n * In this browser implementation, throws an error\n */\nexport function notFound() {\n  throw new Error('NEXT_NOT_FOUND');\n}\n\n// Re-export Link for convenience (can import from next/navigation or next/link)\nexport { default as Link } from 'next/link';\n";
/**
 * Next.js Head shim code
 */
export declare const NEXT_HEAD_SHIM = "\nimport React, { useEffect } from 'react';\n\nexport default function Head({ children }) {\n  useEffect(() => {\n    // Process children and update document.head\n    React.Children.forEach(children, (child) => {\n      if (!React.isValidElement(child)) return;\n\n      const { type, props } = child;\n\n      if (type === 'title' && props.children) {\n        document.title = Array.isArray(props.children)\n          ? props.children.join('')\n          : props.children;\n      } else if (type === 'meta') {\n        const existingMeta = props.name\n          ? document.querySelector(`meta[name=\"${props.name}\"]`)\n          : props.property\n            ? document.querySelector(`meta[property=\"${props.property}\"]`)\n            : null;\n\n        if (existingMeta) {\n          Object.keys(props).forEach(key => {\n            existingMeta.setAttribute(key, props[key]);\n          });\n        } else {\n          const meta = document.createElement('meta');\n          Object.keys(props).forEach(key => {\n            meta.setAttribute(key, props[key]);\n          });\n          document.head.appendChild(meta);\n        }\n      } else if (type === 'link') {\n        const link = document.createElement('link');\n        Object.keys(props).forEach(key => {\n          link.setAttribute(key, props[key]);\n        });\n        document.head.appendChild(link);\n      }\n    });\n  }, [children]);\n\n  return null;\n}\n";
/**
 * Next.js Image shim code
 * Provides a simple img-based implementation of next/image
 */
export declare const NEXT_IMAGE_SHIM = "\nimport React from 'react';\n\nfunction Image({\n  src,\n  alt = '',\n  width,\n  height,\n  fill,\n  loader,\n  quality = 75,\n  priority,\n  loading,\n  placeholder,\n  blurDataURL,\n  unoptimized,\n  onLoad,\n  onError,\n  style,\n  className,\n  sizes,\n  ...rest\n}) {\n  // Handle src - could be string or StaticImageData object\n  const imageSrc = typeof src === 'object' ? src.src : src;\n\n  // Build style object\n  const imgStyle = { ...style };\n  if (fill) {\n    imgStyle.position = 'absolute';\n    imgStyle.width = '100%';\n    imgStyle.height = '100%';\n    imgStyle.objectFit = imgStyle.objectFit || 'cover';\n    imgStyle.inset = '0';\n  }\n\n  return React.createElement('img', {\n    src: imageSrc,\n    alt,\n    width: fill ? undefined : width,\n    height: fill ? undefined : height,\n    loading: priority ? 'eager' : (loading || 'lazy'),\n    decoding: 'async',\n    style: imgStyle,\n    className,\n    onLoad,\n    onError,\n    ...rest\n  });\n}\n\nexport default Image;\nexport { Image };\n";
/**
 * next/dynamic shim - Dynamic imports with loading states
 */
export declare const NEXT_DYNAMIC_SHIM = "\nimport React from 'react';\n\nfunction dynamic(importFn, options = {}) {\n  const {\n    loading: LoadingComponent,\n    ssr = true,\n  } = options;\n\n  // Create a lazy component\n  const LazyComponent = React.lazy(importFn);\n\n  // Wrapper component that handles loading state\n  function DynamicComponent(props) {\n    const fallback = LoadingComponent\n      ? React.createElement(LoadingComponent, { isLoading: true })\n      : null;\n\n    return React.createElement(\n      React.Suspense,\n      { fallback },\n      React.createElement(LazyComponent, props)\n    );\n  }\n\n  return DynamicComponent;\n}\n\nexport default dynamic;\nexport { dynamic };\n";
/**
 * next/script shim - Loads external scripts
 */
export declare const NEXT_SCRIPT_SHIM = "\nimport React from 'react';\n\nfunction Script({\n  src,\n  strategy = 'afterInteractive',\n  onLoad,\n  onReady,\n  onError,\n  children,\n  dangerouslySetInnerHTML,\n  ...rest\n}) {\n  React.useEffect(function() {\n    if (!src && !children && !dangerouslySetInnerHTML) return;\n\n    var script = document.createElement('script');\n\n    if (src) {\n      script.src = src;\n      script.async = strategy !== 'beforeInteractive';\n    }\n\n    Object.keys(rest).forEach(function(key) {\n      script.setAttribute(key, rest[key]);\n    });\n\n    if (children) {\n      script.textContent = children;\n    } else if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) {\n      script.textContent = dangerouslySetInnerHTML.__html;\n    }\n\n    script.onload = function() {\n      if (onLoad) onLoad();\n      if (onReady) onReady();\n    };\n    script.onerror = onError;\n\n    document.head.appendChild(script);\n\n    return function() {\n      if (script.parentNode) {\n        script.parentNode.removeChild(script);\n      }\n    };\n  }, [src]);\n\n  return null;\n}\n\nexport default Script;\nexport { Script };\n";
/**
 * next/font/google shim - Loads Google Fonts via CDN
 * Uses a Proxy to dynamically handle ANY Google Font without hardcoding
 */
export declare const NEXT_FONT_GOOGLE_SHIM = "\n// Track loaded fonts to avoid duplicate style injections\nconst loadedFonts = new Set();\n\n/**\n * Convert font function name to Google Fonts family name\n * Examples:\n *   DM_Sans -> DM Sans\n *   Open_Sans -> Open Sans\n *   Fraunces -> Fraunces\n */\nfunction toFontFamily(fontName) {\n  return fontName.replace(/_/g, ' ');\n}\n\n/**\n * Inject font CSS into document\n * - Adds preconnect links for faster font loading\n * - Loads the font from Google Fonts CDN\n * - Creates a CSS class that sets the CSS variable\n */\nfunction injectFontCSS(fontFamily, variableName, weight, style) {\n  const fontKey = fontFamily + '-' + (variableName || 'default');\n  if (loadedFonts.has(fontKey)) {\n    return;\n  }\n  loadedFonts.add(fontKey);\n\n  if (typeof document === 'undefined') {\n    return;\n  }\n\n  // Add preconnect links for faster loading (only once)\n  if (!document.querySelector('link[href=\"https://fonts.googleapis.com\"]')) {\n    const preconnect1 = document.createElement('link');\n    preconnect1.rel = 'preconnect';\n    preconnect1.href = 'https://fonts.googleapis.com';\n    document.head.appendChild(preconnect1);\n\n    const preconnect2 = document.createElement('link');\n    preconnect2.rel = 'preconnect';\n    preconnect2.href = 'https://fonts.gstatic.com';\n    preconnect2.crossOrigin = 'anonymous';\n    document.head.appendChild(preconnect2);\n  }\n\n  // Build Google Fonts URL\n  const escapedFamily = fontFamily.replace(/ /g, '+');\n\n  // Build axis list based on options\n  let axisList = '';\n  const axes = [];\n\n  // Handle italic style\n  if (style === 'italic') {\n    axes.push('ital');\n  }\n\n  // Handle weight - use specific weight or variable range\n  if (weight && weight !== '400' && !Array.isArray(weight)) {\n    // Specific weight requested\n    axes.push('wght');\n    if (style === 'italic') {\n      axisList = ':ital,wght@1,' + weight;\n    } else {\n      axisList = ':wght@' + weight;\n    }\n  } else if (Array.isArray(weight)) {\n    // Multiple weights\n    axes.push('wght');\n    axisList = ':wght@' + weight.join(';');\n  } else {\n    // Default: request common weights for flexibility\n    axisList = ':wght@400;500;600;700';\n  }\n\n  const fontUrl = 'https://fonts.googleapis.com/css2?family=' +\n    escapedFamily + axisList + '&display=swap';\n\n  // Add link element for Google Fonts (if not already present)\n  if (!document.querySelector('link[href*=\"family=' + escapedFamily + '\"]')) {\n    const link = document.createElement('link');\n    link.rel = 'stylesheet';\n    link.href = fontUrl;\n    document.head.appendChild(link);\n  }\n\n  // Create style element for CSS variable at :root level (globally available)\n  // This makes the variable work without needing to apply the class to body\n  if (variableName) {\n    const styleEl = document.createElement('style');\n    styleEl.setAttribute('data-font-var', variableName);\n    styleEl.textContent = ':root { ' + variableName + ': \"' + fontFamily + '\", ' + (fontFamily.includes('Serif') ? 'serif' : 'sans-serif') + '; }';\n    document.head.appendChild(styleEl);\n  }\n}\n\n/**\n * Create a font loader function for a specific font\n */\nfunction createFontLoader(fontName) {\n  const fontFamily = toFontFamily(fontName);\n\n  return function(options = {}) {\n    const {\n      weight,\n      style = 'normal',\n      subsets = ['latin'],\n      variable,\n      display = 'swap',\n      preload = true,\n      fallback = ['sans-serif'],\n      adjustFontFallback = true\n    } = options;\n\n    // Inject the font CSS\n    injectFontCSS(fontFamily, variable, weight, style);\n\n    // Generate class name from variable (--font-inter -> __font-inter)\n    const className = variable\n      ? variable.replace('--', '__')\n      : '__font-' + fontName.toLowerCase().replace(/_/g, '-');\n\n    return {\n      className,\n      variable: className,\n      style: {\n        fontFamily: '\"' + fontFamily + '\", ' + fallback.join(', ')\n      }\n    };\n  };\n}\n\n/**\n * Use a Proxy to dynamically create font loaders for ANY font name\n * This allows: import { AnyGoogleFont } from \"next/font/google\"\n */\nconst fontProxy = new Proxy({}, {\n  get(target, prop) {\n    // Handle special properties\n    if (prop === '__esModule') return true;\n    if (prop === 'default') return fontProxy;\n    if (typeof prop !== 'string') return undefined;\n\n    // Create a font loader for this font name\n    return createFontLoader(prop);\n  }\n});\n\n// Export the proxy as both default and named exports\nexport default fontProxy;\n\n// Re-export through proxy for named imports\nexport const {\n  Fraunces, Inter, DM_Sans, DM_Serif_Text, Roboto, Open_Sans, Lato,\n  Montserrat, Poppins, Playfair_Display, Merriweather, Raleway, Nunito,\n  Ubuntu, Oswald, Quicksand, Work_Sans, Fira_Sans, Barlow, Mulish, Rubik,\n  Noto_Sans, Manrope, Space_Grotesk, Geist, Geist_Mono\n} = fontProxy;\n";
/**
 * next/font/local shim - Loads local font files
 * Accepts font source path and creates @font-face declaration + CSS variable
 */
export declare const NEXT_FONT_LOCAL_SHIM = "\nconst loadedLocalFonts = new Set();\n\nfunction localFont(options = {}) {\n  const {\n    src,\n    weight,\n    style = 'normal',\n    variable,\n    display = 'swap',\n    fallback = ['sans-serif'],\n    declarations = [],\n    adjustFontFallback = true\n  } = options;\n\n  // Determine font family name from variable or src\n  const familyName = variable\n    ? variable.replace('--', '').replace(/-/g, ' ')\n    : 'local-font-' + Math.random().toString(36).slice(2, 8);\n\n  const fontKey = familyName + '-' + (variable || 'default');\n  if (typeof document !== 'undefined' && !loadedLocalFonts.has(fontKey)) {\n    loadedLocalFonts.add(fontKey);\n\n    // Build @font-face declarations\n    let fontFaces = '';\n\n    if (typeof src === 'string') {\n      // Single source\n      fontFaces = '@font-face {\\n' +\n        '  font-family: \"' + familyName + '\";\\n' +\n        '  src: url(\"' + src + '\");\\n' +\n        '  font-weight: ' + (weight || '400') + ';\\n' +\n        '  font-style: ' + style + ';\\n' +\n        '  font-display: ' + display + ';\\n' +\n        '}';\n    } else if (Array.isArray(src)) {\n      // Multiple sources (different weights/styles)\n      fontFaces = src.map(function(s) {\n        const path = typeof s === 'string' ? s : s.path;\n        const w = (typeof s === 'object' && s.weight) || weight || '400';\n        const st = (typeof s === 'object' && s.style) || style;\n        return '@font-face {\\n' +\n          '  font-family: \"' + familyName + '\";\\n' +\n          '  src: url(\"' + path + '\");\\n' +\n          '  font-weight: ' + w + ';\\n' +\n          '  font-style: ' + st + ';\\n' +\n          '  font-display: ' + display + ';\\n' +\n          '}';\n      }).join('\\n');\n    }\n\n    // Inject font-face CSS\n    if (fontFaces) {\n      var styleEl = document.createElement('style');\n      styleEl.setAttribute('data-local-font', fontKey);\n      styleEl.textContent = fontFaces;\n      document.head.appendChild(styleEl);\n    }\n\n    // Inject CSS variable at :root level\n    if (variable) {\n      var varStyle = document.createElement('style');\n      varStyle.setAttribute('data-font-var', variable);\n      varStyle.textContent = ':root { ' + variable + ': \"' + familyName + '\", ' + fallback.join(', ') + '; }';\n      document.head.appendChild(varStyle);\n    }\n  }\n\n  const className = variable\n    ? variable.replace('--', '__')\n    : '__font-' + familyName.toLowerCase().replace(/\\s+/g, '-');\n\n  return {\n    className,\n    variable: className,\n    style: {\n      fontFamily: '\"' + familyName + '\", ' + fallback.join(', ')\n    }\n  };\n}\n\nexport default localFont;\nexport { localFont };\n";
//# sourceMappingURL=next-shims.d.ts.map