utxo22-web/_app/chunks/Event-39c02480.js

4 řádky
16 KiB
JavaScript
Surový Normální zobrazení Historie

import{S as ze,i as Le,s as je,e as b,t as A,k as j,c as E,a as D,h as H,m as C,d,b as p,g as M,J as c,j as K,E as te,q as V,w as ie,x as re,y as ae,o as B,B as ne,n as Q,p as U,K as se,O as Ce,L as he,l as _e}from"./index-695b5929.js";import{A as Ne}from"./Avatar-af5af55b.js";import{S as $e,L as qe}from"./Link-9c9f68ae.js";import{E as Ze}from"./EventTypeLabel-65f6f4ed.js";import{f as x}from"./utils-1595b72e.js";import{b as Fe,a as fe}from"./stores-f2dd11ab.js";function Je(n){let e,r=x(n[2],"yyyy-MM-dd")==="2022-06-04"?"SO":"NE",i,l,a=x(n[2],"HH:mm")+"",t,s,f=x(n[1],"HH:mm")+"",o,k,h=(n[3]?n[3].name:"n/a")+"",u,_,m=n[0].id+"",S;return{c(){e=b("div"),i=A(r),l=j(),t=A(a),s=A("-"),o=A(f),k=A(" ("),u=A(h),_=A(") @"),S=A(m),this.h()},l(w){e=E(w,"DIV",{class:!0});var v=D(e);i=H(v,r),l=C(v),t=H(v,a),s=H(v,"-"),o=H(v,f),k=H(v," ("),u=H(v,h),_=H(v,") @"),S=H(v,m),v.forEach(d),this.h()},h(){p(e,"class","font-semibold")},m(w,v){M(w,e,v),c(e,i),c(e,l),c(e,t),c(e,s),c(e,o),c(e,k),c(e,u),c(e,_),c(e,S)},p(w,[v]){v&4&&r!==(r=x(w[2],"yyyy-MM-dd")==="2022-06-04"?"SO":"NE")&&K(i,r),v&4&&a!==(a=x(w[2],"HH:mm")+"")&&K(t,a),v&2&&f!==(f=x(w[1],"HH:mm")+"")&&K(o,f),v&8&&h!==(h=(w[3]?w[3].name:"n/a")+"")&&K(u,h),v&1&&m!==(m=w[0].id+"")&&K(S,m)},i:te,o:te,d(w){w&&d(e)}}}function Ke(n,e,r){let i,l,a,{item:t}=e,{e:s}=e,{bundle:f}=e;return n.$$set=o=>{"item"in o&&r(0,t=o.item),"e"in o&&r(4,s=o.e),"bundle"in o&&r(5,f=o.bundle)},n.$$.update=()=>{n.$$.dirty&33&&r(3,i=f?f.spec.stages.find(o=>o.id===t.stage):null),n.$$.dirty&1&&r(2,l=typeof t.period.start=="string"?new Date(t.period.start):t.period.start),n.$$.dirty&1&&r(1,a=typeof t.period.end=="string"?new Date(t.period.end):t.period.end)},[t,a,l,i,s,f]}class Re extends ze{constructor(e){super();Le(this,e,Ke,Je,je,{item:0,e:4,bundle:5})}}function Ge(n,e){if(!e)return 0;if(n.duration)return n.duration;const r=e.spec.events.filter(i=>i.parent===n.id);if(r.length>0){let i=r.reduce((l,a)=>l+(a.duration?a.duration:0),0);return i+=5*(r.length-1),i}}function ve(n,e){e.update(r=>{const i=r.favoriteEvents;let l=null;return i.includes(n)?l=Object.assign({},r,{favoriteEvents:i.filter(a=>a!==n)}):(i.push(n),l=Object.assign(r,{favoriteEvents:i})),l})}function me(n,e,r){const i=n.slice();return i[14]=e[r],i}function pe(n,e,r){const i=n.slice();return i[17]=e[r],i}function ge(n,e,r){const i=n.slice();return i[20]=e[r],i}function ke(n,e,r){const i=n.slice();return i[17]=e[r],i}function be(n){let e,r,i=n[8](n[1].speakers),l=[];for(let t=0;t<i.length;t+=1)l[t]=De(ke(n,i,t));const a=t=>B(l[t],1,1,()=>{l[t]=null});return{c(){e=b("div");for(let t=0;t<l.length;t+=1)l[t].c();this.h()},l(t){e=E(t,"DIV",{class:!0});var s=D(e);for(let f=0;f<l.length;f+=1)l[f].l(s);s.forEach(d),this.h()},h(){p(e,"class","mt-1 mb-2 flex flex-wrap gap-2")},m(t,s){M(t,e,s);for(let f=0;f<l.length;f+=1)l[f].m(e,null);r=!0},p(t,s){if(s&258){i=t[8](t[1].speakers);let f;for(f=0;f<i.length;f+=1){const o=ke(t,i,f);l[f]?(l[f].p(o,s),V(l[f],1)):(l[f]=De(o),l[f].c(),V(l[f],1),l[f].m(e,null))}for(Q(),f=i.length;f<l.length;f+=1)a(f);U()}},i(t){if(!r){for(let s=0;s<i.length;s+=1)V(l[s]);r=!0}},o(t){l=l.filter(Boolean);for(let s=0;s<l.length;s+=1)B(l[s]);r=!1},d(t){t&&d(e),se(l,t)}}}function Ee(n){let e,r=n[17].nickname+"",i,l;return{c(){e=A("\xA0("),i=A(r),l=A(")")},l(a){e=H(a,"\xA0("),i=H(a,r),l=H(a,")")},m(a,t){M(a,e,t),M(a,i,t),M(a,l,t)},p(a,t){t&2&&r!==(r=a[17].nickname+"")&&K(i,r)},d(a){a&&d(e),a&&d(i),a&&d(l)}}}function De(n){let e,r,i,l,a,t=n[17].name+"",s,f,o,k;r=new Ne({props:{speaker:n[17],size:"extra-small"}});let h=n[17].nickname&&Ee(n);return{c(){e=b("div"),ie(r.$$.fragment),i=j(),l=b("div"),a=b("a"),s=A(t),h&&h.c(),o=j(),this.h()},l(u){e=E(u,"DIV",{class:!0});var _=D(e);re(r.$$.fragment,_),i=C(_),l=E(_,"DIV",{class:!0});var m=D(l);a=E(m,"A",{href:!0});var S=D(a);s=H(S,t),h&&h.l(S),S.forEach(d),m.forEach(d),o=C(_),_.forEach(d),this.h()},h(){p(a,"href",f="/lide?id="+n[17].id),p(l,"class","m-auto"),p(e,"class","flex gap-1.5")},m(u,_){M(u,e,_),ae(r,e,null),c(e,i),c(e,l),c(l,a),c(a,s),h&&h.m(a,null),c(e,o),k=!0},p(u,_){const m={};_&2&&(m.speaker=u[17]
`),r=e.length>1;return{md:e[0],stripped:r}}function Xe(n,e,r){let i,l,a,t,s,f;he(n,Fe,v=>r(2,s=v)),he(n,fe,v=>r(6,f=v));let{event:o}=e,{hideDate:k=!1}=e;const h={link:qe};function u(v){if(!!v)return v.map(J=>s.spec.speakers.find(G=>G.id===J))}function _(v){const J=s.spec.tracks.find(G=>G.id===v);return J.shortname||J.name}function m(v){return s.spec.events.filter(J=>J.parent===v.id)}const S=()=>ve(i.id,fe),w=v=>ve(v.id,fe);return n.$$set=v=>{"event"in v&&r(11,o=v.event),"hideDate"in v&&r(0,k=v.hideDate)},n.$$.update=()=>{n.$$.dirty&2048&&r(1,i=o),n.$$.dirty&6&&r(5,l=Ge(i,s)),n.$$.dirty&2&&r(4,a=We(i)),n.$$.dirty&6&&r(3,t=s?s.spec.schedule.find(v=>v.event===i.id):null)},[k,i,s,t,a,l,f,h,u,_,m,o,S,w]}class rl extends ze{constructor(e){super();Le(this,e,Xe,Ue,je,{event:11,hideDate:0})}}export{rl as E,Re as a,ve as b,Ge as c};