1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[220],{2912:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>m});var a=t(5155),r=t(8500),n=t.n(r),i=t(2115),d=t(3321),l=t(3565),c=t(5024),o=t(6802),x=t(1926);function m(){let{token:e,isLoading:s,login:t,logout:r,error:m}=(0,l.A)(),{events:u,isLoadingEvents:h,error:g,refreshEvents:p}=(0,c.n)(),f=(0,d.useRouter)(),[j,N]=(0,i.useState)("unknown"),y=(0,x.sc)(),b=(0,x.Vf)();(0,i.useEffect)(()=>{s||e||m?.includes("Missing required env var")||f.replace("/")},[e,s,m,f]),(0,i.useEffect)(()=>{N(window.location.origin)},[]);let v=(0,i.useMemo)(()=>{let e=Date.now();return u.filter(s=>new Date(s.end).getTime()>e).slice(0,10)},[u]);return(0,a.jsxs)("div",{className:"px-4 pt-6 pb-20",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(o.default,{size:36}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-lg font-bold text-gray-900",children:"Google Debug"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"Smoke test for GIS auth and Calendar read access."})]})]}),(0,a.jsx)(n(),{href:"/",className:"text-sm font-medium text-blue-600",children:"Back"})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Auth"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-gray-700",children:e?"Connected":s?"Loading auth state...":"Not connected"}),(0,a.jsxs)("div",{className:"mt-3 space-y-1 text-xs text-gray-500",children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold text-gray-700",children:"Origin:"})," ",j]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold text-gray-700",children:"Client ID present:"})," ",y?"yes":"no"]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold text-gray-700",children:"Client ID preview:"})," ",b]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold text-gray-700",children:"Auth method:"})," ","popup/token flow via google.accounts.oauth2.initTokenClient"]})]}),m&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-700",children:m}),(0,a.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,a.jsx)("button",{onClick:t,className:"rounded-xl bg-blue-600 px-4 py-2 text-sm font-medium text-white",children:"Connect Google Calendar"}),e&&(0,a.jsx)("button",{onClick:r,className:"rounded-xl bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700",children:"Disconnect"})]})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Calendar Fetch"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-gray-700",children:h?"Loading April 20-24, 2026 events...":`${u.length} event(s) loaded for April 20-24, 2026`})]}),(0,a.jsx)("button",{onClick:()=>p(),disabled:!e||h,className:"rounded-xl bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 disabled:opacity-50",children:"Refresh"})]}),g&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-700",children:"CALENDAR_ACCESS_DENIED"===g?"Calendar access denied. If your OAuth consent screen is still in Testing, add your Google account as a test user.":g})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Next 10 Upcoming Events"}),0===v.length?(0,a.jsx)("p",{className:"mt-3 text-sm text-gray-500",children:"No timed events found in the April 20-24, 2026 window."}):(0,a.jsx)("div",{className:"mt-3 space-y-3",children:v.map(e=>(0,a.jsxs)("div",{className:"rounded-lg border border-gray-100 bg-gray-50 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,a.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:new Date(e.start).toLocaleStr
1ing("en-GB",{weekday:"short",day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}),e.locationText&&(0,a.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:e.locationText})]},e.id))})]})]})]})}},3321:(e,s,t)=>{"use strict";var a=t(4645);t.o(a,"useParams")&&t.d(s,{useParams:function(){return a.useParams}}),t.o(a,"usePathname")&&t.d(s,{usePathname:function(){return a.usePathname}}),t.o(a,"useRouter")&&t.d(s,{useRouter:function(){return a.useRouter}}),t.o(a,"useSearchParams")&&t.d(s,{useSearchParams:function(){return a.useSearchParams}})},5418:(e,s,t)=>{Promise.resolve().then(t.bind(t,2912))},6802:(e,s,t)=>{"use strict";t.d(s,{default:()=>n});var a=t(5155),r=t(5772);function n({size:e,priority:s=!1,className:t=""}){return(0,a.jsx)(r.default,{src:"/logo-mark.png",alt:"Between Sessions logo",width:e,height:e,priority:s,className:t})}}},e=>{e.O(0,[500,772,24,441,928,358],()=>e(e.s=5418)),_N_E=e.O()}]);
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.