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