1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,701178,(e,t,r)=>{let n;{let e=e=>function(){throw Error(`\`${e}\` is only available in a Server Component.`)};n={unstable_cache:function(e){return"function"!=typeof e?e:function(){return e.apply(this,arguments)}},unstable_noStore:function(){},updateTag:e("updateTag"),revalidateTag:e("revalidateTag"),revalidatePath:e("revalidatePath"),refresh:e("refresh"),cacheLife:e("cacheLife"),cacheTag:e("cacheTag")}}let i=!1,a=!1;n.unstable_cacheLife=function(){return i||(i=!0,console.error(Error("`unstable_cacheLife` was recently stabilized and should be imported as `cacheLife`. The `unstable` prefixed form will be removed in a future version of Next.js."))),n.cacheLife.apply(this,arguments)},n.unstable_cacheTag=function(){return a||(a=!0,console.error(Error("`unstable_cacheTag` was recently stabilized and should be imported as `cacheTag`. The `unstable` prefixed form will be removed in a future version of Next.js."))),n.cacheTag.apply(this,arguments)},t.exports=n,r.unstable_cache=n.unstable_cache,r.revalidatePath=n.revalidatePath,r.revalidateTag=n.revalidateTag,r.updateTag=n.updateTag,r.unstable_noStore=n.unstable_noStore,r.cacheLife=n.cacheLife,r.unstable_cacheLife=n.unstable_cacheLife,r.cacheTag=n.cacheTag,r.unstable_cacheTag=n.unstable_cacheTag,r.refresh=n.refresh},449910,(e,t,r)=>{"use strict";var n=e.i(247167);Object.defineProperty(r,"__esModule",{value:!0}),r.getPublicEnv=function(){return Object.keys(n.default.env).filter(e=>/^NEXT_PUBLIC_/i.test(e)).reduce((e,t)=>({...e,[t]:n.default.env[t]}),{})}},860270,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PublicEnvProvider=void 0;let n=e.r(843476),i=e.r(701178),a=e.r(449910),o=e.r(610294);r.PublicEnvProvider=({children:e})=>{(0,i.unstable_noStore)();let t=(0,a.getPublicEnv)();return(0,n.jsx)(o.EnvProvider,{env:t,children:e})}},752058,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.useEnvContext=r.PublicEnvProvider=r.EnvProvider=void 0;var n=e.r(610294);Object.defineProperty(r,"EnvProvider",{enumerable:!0,get:function(){return n.EnvProvider}});var i=e.r(860270);Object.defineProperty(r,"PublicEnvProvider",{enumerable:!0,get:function(){return i.PublicEnvProvider}});var a=e.r(423865);Object.defineProperty(r,"useEnvContext",{enumerable:!0,get:function(){return a.useEnvContext}})},377758,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PUBLIC_ENV_KEY=void 0,r.PUBLIC_ENV_KEY="__ENV"},950446,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isBrowser=function(){return!!("u">typeof window&&window[n.PUBLIC_ENV_KEY])};let n=e.r(377758)},680448,(e,t,r)=>{"use strict";var n=e.i(247167);Object.defineProperty(r,"__esModule",{value:!0}),r.env=function(e){if((0,a.isBrowser)()){if(!e.startsWith("NEXT_PUBLIC_"))throw Error(`Environment variable '${e}' is not public and cannot be accessed in the browser.`);return window[o.PUBLIC_ENV_KEY][e]}return(0,i.unstable_noStore)(),n.default.env[e]};let i=e.r(701178),a=e.r(950446),o=e.r(377758)},3303,(e,t,r)=>{t.exports=e.r(479520)},207880,(e,t,r)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.EnvScript=void 0;
1let i=e.r(843476),a=n(e.r(3303)),o=e.r(377758);r.EnvScript=({env:e,nonce:t,disableNextScript:r=!1,nextScriptProps:n={strategy:"beforeInteractive"}})=>{let s;"string"==typeof t&&(s=t);let c={__html:`window['${o.PUBLIC_ENV_KEY}'] = ${JSON.stringify(e)}`};return r?(0,i.jsx)("script",{nonce:s,dangerouslySetInnerHTML:c}):(0,i.jsx)(a.default,{...n,nonce:s,dangerouslySetInnerHTML:c})}},835481,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PublicEnvScript=void 0;let n=e.r(843476),i=e.r(701178),a=e.r(449910),o=e.r(207880);r.PublicEnvScript=({nonce:e,disableNextScript:t,nextScriptProps:r})=>{(0,i.unstable_noStore)();let s=(0,a.getPublicEnv)();return(0,n.jsx)(o.EnvScript,{env:s,nonce:e,disableNextScript:t,nextScriptProps:r})}},351477,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PublicEnvScript=r.EnvScript=r.env=r.PUBLIC_ENV_KEY=void 0;var n=e.r(377758);Object.defineProperty(r,"PUBLIC_ENV_KEY",{enumerable:!0,get:function(){return n.PUBLIC_ENV_KEY}});var i=e.r(680448);Object.defineProperty(r,"env",{enumerable:!0,get:function(){return i.env}});var a=e.r(207880);Object.defineProperty(r,"EnvScript",{enumerable:!0,get:function(){return a.EnvScript}});var o=e.r(835481);Object.defineProperty(r,"PublicEnvScript",{enumerable:!0,get:function(){return o.PublicEnvScript}})},203176,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.bgWhite=r.bgCyan=r.bgMagenta=r.bgBlue=r.bgYellow=r.bgGreen=r.bgRed=r.bgBlack=r.gray=r.white=r.cyan=r.purple=r.magenta=r.blue=r.yellow=r.green=r.red=r.black=r.strikethrough=r.hidden=r.inverse=r.underline=r.italic=r.dim=r.bold=r.reset=void 0;let{env:n,stdout:i}=globalThis?.process??{},a=n&&!n.NO_COLOR&&(n.FORCE_COLOR||i?.isTTY&&!n.CI&&"dumb"!==n.TERM),o=(e,t,r,n)=>{let i=e.substring(0,n)+r,a=e.substring(n+t.length),s=a.indexOf(t);return~s?i+o(a,t,r,s):i+a},s=(e,t,r=e)=>n=>{let i=""+n,a=i.indexOf(t,e.length);return~a?e+o(i,t,r,a)+t:e+i+t};r.reset=a?e=>`\x1b[0m${e}\x1b[0m`:String,r.bold=a?s("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"):String,r.dim=a?s("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"):String,r.italic=a?s("\x1b[3m","\x1b[23m"):String,r.underline=a?s("\x1b[4m","\x1b[24m"):String,r.inverse=a?s("\x1b[7m","\x1b[27m"):String,r.hidden=a?s("\x1b[8m","\x1b[28m"):String,r.strikethrough=a?s("\x1b[9m","\x1b[29m"):String,r.black=a?s("\x1b[30m","\x1b[39m"):String,r.red=a?s("\x1b[31m","\x1b[39m"):String,r.green=a?s("\x1b[32m","\x1b[39m"):String,r.yellow=a?s("\x1b[33m","\x1b[39m"):String,r.blue=a?s("\x1b[34m","\x1b[39m"):String,r.magenta=a?s("\x1b[35m","\x1b[39m"):String,r.purple=a?s("\x1b[38;2;173;127;168m","\x1b[39m"):String,r.cyan=a?s("\x1b[36m","\x1b[39m"):String,r.white=a?s("\x1b[37m","\x1b[39m"):String,r.gray=a?s("\x1b[90m","\x1b[39m"):String,r.bgBlack=a?s("\x1b[40m","\x1b[49m"):String,r.bgRed=a?s("\x1b[41m","\x1b[49m"):String,r.bgGreen=a?s("\x1b[42m","\x1b[49m"):String,r.bgYellow=a?s("\x1b[43m","\x1b[49m"):String,r.bgBlue=a?s("\x1b[44m","\x1b[49m"):String,r.bgMagenta=a?s("\x1b[45m","\x1b[49m"):String,r.bgCyan=a?s("\x1b[46m","\x1b[49m"):String,r.bgWhite=a?s("\x1b[47m","\x1b[49m"):String},928334,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.prefixLevels=r.prefixes=void 0,r.error=function(e,t){a("error",e,t)},r.warn=function(e,t){a("warn",e,t)},r.info=function(e,t){a("info",e,t)},r.event=function(e,t){a("event",e,t)};let n=e.r(203176);r.prefixes={error:(0,n.red)((0,n.bold)("⨯")),warn:(0,n.yellow)((0,n.bold)("â ")),info:(0,n.white)((0,n.bold)(" ")),event:(0,n.green)((0,n.bold)("â"))},r.prefixLevels={silent:1/0,error:40,warn:30,info:20,event:10};let i={log:"log",warn:"warn",error:"error"};function a(e,t,n){let{logLevel:a="event"}=n||{};if(r.prefixLevels[e]<r.prefixLevels[a])return;let o=e in i?i[e]:"log",s=r.prefixes[e];console[o](` ${s}`,t,"(next-runtime-env)")}},298342,(e,t,r)=>{"use strict";var n=e.i(247167);Object.defineProperty(r,"__esModule",{value:!0}),r.makeEnvPublic=function(e,t){"string"==typeof e?a(e,t):e.forEach(e=>a(e,t))};let i=e.r(928334);function a(e,t){if(!n.default.env[e])return void(0,i.warn)(`Skipped prefixing environment variable '${e}'. Variable not in process.env`,t);/^NEXT_PUBLIC_/i.test(e)&&(0,i.warn)(`Environment variable '${e}' is already public`,t);
1let r=`NEXT_PUBLIC_${e}`;n.default.env[r]=n.default.env[e],(0,i.event)(`Prefixed environment variable '${e}'`,t)}},204400,(e,t,r)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.makeEnvPublic=void 0,i(e.r(752058),r),i(e.r(351477),r);var a=e.r(298342);Object.defineProperty(r,"makeEnvPublic",{enumerable:!0,get:function(){return a.makeEnvPublic}})},741857,945168,464880,e=>{"use strict";var t=e.i(247167),r=e.i(204400);function n(){return!1}function i(e){if(!n()){if(!e.startsWith("NEXT_PUBLIC_"))throw Error(`Environment variable '${e}' is not public and cannot be accessed in the browser.`);return window[r.PUBLIC_ENV_KEY][e]}}function a(){return{domain:i("NEXT_PUBLIC_DOMAIN")??"",version:t.default.env.APP_VERSION??"",siteURl:i("NEXT_PUBLIC_SITE_URL")??"",enableAnalytics:t.default.env.ENABLE_ANALYTICS??i("NEXT_PUBLIC_ENABLE_ANALYTICS")??"",bench:i("NEXT_PUBLIC_BENCH")??"",api:{url:t.default.env.API_URL??i("NEXT_PUBLIC_API_URL")??""},bytelApi:{url:t.default.env.B2R_URL??i("NEXT_PUBLIC_B2R_URL")??""},sapi:{url:t.default.env.SAPI_URL??i("NEXT_PUBLIC_SAPI_URL")??""},sapic:{url:t.default.env.SAPIC_URL??i("NEXT_PUBLIC_SAPIC_URL")??""},widget:{faiEligibilityWidget:{src:i("NEXT_PUBLIC_FAI_ELIGIBILITY_WIDGET")??""}},proxy:{url:t.default.env.PROXY_URL},prisme:{url:i("NEXT_PUBLIC_PRISME_URL")??"",active:t.default.env.LOG_PRISME_ACTIVE?"true"===t.default.env.LOG_PRISME_ACTIVE:"true"===i("NEXT_PUBLIC_LOG_PRISME_ACTIVE"),authorizeUrls:[i("NEXT_PUBLIC_DOMAIN"),i("NEXT_PUBLIC_SAPIC_URL"),i("NEXT_PUBLIC_SAPI_URL"),i("NEXT_PUBLIC_BYTEL_API"),i("NEXT_PUBLIC_FAQ_API_URL"),"/webapi/"].filter(e=>void 0!==e)},oauth2:{clientId:i("NEXT_PUBLIC_OAUTH2_CLIENT_ID")??"",scope:i("NEXT_PUBLIC_OAUTH2_SCOPE")??"",url:i("NEXT_PUBLIC_OAUTH2_URL")??"",authorizationUrl:i("NEXT_PUBLIC_OAUTH2_AUTHORIZATION_URL")??"",tokenUrl:t.default.env.OAUTH2_TOKEN_URL,userInfoUrl:t.default.env.OAUTH2_USERINFO_URL,tgtUrl:i("NEXT_PUBLIC_OAUTH2_TGT_URL")??"",tgtCallbackUrl:i("NEXT_PUBLIC_OAUTH2_TGT_CALLBACK")??""},assets:{images:{url:i("NEXT_PUBLIC_ASSETS_IMAGES")??""},cms:{url:t.default.env.ASSETS_CMS??i("NEXT_PUBLIC_ASSETS_CMS")??""},partials:{url:t.default.env.PARTIALS_URL??i("NEXT_PUBLIC_PARTIALS_URL")??""},sliders:{script:i("NEXT_PUBLIC_ASSETS_SLIDERS_SCRIPT")??""},palpatine:{plans:t.default.env.PALPATINE_FORFAITS_API??i("NEXT_PUBLIC_PALPATINE_FORFAITS_API")??"",nuggets:i("NEXT_PUBLIC_CE_CHECKOUT_API_BASE_URL")??"",mediaLibrary:i("NEXT_PUBLIC_PALPATINE_MEDIA_LIBRARY")??"",checkoutApi:i("NEXT_PUBLIC_PALPATINE_CHECKOUT_API")??"",fai:i("NEXT_PUBLIC_PALPATINE_FAI_API")??""}},tracking:{env:i("NEXT_PUBLIC_TRACKING_ENV"),enabled:"true"===i("NEXT_PUBLIC_TRACKING_ENABLED"),host:i("NEXT_PUBLIC_TRACKING_HOST")??"",debug:"true"===i("NEXT_PUBLIC_TRACKING_DEBUG"),universe:i("NEXT_PUBLIC_TRACKING_UNIVERSE")??""},thumbor:{active:"true"===i("NEXT_PUBLIC_THUMBOR_ACTIVE"),url:i("NEXT_PUBLIC_THUMBOR_URL")??""},logger:{http:{prisme:"true"===t.default.env.LOG_PRISME_ACTIVE,logCached:"true"===t.default.env.LOG_HTTP_CACHED}},cache:{ttl:{products:i("NEXT_PUBLIC_CACHE_TTL_PRODUCTS")??"",cms:i("NEXT_PUBLIC_CACHE_TTL_CMS")??"",user:i("NEXT_PUBLIC_CACHE_TTL_USER")??"",config:i("NEXT_PUBLIC_CACHE_TTL_CONFIG")??""}},googleMaps:{apiKey:i("NEXT_PUBLIC_GOOGLE_MAPS_API_KEY")??""},siteRootUrl:{url:t.default.env.SITE_URL??i("NEXT_PUBLIC_SITE_URL")??""},axios:{timeout:parseInt(i("NEXT_PUBLIC_AXIOS_TIMEOUT")??"",10)},options:{parentalControlFree:"11148,72155553",parentalControlPremium:"13667,72155390"},rfe:{enabled:"true"===i("NEXT_PUBLIC_RFE_ENABLED")},yamaReferrers:i("NEXT_PUBLIC_YAMA_REFERRERS")?.split(",")??[]}}e.s(["env",0,i,"isServer",0,n],945168),e.s(["generateConfig",0,a,"isServer",0,()=>!1],464880),e.s(["getAppConfig",0,()=>a()],741857)},957645,(e,t,r)=>{"use strict";function n(e,t,r){if(e){for(let n of(r&&(r=r.toLowerCase()),e))if(t===n.domain?.split(":",1)[0].toLowerCase()||r===n.defaultLocale.toLowerCase()||n.locales?.some(e=>e.toLowerCase()===r))return n}}
1Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"detectDomainLocale",{enumerable:!0,get:function(){return n}})},152539,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"addPathSuffix",{enumerable:!0,get:function(){return i}});let n=e.r(572463);function i(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:i,hash:a}=(0,n.parsePath)(e);return`${r}${t}${i}${a}`}},95524,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"addLocale",{enumerable:!0,get:function(){return a}});let n=e.r(541858),i=e.r(59084);function a(e,t,r,a){if(!t||t===r)return e;let o=e.toLowerCase();return!a&&((0,i.pathHasPrefix)(o,"/api")||(0,i.pathHasPrefix)(o,`/${t.toLowerCase()}`))?e:(0,n.addPathPrefix)(e,`/${t}`)}},230283,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"formatNextPathnameInfo",{enumerable:!0,get:function(){return s}});let n=e.r(938281),i=e.r(541858),a=e.r(152539),o=e.r(95524);function s(e){let t=(0,o.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,a.addPathSuffix)((0,i.addPathPrefix)(t,`/_next/data/${e.buildId}`),"/"===e.pathname?"index.json":".json")),t=(0,i.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:(0,a.addPathSuffix)(t,"/"):(0,n.removeTrailingSlash)(t)}},513079,(e,t,r)=>{"use strict";function n(e,t){let r;if(t?.host&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getHostname",{enumerable:!0,get:function(){return n}})},927711,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"normalizeLocalePath",{enumerable:!0,get:function(){return i}});let n=new WeakMap;function i(e,t){let r;if(!t)return{pathname:e};let i=n.get(t);i||(i=t.map(e=>e.toLowerCase()),n.set(t,i));let a=e.split("/",2);if(!a[1])return{pathname:e};let o=a[1].toLowerCase(),s=i.indexOf(o);return s<0?{pathname:e}:(r=t[s],{pathname:e=e.slice(r.length+1)||"/",detectedLocale:r})}},657979,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"removePathPrefix",{enumerable:!0,get:function(){return i}});let n=e.r(59084);function i(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:`/${r}`}},283605,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getNextPathnameInfo",{enumerable:!0,get:function(){return o}});let n=e.r(927711),i=e.r(657979),a=e.r(59084);function o(e,t){let{basePath:r,i18n:o,trailingSlash:s}=t.nextConfig??{},c={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):s};r&&(0,a.pathHasPrefix)(c.pathname,r)&&(c.pathname=(0,i.removePathPrefix)(c.pathname,r),c.basePath=r);let l=c.pathname;if(c.pathname.startsWith("/_next/data/")&&c.pathname.endsWith(".json")){let e=c.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");c.buildId=e[0],l="index"!==e[1]?`/${e.slice(1).join("/")}`:"/",!0===t.parseData&&(c.pathname=l)}if(o){let e=t.i18nProvider?t.i18nProvider.analyze(c.pathname):(0,n.normalizeLocalePath)(c.pathname,o.locales);c.locale=e.detectedLocale,c.pathname=e.pathname??c.pathname,!e.detectedLocale&&c.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(l):(0,n.normalizeLocalePath)(l,o.locales)).detectedLocale&&(c.locale=e.detectedLocale)}return c}},973670,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NextURL",{enumerable:!0,get:function(){return u}});let n=e.r(957645),i=e.r(230283),a=e.r(513079),o=e.r(283605),s=/^(?:127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)$/;function c(e,t){let r=new URL(String(e),t&&String(t));return s.test(r.hostname)&&(r.hostname="localhost"),r}let l=Symbol("NextURLInternal");class u{constructor(e,t,r){let n,i;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,i=r||{}):i=r||t||{},this[l]={url:c(e,n??i.base),options:i,basePath:""},this.analyze()}analyze(){var e,t,r,i,s;let c=(0,o.getNextPathnameInfo)(this[l].url.pathname,{nextConfig:this[l].options.nextConfig,parseData:!0,i18nProvider:this[l].options.i18nProvider}),u=(0,a.getHostname)(this[l].url,this[l].options.headers);this[l].domainLocale=this[l].options.i18nProvider?this[l].options.i18nProvider.detectDomainLocale(u):(0,n.detectDomainLocale)(null==(t=this[l].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,u);let d=(null==(r=this[l].domainLocale)?void 0:r.defaultLocale)||(null==(s=this[l].options.nextConfig)||null==(i=s.i18n)?void 0:i.defaultLocale);this[l].url.pathname=c.pathname,this[l].defaultLocale=d,this[l].basePath=c.basePath??"",this[l].buildId=c.buildId,this[l].locale=c.locale??d,this[l].trailingSlash=c.trailingSlash}formatPathname(){return(0,i.formatNextPathnameInfo)({basePath:this[l].basePath,buildId:this[l].buildId,defaultLocale:this[l].options.forceLocale?void 0:this[l].defaultLocale,locale:this[l].locale,pathname:this[l].url.pathname,trailingSlash:this[l].trailingSlash})}formatSearch(){return this[l].url.search}get buildId(){return this[l].buildId}set buildId(e){this[l].buildId=e}get locale(){return this[l].locale??""}set locale(e){var t,r;if(!this[l].locale||!(null==(r=this[l].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}
1"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[l].locale=e}get defaultLocale(){return this[l].defaultLocale}get domainLocale(){return this[l].domainLocale}get searchParams(){return this[l].url.searchParams}get host(){return this[l].url.host}set host(e){this[l].url.host=e}get hostname(){return this[l].url.hostname}set hostname(e){this[l].url.hostname=e}get port(){return this[l].url.port}set port(e){this[l].url.port=e}get protocol(){return this[l].url.protocol}set protocol(e){this[l].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[l].url=c(e),this.analyze()}get origin(){return this[l].url.origin}get pathname(){return this[l].url.pathname}set pathname(e){this[l].url.pathname=e}get hash(){return this[l].url.hash}set hash(e){this[l].url.hash=e}get search(){return this[l].url.search}set search(e){this[l].url.search=e}get password(){return this[l].url.password}set password(e){this[l].url.password=e}get username(){return this[l].url.username}set username(e){this[l].url.username=e}get basePath(){return this[l].basePath}set basePath(e){this[l].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new u(String(this),this[l].options)}}},531126,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={fromNodeOutgoingHttpHeaders:function(){return o},normalizeNextQueryParam:function(){return u},splitCookiesString:function(){return s},toNodeOutgoingHttpHeaders:function(){return c},validateURL:function(){return l}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(663416);function o(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}function s(e){var t,r,n,i,a,o=[],s=0;function c(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,a=!1;c();)if(","===(r=e.charAt(s))){for(n=s,s+=1,c(),i=s;s<e.length&&"="!==(r=e.charAt(s))&&";"!==r&&","!==r;)s+=1;s<e.length&&"="===e.charAt(s)?(a=!0,s=i,o.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!a||s>=e.length)&&o.push(e.substring(t,e.length))}return o}function c(e){let t={},r=[];if(e)for(let[n,i]of e.entries())"set-cookie"===n.toLowerCase()?(r.push(...s(i)),t[n]=1===r.length?r[0]:r):t[n]=i;return t}function l(e){try{return String(new URL(String(e)))}catch(t){throw Object.defineProperty(Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}function u(e){for(let t of[a.NEXT_QUERY_PARAM_PREFIX,a.NEXT_INTERCEPTION_MARKER_PREFIX])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}},576420,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={PageSignatureError:function(){return a},RemovedPageError:function(){return o},RemovedUAError:function(){return s}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});class a extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form: 2 3 export function middleware(request, event) { 4 return NextResponse.redirect('/new-location') 5 } 6 7 Read more: https://nextjs.org/docs/messages/middleware-new-signature 8 `)}}class o extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class s extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}},434591,(e,t,r)=>{"use strict";
8Object.defineProperty(r,"__esModule",{value:!0});var n={INTERNALS:function(){return l},NextRequest:function(){return u}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(973670),o=e.r(531126),s=e.r(576420),c=e.r(196883),l=Symbol("internal request");class u extends Request{constructor(e,t={}){const r="string"!=typeof e&&"url"in e?e.url:String(e);(0,o.validateURL)(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);const n=new a.NextURL(r,{headers:(0,o.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[l]={cookies:new c.RequestCookies(this.headers),nextUrl:n,url:n.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[l].cookies}get nextUrl(){return this[l].nextUrl}get page(){throw new s.RemovedPageError}get ua(){throw new s.RemovedUAError}get url(){return this[l].url}}},709256,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NextResponse",{enumerable:!0,get:function(){return d}});let n=e.r(196883),i=e.r(973670),a=e.r(531126),o=e.r(242715),s=e.r(196883),c=Symbol("internal response"),l=new Set([301,302,303,307,308]);function u(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class d extends Response{constructor(e,t={}){super(e,t);const r=this.headers,l=new Proxy(new s.ResponseCookies(r),{get(e,i,a){switch(i){case"delete":case"set":return(...a)=>{let o=Reflect.apply(e[i],e,a),c=new Headers(r);return o instanceof s.ResponseCookies&&r.set("x-middleware-set-cookie",o.getAll().map(e=>(0,n.stringifyCookie)(e)).join(",")),u(t,c),o};default:return o.ReflectAdapter.get(e,i,a)}}});this[c]={cookies:l,url:t.url?new i.NextURL(t.url,{headers:(0,a.toNodeOutgoingHttpHeaders)(r),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[c].cookies}static json(e,t){let r=Response.json(e,t);return new d(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!l.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});let n="object"==typeof t?t:{},i=new Headers(null==n?void 0:n.headers);return i.set("Location",(0,a.validateURL)(e)),new d(null,{...n,headers:i,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",(0,a.validateURL)(e)),u(t,r),new d(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),u(e,t),new d(null,{...e,headers:t})}}},274370,(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead'),"__NEXT_ERROR_CODE",{value:"E183",enumerable:!1,configurable:!0})}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageResponse",{enumerable:!0,get:function(){return n}})},275600,(e,t,r)=>{var n={226:function(t,r){!function(n){"use strict";var i="function",a="undefined",o="object",s="string",c="major",l="model",u="name",d="type",p="vendor",h="version",f="architecture",m="console",g="mobile",y="tablet",b="smarttv",w="wearable",_="embedded",v="Amazon",E="Apple",k="ASUS",S="BlackBerry",A="Browser",x="Chrome",P="Firefox",T="Google",R="Huawei",C="Microsoft",
vendor: 4,147 bytes, line 8
8U="Motorola",O="Opera",I="Samsung",L="Sharp",$="Sony",N="Xiaomi",j="Zebra",H="Facebook",D="Chromium OS",W="Mac OS",M=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},K=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},B=function(e,t){return typeof e===s&&-1!==J(t).indexOf(J(e))},J=function(e){return e.toLowerCase()},q=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===a?e:e.substring(0,350)},z=function(e,t){for(var r,n,a,s,c,l,u=0;u<t.length&&!c;){var d=t[u],p=t[u+1];for(r=n=0;r<d.length&&!c&&d[r];)if(c=d[r++].exec(e))for(a=0;a<p.length;a++)l=c[++n],typeof(s=p[a])===o&&s.length>0?2===s.length?typeof s[1]==i?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3===s.length?typeof s[1]!==i||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):void 0:this[s[0]]=l?s[1].call(this,l,s[2]):void 0:4===s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):void 0):this[s]=l||void 0;u+=2}},F=function(e,t){for(var r in t)if(typeof t[r]===o&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(B(t[r][n],e))return"?"===r?void 0:r}else if(B(t[r],e))return"?"===r?void 0:r;return e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},V={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,h],[/opios[\/ ]+([\w\.]+)/i],[h,[u,O+" Mini"]],[/\bopr\/([\w\.]+)/i],[h,[u,O]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[u,"UC"+A]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[h,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[h,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+A],h],[/\bfocus\/([\w\.]+)/i],[h,[u,P+" Focus"]],[/\bopt\/([\w\.]+)/i],[h,[u,O+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[u,O+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[u,"MIUI "+A]],[/fxios\/([-\w\.]+)/i],[h,[u,P]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+A]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+A],h],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,H],h],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[h,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[u,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,x+" WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[u,"Android "+A]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[h,F,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}
vendor: 4,515 bytes, line 8
8]],[/(webkit|khtml)\/([\w\.]+)/i],[u,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[u,P+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[u,h],[/(cobalt)\/([\w\.]+)/i],[u,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,J]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",J]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,J]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[p,I],[d,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[p,I],[d,g]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[p,E],[d,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[p,E],[d,y]],[/(macintosh);/i],[l,[p,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[p,L],[d,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[p,R],[d,y]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[p,R],[d,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[p,N],[d,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[p,N],[d,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[p,"OPPO"],[d,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[p,"Vivo"],[d,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[p,"Realme"],[d,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[p,U],[d,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[p,U],[d,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[p,"LG"],[d,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[p,"LG"],[d,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[p,"Lenovo"],[d,y]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[p,"Nokia"],[d,g]],[/(pixel c)\b/i],[l,[p,T],[d,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[p,T],[d,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[p,$],[d,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[p,$],[d,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[p,"OnePlus"],[d,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[p,v],[d,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[p,v],[d,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,p,[d,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[p,S],[d,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[p,k],[d,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[p,k],[d,g]],[/(nexus 9)/i],[l,[p,"HTC"],[d,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[l,/_/g," "],[d,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[p,"Acer"],[d,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[p,"Meizu"],[d,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asu
vendor: 3,691 bytes, line 8
8s)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,l,[d,g]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,l,[d,y]],[/(surface duo)/i],[l,[p,C],[d,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[p,"Fairphone"],[d,g]],[/(u304aa)/i],[l,[p,"AT&T"],[d,g]],[/\bsie-(\w*)/i],[l,[p,"Siemens"],[d,g]],[/\b(rct\w+) b/i],[l,[p,"RCA"],[d,y]],[/\b(venue[\d ]{2,7}) b/i],[l,[p,"Dell"],[d,y]],[/\b(q(?:mv|ta)\w+) b/i],[l,[p,"Verizon"],[d,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[p,"Barnes & Noble"],[d,y]],[/\b(tm\d{3}\w+) b/i],[l,[p,"NuVision"],[d,y]],[/\b(k88) b/i],[l,[p,"ZTE"],[d,y]],[/\b(nx\d{3}j) b/i],[l,[p,"ZTE"],[d,g]],[/\b(gen\d{3}) b.+49h/i],[l,[p,"Swiss"],[d,g]],[/\b(zur\d{3}) b/i],[l,[p,"Swiss"],[d,y]],[/\b((zeki)?tb.*\b) b/i],[l,[p,"Zeki"],[d,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],l,[d,y]],[/\b(ns-?\w{0,9}) b/i],[l,[p,"Insignia"],[d,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[p,"NextBook"],[d,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],l,[d,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],l,[d,g]],[/\b(ph-1) /i],[l,[p,"Essential"],[d,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[p,"Envizen"],[d,y]],[/\b(trio[-\w\. ]+) b/i],[l,[p,"MachSpeed"],[d,y]],[/\btu_(1491) b/i],[l,[p,"Rotor"],[d,y]],[/(shield[\w ]+) b/i],[l,[p,"Nvidia"],[d,y]],[/(sprint) (\w+)/i],[p,l,[d,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[p,C],[d,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[p,j],[d,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[p,j],[d,g]],[/smart-tv.+(samsung)/i],[p,[d,b]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[p,I],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,"LG"],[d,b]],[/(apple) ?tv/i],[p,[l,E+" TV"],[d,b]],[/crkey/i],[[l,x+"cast"],[p,T],[d,b]],[/droid.+aft(\w)( bui|\))/i],[l,[p,v],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[p,L],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[l,[p,$],[d,b]],[/(mitv-\w{5}) bui/i],[l,[p,N],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[p,l,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,q],[l,q],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,l,[d,m]],[/droid.+; (shield) bui/i],[l,[p,"Nvidia"],[d,m]],[/(playstation [345portablevi]+)/i],[l,[p,$],[d,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[p,C],[d,m]],[/((pebble))app/i],[p,l,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[p,E],[d,w]],[/droid.+; (glass) \d/i],[l,[p,T],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[l,[p,j],[d,w]],[/(quest( 2| pro)?)/i],[l,[p,H],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,_]],[/(aeobc)\b/i],[l,[p,v],[d,_]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[d,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,h],[/rv\
8:([\w\.]{1,9})\b.+(gecko)/i],[h,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[h,F,X]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[h,F,X]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,W],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,h],[/\(bb(10);/i],[h,[u,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[u,P+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[h,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[h,[u,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,D],h],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,h],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,h]]},G=function(e,t){if(typeof e===o&&(t=e,e=void 0),!(this instanceof G))return new G(e,t).getResult();var r=typeof n!==a&&n.navigator?n.navigator:void 0,m=e||(r&&r.userAgent?r.userAgent:""),b=r&&r.userAgentData?r.userAgentData:void 0,w=t?M(V,t):V,_=r&&r.userAgent==m;return this.getBrowser=function(){var e,t={};return t[u]=void 0,t[h]=void 0,z.call(t,m,w.browser),t[c]=typeof(e=t[h])===s?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,_&&r&&r.brave&&typeof r.brave.isBrave==i&&(t[u]="Brave"),t},this.getCPU=function(){var e={};return e[f]=void 0,z.call(e,m,w.cpu),e},this.getDevice=function(){var e={};return e[p]=void 0,e[l]=void 0,e[d]=void 0,z.call(e,m,w.device),_&&!e[d]&&b&&b.mobile&&(e[d]=g),_&&"Macintosh"==e[l]&&r&&typeof r.standalone!==a&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[l]="iPad",e[d]=y),e},this.getEngine=function(){var e={};return e[u]=void 0,e[h]=void 0,z.call(e,m,w.engine),e},this.getOS=function(){var e={};return e[u]=void 0,e[h]=void 0,z.call(e,m,w.os),_&&!e[u]&&b&&"Unknown"!=b.platform&&(e[u]=b.platform.replace(/chrome os/i,D).replace(/macos/i,W)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return m},this.setUA=function(e){return m=typeof e===s&&e.length>350?q(e,350):e,this},this.setUA(m),this};if(G.VERSION="1.0.35",G.BROWSER=K([u,h,c]),G.CPU=K([f]),G.DEVICE=K([l,p,d,m,g,b,y,w,_]),G.ENGINE=G.OS=K([u,h]),typeof r!==a)t.exports&&(r=t.exports=G),r.UAParser=G;else if(typeof define===i&&define.amd)e.r,void 0!==G&&e.v(G);else typeof n!==a&&(n.UAParser=G);var Y=typeof n!==a&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var Z=new G;Y.ua=Z.getResult(),Y.ua.get=function(){return Z.getUA()},Y.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var r in t)Y.ua[r]=t[r]}}}("object"==typeof window?window:this)}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}},o=!0;try{n[e].call(r.exports,r,r.exports,a),o=!1}finally{o&&delete i[e]}return r.exports}a.ab="/ROOT/node_modules/next/dist/compiled/ua-parser-js/",t.exports=a(226)},653291,(e,t,r)=>{"use strict";
8Object.defineProperty(r,"__esModule",{value:!0});var n,i={isBot:function(){return s},userAgent:function(){return l},userAgentFromString:function(){return c}};for(var a in i)Object.defineProperty(r,a,{enumerable:!0,get:i[a]});let o=(n=e.r(275600))&&n.__esModule?n:{default:n};function s(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver|GPTBot/i.test(e)}function c(e){return{...(0,o.default)(e),isBot:void 0!==e&&s(e)}}function l({headers:e}){return c(e.get("user-agent")||void 0)}},773533,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"URLPattern",{enumerable:!0,get:function(){return n}});let n="u"<typeof URLPattern?void 0:URLPattern},771906,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"after",{enumerable:!0,get:function(){return i}});let n=e.r(563599);function i(e){let t=n.workAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"),"__NEXT_ERROR_CODE",{value:"E468",enumerable:!1,configurable:!0});let{afterContext:r}=t;return r.after(e)}},547227,(e,t,r)=>{"use strict";var n,i;Object.defineProperty(r,"__esModule",{value:!0}),n=e.r(771906),i=r,Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(i,e)||Object.defineProperty(i,e,{enumerable:!0,get:function(){return n[e]}})})},272623,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"connection",{enumerable:!0,get:function(){return u}});let n=e.r(563599),i=e.r(662141),a=e.r(67673),o=e.r(643248),s=e.r(963138),c=e.r(850999);e.r(142852);let l=e.r(312718);function u(){let e=n.workAsyncStorage.getStore(),t=i.workUnitAsyncStorage.getStore();if(e){if(t&&"after"===t.phase&&!(0,c.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${e.route} used \`connection()\` inside \`after()\`. The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but \`after()\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E827",enumerable:!1,configurable:!0});if(e.forceStatic)return Promise.resolve(void 0);if(e.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E847",enumerable:!1,configurable:!0});if(t)switch(t.type){case"cache":{let t=Object.defineProperty(Error(`Route ${e.route} used \`connection()\` inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E841",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,u),e.invalidDynamicUsageError??=t,t}case"private-cache":{let t=Object.defineProperty(Error(`Route ${e.route} used \`connection()\` inside "use cache: private". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E837",enumerable:!1,
8configurable:!0});throw Error.captureStackTrace(t,u),e.invalidDynamicUsageError??=t,t}case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used \`connection()\` inside a function cached with \`unstable_cache()\`. The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E840",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${e.route} used \`connection()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1125",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-runtime":return(0,s.makeHangingPromise)(t.renderSignal,e.route,"`connection()`");case"validation-client":{let e="`connection`";throw Object.defineProperty(new l.InvariantError(`${e} must not be used within a Client Component. Next.js should be preventing ${e} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1063",enumerable:!1,configurable:!0})}case"prerender-ppr":return(0,a.postponeWithTracking)(e.route,"connection",t.dynamicTracking);case"prerender-legacy":return(0,a.throwToInterruptStaticGeneration)("connection",e,t);case"request":if((0,a.trackDynamicDataInDynamicRender)(t),t.asyncApiPromises)return t.asyncApiPromises.connection;return Promise.resolve(void 0)}}(0,i.throwForMissingRequestStore)("connection")}},223397,(e,t,r)=>{let n={NextRequest:e.r(434591).NextRequest,NextResponse:e.r(709256).NextResponse,ImageResponse:e.r(274370).ImageResponse,userAgentFromString:e.r(653291).userAgentFromString,userAgent:e.r(653291).userAgent,URLPattern:e.r(773533).URLPattern,after:e.r(547227).after,connection:e.r(272623).connection};t.exports=n,r.NextRequest=n.NextRequest,r.NextResponse=n.NextResponse,r.ImageResponse=n.ImageResponse,r.userAgentFromString=n.userAgentFromString,r.userAgent=n.userAgent,r.URLPattern=n.URLPattern,r.after=n.after,r.connection=n.connection},232124,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"cookies",{enumerable:!0,get:function(){return h}});let n=e.r(397270),i=e.r(196883),a=e.r(563599),o=e.r(662141),s=e.r(67673),c=e.r(643248),l=e.r(963138),u=e.r(876361),d=e.r(850999),p=e.r(312718);function h(){let e="cookies",t=a.workAsyncStorage.getStore(),r=o.workUnitAsyncStorage.getStore();if(t){if(r&&"after"===r.phase&&!(0,d.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${t.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E843",enumerable:!1,configurable:!0});if(t.forceStatic)return m(n.RequestCookiesAdapter.seal(new i.RequestCookies(new Headers({}))));if(t.dynamicShouldError)throw Object.defineProperty(new c.StaticGenBailoutError(`Route ${t.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E849",enumerable:!1,configurable:!0});if(r)switch(r.type){case"cache":let a=Object.defineProperty(Error(`Route ${t.route} used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E831",enumerable:!1,
8configurable:!0});throw Error.captureStackTrace(a,h),t.invalidDynamicUsageError??=a,a;case"unstable-cache":throw Object.defineProperty(Error(`Route ${t.route} used \`cookies()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E846",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${t.route} used \`cookies()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1123",enumerable:!1,configurable:!0});case"prerender":var u=t,g=r;let y=f.get(g);if(y)return y;let b=(0,l.makeHangingPromise)(g.renderSignal,u.route,"`cookies()`");return f.set(g,b),b;case"prerender-client":case"validation-client":let w="`cookies`";throw Object.defineProperty(new p.InvariantError(`${w} must not be used within a Client Component. Next.js should be preventing ${w} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1037",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,s.postponeWithTracking)(t.route,e,r.dynamicTracking);case"prerender-legacy":return(0,s.throwToInterruptStaticGeneration)(e,t,r);case"prerender-runtime":return(0,l.delayUntilRuntimeStage)(r,m(r.cookies));case"private-cache":return m(r.cookies);case"request":let _;if((0,s.trackDynamicDataInDynamicRender)(r),_=(0,n.areCookiesMutableInCurrentPhase)(r)?r.userspaceMutableCookies:r.cookies,!r.asyncApiPromises)return m(_);{let e=(0,o.isInEarlyRenderStage)(r);if(_===r.mutableCookies)return e?r.asyncApiPromises.earlyMutableCookies:r.asyncApiPromises.mutableCookies;return e?r.asyncApiPromises.earlyCookies:r.asyncApiPromises.cookies}}}(0,o.throwForMissingRequestStore)(e)}e.r(142852);let f=new WeakMap;function m(e){let t=f.get(e);if(t)return t;let r=Promise.resolve(e);return f.set(e,r),r}(0,u.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E830",enumerable:!1,configurable:!0})})},835407,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"headers",{enumerable:!0,get:function(){return p}});let n=e.r(687720),i=e.r(563599),a=e.r(662141),o=e.r(67673),s=e.r(643248),c=e.r(963138),l=e.r(876361),u=e.r(850999),d=e.r(312718);function p(){let e="headers",t=i.workAsyncStorage.getStore(),r=a.workUnitAsyncStorage.getStore();if(t){if(r&&"after"===r.phase&&!(0,u.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${t.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E839",enumerable:!1,configurable:!0});if(t.forceStatic)return f(n.HeadersAdapter.seal(new Headers({})));if(r)switch(r.type){case"cache":{let e=Object.defineProperty(Error(`Route ${t.route} used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E833",enumerable:!1,configurable:!0});throw Error.captureStackTrace(e,p),t.invalidDynamicUsageError??=e,e}case"unstable-cache":throw Object.defineProperty(Error(`Route ${t.route} used \`headers()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E838",enumerable:!1,
8configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${t.route} used \`headers()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1134",enumerable:!1,configurable:!0})}if(t.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${t.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E828",enumerable:!1,configurable:!0});if(r)switch(r.type){case"prerender":var l=t,m=r;let i=h.get(m);if(i)return i;let g=(0,c.makeHangingPromise)(m.renderSignal,l.route,"`headers()`");return h.set(m,g),g;case"prerender-client":case"validation-client":let y="`headers`";throw Object.defineProperty(new d.InvariantError(`${y} must not be used within a client component. Next.js should be preventing ${y} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1017",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,o.postponeWithTracking)(t.route,e,r.dynamicTracking);case"prerender-legacy":return(0,o.throwToInterruptStaticGeneration)(e,t,r);case"prerender-runtime":return(0,c.delayUntilRuntimeStage)(r,f(r.headers));case"private-cache":return f(r.headers);case"request":if((0,o.trackDynamicDataInDynamicRender)(r),r.asyncApiPromises)return(0,a.isInEarlyRenderStage)(r)?r.asyncApiPromises.earlyHeaders:r.asyncApiPromises.headers;return f(r.headers)}}(0,a.throwForMissingRequestStore)(e)}e.r(142852);let h=new WeakMap;function f(e){let t=h.get(e);if(t)return t;let r=Promise.resolve(e);return h.set(e,r),r}(0,l.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E836",enumerable:!1,configurable:!0})})},491516,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"draftMode",{enumerable:!0,get:function(){return d}});let n=e.r(662141),i=e.r(563599),a=e.r(67673),o=e.r(876361),s=e.r(643248),c=e.r(476353),l=e.r(312718),u=e.r(963138);function d(){let e="draftMode",t=i.workAsyncStorage.getStore(),r=n.workUnitAsyncStorage.getStore();switch((!t||!r)&&(0,n.throwForMissingRequestStore)(e),r.type){case"prerender-runtime":return(0,u.delayUntilRuntimeStage)(r,p(r.draftMode,t));case"request":return p(r.draftMode,t);case"cache":case"private-cache":case"unstable-cache":let a=(0,n.getDraftModeProviderForCacheScope)(t,r);if(a)return p(a,t);case"prerender":case"prerender-ppr":case"prerender-legacy":return p(null,t);case"prerender-client":case"validation-client":{let e="`draftMode`";throw Object.defineProperty(new l.InvariantError(`${e} must not be used within a Client Component. Next.js should be preventing ${e} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0})}case"generate-static-params":throw Object.defineProperty(Error(`Route ${t.route} used \`${e}()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1132",enumerable:!1,configurable:!0});default:return r}}function p(e,t){let r=f.get(e??h);return r||Promise.resolve(new m(e))}e.r(242715);let h={},f=new WeakMap;class m{constructor(e){this._provider=e}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){g("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){g("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function g(e,t){let r=i.workAsyncStorage.getStore(),o=n.workUnitAsyncStorage.getStore();if(r){if((null==o?void 0:o.phase)==="after")throw Object.defineProperty(Error(`Route ${r.route} used "${e}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E845",enumerable:!1,
8configurable:!0});if(r.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${r.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(o)switch(o.type){case"cache":case"private-cache":{let n=Object.defineProperty(Error(`Route ${r.route} used "${e}" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E829",enumerable:!1,configurable:!0});throw Error.captureStackTrace(n,t),r.invalidDynamicUsageError??=n,n}case"unstable-cache":throw Object.defineProperty(Error(`Route ${r.route} used "${e}" inside a function cached with \`unstable_cache()\`. The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E844",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let t=Object.defineProperty(Error(`Route ${r.route} used ${e} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,a.abortAndThrowOnSynchronousRequestDataAccess)(r.route,e,t,o)}case"prerender-client":case"validation-client":let n="`draftMode`";throw Object.defineProperty(new l.InvariantError(`${n} must not be used within a Client Component. Next.js should be preventing ${n} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,a.postponeWithTracking)(r.route,e,o.dynamicTracking);case"prerender-legacy":o.revalidate=0;let i=Object.defineProperty(new c.DynamicServerError(`Route ${r.route} couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw r.dynamicUsageDescription=e,r.dynamicUsageStack=i.stack,i;case"request":(0,a.trackDynamicDataInDynamicRender)(o);break;case"generate-static-params":throw Object.defineProperty(Error(`Route ${r.route} used \`${e}\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1121",enumerable:!1,configurable:!0})}}}(0,o.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E835",enumerable:!1,configurable:!0})})},630029,(e,t,r)=>{t.exports.cookies=e.r(232124).cookies,t.exports.headers=e.r(835407).headers,t.exports.draftMode=e.r(491516).draftMode},708594,130557,999526,286791,818448,966871,e=>{"use strict";let t,r,n,i,a;var o=((rE={}).PHONE_SIMPLE="phone_simple",rE.PHONE="phone",rE.ACCESSORY="accessory",rE.ACCESSORY_CONFIGURABLE="accessory_configurable",rE.BOX="box",rE.FAIM_UNLIMITED="faim_unlimited",rE.DEVICE_FAIM="device_faim",rE.FAI="fai",rE.FAI_SERVICE="fai_service",rE.PLAN_PREMIUM="plan_premium",rE.PLAN_PREMIUM_RENEWAL="plan_premium_renew",rE.OFFER_PARTNER="offer_partner",rE.OPTION_DEFAULT="option_default",rE.OPTION_SALABLE="option_salable",rE.SIM="sim",rE.ESIM="qr_esim",rE);e.s(["ProductType",()=>o],130557);var s=((rk={}).PHONE="phone",rk.ACCESSORY="accessory",rk.HOTSPOT="device_faim",rk.SALES_PHONE="sales_phone",rk.SALES_ACCESSORY="sales_accessory",rk);(rS={}).PHONE="telephones-mobiles",rS.ACCESSORY="accessoires";let c={index:"/",phoneWall:"/telephones-mobiles",renewalPhoneWall:"/telephones-mobiles/renouvellement",ph
8oneDetail:(e,t=!1)=>`${c.phoneWall}/${t?"renouvellement/":""}${e}`,phoneFilter:(e,t)=>`${e?c.renewalPhoneWall:c.phoneWall}/filtre/${t}`,accessoryWall:"/accessoires",accessoryDetail:e=>`${c.accessoryWall}/${e}`,accessoryFilter:e=>`${c.accessoryWall}/filtre/${e}`,hotspotDetail:e=>`/hotspot-tablette/${e}`,productDetail:(e,t,r=!1)=>{switch(e){case o.ACCESSORY:case o.ACCESSORY_CONFIGURABLE:return c.accessoryDetail(t);case o.PHONE:case o.PHONE_SIMPLE:return c.phoneDetail(t,r);case o.DEVICE_FAIM:case o.BOX:return c.hotspotDetail(t);default:return c.index}},crossSell:e=>{let t=e?`?origin=${e}`:"";return`/personnaliser-mon-offre${t}`},cartCrossSell:"/tunnel/recapitulatif",hotspotWall:"/hotspot-tablette",productWall:e=>{switch(e){case s.ACCESSORY:return c.accessoryWall;case s.PHONE:return c.phoneWall;case s.HOTSPOT:return c.hotspotWall;default:return c.index}},homeFai:"/offres-internet",homePack:"/offres-internet/combo-box",homePackSmartTv:"/offres-internet/combo-box/smart-tv",promos:"/offres-box-forfait",plans:"/forfaits-mobiles/avec-engagement",plansWithoutPhone:"/forfaits-mobiles/avec-engagement?smartphone=false",plansByou:"/forfaits-mobiles/sans-engagement",plansByouPack:"/forfaits-mobiles-lespacks/sans-engagement",cart:"/panier",payment:"/tunnel/paiement",bank:"/tunnel/banque",thankYouBaseUrl:"/tunnel/merci",orderTracking:(e,t="V2")=>"V3"===t?`/mon-compte/suivi-commande/detail/${e}`:`/mon-compte/suivicommande/${e}`,recall:(e,t,r)=>t?"/rappelez-moi?type=pro":r?"/rappelez-moi?callback=tlvctcedfdem":`/rappelez-moi?callback=${e}`,mixedCartEligibility:"/offres-internet/test-eligibilite-panier-mixte",gamingEligibility:"/offres-internet/test-eligibilite-gaming",tabletEligibility:"/offres-internet/test-eligibilite-tablette",smartTvEligibility:"/offres-internet/test-eligibilite-smart-tv",youngEligibility:"/offres-internet/test-eligibilite-moins-26-ans",bankEligibility:"/offres-internet/test-eligibilite-bboxbanque",promoEligibility:"/offres-internet/test-eligibilite-promo",eligibilityTest:"/offres-internet/test-eligibilite",eligibilityResult:"/offres-internet/resultats",offersComparator:"/offres-internet/comparateur",mobileComparator:(e,t)=>`/comparateur?produits=${t.join(",")}${e?"&renewal=true":""}`,clientSpace:"/mon-compte",clientSpaceCallback:e=>`/mon-compte/rappel-client?serviceID=${e}`,clientSpacePreferencesContacts:"/mon-compte/preferences-contacts",sales:e=>`/bons-plans/soldes/${e}`,salesFilter:(e,t)=>`/bons-plans/soldes/${e}/filtre/${t}`,privacyPolicy:"https://www.corporate.bouyguestelecom.fr/mentions-legales/politique-de-confidentialite/",enterpriseDirectory:"https://annuaire-entreprises.data.gouv.fr/",termsAndConditions:"https://www.bouyguestelecom.fr/tarifs-conditions",mobileInsurance:"https://www.bouyguestelecom.fr/static/pdf/assurance_mobile.pdf",storeLocation:"https://boutiques.bouyguestelecom.fr/bouyguestelecom/fr",bankingOfferLegals:"/tarifs-conditions-offres-reseau-bancaire",termsPDF:"/static/cms/tarifs/Conditions_Generales_De_Vente_A_Distance.pdf",serviceConditionsPDF:"/static/cms/tarifs/conditions-generales-de-service.pdf",pricingGuidePDF:"/static/cms/tarifs/Guide_Des_Tarifs.pdf",mobileCGCPDF:"/skin/frontend/bytel/default/medias/images/mobile-retake/CGC.pdf",retractFormPDF:"/static/cms/tarifs/Formulaire_De_Retractation.pdf",fundingRedirect:e=>`${window.location.origin}/tunnel/redirect${e?`?cartId=${e}`:""}`},l="/webapi/checkout",u={authentification:{auth:`${l}/auth`,session:`${l}/auth/session`}};e.s(["localApiPaths",0,u,"paths",0,c],708594);var d=function(e,t,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},p=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};function h(e){let t=e?"__Secure-":"";return{sessionToken:{name:`${t}authjs.session-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},callbackUrl:{name:`${t}authjs.callback-url`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},csrfToken:{name:`${e?"__Host-":""}authjs.csrf-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},pkceCodeVerifier:{name:`${t}authjs.pkce.code_verifier`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},state:{name:`${t}authjs.state`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},nonce:{name:`${t}authjs.nonce`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},webauthnChallenge:{name:`${t}authjs.challenge`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}}}}class f{constructor(e,t,r){if(rA.add(this),rx.set(this,{}),rP.set(this,void 0),rT.set(this,void 0),d(this,rT,r,"f"),d(this,rP,e,"f"),!t)return;const{name:n}=e;for(const[e,r]of Object.entries(t))e.startsWith(n)&&r&&(p(this,rx,"f")[e]=r)}get value(){return Object.keys(p(this,rx,"f")).sort((e,t)=>
8parseInt(e.split(".").pop()||"0")-parseInt(t.split(".").pop()||"0")).map(e=>p(this,rx,"f")[e]).join("")}chunk(e,t){let r=p(this,rA,"m",rC).call(this);for(let n of p(this,rA,"m",rR).call(this,{name:p(this,rP,"f").name,value:e,options:{...p(this,rP,"f").options,...t}}))r[n.name]=n;return Object.values(r)}clean(){return Object.values(p(this,rA,"m",rC).call(this))}}rx=new WeakMap,rP=new WeakMap,rT=new WeakMap,rA=new WeakSet,rR=function(e){let t=Math.ceil(e.value.length/3936);if(1===t)return p(this,rx,"f")[e.name]=e.value,[e];let r=[];for(let n=0;n<t;n++){let t=`${e.name}.${n}`,i=e.value.substr(3936*n,3936);r.push({...e,name:t,value:i}),p(this,rx,"f")[t]=i}return p(this,rT,"f").debug("CHUNKING_SESSION_COOKIE",{message:"Session cookie exceeds allowed 4096 bytes.",emptyCookieSize:160,valueSize:e.value.length,chunks:r.map(e=>e.value.length+160)}),r},rC=function(){let e={};for(let t in p(this,rx,"f"))delete p(this,rx,"f")?.[t],e[t]={name:t,value:"",options:{...p(this,rP,"f").options,maxAge:0}};return e};class m 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);const r=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?". ":""}Read more at ${r}`}}class g extends m{}g.kind="signIn";class y extends m{}y.type="AdapterError";class b extends m{}b.type="AccessDenied";class w extends m{}w.type="CallbackRouteError";class _ extends m{}_.type="ErrorPageLoop";class v extends m{}v.type="EventError";class E extends m{}E.type="InvalidCallbackUrl";class k extends g{constructor(){super(...arguments),this.code="credentials"}}k.type="CredentialsSignin";class S extends m{}S.type="InvalidEndpoints";class A extends m{}A.type="InvalidCheck";class x extends m{}x.type="JWTSessionError";class P extends m{}P.type="MissingAdapter";class T extends m{}T.type="MissingAdapterMethods";class R extends m{}R.type="MissingAuthorize";class C extends m{}C.type="MissingSecret";class U extends g{}U.type="OAuthAccountNotLinked";class O extends g{}O.type="OAuthCallbackError";class I extends m{}I.type="OAuthProfileParseError";class L extends m{}L.type="SessionTokenError";class $ extends m{}$.type="SignOutError";class N extends m{}N.type="UnknownAction";class j extends m{}j.type="UnsupportedStrategy";class H extends m{}H.type="InvalidProvider";class D extends m{}D.type="UntrustedHost";class W extends m{}W.type="Verification";class M extends g{}M.type="MissingCSRF";let K=new Set(["CredentialsSignin","OAuthAccountNotLinked","OAuthCallbackError","AccessDenied","Verification","MissingCSRF","AccountNotLinked","WebAuthnVerificationError"]);function B(e){return e instanceof m&&K.has(e.type)}class J extends m{}J.type="DuplicateConditionalUI";class q extends m{}q.type="MissingWebAuthnAutocomplete";class z extends m{}z.type="WebAuthnVerificationError";class F extends g{}F.type="AccountNotLinked";class X extends m{}X.type="ExperimentalFeatureNotEnabled",e.s(["AccessDenied",0,b,"AccountNotLinked",0,F,"AdapterError",0,y,"AuthError",0,m,"CallbackRouteError",0,w,"CredentialsSignin",0,k,"DuplicateConditionalUI",0,J,"ErrorPageLoop",0,_,"EventError",0,v,"ExperimentalFeatureNotEnabled",0,X,"InvalidCallbackUrl",0,E,"InvalidCheck",0,A,"InvalidEndpoints",0,S,"InvalidProvider",0,H,"JWTSessionError",0,x,"MissingAdapter",0,P,"MissingAdapterMethods",0,T,"MissingAuthorize",0,R,"MissingCSRF",0,M,"MissingSecret",0,C,"MissingWebAuthnAutocomplete",0,q,"OAuthAccountNotLinked",0,U,"OAuthCallbackError",0,O,"OAuthProfileParseError",0,I,"SessionTokenError",0,L,"SignOutError",0,$,"UnknownAction",0,N,"UnsupportedStrategy",0,j,"UntrustedHost",0,D,"Verification",0,W,"WebAuthnVerificationError",0,z,"isClientError",0,B],999526);let V=!1;function G(e,t){try{return/^https?:/.test(new URL(e,e.startsWith("/")?t:void 0).protocol)}catch{return!1}}let Y=!1,Z=!1,Q=!1,ee=["createVerificationToken","useVerificationToken","getUserByEmail"],et=["createUser","getUser","getUserByEmail","getUserByAccount","updateUser","linkAccount","createSession","getSessionAndUser","updateSession","deleteSession"],er=["createUser","getUser","linkAccount","getAccount","getAuthenticator","createAuthenticator","listAuthenticatorsByUserId","updateAuthenticatorCounter"],en=async(e,t,r,n,i)=>{let{crypto:{subtle:a}}=(()=>
8{if("u">typeof globalThis)return globalThis;if("u">typeof self)return self;if("u">typeof window)return window;throw Error("unable to locate global object")})();return new Uint8Array(await a.deriveBits({name:"HKDF",hash:`SHA-${e.substr(3)}`,salt:r,info:n},await a.importKey("raw",t,"HKDF",!1,["deriveBits"]),i<<3))};function ei(e,t){if("string"==typeof e)return new TextEncoder().encode(e);if(!(e instanceof Uint8Array))throw TypeError(`"${t}"" must be an instance of Uint8Array or a string`);return e}async function ea(e,t,r,n,i){return en(function(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw TypeError('unsupported "digest" value')}}(e),function(e){let t=ei(e,"ikm");if(!t.byteLength)throw TypeError('"ikm" must be at least one byte in length');return t}(t),ei(r,"salt"),function(e){let t=ei(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}(n),function(e,t){if("number"!=typeof e||!Number.isInteger(e)||e<1)throw TypeError('"keylen" must be a positive integer');if(e>255*(parseInt(t.substr(3),10)>>3||20))throw TypeError('"keylen" too large');return e}(i,e))}let eo=new TextEncoder,es=new TextDecoder;function ec(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}function el(e,t,r){if(t<0||t>=0x100000000)throw RangeError(`value must be >= 0 and <= ${0x100000000-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function eu(e){let t=Math.floor(e/0x100000000),r=new Uint8Array(8);return el(r,t,0),el(r,e%0x100000000,4),r}function ed(e){let t=new Uint8Array(4);return el(t,e),t}function ep(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}function eh(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:es.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=es.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{var r=t;if(Uint8Array.fromBase64)return Uint8Array.fromBase64(r);let e=atob(r),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function ef(e){let t=e;return("string"==typeof t&&(t=eo.encode(t)),Uint8Array.prototype.toBase64)?t.toBase64({alphabet:"base64url",omitPadding:!0}):(function(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=[];for(let r=0;r<e.length;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join(""))})(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}e.s(["decode",0,eh,"encode",0,ef],113681);let em=Symbol();function eg(e,t){if(e)throw TypeError(`${t} can only be called once`)}function ey(e,t,r){try{return eh(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}async function eb(e,t){let r=`SHA-${e.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(r,t))}let ew=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function e_(e,t,r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if("AES-GCM"!==e.algorithm.name)throw ew("AES-GCM");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw ew(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if("AES-KW"!==e.algorithm.name)throw ew("AES-KW");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw ew(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":break;default:throw ew("ECDH or X25519")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if("PBKDF2"!==e.algorithm.name)throw ew("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if("RSA-OAEP"!==e.algorithm.name)throw ew("RSA-OAEP");var n=e.algorithm,i=parseInt(t.slice(9),10)||1;if(parseInt(n.hash.name.slice(4),10)!==i)throw ew(`SHA-${i}`,"algorithm.hash");break;default:throw TypeError("CryptoKey does not support this operation")}if(r&&!e.usages.includes(r))throw TypeError(`CryptoKey does not support this operation, its usages must include ${r}.`)}function ev(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let eE=(e,...t)=>ev("Key must be ",e,...t),ek=(e,t,...r)=>ev(`Key for the ${e} algorithm must be `,t,...r);
8class eS extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class eA extends eS{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.claim=r,this.reason=n,this.payload=t}}class ex extends eS{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.claim=r,this.reason=n,this.payload=t}}class eP extends eS{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"}class eT extends eS{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class eR extends eS{static code="ERR_JWE_DECRYPTION_FAILED";code="ERR_JWE_DECRYPTION_FAILED";constructor(e="decryption operation failed",t){super(e,t)}}class eC extends eS{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"}class eU extends eS{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class eO extends eS{static code="ERR_JWK_INVALID";code="ERR_JWK_INVALID"}class eI extends eS{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t)}}function eL(e){if(!e$(e))throw Error("CryptoKey instance expected")}let e$=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},eN=e=>e?.[Symbol.toStringTag]==="KeyObject",ej=e=>e$(e)||eN(e);function eH(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new eT(`Unsupported JWE Algorithm: ${e}`)}}let eD=e=>crypto.getRandomValues(new Uint8Array(eH(e)>>3));function eW(e,t){let r=e.byteLength<<3;if(r!==t)throw new eC(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)}function eM(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new eT(`Unsupported JWE Algorithm: ${e}`)}}function eK(e,t){if(t.length<<3!==eM(e))throw new eC("Invalid Initialization Vector length")}async function eB(e,t,r){if(!(t instanceof Uint8Array))throw TypeError(eE(t,"Uint8Array"));let n=parseInt(e.slice(1,4),10);return{encKey:await crypto.subtle.importKey("raw",t.subarray(n>>3),"AES-CBC",!1,[r]),macKey:await crypto.subtle.importKey("raw",t.subarray(0,n>>3),{hash:`SHA-${n<<1}`,name:"HMAC"},!1,["sign"]),keySize:n}}async function eJ(e,t,r){return new Uint8Array((await crypto.subtle.sign("HMAC",e,t)).slice(0,r>>3))}async function eq(e,t,r,n,i){let{encKey:a,macKey:o,keySize:s}=await eB(e,r,"encrypt"),c=new Uint8Array(await crypto.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),l=ec(i,n,c,eu(i.length<<3));return{ciphertext:c,tag:await eJ(o,l,s),iv:n}}async function ez(e,t){if(!(e instanceof Uint8Array))throw TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw TypeError("Second argument must be a buffer");let r={name:"HMAC",hash:"SHA-256"},n=await crypto.subtle.generateKey(r,!1,["sign"]),i=new Uint8Array(await crypto.subtle.sign(r,n,e)),a=new Uint8Array(await crypto.subtle.sign(r,n,t)),o=0,s=-1;for(;++s<32;)o|=i[s]^a[s];return 0===o}async function eF(e,t,r,n,i,a){let o,s,{encKey:c,macKey:l,keySize:u}=await eB(e,t,"decrypt"),d=ec(a,n,r,eu(a.length<<3)),p=await eJ(l,d,u);try{o=await ez(i,p)}catch{}if(!o)throw new eR;try{s=new Uint8Array(await crypto.subtle.decrypt({iv:n,name:"AES-CBC"},c,r))}catch{}if(!s)throw new eR;return s}async function eX(e,t,r,n,i){let a;r instanceof Uint8Array?a=await crypto.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(e_(r,e,"encrypt"),a=r);let o=new Uint8Array(await crypto.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},a,t)),s=o.slice(-16);return{ciphertext:o.slice(0,-16),tag:s,iv:n}}async function eV(e,t,r,n,i,a){let o;t instanceof Uint8Array?o=await crypto.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(e_(t,e,"decrypt"),o=t);try{return new Uint8Array(await crypto.subtle.decrypt({additionalData:a,iv:n,name:"AES-GCM",tagLength:128},o,ec(r,i)))}catch{throw new eR}}let eG="Unsupported JWE Content Encryption Algorithm";async function eY(e,t,r,n,i){if(!e$(r)&&!(r instanceof Uint8Array))throw TypeError(eE(r,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(n)eK(e,n);else n=crypto.getRandomValues(new Uint8Array(eM(e)>>3));switch(e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&eW(r,parseInt(e.slice(-3),10)),eq(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&eW(r,parseInt(e.slice(1,4),10)),eX(e,t,r,n,i);default:throw new eT(eG)}}async function eZ(e,t,r,n,i,a){if(!e$(t)&&!(t instanceof Uint8Array))throw TypeError(eE(t,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(!n)throw new eC("JWE Initialization Vector missing");if(!i)throw new eC("JWE Authentication Tag missing");switch(eK(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&eW(t,parseInt(e.slice(-3),10)),eF(e,t,r,n,i,a);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&eW(t,parseInt(e.slice(1,4),10)),eV(e,t,r,n,i,a);default:throw new eT(eG)}}function eQ(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function e0(e,t,r){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"AES-KW",!0,[r]):(e_(e,t,r),e)}async function e1(e,t,r){let n=await e0(t,e,"wrapKey");eQ(n,e);
8let i=await crypto.subtle.importKey("raw",r,{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.wrapKey("raw",i,n,"AES-KW"))}async function e2(e,t,r){let n=await e0(t,e,"unwrapKey");eQ(n,e);let i=await crypto.subtle.unwrapKey("raw",r,n,"AES-KW",{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.exportKey("raw",i))}function e3(e){return ec(ed(e.length),e)}async function e5(e,t,r){let n=t>>3,i=Math.ceil(n/32),a=new Uint8Array(32*i);for(let t=1;t<=i;t++){let n=new Uint8Array(4+e.length+r.length);n.set(ed(t),0),n.set(e,4),n.set(r,4+e.length);let i=await eb("sha256",n);a.set(i,(t-1)*32)}return a.slice(0,n)}async function e6(e,t,r,n,i=new Uint8Array,a=new Uint8Array){var o;e_(e,"ECDH"),e_(t,"ECDH","deriveBits");let s=ec(e3(ep(r)),e3(i),e3(a),ed(n),new Uint8Array);return e5(new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,"X25519"===(o=e).algorithm.name?256:Math.ceil(parseInt(o.algorithm.namedCurve.slice(-3),10)/8)<<3)),n,s)}function e8(e){switch(e.algorithm.namedCurve){case"P-256":case"P-384":case"P-521":return!0;default:return"X25519"===e.algorithm.name}}async function e4(e,t,r,n){if(!(e instanceof Uint8Array)||e.length<8)throw new eC("PBES2 Salt Input must be 8 or more octets");if(!Number.isSafeInteger(r)||1!==Math.sign(r))throw new eC("PBES2 Count Input must be a positive integer");let i=ec(ep(t),Uint8Array.of(0),e),a=parseInt(t.slice(13,16),10),o={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s=await (n instanceof Uint8Array?crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits"]):(e_(n,t,"deriveBits"),n));return new Uint8Array(await crypto.subtle.deriveBits(o,s,a))}async function e9(e,t,r,n=2048,i=crypto.getRandomValues(new Uint8Array(16))){let a=await e4(i,e,n,t);return{encryptedKey:await e1(e.slice(-6),a,r),p2c:n,p2s:ef(i)}}async function e7(e,t,r,n,i){let a=await e4(i,e,n,t);return e2(e.slice(-6),a,r)}function te(e,t){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}let tt=e=>{switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new eT(`alg ${e} is not supported either by JOSE or your javascript runtime`)}};async function tr(e,t,r){return e_(t,e,"encrypt"),te(e,t),new Uint8Array(await crypto.subtle.encrypt(tt(e),t,r))}async function tn(e,t,r){return e_(t,e,"decrypt"),te(e,t),new Uint8Array(await crypto.subtle.decrypt(tt(e),t,r))}function ti(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ta(...e){let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0}let to=e=>ti(e)&&"string"==typeof e.kty,ts='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function tc(e){if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new eT(ts)}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new eT(ts)}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[e.alg]},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new eT(ts)}break;
8case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new eT(ts)}break;default:throw new eT('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),n={...e};return"AKP"!==n.kty&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,t,e.ext??(!e.d&&!e.priv),e.key_ops??r)}let tl="given KeyObject instance cannot be used for this algorithm",tu=async(e,r,n,i=!1)=>{let a=(t||=new WeakMap).get(e);if(a?.[n])return a[n];let o=await tc({...r,alg:n});return i&&Object.freeze(e),a?a[n]=o:t.set(e,{[n]:o}),o};async function td(e,r){if(e instanceof Uint8Array||e$(e))return e;if(eN(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,r)=>{let n,i=(t||=new WeakMap).get(e);if(i?.[r])return i[r];let a="public"===e.type,o=!!a;if("x25519"===e.asymmetricKeyType){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(tl)}n=e.toCryptoKey(e.asymmetricKeyType,o,a?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==r&&"Ed25519"!==r)throw TypeError(tl);n=e.toCryptoKey(e.asymmetricKeyType,o,[a?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(r!==e.asymmetricKeyType.toUpperCase())throw TypeError(tl);n=e.toCryptoKey(e.asymmetricKeyType,o,[a?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let t;switch(r){case"RSA-OAEP":t="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":t="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":t="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":t="SHA-512";break;default:throw TypeError(tl)}if(r.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:t},o,a?["encrypt"]:["decrypt"]);n=e.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:t},o,[a?"verify":"sign"])}if("ec"===e.asymmetricKeyType){let t=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!t)throw TypeError(tl);let i={ES256:"P-256",ES384:"P-384",ES512:"P-521"};i[r]&&t===i[r]&&(n=e.toCryptoKey({name:"ECDSA",namedCurve:t},o,[a?"verify":"sign"])),r.startsWith("ECDH-ES")&&(n=e.toCryptoKey({name:"ECDH",namedCurve:t},o,a?[]:["deriveBits"]))}if(!n)throw TypeError(tl);return i?i[r]=n:t.set(e,{[r]:n}),n})(e,r)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return tu(e,n,r)}if(to(e))return e.k?eh(e.k):tu(e,e,r,!0);throw Error("unreachable")}async function tp(e,t,r){let n;if(!ti(e))throw TypeError("JWK must be an object");switch(t??=e.alg,n??=r?.extractable??e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return eh(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new eT('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return tc({...e,alg:t,ext:n});case"AKP":if("string"!=typeof e.alg||!e.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw TypeError("JWK alg and alg option value mismatch");return tc({...e,ext:n});case"EC":case"OKP":return tc({...e,alg:t,ext:n});default:throw new eT('Unsupported "kty" (Key Type) Parameter value')}}async function th(e){if(eN(e))if("secret"!==e.type)return e.export({format:"jwk"});else e=e.export();if(e instanceof Uint8Array)return{kty:"oct",k:ef(e)};if(!e$(e))throw TypeError(eE(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:n,use:i,...a}=await crypto.subtle.exportKey("jwk",e);return"AKP"===a.kty&&(a.alg=n),a}async function tf(e){return th(e)}async function tm(e,t,r,n){let i=e.slice(0,7),a=await eY(i,r,t,n,new Uint8Array);return{encryptedKey:a.ciphertext,iv:ef(a.iv),tag:ef(a.tag)}}async function tg(e,t,r,n,i){return eZ(e.slice(0,7),t,r,n,i,new Uint8Array)}e.s(["importJWK",0,tp],286791);let ty='Invalid or unsupported "alg" (JWE Algorithm) header value';function tb(e){if(void 0===e)throw new eC("JWE Encrypted Key missing")}async function tw(e,t,r,n,i){switch(e){case"dir":if(void 0!==r)throw new eC("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new eC("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let i,a;if(!ti(n.epk))throw new eC('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(eL(t),!e8(t))throw new eT("ECDH with the provided key is not allowed or not supported by your javascript runtime");let o=await tp(n.epk,e);if(eL(o),void 0!==n.apu){if("string"!=typeof n.apu)throw new eC('JOSE Header "apu" (Agreement PartyUInfo) invalid');i=ey(n.apu,"apu",eC)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new eC('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=ey(n.apv,"apv",eC)}let s=await e6(o,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?eH(n.enc):parseInt(e.slice(-5,-2),10),i,a);if("ECDH-ES"===e)return s;return tb(r),e2(e.slice(-6),s,r)}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return tb(r),eL(t),tn(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{let a;if(tb(r),"number"!=typeof n.p2c)throw new eC('JOSE Header "p2c" (PBES2 Count) missing or invalid');let o=i?.maxPBES2Count||1e4;if(n.p2c>o)throw new eC('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new eC('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return a=ey(n.p2s,"p2s",eC),e7(e,t,r,n.p2c,a)}
8case"A128KW":case"A192KW":case"A256KW":return tb(r),e2(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(tb(r),"string"!=typeof n.iv)throw new eC('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new eC('JOSE Header "tag" (Authentication Tag) missing or invalid');return tg(e,t,r,ey(n.iv,"iv",eC),ey(n.tag,"tag",eC));default:throw new eT(ty)}}async function t_(e,t,r,n,i={}){let a,o,s;switch(e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let c;if(eL(r),!e8(r))throw new eT("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:l,apv:u}=i;c=i.epk?await td(i.epk,e):(await crypto.subtle.generateKey(r.algorithm,!0,["deriveBits"])).privateKey;let{x:d,y:p,crv:h,kty:f}=await tf(c),m=await e6(r,c,"ECDH-ES"===e?t:e,"ECDH-ES"===e?eH(t):parseInt(e.slice(-5,-2),10),l,u);if(o={epk:{x:d,crv:h,kty:f}},"EC"===f&&(o.epk.y=p),l&&(o.apu=ef(l)),u&&(o.apv=ef(u)),"ECDH-ES"===e){s=m;break}s=n||eD(t);let g=e.slice(-6);a=await e1(g,m,s);break}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||eD(t),eL(r),a=await tr(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||eD(t);let{p2c:c,p2s:l}=i;({encryptedKey:a,...o}=await e9(e,r,s,c,l));break}case"A128KW":case"A192KW":case"A256KW":s=n||eD(t),a=await e1(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||eD(t);let{iv:c}=i;({encryptedKey:a,...o}=await tm(e,r,s,c));break}default:throw new eT(ty)}return{cek:s,encryptedKey:a,parameters:o}}function tv(e,t,r,n,i){let a;if(void 0!==i.crit&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let o of(a=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,n.crit)){if(!a.has(o))throw new eT(`Extension Header Parameter "${o}" is not recognized`);if(void 0===i[o])throw new e(`Extension Header Parameter "${o}" is missing`);if(a.get(o)&&void 0===n[o])throw new e(`Extension Header Parameter "${o}" MUST be integrity protected`)}return new Set(n.crit)}let tE=e=>e?.[Symbol.toStringTag],tk=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let n;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):n=r;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):n=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):n="wrapKey";break;case"decrypt"===r:n=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(n&&t.key_ops?.includes?.(n)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0};function tS(e,t,r){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,r)=>{if(!(t instanceof Uint8Array)){if(to(t)){if("oct"===t.kty&&"string"==typeof t.k&&tk(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!ej(t))throw TypeError(ek(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError(`${tE(t)} instances for symmetric algorithms must be of type "secret"`)}})(e,t,r);break;default:((e,t,r)=>{if(to(t))switch(r){case"decrypt":case"sign":if("oct"!==t.kty&&("AKP"===t.kty&&"string"==typeof t.priv||"string"==typeof t.d)&&tk(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if("oct"!==t.kty&&void 0===t.d&&void 0===t.priv&&tk(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}
8if(!ej(t))throw TypeError(ek(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError(`${tE(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(r){case"sign":throw TypeError(`${tE(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${tE(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(r){case"verify":throw TypeError(`${tE(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${tE(t)} instances for asymmetric algorithm encryption must be of type "public"`)}})(e,t,r)}}function tA(e){if(void 0===globalThis[e])throw new eT(`JWE "zip" (Compression Algorithm) Header Parameter requires the ${e} API.`)}async function tx(e){tA("CompressionStream");let t=new CompressionStream("deflate-raw"),r=t.writable.getWriter();r.write(e).catch(()=>{}),r.close().catch(()=>{});let n=[],i=t.readable.getReader();for(;;){let{value:e,done:t}=await i.read();if(t)break;n.push(e)}return ec(...n)}async function tP(e,t){tA("DecompressionStream");let r=new DecompressionStream("deflate-raw"),n=r.writable.getWriter();n.write(e).catch(()=>{}),n.close().catch(()=>{});let i=[],a=0,o=r.readable.getReader();for(;;){let{value:e,done:r}=await o.read();if(r)break;if(i.push(e),a+=e.byteLength,t!==1/0&&a>t)throw new eC("Decompressed plaintext exceeded the configured limit")}return ec(...i)}class tT{#e;#t;#r;#n;#i;#a;#o;#s;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("plaintext must be an instance of Uint8Array");this.#e=e}setKeyManagementParameters(e){return eg(this.#s,"setKeyManagementParameters"),this.#s=e,this}setProtectedHeader(e){return eg(this.#t,"setProtectedHeader"),this.#t=e,this}setSharedUnprotectedHeader(e){return eg(this.#r,"setSharedUnprotectedHeader"),this.#r=e,this}setUnprotectedHeader(e){return eg(this.#n,"setUnprotectedHeader"),this.#n=e,this}setAdditionalAuthenticatedData(e){return this.#i=e,this}setContentEncryptionKey(e){return eg(this.#a,"setContentEncryptionKey"),this.#a=e,this}setInitializationVector(e){return eg(this.#o,"setInitializationVector"),this.#o=e,this}async encrypt(e,t){let r,n,i,a,o,s;if(!this.#t&&!this.#n&&!this.#r)throw new eC("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!ta(this.#t,this.#n,this.#r))throw new eC("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let c={...this.#t,...this.#n,...this.#r};if(tv(eC,new Map,t?.crit,this.#t,c),void 0!==c.zip&&"DEF"!==c.zip)throw new eT('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value.');if(void 0!==c.zip&&!this.#t?.zip)throw new eC('JWE "zip" (Compression Algorithm) Header Parameter MUST be in a protected header.');let{alg:l,enc:u}=c;if("string"!=typeof l||!l)throw new eC('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof u||!u)throw new eC('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(this.#a&&("dir"===l||"ECDH-ES"===l))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${l}`);tS("dir"===l?u:l,e,"encrypt");{let i,a=await td(e,l);({cek:n,encryptedKey:r,parameters:i}=await t_(l,u,a,this.#a,this.#s)),i&&(t&&em in t?this.#n?this.#n={...this.#n,...i}:this.setUnprotectedHeader(i):this.#t?this.#t={...this.#t,...i}:this.setProtectedHeader(i))}if(this.#t?o=ep(a=ef(JSON.stringify(this.#t))):(a="",o=new Uint8Array),this.#i){let e=ep(s=ef(this.#i));i=ec(o,ep("."),e)}else i=o;let d=this.#e;"DEF"===c.zip&&(d=await tx(d).catch(e=>{throw new eC("Failed to compress plaintext",{cause:e})}));let{ciphertext:p,tag:h,iv:f}=await eY(u,d,n,this.#o,i),m={ciphertext:ef(p)};return f&&(m.iv=ef(f)),h&&(m.tag=ef(h)),r&&(m.encrypted_key=ef(r)),s&&(m.aad=s),this.#t&&(m.protected=a),this.#r&&(m.unprotected=this.#r),this.#n&&(m.header=this.#n),m}}class tR{#c;constructor(e){this.#c=new tT(e)}setContentEncryptionKey(e){return this.#c.setContentEncryptionKey(e),this}setInitializationVector(e){return this.#c.setInitializationVector(e),this}setProtectedHeader(e){return this.#c.setProtectedHeader(e),this}setKeyManagementParameters(e){return this.#c.setKeyManagementParameters(e),this}
8async encrypt(e,t){let r=await this.#c.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}e.s(["CompactEncrypt",0,tR],818448);let tC=e=>Math.floor(e.getTime()/1e3),tU=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function tO(e){let t,r=tU.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let n=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*n);break;case"day":case"days":case"d":t=Math.round(86400*n);break;case"week":case"weeks":case"w":t=Math.round(604800*n);break;default:t=Math.round(0x1e187e0*n)}return"-"===r[1]||"ago"===r[4]?-t:t}function tI(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}let tL=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`;class t${#l;constructor(e){if(!ti(e))throw TypeError("JWT Claims Set MUST be an object");this.#l=structuredClone(e)}data(){return eo.encode(JSON.stringify(this.#l))}get iss(){return this.#l.iss}set iss(e){this.#l.iss=e}get sub(){return this.#l.sub}set sub(e){this.#l.sub=e}get aud(){return this.#l.aud}set aud(e){this.#l.aud=e}set jti(e){this.#l.jti=e}set nbf(e){"number"==typeof e?this.#l.nbf=tI("setNotBefore",e):e instanceof Date?this.#l.nbf=tI("setNotBefore",tC(e)):this.#l.nbf=tC(new Date)+tO(e)}set exp(e){"number"==typeof e?this.#l.exp=tI("setExpirationTime",e):e instanceof Date?this.#l.exp=tI("setExpirationTime",tC(e)):this.#l.exp=tC(new Date)+tO(e)}set iat(e){void 0===e?this.#l.iat=tC(new Date):e instanceof Date?this.#l.iat=tI("setIssuedAt",tC(e)):"string"==typeof e?this.#l.iat=tI("setIssuedAt",tC(new Date)+tO(e)):this.#l.iat=tI("setIssuedAt",e)}}class tN{#a;#o;#s;#t;#u;#d;#p;#h;constructor(e={}){this.#h=new t$(e)}setIssuer(e){return this.#h.iss=e,this}setSubject(e){return this.#h.sub=e,this}setAudience(e){return this.#h.aud=e,this}setJti(e){return this.#h.jti=e,this}setNotBefore(e){return this.#h.nbf=e,this}setExpirationTime(e){return this.#h.exp=e,this}setIssuedAt(e){return this.#h.iat=e,this}setProtectedHeader(e){return eg(this.#t,"setProtectedHeader"),this.#t=e,this}setKeyManagementParameters(e){return eg(this.#s,"setKeyManagementParameters"),this.#s=e,this}setContentEncryptionKey(e){return eg(this.#a,"setContentEncryptionKey"),this.#a=e,this}setInitializationVector(e){return eg(this.#o,"setInitializationVector"),this.#o=e,this}replicateIssuerAsHeader(){return this.#u=!0,this}replicateSubjectAsHeader(){return this.#d=!0,this}replicateAudienceAsHeader(){return this.#p=!0,this}async encrypt(e,t){let r=new tR(this.#h.data());return this.#t&&(this.#u||this.#d||this.#p)&&(this.#t={...this.#t,iss:this.#u?this.#h.iss:void 0,sub:this.#d?this.#h.sub:void 0,aud:this.#p?this.#h.aud:void 0}),r.setProtectedHeader(this.#t),this.#o&&r.setInitializationVector(this.#o),this.#a&&r.setContentEncryptionKey(this.#a),this.#s&&r.setKeyManagementParameters(this.#s),r.encrypt(e,t)}}var tj=e.i(113681),tj=tj;let tH=(e,t)=>{if("string"!=typeof e||!e)throw new eO(`${t} missing or invalid`)};async function tD(e,t){let r,n;if(to(e))r=e;else if(ej(e))r=await tf(e);else throw TypeError(eE(e,"CryptoKey","KeyObject","JSON Web Key"));if("sha256"!==(t??="sha256")&&"sha384"!==t&&"sha512"!==t)throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');switch(r.kty){case"AKP":tH(r.alg,'"alg" (Algorithm) Parameter'),tH(r.pub,'"pub" (Public key) Parameter'),n={alg:r.alg,kty:r.kty,pub:r.pub};break;case"EC":tH(r.crv,'"crv" (Curve) Parameter'),tH(r.x,'"x" (X Coordinate) Parameter'),tH(r.y,'"y" (Y Coordinate) Parameter'),n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":tH(r.crv,'"crv" (Subtype of Key Pair) Parameter'),tH(r.x,'"x" (Public Key) Parameter'),n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":tH(r.e,'"e" (Exponent) Parameter'),tH(r.n,'"n" (Modulus) Parameter'),n={e:r.e,kty:r.kty,n:r.n};break;case"oct":tH(r.k,'"k" (Key Value) Parameter'),n={k:r.k,kty:r.kty};break;default:throw new eT('"kty" (Key Type) Parameter missing or unsupported')}let i=ep(JSON.stringify(n));return ef(await eb(t,i))}function tW(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}
8" option must be an array of strings`);if(t)return new Set(t)}async function tM(e,t,r){let n,i,a,o,s,c;if(!ti(e))throw new eC("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new eC("JOSE Header missing");if(void 0!==e.iv&&"string"!=typeof e.iv)throw new eC("JWE Initialization Vector incorrect type");if("string"!=typeof e.ciphertext)throw new eC("JWE Ciphertext missing or incorrect type");if(void 0!==e.tag&&"string"!=typeof e.tag)throw new eC("JWE Authentication Tag incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new eC("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new eC("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new eC("JWE AAD incorrect type");if(void 0!==e.header&&!ti(e.header))throw new eC("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!ti(e.unprotected))throw new eC("JWE Per-Recipient Unprotected Header incorrect type");if(e.protected)try{let t=eh(e.protected);n=JSON.parse(es.decode(t))}catch{throw new eC("JWE Protected Header is invalid")}if(!ta(n,e.header,e.unprotected))throw new eC("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let l={...n,...e.header,...e.unprotected};if(tv(eC,new Map,r?.crit,n,l),void 0!==l.zip&&"DEF"!==l.zip)throw new eT('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value.');if(void 0!==l.zip&&!n?.zip)throw new eC('JWE "zip" (Compression Algorithm) Header Parameter MUST be in a protected header.');let{alg:u,enc:d}=l;if("string"!=typeof u||!u)throw new eC("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof d||!d)throw new eC("missing JWE Encryption Algorithm (enc) in JWE Header");let p=r&&tW("keyManagementAlgorithms",r.keyManagementAlgorithms),h=r&&tW("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(p&&!p.has(u)||!p&&u.startsWith("PBES2"))throw new eP('"alg" (Algorithm) Header Parameter value not allowed');if(h&&!h.has(d))throw new eP('"enc" (Encryption Algorithm) Header Parameter value not allowed');void 0!==e.encrypted_key&&(i=ey(e.encrypted_key,"encrypted_key",eC));let f=!1;"function"==typeof t&&(t=await t(n,e),f=!0),tS("dir"===u?d:u,t,"decrypt");let m=await td(t,u);try{a=await tw(u,m,i,l,r)}catch(e){if(e instanceof TypeError||e instanceof eC||e instanceof eT)throw e;a=eD(d)}void 0!==e.iv&&(o=ey(e.iv,"iv",eC)),void 0!==e.tag&&(s=ey(e.tag,"tag",eC));let g=void 0!==e.protected?ep(e.protected):new Uint8Array;c=void 0!==e.aad?ec(g,ep("."),ep(e.aad)):g;let y=ey(e.ciphertext,"ciphertext",eC),b=await eZ(d,a,y,o,s,c),w={plaintext:b};if("DEF"===l.zip){let e=r?.maxDecompressedLength??25e4;if(0===e)throw new eT('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');if(e!==1/0&&(!Number.isSafeInteger(e)||e<1))throw TypeError("maxDecompressedLength must be 0, a positive safe integer, or Infinity");w.plaintext=await tP(b,e).catch(e=>{if(e instanceof eC)throw e;throw new eC("Failed to decompress plaintext",{cause:e})})}return(void 0!==e.protected&&(w.protectedHeader=n),void 0!==e.aad&&(w.additionalAuthenticatedData=ey(e.aad,"aad",eC)),void 0!==e.unprotected&&(w.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(w.unprotectedHeader=e.header),f)?{...w,key:m}:w}async function tK(e,t,r){if(e instanceof Uint8Array&&(e=es.decode(e)),"string"!=typeof e)throw new eC("Compact JWE must be a string or Uint8Array");let{0:n,1:i,2:a,3:o,4:s,length:c}=e.split(".");if(5!==c)throw new eC("Invalid Compact JWE");let l=await tM({ciphertext:o,iv:a||void 0,protected:n,tag:s||void 0,encrypted_key:i||void 0},t,r),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return"function"==typeof t?{...u,key:l.key}:u}async function tB(e,t,r){let n=await tK(e,t,r),i=function(e,t,r={}){var n,i;let a,o;try{a=JSON.parse(es.decode(t))}catch{}if(!ti(a))throw new eU("JWT Claims Set must be a top-level JSON object");let{typ:s}=r;if(s&&("string"!=typeof e.typ||tL(e.typ)!==tL(s)))throw new eA('unexpected "typ" JWT header value',a,"typ","check_failed");let{requiredClaims:c=[],issuer:l,subject:u,audience:d,maxTokenAge:p}=r,h=[...c];for(let e of(void 0!==p&&h.push("iat"),void 0!==d&&h.push("aud"),void 0!==u&&h.push("sub"),void 0!==l&&h.push("iss"),new Set(h.reverse())))if(!(e in a))throw new eA(`missing required "${e}" claim`,a,e,"missing");if(l&&!(Array.isArray(l)?l:[l]).includes(a.iss))throw new eA('unexpected "iss" claim value',a,"iss","check_failed");if(u&&a.sub!==u)throw new eA('unexpected "sub" claim value',a,"sub","check_failed");if(d&&(n=a.aud,i="string"==typeof d?[d]:d,"string"==typeof n?!i.includes(n):!(Array.isArray(n)&&i.some(Set.prototype.has.bind(new Set(n))))))throw new eA('unexpected "aud" claim value',a,"aud","check_failed");switch(typeof r.clockTolerance){case"string":o=tO(r.clockTolerance);break;case"number":o=r.clockTolerance;break;case"undefined":o=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:f}=r,m=tC(f||new Date);if((void 0!==a.iat||p)&&"number"!=typeof a.iat)throw new eA('"iat" claim must be a number',a,"iat","invali
8d");if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw new eA('"nbf" claim must be a number',a,"nbf","invalid");if(a.nbf>m+o)throw new eA('"nbf" claim timestamp check failed',a,"nbf","check_failed")}if(void 0!==a.exp){if("number"!=typeof a.exp)throw new eA('"exp" claim must be a number',a,"exp","invalid");if(a.exp<=m-o)throw new ex('"exp" claim timestamp check failed',a,"exp","check_failed")}if(p){let e=m-a.iat;if(e-o>("number"==typeof p?p:tO(p)))throw new ex('"iat" claim timestamp check failed (too far in the past)',a,"iat","check_failed");if(e<0-o)throw new eA('"iat" claim timestamp check failed (it should be in the past)',a,"iat","check_failed")}return a}(n.protectedHeader,n.plaintext,r),{protectedHeader:a}=n;if(void 0!==a.iss&&a.iss!==i.iss)throw new eA('replicated "iss" claim header parameter mismatch',i,"iss","mismatch");if(void 0!==a.sub&&a.sub!==i.sub)throw new eA('replicated "sub" claim header parameter mismatch',i,"sub","mismatch");if(void 0!==a.aud&&JSON.stringify(a.aud)!==JSON.stringify(i.aud))throw new eA('replicated "aud" claim header parameter mismatch',i,"aud","mismatch");let o={payload:i,protectedHeader:a};return"function"==typeof t?{...o,key:n.key}:o}let tJ=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,tq=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,tz=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,tF=/^[\u0020-\u003A\u003D-\u007E]*$/,tX=Object.prototype.toString,tV=((a=function(){}).prototype=Object.create(null),a);function tG(e,t,r){do{let r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<r)return r}function tY(e,t,r){for(;t>r;){let r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return r}function tZ(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}e.s(["parse",0,function(e,t){let r=new tV,n=e.length;if(n<2)return r;let i=t?.decode||tZ,a=0;do{let t=e.indexOf("=",a);if(-1===t)break;let o=e.indexOf(";",a),s=-1===o?n:o;if(t>s){a=e.lastIndexOf(";",t-1)+1;continue}let c=tG(e,a,t),l=tY(e,t,c),u=e.slice(c,l);if(void 0===r[u]){let n=tG(e,t+1,s),a=tY(e,s,n),o=i(e.slice(n,a));r[u]=o}a=s+1}while(a<n)return r},"serialize",0,function(e,t,r){let n=r?.encode||encodeURIComponent;if(!tJ.test(e))throw TypeError(`argument name is invalid: ${e}`);let i=n(t);if(!tq.test(i))throw TypeError(`argument val is invalid: ${t}`);let a=e+"="+i;if(!r)return a;
8if(void 0!==r.maxAge){if(!Number.isInteger(r.maxAge))throw TypeError(`option maxAge is invalid: ${r.maxAge}`);a+="; Max-Age="+r.maxAge}if(r.domain){if(!tz.test(r.domain))throw TypeError(`option domain is invalid: ${r.domain}`);a+="; Domain="+r.domain}if(r.path){if(!tF.test(r.path))throw TypeError(`option path is invalid: ${r.path}`);a+="; Path="+r.path}if(r.expires){var o;if(o=r.expires,"[object Date]"!==tX.call(o)||!Number.isFinite(r.expires.valueOf()))throw TypeError(`option expires is invalid: ${r.expires}`);a+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(a+="; HttpOnly"),r.secure&&(a+="; Secure"),r.partitioned&&(a+="; Partitioned"),r.priority)switch("string"==typeof r.priority?r.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw TypeError(`option priority is invalid: ${r.priority}`)}if(r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${r.sameSite}`)}return a}],712654);var tQ=e.i(712654);let{parse:t0}=tQ,t1="A256CBC-HS512";async function t2(e){let{token:t={},secret:r,maxAge:n=2592e3,salt:i}=e,a=Array.isArray(r)?r:[r],o=await t5(t1,a[0],i),s=await tD({kty:"oct",k:tj.encode(o)},`sha${o.byteLength<<3}`);return await new tN(t).setProtectedHeader({alg:"dir",enc:t1,kid:s}).setIssuedAt().setExpirationTime((Date.now()/1e3|0)+n).setJti(crypto.randomUUID()).encrypt(o)}async function t3(e){let{token:t,secret:r,salt:n}=e,i=Array.isArray(r)?r:[r];if(!t)return null;let{payload:a}=await tB(t,async({kid:e,enc:t})=>{for(let r of i){let i=await t5(t,r,n);if(void 0===e||e===await tD({kty:"oct",k:tj.encode(i)},`sha${i.byteLength<<3}`))return i}throw Error("no matching decryption secret")},{clockTolerance:15,keyManagementAlgorithms:["dir"],contentEncryptionAlgorithms:[t1,"A256GCM"]});return a}async function t5(e,t,r){let n;switch(e){case"A256CBC-HS512":n=64;break;case"A256GCM":n=32;break;default:throw Error("Unsupported JWT Content Encryption Algorithm")}return await ea("sha256",t,r,`Auth.js Generated Encryption Key (${r})`,n)}async function t6({options:e,paramValue:t,cookieValue:r}){let{url:n,callbacks:i}=e,a=n.origin;return t?a=await i.redirect({url:t,baseUrl:n.origin}):r&&(a=await i.redirect({url:r,baseUrl:n.origin})),{callbackUrl:a,callbackUrlCookie:a!==r?a:void 0}}let t8="\x1b[31m",t4="\x1b[0m",t9={error(e){let t=e instanceof m?e.type:e.name;if(console.error(`${t8}[auth][error]${t4} ${t}: ${e.message}`),e.cause&&"object"==typeof e.cause&&"err"in e.cause&&e.cause.err instanceof Error){let{err:t,...r}=e.cause;console.error(`${t8}[auth][cause]${t4}:`,t.stack),r&&console.error(`${t8}[auth][details]${t4}:`,JSON.stringify(r,null,2))}else e.stack&&console.error(e.stack.replace(/.*/,"").substring(1))},warn(e){console.warn(`\x1b[33m[auth][warn][${e}]${t4}`,"Read more: https://warnings.authjs.dev")},debug(e,t){console.log(`\x1b[90m[auth][debug]:${t4} ${e}`,JSON.stringify(t,null,2))}};function t7(e){let t={...t9};return e.debug||(t.debug=()=>{}),e.logger?.error&&(t.error=e.logger.error),e.logger?.warn&&(t.warn=e.logger.warn),e.logger?.debug&&(t.debug=e.logger.debug),e.logger??(e.logger=t),t}let re=["providers","session","csrf","signin","signout","callback","verify-request","error","webauthn-options"],{parse:rt,serialize:rr}=tQ;async function rn(e){if(!("body"in e)||!e.body||"POST"!==e.method)return;let t=e.headers.get("content-type");return t?.includes("application/json")?await e.json():t?.includes("application/x-www-form-urlencoded")?Object.fromEntries(new URLSearchParams(await e.text())):void 0}async function ri(e,t){try{if("GET"!==e.method&&"POST"!==e.method)throw new N("Only GET and POST requests are supported");t.basePath??(t.basePath="/auth");let r=new URL(e.url),{action:n,providerId:i}=function(e,t){let r=e.match(RegExp(`^${t}(.+)`));if(null===r)throw new N(`Cannot parse action at ${e}`);
8let n=r.at(-1).replace(/^\//,"").split("/").filter(Boolean);if(1!==n.length&&2!==n.length)throw new N(`Cannot parse action at ${e}`);let[i,a]=n;if(!re.includes(i)||a&&!["signin","callback","webauthn-options"].includes(i))throw new N(`Cannot parse action at ${e}`);return{action:i,providerId:"undefined"==a?void 0:a}}(r.pathname,t.basePath);return{url:r,action:n,providerId:i,method:e.method,headers:Object.fromEntries(e.headers),body:e.body?await rn(e):void 0,cookies:rt(e.headers.get("cookie")??"")??{},error:r.searchParams.get("error")??void 0,query:Object.fromEntries(r.searchParams)}}catch(n){let r=t7(t);r.error(n),r.debug("request",e)}}function ra(e){let t=new Headers(e.headers);e.cookies?.forEach(e=>{let{name:r,value:n,options:i}=e,a=rr(r,n,i);t.has("Set-Cookie")?t.append("Set-Cookie",a):t.set("Set-Cookie",a)});let r=e.body;"application/json"===t.get("content-type")?r=JSON.stringify(e.body):"application/x-www-form-urlencoded"===t.get("content-type")&&(r=new URLSearchParams(e.body).toString());let n=new Response(r,{headers:t,status:e.redirect?302:e.status??200});return e.redirect&&n.headers.set("Location",e.redirect),n}async function ro(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>e.toString(16).padStart(2,"0")).join("").toString()}function rs(e){return Array.from(crypto.getRandomValues(new Uint8Array(e))).reduce((e,t)=>e+("0"+t.toString(16)).slice(-2),"")}async function rc({options:e,cookieValue:t,isPost:r,bodyValue:n}){if(t){let[i,a]=t.split("|");if(a===await ro(`${i}${e.secret}`))return{csrfTokenVerified:r&&i===n,csrfToken:i}}let i=rs(32),a=await ro(`${i}${e.secret}`);return{cookie:`${i}|${a}`,csrfToken:i}}function rl(e,t){if(!t)throw new M(`CSRF token was missing during an action ${e}`)}function ru(e){return null!==e&&"object"==typeof e}function rd(e,...t){if(!t.length)return e;let r=t.shift();if(ru(e)&&ru(r))for(let t in r)ru(r[t])?(ru(e[t])||(e[t]=Array.isArray(r[t])?[]:{}),rd(e[t],r[t])):void 0!==r[t]&&(e[t]=r[t]);return rd(e,...t)}let rp=Symbol("skip-csrf-check"),rh=Symbol("return-type-raw"),rf=Symbol("custom-fetch"),rm=Symbol("conform-internal"),rg=e=>rb({id:e.sub??e.id??crypto.randomUUID(),name:e.name??e.nickname??e.preferred_username,email:e.email,image:e.picture}),ry=e=>rb({access_token:e.access_token,id_token:e.id_token,refresh_token:e.refresh_token,expires_at:e.expires_at,scope:e.scope,token_type:e.token_type,session_state:e.session_state});function rb(e){let t={};for(let[r,n]of Object.entries(e))void 0!==n&&(t[r]=n);return t}function rw(e,t){if(!e&&t)return;if("string"==typeof e)return{url:new URL(e)};let r=new URL(e?.url??"https://authjs.dev");if(e?.params!=null)for(let[t,n]of Object.entries(e.params))"claims"===t&&(n=JSON.stringify(n)),r.searchParams.set(t,String(n));return{url:r,request:e?.request,conform:e?.conform,...e?.clientPrivateKey?{clientPrivateKey:e?.clientPrivateKey}:null}}let r_={signIn:()=>!0,redirect:({url:e,baseUrl:t})=>e.startsWith("/")?`${t}${e}`:new URL(e).origin===t?e:t,session:({session:e})=>({user:{name:e.user?.name,email:e.user?.email,image:e.user?.image},expires:e.expires?.toISOString?.()??e.expires}),jwt:({token:e})=>e};async function rv({authOptions:e,providerId:t,action:r,url:n,cookies:i,callbackUrl:a,csrfToken:o,csrfDisabled:s,isPost:c}){var l,u;let d=t7(e),{providers:p,provider:f}=function(e){let{providerId:t,config:r}=e,n=new URL(r.basePath??"/auth",e.url.origin),i=r.providers.map(e=>{let t="function"==typeof e?e():e,{options:i,...a}=t,o=i?.id??a.id,s=rd(a,i,{signinUrl:`${n}/signin/${o}`,callbackUrl:`${n}/callback/${o}`});if("oauth"===t.type||"oidc"===t.type){var c;let e,t,n,a;s.redirectProxyUrl??(s.redirectProxyUrl=i?.redirectProxyUrl??r.redirectProxyUrl);let o=((c=s).issuer&&(c.wellKnown??(c.wellKnown=`${c.issuer}/.well-known/openid-configuration`)),(e=rw(c.authorization,c.issuer))&&!e.url?.searchParams.has("scope")&&e.url.searchParams.set("scope","openid profile email"),t=rw(c.token,c.issuer),n=rw(c.userinfo,c.issuer),a=c.checks??["pkce"],c.redirectProxyUrl&&(a.includes("state")||a.push("state"),c.redirectProxyUrl=`${c.redirectProxyUrl}/callback/${c.id}`),{...c,authorization:e,token:t,checks:a,userinfo:n,profile:c.profile??rg,account:c.account??ry});return o.authorization?.url.searchParams.get("response_mode")==="form_post"&&delete o.redirectProxyUrl,o[rf]??(o[rf]=i?.[rf]),o}return s}),a=i.find(({id:e})=>e===t);if(t&&!a){let e=i.map(e=>e.id).join(", ");
8throw Error(`Provider with id "${t}" not found. Available providers: [${e}].`)}return{providers:i,provider:a}}({url:n,providerId:t,config:e}),m=!1;if((f?.type==="oauth"||f?.type==="oidc")&&f.redirectProxyUrl)try{m=new URL(f.redirectProxyUrl).origin===n.origin}catch{throw TypeError(`redirectProxyUrl must be a valid URL. Received: ${f.redirectProxyUrl}`)}let g={debug:!1,pages:{},theme:{colorScheme:"auto",logo:"",brandColor:"",buttonText:""},...e,url:n,action:r,provider:f,cookies:rd(h(e.useSecureCookies??"https:"===n.protocol),e.cookies),providers:p,session:{strategy:e.adapter?"database":"jwt",maxAge:2592e3,updateAge:86400,generateSessionToken:()=>crypto.randomUUID(),...e.session},jwt:{secret:e.secret,maxAge:e.session?.maxAge??2592e3,encode:t2,decode:t3,...e.jwt},events:(l=e.events??{},u=d,Object.keys(l).reduce((e,t)=>(e[t]=async(...e)=>{try{let r=l[t];return await r(...e)}catch(e){u.error(new v(e))}},e),{})),adapter:function(e,t){if(e)return Object.keys(e).reduce((r,n)=>(r[n]=async(...r)=>{try{t.debug(`adapter_${n}`,{args:r});let i=e[n];return await i(...r)}catch(r){let e=new y(r);throw t.error(e),e}},r),{})}(e.adapter,d),callbacks:{...r_,...e.callbacks},logger:d,callbackUrl:n.origin,isOnRedirectProxy:m,experimental:{...e.experimental}},b=[];if(s)g.csrfTokenVerified=!0;else{let{csrfToken:e,cookie:t,csrfTokenVerified:r}=await rc({options:g,cookieValue:i?.[g.cookies.csrfToken.name],isPost:c,bodyValue:o});g.csrfToken=e,g.csrfTokenVerified=r,t&&b.push({name:g.cookies.csrfToken.name,value:t,options:g.cookies.csrfToken.options})}let{callbackUrl:w,callbackUrlCookie:_}=await t6({options:g,cookieValue:i?.[g.cookies.callbackUrl.name],paramValue:a});return g.callbackUrl=w,_&&b.push({name:g.cookies.callbackUrl.name,value:_,options:g.cookies.callbackUrl.options}),{options:g,cookies:b}}var rE,rk,rS,rA,rx,rP,rT,rR,rC,rU,rO,rI,rL,r$,rN,rj,rH,rD,rW,rM={},rK=[],rB=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rJ=Array.isArray;function rq(e,t){for(var r in t)e[r]=t[r];return e}function rz(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function rF(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++rI:i,__i:-1,__u:0};return null==i&&null!=rO.vnode&&rO.vnode(a),a}function rX(e){return e.children}function rV(e,t){this.props=e,this.context=t}function rG(e,t){if(null==t)return e.__?rG(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?rG(e):null}function rY(e){(!e.__d&&(e.__d=!0)&&rL.push(e)&&!rZ.__r++||r$!==rO.debounceRendering)&&((r$=rO.debounceRendering)||rN)(rZ)}function rZ(){var e,t,r,n,i,a,o,s;for(rL.sort(rj);e=rL.shift();)e.__d&&(t=rL.length,n=void 0,a=(i=(r=e).__v).__e,o=[],s=[],r.__P&&((n=rq({},i)).__v=i.__v+1,rO.vnode&&rO.vnode(n),r3(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[a]:null,o,null==a?rG(i):a,!!(32&i.__u),s),n.__v=i.__v,n.__.__k[n.__i]=n,function(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)r5(r[n],r[++n],r[++n]);rO.__c&&rO.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){rO.__e(e,t.__v)}})}(o,n,s),n.__e!=a&&function e(t){var r,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,r=0;r<t.__k.length;r++)if(null!=(n=t.__k[r])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return e(t)}}(n)),rL.length>t&&rL.sort(rj));rZ.__r=0}function rQ(e,t,r,n,i,a,o,s,c,l,u){var d,p,h,f,m,g=n&&n.__k||rK,y=t.length;for(r.__d=c,function(e,t,r){var n,i,a,o,s,c=t.length,l=r.length,u=l,d=0;for(e.__k=[],n=0;n<c;n++)null!=(i=t[n])&&"boolean"!=typeof i&&"function"!=typeof i?(o=n+d,(i=e.__k[n]="string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?rF(null,i,null,null,null):rJ(i)?rF(rX,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?rF(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,a=null,-1!==(s=i.__i=function(e,t,r,n){var i=e.key,a=e.type,o=r-1,s=r+1,c=t[r];if(null===c||c&&i==c.key&&a===c.type&&0==(131072&c.__u))return r;if(n>+(null!=c&&0==(131072&c.__u)))for(;o>=0||s<t.length;){if(o>=0){if((c=t[o])&&0==(131072&c.__u)&&i==c.key&&a===c.type)return o;o--}if(s<t.length){if((c=t[s])&&0==(131072&c.__u)&&i==c.key&&a===c.type)return s;s++}}return -1}(i,r,o,u))&&(u--,(a=r[s])&&(a.__u|=131072)),null==a||null===a.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==o&&(s==o-1?d--:s==o+1?d++:(s>o?d--:d++,i.__u|=65536))):i=e.__k[n]=null;if(u)for(n=0;n<l;n++)null!=(a=r[n])&&0==(131072&a.__u)&&(a.__e==e.__d&&(e.__d=rG(a)),function e(t,r,n){var i,a;if(rO.unmount&&rO.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||r5(i,null,r)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){rO.__e(e,r)}i.base=i.__P=null}if(i=t.__k)for(a=0;a<i.length;a++)i[a]&&e(i[a],r,n||"function"!=typeof t.type);n||rz(t.__e),t.__c=t.__=t.__e=t.__d=void 0}(a,a))}(r,t,g),c=r.__d,d=0;d<y;d++)null!=(h=r.__k[d])&&(p=-1===h.__i?rM:g[h.__i]||rM,h.__i=d,r3(e,h,p,i,a,o,s,c,l,u),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&r5(p.ref,null,h),u.push(h.ref,h.__c||f,h)),null==m&&null!=f&&(m=f),65536&h.__u||p.__k===h.__k?c=function e(t,r,n){var i,a;if("function"==typeof t.type){for(i=t.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=t,r=e(i[a],r,n));return r}t.__e!=r&&(r&&t.type&&!n.contains(r)&&(r=rG(t)),n.insertBefore(t.__e,r||null),r=t.__e);do r=r&&r.nextSibling;
vendor: 5,108 bytes, line 8
8while(null!=r&&8===r.nodeType)return r}(h,c,e):"function"==typeof h.type&&void 0!==h.__d?c=h.__d:f&&(c=f.nextSibling),h.__d=void 0,h.__u&=-196609);r.__d=c,r.__e=m}function r0(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||rB.test(t)?r:r+"px"}function r1(e,t,r,n,i){var a;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||r0(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||r0(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])a=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n?r.u=n.u:(r.u=rH,e.addEventListener(t,a?rW:rD,a)):e.removeEventListener(t,a?rW:rD,a);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function r2(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=rH++;else if(t.t<r.u)return;return r(rO.event?rO.event(t):t)}}}function r3(e,t,r,n,i,a,o,s,c,l){var u,d,p,h,f,m,g,y,b,w,_,v,E,k,S,A,x=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(c=!!(32&r.__u),a=[s=t.__e=r.__e]),(u=rO.__b)&&u(t);e:if("function"==typeof x)try{if(y=t.props,b="prototype"in x&&x.prototype.render,w=(u=x.contextType)&&n[u.__c],_=u?w?w.props.value:u.__:n,r.__c?g=(d=t.__c=r.__c).__=d.__E:(b?t.__c=d=new x(y,_):(t.__c=d=new rV(y,_),d.constructor=x,d.render=r6),w&&w.sub(d),d.props=y,d.state||(d.state={}),d.context=_,d.__n=n,p=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=x.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=rq({},d.__s)),rq(d.__s,x.getDerivedStateFromProps(y,d.__s))),h=d.props,f=d.state,d.__v=t,p)b&&null==x.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==x.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,_),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,_)||t.__v===r.__v)){for(t.__v!==r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),v=0;v<d._sb.length;v++)d.__h.push(d._sb[v]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,_),b&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(h,f,m)})}if(d.context=_,d.props=y,d.__P=e,d.__e=!1,E=rO.__r,k=0,b){for(d.state=d.__s,d.__d=!1,E&&E(t),u=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do d.__d=!1,E&&E(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++k<25)d.state=d.__s,null!=d.getChildContext&&(n=rq(rq({},n),d.getChildContext())),b&&!p&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(h,f)),rQ(e,rJ(A=null!=u&&u.type===rX&&null==u.key?u.props.children:u)?A:[A],t,r,n,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){if(t.__v=null,c||null!=a){for(t.__u|=c?160:128;s&&8===s.nodeType&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else t.__e=r.__e,t.__k=r.__k;rO.__e(e,t,r)}else null==a&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,i,a,o,s,c){var l,u,d,p,h,f,m,g=r.props,y=t.props,b=t.type;if("svg"===b?i="http://www.w3.org/2000/svg":"math"===b?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a){for(l=0;l<a.length;l++)if((h=a[l])&&"setAttribute"in h==!!b&&(b?h.localName===b:3===h.nodeType)){e=h,a[l]=null;break}}if(null==e){if(null===b)return document.createTextNode(y);e=document.createElementNS(i,b,y.is&&y),s&&(rO.__m&&rO.__m(t,a),s=!1),a=null}if(null===b)g===y||s&&e.data===y||(e.data=y);else{if(a=a&&rU.call(e.childNodes),g=r.props||rM,!s&&null!=a)for(g={},l=0;l<e.attributes.length;l++)g[(h=e.attributes[l]).name]=h.value;for(l in g)if(h=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=h;else if(!(l in y)){if("value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y)continue;r1(e,l,null,h,i)}for(l in y)h=y[l],"children"==l?p=h:"dangerouslySetInnerHTML"==l?u=h:"value"==l?f=h:"checked"==l?m=h:s&&"function"!=typeof h||g[l]===h||r1(e,l,h,g[l],i);if(u)s||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),rQ(e,rJ(p)?p:[p],t,r,n,"foreignObject"===b?"http://www.w3.org/1999/xhtml":i,a,o,a?a[0]:r.__k&&rG(r,0),s,c),null!=a)for(l=a.length;l--;)rz(a[l]);s||(l="value","progress"===b&&null==f?e.removeAttribute("value"):void 0===f||f===e[l]&&("progress"!==b||f)&&("option"!==b||f===g[l])||r1(e,l,f,g[l],i),l="checked",void 0!==m&&m!==e[l]&&r1(e,l,m,g[l],i))}return e}(r.__e,t,r,n,i,a,o,c,l);(u=rO.diffed)&&u(t)}
8function r5(e,t,r){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){rO.__e(e,r)}}function r6(e,t,r){return this.constructor(e,r)}rU=rK.slice,rO={__e:function(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&null!=a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},rI=0,rV.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=rq({},this.state),"function"==typeof e&&(e=e(rq({},r),this.props)),e&&rq(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),rY(this))},rV.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),rY(this))},rV.prototype.render=rX,rL=[],rN="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rj=function(e,t){return e.__v.__b-t.__v.__b},rZ.__r=0,rH=0,rD=r2(!1),rW=r2(!0);var r8=/[\s\n\\/='"\0<>]/,r4=/^(xlink|xmlns|xml)([A-Z])/,r9=/^accessK|^auto[A-Z]|^cell|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z]/,r7=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,ne=new Set(["draggable","spellcheck"]),nt=/["&<]/;function nr(e){if(0===e.length||!1===nt.test(e))return e;for(var t=0,r=0,n="",i="";r<e.length;r++){switch(e.charCodeAt(r)){case 34:i=""";break;case 38:i="&";break;case 60:i="<";break;default:continue}r!==t&&(n+=e.slice(t,r)),n+=i,t=r+1}return r!==t&&(n+=e.slice(t,r)),n}var nn={},ni=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","opacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),na=/[A-Z]/g;function no(){this.__d=!0}function ns(e,t,r){if(!e.s){if(r instanceof np){if(!r.s)return void(r.o=ns.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(ns.bind(null,e,t),ns.bind(null,e,2));e.s=t,e.v=r;let n=e.o;n&&n(e)}}var nc,nl,nu,nd,np=function(){function e(){}return e.prototype.then=function(t,r){var n=new e,i=this.s;if(i){var a=1&i?t:r;if(a){try{ns(n,1,a(this.v))}catch(e){ns(n,2,e)}return n}return this}return this.o=function(e){try{var i=e.v;1&e.s?ns(n,1,t?t(i):i):r?ns(n,1,r(i)):ns(n,2,i)}catch(e){ns(n,2,e)}},n},e}(),nh={},nf=[],nm=Array.isArray,ng=Object.assign;function ny(e,t){var r,n=e.type,i=!0;return e.__c?(i=!1,(r=e.__c).state=r.__s):r=new n(e.props,t),e.__c=r,r.__v=e,r.props=e.props,r.context=t,r.__d=!0,null==r.state&&(r.state=nh),null==r.__s&&(r.__s=r.state),n.getDerivedStateFromProps?r.state=ng({},r.state,n.getDerivedStateFromProps(r.props,r.state)):i&&r.componentWillMount?(r.componentWillMount(),r.state=r.__s!==r.state?r.__s:r.state):!i&&r.componentWillUpdate&&r.componentWillUpdate(),nu&&nu(e),r.render(r.props,r.state,t)}var nb=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),nw=0;function n_(e,t,r,n,i,a){t||(t={});var o,s,c=t;"ref"in t&&(o=t.ref,delete t.ref);var l={type:e,props:c,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--nw,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===c[s]&&(c[s]=o[s]);return rO.vnode&&rO.vnode(l),l}async function nv(e,t){let r=window.SimpleWebAuthnBrowser;async function n(r){let n=new URL(`${e}/webauthn-options/${t}`);
8r&&n.searchParams.append("action",r),a().forEach(e=>{n.searchParams.append(e.name,e.value)});let i=await fetch(n);return i.ok?i.json():void console.error("Failed to fetch options",i)}function i(){let e=`#${t}-form`,r=document.querySelector(e);if(!r)throw Error(`Form '${e}' not found`);return r}function a(){return Array.from(i().querySelectorAll("input[data-form-field]"))}async function o(e,t){let r=i();if(e){let t=document.createElement("input");t.type="hidden",t.name="action",t.value=e,r.appendChild(t)}if(t){let e=document.createElement("input");e.type="hidden",e.name="data",e.value=JSON.stringify(t),r.appendChild(e)}return r.submit()}async function s(e,t){let n=await r.startAuthentication(e,t);return await o("authenticate",n)}async function c(e){a().forEach(e=>{if(e.required&&!e.value)throw Error(`Missing required field: ${e.name}`)});let t=await r.startRegistration(e);return await o("register",t)}async function l(){if(!r.browserSupportsWebAuthnAutofill())return;let e=await n("authenticate");if(!e)return void console.error("Failed to fetch option for autofill authentication");try{await s(e.options,!0)}catch(e){console.error(e)}}(async function(){let e=i();if(!r.browserSupportsWebAuthn()){e.style.display="none";return}e&&e.addEventListener("submit",async e=>{e.preventDefault();let t=await n(void 0);if(!t)return void console.error("Failed to fetch options for form submission");if("authenticate"===t.action)try{await s(t.options,!1)}catch(e){console.error(e)}else if("register"===t.action)try{await c(t.options)}catch(e){console.error(e)}})})(),l()}let nE={default:"Unable to sign in.",Signin:"Try signing in with a different account.",OAuthSignin:"Try signing in with a different account.",OAuthCallbackError:"Try signing in with a different account.",OAuthCreateAccount:"Try signing in with a different account.",EmailCreateAccount:"Try signing in with a different account.",Callback:"Try signing in with a different account.",OAuthAccountNotLinked:"To confirm your identity, sign in with the same account you used originally.",EmailSignin:"The e-mail could not be sent.",CredentialsSignin:"Sign in failed. Check the details you provided are correct.",SessionRequired:"Please sign in to access this page."},nk=`:root { 9 --border-width: 1px; 10 --border-radius: 0.5rem; 11 --color-error: #c94b4b; 12 --color-info: #157efb; 13 --color-info-hover: #0f6ddb; 14 --color-info-text: #fff; 15} 16 17.__next-auth-theme-auto, 18.__next-auth-theme-light { 19 --color-background: #ececec; 20 --color-background-hover: rgba(236, 236, 236, 0.8); 21 --color-background-card: #fff; 22 --color-text: #000; 23 --color-primary: #444; 24 --color-control-border: #bbb; 25 --color-button-active-background: #f9f9f9; 26 --color-button-active-border: #aaa; 27 --color-separator: #ccc; 28 --provider-bg: #fff; 29 --provider-bg-hover: color-mix( 30 in srgb, 31 var(--provider-brand-color) 30%, 32 #fff 33 ); 34} 35 36.__next-auth-theme-dark { 37 --color-background: #161b22; 38 --color-background-hover: rgba(22, 27, 34, 0.8); 39 --color-background-card: #0d1117; 40 --color-text: #fff; 41 --color-primary: #ccc; 42 --color-control-border: #555; 43 --color-button-active-background: #060606; 44 --color-button-active-border: #666; 45 --color-separator: #444; 46 --provider-bg: #161b22; 47 --provider-bg-hover: color-mix( 48 in srgb, 49 var(--provider-brand-color) 30%, 50 #000 51 ); 52} 53 54.__next-auth-theme-dark img[src$="42-school.svg"], 55 .__next-auth-theme-dark img[src$="apple.svg"], 56 .__next-auth-theme-dark img[src$="boxyhq-saml.svg"], 57 .__next-auth-theme-dark img[src$="eveonline.svg"], 58 .__next-auth-theme-dark img[src$="github.svg"], 59 .__next-auth-theme-dark img[src$="mailchimp.svg"], 60 .__next-auth-theme-dark img[src$="medium.svg"], 61 .__next-auth-theme-dark img[src$="okta.svg"], 62 .__next-auth-theme-dark img[src$="patreon.svg"], 63 .__next-auth-theme-dark img[src$="ping-id.svg"], 64 .__next-auth-theme-dark img[src$="roblox.svg"], 65 .__next-auth-theme-dark img[src$="threads.svg"], 66 .__next-auth-theme-dark img[src$="wikimedia.svg"] { 67 filter: invert(1); 68 } 69 70.__next-auth-theme-dark #submitButton { 71 background-color: var(--provider-bg, var(--color-info)); 72 } 73 74@media (prefers-color-scheme: dark) { 75 .__next-auth-theme-auto { 76 --color-background: #161b22; 77 --color-background-hover: rgba(22, 27, 34, 0.8); 78 --color-background-card: #0d1117; 79 --color-text: #fff; 80 --color-primary: #ccc; 81 --color-control-border: #555; 82 --color-button-active-background: #060606; 83 --color-button-active-border: #666; 84 --color-separator: #444; 85 --provider-bg: #161b22; 86 --provider-bg-hover: color-mix( 87 in srgb, 88 var(--provider-brand-color) 30%, 89 #000 90 ); 91 } 92 .__next-auth-theme-auto img[src$="42-school.svg"], 93 .__next-auth-theme-auto img[src$="apple.svg"], 94 .__next-auth-theme-auto img[src$="boxyhq-saml.svg"], 95 .__next-auth-theme-auto img[src$="eveonline.svg"], 96 .__next-auth-theme-auto img[src$="github.svg"], 97 .__next-auth-theme-auto img[src$="mailchimp.svg"], 98 .__next-auth-theme-auto img[src$="medium.svg"], 99 .__next-auth-theme-auto img[src$="okta.svg"], 100 .__next-auth-theme-auto img[src$="patreon.svg"], 101 .__next-auth-theme-auto img[src$="ping-id.svg"], 102 .__next-auth-theme-auto img[src$="roblox.svg"], 103 .__next-auth-theme-auto img[src$="threads.svg"], 104 .__next-auth-theme-auto img[src$="wikimedia.svg"] { 105 filter: invert(1); 106 } 107 .__next-auth-theme-auto #submitButton { 108 background-color: var(--provider-bg, var(--color-info)); 109 } 110} 111 112html { 113 box-sizing: border-box; 114} 115 116*, 117*:before, 118*:after { 119 box-sizing: inherit; 120 margin: 0; 121 padding: 0; 122} 123 124body { 125 background-color: var(--color-background); 126 margin: 0; 127 padding: 0; 128 font-family: 129 ui-sans-serif, 130 system-ui, 131 -apple-system, 132 BlinkMacSystemFont, 133 "Segoe UI", 134 Roboto, 135 "Helvetica Neue", 136 Arial, 137 "Noto Sans", 138 sans-serif, 139 "Apple Color Emoji", 140 "Segoe UI Emoji", 141 "Segoe UI Symbol", 142 "Noto Color Emoji"; 143} 144 145h1 { 146 margin-bottom: 1.5rem; 147 padding: 0 1rem; 148 font-weight: 400; 149 color: var(--color-text); 150} 151 152p { 153 margin-bottom: 1.5rem; 154 padding: 0 1rem; 155 color: var(--color-text); 156} 157 158form { 159 margin: 0; 160 padding: 0; 161} 162 163label { 164 font-weight: 500; 165 text-align: left; 166 margin-bottom: 0.25rem; 167 display: block; 168 color: var(--color-text); 169} 170 171input[type] { 172 box-sizing: border-box; 173 display: block; 174 width: 100%; 175 padding: 0.5rem 1rem; 176 border: var(--border-width) solid var(--color-control-border); 177 background: var(--color-background-card); 178 font-size: 1rem; 179 border-radius: var(--border-radius); 180 color: var(--color-text); 181} 182 183p { 184 font-size: 1.1rem; 185 line-height: 2rem; 186} 187 188a.button { 189 text-decoration: none; 190 line-height: 1rem; 191} 192 193a.button:link, 194 a.button:visited { 195 background-color: var(--color-background); 196 color: var(--color-primary); 197 } 198 199button, 200a.button { 201 padding: 0.75rem 1rem; 202 color: var(--provider-color, var(--color-primary)); 203 background-color: var(--provider-bg, var(--color-background)); 204 border: 1px solid #00000031; 205 font-size: 0.9rem; 206 height: 50px; 207 border-radius: var(--border-radius); 208 transition: background-color 250ms ease-in-out; 209 font-weight: 300; 210 position: relative; 211 display: flex; 212 align-items: center; 213 justify-content: space-between; 214} 215 216:is(button,a.button):hover { 217 background-color: var(--provider-bg-hover, var(--color-background-hover)); 218 cursor: pointer; 219 } 220 221:is(button,a.button):active { 222 cursor: pointer; 223 } 224 225:is(button,a.button) span { 226 color: var(--provider-bg); 227 } 228 229#submitButton { 230 color: var(--button-text-color, var(--color-info-text)); 231 background-color: var(--brand-color, var(--color-info)); 232 width: 100%; 233} 234 235#submitButton:hover { 236 background-color: var( 237 --button-hover-bg, 238 var(--color-info-hover) 239 ) !important; 240 } 241 242a.site { 243 color: var(--color-primary); 244 text-decoration: none; 245 font-size: 1rem; 246 line-height: 2rem; 247} 248 249a.site:hover { 250 text-decoration: underline; 251 } 252 253.page { 254 position: absolute; 255 width: 100%; 256 height: 100%; 257 display: grid; 258 place-items: center; 259 margin: 0; 260 padding: 0; 261 box-sizing: border-box; 262} 263 264.page > div { 265 text-align: center; 266 } 267 268.error a.button { 269 padding-left: 2rem; 270 padding-right: 2rem; 271 margin-top: 0.5rem; 272 } 273 274.error .message { 275 margin-bottom: 1.5rem; 276 } 277 278.signin input[type="text"] { 279 margin-left: auto; 280 margin-right: auto; 281 display: block; 282 } 283 284.signin hr { 285 display: block; 286 border: 0; 287 border-top: 1px solid var(--color-separator); 288 margin: 2rem auto 1rem auto; 289 overflow: visible; 290 } 291 292.signin hr::before { 293 content: "or"; 294 background: var(--color-background-card); 295 color: #888; 296 padding: 0 0.4rem; 297 position: relative; 298 top: -0.7rem; 299 } 300 301.signin .error { 302 background: #f5f5f5; 303 font-weight: 500; 304 border-radius: 0.3rem; 305 background: var(--color-error); 306 } 307 308.signin .error p { 309 text-align: left; 310 padding: 0.5rem 1rem; 311 font-size: 0.9rem; 312 line-height: 1.2rem; 313 color: var(--color-info-text); 314 } 315 316.signin > div, 317 .signin form { 318 display: block; 319 } 320 321.signin > div input[type], .signin form input[type] { 322 margin-bottom: 0.5rem; 323 } 324 325.signin > div button, .signin form button { 326 width: 100%; 327 } 328 329.signin .provider + .provider { 330 margin-top: 1rem; 331 } 332 333.logo { 334 display: inline-block; 335 max-width: 150px; 336 margin: 1.25rem 0; 337 max-height: 70px; 338} 339 340.card { 341 background-color: var(--color-background-card); 342 border-radius: 1rem; 343 padding: 1.25rem 2rem; 344} 345 346.card .header { 347 color: var(--color-primary); 348 } 349 350.card input[type]::-moz-placeholder { 351 color: color-mix( 352 in srgb, 353 var(--color-text) 20%, 354 var(--color-button-active-background) 355 ); 356 } 357 358.card input[type]::placeholder { 359 color: color-mix( 360 in srgb, 361 var(--color-text) 20%, 362 var(--color-button-active-background) 363 ); 364 } 365 366.card input[type] { 367 background: color-mix(in srgb, var(--color-background-card) 95%, black); 368 } 369 370.section-header { 371 color: var(--color-text); 372} 373 374@media screen and (min-width: 450px) { 375 .card { 376 margin: 2rem 0; 377 width: 368px; 378 } 379} 380 381@media screen and (max-width: 450px) { 382 .card { 383 margin: 1rem 0; 384 width: 343px; 385 } 386} 387`;function nS({html:e,title:t,status:r,cookies:n,theme:i,headTags:a}){return{cookies:n,status:r,headers:{"Content-Type":"text/html"},body:`<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><style>${nk}</style><title>${t}</title>${a??""}</head><body class="__next-auth-theme-${i?.colorScheme??"auto"}"><div class="page">${function(e){var t=rO.__s;rO.__s=!0,nc=rO.__b,nl=rO.diffed,nu=rO.__r,nd=rO.unmount;var r=function(e,t,r){var n,i,a,o={};for(a in t)"key"==a?n=t[a]:"ref"==a?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?rU.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]
387);return rF(e,o,n,i,null)}(rX,null);r.__k=[e];try{var n=function e(t,r,n,i,a,o,s){if(null==t||!0===t||!1===t||""===t)return"";var c=typeof t;if("object"!=c)return"function"==c?"":"string"==c?nr(t):t+"";if(nm(t)){var l,u="";a.__k=t;for(var d=0;d<t.length;d++){var p=t[d];if(null!=p&&"boolean"!=typeof p){var h,f=e(p,r,n,i,a,o,s);"string"==typeof f?u+=f:(l||(l=[]),u&&l.push(u),u="",nm(f)?(h=l).push.apply(h,f):l.push(f))}}return l?(u&&l.push(u),l):u}if(void 0!==t.constructor)return"";t.__=a,nc&&nc(t);var m=t.type,g=t.props;if("function"==typeof m){var y,b,w,_=r;if(m===rX){if("tpl"in g){for(var v="",E=0;E<g.tpl.length;E++)if(v+=g.tpl[E],g.exprs&&E<g.exprs.length){var k=g.exprs[E];if(null==k)continue;"object"==typeof k&&(void 0===k.constructor||nm(k))?v+=e(k,r,n,i,t,o,s):v+=k}return v}if("UNSTABLE_comment"in g)return"<!--"+nr(g.UNSTABLE_comment)+"-->";b=g.children}else{if(null!=(y=m.contextType)){var S=r[y.__c];_=S?S.props.value:y.__}var A=m.prototype&&"function"==typeof m.prototype.render;if(A)b=ny(t,_),w=t.__c;else{t.__c=w={__v:t,context:_,props:t.props,setState:no,forceUpdate:no,__d:!0,__h:[]};for(var x=0;w.__d&&x++<25;)w.__d=!1,nu&&nu(t),b=m.call(w,g,_);w.__d=!0}if(null!=w.getChildContext&&(r=ng({},r,w.getChildContext())),A&&rO.errorBoundaries&&(m.getDerivedStateFromError||w.componentDidCatch)){b=null!=b&&b.type===rX&&null==b.key&&null==b.props.tpl?b.props.children:b;try{return e(b,r,n,i,t,o,s)}catch(a){return m.getDerivedStateFromError&&(w.__s=m.getDerivedStateFromError(a)),w.componentDidCatch&&w.componentDidCatch(a,nh),w.__d?(b=ny(t,r),null!=(w=t.__c).getChildContext&&(r=ng({},r,w.getChildContext())),e(b=null!=b&&b.type===rX&&null==b.key&&null==b.props.tpl?b.props.children:b,r,n,i,t,o,s)):""}finally{nl&&nl(t),t.__=null,nd&&nd(t)}}}b=null!=b&&b.type===rX&&null==b.key&&null==b.props.tpl?b.props.children:b;try{var P=e(b,r,n,i,t,o,s);return nl&&nl(t),t.__=null,rO.unmount&&rO.unmount(t),P}catch(a){if(!o&&s&&s.onError){var T=s.onError(a,t,function(a){return e(a,r,n,i,t,o,s)});if(void 0!==T)return T;var R=rO.__e;return R&&R(a,t),""}if(!o||!a||"function"!=typeof a.then)throw a;return a.then(function a(){try{return e(b,r,n,i,t,o,s)}catch(c){if(!c||"function"!=typeof c.then)throw c;return c.then(function(){return e(b,r,n,i,t,o,s)},a)}})}}var C,U="<"+m,O="";for(var I in g){var L=g[I];if("function"!=typeof L||"class"===I||"className"===I){switch(I){case"children":C=L;continue;case"key":case"ref":case"__self":case"__source":continue;case"htmlFor":if("for"in g)continue;I="for";break;case"className":if("class"in g)continue;I="class";break;case"defaultChecked":I="checked";break;case"defaultSelected":I="selected";break;case"defaultValue":case"value":switch(I="value",m){case"textarea":C=L;continue;case"select":i=L;continue;case"option":i!=L||"selected"in g||(U+=" selected")}break;case"dangerouslySetInnerHTML":O=L&&L.__html;continue;case"style":"object"==typeof L&&(L=function(e){var t="";for(var r in e){var n=e[r];if(null!=n&&""!==n){var i="-"==r[0]?r:nn[r]||(nn[r]=r.replace(na,"-$&").toLowerCase()),a=";";"number"!=typeof n||i.startsWith("--")||ni.has(i)||(a="px;"),t=t+i+":"+n+a}}return t||void 0}(L));break;case"acceptCharset":I="accept-charset";break;case"httpEquiv":I="http-equiv";break;default:if(r4.test(I))I=I.replace(r4,"$1:$2").toLowerCase();else{if(r8.test(I))continue;("-"===I[4]||ne.has(I))&&null!=L?L+="":n?r7.test(I)&&(I="panose1"===I?"panose-1":I.replace(/([A-Z])/g,"-$1").toLowerCase()):r9.test(I)&&(I=I.toLowerCase())}}null!=L&&!1!==L&&(U=!0===L||""===L?U+" "+I:U+" "+I+'="'+("string"==typeof L?nr(L):L+"")+'"')}}if(r8.test(m))throw Error(m+" is not a valid HTML tag name in "+U+">");if(O||("string"==typeof C?O=nr(C):null!=C&&!1!==C&&!0!==C&&(O=e(C,r,"svg"===m||"foreignObject"!==m&&n,i,t,o,s))),nl&&nl(t),t.__=null,nd&&nd(t),!O&&nb.has(m))return U+"/>";var $="</"+m+">",N=U+">";return nm(O)?[N].concat(O,[$]):"string"!=typeof O?[N,O,$]:N+O+$}(e,nh,!1,void 0,r,!1,void 0);return nm(n)?n.join(""):n}catch(e){if(e.then)throw Error('Use "renderToStringAsync" for suspenseful rendering.');throw e}finally{rO.__c&&rO.__c(e,nf),rO.__s=t,nf.length=0}}(e)}</div></body></html>`}}function nA(e){let{url:t,theme:r,query:n,cookies:i,pages:a,providers:o}=e;return{csrf:(e,t,r)=>e?(t.logger.warn("csrf-disabled"),r.push({name:t.cookies.csrfToken.name,value:"",options:{...t.cookies.csrfToken.options,maxAge:0}}),{status:404,cookies:r}):{headers:{"Content-Type":"application/json","Cache-Control":"private, no-cache, no-store",Expires:"0",Pragma:"no-cache"},body:{csrfToken:t.csrfToken},cookies:r},providers:e=>({headers:{"Content-Type":"application/json"},body:e.reduce((e,{id:t,name:r,type:n,signinUrl:i,callbackUrl:a})=>(e[t]={id:t,name:r,type:n,signinUrl:i,callbackUrl:a},e),{})}),signin(t,s){if(t)throw new N("Unsupported action");if(a?.signIn){let t=`${a.signIn}${a.signIn.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:e.callbackUrl??"/"})}`;return s&&(t=`${t}&${new URLSearchParams({error:s})}`),{redirect:t,cookies:i}}let c=o?.find(e=>"webauthn"===e.type&&e.enableConditionalUI&&!!e.simpleWebAuthnBrowserVersion),l="";if(c){let{simpleWebAuthnBrowserVersion:e}=c;l=`<script src="https://unpkg.com/@simplewebauthn/browser@${e}/dist/bundle/index.umd.min.js" crossorigin="anonymous"></script>`}return nS({cookies:i,theme:r,html:function(e){let{csrfToken:t,providers:r=[],callbackUrl:n,theme:i,email:a,error:o}=e;"u">typeof document&&i?.brandColor&&document.documentElement.style.setProperty("--brand-color",i.brandColor),"u">typeof document&&i?.buttonText&&document.documentElement.style.setProperty("--button-text-color",i.buttonText);let s=o&&(nE[o]??nE.default),c=r.find(e=>"webauthn"===e.type&&e.enableConditionalUI)?.id;return n_("div",{className:"signin",children:[i?.brandColor&&n_("style",{dangerouslySetInnerHTML:{__html:`:root {--brand-color: ${i.brandColor}}`}}),i?.buttonText&&n_("style",{dangerouslySetInnerHTML:{__html:` 388 :root { 389 --button-text-color: ${i.buttonText} 390 } 391 `}}),n_("div",{className:"card",children:[s&&n_("div",{className:"error",children:n_("p",{children:s})}),i?.logo&&n_("img",{src:i.logo,alt:"Logo",className:"logo"}),r.map((e,i)=>{let o,s,c;("oauth"===e.type||"oidc"===e.type)&&({bg:o="#fff",brandColor:s,logo:c=`https://authjs.dev/img/providers/${e.id}.svg`}=e.style??{});let l=s??o??"#fff";return n_("div",{className:"provider",children:["oauth"===e.type||"oidc"===e.type?n_("form",{action:e.signinUrl,method:"POST",children:[n_("input",{type:"hidden",name:"csrfToken",value:t}),n&&n_("input",{type:"hidden",name:"callbackUrl",value:n}),n_("button",{type:"submit",className:"button",style:{"--provider-brand-color":l},tabIndex:0,children:[n_("span",{style:{filter:"invert(1) grayscale(1) brightness(1.3) contrast(9000)","mix-blend-mode":"luminosity",opacity:.95},children:["Sign in with ",e.name]}),c&&n_("img",{loading:"lazy",height:24,src:c})]})]}):null,("email"===e.type||"credentials"===e.type||"webauthn"===e.type)&&i>
3910&&"email"!==r[i-1].type&&"credentials"!==r[i-1].type&&"webauthn"!==r[i-1].type&&n_("hr",{}),"email"===e.type&&n_("form",{action:e.signinUrl,method:"POST",children:[n_("input",{type:"hidden",name:"csrfToken",value:t}),n_("label",{className:"section-header",htmlFor:`input-email-for-${e.id}-provider`,children:"Email"}),n_("input",{id:`input-email-for-${e.id}-provider`,autoFocus:!0,type:"email",name:"email",value:a,placeholder:"[email protected]",required:!0}),n_("button",{id:"submitButton",type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),"credentials"===e.type&&n_("form",{action:e.callbackUrl,method:"POST",children:[n_("input",{type:"hidden",name:"csrfToken",value:t}),Object.keys(e.credentials).map(t=>n_("div",{children:[n_("label",{className:"section-header",htmlFor:`input-${t}-for-${e.id}-provider`,children:e.credentials[t].label??t}),n_("input",{name:t,id:`input-${t}-for-${e.id}-provider`,type:e.credentials[t].type??"text",placeholder:e.credentials[t].placeholder??"",...e.credentials[t]})]},`input-group-${e.id}`)),n_("button",{id:"submitButton",type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),"webauthn"===e.type&&n_("form",{action:e.callbackUrl,method:"POST",id:`${e.id}-form`,children:[n_("input",{type:"hidden",name:"csrfToken",value:t}),Object.keys(e.formFields).map(t=>n_("div",{children:[n_("label",{className:"section-header",htmlFor:`input-${t}-for-${e.id}-provider`,children:e.formFields[t].label??t}),n_("input",{name:t,"data-form-field":!0,id:`input-${t}-for-${e.id}-provider`,type:e.formFields[t].type??"text",placeholder:e.formFields[t].placeholder??"",...e.formFields[t]})]},`input-group-${e.id}`)),n_("button",{id:`submitButton-${e.id}`,type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),("email"===e.type||"credentials"===e.type||"webauthn"===e.type)&&i+1<r.length&&n_("hr",{})]},e.id)})]}),c&&n_(rX,{children:n_("script",{dangerouslySetInnerHTML:{__html:` 392const currentURL = window.location.href; 393const authURL = currentURL.substring(0, currentURL.lastIndexOf('/')); 394(${nv})(authURL, "${c}"); 395`}})})]})}({csrfToken:e.csrfToken,providers:e.providers?.filter(e=>["email","oauth","oidc"].includes(e.type)||"credentials"===e.type&&e.credentials||"webauthn"===e.type&&e.formFields||!1),callbackUrl:e.callbackUrl,theme:e.theme,error:s,...n}),title:"Sign In",headTags:l})},signout:()=>a?.signOut?{redirect:a.signOut,cookies:i}:nS({cookies:i,theme:r,html:function(e){let{url:t,csrfToken:r,theme:n}=e;return n_("div",{className:"signout",children:[n?.brandColor&&n_("style",{dangerouslySetInnerHTML:{__html:` 396 :root { 397 --brand-color: ${n.brandColor} 398 } 399 `}}),n?.buttonText&&n_("style",{dangerouslySetInnerHTML:{__html:` 400 :root { 401 --button-text-color: ${n.buttonText} 402 } 403 `}}),n_("div",{className:"card",children:[n?.logo&&n_("img",{src:n.logo,alt:"Logo",className:"logo"}),n_("h1",{children:"Signout"}),n_("p",{children:"Are you sure you want to sign out?"}),n_("form",{action:t?.toString(),method:"POST",children:[n_("input",{type:"hidden",name:"csrfToken",value:r}),n_("button",{id:"submitButton",type:"submit",children:"Sign out"})]})]})]})}({csrfToken:e.csrfToken,url:t,theme:r}),title:"Sign Out"}),verifyRequest:e=>a?.verifyRequest?{redirect:`${a.verifyRequest}${t?.search??""}`,cookies:i}:nS({cookies:i,theme:r,html:function(e){let{url:t,theme:r}=e;return n_("div",{className:"verify-request",children:[r.brandColor&&n_("style",{dangerouslySetInnerHTML:{__html:` 404 :root { 405 --brand-color: ${r.brandColor} 406 } 407 `}}),n_("div",{className:"card",children:[r.logo&&n_("img",{src:r.logo,alt:"Logo",className:"logo"}),n_("h1",{children:"Check your email"}),n_("p",{children:"A sign in link has been sent to your email address."}),n_("p",{children:n_("a",{className:"site",href:t.origin,children:t.host})})]})]})}({url:t,theme:r,...e}),title:"Verify Request"}),error:e=>a?.error?{redirect:`${a.error}${a.error.includes("?")?"&":"?"}error=${e}`,cookies:i}:nS({cookies:i,theme:r,...function(e){let{url:t,error:r="default",theme:n}=e,i=`${t}/signin`,a={default:{status:200,heading:"Error",message:n_("p",{children:n_("a",{className:"site",href:t?.origin,children:t?.host})})},Configuration:{status:500,heading:"Server error",message:n_("div",{children:[n_("p",{children:"There is a problem with the server configuration."}),n_("p",{children:"Check the server logs for more information."})]})},AccessDenied:{status:403,heading:"Access Denied",message:n_("div",{children:[n_("p",{children:"You do not have permission to sign in."}),n_("p",{children:n_("a",{className:"button",href:i,children:"Sign in"})})]})},Verification:{status:403,heading:"Unable to sign in",message:n_("div",{children:[n_("p",{children:"The sign in link is no longer valid."}),n_("p",{children:"It may have been used already or it may have expired."})]}),signin:n_("a",{className:"button",href:i,children:"Sign in"})}},{status:o,heading:s,message:c,signin:l}=a[r]??a.default;return{status:o,html:n_("div",{className:"error",children:[n?.brandColor&&n_("style",{dangerouslySetInnerHTML:{__html:` 408 :root { 409 --brand-color: ${n?.brandColor} 410 } 411 `}}),n_("div",{className:"card",children:[n?.logo&&n_("img",{src:n?.logo,alt:"Logo",className:"logo"}),n_("h1",{children:s}),n_("div",{className:"message",children:c}),l]})]})}}({url:t,theme:r,error:e}),title:"Error"})}}function nx(e,t=Date.now()){return new Date(t+1e3*e)}async function nP(e,t,r,n){if(!r?.providerAccountId||!r.type)throw Error("Missing or invalid provider account");if(!["email","oauth","oidc","webauthn"].includes(r.type))throw Error("Provider not supported");let{adapter:i,jwt:a,events:o,session:{strategy:s,generateSessionToken:c}}=n;
411if(!i)return{user:t,account:r};let l=r,{createUser:u,updateUser:d,getUser:p,getUserByAccount:h,getUserByEmail:f,linkAccount:m,createSession:g,getSessionAndUser:y,deleteSession:b}=i,w=null,_=null,v=!1,E="jwt"===s;if(e)if(E)try{let t=n.cookies.sessionToken.name;(w=await a.decode({...a,token:e,salt:t}))&&"sub"in w&&w.sub&&(_=await p(w.sub))}catch{}else{let t=await y(e);t&&(w=t.session,_=t.user)}if("email"===l.type){let r=await f(t.email);return r?(_?.id!==r.id&&!E&&e&&await b(e),_=await d({id:r.id,emailVerified:new Date}),await o.updateUser?.({user:_})):(_=await u({...t,emailVerified:new Date}),await o.createUser?.({user:_}),v=!0),{session:w=E?{}:await g({sessionToken:c(),userId:_.id,expires:nx(n.session.maxAge)}),user:_,isNewUser:v}}if("webauthn"===l.type){let e=await h({providerAccountId:l.providerAccountId,provider:l.provider});if(e){if(_){if(e.id===_.id){let e={...l,userId:_.id};return{session:w,user:_,isNewUser:v,account:e}}throw new F("The account is already associated with another user",{provider:l.provider})}w=E?{}:await g({sessionToken:c(),userId:e.id,expires:nx(n.session.maxAge)});let t={...l,userId:e.id};return{session:w,user:e,isNewUser:v,account:t}}{if(_){await m({...l,userId:_.id}),await o.linkAccount?.({user:_,account:l,profile:t});let e={...l,userId:_.id};return{session:w,user:_,isNewUser:v,account:e}}if(t.email?await f(t.email):null)throw new F("Another account already exists with the same e-mail address",{provider:l.provider});_=await u({...t}),await o.createUser?.({user:_}),await m({...l,userId:_.id}),await o.linkAccount?.({user:_,account:l,profile:t}),w=E?{}:await g({sessionToken:c(),userId:_.id,expires:nx(n.session.maxAge)});let e={...l,userId:_.id};return{session:w,user:_,isNewUser:!0,account:e}}}let k=await h({providerAccountId:l.providerAccountId,provider:l.provider});if(k){if(_){if(k.id===_.id)return{session:w,user:_,isNewUser:v};throw new U("The account is already associated with another user",{provider:l.provider})}return{session:w=E?{}:await g({sessionToken:c(),userId:k.id,expires:nx(n.session.maxAge)}),user:k,isNewUser:v}}{let{provider:e}=n,{type:r,provider:i,providerAccountId:a,userId:s,...d}=l;if(l=Object.assign(e.account(d)??{},{providerAccountId:a,provider:i,type:r,userId:s}),_)return await m({...l,userId:_.id}),await o.linkAccount?.({user:_,account:l,profile:t}),{session:w,user:_,isNewUser:v};let p=t.email?await f(t.email):null;if(p){let e=n.provider;if(e?.allowDangerousEmailAccountLinking)_=p,v=!1;else throw new U("Another account already exists with the same e-mail address",{provider:l.provider})}else _=await u({...t,emailVerified:null}),v=!0;return await o.createUser?.({user:_}),await m({...l,userId:_.id}),await o.linkAccount?.({user:_,account:l,profile:t}),{session:w=E?{}:await g({sessionToken:c(),userId:_.id,expires:nx(n.session.maxAge)}),user:_,isNewUser:v}}}function nT(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}("u"<typeof navigator||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(r="oauth4webapi/v3.8.2");let nR="ERR_INVALID_ARG_VALUE",nC="ERR_INVALID_ARG_TYPE";function nU(e,t,r){let n=TypeError(e,{cause:r});return Object.assign(n,{code:t}),n}let nO=Symbol(),nI=Symbol(),nL=Symbol(),n$=Symbol(),nN=Symbol(),nj=Symbol();Symbol();let nH=new TextEncoder,nD=new TextDecoder;function nW(e){return"string"==typeof e?nH.encode(e):nD.decode(e)}function nM(e){return"string"==typeof e?i(e):n(e)}n=Uint8Array.prototype.toBase64?e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));let t=[];for(let r=0;r<e.byteLength;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},i=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw nU("The input to be decoded is not correctly encoded.",nR,e)}}:e=>{try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),r=new
411Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}catch(e){throw nU("The input to be decoded is not correctly encoded.",nR,e)}};class nK extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=iq,Error.captureStackTrace?.(this,this.constructor)}}class nB extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,t?.code&&(this.code=t?.code),Error.captureStackTrace?.(this,this.constructor)}}function nJ(e,t,r){return new nB(e,{code:t,cause:r})}function nq(e){return!(null===e||"object"!=typeof e||Array.isArray(e))}function nz(e){nT(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e??{});if(r&&!t.has("user-agent")&&t.set("user-agent",r),t.has("authorization"))throw nU('"options.headers" must not include the "authorization" header name',nR);return t}function nF(e,t){if(void 0!==t){if("function"==typeof t&&(t=t(e.href)),!(t instanceof AbortSignal))throw nU('"options.signal" must return or be an instance of AbortSignal',nC);return t}}function nX(e){return e.includes("//")?e.replace("//","/"):e}async function nV(e,t,r,n){if(!(e instanceof URL))throw nU(`"${t}" must be an instance of URL`,nC);it(e,n?.[nO]!==!0);let i=r(new URL(e.href)),a=nz(n?.headers);return a.set("accept","application/json"),(n?.[n$]||fetch)(i.href,{body:void 0,headers:Object.fromEntries(a.entries()),method:"GET",redirect:"manual",signal:nF(i,n?.signal)})}async function nG(e,t){return nV(e,"issuerIdentifier",e=>{switch(t?.algorithm){case void 0:case"oidc":e.pathname=nX(`${e.pathname}/.well-known/openid-configuration`);break;case"oauth2":!function(e,t,r=!1){"/"===e.pathname?e.pathname=t:e.pathname=nX(`${t}/${r?e.pathname:e.pathname.replace(/(\/)$/,"")}`)}(e,".well-known/oauth-authorization-server");break;default:throw nU('"options.algorithm" must be "oidc" (default), or "oauth2"',nR)}return e},t)}function nY(e,t,r,n,i){try{if("number"!=typeof e||!Number.isFinite(e))throw nU(`${r} must be a number`,nC,i);if(e>0)return;if(t){if(0!==e)throw nU(`${r} must be a non-negative number`,nR,i);return}throw nU(`${r} must be a positive number`,nR,i)}catch(e){if(n)throw nJ(e.message,n,i);throw e}}function nZ(e,t,r,n){try{if("string"!=typeof e)throw nU(`${t} must be a string`,nC,n);if(0===e.length)throw nU(`${t} must not be empty`,nR,n)}catch(e){if(r)throw nJ(e.message,r,n);throw e}}async function nQ(e,t){if(!(e instanceof URL)&&e!==an)throw nU('"expectedIssuerIdentifier" must be an instance of URL',nC);if(!nT(t,Response))throw nU('"response" must be an instance of Response',nC);if(200!==t.status)throw nJ('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',iY,t);i6(t);let r=await ar(t);if(nZ(r.issuer,'"response" body "issuer" property',iV,{body:r}),e!==an&&new URL(r.issuer).href!==e.href)throw nJ('"response" body "issuer" property does not match the expected value',i2,{expected:e.href,body:r,attribute:"issuer"});return r}function n0(e){var t=e,r="application/json";if(i_(t)!==r)throw function(e,...t){let r='"response" content-type must be ';if(t.length>2){let e=t.pop();r+=`${t.join(", ")}, or ${e}`}else 2===t.length?r+=`${t[0]} or ${t[1]}`:r+=t[0];return nJ(r,iG,e)}(t,r)}function n1(){return nM(crypto.getRandomValues(new Uint8Array(32)))}async function n2(e){return nZ(e,"codeVerifier"),nM(await crypto.subtle.digest("SHA-256",nW(e)))}function n3(e){let t=e?.[nI];return"number"==typeof t&&Number.isFinite(t)?t:0}function n5(e){let t=e?.[nL];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function n6(){return Math.floor(Date.now()/1e3)}function n8(e){if("object"!=typeof e||null===e)throw nU('"as" must be an object',nC);nZ(e.issuer,'"as.issuer"')}function n4(e){if("object"!=typeof e||null===e)throw nU('"client" must be an object',nC);nZ(e.client_id,'"client.client_id"')}function n9(e,t){let r=n6()+n3(t);return{jti:n1(),aud:e.issuer,exp:r+60,iat:r,nbf:r,iss:t.client_id,sub:t.client_id}}async function n7(e,t,r){if(!r.usages.includes("sign"))throw nU('CryptoKey instances used for signing assertions must include "sign" in their "usages"',nR);let n=`${nM(nW(JSON.stringify(e)))}.${nM(nW(JSON.stringify(t)))}`,i=nM(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:function(e){let{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new nK("unsupported ECDSA namedCurve",{cause:e})}}(e)};case"RSA-PSS":switch(i8(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new nK("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return i8(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new nK("unsupported CryptoKey algorithm name",{cause:e})}(r),r,nW(n)));return`${n}.${i}`}let ie=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function it(e,t){if(t&&"https:"!==e.protocol)throw nJ("only requests to HTTPS are allowed",iZ,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw nJ("only HTTP and HTTPS requests are allowed",iQ,e)}function ir(e,t,r,n){let i;if("string"!=typeof e||!(i=ie(e)))throw nJ(`authorization server metadata does not contain a valid ${r?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,void 0===e?i3:i5,{attribute:r?`mtls_endpoint_aliases.${t}`:t});return it(i,n),i}function ii(e,t,r,n){return r&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?ir(e.mtls_endpoint_aliases[t],t,r,n):ir(e[t],t,r,n)}
411class ia extends Error{cause;code;error;status;error_description;response;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=iJ,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),Error.captureStackTrace?.(this,this.constructor)}}class io extends Error{cause;code;error;error_description;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=iz,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=t.cause.get("error_description")??void 0,Error.captureStackTrace?.(this,this.constructor)}}class is extends Error{cause;code;response;status;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=iB,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),Error.captureStackTrace?.(this,this.constructor)}}let ic="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",il=RegExp("^[,\\s]*("+ic+")\\s(.*)"),iu=RegExp("^[,\\s]*("+ic+')\\s*=\\s*"((?:[^"\\\\]|\\\\.)*)"[,\\s]*(.*)'),id=RegExp("^[,\\s]*"+("("+ic+")\\s*=\\s*(")+ic+")[,\\s]*(.*)"),ip=RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+[=]{0,2})(?:$|[,\\s])(.*)");async function ih(e){if(e.status>399&&e.status<500){i6(e),n0(e);try{let t=await e.clone().json();if(nq(t)&&"string"==typeof t.error&&t.error.length)return t}catch{}}}async function im(e,t,r){if(e.status!==t){let t;if(iT(e),t=await ih(e))throw await e.body?.cancel(),new ia("server responded with an error in the response body",{cause:t,response:e});throw nJ(`"response" is not a conform ${r} response (unexpected HTTP status code)`,iY,e)}}function ig(e){if(!iI.has(e))throw nU('"options.DPoP" is not a valid DPoPHandle',nR)}async function iy(e,t,r,n,i,a){if(nZ(e,'"accessToken"'),!(r instanceof URL))throw nU('"url" must be an instance of URL',nC);it(r,a?.[nO]!==!0),n=nz(n),a?.DPoP&&(ig(a.DPoP),await a.DPoP.addProof(r,n,t.toUpperCase(),e)),n.set("authorization",`${n.has("dpop")?"DPoP":"Bearer"} ${e}`);let o=await (a?.[n$]||fetch)(r.href,{body:i,headers:Object.fromEntries(n.entries()),method:t,redirect:"manual",signal:nF(r,a?.signal)});return a?.DPoP?.cacheNonce(o,r),o}async function ib(e,t,r,n){n8(e),n4(t);let i=ii(e,"userinfo_endpoint",t.use_mtls_endpoint_aliases,n?.[nO]!==!0),a=nz(n?.headers);return t.userinfo_signed_response_alg?a.set("accept","application/jwt"):(a.set("accept","application/json"),a.append("accept","application/jwt")),iy(r,"GET",i,a,null,{...n,[nI]:n3(t)})}let iw=Symbol();function i_(e){return e.headers.get("content-type")?.split(";")[0]}async function iv(e,t,r,n,i){let a;if(n8(e),n4(t),!nT(n,Response))throw nU('"response" must be an instance of Response',nC);if(iT(n),200!==n.status)throw nJ('"response" is not a conform UserInfo Endpoint response (unexpected HTTP status code)',iY,n);if(i6(n),"application/jwt"===i_(n)){let{claims:r,jwt:o}=await i4(await n.text(),i9.bind(void 0,t.userinfo_signed_response_alg,e.userinfo_signing_alg_values_supported,void 0),n3(t),n5(t),i?.[nj]).then(iR.bind(void 0,t.client_id)).then(iU.bind(void 0,e));iA.set(n,o),a=r}else{if(t.userinfo_signed_response_alg)throw nJ("JWT UserInfo Response expected",iF,n);a=await ar(n)}if(nZ(a.sub,'"response" body "sub" property',iV,{body:a}),r===iw);else if(nZ(r,'"expectedSubject"'),a.sub!==r)throw nJ('unexpected "response" body "sub" property value',i2,{expected:r,body:a,attribute:"sub"});return a}async function iE(e,t,r,n,i,a,o){return await r(e,t,i,a),a.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),(o?.[n$]||fetch)(n.href,{body:i,headers:Object.fromEntries(a.entries()),method:"POST",redirect:"manual",signal:nF(n,o?.signal)})}async function ik(e,t,r,n,i,a){let o=ii(e,"token_endpoint",t.use_mtls_endpoint_aliases,a?.[nO]!==!0);i.set("grant_type",n);let s=nz(a?.headers);s.set("accept","application/json"),a?.DPoP!==void 0&&(ig(a.DPoP),await a.DPoP.addProof(o,s,"POST"));let c=await iE(e,t,r,o,i,s,a);return a?.DPoP?.cacheNonce(c,o),c}let iS=new WeakMap,iA=new WeakMap;function ix(e){if(!e.id_token)return;let t=iS.get(e);if(!t)throw nU('"ref" was already garbage collected or did not resolve from the proper sources',nR);return t}async function iP(e,t,r,n,i,a){if(n8(e),n4(t),!nT(r,Response))throw nU('"response" must be an instance of Response',nC);await im(r,200,"Token Endpoint"),i6(r);let o=await ar(r);if(nZ(o.access_token,'"response" body "access_token" property',iV,{body:o}),nZ(o.token_type,'"response" body "token_type" property',iV,{body:o}),o.token_type=o.token_type.toLowerCase(),void 0!==o.expires_in){let e="number"!=typeof o.expires_in?parseFloat(o.expires_in):o.expires_in;nY(e,!0,'"response" body "expires_in" property',iV,{body:o}),o.expires_in=e}if(void 0!==o.refresh_token&&nZ(o.refresh_token,'"response" body "refresh_token" property',iV,{body:o}),void 0!==o.scope&&"string"!=typeof o.scope)throw nJ('"response" body "scope" property must be a string',iV,{body:o});if(void 0!==o.id_token){nZ(o.id_token,'"response" body "id_token" property',iV,{body:o});let a=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&a.push("auth_time"),void 0!==t.default_max_age&&(nY(t.default_max_age,!0,'"client.default_max_age"'),a.push("auth_time")),n?.length&&a.push(...n);let{claims:s,jwt:c}=await i4(o.id_token,i9.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),n3(t),n5(t),i).then(ij.bind(void 0,a)).then(iO.bind(void 0,e)).then(iC.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw nJ('ID Token "aud" (audience) claim includes additional untrusted audiences',i1,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw nJ('unexpected ID Token "azp" (authorized party) claim value',i1,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&nY(s.auth_time,!0,'ID Token "auth_time" (authentication time)',iV,{claims:s}),iA.set(r,c),iS.set(o,s)}if(a?.[o.token_type]!==void 0)a[o.token_type](r,o);else if("dpop"!==o.token_type&&"bearer"!==o.token_type)throw new nK("unsupported `token_type` value",{cause:{body:o}});return o}function iT(e){let t;if(t=function(e){if(!nT(e,Response))throw nU('"response" must be an instance of Response',nC);let t=e.headers.get("www-authenticate");if(null===t)return;let r=[],n=t;for(;n;){let e,t=n.match(il),i=t?.["1"].toLowerCase();if(n=t?.["2"],!i)return;let a={};for(;n;){let r,i;
411if(t=n.match(iu)){if([,r,i,n]=t,i.includes("\\"))try{i=JSON.parse(`"${i}"`)}catch{}a[r.toLowerCase()]=i;continue}if(t=n.match(id)){[,r,i,n]=t,a[r.toLowerCase()]=i;continue}if(t=n.match(ip)){if(Object.keys(a).length)break;[,e,n]=t;break}return}let o={scheme:i,parameters:a};e&&(o.token68=e),r.push(o)}if(r.length)return r}(e))throw new is("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}function iR(e,t){return void 0!==t.claims.aud?iC(e,t):t}function iC(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw nJ('unexpected JWT "aud" (audience) claim value',i1,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw nJ('unexpected JWT "aud" (audience) claim value',i1,{expected:e,claims:t.claims,claim:"aud"});return t}function iU(e,t){return void 0!==t.claims.iss?iO(e,t):t}function iO(e,t){let r=e[ai]?.(t)??e.issuer;if(t.claims.iss!==r)throw nJ('unexpected JWT "iss" (issuer) claim value',i1,{expected:r,claims:t.claims,claim:"iss"});return t}let iI=new WeakSet,iL=Symbol();async function i$(e,t,r,n,i,a,o){if(n8(e),n4(t),!iI.has(n))throw nU('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',nR);nZ(i,'"redirectUri"');let s=i7(n,"code");if(!s)throw nJ('no authorization code in "callbackParameters"',iV);let c=new URLSearchParams(o?.additionalParameters);return c.set("redirect_uri",i),c.set("code",s),a!==iL&&(nZ(a,'"codeVerifier"'),c.set("code_verifier",a)),ik(e,t,r,"authorization_code",c,o)}let iN={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function ij(e,t){for(let r of e)if(void 0===t.claims[r])throw nJ(`JWT "${r}" (${iN[r]}) claim missing`,iV,{claims:t.claims});return t}let iH=Symbol(),iD=Symbol();async function iW(e,t,r,n){return"string"==typeof n?.expectedNonce||"number"==typeof n?.maxAge||n?.requireIdToken?iM(e,t,r,n.expectedNonce,n.maxAge,n[nj],n.recognizedTokenTypes):iK(e,t,r,n?.[nj],n?.recognizedTokenTypes)}async function iM(e,t,r,n,i,a,o){let s=[];switch(n){case void 0:n=iH;break;case iH:break;default:nZ(n,'"expectedNonce" argument'),s.push("nonce")}switch(i??=t.default_max_age){case void 0:i=iD;break;case iD:break;default:nY(i,!0,'"maxAge" argument'),s.push("auth_time")}let c=await iP(e,t,r,s,a,o);nZ(c.id_token,'"response" body "id_token" property',iV,{body:c});let l=ix(c);if(i!==iD){let e=n6()+n3(t),r=n5(t);if(l.auth_time+i<e-r)throw nJ("too much time has elapsed since the last End-User authentication",i0,{claims:l,now:e,tolerance:r,claim:"auth_time"})}if(n===iH){if(void 0!==l.nonce)throw nJ('unexpected ID Token "nonce" claim value',i1,{expected:void 0,claims:l,claim:"nonce"})}else if(l.nonce!==n)throw nJ('unexpected ID Token "nonce" claim value',i1,{expected:n,claims:l,claim:"nonce"});return c}async function iK(e,t,r,n,i){let a=await iP(e,t,r,void 0,n,i),o=ix(a);if(o){if(void 0!==t.default_max_age){nY(t.default_max_age,!0,'"client.default_max_age"');let e=n6()+n3(t),r=n5(t);if(o.auth_time+t.default_max_age<e-r)throw nJ("too much time has elapsed since the last End-User authentication",i0,{claims:o,now:e,tolerance:r,claim:"auth_time"})}if(void 0!==o.nonce)throw nJ('unexpected ID Token "nonce" claim value',i1,{expected:void 0,claims:o,claim:"nonce"})}return a}let iB="OAUTH_WWW_AUTHENTICATE_CHALLENGE",iJ="OAUTH_RESPONSE_BODY_ERROR",iq="OAUTH_UNSUPPORTED_OPERATION",iz="OAUTH_AUTHORIZATION_RESPONSE_ERROR",iF="OAUTH_JWT_USERINFO_EXPECTED",iX="OAUTH_PARSE_ERROR",iV="OAUTH_INVALID_RESPONSE",iG="OAUTH_RESPONSE_IS_NOT_JSON",iY="OAUTH_RESPONSE_IS_NOT_CONFORM",iZ="OAUTH_HTTP_REQUEST_FORBIDDEN",iQ="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",i0="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",i1="OAUTH_JWT_CLAIM_COMPARISON_FAILED",i2="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",i3="OAUTH_MISSING_SERVER_METADATA",i5="OAUTH_INVALID_SERVER_METADATA";function i6(e){if(e.bodyUsed)throw nU('"response" body has been used already',nR)}function i8(e){let{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new nK(`unsupported ${t.name} modulusLength`,{cause:e})}async function i4(e,t,r,n,i){let a,o,{0:s,1:c,length:l}=e.split(".");if(5===l)if(void 0!==i)e=await i(e),{0:s,1:c,length:l}=e.split(".");else throw new nK("JWE decryption is not configured",{cause:e});if(3!==l)throw nJ("Invalid JWT",iV,e);try{a=JSON.parse(nW(nM(s)))}catch(e){throw nJ("failed to parse JWT Header body as base64url encoded JSON",iX,e)}if(!nq(a))throw nJ("JWT Header must be a top level object",iV,e);if(t(a),void 0!==a.crit)throw new nK('no JWT "crit" header parameter extensions are supported',{cause:{header:a}});try{o=JSON.parse(nW(nM(c)))}catch(e){throw nJ("failed to parse JWT Payload body as base64url encoded JSON",iX,e)}if(!nq(o))throw nJ("JWT Payload must be a top level object",iV,e);let u=n6()+r;if(void 0!==o.exp){if("number"!=typeof o.exp)throw nJ('unexpected JWT "exp" (expiration time) claim type',iV,{claims:o});if(o.exp<=u-n)throw nJ('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',i0,{claims:o,now:u,tolerance:n,claim:"exp"})}if(void 0!==o.iat&&"number"!=typeof o.iat)throw nJ('unexpected JWT "iat" (issued at) claim type',iV,{claims:o});if(void 0!==o.iss&&"string"!=typeof o.iss)throw nJ('unexpected JWT "iss" (issuer) claim type',iV,{claims:o});if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw nJ('unexpected JWT "nbf" (not before) claim type',iV,{claims:o});if(o.nbf>u+n)throw nJ('unexpected JWT "nbf" (not before) claim value',i0,{claims:o,now:u,tolerance:n,claim:"nbf"})}if(void 0!==o.aud&&"string"!=typeof o.aud&&!Array.isArray(o.aud))throw nJ('unexpected JWT "aud" (audience) claim type',iV,{claims:o});return{header:a,claims:o,jwt:e}}function i9(e,t,r,n){if(void 0!==e){if("string"==typeof e?n.alg!==e:!e.includes(n.alg))throw nJ('unexpected JWT "alg" header parameter',iV,{header:n,expected:e,reason:"client configuration"});return}if(Array.isArray(t)){if(!t.includes(n.alg))throw nJ('unexpected JWT "alg" header parameter',iV,{header:n,expected:t,reason:"authorization server metadata"});return}if(void 0!==r){if("string"==typeof r?n.alg!==r:"function"==typeof r?!r(n.alg):!r.includes(n.alg))throw nJ('unexpected JWT "alg" header parameter',iV,{header:n,expected:r,reason:"default value"});return}throw nJ('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:r})}function i7(e,t){let{0:r,length:n}=e.getAll(t);if(n>1)throw nJ(`"${t}
411" parameter must be provided only once`,iV);return r}let ae=Symbol(),at=Symbol();async function ar(e,t=n0){let r;try{r=await e.json()}catch(r){throw t(e),nJ('failed to parse "response" body as JSON',iX,r)}if(!nq(r))throw nJ('"response" body must be a top level object',iV,{body:r});return r}let an=Symbol(),ai=Symbol();async function aa(e,t,r){let{cookies:n,logger:i}=r,a=n[e],o=new Date;o.setTime(o.getTime()+9e5),i.debug(`CREATE_${e.toUpperCase()}`,{name:a.name,payload:t,COOKIE_TTL:900,expires:o});let s=await t2({...r.jwt,maxAge:900,token:{value:t},salt:a.name}),c={...a.options,expires:o};return{name:a.name,value:s,options:c}}async function ao(e,t,r){try{let{logger:n,cookies:i,jwt:a}=r;if(n.debug(`PARSE_${e.toUpperCase()}`,{cookie:t}),!t)throw new A(`${e} cookie was missing`);let o=await t3({...a,token:t,salt:i[e].name});if(o?.value)return o.value;throw Error("Invalid cookie")}catch(t){throw new A(`${e} value could not be parsed`,{cause:t})}}function as(e,t,r){let{logger:n,cookies:i}=t,a=i[e];n.debug(`CLEAR_${e.toUpperCase()}`,{cookie:a}),r.push({name:a.name,value:"",options:{...i[e].options,maxAge:0}})}function ac(e,t){return async function(r,n,i){let{provider:a,logger:o}=i;if(!a?.checks?.includes(e))return;let s=r?.[i.cookies[t].name];o.debug(`USE_${t.toUpperCase()}`,{value:s});let c=await ao(t,s,i);return as(t,i,n),c}}let al={async create(e){let t=n1(),r=await n2(t);return{cookie:await aa("pkceCodeVerifier",t,e),value:r}},use:ac("pkce","pkceCodeVerifier")},au="encodedState",ad={async create(e,t){let{provider:r}=e;if(!r.checks.includes("state")){if(t)throw new A("State data was provided but the provider is not configured to use state");return}let n={origin:t,random:n1()},i=await t2({secret:e.jwt.secret,token:n,salt:au,maxAge:900});return{cookie:await aa("state",i,e),value:i}},use:ac("state","state"),async decode(e,t){try{t.logger.debug("DECODE_STATE",{state:e});let r=await t3({secret:t.jwt.secret,token:e,salt:au});if(r)return r;throw Error("Invalid state")}catch(e){throw new A("State could not be decoded",{cause:e})}}},ap={async create(e){if(!e.provider.checks.includes("nonce"))return;let t=n1();return{cookie:await aa("nonce",t,e),value:t}},use:ac("nonce","nonce")},ah="encodedWebauthnChallenge",af={create:async(e,t,r)=>({cookie:await aa("webauthnChallenge",await t2({secret:e.jwt.secret,token:{challenge:t,registerData:r},salt:ah,maxAge:900}),e)}),async use(e,t,r){let n=t?.[e.cookies.webauthnChallenge.name],i=await ao("webauthnChallenge",n,e),a=await t3({secret:e.jwt.secret,token:i,salt:ah});if(as("webauthnChallenge",e,r),!a)throw new A("WebAuthn challenge was missing");return a}};function am(e){return encodeURIComponent(e).replace(/%20/g,"+")}async function ag(e,t,r){var n,i;let a,o,s,c,l,{logger:u,provider:d}=r,{token:p,userinfo:h}=d;if(p?.url&&"authjs.dev"!==p.url.host||h?.url&&"authjs.dev"!==h.url.host)a={issuer:d.issuer??"https://authjs.dev",token_endpoint:p?.url.toString(),userinfo_endpoint:h?.url.toString()};else{let e=new URL(d.issuer),t=await nG(e,{[nO]:!0,[n$]:d[rf]});if(!(a=await nQ(e,t)).token_endpoint)throw TypeError("TODO: Authorization server did not provide a token endpoint.");if(!a.userinfo_endpoint)throw TypeError("TODO: Authorization server did not provide a userinfo endpoint.")}let f={client_id:d.clientId,...d.client};switch(f.token_endpoint_auth_method){case void 0:case"client_secret_basic":o=(e,t,r,n)=>{var i,a;let o,s,c;n.set("authorization",(i=d.clientId,a=d.clientSecret,o=am(i),s=am(a),c=btoa(`${o}:${s}`),`Basic ${c}`))};break;case"client_secret_post":nZ(n=d.clientSecret,'"clientSecret"'),o=(e,t,r,i)=>{r.set("client_id",t.client_id),r.set("client_secret",n)};break;case"client_secret_jwt":nZ(i=d.clientSecret,'"clientSecret"'),l=void 0,o=async(e,t,r,n)=>{c||=await crypto.subtle.importKey("raw",nW(i),{hash:"SHA-256",name:"HMAC"},!1,["sign"]);let a={alg:"HS256"},o=n9(e,t);l?.(a,o);let s=`${nM(nW(JSON.stringify(a)))}.${nM(nW(JSON.stringify(o)))}`,u=await crypto.subtle.sign(c.algorithm,c,nW(s));r.set("client_id",t.client_id),r.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),r.set("client_assertion",`${s}
411.${nM(new Uint8Array(u))}`)};break;case"private_key_jwt":o=function(e,t){let{key:r,kid:n}=e instanceof CryptoKey?{key:e}:e?.key instanceof CryptoKey?(void 0!==e.kid&&nZ(e.kid,'"kid"'),{key:e.key,kid:e.kid}):{};var i='"clientPrivateKey.key"';if(!(r instanceof CryptoKey))throw nU(`${i} must be a CryptoKey`,nC);if("private"!==r.type)throw nU(`${i} must be a private CryptoKey`,nR);return async(e,i,a,o)=>{let s={alg:function(e){switch(e.algorithm.name){case"RSA-PSS":switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new nK("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new nK("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}case"ECDSA":switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new nK("unsupported EcKeyAlgorithm namedCurve",{cause:e})}case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new nK("unsupported CryptoKey algorithm name",{cause:e})}}(r),kid:n},c=n9(e,i);t?.[nN]?.(s,c),a.set("client_id",i.client_id),a.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),a.set("client_assertion",await n7(s,c,r))}}(d.token.clientPrivateKey,{[nN](e,t){t.aud=[a.issuer,a.token_endpoint]}});break;case"none":o=(e,t,r,n)=>{r.set("client_id",t.client_id)};break;default:throw Error("unsupported client authentication method")}let m=[],g=await ad.use(t,m,r);try{s=function(e,t,r,n){var i;if(n8(e),n4(t),r instanceof URL&&(r=r.searchParams),!(r instanceof URLSearchParams))throw nU('"parameters" must be an instance of URLSearchParams, or URL',nC);if(i7(r,"response"))throw nJ('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',iV,{parameters:r});let a=i7(r,"iss"),o=i7(r,"state");if(!a&&e.authorization_response_iss_parameter_supported)throw nJ('response parameter "iss" (issuer) missing',iV,{parameters:r});if(a&&a!==e.issuer)throw nJ('unexpected "iss" (issuer) response parameter value',iV,{expected:e.issuer,parameters:r});switch(n){case void 0:case at:if(void 0!==o)throw nJ('unexpected "state" response parameter encountered',iV,{expected:void 0,parameters:r});break;case ae:break;default:if(nZ(n,'"expectedState" argument'),o!==n)throw nJ(void 0===o?'response parameter "state" missing':'unexpected "state" response parameter value',iV,{expected:n,parameters:r})}if(i7(r,"error"))throw new io("authorization response from the server is an error",{cause:r});let s=i7(r,"id_token"),c=i7(r,"token");if(void 0!==s||void 0!==c)throw new nK("implicit and hybrid flows are not supported");return i=new URLSearchParams(r),iI.add(i),i}(a,f,new URLSearchParams(e),d.checks.includes("state")?g:ae)}catch(e){if(e instanceof io){let t={providerId:d.id,...Object.fromEntries(e.cause.entries())};throw u.debug("OAuthCallbackError",t),new O("OAuth Provider returned an error",t)}throw e}let y=await al.use(t,m,r),b=d.callbackUrl;!r.isOnRedirectProxy&&d.redirectProxyUrl&&(b=d.redirectProxyUrl);let w=await i$(a,f,o,s,b,y??"decoy",{[nO]:!0,[n$]:(...e)=>(d.checks.includes("pkce")||e[1].body.delete("code_verifier"),(d[rf]??fetch)(...e))});d.token?.conform&&(w=await d.token.conform(w.clone())??w);let _={},v="oidc"===d.type;if(d[rm])switch(d.id){case"microsoft-entra-id":case"azure-ad":{let e=await w.clone().json();if(e.error){let t={providerId:d.id,...e};throw new O(`OAuth Provider returned an error: ${e.error}`,t)}let{tid:t}=function(e){let t,r;if("string"!=typeof e)throw new eU("JWTs must use Compact JWS serialization, JWT must be a string");let{1:n,length:i}=e.split(".");if(5===i)throw new eU("Only JWTs using Compact JWS serialization can be decoded");if(3!==i)throw new eU("Invalid JWT");if(!n)throw new eU("JWTs must contain a payload");try{t=eh(n)}catch{throw new eU("Failed to base64url decode the payload")}try{r=JSON.parse(es.decode(t))}catch{throw new eU("Failed to parse the decoded payload as JSON")}if(!ti(r))throw new eU("Invalid JWT Claims Set");return r}(e.id_token);if("string"==typeof t){let e=a.issuer?.match(/microsoftonline\.com\/(\w+)\/v2\.0/)?.[1]??"common",r=new URL(a.issuer.replace(e,t)),n=await nG(r,{[n$]:d[rf]});a=await nQ(r,n)}}}let E=await iW(a,f,w,{expectedNonce:await ap.use(t,m,r),requireIdToken:v});if(v){let t=ix(E);if(_=t,d[rm]&&"apple"===d.id)try{_.user=JSON.parse(e?.user)}catch{}if(!1===d.idToken){let e=await ib(a,f,E.access_token,{[n$]:d[rf],[nO]:!0});_=await iv(a,f,t.sub,e)}}else if(h?.request){let e=await h.request({tokens:E,provider:d});e instanceof Object&&(_=e)}else if(h?.url){let e=await ib(a,f,E.access_token,{[n$]:d[rf],[nO]:!0});_=await e.json()}else throw TypeError("No userinfo endpoint configured");return E.expires_in&&(E.expires_at=Math.floor(Date.now()/1e3)+Number(E.expires_in)),{...await ay(_,d,E,u),profile:_,cookies:m}}async function ay(e,t,r,n){try{let n=await t.profile(e,r);return{user:{...n,id:crypto.randomUUID(),email:n.email?.toLowerCase()},account:{...r,provider:t.id,type:t.type,providerAccountId:n.id??crypto.randomUUID()}}}catch(r){n.debug("getProfile error details",e),n.error(new I(r,{provider:t.id}))}}var ab=e.i(467034);
411async function aw(e,t,r,n){let i=await aS(e,t,r),{cookie:a}=await af.create(e,i.challenge,r);return{status:200,cookies:[...n??[],a],body:{action:"register",options:i},headers:{"Content-Type":"application/json"}}}async function a_(e,t,r,n){let i=await ak(e,t,r),{cookie:a}=await af.create(e,i.challenge);return{status:200,cookies:[...n??[],a],body:{action:"authenticate",options:i},headers:{"Content-Type":"application/json"}}}async function av(e,t,r){let n,{adapter:i,provider:a}=e,o=t.body&&"string"==typeof t.body.data?JSON.parse(t.body.data):void 0;if(!o||"object"!=typeof o||!("id"in o)||"string"!=typeof o.id)throw new m("Invalid WebAuthn Authentication response");let s=aP(ax(o.id)),c=await i.getAuthenticator(s);if(!c)throw new m(`WebAuthn authenticator not found in database: ${JSON.stringify({credentialID:s})}`);let{challenge:l}=await af.use(e,t.cookies,r);try{var u;let r=a.getRelayingParty(e,t);n=await a.simpleWebAuthn.verifyAuthenticationResponse({...a.verifyAuthenticationOptions,expectedChallenge:l,response:o,authenticator:{...u=c,credentialDeviceType:u.credentialDeviceType,transports:aT(u.transports),credentialID:ax(u.credentialID),credentialPublicKey:ax(u.credentialPublicKey)},expectedOrigin:r.origin,expectedRPID:r.id})}catch(e){throw new z(e)}let{verified:d,authenticationInfo:p}=n;
411if(!d)throw new z("WebAuthn authentication response could not be verified");try{let{newCounter:e}=p;await i.updateAuthenticatorCounter(c.credentialID,e)}catch(e){throw new y(`Failed to update authenticator counter. This may cause future authentication attempts to fail. ${JSON.stringify({credentialID:s,oldCounter:c.counter,newCounter:p.newCounter})}`,e)}let h=await i.getAccount(c.providerAccountId,a.id);if(!h)throw new m(`WebAuthn account not found in database: ${JSON.stringify({credentialID:s,providerAccountId:c.providerAccountId})}`);let f=await i.getUser(h.userId);if(!f)throw new m(`WebAuthn user not found in database: ${JSON.stringify({credentialID:s,providerAccountId:c.providerAccountId,userID:h.userId})}`);return{account:h,user:f}}async function aE(e,t,r){var n;let i,{provider:a}=e,o=t.body&&"string"==typeof t.body.data?JSON.parse(t.body.data):void 0;if(!o||"object"!=typeof o||!("id"in o)||"string"!=typeof o.id)throw new m("Invalid WebAuthn Registration response");let{challenge:s,registerData:c}=await af.use(e,t.cookies,r);if(!c)throw new m("Missing user registration data in WebAuthn challenge cookie");try{let r=a.getRelayingParty(e,t);i=await a.simpleWebAuthn.verifyRegistrationResponse({...a.verifyRegistrationOptions,expectedChallenge:s,response:o,expectedOrigin:r.origin,expectedRPID:r.id})}catch(e){throw new z(e)}if(!i.verified||!i.registrationInfo)throw new z("WebAuthn registration response could not be verified");let l={providerAccountId:aP(i.registrationInfo.credentialID),provider:e.provider.id,type:a.type},u={providerAccountId:l.providerAccountId,counter:i.registrationInfo.counter,credentialID:aP(i.registrationInfo.credentialID),credentialPublicKey:aP(i.registrationInfo.credentialPublicKey),credentialBackedUp:i.registrationInfo.credentialBackedUp,credentialDeviceType:i.registrationInfo.credentialDeviceType,transports:(n=o.response.transports,n?.join(","))};return{user:c,account:l,authenticator:u}}async function ak(e,t,r){let{provider:n,adapter:i}=e,a=r&&r.id?await i.listAuthenticatorsByUserId(r.id):null,o=n.getRelayingParty(e,t);return await n.simpleWebAuthn.generateAuthenticationOptions({...n.authenticationOptions,rpID:o.id,allowCredentials:a?.map(e=>({id:ax(e.credentialID),type:"public-key",transports:aT(e.transports)}))})}async function aS(e,t,r){let{provider:n,adapter:i}=e,a=r.id?await i.listAuthenticatorsByUserId(r.id):null,o=rs(32),s=n.getRelayingParty(e,t);return await n.simpleWebAuthn.generateRegistrationOptions({...n.registrationOptions,userID:o,userName:r.email,userDisplayName:r.name??void 0,rpID:s.id,rpName:s.name,excludeCredentials:a?.map(e=>({id:ax(e.credentialID),type:"public-key",transports:aT(e.transports)}))})}function aA(e){let{provider:t,adapter:r}=e;if(!r)throw new P("An adapter is required for the WebAuthn provider");if(!t||"webauthn"!==t.type)throw new H("Provider must be WebAuthn");return{...e,provider:t,adapter:r}}function ax(e){return new Uint8Array(ab.Buffer.from(e,"base64"))}function aP(e){return ab.Buffer.from(e).toString("base64")}function aT(e){return e?e.split(","):void 0}async function aR(e,t,r,n){if(!t.provider)throw new H("Callback route called without provider");let{query:i,body:a,method:o,headers:s}=e,{provider:c,adapter:l,url:u,callbackUrl:d,pages:p,jwt:h,events:f,callbacks:g,session:{strategy:y,maxAge:b},logger:_}=t,v="jwt"===y;try{if("oauth"===c.type||"oidc"===c.type){let o,s=c.authorization?.url.searchParams.get("response_mode")==="form_post"?a:i;if(t.isOnRedirectProxy&&s?.state){let e=await ad.decode(s.state,t);if(e?.origin&&new URL(e.origin).origin!==t.url.origin){let t=`${e.origin}?${new URLSearchParams(s)}`;return _.debug("Proxy redirecting to",t),{redirect:t,cookies:n}}}let m=await ag(s,e.cookies,t);m.cookies.length&&n.push(...m.cookies),_.debug("authorization result",m);let{user:y,account:w,profile:E}=m;if(!y||!w||!E)return{redirect:`${u}/signin`,cookies:n};if(l){let{getUserByAccount:e}=l;o=await e({providerAccountId:w.providerAccountId,provider:c.id})}let k=await aC({user:o??y,account:w,profile:E},t);if(k)return{redirect:k,cookies:n};let{user:S,session:A,isNewUser:x}=await nP(r.value,y,w,t);
411if(v){let e={name:S.name,email:S.email,picture:S.image,sub:S.id?.toString()},i=await g.jwt({token:e,user:S,account:w,profile:E,isNewUser:x,trigger:x?"signUp":"signIn"});if(null===i)n.push(...r.clean());else{let e=t.cookies.sessionToken.name,a=await h.encode({...h,token:i,salt:e}),o=new Date;o.setTime(o.getTime()+1e3*b);let s=r.chunk(a,{expires:o});n.push(...s)}}else n.push({name:t.cookies.sessionToken.name,value:A.sessionToken,options:{...t.cookies.sessionToken.options,expires:A.expires}});if(await f.signIn?.({user:S,account:w,profile:E,isNewUser:x}),x&&p.newUser)return{redirect:`${p.newUser}${p.newUser.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:d})}`,cookies:n};return{redirect:d,cookies:n}}if("email"===c.type){let e=i?.token,a=i?.email;if(!e){let t=TypeError("Missing token. The sign-in URL was manually opened without token or the link was not sent correctly in the email.",{cause:{hasToken:!!e}});throw t.name="Configuration",t}let o=c.secret??t.secret,s=await l.useVerificationToken({identifier:a,token:await ro(`${e}${o}`)}),u=!!s,m=u&&s.expires.valueOf()<Date.now();if(!u||m||a&&s.identifier!==a)throw new W({hasInvite:u,expired:m});let{identifier:y}=s,w=await l.getUserByEmail(y)??{id:crypto.randomUUID(),email:y,emailVerified:null},_={providerAccountId:w.email,userId:w.id,type:"email",provider:c.id},E=await aC({user:w,account:_},t);if(E)return{redirect:E,cookies:n};let{user:k,session:S,isNewUser:A}=await nP(r.value,w,_,t);if(v){let e={name:k.name,email:k.email,picture:k.image,sub:k.id?.toString()},i=await g.jwt({token:e,user:k,account:_,isNewUser:A,trigger:A?"signUp":"signIn"});if(null===i)n.push(...r.clean());else{let e=t.cookies.sessionToken.name,a=await h.encode({...h,token:i,salt:e}),o=new Date;o.setTime(o.getTime()+1e3*b);let s=r.chunk(a,{expires:o});n.push(...s)}}else n.push({name:t.cookies.sessionToken.name,value:S.sessionToken,options:{...t.cookies.sessionToken.options,expires:S.expires}});if(await f.signIn?.({user:k,account:_,isNewUser:A}),A&&p.newUser)return{redirect:`${p.newUser}${p.newUser.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:d})}`,cookies:n};return{redirect:d,cookies:n}}if("credentials"===c.type&&"POST"===o){let e=a??{};Object.entries(i??{}).forEach(([e,t])=>u.searchParams.set(e,t));let l=await c.authorize(e,new Request(u,{headers:s,method:o,body:JSON.stringify(a)}));if(l)l.id=l.id?.toString()??crypto.randomUUID();else throw new k;let p={providerAccountId:l.id,type:"credentials",provider:c.id},m=await aC({user:l,account:p,credentials:e},t);if(m)return{redirect:m,cookies:n};let y={name:l.name,email:l.email,picture:l.image,sub:l.id},w=await g.jwt({token:y,user:l,account:p,isNewUser:!1,trigger:"signIn"});if(null===w)n.push(...r.clean());else{let e=t.cookies.sessionToken.name,i=await h.encode({...h,token:w,salt:e}),a=new Date;a.setTime(a.getTime()+1e3*b);let o=r.chunk(i,{expires:a});n.push(...o)}return await f.signIn?.({user:l,account:p}),{redirect:d,cookies:n}}else if("webauthn"===c.type&&"POST"===o){let i,a,o,s=e.body?.action;if("string"!=typeof s||"authenticate"!==s&&"register"!==s)throw new m("Invalid action parameter");let c=aA(t);switch(s){case"authenticate":{let t=await av(c,e,n);i=t.user,a=t.account;break}case"register":{let r=await aE(t,e,n);i=r.user,a=r.account,o=r.authenticator}}await aC({user:i,account:a},t);let{user:l,isNewUser:u,session:y,account:w}=await nP(r.value,i,a,t);if(!w)throw new m("Error creating or finding account");if(o&&l.id&&await c.adapter.createAuthenticator({...o,userId:l.id}),v){let e={name:l.name,email:l.email,picture:l.image,sub:l.id?.toString()},i=await g.jwt({token:e,user:l,account:w,isNewUser:u,trigger:u?"signUp":"signIn"});if(null===i)n.push(...r.clean());else{let e=t.cookies.sessionToken.name,a=await h.encode({...h,token:i,salt:e}),o=new Date;o.setTime(o.getTime()+1e3*b);let s=r.chunk(a,{expires:o});n.push(...s)}}else n.push({name:t.cookies.sessionToken.name,value:y.sessionToken,options:{...t.cookies.sessionToken.options,expires:y.expires}});if(await f.signIn?.({user:l,account:w,isNewUser:u}),u&&p.newUser)return{redirect:`${p.newUser}${p.newUser.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:d})}`,cookies:n};return{redirect:d,cookies:n}}throw new H(`Callback for provider type (${c.type}) is not supported`)}catch(t){if(t instanceof m)throw t;let e=new w(t,{provider:c.id});throw _.debug("callback route error details",{method:o,query:i,body:a}),e}}async function aC(e,t){let r,{signIn:n,redirect:i}=t.callbacks;try{r=await n(e)}catch(e){if(e instanceof m)throw e;throw new b(e)}if(!r)throw new b("AccessDenied");if("string"==typeof r)return await i({url:r,baseUrl:t.url.origin})}async function aU(e,t,r,n,i){let{adapter:a,jwt:o,events:s,callbacks:c,logger:l,session:{strategy:u,maxAge:d}}=e,p={body:null,headers:{"Content-Type":"application/json",...!n&&{"Cache-Control":"private, no-cache, no-store",Expires:"0",Pragma:"no-cache"}},cookies:r},h=t.value;if(!h)return p;if("jwt"===u){try{let r=e.cookies.sessionToken.name,a=await o.decode({...o,token:h,salt:r});if(!a)throw Error("Invalid JWT");let l=await c.jwt({token:a,...n&&{trigger:"update"},session:i}),u=nx(d);if(null!==l){let e={user:{name:l.name,email:l.email,image:l.picture},expires:u.toISOString()},n=await c.session({session:e,token:l});p.body=n;let i=await o.encode({...o,token:l,salt:r}),a=t.chunk(i,{expires:u});p.cookies?.push(...a),await s.session?.({session:n,token:l})}else p.cookies?.push(...t.clean())}catch(e){l.error(new x(e)),p.cookies?.push(...t.clean())}return p}try{let{getSessionAndUser:r,deleteSession:o,updateSession:l}=a,u=await r(h);if(u&&u.session.expires.valueOf()<Date.now()&&(await o(h),u=null),u){let{user:t,session:r}=u,a=e.session.updateAge,o=r.expires.valueOf()-1e3*d+1e3*a,f=nx(d);o<=Date.now()&&await l({sessionToken:h,expires:f});let m=await c.session({session:{...r,user:t},user:t,newSession:i,...n?{trigger:"update"}:{}});p.body=m,p.cookies?.push({name:e.cookies.sessionToken.name,value:h,options:{...e.cookies.sessionToken.options,expires:f}}),await s.session?.({session:m})}else h&&p.cookies?.push(...t.clean())}catch(e){l.error(new L(e))}return p}async function aO(e,t){let r,n,{logger:i,provider:a}=t,o=a.authorization?.url;if(!o||"authjs.dev"===o.host){let e=new URL(a.issuer),t=await nG(e,{[n$]:a[rf],[nO]:!0}),r=await nQ(e,t).catch(t=>{if(!(t instanceof TypeError)||"Invalid URL"!==t.message)throw t;
411throw TypeError(`Discovery request responded with an invalid issuer. expected: ${e}`)});if(!r.authorization_endpoint)throw TypeError("Authorization server did not provide an authorization endpoint.");o=new URL(r.authorization_endpoint)}let s=o.searchParams,c=a.callbackUrl;!t.isOnRedirectProxy&&a.redirectProxyUrl&&(c=a.redirectProxyUrl,n=a.callbackUrl,i.debug("using redirect proxy",{redirect_uri:c,data:n}));let l=Object.assign({response_type:"code",client_id:a.clientId,redirect_uri:c,...a.authorization?.params},Object.fromEntries(a.authorization?.url.searchParams??[]),e);for(let e in l)s.set(e,l[e]);let u=[];a.authorization?.url.searchParams.get("response_mode")==="form_post"&&(t.cookies.state.options.sameSite="none",t.cookies.state.options.secure=!0,t.cookies.nonce.options.sameSite="none",t.cookies.nonce.options.secure=!0);let d=await ad.create(t,n);if(d&&(s.set("state",d.value),u.push(d.cookie)),a.checks?.includes("pkce"))if(r&&!r.code_challenge_methods_supported?.includes("S256"))"oidc"===a.type&&(a.checks=["nonce"]);else{let{value:e,cookie:r}=await al.create(t);s.set("code_challenge",e),s.set("code_challenge_method","S256"),u.push(r)}let p=await ap.create(t);return p&&(s.set("nonce",p.value),u.push(p.cookie)),"oidc"!==a.type||o.searchParams.has("scope")||o.searchParams.set("scope","openid profile email"),i.debug("authorization url is ready",{url:o,cookies:u,provider:a}),{redirect:o.toString(),cookies:u}}async function aI(e,t){let r,{body:n}=e,{provider:i,callbacks:a,adapter:o}=t,s=(i.normalizeIdentifier??function(e){if(!e)throw Error("Missing email from request body.");let t=e.toLowerCase().trim();if(t.includes('"'))throw Error("Invalid email address format.");let[r,n]=t.split("@");if(!r||!n||2!==t.split("@").length||!(n=n.split(",")[0]))throw Error("Invalid email address format.");return`${r}@${n}`})(n?.email),c={id:crypto.randomUUID(),email:s,emailVerified:null},l=await o.getUserByEmail(s)??c,u={providerAccountId:s,userId:l.id,type:"email",provider:i.id};try{r=await a.signIn({user:l,account:u,email:{verificationRequest:!0}})}catch(e){throw new b(e)}if(!r)throw new b("AccessDenied");if("string"==typeof r)return{redirect:await a.redirect({url:r,baseUrl:t.url.origin})};let{callbackUrl:d,theme:p}=t,h=await i.generateVerificationToken?.()??rs(32),f=new Date(Date.now()+(i.maxAge??86400)*1e3),m=i.secret??t.secret,g=new URL(t.basePath,t.url.origin),y=i.sendVerificationRequest({identifier:s,token:h,expires:f,url:`${g}/callback/${i.id}?${new URLSearchParams({callbackUrl:d,token:h,email:s})}`,provider:i,theme:p,request:new Request(e.url,{headers:e.headers,method:e.method,body:"POST"===e.method?JSON.stringify(e.body??{}):void 0})}),w=o.createVerificationToken?.({identifier:s,token:await ro(`${h}${m}`),expires:f});return await Promise.all([y,w]),{redirect:`${g}/verify-request?${new URLSearchParams({provider:i.id,type:i.type})}`}}async function aL(e,t,r){let n=`${r.url.origin}${r.basePath}/signin`;if(!r.provider)return{redirect:n,cookies:t};switch(r.provider.type){case"oauth":case"oidc":{let{redirect:n,cookies:i}=await aO(e.query,r);return i&&t.push(...i),{redirect:n,cookies:t}}case"email":return{...await aI(e,r),cookies:t};default:return{redirect:n,cookies:t}}}async function a$(e,t,r){let{jwt:n,events:i,callbackUrl:a,logger:o,session:s}=r,c=t.value;if(!c)return{redirect:a,cookies:e};try{if("jwt"===s.strategy){let e=r.cookies.sessionToken.name,t=await n.decode({...n,token:c,salt:e});await i.signOut?.({token:t})}else{let e=await r.adapter?.deleteSession(c);await i.signOut?.({session:e})}}catch(e){o.error(new $(e))}return e.push(...t.clean()),{redirect:a,cookies:e}}async function aN(e,t){let{adapter:r,jwt:n,session:{strategy:i}}=e,a=t.value;if(!a)return null;if("jwt"===i){let t=e.cookies.sessionToken.name,r=await n.decode({...n,token:a,salt:t});if(r&&r.sub)return{id:r.sub,name:r.name,email:r.email,image:r.picture}}else{let e=await r?.getSessionAndUser(a);if(e)return e.user}return null}async function aj(e,t,r,n){let i=aA(t),{provider:a}=i,{action:o}=e.query??{};if("register"!==o&&"authenticate"!==o&&void 0!==o)return{status:400,body:{error:"Invalid action"},cookies:n,headers:{"Content-Type":"application/json"}};let s=await aN(t,r),c=s?{user:s,exists:!0}:await a.getUserInfo(t,e),l=c?.user;switch(function(e,t,r){let{user:n,exists:i=!1}=r??{};switch(e){case"authenticate":return"authenticate";case"register":if(n&&t===i)return"register";break;case void 0:if(!t)if(!n)return"authenticate";else if(i)return"authenticate";else return"register"}return null}(o,!!s,c)){case"authenticate":return a_(i,e,l,n);case"register":if("string"==typeof l?.email)return aw(i,e,l,n);break;default:return{status:400,body:{error:"Invalid request"},cookies:n,headers:{"Content-Type":"application/json"}}}}async function aH(e,t){let{action:r,providerId:n,error:i,method:a}=e,o=t.skipCSRFCheck===rp,{options:s,cookies:c}=await rv({authOptions:t,action:r,providerId:n,url:e.url,callbackUrl:e.body?.callbackUrl??e.query?.callbackUrl,csrfToken:e.body?.csrfToken,cookies:e.cookies,isPost:"POST"===a,csrfDisabled:o}),l=new f(s.cookies.sessionToken,e.cookies,s.logger);if("GET"===a){let t=nA({...s,query:e.query,cookies:c});switch(r){case"callback":return await aR(e,s,l,c);case"csrf":return t.csrf(o,s,c);case"error":return t.error(i);case"providers":return t.providers(s.providers);case"session":return await aU(s,l,c);case"signin":return t.signin(n,i);case"signout":return t.signout();case"verify-request":return t.verifyRequest();case"webauthn-options":return await aj(e,s,l,c)}}else{let{csrfTokenVerified:t}=s;switch(r){case"callback":return"credentials"===s.provider.type&&rl(r,t),await aR(e,s,l,c);case"session":return rl(r,t),await aU(s,l,c,!0,e.body?.data);case"signin":return rl(r,t),await aL(e,c,s);case"signout":return rl(r,t),await a$(c,l,s)}}throw new N(`Cannot handle action: ${r}`)}function aD(e,t,r,n,i){let a,o=i?.basePath,s=n.AUTH_URL??n.NEXTAUTH_URL;if(s)a=new URL(s),o&&"/"!==o&&"/"!==a.pathname&&(a.pathname!==o&&t7(i).warn("env-url-basepath-mismatch"),a.pathname="/");else{let e=r.get("x-forwarded-host")??r.get("host"),n=r.get("x-forwarded-proto")??t??"https",i=n.endsWith(":")?n:n+":";a=new URL(`${i}//${e}`)}let c=a.toString().replace(/\/$/,"");
411if(o){let t=o?.replace(/(^\/|\/$)/g,"")??"";return new URL(`${c}/${t}/${e}`)}return new URL(`${c}/${e}`)}async function aW(e,t){let r=t7(t),n=await ri(e,t);if(!n)return Response.json("Bad request.",{status:400});let i=function(e,t){let{url:r}=e,n=[];if(!V&&t.debug&&n.push("debug-enabled"),!t.trustHost)return new D(`Host must be trusted. URL was: ${e.url}`);if(!t.secret?.length)return new C("Please define a `secret`");let i=e.query?.callbackUrl;if(i&&!G(i,r.origin))return new E(`Invalid callback URL. Received: ${i}`);let{callbackUrl:a}=h(t.useSecureCookies??"https:"===r.protocol),o=e.cookies?.[t.cookies?.callbackUrl?.name??a.name];if(o&&!G(o,r.origin))return new E(`Invalid callback URL. Received: ${o}`);let s=!1;for(let e of t.providers){let t="function"==typeof e?e():e;if(("oauth"===t.type||"oidc"===t.type)&&!(t.issuer??t.options?.issuer)){let e,{authorization:r,token:n,userinfo:i}=t;if("string"==typeof r||r?.url?"string"==typeof n||n?.url?"string"==typeof i||i?.url||(e="userinfo"):e="token":e="authorization",e)return new S(`Provider "${t.id}" is missing both \`issuer\` and \`${e}\` endpoint config. At least one of them is required`)}if("credentials"===t.type)Y=!0;else if("email"===t.type)Z=!0;else if("webauthn"===t.type){var c;if(Q=!0,t.simpleWebAuthnBrowserVersion&&(c=t.simpleWebAuthnBrowserVersion,!/^v\d+(?:\.\d+){0,2}$/.test(c)))return new m(`Invalid provider config for "${t.id}": simpleWebAuthnBrowserVersion "${t.simpleWebAuthnBrowserVersion}" must be a valid semver string.`);if(t.enableConditionalUI){if(s)return new J("Multiple webauthn providers have 'enableConditionalUI' set to True. Only one provider can have this option enabled at a time");if(s=!0,!Object.values(t.formFields).some(e=>e.autocomplete&&e.autocomplete.toString().indexOf("webauthn")>-1))return new q(`Provider "${t.id}" has 'enableConditionalUI' set to True, but none of its formFields have 'webauthn' in their autocomplete param`)}}}if(Y){let e=t.session?.strategy==="database",r=!t.providers.some(e=>
411"credentials"!==("function"==typeof e?e():e).type);if(e&&r)return new j("Signing in with credentials only supported if JWT strategy is enabled");if(t.providers.some(e=>{let t="function"==typeof e?e():e;return"credentials"===t.type&&!t.authorize}))return new R("Must define an authorize() handler to use credentials authentication provider")}let{adapter:l,session:u}=t,d=[];if(Z||u?.strategy==="database"||!u?.strategy&&l)if(Z){if(!l)return new P("Email login requires an adapter");d.push(...ee)}else{if(!l)return new P("Database session requires an adapter");d.push(...et)}if(Q){if(!t.experimental?.enableWebAuthn)return new X("WebAuthn is an experimental feature. To enable it, set `experimental.enableWebAuthn` to `true` in your config");if(n.push("experimental-webauthn"),!l)return new P("WebAuthn requires an adapter");d.push(...er)}if(l){let e=d.filter(e=>!(e in l));if(e.length)return new T(`Required adapter methods were missing: ${e.join(", ")}`)}return V||(V=!0),n}(n,t);if(Array.isArray(i))i.forEach(r.warn);else if(i){if(r.error(i),!new Set(["signin","signout","error","verify-request"]).has(n.action)||"GET"!==n.method)return Response.json({message:"There was a problem with the server configuration. Check the server logs for more information."},{status:500});let{pages:e,theme:a}=t,o=e?.error&&n.url.searchParams.get("callbackUrl")?.startsWith(e.error);if(!e?.error||o)return o&&r.error(new _(`The error page ${e?.error} should not require authentication`)),ra(nA({theme:a}).error("Configuration"));let s=`${n.url.origin}${e.error}?error=Configuration`;return Response.redirect(s)}let a=e.headers?.has("X-Auth-Return-Redirect"),o=t.raw===rh;try{let e=await aH(n,t);if(o)return e;let r=ra(e),i=r.headers.get("Location");if(!a||!i)return r;return Response.json({url:i},{headers:r.headers})}catch(d){r.error(d);let i=d instanceof m;if(i&&o&&!a)throw d;if("POST"===e.method&&"session"===n.action)return Response.json(null,{status:400});let s=new URLSearchParams({error:B(d)?d.type:"Configuration"});d instanceof k&&s.set("code",d.code);let c=i&&d.kind||"error",l=t.pages?.[c]??`${t.basePath}/${c.toLowerCase()}`,u=`${n.url.origin}${l}?${s}`;if(a)return Response.json({url:u});return Response.redirect(u)}}var aM=e.i(247167),aK=e.i(223397);function aB(e){let t=aM.default.env.AUTH_URL??aM.default.env.NEXTAUTH_URL;if(!t)return e;let{origin:r}=new URL(t),{href:n,origin:i}=e.nextUrl;return new aK.NextRequest(n.replace(i,r),e)}function aJ(e){try{e.secret??(e.secret=aM.default.env.AUTH_SECRET??aM.default.env.NEXTAUTH_SECRET);let t=aM.default.env.AUTH_URL??aM.default.env.NEXTAUTH_URL;if(!t)return;let{pathname:r}=new URL(t);if("/"===r)return;e.basePath||(e.basePath=r)}catch{}finally{e.basePath||(e.basePath="/api/auth"),function(e,t,r=!1){try{let n=e.AUTH_URL;n&&(t.basePath?r||t7(t).warn("env-url-basepath-redundant"):t.basePath=new URL(n).pathname)}catch{}finally{t.basePath??(t.basePath="/auth")}if(!t.secret?.length){t.secret=[];let r=e.AUTH_SECRET;for(let n of(r&&t.secret.push(r),[1,2,3])){let r=e[`AUTH_SECRET_${n}`];r&&t.secret.unshift(r)}}t.redirectProxyUrl??(t.redirectProxyUrl=e.AUTH_REDIRECT_PROXY_URL),t.trustHost??(t.trustHost=!!(e.AUTH_URL??e.AUTH_TRUST_HOST??e.VERCEL??e.CF_PAGES??"production"!==e.NODE_ENV)),t.providers=t.providers.map(t=>{let{id:r}="function"==typeof t?t({}):t,n=r.toUpperCase().replace(/-/g,"_"),i=e[`AUTH_${n}_ID`],a=e[`AUTH_${n}_SECRET`],o=e[`AUTH_${n}_ISSUER`],s=e[`AUTH_${n}_KEY`],c="function"==typeof t?t({clientId:i,clientSecret:a,issuer:o,apiKey:s}):t;return"oauth"===c.type||"oidc"===c.type?(c.clientId??(c.clientId=i),c.clientSecret??(c.clientSecret=a),c.issuer??(c.issuer=o)):"email"===c.type&&(c.apiKey??(c.apiKey=s)),c})}(aM.default.env,e,!0)}}var aq=e.i(630029);async function az(e,t){return aW(new Request(aD("session",e.get("x-forwarded-proto"),e,aM.default.env,t),{headers:{cookie:e.get("cookie")??""}}),{...t,callbacks:{...t.callbacks,async session(...e){let r=await t.callbacks?.session?.(...e)??{...e[0].session,expires:e[0].session.expires?.toISOString?.()??e[0].session.expires};return{user:e[0].user??e[0].token,...r}}}})}function aF(e){return"function"==typeof e}function aX(e,t){return"function"==typeof e?async(...r)=>{if(!r.length){let r=await (0,aq.headers)(),n=await e(void 0);return t?.(n),az(r,n).then(e=>e.json())}if(r[0]instanceof Request){let n=r[0],i=r[1],a=await e(n);return t?.(a),aV([n,i],a)}if(aF(r[0])){let n=r[0];return async(...r)=>{let i=await e(r[0]);return t?.(i),aV(r,i,n)}}let n="req"in r[0]?r[0].req:r[0],i="res"in r[0]?r[0].res:r[1],a=await e(n);return t?.(a),az(new Headers(n.headers),a).then(async e=>{let t=await e.json();for(let t of e.headers.getSetCookie())"headers"in i?i.headers.append("set-cookie",t):i.appendHeader("set-cookie",t);return t})}:(...t)=>{if(!t.length)return Promise.resolve((0,aq.headers)()).then(t=>az(t,e).then(e=>e.json()));if(t[0]instanceof Request)return aV([t[0],t[1]],e);if(aF(t[0])){let r=t[0];return async(...t)=>aV(t,e,r).then(e=>e)}let r="req"in t[0]?t[0].req:t[0],n="res"in t[0]?t[0].res:t[1];return az(new Headers(r.headers),e).then(async e=>{let t=await e.json();for(let t of e.headers.getSetCookie())"headers"in n?n.headers.append("set-cookie",t):n.appendHeader("set-cookie",t);return t})}}async function aV(e,t,r){let n=aB(e[0]),i=await az(n.headers,t),a=await i.json(),o=!0;t.callbacks?.authorized&&(o=await t.callbacks.authorized({request:n,auth:a}));let s=aK.NextResponse.next?.();if(o instanceof Response){var c,l,u;let e,r;s=o;let i=o.headers.get("Location"),{pathname:a}=n.nextUrl;i&&(c=a,l=new URL(i).pathname,u=t,e=l.replace(`${c}/`,""),r=Object.values(u.pages??{}),(aG.has(e)||r.includes(l))&&l===c)&&(o=!0)}else if(r)n.auth=a,s=await r(n,e[1])??aK.NextResponse.next();else if(!o){let e=t.pages?.signIn??`${t.basePath}/signin`;if(n.nextUrl.pathname!==e){let t=n.nextUrl.clone();t.pathname=e,t.searchParams.set("callbackUrl",n.nextUrl.href),s=aK.NextResponse.redirect(t)}}let d=new Response(s?.body,s);for(let e of i.headers.getSetCookie())d.headers.append("set-cookie",e);return d}let aG=new Set(["providers","session","csrf","signin","signout","callback","verify-request","error"]);var aY=e.i(618566);async function aZ(e,t={},r,n){let i=new Headers(await (0,aq.headers)()),{redirect:a=!0,redirectTo:o,...s}=t instanceof FormData?Object.fromEntries(t):t,c=o?.toString()??i.get("Referer")??"/",l=aD("signin",i.get("x-forwarded-proto"),i,aM.default.env,n);if(!e)return l.searchParams.append("callbackUrl",c),a&&(0,aY.redirect)(l.toString()),l.toString();let u=`${l}/${e}?${new URLSearchParams(r)}`,d={};for(let t of n.providers){let{options:r,...n}="function"==typeof t?t():t,i=r?.id??n.id;if(i===e){d={id:i,type:r?.type??n.type};break}}if(!d.id){let e=`${l}?${new URLSearchParams({callbackUrl:c})}`;return a&&(0,aY.redirect)(e),e}"credentials"===d.type&&(u=u.replace("signin","callback")),i.set("Content-Type","application/x-www-form-urlencoded");
411let p=new Request(u,{method:"POST",headers:i,body:new URLSearchParams({...s,callbackUrl:c})}),h=await aW(p,{...n,raw:rh,skipCSRFCheck:rp}),f=await (0,aq.cookies)();for(let e of h?.cookies??[])f.set(e.name,e.value,e.options);let m=(h instanceof Response?h.headers.get("Location"):h.redirect)??u;return a?(0,aY.redirect)(m):m}async function aQ(e,t){let r=new Headers(await (0,aq.headers)());r.set("Content-Type","application/x-www-form-urlencoded");let n=aD("signout",r.get("x-forwarded-proto"),r,aM.default.env,t),i=new URLSearchParams({callbackUrl:e?.redirectTo??r.get("Referer")??"/"}),a=new Request(n,{method:"POST",headers:r,body:i}),o=await aW(a,{...t,raw:rh,skipCSRFCheck:rp}),s=await (0,aq.cookies)();for(let e of o?.cookies??[])s.set(e.name,e.value,e.options);return e?.redirect??!0?(0,aY.redirect)(o.redirect):o}async function a0(e,t){let r=new Headers(await (0,aq.headers)());r.set("Content-Type","application/json");let n=new Request(aD("session",r.get("x-forwarded-proto"),r,aM.default.env,t),{method:"POST",headers:r,body:JSON.stringify({data:e})}),i=await aW(n,{...t,raw:rh,skipCSRFCheck:rp}),a=await (0,aq.cookies)();for(let e of i?.cookies??[])a.set(e.name,e.value,e.options);return i.body}e.s(["default",0,function(e){if("function"==typeof e){let t=async t=>{let r=await e(t);return aJ(r),aW(aB(t),r)};return{handlers:{GET:t,POST:t},auth:aX(e,e=>aJ(e)),signIn:async(t,r,n)=>{let i=await e(void 0);return aJ(i),aZ(t,r,n,i)},signOut:async t=>{let r=await e(void 0);return aJ(r),aQ(t,r)},unstable_update:async t=>{let r=await e(void 0);return aJ(r),a0(t,r)}}}aJ(e);let t=t=>aW(aB(t),e);return{handlers:{GET:t,POST:t},auth:aX(e),signIn:(t,r,n)=>aZ(t,r,n,e),signOut:t=>aQ(t,e),unstable_update:t=>a0(t,e)}}],966871)},126318,990136,980159,976216,e=>{"use strict";let t,r;var n,i=e.i(741857),a=e.i(945168),o=((n={})[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.UNAUTHORIZED=401]="UNAUTHORIZED",n[n.FORBIDDEN=403]="FORBIDDEN",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n);e.s(["HttpStatus",()=>o],990136);class s{log(e,...t){console.log(e,...t)}info(e,...t){console.info(`â¹ï¸ ${e}`,...t)}error(e,...t){console.error(`â ï¸ ${e}`,...t)}}new s,e.s(["LoggerService",0,s],980159);class c{logCached=!1;constructor(e){this.logCached=e.logCached??!1}}let l=(r={logCached:(t=(0,i.getAppConfig)()).logger.http.logCached},(0,a.isServer)()?t.logger.http.prisme?new class e extends c{send(e){(this.logCached||!e.cached)&&this.displayLog(this.mapToLogFormatPrisme(e))}mapToLogFormatPrisme(e){let t=new URL(e.uri),r=`${t.protocol}//${t.host}${t.pathname}`;return{st:"portailvente_web_wall",requestUri:e.uri,urlPattern:r,httpMethod:e.method.toUpperCase(),httpStatus:e.status,headers:e.headers,duree:e.duration,input:e.input,output:e.output,level:e.status>=o.BAD_REQUEST?"ERROR":"INFO",appelant:"server"}}displayLog(e){console.info(JSON.stringify(e))}}(r):new class e extends c{logger;constructor(e){super(e),this.logger=new s}send(e){e.cached?this.logger.log("â
HTTP Success",e):e.status>=o.BAD_REQUEST?this.logger.error("HTTP Error",e):this.logger.info("HTTP Request",e)}}(r):new class e extends c{send(e){}}(r));e.s(["transporter",0,l],126318);let u=/\?.+/,d=[{path:/\/(0|\+33)[1-9]\d{8}(\/|$)/g,remplacement:"/{numTel}$2"},{path:/\/([a-z0-9][a-z0-9_.-]*@[a-z][a-z0-9_.-]*\.[a-z]+)/gi,remplacement:"/{email}"},{path:/\/\d+[TP]/g,remplacement:"/{ligne}"},{path:/\/produits\/[A-Z0-9_]+/g,remplacement:"/produits/{produit}"},{path:/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi,remplacement:"/{id}"},{path:/\/(\d+)/g,remplacement:"/{id}"}];e.s(["extractUrlPattern",0,function(e){for(let t of(e=e.replace(u,""),d))e=e.replace(t.path,t.remplacement);return e}],976216)},415033,e=>{"use strict";var t=e.i(247167),r=e.i(966871),n=e.i(741857),i=e.i(126318),a=e.i(976216);let o=new class{transporter;constructor(e){this.transporter=e}log(e,t){if("authorization url is ready"!==e)return;let r={};r.uri=t.url.href??"",r.method="GET",r.typeEv="APPELRESS",r.urlPattern=t.url?(0,a.extractUrlPattern)(t.url.href):"",this.transporter.send(r)}}(i.transporter),s=(0,n.getAppConfig)(),{handlers:{GET:c,POST:l},auth:u,signIn:d}=(0,r.default)({basePath:"/webapi/checkout/auth",secret:t.default.env.NEXTAUTH_SECRET,trustHost:!0,cookies:{sessionToken:{name:"next-session-token",options:{httpOnly:!0,sameSite:"lax",path:"/",secure:!0}},callbackUrl:{name:"next-callback-url",options:{sameSite:"lax",path:"/",secure:!0}},csrfToken:{name:"next-csrf-token",options:{httpOnly:!0,sameSite:"lax",path:"/",secure:!0}},pkceCodeVerifier:{name:"next-pkce-code-verifier",options:{httpOnly:!0,sameSite:"lax",path:"/",secure:!0,maxAge:900}},state:{name:"next-auth-state",options:{httpOnly:!0,sameSite:"lax",path:"/",secure:!0,maxAge:900}},nonce:{name:"next-auth-nonce",options:{httpOnly:!0,sameSite:"lax",path:"/",secure:!0}}},providers:[{id:"oauth2",name:"Oauth2",issuer:s.oauth2.url,type:"oidc",checks:["pkce","state"],clientId:s.oauth2.clientId,authorization:{url:s.oauth2.authorizationUrl,params:{scope:""}},token:{url:s.oauth2.tokenUrl},userinfo:{url:s.oauth2.userInfoUrl},client:{token_endpoint_auth_method:"none"},profile:e=>({id:e.sub,...e})}],logger:{debug(e,t){o.log(e,t)}},session:{maxAge:3600},callbacks:{session:({session:{expires:e},token:t})=>({user:t,expires:e}),jwt({token:e,profile:t,account:r}){let n=e;return t&&(n={sub:t.sub,login:t.login,name:t.name,user_type:t.user_type,tokenExp:t.exp,given_name:t.given_name}),r&&(n={...n,accessToken:r?.access_token}),n}}});e.s(["auth",0,u],415033)},416487,526732,e=>{"use strict";var t=e.i(741857);e.i(708594),e.i(415033);var r=e.i(247167),n=e.i(843476),i=e.i(271645),a=e.i(999526);class o extends a.AuthError{}class s extends a.AuthError{}async function c(e,t,r,n={}){let i=`${l(t)}/${e}`;try{let e={headers:{"Content-Type":"application/json",...n?.headers?.cookie?{cookie
411:n.headers.cookie}:{}}};n?.body&&(e.body=JSON.stringify(n.body),e.method="POST");let t=await fetch(i,e),r=await t.json();if(!t.ok)throw r;return r}catch(e){return r.error(new o(e.message,e)),null}}function l(e){return"u"<typeof window?`${e.baseUrlServer}${e.basePathServer}`:e.basePath}function u(){return Math.floor(Date.now()/1e3)}function d(e){let t=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e=`https://${e}`);let r=new URL(e||t),n=("/"===r.pathname?t.pathname:r.pathname).replace(/\/$/,""),i=`${r.origin}${n}`;return{origin:r.origin,host:r.host,path:n,base:i,toString:()=>i}}let p={baseUrl:d(r.default.env.NEXTAUTH_URL??r.default.env.VERCEL_URL).origin,basePath:d(r.default.env.NEXTAUTH_URL).path,baseUrlServer:d(r.default.env.NEXTAUTH_URL_INTERNAL??r.default.env.NEXTAUTH_URL??r.default.env.VERCEL_URL).origin,basePathServer:d(r.default.env.NEXTAUTH_URL_INTERNAL??r.default.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:()=>{}},h=null;function f(){return"u"<typeof BroadcastChannel?{postMessage:()=>{},addEventListener:()=>{},removeEventListener:()=>{},name:"next-auth",onmessage:null,onmessageerror:null,close:()=>{},dispatchEvent:()=>!1}:new BroadcastChannel("next-auth")}function m(){return null===h&&(h=f()),h}let g={debug:console.debug,error:console.error,warn:console.warn},y=i.createContext?.(void 0);async function b(e){let t=await c("session",p,g,e);return(e?.broadcast??!0)&&f().postMessage({event:"session",data:{trigger:"getSession"}}),t}async function w(){let e=await c("csrf",p,g);return e?.csrfToken??""}async function _(){return c("providers",p,g)}async function v(e,t,r){let{callbackUrl:n,...i}=t??{},{redirect:a=!0,redirectTo:o=n??window.location.href,...s}=i,c=l(p),u=await _();if(!u){let e=`${c}/error`;window.location.href=e;return}if(!e||!u[e]){let e=`${c}/signin?${new URLSearchParams({callbackUrl:o})}`;window.location.href=e;return}let d=u[e].type;if("webauthn"===d)throw TypeError(`Provider id "${e}" refers to a WebAuthn provider. 412Please use \`import { signIn } from "next-auth/webauthn"\` instead.`);let h=`${c}/${"credentials"===d?"callback":"signin"}/${e}`,f=await w(),m=await fetch(`${h}?${new URLSearchParams(r)}`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({...s,csrfToken:f,callbackUrl:o})}),g=await m.json();if(a){let e=g.url??o;window.location.href=e,e.includes("#")&&window.location.reload();return}let y=new URL(g.url).searchParams.get("error")??void 0,b=new URL(g.url).searchParams.get("code")??void 0;return m.ok&&await p._getSession({event:"storage"}),{error:y,code:b,status:m.status,ok:m.ok,url:y?null:g.url}}e.s(["SessionProvider",0,function(e){if(!y)throw Error("React Context is unavailable in Server Components");let{children:t,basePath:r,refetchInterval:a,refetchWhenOffline:o}=e;r&&(p.basePath=r);let l=void 0!==e.session;p._lastSync=l?u():0;let[d,h]=i.useState(()=>(l&&(p._session=e.session),e.session)),[f,_]=i.useState(!l);i.useEffect(()=>(p._getSession=async({event:e}={})=>{try{let t="storage"===e;if(t||void 0===p._session){p._lastSync=u(),p._session=await b({broadcast:!t}),h(p._session);return}if(!e||null===p._session||u()<p._lastSync)return;p._lastSync=u(),p._session=await b(),h(p._session)}catch(e){g.error(new s(e.message,e))}finally{_(!1)}},p._getSession(),()=>{p._lastSync=0,p._session=void 0,p._getSession=()=>{}}),[]),i.useEffect(()=>{let e=()=>p._getSession({event:"storage"});return m().addEventListener("message",e),()=>m().removeEventListener("message",e)},[]),i.useEffect(()=>{let{refetchOnWindowFocus:t=!0}=e,r=()=>{t&&"visible"===document.visibilityState&&p._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",r,!1),()=>document.removeEventListener("visibilitychange",r,!1)},[e.refetchOnWindowFocus]);let v=function(){let[e,t]=i.useState("u">typeof navigator&&navigator.onLine),r=()=>t(!0),n=()=>t(!1);return i.useEffect(()=>(window.addEventListener("online",r),window.addEventListener("offline",n),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n
412)}),[]),e}(),E=!1!==o||v;i.useEffect(()=>{if(a&&E){let e=setInterval(()=>{p._session&&p._getSession({event:"poll"})},1e3*a);return()=>clearInterval(e)}},[a,E]);let k=i.useMemo(()=>({data:d,status:f?"loading":d?"authenticated":"unauthenticated",async update(e){if(f)return;_(!0);let t=await c("session",p,g,void 0===e?void 0:{body:{csrfToken:await w(),data:e}});return _(!1),t&&(h(t),m().postMessage({event:"session",data:{trigger:"getSession"}})),t}}),[d,f]);return(0,n.jsx)(y.Provider,{value:k,children:t})},"signIn",0,v],526732);let E=(0,t.getAppConfig)();e.s(["signIn",0,function(e){return v("oauth2",{callbackUrl:e})},"signInWithTgtId",0,function(e,t){let r=encodeURI(`${E.oauth2.tgtCallbackUrl}?callbackUrl=${t}`);window.location.href=`${E.oauth2.tgtUrl}?authn_method=mfa-otp-bytel&tgtId=${e}&service=${r}`}],416487)},467955,e=>{"use strict";e.s(["noop",0,function(){}])}]); 413 414//# sourceMappingURL=0t624bhd8~ab1.js.map
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.