import{S as me,i as be,s as ke,e as g,k as $,t as C,c as m,a as b,d,m as z,h as F,b as _,g as T,F as u,j as Ee,E as S,q as B,w as U,x as X,y as Y,o as O,B as Z,n as x,p as ee,G as K,J as ye,H as ie,l as ne}from"./index-6191a390.js";import{A as De}from"./Avatar-53833777.js";import{b as Ie,a as Q}from"./stores-9e69a8a9.js";function Ve(r,e){if(!e)return 0;if(r.duration)return r.duration;const s=e.spec.events.filter(l=>l.parent===r.id);if(s.length>0){let l=s.reduce((t,i)=>t+(i.duration?i.duration:0),0);return l+=5*(s.length-1),l}}function oe(r,e){e.update(s=>{const l=s.favoriteEvents;let t=null;return l.includes(r)?t=Object.assign({},s,{favoriteEvents:l.filter(i=>i!==r)}):(l.push(r),t=Object.assign(s,{favoriteEvents:l})),t})}function we(r){let e,s,l,t,i,a=r[1].title+"",n,o,c;return{c(){e=g("div"),s=g("div"),t=$(),i=g("div"),n=C(a),this.h()},l(v){e=m(v,"DIV",{class:!0});var f=b(e);s=m(f,"DIV",{class:!0}),b(s).forEach(d),t=z(f),i=m(f,"DIV",{class:!0});var p=b(i);n=F(p,a),p.forEach(d),f.forEach(d),this.h()},h(){_(s,"class",l="w-1 rounded-l-sm "+r[1].style),_(i,"class",o=(r[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase"),_(e,"class",c="flex "+(r[0]==="big"?"h-6 text-sm":"h-5 text-xs"))},m(v,f){T(v,e,f),u(e,s),u(e,t),u(e,i),u(i,n)},p(v,[f]){f&2&&l!==(l="w-1 rounded-l-sm "+v[1].style)&&_(s,"class",l),f&2&&a!==(a=v[1].title+"")&&Ee(n,a),f&1&&o!==(o=(v[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase")&&_(i,"class",o),f&1&&c!==(c="flex "+(v[0]==="big"?"h-6 text-sm":"h-5 text-xs"))&&_(e,"class",c)},i:S,o:S,d(v){v&&d(e)}}}function Ae(r,e,s){let l,{event:t={}}=e,{size:i=null}=e;const a={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 r.$$set=n=>{"event"in n&&s(2,t=n.event),"size"in n&&s(0,i=n.size)},r.$$.update=()=>{r.$$.dirty&4&&s(1,l=a[t.type])},[i,l,t]}class $e extends me{constructor(e){super();be(this,e,Ae,we,ke,{event:2,size:0})}}function ce(r,e,s){const l=r.slice();return l[10]=e[s],l}function fe(r,e,s){const l=r.slice();return l[13]=e[s],l}function ue(r,e,s){const l=r.slice();return l[16]=e[s],l}function de(r,e,s){const l=r.slice();return l[13]=e[s],l}function ze(r){let e,s,l=r[3](r[2].speakers),t=[];for(let a=0;aO(t[a],1,1,()=>{t[a]=null});return{c(){e=g("div");for(let a=0;aO(i[n],1,1,()=>{i[n]=null});return{c(){e=g("div"),s=g("div");for(let n=0;nO(t[a],1,1,()=>{t[a]=null});return{c(){for(let a=0;a0,H,J,w,A,V=r[2].speakers&&r[2].speakers.length>0&&ze(r);I=new $e({props:{event:r[2]}});let D=r[0]&&ve(r),j=r[2].track&&Be(r),P=r[2].tags&&Te(r),q=W&&je(r);return{c(){e=g("div"),s=g("div"),l=g("i"),i=$(),a=g("div"),n=g("a"),c=C(o),v=$(),V&&V.c(),f=$(),p=g("div"),h=g("div"),E=g("div"),U(I.$$.fragment),L=$(),D&&D.c(),G=$(),j&&j.c(),N=$(),P&&P.c(),R=$(),q&&q.c(),this.h()},l(k){e=m(k,"DIV",{class:!0});var y=b(e);s=m(y,"DIV",{class:!0});var te=b(s);l=m(te,"I",{class:!0}),b(l).forEach(d),te.forEach(d),i=z(y),a=m(y,"DIV",{class:!0});var le=b(a);n=m(le,"A",{href:!0});var ae=b(n);c=F(ae,o),ae.forEach(d),le.forEach(d),v=z(y),V&&V.l(y),f=z(y),p=m(y,"DIV",{class:!0});var se=b(p);h=m(se,"DIV",{class:!0});var M=b(h);E=m(M,"DIV",{});var re=b(E);X(I.$$.fragment,re),re.forEach(d),L=z(M),D&&D.l(M),G=z(M),j&&j.l(M),N=z(M),P&&P.l(M),M.forEach(d),se.forEach(d),R=z(y),q&&q.l(y),y.forEach(d),this.h()},h(){_(l,"class",t="fa-star "+(r[1].favoriteEvents.includes(r[2].id)?"fa-solid":"fa-regular")+" cursor-pointer"),_(s,"class","float-right"),_(n,"href","/udalosti?id="+r[2].id),_(a,"class","text-lg font-semibold"),_(h,"class","text-sm flex flex-wrap gap-3 flex-1"),_(p,"class",""),_(e,"class",H="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(r[1].favoriteEvents.includes(r[2].id)?"bg-yellow-100":""))},m(k,y){T(k,e,y),u(e,s),u(s,l),u(e,i),u(e,a),u(a,n),u(n,c),u(e,v),V&&V.m(e,null),u(e,f),u(e,p),u(p,h),u(h,E),Y(I,E,null),u(h,L),D&&D.m(h,null),u(h,G),j&&j.m(h,null),u(h,N),P&&P.m(h,null),u(e,R),q&&q.m(e,null),J=!0,w||(A=ye(l,"click",r[8]),w=!0)},p(k,[y]){(!J||y&2&&t!==(t="fa-star "+(k[1].favoriteEvents.includes(k[2].id)?"fa-solid":"fa-regular")+" cursor-pointer"))&&_(l,"class",t),k[2].speakers&&k[2].speakers.length>0&&V.p(k,y),k[0]?D?D.p(k,y):(D=ve(k),D.c(),D.m(h,G)):D&&(D.d(1),D=null),k[2].track&&j.p(k,y),k[2].tags&&P.p(k,y),W&&q.p(k,y),(!J||y&2&&H!==(H="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(k[1].favoriteEvents.includes(k[2].id)?"bg-yellow-100":"")))&&_(e,"class",H)},i(k){J||(B(V),B(I.$$.fragment,k),B(q),J=!0)},o(k){O(V),O(I.$$.fragment,k),O(q),J=!1},d(k){k&&d(e),V&&V.d(),Z(I),D&&D.d(),j&&j.d(),P&&P.d(),q&&q.d(),w=!1,A()}}}function Fe(r,e,s){let l,t,i;ie(r,Ie,h=>s(7,t=h)),ie(r,Q,h=>s(1,i=h));let{event:a}=e;const n=a;function o(h){if(!!h)return h.map(E=>t.spec.speakers.find(I=>I.id===E))}function c(h){const E=t.spec.tracks.find(I=>I.id===h);return E.shortname||E.name}function v(h){return t.spec.events.filter(E=>E.parent===h.id)}const f=()=>oe(n.id,Q),p=h=>oe(h.id,Q);return r.$$set=h=>{"event"in h&&s(6,a=h.event)},r.$$.update=()=>{r.$$.dirty&128&&s(0,l=Ve(n,t))},[l,i,n,o,c,v,a,t,f,p]}class Ge extends me{constructor(e){super();be(this,e,Fe,Ce,ke,{event:6})}}export{$e as E,Ge as a,oe as b,Ve as c};