1import{w as s,bt as q,N as L,et as O,eu as X,ev as Z,ew as J,bu as V,j as e,ex as N,O as R,bT as K,ey as T,a2 as ee,ez as A}from"./client-Bai4VJA1.js";import{B,I as g,H as C,R as U}from"./FeaturedSgmWidgetHeader-Bs5pMGp9.js";import{u as G}from"./useBreakpoint-BnoNun7E.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"97808a5afbf047a0a6f7534b79e8c9b165448d38"};var t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="1d74de23-4cab-455b-a4e9-8463cff2656f",a._sentryDebugIdIdentifier="sentry-dbid-1d74de23-4cab-455b-a4e9-8463cff2656f")}catch{}})();const te=()=>s.useContext(q),ne=()=>{const{loggedIn:a,embedUser:t}=L(),o=!!t?.loggedIn,{data:l}=O(void 0,{skip:!a||o}),{data:i}=X(t?.metadata?{metadata:{brand_name:t.metadata.brandName,brand_user_id:t.metadata.brandUserId,user_id:t.metadata.userId,data:t.metadata.data}}:void 0,{skip:!a||!o||!t?.metadata});return o?i:l},se=()=>{const{loggedIn:a,embedUser:t}=L(),o=!!t?.loggedIn,{data:l}=Z(void 0,{skip:!a||o}),{data:i}=J(t?.metadata?{metadata:{brand_name:t.metadata.brandName,brand_user_id:t.metadata.brandUserId,user_id:t.metadata.userId,data:t.metadata.data}}:void 0,{skip:!a||!o||!t?.metadata});return o?i:l},ie=({fixedPlayer:a})=>{const t=V(),o=ne();return o?.url?e.jsxs(e.Fragment,{children:[e.jsx("iframe",{src:o.url,style:{width:"100%",height:"100%",border:"none"},allow:"autoplay; fullscreen; encrypted-media"}),!a&&e.jsx(B,{className:"bg-transparent opacity-50 transition-opacity hover:opacity-100",style:{position:"absolute",top:0,left:0,zIndex:1001},children:e.jsx(g,{name:"drag"})}),e.jsx(B,{className:"bg-transparent opacity-50 transition-opacity hover:opacity-100",onClick:()=>t(N()),onTouchEnd:l=>{l.preventDefault(),t(N())},style:{position:"absolute",top:0,right:0,zIndex:1001},children:e.jsx(g,{name:"close"})})]}):null},ae=({onWidthChange:a,fixedPlayer:t=!1})=>{const{visionMuted:o}=R(n=>n.preference),{visionExpanded:l,visionType:i}=R(n=>n.racing),{isMobile:_}=G(),f=s.useRef(null),k=s.useRef(null),p=s.useRef(!1),[h,E]=s.useState(o),[I,c]=s.useState(!1),[w,v]=s.useState(!0),[d,r]=s.useState(!1),[x,m]=s.useState(window.matchMedia("(orientation: landscape)").matches),[y,S]=s.useState(window.innerWidth),u=V(),j=se(),P=t?y:l?Math.min(y,640):320,W=s.useMemo(()=>({sky1:j?.channel_1??"",sky2:j?.channel_2??""}),[j]);s.useEffect(()=>{const n=()=>S(window.innerWidth);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),s.useEffect(()=>{const n=window.matchMedia("(orientation: landscape)"),H=Q=>m(Q.matches);return n.addEventListener("change",H),()=>n.removeEventListener("change",H)},[]),s.useEffect(()=>(E(!0),Y()),[]);const Y=()=>{c(!0);const n=setTimeout(()=>c(!1),3500);return()=>clearTimeout(n)};s.useEffect(()=>{if(C.isSupported()&&f.current&&i&&i!=="none"&&i!=="vision"){const n=new C;return n.loadSource(W[i]),n.attachMedia(f.current),n.on(C.Events.MANIFEST_PARSED,()=>{f.current&&f.current.play().catch(()=>v(!1))}),()=>{n.destroy()}}},[W,i,d]),s.useEffect(()=>{a?.(P)},[l,a,P]),s.useEffect(()=>{u(K({visionMuted:h}))},[h,u]);const $=()=>{f.current&&(w?f.current.pause():f.current.play(),v(!w))},F=()=>{u(A(!l))},M=()=>{r(!1),p.current=!1,u(A(!0)),u(N())},D=()=>{if(_||p.current){const n=!d;p.current=n,r(n)}else document.fullscreenElement?document.exitFullscreen():k.current?.requestFullscreen()};s.useEffect(()=>{const n=()=>{r(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]),s.useEffect(()=>(d&&p.current&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[d]);const z=e.jsxs(e.Fragment,{children:[e.jsx("video",{ref:f,src:i==="vision"||i==="none"?"":W[i],autoPlay:!0,playsInline:!0,muted:h,className:d?"h-full w-full object-contain":"aspect-video w-full rounded-lg",onPlay:()=>v(!0),onPause:()=>v(!1)}),!w&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:e.jsx("button",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-black/75 hover:bg-black/90",onClick:$,children:e.jsx(g,{name:"play-line",color:"white",size:"xl"})})}),I&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"absolute left-1/2 top-2 flex -translate-x-1/2 overflow-hidden rounded-full bg-black/75",children:[e.jsx("button",{className:`px-4 ${i==="sky1"?"m-0.5 rounded-full bg-white":""}`,onClick:()=>u(T("sky1")),onTouchStart:()=>u(T("sky1")),children:e.jsx(g,{name:i==="sky1"?"sky1":"sky1-white",size:"lg"})}),e.jsx("button",{className:`px-4 ${i==="sky2"?"m-0.5 rounded-full bg-white":""}`,onClick:()=>u(T("sky2")),onTouchStart:()=>u(T("sky2")),children:e.jsx(g,{name:i==="sky2"?"sky2":"sky2-white",size:"lg"})})]}),e.jsx("div",{className:"absolute right-2 top-2 rounded-lg bg-black/75 p-1",children:e.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full",onClick:M,onTouchStart:M,children:e.jsx(g,{name:"close",color:"white"})})}),e.jsxs("div",{className:"absolute bottom-2 right-2 flex gap-1 rounded-lg",children:[e.jsx("div",{className:"rounded-lg bg-black/75 p-1",children:e.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-l",onClick:()=>E(!h),onTouchStart:()=>E(!h),children:e.jsx(g,{name:h?"mute":"volume",color:"white"})})}),!t&&!d&&e.jsx("div",{className:"rounded-lg bg-black/75 p-1",children:e.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-l",onClick:F,onTouchStart:F,children:e.jsx(g,{name:l?"minimise":"expand",color:"white"})})}),e.jsx("div",{className:"rounded-lg bg-black/75 p-1",children:e.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-l",onClick:D,onTouchStart:D,children:e.jsx(g,{name:d?"fullscreen-exit":"fullscreen",color:"white"})})})]})]})]});return d&&p.current?ee.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black",style:{zIndex:9998},onClick:D}),e.jsx("div",{className:"relative",style:{position:"fixed",top:"50%",left:"50%",width:x?"100vw":"100dvh",height:x?"100dvh":"100vw",transform:x?"translate(-50%, -50%)":"translate(-50%, -50%) rotate(90deg)",zIndex:9999,backgroundColor:"black",paddingLeft:x?"env(safe-area-inset-left)":"env(safe-area-inset-top)",paddingRight:x?"env(safe-area-inset-right)":"env(safe-area-inset-bottom)"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onTouchStart:()=>c(n=>!n),children:z})]}),document.body):e.jsx("div",{ref:k,className:"relative",style:d?{width:"100%",height:"100%",backgroundColor:"black"}:{width:P},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onTouchStart:()=>c(n=>!n),children:z})},b={vision:16/10,sky:16/9},de=()=>{const a=V(),{loggedIn:t}=L(),{visionEnabled:o,visionExpanded:l,visionType:i}=R(r=>r.racing),{isFloating:_}=te(),{isMobile:f}=G(),[k,p]=s.useState(320),[h,E]=s.useState(window.scrollY);s.useEffect(()=>{const r=()=>E(window.scrollY);return window.addEventListener("scroll",r),()=>window.removeEventListener("scroll",r)},[]),s.useEffect(()=>{t||a(N(!1))},[a,t]);const I=f&&!_,c=s.useCallback(()=>{const m=["sky1","sky2"].includes(i)&&l?Math.min(window.innerWidth,640):320,y=window.innerWidth-16,S=1440,u=1280;if(window.innerWidth>S){const j=window.innerWidth-S;return y-295-m-j}return window.innerWidth>u?y-295-m:window.innerWidth>
1m?y-m:0},[i,l]),w=s.useCallback(r=>e.jsx(ie,{fixedPlayer:r}),[]),v=s.useCallback(r=>e.jsx(ae,{onWidthChange:p,fixedPlayer:r}),[]);if(!t||!o)return null;const d={vision:{x:c(),y:h+120,width:320,height:320/b.vision},sky:{x:c(),y:h+104,width:320,height:320/b.sky}};return["sky1","sky2"].includes(i)?I?v(!0):e.jsx(U,{default:d.sky,size:{width:k,height:k/b.sky},minWidth:200,minHeight:200/b.sky,bounds:"window",lockAspectRatio:b.sky,enableResizing:!1,style:{border:"1px solid #ccc",background:"#fff",zIndex:1e3,borderRadius:8,position:"fixed"},children:v(!1)},`skyVision-${o}`):i==="vision"?I?e.jsx("div",{className:"relative",style:{height:window.innerWidth/b.vision},children:w(!0)}):e.jsx(U,{default:d.vision,minWidth:200,minHeight:200/b.vision,bounds:"body",lockAspectRatio:b.vision,onResize:(r,x,m)=>{const y=m.offsetWidth;m.style.height=`${y/b.vision}px`,p(y)},style:{border:"1px solid #ccc",background:"#fff",zIndex:1e3,position:"fixed"},children:w(!1)},`vision-${o}`):null};export{de as F,te as u};
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.