PageSourceSearch

https://www.activefitness.de/assets/WeeklyCourseGrid-CdBjUD-F.js

js activefitness.de collected 2026-10-08 08:42:29 UTC 3,925 bytes, 1 lines download raw bytes

1import{mf as k,r as g,j as o}from"./index-FXnsLRQm.js";const $=["Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],v=["Mo","Di","Mi","Do","Fr","Sa","So"],_=[0,1,2,3,4,5,6],y=s=>{if(!s)return"";const[r,d]=s.split(":");return r===void 0?s:`${r.padStart(2,"0")}:${(d??"00").slice(0,2)}`},N=s=>/reha|rücken|ruecken|physio/i.test(s),D=s=>{const r=s??[],d=(e,l)=>{const t=k(e.course_color);return{key:e.id??`${e.day_of_week}-${e.time_slot}-${e.course_name}-${l}`,name:e.course_name,start:y(e.time_slot),end:e.end_time?y(e.end_time):void 0,trainer:e.trainer??void 0,room:e.room??void 0,isReha:N(e.course_name),colorStrong:t==null?void 0:t.strong,colorSoft:t==null?void 0:t.soft}},i={};r.forEach((e,l)=>{(i[e.day_of_week]??(i[e.day_of_week]=[])).push(d(e,l))}),Object.values(i).forEach(e=>e.sort((l,t)=>l.start.localeCompare(t.start)));const n=_.filter(e=>{var l;return(((l=i[e])==null?void 0:l.length)??0)>0}).map(e=>({index:e,label:$[e],short:v[e]})),x=Array.from(new Set(r.map(e=>y(e.time_slot)))).sort((e,l)=>e.localeCompare(l)).map(e=>{const l={};return n.forEach(t=>{l[t.index]=(i[t.index]??[]).filter(m=>m.start===e)}),{time:e,cells:l}});return{days:n,rows:x,byDay:i}},b=({course:s,accent:r,accentSoft:d,muted:i,border:n,rehaLabel:p})=>o.jsxs("div",{className:"rounded-xl px-3 py-2.5 text-left",style:{background:s.colorSoft??d,border:`1px solid ${n}`,borderLeft:`3px solid ${s.colorStrong??r}`},children:[o.jsx("p",{className:"text-[13px] font-bold leading-tight",children:s.name}),o.jsx("p",{className:"mt-1 text-[11.5px] font-semibold tabular-nums",style:{color:r},children:s.end?`${s.start} – ${s.end}`:s.start}),(s.trainer||s.room)&&o.jsx("p",{className:"mt-0.5 text-[11.5px]",style:{color:i},children:[s.trainer,s.room].filter(Boolean).join(" · ")}),s.isReha&&o.jsx("span",{className:"mt-1.5 inline-block rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-[0.08em]",style:{background:r,color:"#fff"},children:p})]}),S=({schedules:s,accent:r,accentSoft:d,surface:i,border:n,muted:p,foreground:x,className:e,rehaLabel:l="Reha"})=>{const t=g.useMemo(()=>D(s),[s]),[m,j]=g.useState(null);if(t.days.length===0)return null;const f=m??t.days[0].index;return o.jsxs("div",{className:e,style:{color:x},children:[o.jsx("div",{className:"hidden overflow-hidden rounded-2xl md:block",style:{border:`1px solid ${n}`,background:i},children:o.jsxs("div",{className:"grid",style:{gridTemplateColumns:`92px repeat(${t.days.length}, minmax(0, 1fr))`},children:[o.jsx("div",{className:"px-4 py-3 text-[11px] font-bold uppercase tracking-[0.14em]",style:{color:p},children:"Zeit"}),t.days.map(a=>o.jsx("div",{className:"px-3 py-3 text-center text-[12px] font-bold uppercase tracking-[0.12em]",style:{background:d,color:r,borderLeft:`1px solid ${n}`},children:a.label},a.index)),t.rows.map(a=>o.jsxs("div",{className:"contents",children:[o.jsx("div",{className:"px-4 py-4 text-[13px] font-bold tabular-nums",style:{borderTop:`1px solid ${n}`,color:r},children:a.time}),t.days.map(c=>{var h;return o.jsx("div",{className:"space-y-2 px-2.5 py-3",style:{borderTop:`1px solid ${n}`,borderLeft:`1px solid ${n}`},children:(h=a.cells[c.index])==null?void 0:h.map(u=>o.jsx(b,{course:u,accent:r,accentSoft:d,muted:p,border:n,rehaLabel:l},u.key))},`${a.time}-${c.index}`)})]},a.time))]})}),o.jsxs("div",{className:"md:hidden",children:[o.jsx("div",{className:"flex flex-wrap gap-2",children:t.days.map(a=>{const c=a.index===f;return o.jsx("button",{type:"button",onClick:()=>j(a.index),className:"rounded-full px-4 py-2 text-[12px] font-bold uppercase tracking-[0.1em]",style:{background:c?r:d,color:c?"#fff":r,border:`1px solid ${c?r:n}`},children:a.short},a.index)})}),o.jsx("div",{className:"mt-4 space-y-3 rounded-2xl p-4",style:{border:`1px solid ${n}`,background:i},children:(t.byDay[f]??[]).map(a=>o.jsx(b,{course:a,accent:r,accentSoft:d,muted:p,border:n,rehaLabel:l},a.key))})]})]})};export{S as W};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.