utxo22-web/_app/chunks/Event-40b7b6ad.js

2 řádky
10 KiB
JavaScript

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