import{ao as e,ba as f,r as L,a_ as u,cr as x,aq as b,d6 as S,d7 as V,M as s,aC as P,bv as g,E as v}from"./app-k0jcl5PQ.js";import{V as p,T as A}from"./BhYYYlpK.chunk.js";const $="_thumbnailTitle_14phd_1",z={thumbnailTitle:$};function y(t){return e.jsx("h3",{title:t.title,className:"h6",children:t.title})}function M(t){return t.appLink?e.jsx(f,{appLink:t.appLink,className:`${z.thumbnailTitle}`,children:e.jsx(y,{...t})}):e.jsx(y,{...t})}const E="_badge_o3vz9_1",O="_mask_o3vz9_4",D="_thumbnailContainer_o3vz9_7",c={badge:E,mask:O,thumbnailContainer:D},T="shared.collectionThumbnail";function F(t){var r,m,h;function j(){var a;let i=(a=t.collection)==null?void 0:a.videos;if(i){if(!i.count&&t.collection.typeId===s.Playlist){const n=t.collection;n.clips.count&&(i=n.clips),n.interactives.count&&(i=n.interactives)}return P.first(i.data)}}function k(){var a,n;let i=0;if(t.collection.videos&&t.collection.videos.count&&(i+=t.collection.videos.count),t.collection.typeId===s.Playlist){const l=t.collection;(a=l.interactives)!=null&&a.count&&(i+=l.interactives.count),(n=l.clips)!=null&&n.count&&(i+=l.clips.count)}return i}function C(i){if(g.isType(i,s.Playlist))return v.Playlist;if(g.isType(i,s.Series))return v.Series}const o=j(),d=k(),w=((r=t.title)==null?void 0:r.length)||((m=t.subText)==null?void 0:m.length),N={id:t.collection.id.toString(),name:t.collection.name,...t.analyticsData},_={actionType:L.Click,entity:C(t.collection),...t.analyticsOptions};return e.jsxs("div",{children:[e.jsx("div",{className:`position-relative ${c.thumbnailContainer} z-1`,children:e.jsxs(f,{appLink:t.appLink,analyticsData:N,analyticsOptions:_,preventFocus:!0,children:[t.showMask&&e.jsx("div",{className:`${c.mask} position-absolute w-100 h-100 rounded-3 bg-dark bg-gradient z-1 bg-opacity-50 pointer-events-none`,children:e.jsxs("div",{className:`${c.badge} d-flex align-items-center w-fit flex-grow-0 bg-dark rounded-pill ps-1 m-2`,children:[e.jsx(u,{svg:x,className:"svg-container text-white"}),e.jsx("p",{className:"d-inline fw-medium text-white mb-0",children:(h=t.hoverText)!=null&&h.length?e.jsx("span",{children:t.hoverText}):e.jsx(b,{namespace:T,phrase:"playAll"})})]})}),o&&e.jsx(p,{video:o,imageOptions:t.imageOptions,textPosition:A.Independent,type:"cosmetic",hideMask:!0,hideRating:!0,hideDuration:!0,hideVideoTypeBadge:!0}),!o&&e.jsx("div",{className:"ratio ratio-16x9 bg-light rounded-3",children:e.jsx("div",{className:"d-flex justify-content-center align-items-center",children:e.jsx(u,{svg:x,className:"w-33 opacity-25 text-gray-400"})})}),t.showVideoCount&&e.jsxs("div",{className:`${c.badge} d-flex align-items-center w-fit bg-dark bg-opacity-75 rounded-pill position-absolute bottom-0 end-0 ps-1 m-2`,children:[e.jsx(u,{svg:S,className:"svg-container text-white me-1"}),e.jsx("p",{className:"d-inline fw-semibold text-white mb-0",children:t.onlyCount?e.jsx("span",{children:d}):e.jsx(b,{namespace:T,phrase:"videos",options:{count:d,smartCount:d}})})]})]})}),w&&e.jsxs("div",{className:"mt-2 d-flex flex-column",children:[t.subText&&e.jsx(V,{title:t.subText,appLink:t.subTextAppLink,children:t.subText}),t.title&&e.jsx(M,{title:t.collection.name,appLink:t.titleAppLink})]})]})}export{F as C};
//# sourceMappingURL=CBHg5Ydb.chunk.js.map
