'use client';
import{template as e,RenderIf as l}from"@gem-sdk/core";import o from"../../../grid/components/row/Row.liquid.js";import{createClass as t,createStyle as s}from"@gem-sdk/system";import{getClassContainerBanner as i,getClassContainerBackgoundImage as r,getClassOverlayBanner as m,getClassLinkBanner as a}from"./common/classes.js";import{getDimension as c,getStyleOverlay as n,getStyleContainerBackgoundImage as d}from"./common/styles.js";import{updateBackroundImageSrc as $,defaultImageUrl as f}from"./common/helpers.js";let CollectionBanner=({builderAttrs:g,builderProps:p,setting:v,style:y,children:k,rawChildren:u,advanced:h})=>{let{link:j,layout:b,width:C,verticalGutter:w,horizontalAlign:B,verticalAlign:q}=v??{};$({setting:v,collectionSrc:`{% if collection.image %} {{ collection.image.src | image_url}}  {% else %} ${f} {% endif  %}`});let x=t({...i({builderProps:p,setting:v,advanced:h})}),I=t({...r({setting:v})}),O=t({...m({setting:v})}),R=t({...a()}),S=s({...c({setting:v,style:y})}),W=s({...n({setting:v})}),_=s({...d({setting:v,hasCollectionImage:!1})});return e`
    <div ${{...g}} class="${x}" style="${S}">
      <div
        class="${I}"
        style="${_}"
      >
      </div>
      <div aria-label="Overlay" class="${O}" style="${W}"> </div>
      ${l(!!j?.link,`<a
          href="${j?.link}"
          target="${j?.target}"
          class="${R}"
        > </a>`)}
      ${o({setting:{layout:b,horizontalAlign:B,verticalAlign:q},styles:{verticalGutter:w,width:C,fullWidth:{desktop:!1,tablet:!1,mobile:!1}},style:y,children:k,rawChildren:u})}
    </div>
  `};export{CollectionBanner as default};
