'use client';
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import a from"next/head";import i from"./Img.js";let BREAKPOINTS={},AdaptiveImage=({srcSet:m,priority:s=!1,pictureClass:c,...l})=>{if(!m?.desktop?.src)return null;let d=e=>Object.entries(e).map(([e,r])=>r?.src&&t("link",{rel:"preload",href:r.src,as:"image"},`preload-${e}`)),p=e=>{let r=[{media:"(max-width: 767px)",srcSet:e.mobile?.src},{media:"(max-width: 1024px)",srcSet:e.tablet?.src}];return r.map(({media:e,srcSet:r})=>r&&t("source",{media:e,srcSet:r},e))};return e(r,{children:[t(a,{children:d(m)}),e("picture",{className:c,children:[p(m),t(i,{...l,loading:s?"eager":"lazy",image:{src:m.desktop.src}})]})]})};export{AdaptiveImage as default};
