'use client';
import{jsx as e,Fragment as a,jsxs as s}from"react/jsx-runtime";import{FALLBACK_IMAGE as m,getAdaptiveImageData as r,IMAGE_PLACEHOLDER as o}from"../common/helpers.js";import{createAttr as t,createStyleReact as l,createStyle as d,createClass as c}from"@gem-sdk/system";import{getAdaptiveImageClasses as i}from"../common/classes.js";import{getAdaptivePictureStyles as p,getAdaptiveImageStyles as n}from"../common/styles.js";let g=g=>{let{alt:y,style:f,srcSet:h,layout:u,priority:L,className:x,aspectRatio:z,borderRadius:b,pictureClass:j,pageContext:I,...k}=g,{getDeviceSource:w}=r(g),{srcTablet:v,srcMobile:N}=w(),S=t({loading:L?"eager":"lazy",src:h?.desktop?.src||m}),A=l({...p()}),P=d({...n({layout:u,aspectRatio:z,borderRadius:b}),...f}),q=c({...i({className:x,hasLazyLoad:!L&&I?.enableLazyLoadImage})});return e(a,{children:s("picture",{style:A,className:j,children:[s(a,{children:[N&&e("source",{media:"(max-width: 767px)",srcSet:I?.enableLazyLoadImage?o:N}),v&&e("source",{media:"(max-width: 1024px)",srcSet:I?.enableLazyLoadImage?o:v})]}),e("img",{...k,...S,alt:y,width:"100%",style:P,className:q,draggable:"false"})]})})};g.defaultProps={layout:{desktop:"cover"}};export{g as default};
