1import{j as e,y as f,r as l}from"./index-DIYGvCP-.js";const m=t=>!!t&&/\.(mp4|webm|ogv)(\?|$)/i.test(t);function b({pkg:t,className:r="",children:n}){const s=t.media?.banner;return e.jsxs("div",{className:`relative overflow-hidden ${r}`,children:[s?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:s,alt:`${t.name} banner`,loading:"lazy",className:"absolute inset-0 h-full w-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-black/10"})]}):e.jsx("div",{className:"card-grad absolute inset-0"}),e.jsx("div",{className:"relative flex h-full items-center justify-center",children:n??e.jsx("span",{className:"px-3 text-center text-2xl font-extrabold tracking-tight text-white drop-shadow",children:t.label})})]})}function y({pkg:t,className:r=""}){const n=t.media?.icon;return n?e.jsx("div",{className:`relative overflow-hidden bg-surface-alt ${r}`,children:e.jsx("img",{src:n,alt:`${t.name} icon`,loading:"lazy",className:"absolute inset-0 h-full w-full object-cover"})}):e.jsx(b,{pkg:t,className:r,children:e.jsx("span",{className:"text-sm font-extrabold text-white drop-shadow",children:t.label.charAt(0)})})}function h({pkg:t}){const r=t.media?.bannerVideo??(m(t.media?.banner)?t.media?.banner:void 0),n=t.trailerUrl?f(t.trailerUrl):void 0,s=m(t.media?.banner)?void 0:t.media?.banner,i=l.useRef(null),d=l.useRef(!1),o=l.useRef(null);return l.useEffect(()=>{if(!n)return;function c(){i.current||(i.current=new window.YT.Player("youtube-player",{videoId:n,playerVars:{autoplay:1,controls:0,mute:1,rel:0,fs:0,modestbranding:1,playsinline:1,iv_load_policy:3,disablekb:1,showinfo:0},events:{onReady:a=>{a.target.mute(),a.target.playVideo()},onStateChange:a=>{a.data===window.YT.PlayerState.PLAYING&&o.current&&(o.current.style.opacity="1"),a.data===window.YT.PlayerState.ENDED&&a.target.playVideo()}}}))}if(window.YT)window.YT.Player?c():window.onYouTubeIframeAPIReady=()=>{d.current=!0,c()};else{const a=document.createElement("script");a.src="https://www.youtube.com/iframe_api";const u=document.getElementsByTagName("script")[0];u?.parentNode?.insertBefore(a,u),window.onYouTubeIframeAPIReady=()=>{d.current=!0,c()}}return()=>{if(i.current?.destroy)try{i.current.destroy(),i.current=null}catch{}}},[n]),e.jsx(e.Fragment,{children:r?e.jsx("video",{className:"absolute inset-0 h-full w-full object-cover",src:r,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,poster:s}):n?e.jsxs("div",{ref:o,className:"pointer-events-none absolute inset-0 overflow-hidden transition-opacity duration-500",style:{opacity:0},children:[e.jsx("div",{id:"youtube-player",className:"absolute left-1/2 top-1/2 h-[110vh] min-h-full w-[195vh] min-w-full -translate-x-1/2 -translate-y-1/2 pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 z-10 pointer-events-none"})]}):s?e.jsx("img",{src:s,alt:`${t.name} banner`,className:"absolute inset-0 h-full w-full object-cover"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"card-grad absolute inset-0"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-white/40",children:"Banner video placeholder"})})]})})}export{b as P,y as a,h as b};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.