utxo22-web/_app/chunks/Event-ab546c43.js

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

import{S as Me,i as je,s as Ce,e as E,t as $,k as j,c as D,a as w,h as A,m as C,d,b as m,g as B,J as c,j as G,E as le,q as V,w as te,x as ie,y as re,o as S,B as ae,n as P,p as Q,K as ne,N as Ne,L as he,l as _e}from"./index-9987666b.js";import{A as Oe}from"./Avatar-646b3763.js";import{S as qe,L as Ze}from"./Link-57e97f60.js";import{E as ye}from"./EventTypeLabel-ca431df3.js";import{f as se}from"./utils-93c6c1d6.js";import{b as Fe,c as fe}from"./stores-af76d038.js";function Je(n){let e,a=se(n[1],"yyyy-MM-dd")==="2022-06-04"?"SO":"NE",t,l,r=se(n[1],"HH:mm")+"",i,s,f=se(n[2],"HH:mm")+"",o,g,h=(n[0]?n[0].name:"n/a")+"",u,_;return{c(){e=E("div"),t=$(a),l=j(),i=$(r),s=$("-"),o=$(f),g=$(" ("),u=$(h),_=$(")"),this.h()},l(v){e=D(v,"DIV",{class:!0});var k=w(e);t=A(k,a),l=C(k),i=A(k,r),s=A(k,"-"),o=A(k,f),g=A(k," ("),u=A(k,h),_=A(k,")"),k.forEach(d),this.h()},h(){m(e,"class","font-semibold")},m(v,k){B(v,e,k),c(e,t),c(e,l),c(e,i),c(e,s),c(e,o),c(e,g),c(e,u),c(e,_)},p(v,[k]){k&1&&h!==(h=(v[0]?v[0].name:"n/a")+"")&&G(u,h)},i:le,o:le,d(v){v&&d(e)}}}function Ke(n,e,a){let t,{item:l}=e,{e:r}=e,{bundle:i}=e;const s=new Date(l.period.start),f=new Date(l.period.end);return n.$$set=o=>{"item"in o&&a(3,l=o.item),"e"in o&&a(4,r=o.e),"bundle"in o&&a(5,i=o.bundle)},n.$$.update=()=>{n.$$.dirty&40&&a(0,t=i?i.spec.stages.find(o=>o.id===l.stage):null)},[t,s,f,l,r,i]}class Re extends Me{constructor(e){super();je(this,e,Ke,Je,Ce,{item:3,e:4,bundle:5})}}function Ge(n,e){if(!e)return 0;if(n.duration)return n.duration;const a=e.spec.events.filter(t=>t.parent===n.id);if(a.length>0){let t=a.reduce((l,r)=>l+(r.duration?r.duration:0),0);return t+=5*(a.length-1),t}}function ve(n,e){e.update(a=>{const t=a.favoriteEvents;let l=null;return t.includes(n)?l=Object.assign({},a,{favoriteEvents:t.filter(r=>r!==n)}):(t.push(n),l=Object.assign(a,{favoriteEvents:t})),l})}function me(n,e,a){const t=n.slice();return t[13]=e[a],t}function pe(n,e,a){const t=n.slice();return t[16]=e[a],t}function ge(n,e,a){const t=n.slice();return t[19]=e[a],t}function ke(n,e,a){const t=n.slice();return t[16]=e[a],t}function be(n){let e,a,t=n[7](n[0].speakers),l=[];for(let i=0;i<t.length;i+=1)l[i]=De(ke(n,t,i));const r=i=>S(l[i],1,1,()=>{l[i]=null});return{c(){e=E("div");for(let i=0;i<l.length;i+=1)l[i].c();this.h()},l(i){e=D(i,"DIV",{class:!0});var s=w(e);for(let f=0;f<l.length;f+=1)l[f].l(s);s.forEach(d),this.h()},h(){m(e,"class","mt-1 mb-2 flex flex-wrap gap-2")},m(i,s){B(i,e,s);for(let f=0;f<l.length;f+=1)l[f].m(e,null);a=!0},p(i,s){if(s&129){t=i[7](i[0].speakers);let f;for(f=0;f<t.length;f+=1){const o=ke(i,t,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(P(),f=t.length;f<l.length;f+=1)r(f);Q()}},i(i){if(!a){for(let s=0;s<t.length;s+=1)V(l[s]);a=!0}},o(i){l=l.filter(Boolean);for(let s=0;s<l.length;s+=1)S(l[s]);a=!1},d(i){i&&d(e),ne(l,i)}}}function Ee(n){let e,a=n[16].nickname+"",t,l;return{c(){e=$("\xA0("),t=$(a),l=$(")")},l(r){e=A(r,"\xA0("),t=A(r,a),l=A(r,")")},m(r,i){B(r,e,i),B(r,t,i),B(r,l,i)},p(r,i){i&1&&a!==(a=r[16].nickname+"")&&G(t,a)},d(r){r&&d(e),r&&d(t),r&&d(l)}}}function De(n){let e,a,t,l,r,i=n[16].name+"",s,f,o,g;a=new Oe({props:{speaker:n[16],size:"extra-small"}});let h=n[16].nickname&&Ee(n);return{c(){e=E("div"),te(a.$$.fragment),t=j(),l=E("div"),r=E("a"),s=$(i),h&&h.c(),o=j(),this.h()},l(u){e=D(u,"DIV",{class:!0});var _=w(e);ie(a.$$.fragment,_),t=C(_),l=D(_,"DIV",{class:!0});var v=w(l);r=D(v,"A",{href:!0});var k=w(r);s=A(k,i),h&&h.l(k),k.forEach(d),v.forEach(d),o=C(_),_.forEach(d),this.h()},h(){m(r,"href",f="/lide?id="+n[16].id),m(l,"class","m-auto"),m(e,"class","flex gap-1.5")},m(u,_){B(u,e,_),re(a,e,null),c(e,t),c(e,l),c(l,r),c(r,s),h&&h.m(r,null),c(e,o),g=!0},p(u,_){const v={};_&1&&(v.speaker=u[16]),a.$set(v),(!g||_&1)&&i!==(i=u[16].name+"")&&G(s,i),u[16].nickname?h?h.p(u,_):(h=Ee(u),h.c(),h.m(r,null)):h&&(h.d(1),h=null),(!g||_&1&&f!==(f="/lide?id="+u[16].id))&&m(r,"href",f)},i(u){g||(V(a.$$.fragment,u),g=!0)},o(u){S(a.$$.fragment,u),g=!1},d(u){u&&d(e),ae(a),h&&h.d()}}}function we(n){let e,a;return e=new Re({props:{item:n[2],event:n[0
`),a=e.length>1;return{md:e[0],stripped:a}}function Xe(n,e,a){let t,l,r,i,s,f;he(n,Fe,b=>a(1,s=b)),he(n,fe,b=>a(5,f=b));let{event:o}=e;const g={link:Ze};function h(b){if(!!b)return b.map(F=>s.spec.speakers.find(K=>K.id===F))}function u(b){const F=s.spec.tracks.find(K=>K.id===b);return F.shortname||F.name}function _(b){return s.spec.events.filter(F=>F.parent===b.id)}const v=()=>ve(t.id,fe),k=b=>ve(b.id,fe);return n.$$set=b=>{"event"in b&&a(10,o=b.event)},n.$$.update=()=>{n.$$.dirty&1024&&a(0,t=o),n.$$.dirty&3&&a(4,l=Ge(t,s)),n.$$.dirty&1&&a(3,r=We(t)),n.$$.dirty&3&&a(2,i=s?s.spec.schedule.find(b=>b.event===t.id):null)},[t,s,i,r,l,f,g,h,u,_,o,v,k]}class rl extends Me{constructor(e){super();je(this,e,Xe,Ue,Ce,{event:10})}}export{rl as E,Re as a,ve as b,Ge as c};