import{template as s}from"@gem-sdk/core";import{createStyle as e,createClass as t,createAttr as i,If as m}from"@gem-sdk/system";import{getLinkData as r}from"../../helpers.js";import o from"./AdaptiveImage.liquid.js";import a from"./NextImage.liquid.js";import{getWrapperStyles as l,getImageStyles as p,getContainerStyles as d}from"../common/styles.js";import{getWrapperClasses as c,getImageClasses as f,getContainerClasses as u}from"../common/classes.js";import{getContainerAttrs as $,getAdaptiveImageAttrs as g,getNextImageAttrs as n,getLinkWrapperAttrs as j,getImageLiquidAttrs as y}from"../common/attrs.js";let Image=({style:q,styles:v,setting:I,advanced:L,className:N,pageContext:h,builderAttrs:k,builderProps:x})=>{let{imageLink:W,isAdaptive:A,enableImageLink:C}=I??{},{enableLazyLoadImage:b}=h??{},{Wrapper:w,urlData:z}=r({defaultWrap:"div",setting:W,enableImageLink:C,isLiquid:!0}),B=e(l(v)),D=e(p(v,x)),E=e(d(q,v)),F=t(c()),G=t(f(N,v)),H=t(u(x?.uid,L?.cssClass,v?.shape)),J=i($(k,x?.uid)),K=j({urlData:z,imageLink:W,title:I?.title,isLiquid:!0}),M=g({styles:v,setting:I,isLiquid:!0}),O=n({styles:v,setting:I}),P=y({pageContext:h,enableLazyLoadImage:b}),Q=()=>m(A,o({...P,...M,style:D,className:G}),a({...P,...O,style:D,className:G})),R=()=>Q();return s`
    <div
      role="presentation"
      ${{...J}}
      style="${E}"
      class="${H}"
    >
      <${w}
        ${K}
        style="${B}"
        class="${F}"
      >
        ${R()}
      </${w}>
    </div>
  `};export{Image as default};
