1import{_ as j}from"./DlAUqK2U.js";import{o as n,c as r,q as M,b as s,d as k,g as f,w as y,i as T,t as _,f as o,l as b,h as E,z as i,C as z,D as l,E as L,G as U,H as V,I as W,J as B,s as I,x as A,y as Y,k as Z,F as C,r as D}from"./D-lTpltH.js";import{_ as O}from"./g29_ymSw.js";import{_ as X}from"./lnCE4Z2x.js";import{_ as q}from"./BCdEtCoo.js";import{g as N}from"./CT2BoUtt.js";import{_ as H}from"./PzznnjGT.js";import{u as P}from"./DKPk7vEH.js";import{c as G}from"./CoD-DTFI.js";const J={},K={class:"bg-xt-red text-white px-2 py-1 font-display uppercase w-fit rounded-md mb-1"};function Q(t,e){return n(),r("p",K,[M(t.$slots,"default")])}const F=j(J,[["render",Q]]),tt={},et={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"};function st(t,e){return n(),r("svg",et,[...e[0]||(e[0]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"},null,-1),s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"},null,-1)])])}const at=j(tt,[["render",st]]),nt={class:"text-white text-5xl font-display font-extrabold"},ot={class:"flex flex-col gap-4 mb-12 md:flex-row md:justify-between md:gap-12"},rt={class:"relative w-full aspect-video flex-1 min-w-60"},it={key:0,class:"absolute inset-0 flex items-center justify-center bg-black/80"},lt=["src"],ct={class:"basis-3/12"},ut={key:0,class:"flex text-white items-baseline gap-2 flex-wrap mb-4 font-display"},mt={class:"text-2xl"},_t={class:""},dt={class:"text-sm font-sans font-thin"},ft={key:1,class:"flex text-white items-baseline gap-2 flex-wrap mb-4 font-display"},pt={class:"text-2xl"},ht={class:"text-sm font-sans font-thin"},bt={class:"flex items-center gap-2 mb-6"},vt={class:"text-white font-display"},xt=["innerHTML"],gt=["href"],wt=k({__name:"FeaturedStream",props:{stream:{},title:{}},setup(t){const e=t,h=E(!1),d=i(()=>e.stream.start_date_time_iso?new Date(e.stream.start_date_time_iso).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):""),p=i(()=>e.stream.start_date_time_iso?new Date(e.stream.start_date_time_iso).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):""),v=i(()=>!e.stream.start_date_time_iso||!e.stream.event?.timezone?"":new Date(e.stream.start_date_time_iso).toLocaleTimeString("en-US",{timeZone:e.stream.event.timezone,hour:"numeric",minute:"2-digit",hour12:!0})),x=i(()=>e.stream.event?.timezone?new Intl.DateTimeFormat("en-US",{timeZone:e.stream.event.timezone,timeZoneName:"shortOffset"}).formatToParts().find(c=>c.type==="timeZoneName")?.value:""),a=i(()=>e.stream.start_date_time_user_input?new Date(e.stream.start_date_time_user_input).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):""),u=i(()=>e.stream.start_date_time_user_input?new Date(e.stream.start_date_time_user_input).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}):"");return(m,c)=>{const S=F,g=O,w=at;return n(),r("div",null,[f(S,null,{default:y(()=>[T(_(t.title),1)]),_:1}),s("h2",nt,_(t.stream.name),1),c[1]||(c[1]=s("hr",{class:"my-4 border-gray-400"},null,-1)),s("div",ot,[s("div",rt,[o(h)?b("",!0):(n(),r("div",it,[f(g,{class:"size-12 text-xt-red"})])),s("iframe",{src:`https://www.youtube.com/embed/${t.stream.youtube_id}`,class:"absolute inset-0 w-full h-full",allow:"fullscreen",onLoad:c[0]||(c[0]=R=>h.value=!0)},null,40,lt)]),s("div",ct,[t.stream.event?.timezone?(n(),r("span",ut,[s("span",mt,_(o(d)),1),s("span",_t,_(o(p)),1),s("span",dt,"("+_(o(v))+" "+_(o(x))+")",1)])):b("",!0),t.stream.event?.timezone?b("",!0):(n(),r("span",ft,[s("span",pt,_(o(a)),1),s("span",null,_(o(u)),1),s("span",ht,_(t.stream.time_zone),1)])),s("div",bt,[f(w,{class:"size-4 text-neutral-500"}),s("p",vt,_(t.stream.location),1)]),s("div",{innerHTML:t.stream.description,class:"text-white text-sm font-light mb-6"},null,8,xt),t.stream.info_button_url||t.stream.info_button_text?(n(),r("a",{key:2,href:t.stream.info_button_url||"",target:"_blank",class:"rounded-full text-sm px-2 py-1
1w-fit border-white border text-white hover:bg-white hover:text-black"},_(t.stream.info_button_text),9,gt)):b("",!0)])])])}}}),yt={class:"flex flex-col"},St=["href"],$t={class:"absolute top-1/2 left-1/2 -translate-x-1/2"},Lt={class:"relative rounded-lg w-14 h-8 bg-xt-red"},Tt=["href"],kt=k({__name:"VideoCard",props:{stream:{}},setup(t){return(e,h)=>{const d=X,p=q;return n(),r("div",yt,[s("a",{href:("getYoutubeWatchUrl"in e?e.getYoutubeWatchUrl:o(N))(t.stream?.youtube_id||""),target:"_blank",class:"w-full h-200 relative mb-4 group overflow-hidden"},[f(d,{src:t.stream?.image||"",placeholder:"/images/placeholder.svg",class:"object-cover w-full h-full transition-transform duration-1000 group-hover:scale-110"},null,8,["src"]),s("div",$t,[s("div",Lt,[f(p,{class:"size-4 fill-white text-transparent absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2"})])])],8,St),s("a",{href:("getYoutubeWatchUrl"in e?e.getYoutubeWatchUrl:o(N))(t.stream?.youtube_id||""),target:"_blank",class:"text-white font-display text-lg mb-8 hover:text-xt-red"},_(t.stream?.name),9,Tt)])}}}),Rt=z({uuid:l().uuid(),start_timestamp:U().nullable(),start_date_time_iso:l().nullable(),start_date_time_user_input:l().nullable(),end_date_time_iso:l().nullable(),name:l().nullable(),time_zone:l().nullable(),description:l().nullable(),youtube_id:l().nullable(),location:l().nullable(),info_button_url:l().nullable(),info_button_text:l().nullable(),regional_times:l().nullable(),position:U().nullable(),is_published:L().nullable(),catch_replay:L().nullable(),image:l().nullable(),is_upcoming:L().nullable(),event:z({timezone:l().nullable()}).optional().nullable()}),zt=V(Rt),Ut=async()=>{const t=await W("/open/livestreams");return zt.parse(t?.data)},Ct=B("livestream",()=>{const t=E([]),e=async()=>{if(!t.value.length)return await h()},h=async()=>{t.value=await Ut()},d=i(()=>t.value.every(a=>!a.is_upcoming)?null:t.value.filter(a=>a.is_upcoming).toSorted((a,u)=>(a.start_timestamp||0)-(u.start_timestamp||0))[0]),p=i(()=>t.value.length?t.value.toSorted((a,u)=>(u.start_timestamp||0)-(a.start_timestamp||0))[0]:null),v=i(()=>{const a=t.value.filter(u=>u.is_upcoming).toSorted((u,m)=>(u.start_timestamp||0)-(m.start_timestamp||0));return a.length<2?[]:a.slice(1)}),x=i(()=>t.value.filter(a=>a.catch_replay&&!a.is_upcoming));return{fetchLivestreams:e,all:t,nextUp:d,futureStreams:v,catchReplays:x,mostRecent:p}}),Dt={class:"bg-neutral-800 h-full flex-1"},Nt={key:1,class:"mb-20"},jt={class:"flex gap-4 overflow-x-auto"},Et={class:"min-w-300"},Ft={key:2,class:"mb-8"},Mt={class:"flex gap-4 overflow-x-auto"},Vt={class:"min-w-300"},Ht=k({__name:"watch-live",async setup(t){let e,h;P({title:()=>"Watch Live | XTERRA",description:()=>"Watch upcoming and past XTERRA off-road race live streams. Catch the action live or replay epic XTERRA races and highlightsâall in one place.",ogImage:()=>"https://xt-assets-media.fra1.cdn.digitaloceanspaces.com/70237/conversions/VBYqe96uMe7maj8D1Mu85NtnPWFBO3FS5v49reUS-web.jpg"});const d=Ct(),p=i(()=>d.nextUp),v=i(()=>d?.futureStreams),x=i(()=>d?.catchReplays),a=i(()=>d.mostRecent),u=i(()=>p.value?p.value:a.value);try{[e,h]=I(async()=>G("livestream",async()=>{await d.fetchLivestreams()},"$2hhqAKeJb7")),await e,h()}catch(m){if(A(m))throw Y(m)}return(m,c)=>
1{const S=wt,g=F,w=kt,R=H;return n(),r("div",Dt,[f(R,{class:"pt-20 pb-12"},{default:y(()=>[c[2]||(c[2]=s("p",{class:"bg-white px-4 py-2 font-display font-extrabold text-2xl w-fit rounded-lg mb-16"}," XTERRA Live ",-1)),s("div",null,[o(u)?(n(),Z(S,{key:0,title:o(p)?"Next Up":"Most Recent",stream:o(u)},null,8,["title","stream"])):b("",!0),o(v)?.length?(n(),r("div",Nt,[f(g,{class:"mb-8"},{default:y(()=>[...c[0]||(c[0]=[T("Future Streams",-1)])]),_:1}),s("div",jt,[(n(!0),r(C,null,D(o(v),$=>(n(),r("div",Et,[f(w,{stream:$},null,8,["stream"])]))),256))])])):b("",!0),o(x)?.length?(n(),r("div",Ft,[f(g,{class:"mb-8"},{default:y(()=>[...c[1]||(c[1]=[T("Catch the Replay",-1)])]),_:1}),s("div",Mt,[(n(!0),r(C,null,D(o(x),$=>(n(),r("div",Vt,[f(w,{stream:$},null,8,["stream"])]))),256))])])):b("",!0)])]),_:1})])}}});export{Ht as default};
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.