Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
No EOL
6.7 KiB
Text
1 line
No EOL
6.7 KiB
Text
{"version":3,"sources":["../../../src/shared/lib/image-loader.ts"],"sourcesContent":["import type { ImageLoaderPropsWithConfig } from './image-config'\nimport { findClosestQuality } from './find-closest-quality'\n\nfunction defaultLoader({\n config,\n src,\n width,\n quality,\n}: ImageLoaderPropsWithConfig): string {\n if (\n src.startsWith('/') &&\n src.includes('?') &&\n config.localPatterns?.length === 1 &&\n config.localPatterns[0].pathname === '**' &&\n config.localPatterns[0].search === ''\n ) {\n throw new Error(\n `Image with src \"${src}\" is using a query string which is not configured in images.localPatterns.` +\n `\\nRead more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`\n )\n }\n\n if (process.env.NODE_ENV !== 'production') {\n const missingValues = []\n\n // these should always be provided but make sure they are\n if (!src) missingValues.push('src')\n if (!width) missingValues.push('width')\n\n if (missingValues.length > 0) {\n throw new Error(\n `Next Image Optimization requires ${missingValues.join(\n ', '\n )} to be provided. Make sure you pass them as props to the \\`next/image\\` component. Received: ${JSON.stringify(\n { src, width, quality }\n )}`\n )\n }\n\n if (src.startsWith('//')) {\n throw new Error(\n `Failed to parse src \"${src}\" on \\`next/image\\`, protocol-relative URL (//) must be changed to an absolute URL (http:// or https://)`\n )\n }\n\n if (src.startsWith('/') && config.localPatterns) {\n if (\n process.env.NODE_ENV !== 'test' &&\n // micromatch isn't compatible with edge runtime\n process.env.NEXT_RUNTIME !== 'edge'\n ) {\n // We use dynamic require because this should only error in development\n const { hasLocalMatch } =\n require('./match-local-pattern') as typeof import('./match-local-pattern')\n if (!hasLocalMatch(config.localPatterns, src)) {\n throw new Error(\n `Invalid src prop (${src}) on \\`next/image\\` does not match \\`images.localPatterns\\` configured in your \\`next.config.js\\`\\n` +\n `See more info: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`\n )\n }\n }\n }\n\n if (!src.startsWith('/') && (config.domains || config.remotePatterns)) {\n let parsedSrc: URL\n try {\n parsedSrc = new URL(src)\n } catch (err) {\n console.error(err)\n throw new Error(\n `Failed to parse src \"${src}\" on \\`next/image\\`, if using relative image it must start with a leading slash \"/\" or be an absolute URL (http:// or https://)`\n )\n }\n\n if (\n process.env.NODE_ENV !== 'test' &&\n // micromatch isn't compatible with edge runtime\n process.env.NEXT_RUNTIME !== 'edge'\n ) {\n // We use dynamic require because this should only error in development\n const { hasRemoteMatch } =\n require('./match-remote-pattern') as typeof import('./match-remote-pattern')\n if (\n !hasRemoteMatch(config.domains!, config.remotePatterns!, parsedSrc)\n ) {\n throw new Error(\n `Invalid src prop (${src}) on \\`next/image\\`, hostname \"${parsedSrc.hostname}\" is not configured under images in your \\`next.config.js\\`\\n` +\n `See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host`\n )\n }\n }\n }\n }\n\n const q = findClosestQuality(quality, config)\n\n return `${config.path}?url=${encodeURIComponent(src)}&w=${width}&q=${q}${\n src.startsWith('/_next/static/media/') && process.env.NEXT_DEPLOYMENT_ID\n ? `&dpl=${process.env.NEXT_DEPLOYMENT_ID}`\n : ''\n }`\n}\n\n// We use this to determine if the import is the default loader\n// or a custom loader defined by the user in next.config.js\ndefaultLoader.__next_img_default = true\n\nexport default defaultLoader\n"],"names":["defaultLoader","config","src","width","quality","startsWith","includes","localPatterns","length","pathname","search","Error","process","env","NODE_ENV","missingValues","push","join","JSON","stringify","NEXT_RUNTIME","hasLocalMatch","require","domains","remotePatterns","parsedSrc","URL","err","console","error","hasRemoteMatch","hostname","q","findClosestQuality","path","encodeURIComponent","NEXT_DEPLOYMENT_ID","__next_img_default"],"mappings":";;;;+BA2GA;;;eAAA;;;oCA1GmC;AAEnC,SAASA,cAAc,EACrBC,MAAM,EACNC,GAAG,EACHC,KAAK,EACLC,OAAO,EACoB;IAC3B,IACEF,IAAIG,UAAU,CA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