"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var HeroBannerItem_liquid=require("./HeroBannerItem.liquid.js"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),system=require("@gem-sdk/system"),core=require("@gem-sdk/core"),helpers=require("../../helpers.js"),helpers$1=require("../common/helpers.js"),translate=require("../settings/configs/translate.js");const HeroBanner=e=>{let{builderAttrs:t,builderProps:s,setting:r,styles:a,style:n,children:i,advanced:l,pageContext:o}=e,{enableLazyLoadImage:c}=o??{},{enableLink:d,enableParallax:g}=r??{},u=helpers.getBackgroundTranslated({background:a?.background,uid:s?.uid,enableTranslate:!!translate.HeroBanner?.background?.id,pageContext:o??{},isTranslateVideo:!0}),p=helpers$1.getBannerLink(r),{cssClass:f}=l??{},{urlData:h}=helpers.getInsertLinkData("",p),m=system.createStateOrContext({background:helpers$1.getResponsiveSetting(u||{}),uid:s?.uid,enableParallax:g&&Number(r?.speedParallax||0)>0,speedParallax:Number(r?.speedParallax)||0,hoverEffect:a?.hoverEffect,hoverEffectScale:a?.hoverEffectScale,layout:r?.layout,contentPosition1Col:a?.contentPosition1Col,contentPosition2Col:a?.contentPosition2Col,aspectRatio:r?.aspectRatio,sizeSetting:helpers$1.getResponsiveSetting(a?.sizeSetting||{}),videoObjectFit:helpers$1.getResponsiveSetting(a?.videoObjectFit||{}),target:p?.target??"_self",href:h?.href??"",linkType:p?.type??"",hoverEffectDuration:a?.hoverEffectDuration,isYoutubeVideoMigrated:r?.isYoutubeVideoMigrated}),y=!!p?.link&&d,v=system.createAttr({...attrs.getAttr({uid:s?.uid||""})}),$=system.createAttr(attrs.getAttrLink()),b=system.createStyle({...styles.getStyle(a,r,n)}),S=system.createClass({...classes.getClasses({setting:r,builderProps:s,advancedCssClass:f})}),k=system.createClass({...classes.getLinkClasses()}),C=()=>HeroBannerItem_liquid.default({setting:r,translatedBackground:u,styles:a,children:i,enableLazyLoadImage:c,rawChildren:e.rawChildren,builderProps:s,pageContext:o});return core.template`
      <gp-hero-banner
        ${{...t}}
        ${{...v}}
        class="${S}"
        style="${b}"
        gp-data='${core.dataStringify(m)}'
      >
        ${system.If(!y,C())}
        ${system.If(y,core.template`
          <div
            ${{...$}}
            aria-hidden="true"
            class="${k}"
          >
            ${C()}
          </div>`)}
      </gp-hero-banner>
       ${core.RenderIf(core.isLocalEnv,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-hero-banner-v2-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-hero-banner-v2-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>
`)}
  `};exports.default=HeroBanner;
