import e from"./HeroBannerItem.liquid.js";import{getAttr as r,getAttrLink as t}from"../common/attrs.js";import{getStyle as o}from"../common/styles.js";import{getClasses as a,getLinkClasses as s}from"../common/classes.js";import{createStateOrContext as i,createAttr as n,createStyle as l,createClass as d,If as c}from"@gem-sdk/system";import{template as m,dataStringify as p,RenderIf as f,isLocalEnv as u,baseAssetURL as g}from"@gem-sdk/core";import{getBackgroundTranslated as h,getInsertLinkData as v,getSettingPreloadData as b}from"../../helpers.js";import{getResponsiveSetting as $,getBannerLink as j}from"../common/helpers.js";import{HeroBanner as k}from"../settings/configs/translate.js";let HeroBanner=E=>{let{builderAttrs:y,builderProps:C,setting:P,styles:S,style:x,children:B,advanced:H,pageContext:T}=E,{enableLazyLoadImage:V}=T??{},{enableLink:M,enableParallax:N}=P??{},O=h({background:S?.background,uid:C?.uid,enableTranslate:!!k?.background?.id,pageContext:T??{},isTranslateVideo:!0}),R=j(P),{cssClass:_}=H??{},{urlData:w}=v("",R),z=i({background:$(O||{}),uid:C?.uid,enableParallax:N&&Number(P?.speedParallax||0)>0,speedParallax:Number(P?.speedParallax)||0,hoverEffect:S?.hoverEffect,hoverEffectScale:S?.hoverEffectScale,layout:P?.layout,contentPosition1Col:S?.contentPosition1Col,contentPosition2Col:S?.contentPosition2Col,aspectRatio:P?.aspectRatio,sizeSetting:$(S?.sizeSetting||{}),videoObjectFit:$(S?.videoObjectFit||{}),target:R?.target??"_self",href:w?.href??"",linkType:R?.type??"",hoverEffectDuration:S?.hoverEffectDuration,isYoutubeVideoMigrated:P?.isYoutubeVideoMigrated}),A=!!R?.link&&M,D=n({...r({uid:C?.uid||""})}),F=n(t()),G=l({...o(S,P,x)}),I=d({...a({setting:P,builderProps:C,advancedCssClass:_})}),Y=d({...s()}),q=()=>e({setting:P,translatedBackground:O,styles:S,children:B,enableLazyLoadImage:V,rawChildren:E.rawChildren,builderProps:C,pageContext:T});return m`
      <gp-hero-banner
        ${{...y}}
        ${{...D}}
        class="${I}"
        style="${G}"
        gp-data='${p(z)}'
      >
        ${c(!A,q())}
        ${c(A,m`
          <div
            ${{...F}}
            aria-hidden="true"
            class="${Y}"
          >
            ${q()}
          </div>`)}
      </gp-hero-banner>
       ${f(u,`<script ${b('class="gps-link" delay',"src")}="{{ 'gp-hero-banner-v2-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${b('class="gps-link" delay',"src")}="${g}/assets-v2/gp-hero-banner-v2-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>
`)}
  `};export{HeroBanner as default};
