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AM0M,GAAiB,CACrBhG,uBACAP,GACAC,qBACAC,aACAC,SACApD,YACAqD,WACAC,aACAC,WACAE,SACA9F,cACAoC,cACAoC,SACAjC,YACAwD,wBACAtB,GACAC,kCACAsB,YACAG,EACAC,cAAe9D,EAzZekF,GAAAA,CA0Z9B,EAEF,CAFKnB,IAAI,CAGP,iCACE,WAACyF,OAAAA,CAAKtF,MAAO+C,YACVU,EACC,SADDA,CACE6B,OAAAA,CAAKtF,EADPyD,IACcD,WACVjD,EACC,UAACxC,EADFwC,IACExC,CACCiC,MAAO,CACLiD,QAAS,QACTkB,SAAU,OACV1K,MAAO,UACPkH,OAAQ,UACRwC,WAAY,OACZC,QAAS,EACTC,OAAQ,EACRC,OAAQ,EACRC,QAAS,CACX,EACAgC,IAAI,GACJC,eAAa,EACb7M,IAAK4H,IAEL,OAEJ,KACJ,UAAC1B,EAAAA,CAAc,GAAGwG,EAAc,MAEjC,CAACxM,GAAiB2H,EAMjB,SALA,CAKCiF,EAAAA,OAAI,WACH,UAACC,OAAAA,CAOCC,IAAI,UACJC,GAAG,QACHzK,KAdiE,GAc7Ca,MAAM,MAAGP,EAAYqD,GAAcnG,GAAG,CACzD,GAAGiM,EAAS,EARX,UACA9F,GAAcnG,GAAG,CACjBmG,GAAc9C,MAAM,CACpB8C,GAAchD,KAAK,IAQvB,OAGV","sources":["webpack://_N_E/../../node_modules/.pnpm/next@15.2.3_@babel+core@7.26.0_babel-plugin-macros@3.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.85.1/node_modules/next/legacy/image.js","webpack://_N_E/../../../src/client/legacy/image.tsx"],"sourcesContent":["module.exports = require('../dist/client/legacy/image')\n","'use client'\n\nimport React, {\n useRef,\n useEffect,\n useCallback,\n useContext,\n useMemo,\n useState,\n type JSX,\n} from 'react'\nimport * as ReactDOM from 'react-dom'\nimport Head from '../../shared/lib/head'\nimport {\n imageConfigDefault,\n VALID_LOADERS,\n} from '../../shared/lib/image-config'\nimport type {\n ImageConfigComplete,\n LoaderValue,\n} from '../../shared/lib/image-config'\nimport { useIntersection } from '../use-intersection'\nimport { ImageConfigContext } from '../../shared/lib/image-config-context.shared-runtime'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport { normalizePathTrailingSlash } from '../normalize-trailing-slash'\n\nfunction normalizeSrc(src: string): string {\n return src[0] === '/' ? src.slice(1) : src\n}\n\nconst supportsFloat = typeof ReactDOM.preload === 'function'\nconst DEFAULT_Q = 75\nconst configEnv = process.env.__NEXT_IMAGE_OPTS as any as ImageConfigComplete\nconst loadedImageURLs = new Set<string>()\nconst allImgs = new Map<\n string,\n { src: string; priority: boolean; placeholder: string }\n>()\nlet perfObserver: PerformanceObserver | undefined\nconst emptyDataURL =\n 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'\n\nif (typeof window === 'undefined') {\n ;(globalThis as any).__NEXT_IMAGE_IMPORTED = true\n}\n\nconst VALID_LOADING_VALUES = ['lazy', 'eager', undefined] as const\ntype LoadingValue = (typeof VALID_LOADING_VALUES)[number]\ntype ImageConfig = ImageConfigComplete & { allSizes: number[] }\nexport type ImageLoader = (resolverProps: ImageLoaderProps) => string\n\nexport type ImageLoaderProps = {\n src: string\n width: number\n quality?: number\n}\n\n// Do not export - this is an internal type only\n// because `next.config.js` is only meant for the\n// built-in loaders, not for a custom loader() prop.\ntype ImageLoaderWithConfig = (\n resolverProps: ImageLoaderPropsWithConfig\n) => string\ntype ImageLoaderPropsWithConfig = ImageLoaderProps & {\n config: Readonly<ImageConfig>\n}\n\nfunction imgixLoader({\n config,\n src,\n width,\n quality,\n}: ImageLoaderPropsWithConfig): string {\n // Demo: https://static.imgix.net/daisy.png?auto=format&fit=max&w=300\n const url = new URL(`${config.path}${normalizeSrc(src)}`)\n const params = url.searchParams\n\n // auto params can be combined with comma separation, or reiteration\n params.set('auto', params.getAll('auto').join(',') || 'format')\n params.set('fit', params.get('fit') || 'max')\n params.set('w', params.get('w') || width.toString())\n\n if (quality) {\n params.set('q', quality.toString())\n }\n\n return url.href\n}\n\nfunction akamaiLoader({\n config,\n src,\n width,\n}: ImageLoaderPropsWithConfig): string {\n return `${config.path}${normalizeSrc(src)}?imwidth=${width}`\n}\n\nfunction cloudinaryLoader({\n config,\n src,\n width,\n quality,\n}: ImageLoaderPropsWithConfig): string {\n // Demo: https://res.cloudinary.com/demo/image/upload/w_300,c_limit,q_auto/turtles.jpg\n const params = ['f_auto', 'c_limit', 'w_' + width, 'q_' + (quality || 'auto')]\n const paramsString = params.join(',') + '/'\n return `${config.path}${paramsString}${normalizeSrc(src)}`\n}\n\nfunction customLoader({ src }: ImageLoaderProps): string {\n throw new Error(\n `Image with src \"${src}\" is missing \"loader\" prop.` +\n `\\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader`\n )\n}\n\nfunction defaultLoader({\n config,\n src,\n width,\n quality,\n}: ImageLoaderPropsWithConfig): string {\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 {\n hasLocalMatch,\n } = require('../../shared/lib/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 {\n hasRemoteMatch,\n } = require('../../shared/lib/match-remote-pattern')\n if (!hasRemoteMatch(config.domains, config.remotePatterns, parsedSrc)) {\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 if (quality && config.qualities && !config.qualities.includes(quality)) {\n throw new Error(\n `Invalid quality prop (${quality}) on \\`next/image\\` does not match \\`images.qualities\\` configured in your \\`next.config.js\\`\\n` +\n `See more info: https://nextjs.org/docs/messages/next-image-unconfigured-qualities`\n )\n }\n }\n\n const q =\n quality ||\n config.qualities?.reduce((prev, cur) =>\n Math.abs(cur - DEFAULT_Q) < Math.abs(prev - DEFAULT_Q) ? cur : prev\n ) ||\n DEFAULT_Q\n\n if (!config.dangerouslyAllowSVG && src.split('?', 1)[0].endsWith('.svg')) {\n // Special case to make svg serve as-is to avoid proxying\n // through the built-in Image Optimization API.\n return src\n }\n\n return `${normalizePathTrailingSlash(config.path)}?url=${encodeURIComponent(\n src\n )}&w=${width}&q=${q}`\n}\n\nconst loaders = new Map<\n LoaderValue,\n (props: ImageLoaderPropsWithConfig) => string\n>([\n ['default', defaultLoader],\n ['imgix', imgixLoader],\n ['cloudinary', cloudinaryLoader],\n ['akamai', akamaiLoader],\n ['custom', customLoader],\n])\n\nconst VALID_LAYOUT_VALUES = [\n 'fill',\n 'fixed',\n 'intrinsic',\n 'responsive',\n undefined,\n] as const\ntype LayoutValue = (typeof VALID_LAYOUT_VALUES)[number]\n\ntype PlaceholderValue = 'blur' | 'empty'\n\ntype OnLoadingComplete = (result: {\n naturalWidth: number\n naturalHeight: number\n}) => void\n\ntype ImgElementStyle = NonNullable<JSX.IntrinsicElements['img']['style']>\n\ntype ImgElementWithDataProp = HTMLImageElement & {\n 'data-loaded-src': string | undefined\n}\n\nexport interface StaticImageData {\n src: string\n height: number\n width: number\n blurDataURL?: string\n}\n\ninterface StaticRequire {\n default: StaticImageData\n}\n\ntype StaticImport = StaticRequire | StaticImageData\n\ntype SafeNumber = number | `${number}`\n\nfunction isStaticRequire(\n src: StaticRequire | StaticImageData\n): src is StaticRequire {\n return (src as StaticRequire).default !== undefined\n}\n\nfunction isStaticImageData(\n src: StaticRequire | StaticImageData\n): src is StaticImageData {\n return (src as StaticImageData).src !== undefined\n}\n\nfunction isStaticImport(src: string | StaticImport): src is StaticImport {\n return (\n typeof src === 'object' &&\n (isStaticRequire(src as StaticImport) ||\n isStaticImageData(src as StaticImport))\n )\n}\n\nexport type ImageProps = Omit<\n JSX.IntrinsicElements['img'],\n 'src' | 'srcSet' | 'ref' | 'width' | 'height' | 'loading'\n> & {\n src: string | StaticImport\n width?: SafeNumber\n height?: SafeNumber\n layout?: LayoutValue\n loader?: ImageLoader\n quality?: SafeNumber\n priority?: boolean\n loading?: LoadingValue\n lazyRoot?: React.RefObject<HTMLElement | null> | null\n lazyBoundary?: string\n placeholder?: PlaceholderValue\n blurDataURL?: string\n unoptimized?: boolean\n objectFit?: ImgElementStyle['objectFit']\n objectPosition?: ImgElementStyle['objectPosition']\n onLoadingComplete?: OnLoadingComplete\n}\n\ntype ImageElementProps = Omit<ImageProps, 'src' | 'loader'> & {\n srcString: string\n imgAttributes: GenImgAttrsResult\n heightInt: number | undefined\n widthInt: number | undefined\n qualityInt: number | undefined\n layout: LayoutValue\n imgStyle: ImgElementStyle\n blurStyle: ImgElementStyle\n isLazy: boolean\n loading: LoadingValue\n config: ImageConfig\n unoptimized: boolean\n loader: ImageLoaderWithConfig\n placeholder: PlaceholderValue\n onLoadingCompleteRef: React.MutableRefObject<OnLoadingComplete | undefined>\n setBlurComplete: (b: boolean) => void\n setIntersection: (img: HTMLImageElement | null) => void\n isVisible: boolean\n noscriptSizes: string | undefined\n}\n\nfunction getWidths(\n { deviceSizes, allSizes }: ImageConfig,\n width: number | undefined,\n layout: LayoutValue,\n sizes: string | undefined\n): { widths: number[]; kind: 'w' | 'x' } {\n if (sizes && (layout === 'fill' || layout === 'responsive')) {\n // Find all the \"vw\" percent sizes used in the sizes prop\n const viewportWidthRe = /(^|\\s)(1?\\d?\\d)vw/g\n const percentSizes = []\n for (let match; (match = viewportWidthRe.exec(sizes)); match) {\n percentSizes.push(parseInt(match[2]))\n }\n if (percentSizes.length) {\n const smallestRatio = Math.min(...percentSizes) * 0.01\n return {\n widths: allSizes.filter((s) => s >= deviceSizes[0] * smallestRatio),\n kind: 'w',\n }\n }\n return { widths: allSizes, kind: 'w' }\n }\n if (\n typeof width !== 'number' ||\n layout === 'fill' ||\n layout === 'responsive'\n ) {\n return { widths: deviceSizes, kind: 'w' }\n }\n\n const widths = [\n ...new Set(\n // > This means that most OLED screens that say they are 3x resolution,\n // > are actually 3x in the green color, but only 1.5x in the red and\n // > blue colors. Showing a 3x resolution image in the app vs a 2x\n // > resolution image will be visually the same, though the 3x image\n // > takes significantly more data. Even true 3x resolution screens are\n // > wasteful as the human eye cannot see that level of detail without\n // > something like a magnifying glass.\n // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html\n [width, width * 2 /*, width * 3*/].map(\n (w) => allSizes.find((p) => p >= w) || allSizes[allSizes.length - 1]\n )\n ),\n ]\n return { widths, kind: 'x' }\n}\n\ntype GenImgAttrsData = {\n config: ImageConfig\n src: string\n unoptimized: boolean\n layout: LayoutValue\n loader: ImageLoaderWithConfig\n width?: number\n quality?: number\n sizes?: string\n}\n\ntype GenImgAttrsResult = {\n src: string\n srcSet: string | undefined\n sizes: string | undefined\n}\n\nfunction generateImgAttrs({\n config,\n src,\n unoptimized,\n layout,\n width,\n quality,\n sizes,\n loader,\n}: GenImgAttrsData): GenImgAttrsResult {\n if (unoptimized) {\n return { src, srcSet: undefined, sizes: undefined }\n }\n\n const { widths, kind } = getWidths(config, width, layout, sizes)\n const last = widths.length - 1\n\n return {\n sizes: !sizes && kind === 'w' ? '100vw' : sizes,\n srcSet: widths\n .map(\n (w, i) =>\n `${loader({ config, src, quality, width: w })} ${\n kind === 'w' ? w : i + 1\n }${kind}`\n )\n .join(', '),\n\n // It's intended to keep `src` the last attribute because React updates\n // attributes in order. If we keep `src` the first one, Safari will\n // immediately start to fetch `src`, before `sizes` and `srcSet` are even\n // updated by React. That causes multiple unnecessary requests if `srcSet`\n // and `sizes` are defined.\n // This bug cannot be reproduced in Chrome or Firefox.\n src: loader({ config, src, quality, width: widths[last] }),\n }\n}\n\nfunction getInt(x: unknown): number | undefined {\n if (typeof x === 'number') {\n return x\n }\n if (typeof x === 'string') {\n return parseInt(x, 10)\n }\n return undefined\n}\n\nfunction defaultImageLoader(loaderProps: ImageLoaderPropsWithConfig) {\n const loaderKey = loaderProps.config?.loader || 'default'\n const load = loaders.get(loaderKey)\n if (load) {\n return load(loaderProps)\n }\n throw new Error(\n `Unknown \"loader\" found in \"next.config.js\". Expected: ${VALID_LOADERS.join(\n ', '\n )}. Received: ${loaderKey}`\n )\n}\n\n// See https://stackoverflow.com/q/39777833/266535 for why we use this ref\n// handler instead of the img's onLoad attribute.\nfunction handleLoading(\n img: ImgElementWithDataProp,\n src: string,\n layout: LayoutValue,\n placeholder: PlaceholderValue,\n onLoadingCompleteRef: React.MutableRefObject<OnLoadingComplete | undefined>,\n setBlurComplete: (b: boolean) => void\n) {\n if (!img || img.src === emptyDataURL || img['data-loaded-src'] === src) {\n return\n }\n img['data-loaded-src'] = src\n const p = 'decode' in img ? img.decode() : Promise.resolve()\n p.catch(() => {}).then(() => {\n if (!img.parentNode) {\n // Exit early in case of race condition:\n // - onload() is called\n // - decode() is called but incomplete\n // - unmount is called\n // - decode() completes\n return\n }\n loadedImageURLs.add(src)\n if (placeholder === 'blur') {\n setBlurComplete(true)\n }\n if (onLoadingCompleteRef?.current) {\n const { naturalWidth, naturalHeight } = img\n // Pass back read-only primitive values but not the\n // underlying DOM element because it could be misused.\n onLoadingCompleteRef.current({ naturalWidth, naturalHeight })\n }\n if (process.env.NODE_ENV !== 'production') {\n if (img.parentElement?.parentElement) {\n const parent = getComputedStyle(img.parentElement.parentElement)\n if (!parent.position) {\n // The parent has not been rendered to the dom yet and therefore it has no position. Skip the warnings for such cases.\n } else if (layout === 'responsive' && parent.display === 'flex') {\n warnOnce(\n `Image with src \"${src}\" may not render properly as a child of a flex container. Consider wrapping the image with a div to configure the width.`\n )\n } else if (\n layout === 'fill' &&\n parent.position !== 'relative' &&\n parent.position !== 'fixed' &&\n parent.position !== 'absolute'\n ) {\n warnOnce(\n `Image with src \"${src}\" may not render properly with a parent using position:\"${parent.position}\". Consider changing the parent style to position:\"relative\" with a width and height.`\n )\n }\n }\n }\n })\n}\n\nconst ImageElement = ({\n imgAttributes,\n heightInt,\n widthInt,\n qualityInt,\n layout,\n className,\n imgStyle,\n blurStyle,\n isLazy,\n placeholder,\n loading,\n srcString,\n config,\n unoptimized,\n loader,\n onLoadingCompleteRef,\n setBlurComplete,\n setIntersection,\n onLoad,\n onError,\n isVisible,\n noscriptSizes,\n ...rest\n}: ImageElementProps) => {\n loading = isLazy ? 'lazy' : loading\n return (\n <>\n <img\n {...rest}\n {...imgAttributes}\n decoding=\"async\"\n data-nimg={layout}\n className={className}\n style={{ ...imgStyle, ...blurStyle }}\n ref={useCallback(\n (img: ImgElementWithDataProp) => {\n if (process.env.NODE_ENV !== 'production') {\n if (img && !srcString) {\n console.error(`Image is missing required \"src\" property:`, img)\n }\n }\n setIntersection(img)\n if (img?.complete) {\n handleLoading(\n img,\n srcString,\n layout,\n placeholder,\n onLoadingCompleteRef,\n setBlurComplete\n )\n }\n },\n [\n setIntersection,\n srcString,\n layout,\n placeholder,\n onLoadingCompleteRef,\n setBlurComplete,\n ]\n )}\n onLoad={(event) => {\n const img = event.currentTarget as ImgElementWithDataProp\n handleLoading(\n img,\n srcString,\n layout,\n placeholder,\n onLoadingCompleteRef,\n setBlurComplete\n )\n if (onLoad) {\n onLoad(event)\n }\n }}\n onError={(event) => {\n if (placeholder === 'blur') {\n // If the real image fails to load, this will still remove the placeholder.\n setBlurComplete(true)\n }\n if (onError) {\n onError(event)\n }\n }}\n />\n {(isLazy || placeholder === 'blur') && (\n <noscript>\n <img\n {...rest}\n // @ts-ignore - TODO: upgrade to `@types/react@17`\n loading={loading}\n decoding=\"async\"\n data-nimg={layout}\n style={imgStyle}\n className={className}\n // It's intended to keep `loading` before `src` because React updates\n // props in order which causes Safari/Firefox to not lazy load properly.\n // See https://github.com/facebook/react/issues/25883\n {...generateImgAttrs({\n config,\n src: srcString,\n unoptimized,\n layout,\n width: widthInt,\n quality: qualityInt,\n sizes: noscriptSizes,\n loader,\n })}\n />\n </noscript>\n )}\n </>\n )\n}\n\nexport default function Image({\n src,\n sizes,\n unoptimized = false,\n priority = false,\n loading,\n lazyRoot = null,\n lazyBoundary,\n className,\n quality,\n width,\n height,\n style,\n objectFit,\n objectPosition,\n onLoadingComplete,\n placeholder = 'empty',\n blurDataURL,\n ...all\n}: ImageProps) {\n const configContext = useContext(ImageConfigContext)\n const config: ImageConfig = useMemo(() => {\n const c = configEnv || configContext || imageConfigDefault\n const allSizes = [...c.deviceSizes, ...c.imageSizes].sort((a, b) => a - b)\n const deviceSizes = c.deviceSizes.sort((a, b) => a - b)\n const qualities = c.qualities?.sort((a, b) => a - b)\n return { ...c, allSizes, deviceSizes, qualities }\n }, [configContext])\n\n let rest: Partial<ImageProps> = all\n let layout: NonNullable<LayoutValue> = sizes ? 'responsive' : 'intrinsic'\n if ('layout' in rest) {\n // Override default layout if the user specified one:\n if (rest.layout) layout = rest.layout\n\n // Remove property so it's not spread on <img>:\n delete rest.layout\n }\n\n let loader: ImageLoaderWithConfig = defaultImageLoader\n if ('loader' in rest) {\n if (rest.loader) {\n const customImageLoader = rest.loader\n loader = (obj) => {\n const { config: _, ...opts } = obj\n // The config object is internal only so we must\n // not pass it to the user-defined loader()\n return customImageLoader(opts)\n }\n }\n // Remove property so it's not spread on <img>\n delete rest.loader\n }\n\n let staticSrc = ''\n if (isStaticImport(src)) {\n const staticImageData = isStaticRequire(src) ? src.default : src\n\n if (!staticImageData.src) {\n throw new Error(\n `An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(\n staticImageData\n )}`\n )\n }\n blurDataURL = blurDataURL || staticImageData.blurDataURL\n staticSrc = staticImageData.src\n if (!layout || layout !== 'fill') {\n height = height || staticImageData.height\n width = width || staticImageData.width\n if (!staticImageData.height || !staticImageData.width) {\n throw new Error(\n `An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(\n staticImageData\n )}`\n )\n }\n }\n }\n src = typeof src === 'string' ? src : staticSrc\n\n let isLazy =\n !priority && (loading === 'lazy' || typeof loading === 'undefined')\n if (src.startsWith('data:') || src.startsWith('blob:')) {\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n unoptimized = true\n isLazy = false\n }\n if (typeof window !== 'undefined' && loadedImageURLs.has(src)) {\n isLazy = false\n }\n if (config.unoptimized) {\n unoptimized = true\n }\n\n const [blurComplete, setBlurComplete] = useState(false)\n const [setIntersection, isIntersected, resetIntersected] =\n useIntersection<HTMLImageElement>({\n rootRef: lazyRoot,\n rootMargin: lazyBoundary || '200px',\n disabled: !isLazy,\n })\n const isVisible = !isLazy || isIntersected\n\n const wrapperStyle: JSX.IntrinsicElements['span']['style'] = {\n boxSizing: 'border-box',\n display: 'block',\n overflow: 'hidden',\n width: 'initial',\n height: 'initial',\n background: 'none',\n opacity: 1,\n border: 0,\n margin: 0,\n padding: 0,\n }\n const sizerStyle: JSX.IntrinsicElements['span']['style'] = {\n boxSizing: 'border-box',\n display: 'block',\n width: 'initial',\n height: 'initial',\n background: 'none',\n opacity: 1,\n border: 0,\n margin: 0,\n padding: 0,\n }\n let hasSizer = false\n let sizerSvgUrl: string | undefined\n const layoutStyle: ImgElementStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n\n boxSizing: 'border-box',\n padding: 0,\n border: 'none',\n margin: 'auto',\n\n display: 'block',\n width: 0,\n height: 0,\n minWidth: '100%',\n maxWidth: '100%',\n minHeight: '100%',\n maxHeight: '100%',\n\n objectFit,\n objectPosition,\n }\n\n let widthInt = getInt(width)\n let heightInt = getInt(height)\n const qualityInt = getInt(quality)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!src) {\n // React doesn't show the stack trace and there's\n // no `src` to help identify which image, so we\n // instead console.error(ref) during mount.\n widthInt = widthInt || 1\n heightInt = heightInt || 1\n unoptimized = true\n } else {\n if (!VALID_LAYOUT_VALUES.includes(layout)) {\n throw new Error(\n `Image with src \"${src}\" has invalid \"layout\" property. Provided \"${layout}\" should be one of ${VALID_LAYOUT_VALUES.map(\n String\n ).join(',')}.`\n )\n }\n\n if (\n (typeof widthInt !== 'undefined' && isNaN(widthInt)) ||\n (typeof heightInt !== 'undefined' && isNaN(heightInt))\n ) {\n throw new Error(\n `Image with src \"${src}\" has invalid \"width\" or \"height\" property. These should be numeric values.`\n )\n }\n if (layout === 'fill' && (width || height)) {\n warnOnce(\n `Image with src \"${src}\" and \"layout='fill'\" has unused properties assigned. Please remove \"width\" and \"height\".`\n )\n }\n if (!VALID_LOADING_VALUES.includes(loading)) {\n throw new Error(\n `Image with src \"${src}\" has invalid \"loading\" property. Provided \"${loading}\" should be one of ${VALID_LOADING_VALUES.map(\n String\n ).join(',')}.`\n )\n }\n if (priority && loading === 'lazy') {\n throw new Error(\n `Image with src \"${src}\" has both \"priority\" and \"loading='lazy'\" properties. Only one should be used.`\n )\n }\n if (sizes && layout !== 'fill' && layout !== 'responsive') {\n warnOnce(\n `Image with src \"${src}\" has \"sizes\" property but it will be ignored. Only use \"sizes\" with \"layout='fill'\" or \"layout='responsive'\"`\n )\n }\n if (placeholder === 'blur') {\n if (layout !== 'fill' && (widthInt || 0) * (heightInt || 0) < 1600) {\n warnOnce(\n `Image with src \"${src}\" is smaller than 40x40. Consider removing the \"placeholder='blur'\" property to improve performance.`\n )\n }\n if (!blurDataURL) {\n const VALID_BLUR_EXT = ['jpeg', 'png', 'webp', 'avif'] // should match next-image-loader\n\n throw new Error(\n `Image with src \"${src}\" has \"placeholder='blur'\" property but is missing the \"blurDataURL\" property.\n Possible solutions:\n - Add a \"blurDataURL\" property, the contents should be a small Data URL to represent the image\n - Change the \"src\" property to a static import with one of the supported file types: ${VALID_BLUR_EXT.join(\n ','\n )} (animated images not supported)\n - Remove the \"placeholder\" property, effectively no blur effect\n Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url`\n )\n }\n }\n if ('ref' in rest) {\n warnOnce(\n `Image with src \"${src}\" is using unsupported \"ref\" property. Consider using the \"onLoadingComplete\" property instead.`\n )\n }\n\n if (!unoptimized && loader !== defaultImageLoader) {\n const urlStr = loader({\n config,\n src,\n width: widthInt || 400,\n quality: qualityInt || 75,\n })\n let url: URL | undefined\n try {\n url = new URL(urlStr)\n } catch (err) {}\n if (urlStr === src || (url && url.pathname === src && !url.search)) {\n warnOnce(\n `Image with src \"${src}\" has a \"loader\" property that does not implement width. Please implement it or use the \"unoptimized\" property instead.` +\n `\\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader-width`\n )\n }\n }\n\n if (style) {\n let overwrittenStyles = Object.keys(style).filter(\n (key) => key in layoutStyle\n )\n if (overwrittenStyles.length) {\n warnOnce(\n `Image with src ${src} is assigned the following styles, which are overwritten by automatically-generated styles: ${overwrittenStyles.join(\n ', '\n )}`\n )\n }\n }\n\n if (\n typeof window !== 'undefined' &&\n !perfObserver &&\n window.PerformanceObserver\n ) {\n perfObserver = new PerformanceObserver((entryList) => {\n for (const entry of entryList.getEntries()) {\n // @ts-ignore - missing \"LargestContentfulPaint\" class with \"element\" prop\n const imgSrc = entry?.element?.src || ''\n const lcpImage = allImgs.get(imgSrc)\n if (\n lcpImage &&\n !lcpImage.priority &&\n lcpImage.placeholder !== 'blur' &&\n !lcpImage.src.startsWith('data:') &&\n !lcpImage.src.startsWith('blob:')\n ) {\n // https://web.dev/lcp/#measure-lcp-in-javascript\n warnOnce(\n `Image with src \"${lcpImage.src}\" was detected as the Largest Contentful Paint (LCP). Please add the \"priority\" property if this image is above the fold.` +\n `\\nRead more: https://nextjs.org/docs/api-reference/next/legacy/image#priority`\n )\n }\n }\n })\n try {\n perfObserver.observe({\n type: 'largest-contentful-paint',\n buffered: true,\n })\n } catch (err) {\n // Log error but don't crash the app\n console.error(err)\n }\n }\n }\n }\n const imgStyle = Object.assign({}, style, layoutStyle)\n const blurStyle =\n placeholder === 'blur' && !blurComplete\n ? {\n backgroundSize: objectFit || 'cover',\n backgroundPosition: objectPosition || '0% 0%',\n filter: 'blur(20px)',\n backgroundImage: `url(\"${blurDataURL}\")`,\n }\n : {}\n if (layout === 'fill') {\n // <Image src=\"i.png\" layout=\"fill\" />\n wrapperStyle.display = 'block'\n wrapperStyle.position = 'absolute'\n wrapperStyle.top = 0\n wrapperStyle.left = 0\n wrapperStyle.bottom = 0\n wrapperStyle.right = 0\n } else if (\n typeof widthInt !== 'undefined' &&\n typeof heightInt !== 'undefined'\n ) {\n // <Image src=\"i.png\" width=\"100\" height=\"100\" />\n const quotient = heightInt / widthInt\n const paddingTop = isNaN(quotient) ? '100%' : `${quotient * 100}%`\n if (layout === 'responsive') {\n // <Image src=\"i.png\" width=\"100\" height=\"100\" layout=\"responsive\" />\n wrapperStyle.display = 'block'\n wrapperStyle.position = 'relative'\n hasSizer = true\n sizerStyle.paddingTop = paddingTop\n } else if (layout === 'intrinsic') {\n // <Image src=\"i.png\" width=\"100\" height=\"100\" layout=\"intrinsic\" />\n wrapperStyle.display = 'inline-block'\n wrapperStyle.position = 'relative'\n wrapperStyle.maxWidth = '100%'\n hasSizer = true\n sizerStyle.maxWidth = '100%'\n sizerSvgUrl = `data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27${widthInt}%27%20height=%27${heightInt}%27/%3e`\n } else if (layout === 'fixed') {\n // <Image src=\"i.png\" width=\"100\" height=\"100\" layout=\"fixed\" />\n wrapperStyle.display = 'inline-block'\n wrapperStyle.position = 'relative'\n wrapperStyle.width = widthInt\n wrapperStyle.height = heightInt\n }\n } else {\n // <Image src=\"i.png\" />\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Image with src \"${src}\" must use \"width\" and \"height\" properties or \"layout='fill'\" property.`\n )\n }\n }\n\n let imgAttributes: GenImgAttrsResult = {\n src: emptyDataURL,\n srcSet: undefined,\n sizes: undefined,\n }\n\n if (isVisible) {\n imgAttributes = generateImgAttrs({\n config,\n src,\n unoptimized,\n layout,\n width: widthInt,\n quality: qualityInt,\n sizes,\n loader,\n })\n }\n\n let srcString: string = src\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof window !== 'undefined') {\n let fullUrl: URL\n try {\n fullUrl = new URL(imgAttributes.src)\n } catch (e) {\n fullUrl = new URL(imgAttributes.src, window.location.href)\n }\n allImgs.set(fullUrl.href, { src, priority, placeholder })\n }\n }\n\n const linkProps:\n | React.DetailedHTMLProps<\n React.LinkHTMLAttributes<HTMLLinkElement>,\n HTMLLinkElement\n >\n | undefined = supportsFloat\n ? undefined\n : {\n imageSrcSet: imgAttributes.srcSet,\n imageSizes: imgAttributes.sizes,\n crossOrigin: rest.crossOrigin,\n referrerPolicy: rest.referrerPolicy,\n }\n\n const useLayoutEffect =\n typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect\n const onLoadingCompleteRef = useRef(onLoadingComplete)\n\n const previousImageSrc = useRef<string | StaticImport>(src)\n useEffect(() => {\n onLoadingCompleteRef.current = onLoadingComplete\n }, [onLoadingComplete])\n\n useLayoutEffect(() => {\n if (previousImageSrc.current !== src) {\n resetIntersected()\n previousImageSrc.current = src\n }\n }, [resetIntersected, src])\n\n const imgElementArgs = {\n isLazy,\n imgAttributes,\n heightInt,\n widthInt,\n qualityInt,\n layout,\n className,\n imgStyle,\n blurStyle,\n loading,\n config,\n unoptimized,\n placeholder,\n loader,\n srcString,\n onLoadingCompleteRef,\n setBlurComplete,\n setIntersection,\n isVisible,\n noscriptSizes: sizes,\n ...rest,\n }\n return (\n <>\n <span style={wrapperStyle}>\n {hasSizer ? (\n <span style={sizerStyle}>\n {sizerSvgUrl ? (\n <img\n style={{\n display: 'block',\n maxWidth: '100%',\n width: 'initial',\n height: 'initial',\n background: 'none',\n opacity: 1,\n border: 0,\n margin: 0,\n padding: 0,\n }}\n alt=\"\"\n aria-hidden={true}\n src={sizerSvgUrl}\n />\n ) : null}\n </span>\n ) : null}\n <ImageElement {...imgElementArgs} />\n </span>\n {!supportsFloat && priority ? (\n // Note how we omit the `href` attribute, as it would only be relevant\n // for browsers that do not support `imagesrcset`, and in those cases\n // it would likely cause the incorrect image to be preloaded.\n //\n // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset\n <Head>\n <link\n key={\n '__nimg-' +\n imgAttributes.src +\n imgAttributes.srcSet +\n imgAttributes.sizes\n }\n rel=\"preload\"\n as=\"image\"\n href={imgAttributes.srcSet ? undefined : imgAttributes.src}\n {...linkProps}\n />\n </Head>\n ) : null}\n </>\n )\n}\n"],"names":["Image","normalizeSrc","src","slice","supportsFloat","ReactDOM","preload","configEnv","process","loadedImageURLs","Set","emptyDataURL","loaders","Map","defaultLoader","config","width","quality","q","qualities","reduce","prev","cur","Math","abs","DEFAULT_Q","dangerouslyAllowSVG","split","endsWith","normalizePathTrailingSlash","path","encodeURIComponent","imgixLoader","url","URL","params","searchParams","set","getAll","join","get","toString","href","cloudinaryLoader","paramsString","akamaiLoader","customLoader","isStaticRequire","undefined","default","generateImgAttrs","unoptimized","layout","sizes","loader","srcSet","widths","kind","getWidths","deviceSizes","allSizes","viewportWidthRe","percentSizes","match","exec","push","parseInt","length","smallestRatio","min","filter","s","map","find","p","w","i","last","getInt","x","defaultImageLoader","loaderProps","loaderKey","load","VALID_LOADERS","handleLoading","img","placeholder","onLoadingCompleteRef","setBlurComplete","decode","Promise","resolve","catch","then","parentNode","add","current","naturalWidth","naturalHeight","ImageElement","imgAttributes","heightInt","widthInt","qualityInt","className","imgStyle","blurStyle","isLazy","loading","srcString","setIntersection","onLoad","onError","isVisible","noscriptSizes","rest","decoding","data-nimg","style","ref","useCallback","complete","event","currentTarget","noscript","sizerSvgUrl","priority","lazyRoot","lazyBoundary","height","objectFit","objectPosition","onLoadingComplete","blurDataURL","all","configContext","useContext","ImageConfigContext","useMemo","c","imageConfigDefault","imageSizes","sort","a","b","customImageLoader","_","opts","obj","staticSrc","isStaticImport","isStaticImageData","staticImageData","JSON","stringify","startsWith","has","blurComplete","useState","isIntersected","resetIntersected","useIntersection","rootRef","rootMargin","disabled","wrapperStyle","boxSizing","display","overflow","background","opacity","border","margin","padding","sizerStyle","hasSizer","Object","assign","position","layoutStyle","top","left","bottom","right","minWidth","maxWidth","minHeight","maxHeight","backgroundSize","backgroundPosition","backgroundImage","quotient","paddingTop","isNaN","linkProps","imageSrcSet","crossOrigin","referrerPolicy","useLayoutEffect","React","useRef","previousImageSrc","useEffect","imgElementArgs","span","alt","aria-hidden","Head","link","rel","as"],"sourceRoot":"","ignoreList":[0]}