'use client';
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useCollection as l,useRenderMode as r}from"@gem-sdk/core";import t from"../../../grid/components/row/Row.js";import{createClass as s,createStyle as m,If as a}from"@gem-sdk/system";import{getClassContainerBanner as i,getClassContainerBackgoundImage as n,getClassOverlayBanner as c,getClassLinkBanner as d}from"./common/classes.js";import{getDimension as p,getStyleOverlay as f,getStyleContainerBackgoundImage as g}from"./common/styles.js";import{updateBackroundImageSrc as k}from"./common/helpers.js";import y from"../../../link/components/Link.js";let CollectionBanner=({builderAttrs:b,builderProps:h,setting:j,style:u,children:v,advanced:N})=>{let B=l(),{isPreviewSharePageMode:C,isEditMode:w}=r(),{link:x,layout:I,width:L,verticalGutter:M,verticalAlign:O,horizontalAlign:R}=j??{};k({setting:j,collectionSrc:B?.collectionMedia?.src});let S=s({...i({builderProps:h,setting:j,advanced:N})}),W=s({...n({setting:j})}),q=s({...c({setting:j})}),z=s({...d()}),A=m({...p({setting:j,style:u})}),D=m({...f({setting:j})}),E=m({...g({setting:j,hasCollectionImage:!1})}),F=!!x?.link&&!w&&!C;return e("div",{...b,className:S,style:A,children:[o("div",{"aria-label":"Background Image",role:"banner",className:W,style:E}),o("div",{"aria-label":"Overlay",role:"banner",className:q,style:D}),a(F,o(y,{setting:{href:x?.link,target:x?.target},className:z})),o(t,{setting:{layout:I,horizontalAlign:R,verticalAlign:O},styles:{verticalGutter:M,width:L,fullWidth:{desktop:!1,tablet:!1,mobile:!1}},style:u,children:v})]})};export{CollectionBanner as default};
