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