PageSourceSearch

https://sharethemeal.org/assets/responsiveImage-B1E4D8Vd.js

js sharethemeal.org collected 2026-10-01 10:12:19 UTC 1,648 bytes, 1 lines download raw bytes

1import{Q as d}from"./constants-CmaRX5ba.js";import{t as l}from"./chunk-4N6VE7H7-Exqj4PTM.js";import{k as u}from"./index-Cp7v22Jw.js";import{u as y}from"./useRootData-fFXhC2hW.js";const f=(c,i,o,e=1)=>{const t=(i.height*e).toFixed(),s=(i.width*e).toFixed(),m="&fit=fill&q=80",r=e===1?"":` ${e}x`;return`${o.includes("?")?`${o}&`:`${o}?`}w=${s}&h=${t}${m}&fm=${c}${r}`},p={desktop:[1,1.5,2],mobile:[1,1.5]},w=(c,i,o,e)=>{const t=c?"avif":"webp",{query:s}=i,r=(o?p.desktop:p.mobile).map(n=>f(t,i,e,n)).join(", ");return d.jsx("source",{"data-testid":"responsive-img-source",...s&&{media:s},srcSet:r,type:`image/${t}`},t+e+(s||""))},N=(c,i,o,e)=>{const t=c?"avif":"webp",{query:s}=i,r=(o?p.desktop:p.mobile).map(n=>f(t,i,e,n)).join(", ");return{tagName:"link",rel:"preload",as:"image",key:t+e+(s||""),imageSrcSet:r,type:`image/${t}`,...s&&{media:s}}},j=({alt:c,className:i,dimensions:o,lazy:e,src:t,skeletonClassName:s})=>{const[m,r]=l.useState(!1),n=l.useRef(null),{clientData:x}=y(),{avifSupported:S,IS_DESKTOP:h}=x;l.useEffect(()=>{if(n.current){const a=n.current;a.complete?r(!0):a.src||(a.src=a.dataset.src)}},[]);const g=Array.isArray(o)?o:[o],v=()=>g.map(a=>w(S,a,h,t)),$=Math.max(...g.map(a=>a.width));return d.jsxs("div",{className:u("responsive-image-wrapper",{loaded:m}),children:[d.jsxs("picture",{"data-testid":"responsive-img",children:[v(),d.jsx("img",{ref:n,className:u(i,"responsive-image",{loaded:m}),onLoad:()=>r(!0),"data-src":f("webp",g.find(a=>a.width===$),t),...e&&{loading:"lazy"},alt:c})]}),!m&&d.jsx("div",{className:u("responsive-image-skeleton",{...s&&{[s]:!0}})})]})};j.displayName="ResponsiveImage";export{j as R,N as g};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.