1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7769],{77769:(e,t,r)=>{r.d(t,{M:()=>ey});var n=r(95985);let o=Object.create(null),s=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),i=new Proxy(o,{get:(e,t)=>s()[t]??o[t],has:(e,t)=>t in s()||t in o,set:(e,t,r)=>(s(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=s(!0);return delete r[t],!0},ownKeys:()=>Object.keys(s(!0))});function l(e,t){return void 0!==n&&n.env?n.env[e]??t:"u">typeof Deno?Deno.env.get(e)??t:"u">typeof Bun?Bun.env[e]??t:t}i.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return l("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return l("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return l("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return l("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return l("NODE_ENV","development")},get PACKAGE_VERSION(){return l("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return l("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});let a={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};var u=class extends Error{status;body;headers;statusCode;constructor(e="INTERNAL_SERVER_ERROR",t,r={},n="number"==typeof e?e:a[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=r,this.statusCode=n,this.name="APIError",this.status=e,this.headers=r,this.statusCode=n,this.body=t}};Symbol.for("better-call:api-error-headers"),function(e,t){class r extends e{#e;constructor(...e){if(function(){let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,"writable")?e.writable:void 0!==e.set}()){const t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);const t=Error().stack;t&&(this.#e=function(e){let t=e.split("\n at ");return t.length<=1?e:(t.splice(1,1),t.join("\n at "))}(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}Object.defineProperty(r.prototype,"constructor",{get:()=>t,enumerable:!1,configurable:!0})}(u,Error);var c=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function f(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function p(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new c(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof c)throw t;throw new c(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(f(new URL(e).pathname)||"/")}catch{throw new c(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let r=f(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}let d={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},h=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,E={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},v=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,b=["javascript:","data:","vbscript:"],y={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&function(e){let t;try{t=new URL(e)}catch{return!0}return!b.includes(t.protocol)}(e.data.url)&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},g=(e,t,r,n)=>(e.events=e.events||{},e.events[r+10]||(e.events[r+10]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);n.splice(o,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])});function T(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function R(e,t){if(e===t)return!0;
1if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!R(e[r],t[r]))return!1;return!0}if(T(e)&&T(t)){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!(n in t)||!R(e[n],t[n]))return!1;return!0}return!1}let w=Symbol.for("better-auth:broadcast-channel");var O=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if("u">typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??"{}");t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function m(e="better-auth.message"){return globalThis[w]||(globalThis[w]=new O(e)),globalThis[w]}let _=Symbol.for("better-auth:focus-manager");var S=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if("u"<typeof window||"u"<typeof document||void 0===window.addEventListener)return()=>{};let e=()=>{"visible"===document.visibilityState&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function A(){return globalThis[_]||(globalThis[_]=new S),globalThis[_]}let L=Symbol.for("better-auth:online-manager");var U=class{listeners=new Set;isOnline="u"<typeof navigator||navigator.onLine;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function I(){return globalThis[L]||(globalThis[L]=new U),globalThis[L]}let N=()=>Math.floor(Date.now()/1e3),P=[],D=0,j=globalThis.nanostoresGlobal||={epoch:0},C=e=>{let t=[],r={eq:Object.is,get:()=>(r.lc||r.listen(()=>{})(),r.value),init:e,lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=D+4;t<P.length;)P[t]===e?P.splice(t,4):t+=4;let n=t.indexOf(e);~n&&(t.splice(n,1),--r.lc||r.off())}),notify(e,n){j.epoch++;let o=!P.length;for(let o of t)P.push(o,r,e,n);o&&(()=>{let e;for(D=0;D<P.length;D+=4)try{P[D](P[D+1].value,P[D+2],P[D+3])}catch(t){e=t}if(P.length=0,e)throw e})()},off(){},set(e){let t=r.value;r.eq(t,e)||(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r};function k(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function B(e,t){return R(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function x(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}function F(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,n=".",o){if(!x(r))return e(t,{},n,o);let s={...r};for(let r of Object.keys(t)){if("__proto__"===r||"constructor"===r)continue;let i=t[r];null!=i&&(o&&o(s,r,i,n)||(Array.isArray(i)&&Array.isArray(s[r])?s[r]=[...i,...s[r]]:x(i)&&x(s[r])?s[r]=e(i,s[r],(n?`${n}.`:"")+r.toString(),o):s[r]=i))}return s})(t,r,"",e),{})}let M=F();F((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),F((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0});var $=Object.defineProperty,H=Object.defineProperties,q=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,Y=(e,t,r)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q=(e,t)=>{for(var r in t||(t={}))V.call(t,r)&&Y(e,r,t[r]);if(G)for(var r of G(t))W.call(t,r)&&Y(e,r,t[r]);return e},J=(e,t)=>
1H(e,q(t)),K=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r,Error.captureStackTrace(this,this.constructor)}},X=async(e,t)=>{var r,n,o,s,i,l;let a=t||{},u={onRequest:[null==t?void 0:t.onRequest],onResponse:[null==t?void 0:t.onResponse],onSuccess:[null==t?void 0:t.onSuccess],onError:[null==t?void 0:t.onError],onRetry:[null==t?void 0:t.onRetry]};if(!t||!(null==t?void 0:t.plugins))return{url:e,options:a,hooks:u};for(let c of(null==t?void 0:t.plugins)||[]){if(c.init){let n=await (null==(r=c.init)?void 0:r.call(c,e.toString(),t));a=n.options||a,e=n.url}u.onRequest.push(null==(n=c.hooks)?void 0:n.onRequest),u.onResponse.push(null==(o=c.hooks)?void 0:o.onResponse),u.onSuccess.push(null==(s=c.hooks)?void 0:s.onSuccess),u.onError.push(null==(i=c.hooks)?void 0:i.onError),u.onRetry.push(null==(l=c.hooks)?void 0:l.onRetry)}return{url:e,options:a,hooks:u}},z=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},Z=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}},ee=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.username),r(e.auth.password)]);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.prefix),r(e.auth.value)]);if(!o)return t;t.authorization=`${null!=n?n:""} ${o}`}}return t},et=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function er(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}function en(e){try{return JSON.parse(e)}catch(t){return e}}function eo(e){return"function"==typeof e}function es(...e){let t={};for(let r of e)if(r)if(r instanceof Headers)r.forEach((e,r)=>{t[r]=e});else for(let[e,n]of Array.isArray(r)?r:Object.entries(r))null!=n&&(t[e]=n);return t}async function ei(e){let t=new Headers(es(null==e?void 0:e.headers,await ee(e)));if(!t.has("content-type")){let r=er(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var el=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function ea(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new el(r.issues);return r.value}var eu=["get","post","put","patch","delete"],ec=async(e,t)=>{var r,n,o,s,i,l,a,u;let c,{hooks:f,url:p,options:d}=await X(e,t),h=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&eo(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&eo(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(d),E=new AbortController,v=null!=(r=d.signal)?r:E.signal,b=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},s=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];eu.includes(t)&&(e=e.replace(`@${t}/`,"/"))}s.endsWith("/")||(s+="/");let[i,l]=e.replace(s,"").split("?"),a=new URLSearchParams(l);for(let[e,t]of Object.entries(o||{})){let r;if(null!=t){if("string"==typeof t)r=t;else if(Array.isArray(t)){for(let r of t)a.append(e,r);continue}else r=JSON.stringify(t);a.set(e,r)}}let u=new Map;if(n)if(Array.isArray(n))for(let[e,t]of i.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];u.set(t,String(r))}else for(let[e,t]of Object.entries(n))u.set(`:${e}`,String(t));i=(i=i.split("/").map(e=>(function(e,t){let r,n=e;for(let[e,r]of t)n=n.replace(e,r);if("."===(r=n)||".."===r)throw TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(n)})(e,u)).join("/")).replace(/^\/+/,"");let c=a.toString();return(c=c.length>0?`?${c}`.replace(/\+/g,"%20"):"",s.startsWith("http"))?new URL(`${i}${c}`,s):`${s}${i}${c}`}(p,d),y=await ei(d),g=function(e,t){let r,{body:n}=e;return n?er(n)&&"string"!=typeof n?"application/x-www-form-urlencoded"===((r=t.get("content-type"))?r.split(";")[0].trim().toLowerCase():null)?new URLSearchParams(n).toString():JSON.stringify(n):n:null}(d,y),T=function(e,t){var r;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let n=null==(r=e.split("@")[1])?void 0:r.split("/")[0];return eu.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(p,d),R=J(Q({},d),{url:b,headers:y,body:g,method:T,signal:v});for(let e of f.onRequest)if(e){let t=await e(R);"object"==typeof t&&null!==t&&Object.assign(R,t)}("pipeTo"in R&&"function"==typeof R.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pi
1pe))&&!("duplex"in R)&&(R.duplex="half");let{clearTimeout:w}=(!(null==d?void 0:d.signal)&&(null==d?void 0:d.timeout)&&(c=setTimeout(()=>null==E?void 0:E.abort(),null==d?void 0:d.timeout)),{abortTimeout:c,clearTimeout:()=>{c&&clearTimeout(c)}}),O=await h(R.url,R);w();let m={response:O,request:R};for(let e of f.onResponse)if(e){let r=await e(J(Q({},m),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?O.clone():O}));r instanceof Response?O=r:"object"==typeof r&&null!==r&&(O=r.response)}if(O.ok){if("HEAD"===R.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),r=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let n=t.split(";").shift()||"";return et.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(O),r={data:null,response:O,request:R};if("json"===e||"text"===e){let e=await O.text(),t=null!=(s=R.jsonParser)?s:en;r.data=await t(e)}else r.data=await O[e]();for(let e of((null==R?void 0:R.output)&&R.output&&!R.disableValidation&&(r.data=await ea(R.output,r.data)),f.onSuccess))e&&await e(J(Q({},r),{response:(null==(i=null==t?void 0:t.hookOptions)?void 0:i.cloneResponse)?O.clone():O}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let _=null!=(l=null==t?void 0:t.jsonParser)?l:en,S=await O.text(),A=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(S),L=A?await _(S):null,U={response:O,responseText:S,request:R,error:J(Q({},L),{status:O.status,statusText:O.statusText})};for(let e of f.onError)e&&await e(J(Q({},U),{response:(null==(a=null==t?void 0:t.hookOptions)?void 0:a.cloneResponse)?O.clone():O}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new z({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new z(e);case"exponential":return new Z(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;if(await r.shouldAttemptRetry(n,O)){for(let e of f.onRetry)e&&await e(m);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await ec(e,J(Q({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new K(O.status,O.statusText,A?L:S);return{data:null,error:J(Q({},L),{status:O.status,statusText:O.statusText})}},ef=r(95985);let ep=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,ed=/['\u2019]/g;function eh(e){return(e.replace(ed,"").match(ep)??[]).map(e=>e.toLowerCase()).join("-")}function eE(e,t){let r=t.split(".").flatMap(e=>(function e(t){if(ev.test(t)){let[,r,n]=t.match(ev);return[...e(r),n]}return[t]})(e)),n=e;for(let e of r){if(null==n)return;n=n[e]}return n}let ev=/(.*)\[(\d+)\]/;var eb=r(93433);function ey(e){var t;let{pluginPathMethods:r,pluginsActions:n,pluginsAtoms:o,$fetch:s,$store:l,atomListeners:a}=(e=>{var t,r;let n,o,s,l,a,u,f,b,T,w="credentials"in Request.prototype,O=function(e,t,r,n){if(e)return p(e,t);if(!1!==n){let e=i.BETTER_AUTH_URL||i.NEXT_PUBLIC_BETTER_AUTH_URL||i.PUBLIC_BETTER_AUTH_URL||i.NUXT_PUBLIC_BETTER_AUTH_URL||i.NUXT_PUBLIC_AUTH_URL||("/"!==i.BASE_URL?i.BASE_URL:void 0);if(e)return p(e,t)}r?.headers.get("x-forwarded-host"),r?.headers.get("x-forwarded-proto");if(r){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}(r.url);if(!e)throw new c("Could not get origin from request. Please provide a valid base URL.");return p(e,t)}if("u">typeof window&&window.location)return p(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,void 0)??(e=>{if(void 0!==ef){if(ef.env.NEXT_PUBLIC_AUTH_URL)return ef.env.NEXT_PUBLIC_AUTH_URL;if("u"<typeof window){if(ef.env.NEXTAUTH_URL)try{return ef.env.NEXTAUTH_URL}catch{}if(ef.env.VERCEL_URL)try{let t=ef.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${ef.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",_=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],S={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:L,onError:U,onRequest:P,onResponse:D,...j}=e?.fetchOptions||{},x=(t={baseURL:O,...w?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:o,parseDates:s=!0}=t;if("string"!=typeof e)return e;let i=e.trim(),l=i.toLowerCase();if(l.length<=9&&l in E)return E[l];
1if(!h.test(i)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(d).some(([e,t])=>{let r=t.test(i);return r&&n&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),r})&&r)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(i,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){n&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(s&&"string"==typeof t){let e=function(e){let t=v.exec(e);if(!t)return null;let[,r,n,o,s,i,l,a,u,c,f]=t,p=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(s,10),parseInt(i,10),parseInt(l,10),a?parseInt(a.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(f,10))*("+"===u?-1:1);p.setUTCMinutes(p.getUTCMinutes()+e)}return p instanceof Date&&!isNaN(p.getTime())?p:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...j,plugins:[S,...j.plugins||[],...e?.disableDefaultFetchPlugins?[]:[y],..._]},async function(e,r){let n,o=J(Q(Q({},t),r),{headers:es(null==t?void 0:t.headers,null==r?void 0:r.headers),plugins:[...(null==t?void 0:t.plugins)||[],(n=t||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,s,i;let l=(null==(o=null==(r=n.plugins)?void 0:r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(l){let r=e;(null==(s=l.config)?void 0:s.prefix)&&r.startsWith(l.config.prefix)&&(r=r.replace(l.config.prefix,""),l.config.baseURL&&(e=e.replace(l.config.prefix,l.config.baseURL))),(null==(i=l.config)?void 0:i.baseURL)&&r.startsWith(l.config.baseURL)&&(r=r.replace(l.config.baseURL,"")),r.startsWith("/")&&"@"===r.charAt(1)&&(r=r.substring(1));let n=l.schema[r];if(n){let r=null==t?void 0:t.headers;if(n.headers&&!(null==t?void 0:t.disableValidation)){let e={};if(null==t?void 0:t.headers){if(t.headers instanceof Headers)t.headers.forEach((t,r)=>{e[r.toLowerCase()]=t});else if("object"==typeof t.headers)for(let[r,n]of Object.entries(t.headers))null!=n&&(e[r.toLowerCase()]=n)}let o=await ea(n.headers,e),s={};for(let[e,t]of Object.entries(o))s[e.toLowerCase()]=t;r=s}let o=J(Q({},t),{method:n.method,output:n.output,headers:r});return(null==t?void 0:t.disableValidation)||(o=J(Q({},o),{body:n.input?await ea(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await ea(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await ea(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:o}}}return{url:e,options:t}}}),...(null==r?void 0:r.plugins)||[]]});if(null==t?void 0:t.catchAllError)try{return await ec(e,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await ec(e,o)}),{$sessionSignal:F,session:$,broadcastSessionUpdate:H}=(o=C(!1),s=0,l=0,o.listen(()=>{l++,s=0}),u=C({data:null,error:null,isPending:!0,isRefetching:!1,refetch:a=e=>b(e)}),g(u,({newValue:e,abort:t})=>{B(u.value,e)&&t()},2,e=>{let t=u.set,r=u.setKey;return u.setKey&&(u.setKey=(t,n)=>{let o;if(e({abort:()=>{o=!0},changed:t,newValue:{...u.value,[t]:n}}),!o)return r(t,n)}),u.set=r=>{let n;if(e({abort:()=>{n=!0},newValue:r}),!n)return t(r)},()=>{u.set=t,u.setKey=r}}),f=async(e,t)=>{let r=u.value;if(u.set({...r,isPending:null===r.data,isRefetching:!0,error:null,refetch:a}),e.aborted)return"aborted";try{var n;let r=await x("/get-session",{method:"GET",query:t?.query,signal:e});if(e.aborted)return"aborted";let{data:o,error:s}=k(r),i="fresh";if(o?.needsRefresh)try{let t=await x("/get-session",{method:"POST",signal:e});if(e.aborted)return"aborted";({data:o,error:s}=k(t))}catch{if(e.aborted)return"aborted";i="stale"}if(s){let e=u.value,t=s?.status===401;return u.set({data:t?null:e.data,error:s,isPending:!1,isRefetching:!1,refetch:a}),"failed"}let l=(n=o)&&(null!==n.session||null!==n.user)?n:null,c=u.value,f=null!=c.data&&null!=l&&R(c.data,l)?c.data:l;return u.set({data:f,error:null,isPending:!1,isRefetching:!1,refetch:a}),i}catch(r){if(e.aborted)return"aborted";let t=u.value;return u.set({data:t.data,error:r,isPending:!1,isRefetching:!1,refetch:a}),"failed"}},b=e=>{s=0,n?.cancel();let t=new AbortController,r={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?"aborted":f(t.signal,e)),revision:l};n=r;let o=e=>{if(n===r){let t,o;n=void 0,"fresh"===e&&r.revision===l&&(o=(t=u.value.data?.session?.expiresAt)instanceof Date?t.getTime():1/0,s=Math.min(Date.now()+1e3,o))}};return r.promise.then(o,()=>o("failed")),r.promise.then(()=>void 0)},T=()=>{},r=()=>{let t;"u"<typeof window||(t=setTimeout(()=>{n?.revision===l?n.promise.then(()=>void 0):Date.now()<s?Promise.resolve():b()},0));let r=function(e){let{fetchSession:t,shouldPollSession:r=()=>!0,sessionSignal:n,options:o={}}=e,s=o.sessionOptions?.refetchInterval??0,i=o.sessionOptions?.refetchOnWindowFocus??!0,l=o.sessionOptions?.refetchWhenOffline??!1,a={isInitialized:!1,lastSessionRequest:0},u=e=>{if(l||I().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){a.lastSessionRequest=N(),t();return}if(e?.event==="visibilitychange"){if(N()-a.lastSessionRequest<5)return;a.lastSessionRequest=N(),t();return}t()}};return{init:()=>{a.isInitialized||(a.isInitialized=!0,s&&s>0&&(a.pollInterval=setInterval(()=>{r()&&u({event:"poll"})},1e3*s)),a.unsubscribeBroadcast=m().subscribe(()=>{u({event:"storage"})}),i&&(a.unsubscribeFocus=A().subscribe(()=>{u({event:"visibilitychange"})})),a.unsubscribeOnline=I().subscribe(e=>{e&&u({event:"visibilitychange"})}),a.unsubscribeSignal=n.listen(()=>{t()}),a.cleanupBroadcastSetup=m().setup(),a.cleanupFocusSetup=A().setup(),a.cleanupOnlineSetup=I().setup())},cleanup:()=>{a.isInitialized&&(a.pollInterval&&(clearInterval(a.pollInterval),a.pollInterval=void 0),a.unsubscribeBroadcast&&(a.unsubscribeBroadcast(),a.unsubscribeBroadcast=void 0),a.unsubscribeFocus&&(a.unsubscribeFocus(),a.unsubscribeFocus=void 0),a.unsubscribeOnline&&(a.unsubscribeOnline(),a.unsubscribeOnline=void 0),a.unsubscribeSignal&&(a.unsubscribeSignal(),a.unsubscribeSignal=void 0),a.cleanupBroadcastSetup&&(a.cleanupBroadcastSetup(),a.cleanupBroadcastSetup=void 0),a.cleanupFocusSetup&&(a.cleanupFocusSetup(),a.cleanupFocusSetup=void 0),a.cleanupOnlineSetup&&(a.cleanupOnlineSetup(),a.cleanupOnlineSetup=void 0),a.isInitialized=!1,a.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:e=>{m().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:b,shouldPollSession:()=>null!=u.value.data,sessionSignal:o,options:e});return r.init(),T=r.broadcastSessionUpdate,()=>{t&&clearTimeout(t),r.cleanup()}},g(u,e=>{let t=r(e);t&&u.events[6].push(t)},5,e=>{let t=u.listen;u.listen=(...r)=>(u.lc||u.active||(u.active=!0,e()),t(...r));let r=u.off;return u.events[6]=[],u.off=()=>{r(),setTimeout(()=>{if(u.active&&!u.lc){for(let e of(u.active=!1,u.events[6]))e();u.events[6]=[]}},1e3)},()=>{u.listen=t,u.off=r}}),{session:u,$sessionSignal:o,broadcastSessionUpdate:e=>T(e)}),q=e?.plugins||[],G={},V={$sessionSignal:F,session:$}
1,W={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},Y=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||"/update-session"===e||"/sign-up/email"===e||"/sign-in/email"===e||"/delete-user"===e||"/verify-email"===e||"/revoke-sessions"===e||"/revoke-session"===e||"/revoke-other-sessions"===e||"/change-email"===e||"/change-password"===e,callback(e){"/sign-out"===e?H("signout"):("/update-user"===e||"/update-session"===e)&&H("updateUser")}}];for(let e of q)e.getAtoms&&Object.assign(V,e.getAtoms?.(x)),e.pathMethods&&Object.assign(W,e.pathMethods),e.atomListeners&&Y.push(...e.atomListeners);let K={notify:e=>{V[e].set(!V[e].get())},listen:(e,t)=>{V[e].subscribe(t)},atoms:V};for(let t of q)t.getActions&&(G=M(t.getActions?.(x,K,e)??{},G));return{get baseURL(){return O},pluginsActions:G,pluginsAtoms:V,pluginPathMethods:W,atomListeners:Y,$fetch:x,$store:K}})(e),u={};for(let[e,t]of Object.entries(o))u[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let r=(0,eb.useRef)(e.get()),{keys:n,deps:o=[e,n]}=t,s=(0,eb.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n),e.listen((e,r,s)=>{(void 0===s?n.some(t=>e[t]!==r[t]||eE(e,t)!==eE(r,t)):t.has(s)||t.has(s.split(/\.|\[/)[0]))&&o(e,r,s)})}return e.listen(o)},o),i=()=>r.current;return(0,eb.useSyncExternalStore)(s,i,i)})(t);return t={...n,...u,$fetch:s,$store:l},function e(n=[]){return new Proxy(function(){},{get(r,o){var s;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let i=[...n,o],l=t;for(let e of i)if(l&&"object"==typeof l&&e in l)l=l[e];else{l=void 0;break}return"function"==typeof l?l:"object"==typeof(s=l)&&null!==s&&"get"in s&&"function"==typeof s.get&&"lc"in s&&"number"==typeof s.lc?l:e(i)},apply:async(e,t,i)=>{let l="/"+n.map(eh).join("/"),u=i[0]||{},c=i[1]||{},{query:f,fetchOptions:p,...d}=u,h={...c,...p},E=function(e,t,r){let n=t[e],{fetchOptions:o,query:s,...i}=r||{};return n||(o?.method?o.method:i&&Object.keys(i).length>0?"POST":"GET")}(l,r,u);return await s(l,{...h,body:"GET"===E?void 0:{...d,...h?.body||{}},query:f||h?.query,method:E,async onSuccess(e){if(await h?.onSuccess?.(e),!a||h.disableSignal)return;let t=a.filter(e=>e.matcher(l));if(!t.length)return;let r=new Set;for(let e of t){let t=o[e.signal];if(!t)return;if(r.has(e.signal))continue;r.add(e.signal);let n=t.get();setTimeout(()=>{t.set(!n)},10),e.callback?.(l)}}})}})}()}}}]);
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.