1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6856],{20063:(e,t,s)=>{var n=s(47260);s.o(n,"permanentRedirect")&&s.d(t,{permanentRedirect:function(){return n.permanentRedirect}}),s.o(n,"redirect")&&s.d(t,{redirect:function(){return n.redirect}}),s.o(n,"useParams")&&s.d(t,{useParams:function(){return n.useParams}}),s.o(n,"usePathname")&&s.d(t,{usePathname:function(){return n.usePathname}}),s.o(n,"useRouter")&&s.d(t,{useRouter:function(){return n.useRouter}}),s.o(n,"useSearchParams")&&s.d(t,{useSearchParams:function(){return n.useSearchParams}})},96199:(e,t,s)=>{s.d(t,{CP:()=>eo,wV:()=>en});var n,r,a,o,i,c=s(95155),l=s(12115),u=s.t(l,2);class d extends Error{constructor(e,t){e instanceof Error?super(void 0,{cause:{err:e,...e.cause,...t}}):"string"==typeof e?(t instanceof Error&&(t={err:t,...t.cause}),super(e,t)):super(void 0,e),this.name=this.constructor.name,this.type=this.constructor.type??"AuthError",this.kind=this.constructor.kind??"error",Error.captureStackTrace?.(this,this.constructor);let s=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?". ":""}Read more at ${s}`}}class p extends d{}p.kind="signIn";class h extends d{}h.type="AdapterError";class v extends d{}v.type="AccessDenied";class f extends d{}f.type="CallbackRouteError";class y extends d{}y.type="ErrorPageLoop";class g extends d{}g.type="EventError";class E extends d{}E.type="InvalidCallbackUrl";class x extends p{constructor(){super(...arguments),this.code="credentials"}}x.type="CredentialsSignin";class m extends d{}m.type="InvalidEndpoints";class S extends d{}S.type="InvalidCheck";class w extends d{}w.type="JWTSessionError";class _ extends d{}_.type="MissingAdapter";class b extends d{}b.type="MissingAdapterMethods";class L extends d{}L.type="MissingAuthorize";class R extends d{}R.type="MissingSecret";class U extends p{}U.type="OAuthAccountNotLinked";class A extends p{}A.type="OAuthCallbackError";class k extends d{}k.type="OAuthProfileParseError";class C extends d{}C.type="SessionTokenError";class P extends p{}P.type="OAuthSignInError";class T extends p{}T.type="EmailSignInError";class N extends d{}N.type="SignOutError";class I extends d{}I.type="UnknownAction";class M extends d{}M.type="UnsupportedStrategy";class O extends d{}O.type="InvalidProvider";class H extends d{}H.type="UntrustedHost";class X extends d{}X.type="Verification";class V extends p{}V.type="MissingCSRF";class W extends d{}W.type="DuplicateConditionalUI";class j extends d{}j.type="MissingWebAuthnAutocomplete";class $ extends d{}$.type="WebAuthnVerificationError";class D extends p{}D.type="AccountNotLinked";class F extends d{}F.type="ExperimentalFeatureNotEnabled";class B extends d{}class J extends d{}async function q(e,t,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r="".concat(t.basePath,"/").concat(e);try{var a;let e={headers:{"Content-Type":"application/json",...(null==n||null==(a=n.headers)?void 0:a.cookie)?{cookie:n.headers.cookie}:{}}};(null==n?void 0:n.body)&&(e.body=JSON.stringify(n.body),e.method="POST");let t=await fetch(r,e),s=await t.json();if(!t.ok)throw s;return s}catch(e){return s.error(new B(e.message,e)),null}}function z(){return Math.floor(Date.now()/1e3)}function G(e){let t=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e="https://".concat(e));let s=new URL(e||t),n=("/"===s.pathname?t.pathname:s.pathname).replace(/\/$/,""),r="".concat(s.origin).concat(n);return{origin:s.origin,host:s.host,path:n,base:r,toString:()=>r}}var K=s(95704);let Q={baseUrl:G(null!=(r=K.env.NEXTAUTH_URL)?r:K.env.VERCEL_URL).origin,basePath:G(K.env.NEXTAUTH_URL).path,baseUrlServer:G(null!=(o=null!=(a=K.env.NEXTAUTH_URL_INTERNAL)?a:K.env.NEXTAUTH_URL)?o:K.env.VERCEL_URL).origin,basePathServer:G(null!=(i=K.env.NEXTAUTH_URL_INTERNAL)?i:K.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:()=>{}},Y=null;function Z(){return"undefined"==typeof BroadcastChannel?{postMessage:()=>{},addEventListener:()=>{},removeEventListener:()=>{},name:"next-auth",onmessage:null,onmessageerror:null,close:()=>{},dispatchEvent:()=>!1}:new BroadcastChannel("next-auth")}function ee(){return null===Y&&(Y=Z()),Y}let et={debug:console.debug,error:console.error,warn:console.warn},es=null==(n=l.createContext)?void 0:n.call(u,void 0);function en(e){if(!es)throw Error("React Context is unavailable in Server Components");let t=l.useContext(es),{required:s,onUnauthenticated:n}=null!=e?e:{},r=s&&"unauthenticated"===t.status;return(l.useEffect(()=>
1{if(r){let e="".concat(Q.basePath,"/signin?").concat(new URLSearchParams({error:"SessionRequired",callbackUrl:window.location.href}));n?n():window.location.href=e}},[r,n]),r)?{data:t.data,update:t.update,status:"loading"}:t}async function er(e){var t;let s=await q("session",Q,et,e);return(null==(t=null==e?void 0:e.broadcast)||t)&&Z().postMessage({event:"session",data:{trigger:"getSession"}}),s}async function ea(){var e;let t=await q("csrf",Q,et);return null!=(e=null==t?void 0:t.csrfToken)?e:""}function eo(e){if(!es)throw Error("React Context is unavailable in Server Components");let{children:t,basePath:s,refetchInterval:n,refetchWhenOffline:r}=e;s&&(Q.basePath=s);let a=void 0!==e.session;Q._lastSync=a?z():0;let[o,i]=l.useState(()=>(a&&(Q._session=e.session),e.session)),[u,d]=l.useState(!a);l.useEffect(()=>(Q._getSession=async function(){let{event:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t="storage"===e;if(t||void 0===Q._session){Q._lastSync=z(),Q._session=await er({broadcast:!t}),i(Q._session);return}if(!e||null===Q._session||z()<Q._lastSync)return;Q._lastSync=z(),Q._session=await er(),i(Q._session)}catch(e){et.error(new J(e.message,e))}finally{d(!1)}},Q._getSession(),()=>{Q._lastSync=0,Q._session=void 0,Q._getSession=()=>{}}),[]),l.useEffect(()=>{let e=()=>Q._getSession({event:"storage"});return ee().addEventListener("message",e),()=>ee().removeEventListener("message",e)},[]),l.useEffect(()=>{let{refetchOnWindowFocus:t=!0}=e,s=()=>{t&&"visible"===document.visibilityState&&Q._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",s,!1),()=>document.removeEventListener("visibilitychange",s,!1)},[e.refetchOnWindowFocus]);let p=function(){let[e,t]=l.useState("undefined"!=typeof navigator&&navigator.onLine),s=()=>t(!0),n=()=>t(!1);return l.useEffect(()=>(window.addEventListener("online",s),window.addEventListener("offline",n),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",n)}),[]),e}(),h=!1!==r||p;l.useEffect(()=>{if(n&&h){let e=setInterval(()=>{Q._session&&Q._getSession({event:"poll"})},1e3*n);return()=>clearInterval(e)}},[n,h]);let v=l.useMemo(()=>({data:o,status:u?"loading":o?"authenticated":"unauthenticated",async update(e){if(u)return;d(!0);let t=await q("session",Q,et,void 0===e?void 0:{body:{csrfToken:await ea(),data:e}});return d(!1),t&&(i(t),ee().postMessage({event:"session",data:{trigger:"getSession"}})),t}}),[o,u]);return(0,c.jsx)(es.Provider,{value:v,children:t})}}}]);
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.