import{aP as e,aI as c,ao as l,M as s}from"./app-k0jcl5PQ.js";const u="_left_70dai_1",b="_right_70dai_24",U="_blur_70dai_31",h="_imageContainer_70dai_43",P="_imagePosition_70dai_52",f="_image_70dai_43",C="_thumbnail_70dai_59",L="_tallposter_70dai_62",I="_cover_70dai_65",B="_simpleImage_70dai_68",G="_linksContainer_70dai_76",n={left:u,right:b,blur:U,imageContainer:h,imagePosition:P,image:f,thumbnail:C,tallposter:L,cover:I,simpleImage:B,linksContainer:G},v=[{bgUrl:e.LaunchPad.BG_1},{bgUrl:e.LaunchPad.BG_2},{bgUrl:e.LaunchPad.BG_3},{bgUrl:e.LaunchPad.BG_4},{bgUrl:e.LaunchPad.BG_5}],j=[{bgUrl:e.LaunchPad.PRODUCT.BG_1},{bgUrl:e.LaunchPad.PRODUCT.BG_2},{bgUrl:e.LaunchPad.PRODUCT.BG_3},{bgUrl:e.LaunchPad.PRODUCT.BG_4},{bgUrl:e.LaunchPad.PRODUCT.BG_5},{bgUrl:e.LaunchPad.PRODUCT.BG_6},{bgUrl:e.LaunchPad.PRODUCT.BG_7},{bgUrl:e.LaunchPad.PRODUCT.BG_8}];function T(a){return a[Math.floor(Math.random()*a.length)]}function x(a){switch(a){case s.Video:case s.Interactive:case s.Clip:return n.thumbnail;case s.Subject:case s.Playlist:return n.cover;case s.Series:return n.tallposter;default:return""}}function D(a){const[i,m]=c.useState(null),[o,_]=c.useState(""),r=a.imageUrl,g=a.fallbackImageUrl;return c.useEffect(()=>{if(r)return;const t=T(j);t.bgUrl&&_(t.bgUrl)},[]),c.useEffect(()=>{if(!r)return;const t=new Image;return t.onload=()=>m(r),t.onerror=()=>{if(g){const d=new Image;d.onload=()=>m(g),d.src=g}},t.src=r,()=>{t.onload=null,t.onerror=null}},[]),l.jsx("div",{className:`${n.left} ${o?"bg-blue d-flex align-items-center":a.backgroundClass??"bg-light"}`,children:o?l.jsx("img",{className:"img-fluid",src:o,draggable:!1}):i&&l.jsxs(l.Fragment,{children:[!a.backgroundClass&&l.jsx("div",{className:n.blur,style:{backgroundImage:`url('${i}')`}}),a.objectType?l.jsx("div",{className:`${n.imageContainer} ${x(a.objectType)}`,children:l.jsx("div",{className:n.imagePosition,children:l.jsx("img",{className:n.image,src:i,alt:a.title})})}):l.jsx("div",{className:n.imageContainer,children:l.jsx("img",{className:n.simpleImage,src:i,alt:a.title,draggable:!1})})]})})}export{v as L,D as a,j as b,n as s};
//# sourceMappingURL=BCKXZxoz.chunk.js.map
