import{C as Me,T as qe,i as C,a0 as Ue,M as Ne,L as Be,p as Ve,ai as Ze,X as Te,Z as j,R as h}from"./BrXQVriU.js";import{f as We,D as Xe,g as k,c as d,j as n,i as Ke,h as $e,v as Pe,o as l,a as L,d as i,u as c,b as r,w as u,x as E,q as v,t as m,F as S,k as Qe}from"./Cd1nqtmb.js";const Ye={key:0,"data-test-id":"s-next-match__root",class:"s-next-match bg-theme-background-light border-theme-border-light flex flex-col items-center justify-center gap-4 rounded-[10px] border p-4 lg:p-8"},Ae={key:0,class:"s-next-match__team-logo relative h-[60px] w-[60px]"},Ge={key:1,"data-test-id":"s-next-match__opponent-title",class:"text-theme-safe s-text-paragraph-bold block"},Je={class:"s-next-match__result-and-datetime flex flex-col items-center justify-center"},et={key:0,"data-test-id":"s-next-match__result",class:"s-next-match__result s-text-paragraph-bold text-primary"},tt={class:"s-next-match__datetime flex flex-row items-center justify-center gap-1 sm:flex-col sm:gap-0"},at={"data-test-id":"s-next-match__date",class:"text-theme-safe s-text-paragraph-bold"},st={class:"s-text-paragraph text-theme-muted"},lt={key:0,"data-test-id":"s-next-match__time",class:"s-text-paragraph-small text-theme-muted flex items-center whitespace-nowrap"},it={class:"s-next-match__buttons grid w-full auto-rows-fr grid-cols-2 gap-[4px]"},ot={"data-test-id":"s-next-match__button-icon-box-score-text",class:"capitalize"},nt={"data-test-id":"s-next-match__button-icon-recap-text",class:"capitalize"},mt={"data-test-id":"s-next-match__button-icon-gamefiles-title",class:"max-w-[110px] truncate capitalize sm:max-w-none md:max-w-[110px]"},rt={"data-test-id":"s-next-match__button-icon-video-text",class:"capitalize"},ct={"data-test-id":"s-next-match__button-icon-audio-text",class:"capitalize"},ut={"data-test-id":"s-next-match__button-icon-preview-text",class:"capitalize"},dt={"data-test-id":"s-next-match__button-icon-stats-text",class:"capitalize"},pt={key:2,"data-test-id":"s-next-match__call-to-action-result",class:"s-next-match__call-to-action text-theme-link"},gt={key:3,class:"s-next-match__countdown-timer border-theme-border-light divide-theme-border-light grid h-[100px] w-full grid-cols-4 divide-x rounded-[10px] border"},ht={class:"s-next-match__countdown-timer__days flex h-full flex-col items-center justify-center space-y-1"},xt={"data-test-id":"s-next-match__countdown-timer-days-value",class:"s-text-title-large text-theme-brand-light"},_t={class:"s-next-match__countdown-timer__hours flex h-full flex-col items-center justify-center space-y-1"},ft={"data-test-id":"s-next-match__countdown-timer-hours-value",class:"s-text-title-large text-theme-brand-light"},kt={class:"s-next-match__countdown-timer__minutes flex h-full flex-col items-center justify-center space-y-1"},yt={"data-test-id":"s-next-match__countdown-timer-minutes-value",class:"s-text-title-large text-theme-brand-light"},bt={class:"s-next-match__countdown-timer__seconds flex h-full flex-col items-center justify-center space-y-1"},vt={"data-test-id":"s-next-match__countdown-timer-seconds-value",class:"s-text-title-large text-theme-brand-light"},wt={key:4,"data-test-id":"s-next-match__call-to-action-pregame",class:"s-next-match__call-to-action text-theme-link"},Et=We({__name:"SNextMatch",props:{game:Object,sport:Object,showCountdown:{type:Boolean,default:!0},linkEl:{type:String,default:"s-nav-link"},displayOpponentHistory:{type:Boolean}},setup(e){const t=e,R=Xe("siteBucket"),He=k(()=>{var o,a,p,g;return!!((o=t==null?void 0:t.game)!=null&&o.opponent&&((a=t.game.opponent)!=null&&a.id)&&((p=t.game.opponent)!=null&&p.image)&&((g=t.game.opponent.image)!=null&&g.fullpath))}),y=k(()=>{var o;return t.game&&((o=t.game)!=null&&o.result)?"result":"pregame"}),N=k(()=>{var o,a;return t!=null&&t.game&&(t!=null&&t.sport)&&((a=(o=t.game)==null?void 0:o.opponent)!=null&&a.id)?`/sports/${t.sport.shortname}/opponent-history/${Me(t.game.opponent.title)}/${t.game.opponent.id}`:""}),f=k(()=>{var o,a;return t!=null&&t.game&&(t!=null&&t.sport)&&((a=(o=t.game)==null?void 0:o.opponent)!=null&&a.id)?`/sports/${t.sport.globalSportNameSlug}/schedule`:""}),Oe=k(()=>{var o,a,p,g,x,_;return(a=(o=t.game)==null?void 0:o.ticketLink)!=null&&a.url?(p=t.game.ticketLink)==null?void 0:p.url:((_=(x=(g=t.game)==null?void 0:g.media)==null?void 0:x.tickets)==null?void 0:_.url)??""}),De=k(()=>{var o,a,p,g,x,_;return(a=(o=t.game)==null?void 0:o.ticketLink)!=null&&a.label?(p=t.game.ticketLink)==null?void 0:p.label:((_=(x=(g=t.game)==null?void 0:g.media)==null?void 0:x.tickets)==null?void 0:_.title)??""}),{timeNow:B,gameDay:V,countdown:w,setTimeNowInterval:Fe,clearTimeNowInterval:T,setCountdown:Ie}=qe();return Ke(()=>{$e(()=>t.game,o=>{B.value=C.utc(),o!=null&&o.dateUtc?V.value=C.fromISO(o==null?void 0:o.dateUtc):V.value=C.utc(),T(),Fe()},{immediate:!0}),$e(B,o=>{o&&Ie()})}),Pe(()=>{T()}),(o,a)=>{var p,g,x,_,,ドルH,O,D,F,I,M,q,U,Z,W,X,K,P,Q,Y,A,G,J,ee,te,ae,se,le,ie,oe,ne,me,re,ce,ue,de,pe,ge,he,xe,_e,fe,ke,ye,be,ve,we,ze,Le,Ee,Se,Ce,je;return e.game?(l(),d("div",Ye,[L(c(Ue),{class:"s-next-match__heading mb-[8px] w-full border-b",size:"regular",theme:"light-theme",text:"Next Event",line:"under",tag:"h3",sponsorLogoConfig:{show:!1}}),He.value?(l(),d("div",Ae,[(p=e.game.opponent)!=null&&p.website?(l(),r(E(e.linkEl),{key:0,"data-test-id":"s-next-match__opponent-logo-link",href:e.game.opponent.website,target:"_blank",title:e.game.opponent.title,"aria-label":e.game.opponent.title+" Website"},{default:u(()=>{var s,z,b,Re;return[(l(),r(Ne,{key:c(Ve)(e.game.opponent.image.fullpath),alt:((s=e.game.opponent.image)==null?void 0:s.alt)||"Logo",class:"h-[60px] w-[60px] object-contain","aria-hidden":"true",images:[{breakpoint:0,image:(Re=(b=(z=e.game)==null?void 0:z.opponent)==null?void 0:b.image)!=null&&Re.fullpath?c(Be)({url:e.game.opponent.image.fullpath,bucket:c(R)}):"",width:84,height:84,params:{quality:100}}]},null,8,["alt","images"]))]}),_:1},8,["href","title","aria-label"])):(l(),r(Ne,{key:c(Ve)(e.game.opponent.image.fullpath),alt:((g=e.game.opponent.image)==null?void 0:g.alt)||"Logo",class:"h-[60px] w-[60px] object-contain","aria-hidden":"true",images:[{breakpoint:0,image:($=(_=(x=e.game)==null?void 0:x.opponent)==null?void 0:_.image)!=null&&$.fullpath?c(Be)({url:e.game.opponent.image.fullpath,bucket:c(R)}):"",width:84,height:84,params:{quality:100}}]},null,8,["alt","images"])),(H=e.game)!=null&&H.displayVsatIndicator&&["h","a","m"].includes((D=(O=e.game)==null?void 0:O.locationIndicator)==null?void 0:D.toLowerCase())?(l(),r(c(Ze),{key:2,type:((F=e.game)==null?void 0:F.atVs)==="vs"?"priority":"alternate",size:"x-small",theme:"light-theme",class:"s-next-match__stamp absolute bottom-0 right-0"},{default:u(()=>{var s;return[v(m((s=e.game)==null?void 0:s.atVs),1)]}),_:1},8,["type"])):n("",!0)])):n("",!0),(M=(I=e.game)==null?void 0:I.opponent)!=null&&M.title?(l(),d(S,{key:1},[(U=(q=e.game)==null?void 0:q.opponent)!=null&&U.website?(l(),r(E(e.linkEl),{key:0,"data-test-id":"s-next-match__opponent-title-link",class:"text-theme-safe s-text-paragraph-bold block",href:e.game.opponent.website},{default:u(()=>[v(m(e.game.opponent.title),1)]),_:1},8,["href"])):(l(),d("p",Ge,m(e.game.opponent.title),1))],64)):n("",!0),i("div",Je,[y.value==="result"&&((W=(Z=e.game)==null?void 0:Z.result)!=null&&W.status)&&((K=(X=e.game)==null?void 0:X.result)==null?void 0:K.status)!=="N"&&((Q=(P=e.game)==null?void 0:P.result)!=null&&Q.teamScore)&&((A=(Y=e.game)==null?void 0:Y.result)!=null&&A.opponentScore)?(l(),d("div",et,m(e.game.result.status)+", "+m(e.game.result.teamScore)+"-"+m(e.game.result.opponentScore),1)):n("",!0),i("div",tt,[i("p",at,[v(m(c(Te)(e.game.date,"LLL d"))+" ",1),i("span",st,"("+m(c(Te)(e.game.date,"ccc"))+")",1)]),a[0]||(a[0]=i("span",{class:"bg-theme-muted mx-1 block h-[4px] w-[4px] rounded-full sm:hidden"},null,-1)),e.game.time?(l(),d("span",lt,[L(j,{name:"icon-time",class:"mr-[4.5px]",size:"x-small"}),v(" "+m(e.game.time),1)])):n("",!0)])]),i("div",it,[y.value==="result"?(l(),d(S,{key:0},[(ee=(J=(G=e.game)==null?void 0:G.result)==null?void 0:J.boxscore)!=null&&ee.url?(l(),r(h,{key:0,class:"s-next-match__buttons__button-icon-boxscore last:odd:col-span-2",tag:e.linkEl,href:e.game.result.boxscore.url,size:"small",theme:"light-theme",type:"priority",iconRight:"icon-boxscore"},{default:u(()=>{var s;return[i("span",ot,m(((s=e.game.result.boxscore)==null?void 0:s.title)||"Box Score"),1)]}),_:1},8,["tag","href"])):n("",!0),(se=(ae=(te=e.game)==null?void 0:te.result)==null?void 0:ae.recap)!=null&&se.url?(l(),r(h,{key:1,class:"s-next-match__buttons__button-icon-recap last:odd:col-span-2",tag:e.linkEl,href:e.game.result.recap.url,size:"small",theme:"light-theme",type:"priority",iconRight:"icon-recap"},{default:u(()=>{var s;return[i("span",nt,m(((s=e.game.result.recap)==null?void 0:s.title)||"Recap"),1)]}),_:1},8,["tag","href"])):n("",!0),(ie=(le=e.game)==null?void 0:le.media)!=null&&ie.gamefiles&&((me=(ne=(oe=e.game)==null?void 0:oe.media)==null?void 0:ne.gamefiles)!=null&&me.length)&&e.game.media.gamefiles.length>0?(l(!0),d(S,{key:2},Qe(e.game.media.gamefiles,(s,z)=>{var b;return l(),d(S,{key:z},[s!=null&&s.gamefileLink?(l(),r(h,{key:0,class:"s-next-match__buttons__button-icon-gamefiles last:odd:col-span-2",tag:e.linkEl,href:s==null?void 0:s.gamefileLink,size:"small",theme:"light-theme",type:"priority",iconRight:(b=s.gamefileLink)!=null&&b.includes("galleries")?"icon-photo":""},{default:u(()=>[i("span",mt,m(s.gamefileTitle),1)]),_:2},1032,["tag","href","iconRight"])):n("",!0)],64)}),128)):n("",!0)],64)):n("",!0),(ue=(ce=(re=e.game)==null?void 0:re.media)==null?void 0:ce.video)!=null&&ue.url?(l(),r(h,{key:1,class:"s-next-match__buttons__button-icon-video last:odd:col-span-2",tag:e.linkEl,href:e.game.media.video.url,size:"small",theme:"light-theme",type:"priority",iconRight:"icon-video"},{default:u(()=>{var s;return[i("span",rt,m(((s=e.game.media.video)==null?void 0:s.title)||"Watch"),1)]}),_:1},8,["tag","href"])):n("",!0),(ge=(pe=(de=e.game)==null?void 0:de.media)==null?void 0:pe.audio)!=null&&ge.url?(l(),r(h,{key:2,class:"s-next-match__buttons__button-icon-audio last:odd:col-span-2",tag:e.linkEl,href:e.game.media.audio.url,size:"small",theme:"light-theme",type:"priority",iconRight:"icon-audio"},{default:u(()=>{var s;return[i("span",ct,m(((s=e.game.media.audio)==null?void 0:s.title)||"Listen"),1)]}),_:1},8,["tag","href"])):n("",!0),(_e=(xe=(he=e.game)==null?void 0:he.media)==null?void 0:xe.preview)!=null&&_e.url?(l(),r(h,{key:3,class:"s-next-match__buttons__button-icon-preview last:odd:col-span-2",tag:e.linkEl,href:e.game.media.preview.url,size:"small",theme:"light-theme",type:"priority"},{default:u(()=>{var s;return[i("span",ut,m(((s=e.game.media.preview)==null?void 0:s.title)||"Preview"),1)]}),_:1},8,["tag","href"])):n("",!0),(ye=(ke=(fe=e.game)==null?void 0:fe.media)==null?void 0:ke.stats)!=null&&ye.url?(l(),r(h,{key:4,class:"s-next-match__buttons__button-icon-stats last:odd:col-span-2",tag:e.linkEl,href:e.game.media.stats.url,size:"small",theme:"light-theme",type:"priority",iconRight:"icon-stats"},{default:u(()=>{var s;return[i("span",dt,m(((s=e.game.media.stats)==null?void 0:s.title)||"Stats"),1)]}),_:1},8,["tag","href"])):n("",!0),(ve=(be=e.game)==null?void 0:be.ticketLink)!=null&&ve.url||(Le=(ze=(we=e.game)==null?void 0:we.media)==null?void 0:ze.tickets)!=null&&Le.url?(l(),r(h,{key:5,class:"s-next-match__buttons__button-icon-tickets last:odd:col-span-2",tag:e.linkEl,href:Oe.value,size:"small",theme:"light-theme",type:"priority",iconRight:"icon-tickets",title:De.value},{default:u(()=>a[1]||(a[1]=[i("span",{"data-test-id":"s-next-match__button-icon-tickets-text",class:"capitalize"}," Tickets ",-1)])),_:1},8,["tag","href","title"])):n("",!0),(Se=(Ee=e.game)==null?void 0:Ee.opponent)!=null&&Se.id&&N.value&&e.displayOpponentHistory?(l(),r(h,{key:6,class:"s-next-match__buttons__button-icon-opponent-history-path last:odd:col-span-2",tag:e.linkEl,href:N.value,size:"small",theme:"light-theme",type:"priority",iconRight:"icon-timeline"},{default:u(()=>a[2]||(a[2]=[v(" History ")])),_:1},8,["tag","href"])):n("",!0)]),f.value&&((Ce=f.value)!=null&&Ce.length)&&(e.showCountdown&&y.value==="result"||!e.showCountdown)?(l(),d("div",pt,[(l(),r(E(e.linkEl),{href:f.value,class:"flex items-center","data-test-id":"s-next-match__call-to-action-result-link"},{default:u(()=>[a[3]||(a[3]=i("span",{class:"s-text-regular-bold"},"Full Schedule",-1)),L(j,{name:"icon-arrow-right",class:"s-text-regular-bold ml-[11px]",size:"small"})]),_:1},8,["href"]))])):n("",!0),e.showCountdown&&y.value==="pregame"?(l(),d("div",gt,[i("div",ht,[i("span",xt,m(c(w).days),1),a[4]||(a[4]=i("span",{class:"s-text-regular text-theme-muted-light"},"Days",-1))]),i("div",_t,[i("span",ft,m(c(w).hours),1),a[5]||(a[5]=i("span",{class:"s-text-regular text-theme-muted-light"},"Hours",-1))]),i("div",kt,[i("span",yt,m(c(w).minutes),1),a[6]||(a[6]=i("span",{class:"s-text-regular text-theme-muted-light"},"Minutes",-1))]),i("div",bt,[i("span",vt,m(c(w).seconds),1),a[7]||(a[7]=i("span",{class:"s-text-regular text-theme-muted-light"},"Seconds",-1))])])):n("",!0),f.value&&((je=f.value)!=null&&je.length)&&e.showCountdown&&y.value==="pregame"?(l(),d("div",wt,[(l(),r(E(e.linkEl),{href:f.value,class:"flex items-center","data-test-id":"s-next-match__call-to-action-pregame-link"},{default:u(()=>[a[8]||(a[8]=i("span",{class:"s-text-regular-bold"},"Full Schedule",-1)),L(j,{name:"icon-arrow-right",class:"s-text-regular-bold ml-[11px]",size:"small"})]),_:1},8,["href"]))])):n("",!0)])):n("",!0)}}});export{Et as default};