import{S as Me,i as je,s as Ce,e as E,t as $,k as j,c as D,a as w,h as A,m as C,d,b as m,g as B,J as c,j as G,E as le,q as V,w as te,x as ie,y as re,o as S,B as ae,n as P,p as Q,K as ne,N as Ne,L as he,l as _e}from"./index-9987666b.js";import{A as Oe}from"./Avatar-646b3763.js";import{S as qe,L as Ze}from"./Link-57e97f60.js";import{E as ye}from"./EventTypeLabel-ca431df3.js";import{f as se}from"./utils-93c6c1d6.js";import{b as Fe,c as fe}from"./stores-af76d038.js";function Je(n){let e,a=se(n[1],"yyyy-MM-dd")==="2022-06-04"?"SO":"NE",t,l,r=se(n[1],"HH:mm")+"",i,s,f=se(n[2],"HH:mm")+"",o,g,h=(n[0]?n[0].name:"n/a")+"",u,_;return{c(){e=E("div"),t=$(a),l=j(),i=$(r),s=$("-"),o=$(f),g=$(" ("),u=$(h),_=$(")"),this.h()},l(v){e=D(v,"DIV",{class:!0});var k=w(e);t=A(k,a),l=C(k),i=A(k,r),s=A(k,"-"),o=A(k,f),g=A(k," ("),u=A(k,h),_=A(k,")"),k.forEach(d),this.h()},h(){m(e,"class","font-semibold")},m(v,k){B(v,e,k),c(e,t),c(e,l),c(e,i),c(e,s),c(e,o),c(e,g),c(e,u),c(e,_)},p(v,[k]){k&1&&h!==(h=(v[0]?v[0].name:"n/a")+"")&&G(u,h)},i:le,o:le,d(v){v&&d(e)}}}function Ke(n,e,a){let t,{item:l}=e,{e:r}=e,{bundle:i}=e;const s=new Date(l.period.start),f=new Date(l.period.end);return n.$$set=o=>{"item"in o&&a(3,l=o.item),"e"in o&&a(4,r=o.e),"bundle"in o&&a(5,i=o.bundle)},n.$$.update=()=>{n.$$.dirty&40&&a(0,t=i?i.spec.stages.find(o=>o.id===l.stage):null)},[t,s,f,l,r,i]}class Re extends Me{constructor(e){super();je(this,e,Ke,Je,Ce,{item:3,e:4,bundle:5})}}function Ge(n,e){if(!e)return 0;if(n.duration)return n.duration;const a=e.spec.events.filter(t=>t.parent===n.id);if(a.length>0){let t=a.reduce((l,r)=>l+(r.duration?r.duration:0),0);return t+=5*(a.length-1),t}}function ve(n,e){e.update(a=>{const t=a.favoriteEvents;let l=null;return t.includes(n)?l=Object.assign({},a,{favoriteEvents:t.filter(r=>r!==n)}):(t.push(n),l=Object.assign(a,{favoriteEvents:t})),l})}function me(n,e,a){const t=n.slice();return t[13]=e[a],t}function pe(n,e,a){const t=n.slice();return t[16]=e[a],t}function ge(n,e,a){const t=n.slice();return t[19]=e[a],t}function ke(n,e,a){const t=n.slice();return t[16]=e[a],t}function be(n){let e,a,t=n[7](n[0].speakers),l=[];for(let i=0;iS(l[i],1,1,()=>{l[i]=null});return{c(){e=E("div");for(let i=0;iS(r[s],1,1,()=>{r[s]=null});return{c(){e=E("div"),a=E("div");for(let s=0;sS(l[i],1,1,()=>{l[i]=null});return{c(){for(let i=0;i{J[N]=null}),Q(),_=J[u],_?_.p(n,T):(_=J[u]=U[u](n),_.c()),V(_,1),_.m(h,null)),(!b||T&33&&k!==(k="border rounded py-1.5 px-2.5 text-sm transition-all "+(n[5].favoriteEvents.includes(n[13].id)?"bg-yellow-100":"bg-gray-100")))&&m(e,"class",k)},i(y){b||(V(_),b=!0)},o(y){S(_),b=!1},d(y){y&&d(e),J[u].d(),F=!1,K()}}}function Ue(n){let e,a,t,l,r,i,s,f=n[0].name+"",o,g,h,u,_,v,k,b,F,K,X,U,J,W,y=n[9](n[0]).length>0,T,N,Y,x,z=n[0].speakers&&n[0].speakers.length>0&&be(n);b=new ye({props:{event:n[0]}});let H=n[2]&&we(n),O=n[4]&&Ie(n),q=n[0].track&&Ve(n),Z=n[0].tags&&$e(n),L=n[0].description&&Se(n),M=y&&Te(n);return{c(){e=E("div"),a=E("div"),t=E("i"),r=j(),i=E("div"),s=E("a"),o=$(f),h=j(),z&&z.c(),u=j(),_=E("div"),v=E("div"),k=E("div"),te(b.$$.fragment),F=j(),H&&H.c(),K=j(),O&&O.c(),X=j(),q&&q.c(),U=j(),Z&&Z.c(),J=j(),L&&L.c(),W=j(),M&&M.c(),this.h()},l(p){e=D(p,"DIV",{class:!0});var I=w(e);a=D(I,"DIV",{class:!0});var ee=w(a);t=D(ee,"I",{class:!0}),w(t).forEach(d),ee.forEach(d),r=C(I),i=D(I,"DIV",{class:!0});var oe=w(i);s=D(oe,"A",{href:!0});var ue=w(s);o=A(ue,f),ue.forEach(d),oe.forEach(d),h=C(I),z&&z.l(I),u=C(I),_=D(I,"DIV",{class:!0});var ce=w(_);v=D(ce,"DIV",{class:!0});var R=w(v);k=D(R,"DIV",{class:!0});var de=w(k);ie(b.$$.fragment,de),de.forEach(d),F=C(R),H&&H.l(R),K=C(R),O&&O.l(R),X=C(R),q&&q.l(R),U=C(R),Z&&Z.l(R),R.forEach(d),ce.forEach(d),J=C(I),L&&L.l(I),W=C(I),M&&M.l(I),I.forEach(d),this.h()},h(){m(t,"class",l="fa-star "+(n[5].favoriteEvents.includes(n[0].id)?"fa-solid":"fa-regular")+" cursor-pointer"),m(a,"class","float-right"),m(s,"href",g="/udalosti?id="+n[0].id),m(i,"class","text-lg font-semibold"),m(k,"class","opacity-80"),m(v,"class","text-sm flex flex-wrap gap-3 flex-1"),m(_,"class",""),m(e,"class",T="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(n[5].favoriteEvents.includes(n[0].id)?"bg-yellow-100":""))},m(p,I){B(p,e,I),c(e,a),c(a,t),c(e,r),c(e,i),c(i,s),c(s,o),c(e,h),z&&z.m(e,null),c(e,u),c(e,_),c(_,v),c(v,k),re(b,k,null),c(v,F),H&&H.m(v,null),c(v,K),O&&O.m(v,null),c(v,X),q&&q.m(v,null),c(v,U),Z&&Z.m(v,null),c(e,J),L&&L.m(e,null),c(e,W),M&&M.m(e,null),N=!0,Y||(x=Ne(t,"click",n[11]),Y=!0)},p(p,[I]){(!N||I&33&&l!==(l="fa-star "+(p[5].favoriteEvents.includes(p[0].id)?"fa-solid":"fa-regular")+" cursor-pointer"))&&m(t,"class",l),(!N||I&1)&&f!==(f=p[0].name+"")&&G(o,f),(!N||I&1&&g!==(g="/udalosti?id="+p[0].id))&&m(s,"href",g),p[0].speakers&&p[0].speakers.length>0?z?(z.p(p,I),I&1&&V(z,1)):(z=be(p),z.c(),V(z,1),z.m(e,u)):z&&(P(),S(z,1,1,()=>{z=null}),Q());const ee={};I&1&&(ee.event=p[0]),b.$set(ee),p[2]?H?(H.p(p,I),I&4&&V(H,1)):(H=we(p),H.c(),V(H,1),H.m(v,K)):H&&(P(),S(H,1,1,()=>{H=null}),Q()),p[4]?O?O.p(p,I):(O=Ie(p),O.c(),O.m(v,X)):O&&(O.d(1),O=null),p[0].track?q?q.p(p,I):(q=Ve(p),q.c(),q.m(v,U)):q&&(q.d(1),q=null),p[0].tags?Z?Z.p(p,I):(Z=$e(p),Z.c(),Z.m(v,null)):Z&&(Z.d(1),Z=null),p[0].description?L?(L.p(p,I),I&1&&V(L,1)):(L=Se(p),L.c(),V(L,1),L.m(e,W)):L&&(P(),S(L,1,1,()=>{L=null}),Q()),I&1&&(y=p[9](p[0]).length>0),y?M?(M.p(p,I),I&1&&V(M,1)):(M=Te(p),M.c(),V(M,1),M.m(e,null)):M&&(P(),S(M,1,1,()=>{M=null}),Q()),(!N||I&33&&T!==(T="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(p[5].favoriteEvents.includes(p[0].id)?"bg-yellow-100":"")))&&m(e,"class",T)},i(p){N||(V(z),V(b.$$.fragment,p),V(H),V(L),V(M),N=!0)},o(p){S(z),S(b.$$.fragment,p),S(H),S(L),S(M),N=!1},d(p){p&&d(e),z&&z.d(),ae(b),H&&H.d(),O&&O.d(),q&&q.d(),Z&&Z.d(),L&&L.d(),M&&M.d(),Y=!1,x()}}}function We(n){if(!n.description)return{};const e=n.description.split(` `),a=e.length>1;return{md:e[0],stripped:a}}function Xe(n,e,a){let t,l,r,i,s,f;he(n,Fe,b=>a(1,s=b)),he(n,fe,b=>a(5,f=b));let{event:o}=e;const g={link:Ze};function h(b){if(!!b)return b.map(F=>s.spec.speakers.find(K=>K.id===F))}function u(b){const F=s.spec.tracks.find(K=>K.id===b);return F.shortname||F.name}function _(b){return s.spec.events.filter(F=>F.parent===b.id)}const v=()=>ve(t.id,fe),k=b=>ve(b.id,fe);return n.$$set=b=>{"event"in b&&a(10,o=b.event)},n.$$.update=()=>{n.$$.dirty&1024&&a(0,t=o),n.$$.dirty&3&&a(4,l=Ge(t,s)),n.$$.dirty&1&&a(3,r=We(t)),n.$$.dirty&3&&a(2,i=s?s.spec.schedule.find(b=>b.event===t.id):null)},[t,s,i,r,l,f,g,h,u,_,o,v,k]}class rl extends Me{constructor(e){super();je(this,e,Xe,Ue,Ce,{event:10})}}export{rl as E,Re as a,ve as b,Ge as c};