'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),HeroBannerItem=require("./HeroBannerItem.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("../common/helpers.js"),useHeroBanner=require("../hooks/useHeroBanner.js"),React=require("react");const HeroBanner=e=>{let{builderAttrs:s,builderProps:r,setting:t,styles:a,style:n,children:o,advanced:l,enableLazyLoadImage:i=!0}=e,{isEditMode:u,isPreviewSharePageMode:c}=core.useRenderMode(),{enableLink:m}=t??{},d=helpers.getBannerLink(t),{cssClass:y}=l??{},j=core.useCurrentDevice(),{elementRef:f,transform:h,onMouseEnterParallax:R,onMouseLeaveParallax:g,dataVideo:B,bgRef:p,isShowVideoHtml5:q,openLinkBanner:x,layoutResponsive:C}=useHeroBanner.useHeroBanner(a,t,j),H=React.useRef(null),v=!!d?.link&&m&&!u&&!c,k=system.createAttr({...attrs.getAttr({uid:r?.uid||""})}),I=system.createAttr({...attrs.getAttrLink()}),L=system.createStyle({...styles.getStyle(a,t,n)}),b=system.createClass({...classes.getClasses({setting:t,builderProps:r,advancedCssClass:y})}),w=system.createClass({...classes.getLinkClasses()}),A=()=>jsxRuntime.jsx(HeroBannerItem.default,{setting:t,styles:a,children:o,rawChildren:e.rawChildren,builderProps:r,enableLazyLoadImage:i,elementRef:f,transform:h,dataVideo:B,layoutResponsive:C,bgRef:p,isShowVideoHtml5:q,heroBannerWrapperRef:H});return jsxRuntime.jsxs("div",{ref:H,...s,...k,className:b,style:L,onMouseEnter:R,onMouseLeave:g,children:[system.If(!v,A()),system.If(v,jsxRuntime.jsx("div",{...I,"aria-hidden":"true",onClick:x,className:w,children:A()})),core.filterToolbarPreview(o,!0)]})};exports.default=HeroBanner;
