utxo22-web/_app/pages/program.svelte-dd8fc4c3.js

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

import{S as rt,i as ot,s as it,e as E,t as S,k as Z,c as D,a as y,h as P,d as u,m as q,b as _,g as O,J as c,N as we,j as ee,K as re,Y as nt,n as oe,o as x,p as ie,q as X,L as ke,v as ct,T as ft,a4 as Te,E as ue,l as se,w as ut,x as dt,y as ht,B as _t,a5 as pt}from"../chunks/index-9987666b.js";import{g as mt}from"../chunks/navigation-0e6511d1.js";import{p as Ie}from"../chunks/stores-94e0f320.js";import{b as Ve,s as fe}from"../chunks/stores-af76d038.js";import{p as bt}from"../chunks/periods-d433e7f7.js";import{L as vt,S as gt}from"../chunks/Link-57e97f60.js";import{c as kt}from"../chunks/index-1cc1bdc7.js";import{f as le}from"../chunks/index-14ac584d.js";import{l as me}from"../chunks/index-c9b2ee0d.js";import"../chunks/singletons-d1fb5791.js";import"../chunks/index-4049ca3c.js";const{Boolean:de}=pt;function Ae(a,t,e){const l=a.slice();return l[17]=t[e],l}function He(a,t,e){const l=a.slice();return l[20]=t[e],l}function Se(a,t,e){const l=a.slice();return l[23]=t[e],l}function Pe(a,t,e){const l=a.slice();return l[26]=t[e][0],l[27]=t[e][1],l}function Ne(a,t,e){const l=a.slice();return l[30]=t[e],l}function ze(a,t,e){const l=a.slice();return l[33]=t[e],l}function Be(a,t,e){const l=a.slice();return l[23]=t[e],l}function Me(a,t,e){const l=a.slice();return l[38]=t[e],l}function $e(a,t,e){const l=a.slice();return l[17]=t[e],l}function Le(a){let t,e,l,r,f,s,i,o,n,T,w,V,b,$,F,j,m,A,v=a[6](a[0]),g=[];for(let h=0;h<v.length;h+=1)g[h]=Oe($e(a,v,h));let N=tt(a[0]),k=[];for(let h=0;h<N.length;h+=1)k[h]=je(Me(a,N,h));return{c(){t=E("div"),e=E("div"),l=E("div"),r=S("Den"),f=Z();for(let h=0;h<g.length;h+=1)g[h].c();s=Z(),i=E("div"),o=E("div"),n=E("div"),T=S("S\xE1l"),w=Z();for(let h=0;h<k.length;h+=1)k[h].c();V=Z(),b=E("div"),$=E("label"),F=E("input"),j=S(" Zobrazit popisy"),this.h()},l(h){t=D(h,"DIV",{class:!0});var L=y(t);e=D(L,"DIV",{class:!0});var d=y(e);l=D(d,"DIV",{class:!0});var R=y(l);r=P(R,"Den"),R.forEach(u),f=q(d);for(let G=0;G<g.length;G+=1)g[G].l(d);d.forEach(u),L.forEach(u),s=q(h),i=D(h,"DIV",{class:!0});var K=y(i);o=D(K,"DIV",{class:!0});var Q=y(o);n=D(Q,"DIV",{class:!0});var z=y(n);T=P(z,"S\xE1l"),z.forEach(u),w=q(Q);for(let G=0;G<k.length;G+=1)k[G].l(Q);Q.forEach(u),K.forEach(u),V=q(h),b=D(h,"DIV",{class:!0});var J=y(b);$=D(J,"LABEL",{});var W=y($);F=D(W,"INPUT",{type:!0}),j=P(W," Zobrazit popisy"),W.forEach(u),J.forEach(u),this.h()},h(){_(l,"class","font-semibold uppercase my-auto mx-3"),_(e,"class","flex gap-1 flex-wrap"),_(t,"class","mb-4"),_(n,"class","font-semibold uppercase my-auto mx-3"),_(o,"class","flex gap-1 flex-wrap"),_(i,"class","mb-4"),_(F,"type","checkbox"),_(b,"class","mb-4")},m(h,L){O(h,t,L),c(t,e),c(e,l),c(l,r),c(e,f);for(let d=0;d<g.length;d+=1)g[d].m(e,null);O(h,s,L),O(h,i,L),c(i,o),c(o,n),c(n,T),c(o,w);for(let d=0;d<k.length;d+=1)k[d].m(o,null);O(h,V,L),O(h,b,L),c(b,$),c($,F),F.checked=a[2].showDescriptions,c($,j),m||(A=we(F,"change",a[9]),m=!0)},p(h,L){if(L[0]&69){v=h[6](h[0]);let d;for(d=0;d<v.length;d+=1){const R=$e(h,v,d);g[d]?g[d].p(R,L):(g[d]=Oe(R),g[d].c(),g[d].m(e,null))}for(;d<g.length;d+=1)g[d].d(1);g.length=v.length}if(L[0]&5){N=tt(h[0]);let d;for(d=0;d<N.length;d+=1){const R=Me(h,N,d);k[d]?k[d].p(R,L):(k[d]=je(R),k[d].c(),k[d].m(o,null))}for(;d<k.length;d+=1)k[d].d(1);k.length=N.length}L[0]&4&&(F.checked=h[2].showDescriptions)},d(h){h&&u(t),re(g,h),h&&u(s),h&&u(i),re(k,h),h&&u(V),h&&u(b),m=!1,A()}}}function Oe(a){let t,e=a[17].name+"",l,r,f,s;function i(){return a[7](a[17])}return{c(){t=E("button"),l=S(e),this.h()},l(o){t=D(o,"BUTTON",{class:!0});var n=y(t);l=P(n,e),n.forEach(u),this.h()},h(){_(t,"class",r=(a[2].time===a[17].id?"bg-utxo-gradient text-white":"text-blue-web bg-blue-web-light hover:text-[#E16A61] hover:bg-[#E16A61]/20")+" font-semibold py-1 px-2 sm:py-2 sm:px-4 rounded-full")},m(o,n){O(o,t,n),c(t,l),f||(s=we(t,"click",i),f=!0)},p(o,n){a=o,n[0]&1&&e!==(e=a[17].name+"")&&ee(l,e),n[0]&5&&r!==(r=(a[2].time===a[17].id?"bg-utxo-gradient text-white":"text-blue-web bg-blue-web-light hover:text-[#E16A61] hover:bg-[#E16A61]/20")+" font-semibold py-1 px-2 sm:py-2 sm:px-4 rounded-full")&&
`),e=t.length>1;return{md:t[0],stripped:e}}function st(a,t){const e=a.spec.events.find(l=>l.id===t);if(!e)return console.log(`Event not found: ${t}`),null;switch(e.type){case"panel":e.color="bg-orange-400/20 hover:bg-orange-400/40";break;case"talk":e.color="bg-custom-green/20 hover:bg-custom-green/40";break;case"workshop":e.color="bg-custom-blue/20 hover:bg-custom-blue/40";break;case"campfire":e.color="bg-purple-400/20 hover:bg-purple-400/40";break;case"lightning-series":e.color="bg-yellow-400/20 hover:bg-yellow-400/40";break;default:e.color="bg-rose-400/20 hover:bg-rose-400/40"}return e}const at=a=>`#${a}`;function Ht(a,t,e){let l,r,f,s;ke(a,Ie,m=>e(13,r=m)),ke(a,Ve,m=>e(0,f=m)),ke(a,fe,m=>e(2,s=m));const i={link:vt},o={time:{key:"time"},stage:{key:"stage"},desc:{key:"showDescriptions",type:"boolean"}};let n=[];n.push(Ie.subscribe(()=>{fe.update(m=>{for(const A of Object.keys(o)){const v=o[A],g=r.url.searchParams.get(A);v.type==="boolean"?g!==void 0&&(m[v.key]=Boolean(g)):m[v.key]=g||"all"}return m})})),ct(async()=>{const m=Ve.subscribe(v=>{w(v),v.spec.stages});n.push(m);const A=fe.subscribe(v=>{const g=[];g.push(["time",v.time==="all"?void 0:v.time]),g.push(["stage",v.stage==="all"?void 0:v.stage]),g.push(["desc",v.showDescriptions===null||v.showDescriptions===!1||v.showDescriptions===void 0?void 0:!0]);let N="?";if(g.length>0){for(const k of g)k[1]===void 0&&r.url.searchParams.get(k[0])!==void 0?r.url.searchParams.delete(k[0]):r.url.searchParams.set(k[0],k[1]);N=`?${r.url.searchParams.toString()}`}return mt(N),!1});n.push(A)}),ft(()=>{for(const m of n)m()});function T(m,A,v,g=null){let N=A.start;const k=A.end,h=[],L={};for(;kt(N,k)===-1;){const d={};for(const R of v.spec.stages){if(L[R.id]>0){d[R.id]=null,L[R.id]--;continue}if(g&&g.stage!==R.id&&g.stage!=="all")continue;let K=m.find(Q=>new Date(Q.period.start).getTime()===new Date(N).getTime()&&Q.stage===R.id);if(d[R.id]=K,K){const Q=Math.floor((new Date(K.period.end).getTime()-new Date(K.period.start).getTime())/6e4/30);K.span=Q,Q>1&&(L[R.id]=Q-1)}}h.push({title:le(N,"HH:mm"),stages:d}),N=new Date(N.getTime()+30*60*1e3)}return h}function w(m,A=!1){let v=m.scheduleTimes.map((g,N)=>{const k=bt(m,g);switch(k.id=String(N),N){case 0:k.code="sobota";break;case 1:k.code="sobota-party";break;case 2:k.code="nedele";break}return k});return A&&(v=v.filter(g=>g.id===A||A==="all")),v}function V(m){return[{id:"all",name:"V\u0161echny dny"},...w(m)]}const b=m=>Te(fe,s.time=m.id,s),$=m=>Te(fe,s.stage=m.id,s);function F(){s.showDescriptions=this.checked,fe.set(s)}const j=(m,A)=>A.id===m.track;return a.$$.update=()=>{a.$$.dirty[0]&1&&e(1,l=f?f.spec.schedule:null)},[f,l,s,i,T,w,V,b,$,F,j]}class Ut extends rt{constructor(t){super();ot(this,t,Ht,Vt,it,{},null,[-1,-1])}}export{Ut as default,Ft as prerender};