import{aI as C,cu as m,ao as a,ba as j,aq as v,r as b,cm as h,bW as _,M as s,bS as f,cv as c,cw as r,cx as d,cy as N,b_ as S,bT as T}from"./app-k0jcl5PQ.js";import{C as w}from"./CBHg5Ydb.chunk.js";import{V as I,T as M}from"./BhYYYlpK.chunk.js";const F="_posterFallbackSvg_1239k_4",p="_coverFallbackSvg_1239k_7",O="_thumbnailContainer_1239k_10",V="_requireMarking_1239k_13",$="_badge_1239k_19",B="_bar_1239k_22",A="_a_1239k_27",L="_b_1239k_19",q="_c_1239k_7",i={posterFallbackSvg:F,coverFallbackSvg:p,thumbnailContainer:O,requireMarking:V,badge:$,bar:B,a:A,b:L,c:q},z="shared.sharedObjectImage",n="rounded overflow-hidden";function P(e){const t=f.getDisplayImageFromObject(e);if(m.isVideoType(e))return{image:t,imageType:c.Thumbnails,imageClassName:n,imageFallbackComponent:a.jsx(r,{type:d.Video})};switch(e.typeId){case s.Series:return{image:t,imageType:c.TallPosters,imageClassName:n,imageFallbackComponent:a.jsx(r,{type:d.Series,svgContainerClassName:i.posterFallbackSvg})};case s.Playlist:return{image:t,imageType:c.Covers,imageClassName:t!=null&&t.url?n:`${n} ${N(e.name,S)}`,imageFallbackComponent:a.jsx(r,{type:d.Playlist,svgContainerClassName:t!=null&&t.url?i.coverFallbackSvg:"d-none",extraClasses:!(t!=null&&t.url)&&"bg-transparent"})}}}function E(){return a.jsxs("div",{className:"d-flex pointer-events-none position-absolute bottom-0 start-0 h-100 w-100 z-1 justify-content-center align-items-center",children:[a.jsx("div",{className:"position-absolute bg-dark bg-gradient opacity-50 w-100 h-100 z-0 rounded-3"}),a.jsxs("div",{className:"d-flex align-items-end gap-2 h-50 z-1",children:[a.jsx("div",{className:"d-flex align-items-end h-50",children:a.jsx("div",{className:`${i.bar} ${i.a} rounded shadow`})}),a.jsx("div",{className:"d-flex align-items-end h-75",children:a.jsx("div",{className:`${i.bar} ${i.b} rounded shadow`})}),a.jsx("div",{className:"d-flex align-items-end h-100",children:a.jsx("div",{className:`${i.bar} ${i.c} rounded shadow`})})]})]})}function H(e){if(m.isVideoType(e))return 16/9;if(e.typeId===s.Playlist)return 1;if(e.typeId===s.Series)return 9/16}R.defaultProps={imageOptions:{size:T.Small}};function R(e){const t=C.useCallback(o=>{!o||!e.fixedHeight||(o.style.width=`${o.offsetHeight*H(e.object)}px`)},[]),g=m.isVideoType(e.object),{image:l,imageType:u,imageClassName:k,imageFallbackComponent:x}=P(e.object),y=e.showVideoMetadata?{hideBottomBar:e.hideBottomBar}:{hideDuration:!0,hideMask:!0,hideRating:!0,hideVideoBadgeType:!0,hideBottomBar:!0};return a.jsx("div",{className:"d-flex align-items-center justify-content-center w-100 h-100",children:a.jsxs("div",{ref:t,className:e.fixedHeight?"h-100":"w-100",children:[g&&a.jsxs("div",{className:`${i.thumbnailContainer} position-relative`,children:[e.showInsightsMask&&a.jsx(E,{}),a.jsx(j,{appLink:e.appLink,children:a.jsx(I,{video:e.object,size:e.thumbnailSize,imageOptions:e.imageOptions,textPosition:M.Independent,type:"cosmetic",imageClassName:e.imageClassName,...y})}),!!e.requireMarking&&a.jsx("div",{className:`${e.showInsightsMask&&i.requireMarking} position-absolute bottom-0 end-0 z-1 m-2`,children:a.jsx("div",{className:`${i.badge} d-flex align-items-center bg-light-ultramarine text-ultramarine fw-semibold rounded-pill w-fit mt-1 px-2`,children:a.jsx(v,{namespace:z,phrase:"requireMarking",options:{smartCount:e.requireMarking}})})})]}),!g&&a.jsx(a.Fragment,{children:"videos"in e.object?a.jsx(w,{collection:e.object,imageOptions:e.imageOptions,appLink:e.appLink,analyticsData:{id:e.object.id,name:e.object.name},analyticsOptions:{entity:h.getAnalyticsEntity(e.object.type),actionType:b.Click,location:e.locationContext},showMask:e.showCollectionMask,showVideoCount:e.showVideoCount,onlyCount:e.onlyCount}):a.jsx(_,{data:l==null?void 0:l.url,imageType:u,imageOptions:e.imageOptions,appLink:e.appLink,className:k,analyticsData:{id:e.object.id,name:e.object.name},analyticsOptions:{entity:h.getAnalyticsEntity(e.object.type),actionType:b.Click,location:e.locationContext},children:x})})]})})}export{R as S};
//# sourceMappingURL=B8hCUVHx.chunk.js.map
