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