import{S as Ae,i as ze,s as Be,e as m,k as S,t as F,c as g,a as b,d,m as L,h as M,b as _,g as C,F as u,j as J,E as x,q as $,w as ee,x as te,y as le,o as B,B as ie,n as R,p as W,G as ae,J as Se,H as ce,l as ue}from"./index-f961f29d.js";import{A as Le,S as Te,L as je}from"./Avatar-ae188221.js";import{b as Oe,a as re}from"./stores-2b13be7a.js";function qe(s,e){if(!e)return 0;if(s.duration)return s.duration;const i=e.spec.events.filter(r=>r.parent===s.id);if(i.length>0){let r=i.reduce((t,n)=>t+(n.duration?n.duration:0),0);return r+=5*(i.length-1),r}}function de(s,e){e.update(i=>{const r=i.favoriteEvents;let t=null;return r.includes(s)?t=Object.assign({},i,{favoriteEvents:r.filter(n=>n!==s)}):(r.push(s),t=Object.assign(i,{favoriteEvents:r})),t})}function Ce(s){let e,i,r,t,n,l=s[1].title+"",a,o,f;return{c(){e=m("div"),i=m("div"),t=S(),n=m("div"),a=F(l),this.h()},l(v){e=g(v,"DIV",{class:!0});var c=b(e);i=g(c,"DIV",{class:!0}),b(i).forEach(d),t=L(c),n=g(c,"DIV",{class:!0});var h=b(n);a=M(h,l),h.forEach(d),c.forEach(d),this.h()},h(){_(i,"class",r="w-1 rounded-l-sm "+s[1].style),_(n,"class",o=(s[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase"),_(e,"class",f="flex "+(s[0]==="big"?"h-6 text-sm":"h-5 text-xs"))},m(v,c){C(v,e,c),u(e,i),u(e,t),u(e,n),u(n,a)},p(v,[c]){c&2&&r!==(r="w-1 rounded-l-sm "+v[1].style)&&_(i,"class",r),c&2&&l!==(l=v[1].title+"")&&J(a,l),c&1&&o!==(o=(v[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase")&&_(n,"class",o),c&1&&f!==(f="flex "+(v[0]==="big"?"h-6 text-sm":"h-5 text-xs"))&&_(e,"class",f)},i:x,o:x,d(v){v&&d(e)}}}function Fe(s,e,i){let r,{event:t={}}=e,{size:n=null}=e;const l={panel:{title:"Panelov\xE1 debata",style:"bg-custom-red text-white"},talk:{title:"P\u0159edn\xE1\u0161ka",style:"bg-custom-green text-white"},workshop:{title:"Workshop",style:"bg-custom-blue text-white"},other:{title:"Ostatn\xED",style:"bg-custom-yellow"},lightning:{title:"Lightning talk",style:"bg-pink-400"}};return s.$$set=a=>{"event"in a&&i(2,t=a.event),"size"in a&&i(0,n=a.size)},s.$$.update=()=>{s.$$.dirty&4&&i(1,r=l[t.type])},[n,r,t]}class Me extends Ae{constructor(e){super();ze(this,e,Fe,Ce,Be,{event:2,size:0})}}function he(s,e,i){const r=s.slice();return r[12]=e[i],r}function _e(s,e,i){const r=s.slice();return r[15]=e[i],r}function ve(s,e,i){const r=s.slice();return r[18]=e[i],r}function pe(s,e,i){const r=s.slice();return r[15]=e[i],r}function me(s){let e,i,r=s[5](s[0].speakers),t=[];for(let l=0;lB(t[l],1,1,()=>{t[l]=null});return{c(){e=m("div");for(let l=0;lB(n[a],1,1,()=>{n[a]=null});return{c(){e=m("div"),i=m("div");for(let a=0;aB(t[l],1,1,()=>{t[l]=null});return{c(){for(let l=0;l{P[Z]=null}),W(),k=P[h],k?k.p(s,V):(k=P[h]=Q[h](s),k.c()),$(k,1),k.m(c,null)),(!I||V&9&&w!==(w="border rounded py-1.5 px-2.5 text-sm transition-all "+(s[3].favoriteEvents.includes(s[12].id)?"bg-yellow-100":"bg-gray-100")))&&_(e,"class",w)},i(T){I||($(k),I=!0)},o(T){B(k),I=!1},d(T){T&&d(e),P[h].d(),G=!1,N()}}}function Ge(s){let e,i,r,t,n,l,a,o=s[0].name+"",f,v,c,h,k,D,w,I,G,N,K,Q,P,U=s[7](s[0]).length>0,T,V,Z,X,y=s[0].speakers&&s[0].speakers.length>0&&me(s);I=new Me({props:{event:s[0]}});let j=s[2]&&be(s),O=s[0].track&&ke(s),q=s[0].tags&&Ee(s),A=s[0].description&&we(s),z=U&&Ve(s);return{c(){e=m("div"),i=m("div"),r=m("i"),n=S(),l=m("div"),a=m("a"),f=F(o),c=S(),y&&y.c(),h=S(),k=m("div"),D=m("div"),w=m("div"),ee(I.$$.fragment),G=S(),j&&j.c(),N=S(),O&&O.c(),K=S(),q&&q.c(),Q=S(),A&&A.c(),P=S(),z&&z.c(),this.h()},l(p){e=g(p,"DIV",{class:!0});var E=b(e);i=g(E,"DIV",{class:!0});var Y=b(i);r=g(Y,"I",{class:!0}),b(r).forEach(d),Y.forEach(d),n=L(E),l=g(E,"DIV",{class:!0});var se=b(l);a=g(se,"A",{href:!0});var ne=b(a);f=M(ne,o),ne.forEach(d),se.forEach(d),c=L(E),y&&y.l(E),h=L(E),k=g(E,"DIV",{class:!0});var oe=b(k);D=g(oe,"DIV",{class:!0});var H=b(D);w=g(H,"DIV",{});var fe=b(w);te(I.$$.fragment,fe),fe.forEach(d),G=L(H),j&&j.l(H),N=L(H),O&&O.l(H),K=L(H),q&&q.l(H),H.forEach(d),oe.forEach(d),Q=L(E),A&&A.l(E),P=L(E),z&&z.l(E),E.forEach(d),this.h()},h(){_(r,"class",t="fa-star "+(s[3].favoriteEvents.includes(s[0].id)?"fa-solid":"fa-regular")+" cursor-pointer"),_(i,"class","float-right"),_(a,"href",v="/udalosti?id="+s[0].id),_(l,"class","text-lg font-semibold"),_(D,"class","text-sm flex flex-wrap gap-3 flex-1"),_(k,"class",""),_(e,"class",T="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(s[3].favoriteEvents.includes(s[0].id)?"bg-yellow-100":""))},m(p,E){C(p,e,E),u(e,i),u(i,r),u(e,n),u(e,l),u(l,a),u(a,f),u(e,c),y&&y.m(e,null),u(e,h),u(e,k),u(k,D),u(D,w),le(I,w,null),u(D,G),j&&j.m(D,null),u(D,N),O&&O.m(D,null),u(D,K),q&&q.m(D,null),u(e,Q),A&&A.m(e,null),u(e,P),z&&z.m(e,null),V=!0,Z||(X=Se(r,"click",s[10]),Z=!0)},p(p,[E]){(!V||E&9&&t!==(t="fa-star "+(p[3].favoriteEvents.includes(p[0].id)?"fa-solid":"fa-regular")+" cursor-pointer"))&&_(r,"class",t),(!V||E&1)&&o!==(o=p[0].name+"")&&J(f,o),(!V||E&1&&v!==(v="/udalosti?id="+p[0].id))&&_(a,"href",v),p[0].speakers&&p[0].speakers.length>0?y?(y.p(p,E),E&1&&$(y,1)):(y=me(p),y.c(),$(y,1),y.m(e,h)):y&&(R(),B(y,1,1,()=>{y=null}),W());const Y={};E&1&&(Y.event=p[0]),I.$set(Y),p[2]?j?j.p(p,E):(j=be(p),j.c(),j.m(D,N)):j&&(j.d(1),j=null),p[0].track?O?O.p(p,E):(O=ke(p),O.c(),O.m(D,K)):O&&(O.d(1),O=null),p[0].tags?q?q.p(p,E):(q=Ee(p),q.c(),q.m(D,null)):q&&(q.d(1),q=null),p[0].description?A?(A.p(p,E),E&1&&$(A,1)):(A=we(p),A.c(),$(A,1),A.m(e,P)):A&&(R(),B(A,1,1,()=>{A=null}),W()),E&1&&(U=p[7](p[0]).length>0),U?z?(z.p(p,E),E&1&&$(z,1)):(z=Ve(p),z.c(),$(z,1),z.m(e,null)):z&&(R(),B(z,1,1,()=>{z=null}),W()),(!V||E&9&&T!==(T="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(p[3].favoriteEvents.includes(p[0].id)?"bg-yellow-100":"")))&&_(e,"class",T)},i(p){V||($(y),$(I.$$.fragment,p),$(A),$(z),V=!0)},o(p){B(y),B(I.$$.fragment,p),B(A),B(z),V=!1},d(p){p&&d(e),y&&y.d(),ie(I),j&&j.d(),O&&O.d(),q&&q.d(),A&&A.d(),z&&z.d(),Z=!1,X()}}}function He(s){if(!s.description)return{};const e=s.description.split(` `),i=e.length>1;return{md:e[0],stripped:i}}function Je(s,e,i){let r,t,n,l,a;ce(s,Oe,w=>i(9,l=w)),ce(s,re,w=>i(3,a=w));let{event:o}=e;const f={link:je};function v(w){if(!!w)return w.map(I=>l.spec.speakers.find(G=>G.id===I))}function c(w){const I=l.spec.tracks.find(G=>G.id===w);return I.shortname||I.name}function h(w){return l.spec.events.filter(I=>I.parent===w.id)}const k=()=>de(r.id,re),D=w=>de(w.id,re);return s.$$set=w=>{"event"in w&&i(8,o=w.event)},s.$$.update=()=>{s.$$.dirty&256&&i(0,r=o),s.$$.dirty&513&&i(2,t=qe(r,l)),s.$$.dirty&1&&i(1,n=He(r))},[r,n,t,a,f,v,c,h,o,l,k,D]}class Ke extends Ae{constructor(e){super();ze(this,e,Je,Ge,Be,{event:8})}}export{Me as E,Ke as a,de as b,qe as c};