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