1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3896],{63896:function(e,t,r){r.r(t),r.d(t,{default:function(){return u}});var i=r(57437),n=r(2265);let a=["Lunes","Martes","Mi\xe9rcoles","Jueves","Viernes","S\xe1bado","Domingo"];var l=r(1228),s=r(79346);let o=(e,t)=>e?"bg-amber-400 text-black shadow-md":t?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/40 dark:text-indigo-300":"bg-white/60 text-gray-600 hover:bg-white dark:bg-neutral-800/60 dark:text-gray-300 dark:hover:bg-neutral-700",d=(e,t)=>e?"border-l-4 border-amber-400 bg-amber-50 dark:bg-amber-900/20":t?"opacity-60":"",c=n.memo(function(e){let{event:t,baseMs:r,hourStart:n,slotMinutes:a,isPrint:l,nowTs:s,timeFmt:o}=e,d=(t.endMins-t.startMins)/a*(l?24:32);t.isGap||(d=Math.max(d,28));let c=new Date(r+(t.startMins+60*n)*6e4),u=new Date(r+(t.endMins+60*n)*6e4),m=t.color&&!t.isGap?{backgroundColor:t.color}:{},p=!t.isGap&&u.getTime()<=s,x=t.title.trim().split(/\s+/).length,g=o.format(c),h=o.format(u);return(0,i.jsx)("div",{title:t.isGap?void 0:"".concat(t.title," - ").concat(g,"-").concat(h),className:"group relative flex flex-col items-center justify-center rounded-md outline outline-1 outline-white overflow-visible ".concat(t.isGap?"bg-gray-50 text-gray-400 dark:bg-neutral-800/60":"origin-left cursor-pointer bg-indigo-50 text-gray-900 transition-all duration-150 will-change-transform hover:z-30 hover:scale-x-[1.3] hover:scale-y-110 hover:bg-amber-50 hover:ring-2 hover:ring-amber-400 hover:shadow-xl dark:bg-indigo-900/40 dark:text-gray-100 dark:hover:bg-amber-900/60"," ").concat(p?"opacity-60":""," print:bg-white print:text-[8px] print:hover:scale-100 print:hover:shadow-none print:hover:ring-0"),style:{height:d,width:"100%",fontSize:"9px",padding:"1px 3px",...m},children:(0,i.jsxs)("div",{className:"flex w-full flex-1 flex-col items-center justify-center text-center",children:[(0,i.jsx)("span",{className:"block w-full truncate group-hover:whitespace-normal group-hover:overflow-visible print:overflow-hidden print:text-ellipsis print:whitespace-nowrap",style:{fontSize:x>8?"8px":"9px"},children:t.title}),!t.isGap&&(0,i.jsxs)("span",{className:"block w-full font-normal text-gray-600 dark:text-gray-300 print:text-[7px]",style:{fontSize:"8px"},children:[g,"-",h]})]})})});function u(e){let{icsUrl:t,timezone:r="America/Cancun",hourStart:u=7,hourEnd:m=24,slotMinutes:p=30,onApi:x,onDatesSet:g}=e,[h,f]=n.useState(()=>(0,l.y)()),[v,b]=n.useState(()=>{let e=new Date().getDay();return 0===e?6:e-1}),w=function(){let[e,t]=n.useState(!1);return n.useEffect(()=>{if(void 0===globalThis.window)return;let e=globalThis.window.matchMedia?globalThis.window.matchMedia("print"):null,r=e=>t(e.matches);if(e){var i;null===(i=e.addEventListener)||void 0===i||i.call(e,"change",r),t(e.matches)}let n=()=>t(!0),a=()=>t(!1);return globalThis.window.addEventListener("beforeprint",n),globalThis.window.addEventListener("afterprint",a),()=>{if(e){var t;null===(t=e.removeEventListener)||void 0===t||t.call(e,"change",r)}globalThis.window.removeEventListener("beforeprint",n),globalThis.window.removeEventListener("afterprint",a)}},[]),e}(),y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[t,r]=n.useState(!1);return n.useEffect(()=>{let t=()=>r(window.innerWidth<e);return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t}(),{events:N,error:k}=function(e){let[t,r]=n.useState([]),[i,a]=n.useState(null);return n.useEffect(()=>{let t,i,n=!1,l=async()=>{try{a(null);let t=e||"/api/ics",i=t.includes("?")?"&":"?",l=await fetch("".concat(t).concat(i,"t=").concat(Date.now()),{cache:"no-store"});if(!l.ok)throw Error("Cannot get ICS");let o=await l.text(),d=(0,s.O)(o).map((e,t)=>({id:"ev-".concat(t,"-").concat(e.start.toISOString()),title:e.title,start:e.start,end:e.end}));n||r(d)}catch(e){n||a(e instanceof Error?e.message:"Error loading events")}};return l(),t=setTimeout(()=>{l(),i=setInterval(l,6e4)},6e4-Date.now()%6e4),()=>{n=!0,void 0!==t&&globalThis.clearTimeout(t),void 0!==i&&globalThis.clearInterval(i)}},[e]),{events:t,error:i}}(t),{nowTop:j,nowTs:E}=function(e,t,r,i,a){let[s,o]=n.useState(null),[d,c]=n.useState(0);return n.useEffect(()=>{let n,s;let d=()=>{let n=new Date;c(n.getTime());
1let s=new Date((0,l.E)(e,6));s.setHours(23,59,59,999);let d=n>=e&&n<=s,u=60*n.getHours()+n.getMinutes(),m=u>=60*t&&u<=60*r;d&&m?o((a?24:32)/i*(u-60*t)):o(null)};return d(),n=setTimeout(()=>{d(),s=setInterval(d,6e4)},6e4-Date.now()%6e4),()=>{void 0!==n&&globalThis.clearTimeout(n),void 0!==s&&globalThis.clearInterval(s)}},[e,t,r,i,a]),{nowTop:s,nowTs:d}}(h,u,m,p,w);n.useEffect(()=>{if(x)return x({prev:()=>f(e=>(0,l.E)(e,-7)),next:()=>f(e=>(0,l.E)(e,7)),today:()=>f((0,l.y)())}),()=>x(null)},[x]),n.useEffect(()=>{if(!g)return;let e=(0,l.E)(h,6);e.setHours(23,59,59,999),g({start:h,end:e})},[g,h]);let M=n.useMemo(()=>{let e=[],t=(m-u)*60;for(let r=0;r<7;r+=1){let i=(0,l.E)(h,r),n=new Date(i);n.setHours(u,0,0,0);let a=new Date(i);a.setHours(m,0,0,0);let s=[];for(let e of N){let t=e.start,r=e.end;if(r<=n||t>=a)continue;let i=new Date(Math.max(t.getTime(),n.getTime())),l=new Date(Math.min(r.getTime(),a.getTime())),o=60*i.getHours()+i.getMinutes()-60*u,d=60*l.getHours()+l.getMinutes()-60*u;d<=o||s.push({...e,startMins:o,endMins:d})}e.push(function(e,t){let r=[...e].sort((e,t)=>e.startMins-t.startMins),i=[],n=0;for(let e of r)e.startMins>n&&i.push({id:"gap-".concat(n),title:"Sin programaci\xf3n",startMins:n,endMins:e.startMins,isGap:!0}),i.push({id:e.id,title:e.title,startMins:e.startMins,endMins:e.endMins,color:e.color}),n=e.endMins;return n<t&&i.push({id:"gap-".concat(n),title:"Sin programaci\xf3n",startMins:n,endMins:t,isGap:!0}),i}(s,t))}return e},[N,m,u,h]),T=n.useRef(null);n.useEffect(()=>{let e=new Date,t=e.getHours()+e.getMinutes()/60;if(t<u||t>m)return;let r=(t-u)/(m-u),i=T.current;i&&(i.scrollTop=r*(i.scrollHeight-i.clientHeight))},[m,u]);let D=n.useMemo(()=>new Intl.DateTimeFormat("es-MX",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:r}),[r]),S=n.useMemo(()=>{let e=[];for(let t=60*u;t<=60*m;t+=60)e.push(t/60);return e},[m,u]),I=n.useMemo(()=>{let e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(h.getFullYear(),h.getMonth(),h.getDate()),i=Math.floor((t.getTime()-r.getTime())/864e5);return i>=0&&i<7?i:-1},[h]);if(y&&!w){var C;let e=(0,l.E)(h,v),t=(null===(C=M[v])||void 0===C?void 0:C.filter(e=>!e.isGap))||[],r=new Date(e).setHours(0,0,0,0);return(0,i.jsxs)("div",{className:"w-full",children:[k&&(0,i.jsx)("div",{role:"alert",className:"mb-3 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/40 dark:bg-red-900/20 dark:text-red-200",children:k}),(0,i.jsx)("div",{className:"mb-4 overflow-x-auto scrollbar-hide",children:(0,i.jsx)("div",{className:"flex min-w-max gap-1 px-1",children:a.map((e,t)=>{let r=(0,l.E)(h,t).getDate();return(0,i.jsxs)("button",{type:"button",onClick:()=>b(t),className:"flex min-w-[52px] flex-col items-center rounded-xl px-3 py-2 text-sm font-medium transition-all ".concat(o(v===t,I===t)),children:[(0,i.jsx)("span",{className:"text-xs uppercase",children:e.slice(0,3)}),(0,i.jsx)("span",{className:"text-lg font-bold",children:r})]},e)})})}),(0,i.jsxs)("div",{className:"overflow-hidden rounded-2xl border bg-white/80 dark:bg-neutral-900/60",children:[(0,i.jsx)("div",{className:"border-b bg-white/90 px-4 py-3 dark:bg-neutral-900/90",children:(0,i.jsxs)("h3",{className:"font-semibold text-gray-900 dark:text-gray-100",children:[a[v]," ",e.getDate()]})}),(0,i.jsx)("div",{className:"max-h-[60vh] divide-y divide-gray-100 overflow-y-auto dark:divide-neutral-800",children:0===t.length?(0,i.jsx)("div",{className:"px-4 py-8 text-center text-gray-500",children:"No hay programas para este d\xeda"}):t.map(e=>{let t=new Date(r+(e.startMins+60*u)*6e4),n=new Date(r+(e.endMins+60*u)*6e4),a=n.getTime()<=E,l=t.getTime()<=E&&E<n.getTime();return(0,i.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 transition-colors ".concat(d(l,a)),children:[(0,i.jsx)("div",{className:"h-12 w-1 shrink-0 rounded-full",style:{backgroundColor:e.color||"var(--primary, #6366f1)"}}),(0,i.jsxs)("div",{className:"w-20 shrink-0 text-sm text-gray-500 dark:text-gray-400",children:[(0,i.jsx)("div",{className:"font-medium",children:D.format(t)}),(0,i.jsx)("div",{children:D.format(n)})]}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("div",{className:"truncate font-medium ".concat(l?"text-amber-700 dark:text-amber-300":"text-gray-900 dark:text-gray-100"),children:e.title}),l&&(0,i.jsxs)("span",{className:"mt-0.5 inline-flex items-center gap-1 text-xs font-medium text-amber-600 dar
1k:text-amber-400",children:[(0,i.jsx)("span",{className:"h-2 w-2 animate-pulse rounded-full bg-amber-500"}),(0,i.jsx)("span",{children:"En vivo"})]})]})]},e.id)})})]})]})}return(0,i.jsx)("div",{className:"w-full overflow-auto print:overflow-visible",children:(0,i.jsxs)("div",{className:"min-w-[1024px] rounded-2xl border bg-white/80 print:min-w-0 print:rounded-none print:border-0 print:bg-white dark:bg-neutral-900/60",children:[k&&(0,i.jsx)("div",{role:"alert",className:"m-2 rounded border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/40 dark:bg-red-900/20 dark:text-red-200",children:k}),(0,i.jsxs)("div",{className:"calendar-grid grid",style:{gridTemplateColumns:w?"60px repeat(7, minmax(120px, 1fr))":"80px repeat(7, minmax(160px, 1fr))"},children:[(0,i.jsx)("div",{className:"sticky top-0 z-20 border-b bg-white/90 px-1 py-2 text-center text-xs text-gray-500 backdrop-blur print:py-1 print:text-[9px] dark:bg-neutral-900/90",children:"Hora"}),a.map((e,t)=>{let r=(0,l.E)(h,t).getDate();return(0,i.jsxs)("div",{className:"sticky top-0 z-20 border-b bg-white/90 px-3 py-2 text-center text-sm font-semibold backdrop-blur print:py-1 print:text-[10px] dark:bg-neutral-900/90",children:[e," ",r]},e)})]}),(0,i.jsx)("div",{ref:T,className:"relative max-h-[70vh] overflow-auto print:max-h-none print:overflow-visible",children:(0,i.jsxs)("div",{className:"calendar-grid grid",style:{gridTemplateColumns:w?"60px repeat(7, minmax(120px, 1fr))":"80px repeat(7, minmax(160px, 1fr))"},children:[(0,i.jsx)("div",{className:"sticky left-0 z-10 border-r bg-white/90 backdrop-blur print:static print:border-0 print:bg-white dark:bg-neutral-900/90",children:S.map(e=>(0,i.jsxs)("div",{className:"relative flex h-[64px] items-center justify-center border-b px-1 text-xs text-gray-600 print:h-[36px]",children:[String(Math.floor(e)).padStart(2,"0"),":00"]},e))}),M.map((e,t)=>{let r=(0,l.E)(h,t).toDateString(),n=(0,l.E)(h,t).setHours(0,0,0,0);return(0,i.jsxs)("div",{className:"relative overflow-visible print:pb-1",children:[(0,i.jsx)("div",{className:"absolute inset-0 grid grid-rows-[repeat(auto-fit,minmax(64px,1fr))] print:grid-rows-[repeat(auto-fit,minmax(36px,1fr))]",children:S.map(e=>(0,i.jsx)("div",{className:"relative border-b",children:(0,i.jsx)("div",{className:"absolute right-0 top-0 h-full w-px bg-gray-200"})},"".concat(r,"-").concat(e)))}),e.map(e=>(0,i.jsx)(c,{event:e,baseMs:n,hourStart:u,slotMinutes:p,isPrint:w,nowTs:E,timeFmt:D},e.id)),I===t&&null!==j&&(0,i.jsx)("div",{className:"pointer-events-none absolute left-0 right-0 z-30 print:hidden",style:{top:j},children:(0,i.jsx)("div",{className:"h-0.5 bg-red-500"})})]},r)})]})})]})})}},79346:function(e,t,r){function i(e){let t=e.split(":").pop()||"";if(!t)return null;if(/^\d{8}$/.test(t))return new Date(+t.slice(0,4),+t.slice(4,6)-1,+t.slice(6,8),0,0,0,0);let r=/(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?/.exec(t);if(!r)return null;let i=+r[1],n=+r[2]-1,a=+r[3],l=+r[4],s=+r[5],o=+r[6];return r[7]?new Date(Date.UTC(i,n,a,l,s,o)):new Date(i,n,a,l,s,o)}function n(e){let t=(function(e){let t=e.replaceAll("\r\n","\n").split("\n"),r=[];for(let e of t)e.startsWith(" ")&&r.length?r[r.length-1]+=e.slice(1):r.push(e);return r})(e).join("\n").split("BEGIN:VEVENT").slice(1).map(e=>e.split("END:VEVENT")[0]),r=[],n=/^DTSTART[^\n]*$/m,a=/^DTEND[^\n]*$/m,l=/^SUMMARY:(.*)$/m,s=/^DESCRIPTION(?:;[^:]*)?:(.*)$/m,o=/^LOCATION(?:;[^:]*)?:(.*)$/m,d=/^URL(?:;[^:]*)?:(.*)$/m,c=/^RRULE:(.*)$/m,u=/^UID:(.*)$/m,m=/^RECURRENCE-ID(?:;[^:]*)?:(.*)$/m;for(let e of t){let t;let p=n.exec(e),x=a.exec(e),g=l.exec(e),h=s.exec(e),f=o.exec(e),v=d.exec(e),b=c.exec(e),w=u.exec(e),y=m.exec(e),N=p?p[0]:"",k=x?x[0]:"",j=(g?g[1].replace(/\\,/g,",").replace(/\\;/g,";
1"):"Evento").trim(),E=h?h[1].replace(/\\n/gi,"\n").replace(/\\,/g,",").trim():void 0,M=f?f[1].replace(/\\,/g,",").trim():void 0,T=v?v[1].trim():void 0,D=i(N),S=i(k),I=w?w[1].trim():void 0,C=y?y[1]:"",H=C?i(C):null,L=[],$=/^EXDATE(?:;[^:]*)?:(.*)$/gm;for(;null!==(t=$.exec(e));)for(let e of t[1].split(",")){let t=i(e.trim());t&&L.push(t)}D&&S&&r.push({start:D,end:S,title:j,description:E,location:M,url:T,rrule:b?b[1].trim():void 0,exdates:L.length>0?L:void 0,uid:I,recurrenceId:H||void 0})}let p=new Map;for(let e of r)e.uid&&e.recurrenceId&&(p.has(e.uid)||p.set(e.uid,[]),p.get(e.uid).push(e.recurrenceId));for(let e of r)if(e.uid&&e.rrule){let t=p.get(e.uid);t&&(e.exdates=e.exdates?[...e.exdates,...t]:t)}return r}r.d(t,{O:function(){return n}})}}]);
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.