"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("../../grid/components/row/Row.liquid.js"),s=require("@gem-sdk/system"),a=require("../../image/components/AdaptiveImage.liquid.js"),l=require("../../video/components/HTML5Embed.liquid.js"),i=require("../common/styles.js"),r=require("../common/classes.js"),o=require("../common/helpers.js"),d=require("../../image/common/helpers.js"),u=require("../../image/components/NextImage.liquid.js"),n=require("../../video/components/LiteYouTubeEmbed.liquid.js"),g=require("../../video/common/helpers.js"),c=require("../../grid/components/row/common/helpers.js"),m=require("../../image/constants.js"),p=require("../../helpers.js");exports.default=y=>{let{enableLazyLoadImage:C=!0,translatedBackground:v,setting:S,styles:f,children:q,builderProps:I,rawChildren:b,pageContext:j}=y,{layout:T,verticalAlign:k,enableParallax:R,alt:$,title:h,preload:B,isYoutubeVideoMigrated:A}=S??{},{background:V,overlayColor:w,verticalGutter:x,sizeSetting:H,contentWidth:Y,hoverEffect:z,contentPosition1Col:L,contentPosition2Col:N,videoObjectFit:O}=f??{},E=!B&&C,D=o.getAspectRatio(H,V),_=o.getYoutubeAspectRatio(V,O,D),P=o.getResponsiveSetting(v||{}),W=P.desktop,M=s.createStyle({...i.getContainerStyle(f)}),G=s.createClass({...r.getContainerClasses(S,f)}),U=s.createStyle({...i.getOverlayStyle(f)}),F=s.createClass({...r.getOverlayClasses(f)}),J=s.createStyle({...i.getRowStyle(f)}),K=s.createClass({...r.getRowClasses(f,S)}),Q=s.createStyle({...i.getAdaptiveStyle(f)}),X=s.createClass({...r.getAdaptivePictureClasses()}),Z=s.createClass({...r.getAdaptiveClasses()}),ee=s.createClass({...r.getBackgroundClasses(z,E)}),et=s.createStyle({...o.getBackgroundImageHeroBanner(v,E,!1),...i.getBackgroundStyle(f,R,"")}),es=s.createClass({...r.getContainBackgroundClasses()}),ea=s.createStyle({...i.getContainBackgroundStyle(f)}),el=s.createClass({...r.getHtml5VideoClasses(!1)}),ei=s.createStyle({...i.getYoutubeIframeStyle(_,O)}),er=s.createClass({...r.getWrapperYoutubeClasses(A)}),eo=s.createStyle({...i.getHtml5VideoStyle(D,O,V)}),ed=s.createClass({...r.getIframeYoutubeClasses()}),eu=e=>s.createClass({...r.getLazyBackgroundClasses(e)});return e.template`
  <div class="${G}" style="${M}">
      <div
        class="${es}"
        style="${ea}"
      >
        <div class="${ee}" style="${et}">
          ${(()=>{if(!B)return e.DEVICES.map(t=>s.If(o.getEnableBgImageByDevice(t,v),u.default({src:d.getImageSrc(e.getResponsiveValueByScreen(o.getBgImage(v),t),t),alt:p.getSeoTranslated({valueTranslate:$,uid:I?.uid,settingId:"alt",pageContext:j??{}}),title:p.getSeoTranslated({valueTranslate:h,uid:I?.uid,settingId:"title",pageContext:j??{}}),className:eu(t),isDisableAspectStyle:!0,enableLazyLoadImage:C}))).join("")})()}
          ${(()=>{if(!o.showVideoType(V))return;if(c.isRenderHtmlVideo(V))return l.default({uid:I?.uid,muted:!0,loop:W?.loop,controls:!1,autoplay:!0,src:W?.videoHtml5||"",title:"Video",style:eo,className:el});let t=W?.video??"",s=g.getYoutubeVideoId(t),a=`&loop=false&playlist=${s}&showinfo=0&rel=0&fs=0&enablejsapi=1`,i=e.hasTranslatedLiquid(t);if(W?.type==="video"&&W?.videoType==="youtube"&&s&&g.youtubeVideoRegex.test(t)||i)return n.default({uid:I?.uid,id:s??"",translatedVideoUrl:i?t:"",isHeroBanner:!0,autoplay:!0,title:"Video",controls:!1,params:a,adNetwork:!1,noCookie:!0,muted:!0,lazy:W?.lazyLoad??!0,style:ei,wrapperClass:er,iframeClass:ed})})()}
        </div>
        ${s.If(!!w,e.template`<div aria-label="Overlay" class="${F}" style="${U}"> </div>`)}
      </div>
      ${t.default({className:K,style:J,setting:{layout:T,horizontalAlign:o.horizontalAlign(T,L,N),verticalAlign:k},styles:{verticalGutter:x,width:o.getWidth(Y),fullWidth:{desktop:!1,tablet:!1,mobile:!1}},children:q,rawChildren:b})}
        ${a.default({pictureClass:X,srcSet:o.getBgImage(v),className:Z,...B&&m.PRIORITY_LOAD_ATTRS,aspectRatio:e.getAspectRatioGlobalSize(H),style:Q,alt:p.getSeoTranslated({valueTranslate:$,uid:I?.uid,settingId:"alt",pageContext:j??{}}),title:p.getSeoTranslated({valueTranslate:h,uid:I?.uid,settingId:"title",pageContext:j??{}}),enableLazyLoadImage:C,fallbackImg:o.fallbackImg})}
  </div>
`};
