1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[856],{20063:(e,t,n)=>{var s=n(47260);n.o(s,"useSearchParams")&&n.d(t,{useSearchParams:function(){return s.useSearchParams}}),n.o(s,"useServerInsertedHTML")&&n.d(t,{useServerInsertedHTML:function(){return s.useServerInsertedHTML}})},96199:(e,t,n)=>{n.d(t,{Ht:()=>Z,Jv:()=>en,CI:()=>es}),n(95155);var s,r,a,o,c,l=n(12115),i=n.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 n=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?". ":""}Read more at ${n}`}}class u extends d{}u.kind="signIn";class p extends d{}p.type="AdapterError";class h extends d{}h.type="AccessDenied";class y extends d{}y.type="CallbackRouteError";class w extends d{}w.type="ErrorPageLoop";class v extends d{}v.type="EventError";class g extends d{}g.type="InvalidCallbackUrl";class f extends u{constructor(){super(...arguments),this.code="credentials"}}f.type="CredentialsSignin";class x extends d{}x.type="InvalidEndpoints";class E extends d{}E.type="InvalidCheck";class U extends d{}U.type="JWTSessionError";class m extends d{}m.type="MissingAdapter";class S extends d{}S.type="MissingAdapterMethods";class b extends d{}b.type="MissingAuthorize";class k extends d{}k.type="MissingSecret";class L extends u{}L.type="OAuthAccountNotLinked";class A extends u{}A.type="OAuthCallbackError";class R extends d{}R.type="OAuthProfileParseError";class T extends d{}T.type="SessionTokenError";class C extends u{}C.type="OAuthSignInError";class P extends u{}P.type="EmailSignInError";class _ extends d{}_.type="SignOutError";class N extends d{}N.type="UnknownAction";class I extends d{}I.type="UnsupportedStrategy";class M extends d{}M.type="InvalidProvider";class H extends d{}H.type="UntrustedHost";class X extends d{}X.type="Verification";class O extends u{}O.type="MissingCSRF";class j extends d{}j.type="DuplicateConditionalUI";class W extends d{}W.type="MissingWebAuthnAutocomplete";class V extends d{}V.type="WebAuthnVerificationError";class $ extends u{}$.type="AccountNotLinked";class J extends d{}J.type="ExperimentalFeatureNotEnabled";class B extends d{}async function D(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r="".concat(F(t),"/").concat(e);try{var a;let e={headers:{"Content-Type":"application/json",...(null==s||null==(a=s.headers)?void 0:a.cookie)?{cookie:s.headers.cookie}:{}}};(null==s?void 0:s.body)&&(e.body=JSON.stringify(s.body),e.method="POST");let t=await fetch(r,e),n=await t.json();if(!t.ok)throw n;return n}catch(e){return n.error(new B(e.message,e)),null}}function F(e){return e.basePath}function z(e){let t=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e="https://".concat(e));let n=new URL(e||t),s=("/"===n.pathname?t.pathname:n.pathname).replace(/\/$/,""),r="".concat(n.origin).concat(s);return{origin:n.origin,host:n.host,path:s,base:r,toString:()=>r}}var q=n(87358);let G={baseUrl:z(null!=(r=q.env.NEXTAUTH_URL)?r:q.env.VERCEL_URL).origin,basePath:z(q.env.NEXTAUTH_URL).path,baseUrlServer:z(null!=(o=null!=(a=q.env.NEXTAUTH_URL_INTERNAL)?a:q.env.NEXTAUTH_URL)?o:q.env.VERCEL_URL).origin,basePathServer:z(null!=(c=q.env.NEXTAUTH_URL_INTERNAL)?c:q.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:()=>{}},K=null;function Q(){return"undefined"==typeof BroadcastChannel?{postMessage:()=>{},addEventListener:()=>{},removeEventListener:()=>{},name:"next-auth",onmessage:null,onmessageerror:null,close:()=>{},dispatchEvent:()=>!1}:new BroadcastChannel("next-auth")}let Y={debug:console.debug,error:console.error,warn:console.warn};async function Z(e){var t;let n=await D("session",G,Y,e);return(null==(t=null==e?void 0:e.broadcast)||t)&&Q().postMessage({event:"session",data:{trigger:"getSession"}}),n}async function ee(){var e;let t=await D("csrf",G,Y);return null!=(e=null==t?void 0:t.csrfToken)?e:""}async function et(){return D("providers",G,Y)}
1async function en(e,t,n){var s,r,a;let{callbackUrl:o,...c}=null!=t?t:{},{redirect:l=!0,redirectTo:i=null!=o?o:window.location.href,...d}=c,u=F(G),p=await et();if(!p){window.location.href="".concat(u,"/error");return}if(!e||!p[e]){let e="".concat(u,"/signin?").concat(new URLSearchParams({callbackUrl:i}));window.location.href=e;return}let h=p[e].type;if("webauthn"===h)throw TypeError(['Provider id "'.concat(e,'" refers to a WebAuthn provider.'),'Please use `import { signIn } from "next-auth/webauthn"` instead.'].join("\n"));let y="".concat(u,"/").concat("credentials"===h?"callback":"signin","/").concat(e),w=await ee(),v=await fetch("".concat(y,"?").concat(new URLSearchParams(n)),{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({...d,csrfToken:w,callbackUrl:i})}),g=await v.json();if(l){let e=null!=(s=g.url)?s:i;window.location.href=e,e.includes("#")&&window.location.reload();return}let f=null!=(r=new URL(g.url).searchParams.get("error"))?r:void 0,x=null!=(a=new URL(g.url).searchParams.get("code"))?a:void 0;return v.ok&&await G._getSession({event:"storage"}),{error:f,code:x,status:v.status,ok:v.ok,url:f?null:g.url}}async function es(e){var t,n;let{redirect:s=!0,redirectTo:r=null!=(t=null==e?void 0:e.callbackUrl)?t:window.location.href}=null!=e?e:{},a=F(G),o=await ee(),c=await fetch("".concat(a,"/signout"),{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({csrfToken:o,callbackUrl:r})}),l=await c.json();if((null===K&&(K=Q()),K).postMessage({event:"session",data:{trigger:"signout"}}),s){let e=null!=(n=l.url)?n:r;window.location.href=e,e.includes("#")&&window.location.reload();return}return await G._getSession({event:"storage"}),l}null==(s=l.createContext)||s.call(i,void 0)}}]);
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.