import{a as c,W as H,G as R,y as n,z as l,J as f,K as h,P as q,D as s,A as y,U as m,Q as b,I as d}from"./EchoChannel-CIXLa9Py.js";import{D as j}from"./dayjs.min-D0T-nrYO.js";import N from"./SessionGroup-DnF2JpZF.js";import z from"./LogoLoader-JEHqUbzn.js";import I from"./PresentationButton-dfYCi0Lp.js";import O from"./ContactPopUp-D8MASodV.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const P={key:0,class:"flex flex-col gap-8 relative w-full"},W={class:"w-full flex flex-col items-center bg-white sticky lg:relative top-0 left-0 pt-16 pb-8 lg:pt-8 lg:pb-4"},X={class:"scroll-shadow h-fit max-w-[calc(100vw-100px)] flex items-center gap-x-4 my-2 overflow-x-auto pb-2"},F=["id","href","onClick"],J={class:"uppercase font-semibold whitespace-nowrap"},K={class:"scroll-shadow w-[calc(100vw-100px)] lg:w-auto lg:max-w-[calc(100vw-100px)] mt-2 session-groups flex justify-start items-center gap-4 overflow-x-auto md:flex-wrap"},Q=["name"],Z={class:"session-list"},Y={class:"flex flex-col min-w-[100px] mb-2 md:mb-0"},ee={class:"w-full session-time justify-self-start flex md:flex-col font-bold mb-2 md:mb-4"},te={class:"session-content"},le={class:"w-full flex flex-col md:flex-row md:justify-between md:items-start pb-2"},se={class:"w-full"},ne=["onClick"],oe={class:"font-semibold text-lg"},re=["name"],ae={class:"w-full flex flex-wrap mt-2 md:mt-4"},ie={key:0,class:"mx-[2px]"},ue=["onClick","name"],ce=["innerHTML"],de={class:"session-account w-full flex flex-wrap mt-4 gap-4"},pe=["href"],fe=["src"],me={key:0,class:"session-presentation mt-4 flex flex-wrap gap-4"},ve={key:1,class:"w-full py-16 flex justify-center items-start"},Le={__name:"Schedule",props:{eventId:{type:Number,required:!0},eventType:{type:String,required:!1}},emits:["click-speaker"],setup(V,{emit:he}){const v=window.location.hash,S=v&&v.substring(1,v.length),k=v.includes("day")&&parseInt(v.replace(/\D*/,""),10),$=V,_=c(null),g=c([]),p=c({date:"",sessions:[],groups:[]}),L=c([]),i=c([]),w=c(!1),u=c(null);H(()=>{E()}),R(()=>{if(S){let t=document.getElementById(S);t&&t.scrollIntoView()}});function M(t){return u.value=t}function C(t){return u.value=null}function T(t){return j(t).format("dddd")}function U(t){return j(t).format("D")}function B(t){return j(t).format("h:mm A")}function D(){return i.value.length?L.value=p.value.sessions.filter(t=>i.value.indexOf(t.group.name)!==-1):L.value=p.value.sessions}function A(t){let o=i.value.indexOf(t);return o===-1?i.value.push(t):i.value.splice(o,1)}const E=async()=>{w.value=!0;const t=$.eventType==="club_meeting"?`/club/meeting/schedule/${$.eventId}`:`/event/schedule/${$.eventId}`;try{const e=await(await fetch(t,{headers:{"X-Requested-With":"XMLHttpRequest"}})).json();e.days&&(g.value=e.days,p.value=g.value[k&&k<=g.value.length?k-1:0],D()),w.value=!1}catch(o){console.error(o),w.value=!1}},G=t=>t.route?t.route:t.website?t.website:"#";return(t,o)=>(s(),n(f,null,[w.value?(s(),n("div",ve,[q(z)])):(s(),n("div",P,[l("div",W,[l("nav",X,[(s(!0),n(f,null,h(g.value,(e,r)=>(s(),n("a",{id:`day${r+1}`,href:`#day${r+1}`,class:y(["border-b-[1px] border-b-transparent",[e.date===p.value.date&&"text-qorus-purple !border-qorus-purple"]]),onClick:a=>{i.value=[],p.value=e,C(),D()}},[l("span",J,m(T(e.date))+" "+m(U(e.date)),1)],10,F))),256))]),l("ul",K,[(s(!0),n(f,null,h(p.value.groups,e=>(s(),n("li",null,[l("button",{name:`Show only ${e.name} sessions.`},[q(N,{group:e,"is-active":i.value.includes(e.name),onClick:r=>{C(),A(e.name),D()}},null,8,["group","is-active","onClick"])],8,Q)]))),256))])]),l("div",Z,[(s(!0),n(f,null,h(L.value,(e,r)=>(s(),n("div",{class:"session border-t-2 pt-4 pb-8 border-qorus-grey-light grid md:grid-cols-[1fr_5fr] gap-x-16",key:e},[l("div",Y,[l("div",ee,[l("span",null,m(B(e.startDate)),1),o[1]||(o[1]=l("span",{class:"md:hidden mx-2"},"-",-1)),l("span",null,m(B(e.endDate)),1)]),e.group.name?(s(),b(N,{key:0,group:e.group,"is-active":!0,small:!0},null,8,["group"])):d("",!0)]),l("div",te,[l("div",le,[l("div",se,[l("div",{class:y(["w-full flex justify-between items-center",{"cursor-pointer":r===u.value||e.description&&e.description.length>0}]),onClick:a=>r!==u.value&&e.description&&e.description.length>0?M(r):C()},[l("h4",oe,m(e.name),1),e.description&&e.description.length>0?(s(),n("button",{key:0,name:r===u.value?"Close the session description":"Expand the session description",class:"ml-4"},[(s(),n("svg",{class:y({"rotate-90":r===u.value}),width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o[2]||(o[2]=[l("path",{d:"M17.41 11.1228L8.06 2.5L7 3.55666L14.83 12L7 20.4433L8.06 21.5L17.41 12.8772L18.37 12L17.41 11.1228Z",fill:"black"},null,-1)]),2))],8,re)):d("",!0)],10,ne),l("ul",ae,[(s(!0),n(f,null,h(e.speakers,(a,x)=>(s(),n("li",{class:"font-light text-qorus-purple",key:x},[x>0?(s(),n("span",ie,"•")):d("",!0),l("button",{onClick:_e=>_.value=a.id,class:"hover:underline underline-offset-2",name:`See more about ${a.fullName}.`},m(a.fullName),9,ue)]))),128))]),l("div",{class:y(["session-description w-full mt-4 tinytext hidden text-qorus-grey-dark font-light",{"!block":r===u.value}]),innerHTML:e.description},null,10,ce),l("ul",de,[(s(!0),n(f,null,h(e.accounts,(a,x)=>(s(),n("li",{key:x},[l("a",{href:G(a)},[l("img",{class:"h-16 w-32 object-contain",src:a.logoUrl},null,8,fe)],8,pe)]))),128))])])]),e.presentation?(s(),n("div",me,[e.presentation.file?(s(),b(I,{key:0,url:e.presentation.file},null,8,["url"])):d("",!0),e.presentation.youtube?(s(),b(I,{key:1,url:`https://youtu.be/${e.presentation.youtube}`,label:"View replay"},null,8,["url"])):d("",!0),e.presentation.vimeo?(s(),b(I,{key:2,url:`https://vimeo.com/${e.presentation.vimeo}`,label:"View replay"},null,8,["url"])):d("",!0)])):d("",!0)])]))),128))])])),q(O,{popup:_.value!==null,"contact-id":_.value,onClose:o[0]||(o[0]=e=>_.value=null)},null,8,["popup","contact-id"])],64))}};export{Le as default};