/opt/canhelp/node_modules/next/dist/esm/client
NameSizeModeActions
app-dir/-0755rm
compat/-0755rm
components/-0755rm
dev/-0755rm
legacy/-0755rm
lib/-0755rm
portal/-0755rm
react-client-callbacks/-0755rm
request/-0755rm
tracing/-0755rm
add-base-path.js4330644editdlrm
add-base-path.js.map9780644editdlrm
add-locale.js5010644editdlrm
add-locale.js.map8990644editdlrm
app-bootstrap.js22100644editdlrm
app-bootstrap.js.map39640644editdlrm
app-build-id.js9850644editdlrm
app-build-id.js.map14180644editdlrm
app-call-server.js6000644editdlrm
app-call-server.js.map10410644editdlrm
app-find-source-map-url.js11240644editdlrm
app-find-source-map-url.js.map20810644editdlrm
app-globals.js3010644editdlrm
app-globals.js.map6000644editdlrm
app-index.js102280644editdlrm
app-index.js.map172380644editdlrm
app-link-gc.js40250644editdlrm
app-link-gc.js.map51460644editdlrm
app-next-dev.js7330644editdlrm
app-next-dev.js.map12640644editdlrm
app-next-turbopack.js8430644editdlrm
app-next-turbopack.js.map16820644editdlrm
app-next.js8560644editdlrm
app-next.js.map12660644editdlrm
app-webpack.js27270644editdlrm
app-webpack.js.map32070644editdlrm
assign-location.js9950644editdlrm
assign-location.js.map15570644editdlrm
detect-domain-locale.js3800644editdlrm
detect-domain-locale.js.map7110644editdlrm
flight-data-helpers.js50880644editdlrm
flight-data-helpers.js.map86570644editdlrm
form-shared.js55520644editdlrm
form-shared.js.map106220644editdlrm
form.js52120644editdlrm
form.js.map83060644editdlrm
get-domain-locale.js9980644editdlrm
get-domain-locale.js.map24510644editdlrm
has-base-path.js2570644editdlrm
has-base-path.js.map5980644editdlrm
head-manager.js49880644editdlrm
head-manager.js.map83200644editdlrm
image-component.js128780644editdlrm
image-component.js.map214460644editdlrm
index.js312570644editdlrm
index.js.map527990644editdlrm
link.js181650644editdlrm
link.js.map343940644editdlrm
next-dev-turbopack.js14170644editdlrm
next-dev-turbopack.js.map30540644editdlrm
next-dev.js6260644editdlrm
next-dev.js.map12300644editdlrm
next-turbopack.js11660644editdlrm
next-turbopack.js.map23970644editdlrm
next.js3830644editdlrm
next.js.map8930644editdlrm
normalize-locale-path.js3390644editdlrm
normalize-locale-path.js.map8720644editdlrm
normalize-trailing-slash.js9350644editdlrm
normalize-trailing-slash.js.map17360644editdlrm
page-bootstrap.js63140644editdlrm
page-bootstrap.js.map90250644editdlrm
page-loader.js68200644editdlrm
page-loader.js.map122200644editdlrm
remove-base-path.js5260644editdlrm
remove-base-path.js.map11380644editdlrm
remove-locale.js6000644editdlrm
remove-locale.js.map13010644editdlrm
request-idle-callback.js6340644editdlrm
request-idle-callback.js.map13920644editdlrm
resolve-href.js48160644editdlrm
resolve-href.js.map79830644editdlrm
route-announcer.js23460644editdlrm
route-announcer.js.map35230644editdlrm
route-loader.js130750644editdlrm
route-loader.js.map230360644editdlrm
route-params.js68150644editdlrm
route-params.js.map108220644editdlrm
router.js58730644editdlrm
router.js.map88450644editdlrm
script.js126190644editdlrm
script.js.map187110644editdlrm
set-attributes-from-props.js18170644editdlrm
set-attributes-from-props.js.map31010644editdlrm
trusted-types.js14100644editdlrm
trusted-types.js.map19560644editdlrm
use-client-disallowed.js4760644editdlrm
use-client-disallowed.js.map7390644editdlrm
use-intersection.js32480644editdlrm
use-intersection.js.map66470644editdlrm
use-merged-ref.js23450644editdlrm
use-merged-ref.js.map35660644editdlrm
web-vitals.js4910644editdlrm
web-vitals.js.map10050644editdlrm
webpack.js18770644editdlrm
webpack.js.map25420644editdlrm
with-router.js7810644editdlrm
with-router.js.map19350644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/esm/client/image-component.js (12878B)
'use client'; import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import React, { useRef, useEffect, useCallback, useContext, useMemo, useState, forwardRef, use } from 'react'; import ReactDOM from 'react-dom'; import Head from '../shared/lib/head'; import { getImgProps } from '../shared/lib/get-img-props'; import { imageConfigDefault } from '../shared/lib/image-config'; import { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime'; import { warnOnce } from '../shared/lib/utils/warn-once'; import { RouterContext } from '../shared/lib/router-context.shared-runtime'; // This is replaced by webpack alias import defaultLoader from 'next/dist/shared/lib/image-loader'; import { useMergedRef } from './use-merged-ref'; // This is replaced by webpack define plugin const configEnv = process.env.__NEXT_IMAGE_OPTS; if (typeof window === 'undefined') { ; globalThis.__NEXT_IMAGE_IMPORTED = true; } // See https://stackoverflow.com/q/39777833/266535 for why we use this ref // handler instead of the img's onLoad attribute. function handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput) { const src = img == null ? void 0 : img.src; if (!img || img['data-loaded-src'] === src) { return; } img['data-loaded-src'] = src; const p = 'decode' in img ? img.decode() : Promise.resolve(); p.catch(()=>{}).then(()=>{ if (!img.parentElement || !img.isConnected) { // Exit early in case of race condition: // - onload() is called // - decode() is called but incomplete // - unmount is called // - decode() completes return; } if (placeholder !== 'empty') { setBlurComplete(true); } if (onLoadRef == null ? void 0 : onLoadRef.current) { // Since we don't have the SyntheticEvent here, // we must create one with the same shape. // See https://reactjs.org/docs/events.html const event = new Event('load'); Object.defineProperty(event, 'target', { writable: false, value: img }); let prevented = false; let stopped = false; onLoadRef.current({ ...event, nativeEvent: event, currentTarget: img, target: img, isDefaultPrevented: ()=>prevented, isPropagationStopped: ()=>stopped, persist: ()=>{}, preventDefault: ()=>{ prevented = true; event.preventDefault(); }, stopPropagation: ()=>{ stopped = true; event.stopPropagation(); } }); } if (onLoadingCompleteRef == null ? void 0 : onLoadingCompleteRef.current) { onLoadingCompleteRef.current(img); } if (process.env.NODE_ENV !== 'production') { const origSrc = new URL(src, 'http://n').searchParams.get('url') || src; if (img.getAttribute('data-nimg') === 'fill') { if (!unoptimized && (!sizesInput || sizesInput === '100vw')) { let widthViewportRatio = img.getBoundingClientRect().width / window.innerWidth; if (widthViewportRatio < 0.6) { if (sizesInput === '100vw') { warnOnce('Image with src "' + origSrc + '" has "fill" prop and "sizes" prop of "100vw", but image is not rendered at full viewport width. Please adjust "sizes" to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes'); } else { warnOnce('Image with src "' + origSrc + '" has "fill" but is missing "sizes" prop. Please add it to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes'); } } } if (img.parentElement) { const { position } = window.getComputedStyle(img.parentElement); const valid = [ 'absolute', 'fixed', 'relative' ]; if (!valid.includes(position)) { warnOnce('Image with src "' + origSrc + '" has "fill" and parent element with invalid "position". Provided "' + position + '" should be one of ' + valid.map(String).join(',') + "."); } } if (img.height === 0) { warnOnce('Image with src "' + origSrc + '" has "fill" and a height value of 0. This is likely because the parent element of the image has not been styled to have a set height.'); } } const heightModified = img.height.toString() !== img.getAttribute('height'); const widthModified = img.width.toString() !== img.getAttribute('width'); if (heightModified && !widthModified || !heightModified && widthModified) { warnOnce('Image with src "' + origSrc + '" has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles \'width: "auto"\' or \'height: "auto"\' to maintain the aspect ratio.'); } } }); } function getDynamicProps(fetchPriority) { if (Boolean(use)) { // In React 19.0.0 or newer, we must use camelCase // prop to avoid "Warning: Invalid DOM property". // See https://github.com/facebook/react/pull/25927 return { fetchPriority }; } // In React 18.2.0 or older, we must use lowercase prop // to avoid "Warning: Invalid DOM property". return { fetchpriority: fetchPriority }; } const ImageElement = /*#__PURE__*/ forwardRef((param, forwardedRef)=>{ let { src, srcSet, sizes, height, width, decoding, className, style, fetchPriority, placeholder, loading, unoptimized, fill, onLoadRef, onLoadingCompleteRef, setBlurComplete, setShowAltText, sizesInput, onLoad, onError, ...rest } = param; const ownRef = useCallback((img)=>{ if (!img) { return; } if (onError) { // If the image has an error before react hydrates, then the error is lost. // The workaround is to wait until the image is mounted which is after hydration, // then we set the src again to trigger the error handler (if there was an error). // eslint-disable-next-line no-self-assign img.src = img.src; } if (process.env.NODE_ENV !== 'production') { if (!src) { console.error('Image is missing required "src" property:', img); } if (img.getAttribute('alt') === null) { console.error('Image is missing required "alt" property. Please add Alternative Text to describe the image for screen readers and search engines.'); } } if (img.complete) { handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput); } }, [ src, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, onError, unoptimized, sizesInput ]); const ref = useMergedRef(forwardedRef, ownRef); return /*#__PURE__*/ _jsx("img", { ...rest, ...getDynamicProps(fetchPriority), // It's intended to keep `loading` before `src` because React updates // props in order which causes Safari/Firefox to not lazy load properly. // See https://github.com/facebook/react/issues/25883 loading: loading, width: width, height: height, decoding: decoding, "data-nimg": fill ? 'fill' : '1', className: className, style: style, // It's intended to keep `src` the last attribute because React updates // attributes in order. If we keep `src` the first one, Safari will // immediately start to fetch `src`, before `sizes` and `srcSet` are even // updated by React. That causes multiple unnecessary requests if `srcSet` // and `sizes` are defined. // This bug cannot be reproduced in Chrome or Firefox. sizes: sizes, srcSet: srcSet, src: src, ref: ref, onLoad: (event)=>{ const img = event.currentTarget; handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput); }, onError: (event)=>{ // if the real image fails to load, this will ensure "alt" is visible setShowAltText(true); if (placeholder !== 'empty') { // If the real image fails to load, this will still remove the placeholder. setBlurComplete(true); } if (onError) { onError(event); } } }); }); function ImagePreload(param) { let { isAppRouter, imgAttributes } = param; const opts = { as: 'image', imageSrcSet: imgAttributes.srcSet, imageSizes: imgAttributes.sizes, crossOrigin: imgAttributes.crossOrigin, referrerPolicy: imgAttributes.referrerPolicy, ...getDynamicProps(imgAttributes.fetchPriority) }; if (isAppRouter && ReactDOM.preload) { ReactDOM.preload(imgAttributes.src, opts); return null; } return /*#__PURE__*/ _jsx(Head, { children: /*#__PURE__*/ _jsx("link", { rel: "preload", // Note how we omit the `href` attribute, as it would only be relevant // for browsers that do not support `imagesrcset`, and in those cases // it would cause the incorrect image to be preloaded. // // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset href: imgAttributes.srcSet ? undefined : imgAttributes.src, ...opts }, '__nimg-' + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes) }); } /** * The `Image` component is used to optimize images. * * Read more: [Next.js docs: `Image`](https://nextjs.org/docs/app/api-reference/components/image) */ export const Image = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{ const pagesRouter = useContext(RouterContext); // We're in the app directory if there is no pages router. const isAppRouter = !pagesRouter; const configContext = useContext(ImageConfigContext); const config = useMemo(()=>{ var _c_qualities; const c = configEnv || configContext || imageConfigDefault; const allSizes = [ ...c.deviceSizes, ...c.imageSizes ].sort((a, b)=>a - b); const deviceSizes = c.deviceSizes.sort((a, b)=>a - b); const qualities = (_c_qualities = c.qualities) == null ? void 0 : _c_qualities.sort((a, b)=>a - b); return { ...c, allSizes, deviceSizes, qualities }; }, [ configContext ]); const { onLoad, onLoadingComplete } = props; const onLoadRef = useRef(onLoad); useEffect(()=>{ onLoadRef.current = onLoad; }, [ onLoad ]); const onLoadingCompleteRef = useRef(onLoadingComplete); useEffect(()=>{ onLoadingCompleteRef.current = onLoadingComplete; }, [ onLoadingComplete ]); const [blurComplete, setBlurComplete] = useState(false); const [showAltText, setShowAltText] = useState(false); const { props: imgAttributes, meta: imgMeta } = getImgProps(props, { defaultLoader, imgConf: config, blurComplete, showAltText }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(ImageElement, { ...imgAttributes, unoptimized: imgMeta.unoptimized, placeholder: imgMeta.placeholder, fill: imgMeta.fill, onLoadRef: onLoadRef, onLoadingCompleteRef: onLoadingCompleteRef, setBlurComplete: setBlurComplete, setShowAltText: setShowAltText, sizesInput: props.sizes, ref: forwardedRef }), imgMeta.priority ? /*#__PURE__*/ _jsx(ImagePreload, { isAppRouter: isAppRouter, imgAttributes: imgAttributes }) : null ] }); }); //# sourceMappingURL=image-component.js.map