(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8694],{919:(e,t,r)=>{let n=r(19364);function i(e,...t){for(let r of t)if(n(r))for(let[t,o]of Object.entries(r))"__proto__"!==t&&"constructor"!==t&&(n(e[t])&&n(o)?e[t]=i(e[t],o):void 0!==o&&(e[t]=o));return e}e.exports=i},2454:(e,t,r)=>{"use strict";var n=r(49509),i=r(56620);Object.defineProperty(t,"__esModule",{value:!0});var o={encode:!0,decode:!0,getToken:!0};t.decode=h,t.encode=p,t.getToken=y;var a=r(92206),s=i(r(54357)),u=r(81136),c=r(82466),l=r(88599);Object.keys(l).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(o,e))&&(e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))});let f=2592e3,d=()=>Date.now()/1e3|0;async function p(e){let{token:t={},secret:r,maxAge:n=f,salt:i=""}=e,o=await g(r,i);return await new a.EncryptJWT(t).setProtectedHeader({alg:"dir",enc:"A256GCM"}).setIssuedAt().setExpirationTime(d()+n).setJti((0,u.v4)()).encrypt(o)}async function h(e){let{token:t,secret:r,salt:n=""}=e;if(!t)return null;let i=await g(r,n),{payload:o}=await (0,a.jwtDecrypt)(t,i,{clockTolerance:15});return o}async function y(e){var t,r,i,o;let{req:a,secureCookie:s=null!=(t=null==(r=n.env.NEXTAUTH_URL)?void 0:r.startsWith("https://"))?t:!!n.env.VERCEL,cookieName:u=s?"__Secure-next-auth.session-token":"next-auth.session-token",raw:l,decode:f=h,logger:d=console,secret:p=null!=(i=n.env.NEXTAUTH_SECRET)?i:n.env.AUTH_SECRET}=e;if(!a)throw Error("Must pass `req` to JWT getToken()");let y=new c.SessionStore({name:u,options:{secure:s}},{cookies:a.cookies,headers:a.headers},d).value,g=a.headers instanceof Headers?a.headers.get("authorization"):null==(o=a.headers)?void 0:o.authorization;if(y||(null==g?void 0:g.split(" ")[0])!=="Bearer"||(y=decodeURIComponent(g.split(" ")[1])),!y)return null;if(l)return y;try{return await f({token:y,secret:p})}catch(e){return null}}async function g(e,t){return await (0,s.default)("sha256",e,t,`NextAuth.js Generated Encryption Key${t?` (${t})`:""}`,32)}},4117:(e,t,r)=>{"use strict";var n=r(49509);Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{atLeastOneTask:function(){return a},scheduleImmediate:function(){return o},scheduleOnNextTick:function(){return i},waitAtLeastOneReactRenderTask:function(){return s}});let i=e=>{Promise.resolve().then(()=>{n.nextTick(e)})},o=e=>{setImmediate(e)};function a(){return new Promise(e=>o(e))}function s(){return new Promise(e=>setImmediate(e))}},5625:(e,t,r)=>{var n="/",i=r(44134).Buffer,o=r(49509);!function(){var t={992:function(e){e.exports=function(e,r,n){if(e.filter)return e.filter(r,n);if(null==e||"function"!=typeof r)throw TypeError();for(var i=[],o=0;o-1?i(r):r}},139:function(e,t,r){"use strict";var n=r(212),i=r(192),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=s(n,a,arguments);return u&&c&&u(t,"length").configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))}),t};var f=function(){return s(n,o,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},181:function(e){"use strict";e.exports=EvalError},545:function(e){"use strict";e.exports=Error},22:function(e){"use strict";e.exports=RangeError},803:function(e){"use strict";e.exports=ReferenceError},182:function(e){"use strict";e.exports=SyntaxError},202:function(e){"use strict";e.exports=TypeError},284:function(e){"use strict";e.exports=URIError},144:function(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,i){if("[object Function]"!==r.call(n))throw TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var a=0;a1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=U(e),n=r.length>0?r[0]:"",i=N("%"+n+"%",t),o=i.name,a=i.value,s=!1,l=i.alias;l&&(n=l[0],T(r,O([0,1],l)));for(var f=1,d=!0;f=r.length){var m=p(a,h);a=(d=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[h]}else d=x(a,h),a=a[h];d&&!s&&(w[o]=a)}}return a}},14:function(e){"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return({__proto__:t}).foo===t.foo&&!(t instanceof r)}},942:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(773);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},773:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;var n=42;for(t in e[t]=n,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==n||!0!==o.enumerable)return!1}return!0}},115:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(832);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},832:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;var n=42;for(t in e[t]=n,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==n||!0!==o.enumerable)return!1}return!0}},270:function(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;e.exports=r(212).call(n,i)},782:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},157:function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(e){return(!t||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===r.call(e)},i=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r.call(e)&&"[object Function]"===r.call(e.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,e.exports=o?n:i},391:function(e){"use strict";var t=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(e){}}(),s=a?o(a):{};e.exports=function(e){return"function"==typeof e&&(!!n.test(r.call(e))||(i?o(e)===s:"[object GeneratorFunction]"===t.call(e)))}},994:function(e,t,n){"use strict";var i=n(144),o=n(349),a=n(256),s=a("Object.prototype.toString"),u=n(942)()&&"symbol"==typeof Symbol.toStringTag,c=o(),l=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1)}},369:function(e){e.exports=function(e){return e instanceof i}},584:function(e,t,r){"use strict";var n=r(157),i=r(391),o=r(490),a=r(994);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),f=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(u)var h=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===l(e)}function b(e){return"[object Set]"===l(e)}function _(e){return"[object WeakMap]"===l(e)}function v(e){return"[object WeakSet]"===l(e)}function w(e){return"[object ArrayBuffer]"===l(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(w.working?w(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===l(e)}function A(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(_.working?_(e):e instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),t.isWeakSet=function(e){return v(e)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),t.isArrayBuffer=E,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(e){return"[object SharedArrayBuffer]"===l(e)}function O(e){return void 0!==k&&(void 0===x.working&&(x.working=x(new k)),x.working?x(e):e instanceof k)}function T(e){return g(e,f)}function R(e){return g(e,d)}function P(e){return g(e,p)}function j(e){return u&&g(e,h)}function C(e){return c&&g(e,y)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=T,t.isStringObject=R,t.isBooleanObject=P,t.isBigIntObject=j,t.isSymbolObject=C,t.isBoxedPrimitive=function(e){return T(e)||R(e)||P(e)||j(e)||C(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})},177:function(e,t,r){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),v(r)?n.showHidden=r:r&&t._extend(n,r),A(n.showHidden)&&(n.showHidden=!1),A(n.depth)&&(n.depth=2),A(n.colors)&&(n.colors=!1),A(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),p(n,e,n.depth)}function l(e,t){var r=c.styles[t];return r?"\x1b["+c.colors[r][0]+"m"+e+"\x1b["+c.colors[r][1]+"m":e}function f(e,t){return e}function d(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function p(e,r,n){if(e.customInspect&&r&&R(r.inspect)&&r.inspect!==t.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o=r.inspect(n,e);return S(o)||(o=p(e,o,n)),o}var a=h(e,r);if(a)return a;var s=Object.keys(r),u=d(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return y(r);if(0===s.length){if(R(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(k(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(O(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return y(r)}var l="",f=!1,v=["{","}"];if(_(r)&&(f=!0,v=["[","]"]),R(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),k(r)&&(l=" "+RegExp.prototype.toString.call(r)),O(r)&&(l=" "+Date.prototype.toUTCString.call(r)),T(r)&&(l=" "+y(r)),0===s.length&&(!f||0==r.length))return v[0]+l+v[1];if(n<0)if(k(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");else return e.stylize("[Object]","special");return e.seen.push(r),i=f?g(e,r,n,u,s):s.map(function(t){return m(e,r,n,u,t,f)}),e.seen.pop(),b(i,l,v)}function h(e,t){if(A(t))return e.stylize("undefined","undefined");if(S(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return E(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):w(t)?e.stylize("null","null"):void 0}function y(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i){for(var o=[],a=0,s=t.length;ae.seen.indexOf(u.value)?(s=w(r)?p(e,u.value,null):p(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),A(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function b(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function _(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function w(e){return null===e}function E(e){return"number"==typeof e}function S(e){return"string"==typeof e}function A(e){return void 0===e}function k(e){return x(e)&&"[object RegExp]"===P(e)}function x(e){return"object"==typeof e&&null!==e}function O(e){return x(e)&&"[object Date]"===P(e)}function T(e){return x(e)&&("[object Error]"===P(e)||e instanceof Error)}function R(e){return"function"==typeof e}function P(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(!a[e=e.toUpperCase()])if(s.test(e)){var r=o.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(584),t.isArray=_,t.isBoolean=v,t.isNull=w,t.isNullOrUndefined=function(e){return null==e},t.isNumber=E,t.isString=S,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=A,t.isRegExp=k,t.types.isRegExp=k,t.isObject=x,t.isDate=O,t.types.isDate=O,t.isError=T,t.types.isNativeError=T,t.isFunction=R,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(369);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}function U(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",I(),t.format.apply(t,arguments))},t.inherits=r(782),t._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var N="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function M(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(N&&e[N]){var t=e[N];if("function"!=typeof t)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,N,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o{var n=r(49509);let{inspect:i}=r(5625),{RPError:o,OPError:a}=r(32608),s=r(6796);class u{#e;#t;#r;#n;#i;#o;#a;#s;#u;constructor({client:e,exchangeBody:t,clientAssertionPayload:r,response:n,maxAge:i,DPoP:a}){if(["verification_uri","user_code","device_code"].forEach(e=>{if("string"!=typeof n[e]||!n[e])throw new o(`expected ${e} string to be returned by Device Authorization Response, got %j`,n[e])}),!Number.isSafeInteger(n.expires_in))throw new o("expected expires_in number to be returned by Device Authorization Response, got %j",n.expires_in);this.#o=s()+n.expires_in,this.#t=e,this.#n=a,this.#s=i,this.#i=t,this.#r=r,this.#u=n,this.#a=1e3*n.interval||5e3}abort(){this.#e=!0}async poll({signal:e}={}){let t;if(e&&e.aborted||this.#e)throw new o("polling aborted");if(this.expired())throw new o("the device code %j has expired and the device authorization session has concluded",this.device_code);await new Promise(e=>setTimeout(e,this.#a));try{t=await this.#t.grant({...this.#i,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:this.device_code},{clientAssertionPayload:this.#r,DPoP:this.#n})}catch(t){switch(t instanceof a&&t.error){case"slow_down":this.#a+=5e3;case"authorization_pending":return this.poll({signal:e});default:throw t}}return"id_token"in t&&(await this.#t.decryptIdToken(t),await this.#t.validateIdToken(t,void 0,"token",this.#s)),t}get device_code(){return this.#u.device_code}get user_code(){return this.#u.user_code}get verification_uri(){return this.#u.verification_uri}get verification_uri_complete(){return this.#u.verification_uri_complete}get expires_in(){return Math.max.apply(null,[this.#o-s(),0])}expired(){return 0===this.expires_in}[i.custom](){return`${this.constructor.name} ${i(this.#u,{depth:1/0,colors:n.stdout.isTTY,compact:!1,sorted:!0})}`}}e.exports=u},6004:(e,t,r)=>{"use strict";function n(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}r.d(t,{_:()=>n})},6030:(e,t,r)=>{let n;var i=r(44134).Buffer;let o=r(76733),a=r(19110),s=r(36088),u=r(79189),{once:c}=r(19087),{URL:l}=r(75356),f=r(71383),d=r(52962),{RPError:p}=r(32608),h=r(58548),{deep:y}=r(58107),{HTTP_OPTIONS:g}=r(92833),m=/^[\x21\x23-\x5B\x5D-\x7E]+$/,b=["agent","ca","cert","crl","headers","key","lookup","passphrase","pfx","timeout"],_=(e,t)=>{n=y({},e.length?h(t,...e):t,n)};function v(e,t,r){r&&(e.removeHeader("content-type"),e.setHeader("content-type",r)),t&&(e.removeHeader("content-length"),e.setHeader("content-length",i.byteLength(t)),e.write(t)),e.end()}_([],{headers:{"User-Agent":`${d.name}/${d.version} (${d.homepage})`,"Accept-Encoding":"identity"},timeout:3500});let w=new f({max:100});e.exports=async function(e,{accessToken:t,mTLS:r=!1,DPoP:f}={}){let d,_,E,S,A,k,x;try{d=new l(e.url),delete e.url,o(/^(https?:)$/.test(d.protocol))}catch(e){throw TypeError("only valid absolute URLs can be requested")}let O=this[g],T=e,R=`${d.origin}${d.pathname}`;if(f&&"dpopProof"in this&&(T.headers=T.headers||{},T.headers.DPoP=await this.dpopProof({htu:`${d.origin}${d.pathname}`,htm:e.method||"GET",nonce:w.get(R)},f,t)),O&&(_=h(O.call(this,d,y({},T,n)),...b)),T=y({},_,T,n),r&&!T.pfx&&!(T.key&&T.cert))throw TypeError("mutual-TLS certificate and key not set");if(T.searchParams)for(let[e,t]of Object.entries(T.searchParams))d.searchParams.delete(e),d.searchParams.set(e,t);for(let[e,t]of({form:S,responseType:E,json:A,body:k,...T}=T,Object.entries(T.headers||{})))void 0===t&&delete T.headers[e];let P=("https:"===d.protocol?u.request:s.request)(d.href,T);return(async()=>{if(A?v(P,JSON.stringify(A),"application/json"):S?v(P,a.stringify(S),"application/x-www-form-urlencoded"):k?v(P,k):v(P),[x]=await Promise.race([c(P,"response"),c(P,"timeout")]),!x)throw P.destroy(),new p(`outgoing request timed out after ${T.timeout}ms`);let e=[];for await(let t of x)e.push(t);if(e.length)switch(E){case"json":Object.defineProperty(x,"body",{get(){let t=i.concat(e);try{t=JSON.parse(t)}catch(e){throw Object.defineProperty(e,"response",{value:x}),e}finally{Object.defineProperty(x,"body",{value:t,configurable:!0})}return t},configurable:!0});break;case void 0:case"buffer":Object.defineProperty(x,"body",{get(){let t=i.concat(e);return Object.defineProperty(x,"body",{value:t,configurable:!0}),t},configurable:!0});break;default:throw TypeError("unsupported responseType request option")}return x})().catch(e=>{throw x&&Object.defineProperty(e,"response",{value:x}),e}).finally(()=>{let e=x&&x.headers["dpop-nonce"];e&&m.test(e)&&w.set(R,e)})},e.exports.setDefaults=_.bind(void 0,b)},6796:e=>{e.exports=()=>Math.floor(Date.now()/1e3)},7610:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,d=5960464477539062e-23*(23===i),p=n?0:o-1,h=n?1:-1,y=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+f>=1?t+=d/u:t+=d*Math.pow(2,1-f),t*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(a=a<0;e[r+p]=255&a,p+=h,a/=256,c-=8);e[r+p-h]|=128*y}},8303:(e,t,r)=>{"use strict";var n=r(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=n(r(32443)),o=n(r(34895)),a=n(r(34528)),s=n(r(19924)),u=n(r(37045)),c=n(r(45008));function l(e){let{url:t,theme:r,query:n,cookies:l}=e;function f({html:e,title:t,status:n}){var o;return{cookies:l,status:n,headers:[{key:"Content-Type",value:"text/html"}],body:`${t}
${(0,i.default)(e)}
`}}return{signin:t=>f({html:(0,o.default)({csrfToken:e.csrfToken,providers:e.providers,callbackUrl:e.callbackUrl,theme:r,...n,...t}),title:"Sign In"}),signout:n=>f({html:(0,a.default)({csrfToken:e.csrfToken,url:t,theme:r,...n}),title:"Sign Out"}),verifyRequest:e=>f({html:(0,s.default)({url:t,theme:r,...e}),title:"Verify Request"}),error:e=>f({...(0,u.default)({url:t,theme:r,...e}),title:"Error"})}}},8816:e=>{e.exports.keystores=new WeakMap},9597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getDraftModeProviderForCacheScope:function(){return l},getExpectedRequestStore:function(){return o},getHmrRefreshHash:function(){return c},getPrerenderResumeDataCache:function(){return s},getRenderResumeDataCache:function(){return u},throwForMissingRequestStore:function(){return a},workUnitAsyncStorage:function(){return n.workUnitAsyncStorageInstance}});let n=r(74931),i=r(27988);function o(e){let t=n.workUnitAsyncStorageInstance.getStore();switch(!t&&a(e),t.type){case"request":default:return t;case"prerender":case"prerender-ppr":case"prerender-legacy":throw Object.defineProperty(Error(`\`${e}\` cannot be called inside a prerender. This is a bug in Next.js.`),"__NEXT_ERROR_CODE",{value:"E401",enumerable:!1,configurable:!0});case"cache":throw Object.defineProperty(Error(`\`${e}\` cannot be called inside "use cache". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E37",enumerable:!1,configurable:!0});case"unstable-cache":throw Object.defineProperty(Error(`\`${e}\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E69",enumerable:!1,configurable:!0})}}function a(e){throw Object.defineProperty(Error(`\`${e}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E251",enumerable:!1,configurable:!0})}function s(e){return"prerender"===e.type||"prerender-ppr"===e.type?e.prerenderResumeDataCache:null}function u(e){return"prerender-legacy"!==e.type&&"cache"!==e.type&&"unstable-cache"!==e.type?"request"===e.type?e.renderResumeDataCache:e.prerenderResumeDataCache:null}function c(e,t){var r;if(e.dev)return"cache"===t.type||"prerender"===t.type?t.hmrRefreshHash:"request"===t.type?null==(r=t.cookies.get(i.NEXT_HMR_REFRESH_HASH_COOKIE))?void 0:r.value:void 0}function l(e,t){if(e.isDraftMode)switch(t.type){case"cache":case"unstable-cache":case"request":return t.draftMode}}},9985:e=>{e.exports.isAnEarlyCloseHost=function(e){return e&&e.match(".*google(apis)?.com$")}},10064:(e,t,r)=>{"use strict";var n;n={value:!0},Object.defineProperty(t,"b",{enumerable:!0,get:function(){return d}});let i=r(76688),o=r(85744),a=r(9597),s=r(87101),u=r(11881),c=r(44536),l=r(35260),f=(r(4117),r(65867));function d(){let e=o.workAsyncStorage.getStore(),t=a.workUnitAsyncStorage.getStore();if(e){if(t&&"after"===t.phase&&!(0,f.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${e.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:"E367",enumerable:!1,configurable:!0});if(e.forceStatic)return y(i.HeadersAdapter.seal(new Headers({})));if(t){if("cache"===t.type)throw Object.defineProperty(Error(`Route ${e.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:"E304",enumerable:!1,configurable:!0});else if("unstable-cache"===t.type)throw Object.defineProperty(Error(`Route ${e.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:"E127",enumerable:!1,configurable:!0})}if(e.dynamicShouldError)throw Object.defineProperty(new u.StaticGenBailoutError(`Route ${e.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:"E525",enumerable:!1,configurable:!0});if(t)if("prerender"===t.type)return h(e.route,t);else"prerender-ppr"===t.type?(0,s.postponeWithTracking)(e.route,"headers",t.dynamicTracking):"prerender-legacy"===t.type&&(0,s.throwToInterruptStaticGeneration)("headers",e,t);(0,s.trackDynamicDataInDynamicRender)(e,t)}return y((0,a.getExpectedRequestStore)("headers").headers)}let p=new WeakMap;function h(e,t){let r=p.get(t);if(r)return r;let n=(0,c.makeHangingPromise)(t.renderSignal,"`headers()`");return p.set(t,n),Object.defineProperties(n,{append:{value:function(){let r=`\`headers().append(${g(arguments[0])}, ...)\``,n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},delete:{value:function(){let r=`\`headers().delete(${g(arguments[0])})\``,n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},get:{value:function(){let r=`\`headers().get(${g(arguments[0])})\``,n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},has:{value:function(){let r=`\`headers().has(${g(arguments[0])})\``,n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},set:{value:function(){let r=`\`headers().set(${g(arguments[0])}, ...)\``,n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},getSetCookie:{value:function(){let r="`headers().getSetCookie()`",n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},forEach:{value:function(){let r="`headers().forEach(...)`",n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},keys:{value:function(){let r="`headers().keys()`",n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},values:{value:function(){let r="`headers().values()`",n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},entries:{value:function(){let r="`headers().entries()`",n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},[Symbol.iterator]:{value:function(){let r="`headers()[Symbol.iterator]()`",n=b(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}}}),n}function y(e){let t=p.get(e);if(t)return t;let r=Promise.resolve(e);return p.set(e,r),Object.defineProperties(r,{append:{value:e.append.bind(e)},delete:{value:e.delete.bind(e)},get:{value:e.get.bind(e)},has:{value:e.has.bind(e)},set:{value:e.set.bind(e)},getSetCookie:{value:e.getSetCookie.bind(e)},forEach:{value:e.forEach.bind(e)},keys:{value:e.keys.bind(e)},values:{value:e.values.bind(e)},entries:{value:e.entries.bind(e)},[Symbol.iterator]:{value:e[Symbol.iterator].bind(e)}}),r}function g(e){return"string"==typeof e?`'${e}'`:"..."}let m=(0,l.createDedupedByCallsiteServerErrorLoggerDev)(b);function b(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`headers()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E277",enumerable:!1,configurable:!0})}},10894:(e,t,r)=>{let n;var i=r(44134).Buffer;let{strict:o}=r(76733),{createHash:a}=r(8777),{format:s}=r(5625),u=r(23689);if(i.isEncoding("base64url"))n=e=>e.toString("base64url");else{let e=e=>e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");n=t=>e(t.toString("base64"))}function c(e,t){switch(e){case"HS256":case"RS256":case"PS256":case"ES256":case"ES256K":return a("sha256");case"HS384":case"RS384":case"PS384":case"ES384":return a("sha384");case"HS512":case"RS512":case"PS512":case"ES512":case"Ed25519":return a("sha512");case"Ed448":if(!u)throw TypeError("Ed448 *_hash calculation is not supported in your Node.js runtime version");return a("shake256",{outputLength:114});case"EdDSA":switch(t){case"Ed25519":return a("sha512");case"Ed448":if(!u)throw TypeError("Ed448 *_hash calculation is not supported in your Node.js runtime version");return a("shake256",{outputLength:114});default:throw TypeError("unrecognized or invalid EdDSA curve provided")}default:throw TypeError("unrecognized or invalid JWS algorithm provided")}}function l(e,t,r){let i=c(t,r).update(e).digest();return n(i.slice(0,i.length/2))}e.exports={validate:function(e,t,r,n,i){let a,u;if("string"!=typeof e.claim||!e.claim)throw TypeError("names.claim must be a non-empty string");if("string"!=typeof e.source||!e.source)throw TypeError("names.source must be a non-empty string");o("string"==typeof t&&t,`${e.claim} must be a non-empty string`),o("string"==typeof r&&r,`${e.source} must be a non-empty string`);try{a=l(r,n,i)}catch(t){u=s("%s could not be validated (%s)",e.claim,t.message)}u=u||s("%s mismatch, expected %s, got: %s",e.claim,a,t),o.equal(a,t,u)},generate:l}},11881:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{StaticGenBailoutError:function(){return n},isStaticGenBailoutError:function(){return i}});let r="NEXT_STATIC_GEN_BAILOUT";class n extends Error{constructor(...e){super(...e),this.code=r}}function i(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},14740:(e,t,r)=>{var n=r(44134).Buffer,i=r(19110),o=(r(8777),r(79189)),a=r(36088),s=r(75356),u=r(9985);t.OAuth2=function(e,t,r,n,i,o){this._clientId=e,this._clientSecret=t,this._baseSite=r,this._authorizeUrl=n||"/oauth/authorize",this._accessTokenUrl=i||"/oauth/access_token",this._accessTokenName="access_token",this._authMethod="Bearer",this._customHeaders=o||{},this._useAuthorizationHeaderForGET=!1,this._agent=void 0},t.OAuth2.prototype.setAgent=function(e){this._agent=e},t.OAuth2.prototype.setAccessTokenName=function(e){this._accessTokenName=e},t.OAuth2.prototype.setAuthMethod=function(e){this._authMethod=e},t.OAuth2.prototype.useAuthorizationHeaderforGET=function(e){this._useAuthorizationHeaderForGET=e},t.OAuth2.prototype._getAccessTokenUrl=function(){return this._baseSite+this._accessTokenUrl},t.OAuth2.prototype.buildAuthHeader=function(e){return this._authMethod+" "+e},t.OAuth2.prototype._chooseHttpLibrary=function(e){var t=o;return"https:"!=e.protocol&&(t=a),t},t.OAuth2.prototype._request=function(e,t,r,o,a,u){var c=s.parse(t,!0);"https:"!=c.protocol||c.port||(c.port=443);var l=this._chooseHttpLibrary(c),f={};for(var d in this._customHeaders)f[d]=this._customHeaders[d];if(r)for(var d in r)f[d]=r[d];f.Host=c.host,f["User-Agent"]||(f["User-Agent"]="Node-oauth"),o?n.isBuffer(o)?f["Content-Length"]=o.length:f["Content-Length"]=n.byteLength(o):f["Content-length"]=0,!a||"Authorization"in f||(c.query||(c.query={}),c.query[this._accessTokenName]=a);var p=i.stringify(c.query);p&&(p="?"+p);var h={host:c.hostname,port:c.port,path:c.pathname+p,method:e,headers:f};this._executeRequest(l,h,o,u)},t.OAuth2.prototype._executeRequest=function(e,t,r,n){var i=u.isAnEarlyCloseHost(t.host),o=!1;function a(e,t){o||(o=!0,e.statusCode>=200&&e.statusCode<=299||301==e.statusCode||302==e.statusCode?n(null,t,e):n({statusCode:e.statusCode,data:t}))}var s="";this._agent&&(t.agent=this._agent);var c=e.request(t);c.on("response",function(e){e.on("data",function(e){s+=e}),e.on("close",function(t){i&&a(e,s)}),e.addListener("end",function(){a(e,s)})}),c.on("error",function(e){o=!0,n(e)}),("POST"==t.method||"PUT"==t.method)&&r&&c.write(r),c.end()},t.OAuth2.prototype.getAuthorizeUrl=function(e){var e=e||{};return e.client_id=this._clientId,this._baseSite+this._authorizeUrl+"?"+i.stringify(e)},t.OAuth2.prototype.getOAuthAccessToken=function(e,t,r){var t=t||{};t.client_id=this._clientId,t.client_secret=this._clientSecret;var n="refresh_token"===t.grant_type?"refresh_token":"code";t[n]=e;var o=i.stringify(t),a={"Content-Type":"application/x-www-form-urlencoded"};this._request("POST",this._getAccessTokenUrl(),a,o,null,function(e,t,n){if(e)r(e);else{try{o=JSON.parse(t)}catch(e){o=i.parse(t)}var o,a=o.access_token,s=o.refresh_token;delete o.refresh_token,r(null,a,s,o)}})},t.OAuth2.prototype.getProtectedResource=function(e,t,r){this._request("GET",e,{},"",t,r)},t.OAuth2.prototype.get=function(e,t,r){if(this._useAuthorizationHeaderForGET){var n={Authorization:this.buildAuthHeader(t)};t=null}else n={};this._request("GET",e,n,"",t,r)}},16397:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{MutableRequestCookiesAdapter:function(){return d},ReadonlyRequestCookiesError:function(){return s},RequestCookiesAdapter:function(){return u},appendMutableCookies:function(){return f},areCookiesMutableInCurrentPhase:function(){return h},getModifiedCookieValues:function(){return l},responseCookiesToRequestCookies:function(){return g},wrapWithMutableAccessCheck:function(){return p}});let n=r(22116),i=r(93107),o=r(85744),a=r(9597);class s extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new s}}class u{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return s.callable;default:return i.ReflectAdapter.get(e,t,r)}}})}}let c=Symbol.for("next.mutated.cookies");function l(e){let t=e[c];return t&&Array.isArray(t)&&0!==t.length?t:[]}function f(e,t){let r=l(t);if(0===r.length)return!1;let i=new n.ResponseCookies(e),o=i.getAll();for(let e of r)i.set(e);for(let e of o)i.set(e);return!0}class d{static wrap(e,t){let r=new n.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let a=[],s=new Set,u=()=>{let e=o.workAsyncStorage.getStore();if(e&&(e.pathWasRevalidated=!0),a=r.getAll().filter(e=>s.has(e.name)),t){let e=[];for(let t of a){let r=new n.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}},l=new Proxy(r,{get(e,t,r){switch(t){case c:return a;case"delete":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.delete(...t),l}finally{u()}};case"set":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t),l}finally{u()}};default:return i.ReflectAdapter.get(e,t,r)}}});return l}}function p(e){let t=new Proxy(e,{get(e,r,n){switch(r){case"delete":return function(...r){return y("cookies().delete"),e.delete(...r),t};case"set":return function(...r){return y("cookies().set"),e.set(...r),t};default:return i.ReflectAdapter.get(e,r,n)}}});return t}function h(e){return"action"===e.phase}function y(e){if(!h((0,a.getExpectedRequestStore)(e)))throw new s}function g(e){let t=new n.RequestCookies(new Headers);for(let r of e.getAll())t.set(r);return t}},16664:(e,t,r)=>{"use strict";let n;var i=r(49509),o=r(44134).Buffer;Object.defineProperty(t,"__esModule",{value:!0});let a=r(82967),s=r(34896),u=r(70405),{inspect:c}=r(5625),l=r(36088),f=r(8777),{strict:d}=r(76733),p=r(19110),h=r(75356),{URL:y,URLSearchParams:g}=r(75356),m=r(92206),b=r(10894),_=r(89417),v=r(17313),w=r(46755),E=r(58107),S=r(88070),{assertSigningAlgValuesSupport:A,assertIssuerConfiguration:k}=r(99403),x=r(58548),O=r(19364),T=r(67604),R=r(61599),{OPError:P,RPError:j}=r(32608),C=r(6796),{random:I}=r(90735),U=r(6030),{CLOCK_TOLERANCE:N}=r(92833),{keystores:M}=r(8816),D=r(38741),H=r(18877),{authenticatedPost:L,resolveResponseType:B,resolveRedirectUri:$}=r(24382),{queryKeyStore:W}=r(69834),F=r(5669),[q,K]=i.version.slice(1).split(".").map(e=>parseInt(e,10)),J=q>=17||16===q&&K>=9,z=Symbol(),G=Symbol(),V=Symbol();function Z(e){return x(e,"access_token","code","error_description","error_uri","error","expires_in","id_token","iss","response","session_state","state","token_type")}function X(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Bearer";return"".concat(t," ").concat(e)}function Y(e){let t=h.parse(e);return t.search?p.parse(t.search.substring(1)):{}}function Q(e,t,r){if(void 0===e[r])throw new j({message:"missing required JWT property ".concat(r),jwt:t})}function ee(e){let t={client_id:this.client_id,scope:"openid",response_type:B.call(this),redirect_uri:$.call(this),...e};return Object.entries(t).forEach(e=>{let[r,n]=e;null==n?delete t[r]:"claims"===r&&"object"==typeof n?t[r]=JSON.stringify(n):"resource"===r&&Array.isArray(n)?t[r]=n:"string"!=typeof n&&(t[r]=String(n))}),t}function et(e){if(!O(e)||!Array.isArray(e.keys)||e.keys.some(e=>!O(e)||!("kty"in e)))throw TypeError("jwks must be a JSON Web Key Set formatted object");return D.fromJWKS(e,{onlyPrivate:!0})}function er(e,t){try{let r=e.issuer.token_endpoint_auth_methods_supported;!r.includes(t.token_endpoint_auth_method)&&r.includes("client_secret_post")&&(t.token_endpoint_auth_method="client_secret_post")}catch(e){}}function en(e,t,r){if(t.token_endpoint_auth_method||er(e,r),t.redirect_uri){if(t.redirect_uris)throw TypeError("provide a redirect_uri or redirect_uris, not both");r.redirect_uris=[t.redirect_uri],delete r.redirect_uri}if(t.response_type){if(t.response_types)throw TypeError("provide a response_type or response_types, not both");r.response_types=[t.response_type],delete r.response_type}}function ei(e,t,r){if(!t["".concat(e,"_endpoint")])return;let n=r.token_endpoint_auth_method,i=r.token_endpoint_auth_signing_alg,o="".concat(e,"_endpoint_auth_method"),a="".concat(e,"_endpoint_auth_signing_alg");void 0===r[o]&&void 0===r[a]&&(void 0!==n&&(r[o]=n),void 0!==i&&(r[a]=i))}var eo=new WeakMap,ea=new WeakMap,es=new WeakMap,eu=new WeakMap;let ec=c.custom;class el{authorizationUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!O(e))throw TypeError("params must be a plain object");k(this.issuer,"authorization_endpoint");let t=new y(this.issuer.authorization_endpoint);for(let[r,n]of Object.entries(ee.call(this,e)))if(Array.isArray(n))for(let e of(t.searchParams.delete(r),n))t.searchParams.append(r,e);else t.searchParams.set(r,n);return t.href.replace(/\+/g,"%20")}authorizationPost(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!O(e))throw TypeError("params must be a plain object");let t=ee.call(this,e),r=Object.keys(t).map(e=>'')).join("\n");return'\n\nRequesting Authorization\n\n\n
\n ').concat(r,"\n
\n\n")}endSessionUrl(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k(this.issuer,"end_session_endpoint");let{0:r,length:n}=this.post_logout_redirect_uris||[],{post_logout_redirect_uri:i=1===n?r:void 0}=t;if({id_token_hint:e,...t}=t,e instanceof R){if(!e.id_token)throw TypeError("id_token not present in TokenSet");e=e.id_token}let o=h.parse(this.issuer.end_session_endpoint),a=E(Y(this.issuer.end_session_endpoint),t,{post_logout_redirect_uri:i,client_id:this.client_id},{id_token_hint:e});return Object.entries(a).forEach(e=>{let[t,r]=e;null==r&&delete a[t]}),o.search=null,o.query=a,h.format(o)}callbackParams(e){let t=e instanceof l.IncomingMessage||e&&e.method&&e.url;if("string"!=typeof e&&!t)throw TypeError("#callbackParams only accepts string urls, http.IncomingMessage or a lookalike");if(!t)return Z(Y(e));switch(e.method){case"GET":return Z(Y(e.url));case"POST":if(void 0===e.body)throw TypeError("incoming message body missing, include a body parser prior to this method call");switch(typeof e.body){case"object":case"string":if(o.isBuffer(e.body))return Z(p.parse(e.body.toString("utf-8")));if("string"==typeof e.body)return Z(p.parse(e.body));return Z(e.body);default:throw TypeError("invalid IncomingMessage body object")}default:throw TypeError("invalid IncomingMessage method")}}async callback(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{exchangeBody:n,clientAssertionPayload:i,DPoP:o}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=Z(t);if(!r.jarm||"response"in t){if("response"in t){let e=await this.decryptJARM(a.response);a=await this.validateJARM(e)}}else throw new j({message:"expected a JARM response",checks:r,params:a});if(this.default_max_age&&!r.max_age&&(r.max_age=this.default_max_age),a.state&&!r.state)throw TypeError("checks.state argument is missing");if(!a.state&&r.state)throw new j({message:"state missing from the response",checks:r,params:a});if(r.state!==a.state)throw new j({printf:["state mismatch, expected %s, got: %s",r.state,a.state],checks:r,params:a});if("iss"in a){if(k(this.issuer,"issuer"),a.iss!==this.issuer.issuer)throw new j({printf:["iss mismatch, expected %s, got: %s",this.issuer.issuer,a.iss],params:a})}else if(this.issuer.authorization_response_iss_parameter_supported&&!("id_token"in a)&&!("response"in t))throw new j({message:"iss missing from the response",params:a});if(a.error)throw new P(a);let s={code:["code"],id_token:["id_token"],token:["access_token","token_type"]};if(r.response_type){for(let e of r.response_type.split(" "))if("none"===e){if(a.code||a.id_token||a.access_token)throw new j({message:'unexpected params encountered for "none" response',checks:r,params:a})}else for(let t of s[e])if(!a[t])throw new j({message:"".concat(t," missing from response"),checks:r,params:a})}if(a.id_token){let e=new R(a);if(await this.decryptIdToken(e),await this.validateIdToken(e,r.nonce,"authorization",r.max_age,r.state),!a.code)return e}if(a.code){let t=await this.grant({...n,grant_type:"authorization_code",code:a.code,redirect_uri:e,code_verifier:r.code_verifier},{clientAssertionPayload:i,DPoP:o});return await this.decryptIdToken(t),await this.validateIdToken(t,r.nonce,"token",r.max_age),a.session_state&&(t.session_state=a.session_state),t}return new R(a)}async oauthCallback(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{exchangeBody:n,clientAssertionPayload:i,DPoP:o}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=Z(t);if(!r.jarm||"response"in t){if("response"in t){let e=await this.decryptJARM(a.response);a=await this.validateJARM(e)}}else throw new j({message:"expected a JARM response",checks:r,params:a});if(a.state&&!r.state)throw TypeError("checks.state argument is missing");if(!a.state&&r.state)throw new j({message:"state missing from the response",checks:r,params:a});if(r.state!==a.state)throw new j({printf:["state mismatch, expected %s, got: %s",r.state,a.state],checks:r,params:a});if("iss"in a){if(k(this.issuer,"issuer"),a.iss!==this.issuer.issuer)throw new j({printf:["iss mismatch, expected %s, got: %s",this.issuer.issuer,a.iss],params:a})}else if(this.issuer.authorization_response_iss_parameter_supported&&!("id_token"in a)&&!("response"in t))throw new j({message:"iss missing from the response",params:a});if(a.error)throw new P(a);if("string"==typeof a.id_token&&a.id_token.length)throw new j({message:"id_token detected in the response, you must use client.callback() instead of client.oauthCallback()",params:a});delete a.id_token;let s={code:["code"],token:["access_token","token_type"]};if(r.response_type)for(let e of r.response_type.split(" ")){if("none"===e&&(a.code||a.id_token||a.access_token))throw new j({message:'unexpected params encountered for "none" response',checks:r,params:a});if(s[e]){for(let t of s[e])if(!a[t])throw new j({message:"".concat(t," missing from response"),checks:r,params:a})}}if(a.code){let t=await this.grant({...n,grant_type:"authorization_code",code:a.code,redirect_uri:e,code_verifier:r.code_verifier},{clientAssertionPayload:i,DPoP:o});if("string"==typeof t.id_token&&t.id_token.length)throw new j({message:"id_token detected in the response, you must use client.callback() instead of client.oauthCallback()",params:a});return delete t.id_token,t}return new R(a)}async decryptIdToken(e){if(!this.id_token_encrypted_response_alg)return e;let t=e;if(t instanceof R){if(!t.id_token)throw TypeError("id_token not present in TokenSet");t=t.id_token}let r=this.id_token_encrypted_response_alg,n=this.id_token_encrypted_response_enc,i=await this.decryptJWE(t,r,n);return e instanceof R?(e.id_token=i,e):i}async validateJWTUserinfo(e){let t=this.userinfo_signed_response_alg;return this.validateJWT(e,t,[])}async decryptJARM(e){if(!this.authorization_encrypted_response_alg)return e;let t=this.authorization_encrypted_response_alg,r=this.authorization_encrypted_response_enc;return this.decryptJWE(e,t,r)}async decryptJWTUserinfo(e){if(!this.userinfo_encrypted_response_alg)return e;let t=this.userinfo_encrypted_response_alg,r=this.userinfo_encrypted_response_enc;return this.decryptJWE(e,t,r)}async decryptJWE(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"A128CBC-HS256",i=JSON.parse(w.decode(e.split(".")[0]));if(i.alg!==t)throw new j({printf:["unexpected JWE alg received, expected %s, got: %s",t,i.alg],jwt:e});if(i.enc!==n)throw new j({printf:["unexpected JWE enc received, expected %s, got: %s",n,i.enc],jwt:e});let o=e=>new TextDecoder().decode(e.plaintext);if(t.match(/^(?:RSA|ECDH)/)){let t=await M.get(this),n=m.decodeProtectedHeader(e);for(let i of t.all({...n,use:"enc"}))if(r=await m.compactDecrypt(e,await i.keyObject(n.alg)).then(o,()=>{}))break}else r=await m.compactDecrypt(e,this.secretForAlg("dir"===t?n:t)).then(o,()=>{});if(!r)throw new j({message:"failed to decrypt JWE",jwt:e});return r}async validateIdToken(e,t,r,n,i){let o=e,a=this.id_token_signed_response_alg;if(o instanceof R){if(!o.id_token)throw TypeError("id_token not present in TokenSet");o=o.id_token}o=String(o);let s=C(),{protected:u,payload:c,key:l}=await this.validateJWT(o,a);if("number"==typeof n||n!==V&&this.require_auth_time){if(!c.auth_time)throw new j({message:"missing required JWT property auth_time",jwt:o});if("number"!=typeof c.auth_time)throw new j({message:"JWT auth_time claim must be a JSON numeric value",jwt:o})}if("number"==typeof n&&c.auth_time+n2&&void 0!==arguments[2]?arguments[2]:["iss","sub","aud","exp","iat"],s="https://self-issued.me"===this.issuer.issuer,u=C();try{({header:r,payload:n}=v(e,{complete:!0}))}catch(t){throw new j({printf:["failed to decode JWT (%s: %s)",t.name,t.message],jwt:e})}if(r.alg!==t)throw new j({printf:["unexpected JWT alg received, expected %s, got: %s",t,r.alg],jwt:e});if(s&&(o=[...o,"sub_jwk"]),o.forEach(Q.bind(void 0,n,e)),void 0!==n.iss){let t=this.issuer.issuer;if(a._(this,es)&&(t=this.issuer.issuer.replace("{tenantid}",n.tid)),n.iss!==t)throw new j({printf:["unexpected iss value, expected %s, got: %s",t,n.iss],jwt:e})}if(void 0!==n.iat&&"number"!=typeof n.iat)throw new j({message:"JWT iat claim must be a JSON numeric value",jwt:e});if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new j({message:"JWT nbf claim must be a JSON numeric value",jwt:e});if(n.nbf>u+this[N])throw new j({printf:["JWT not active yet, now %i, nbf %i",u+this[N],n.nbf],now:u,tolerance:this[N],nbf:n.nbf,jwt:e})}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new j({message:"JWT exp claim must be a JSON numeric value",jwt:e});if(u-this[N]>=n.exp)throw new j({printf:["JWT expired, now %i, exp %i",u-this[N],n.exp],now:u,tolerance:this[N],exp:n.exp,jwt:e})}if(void 0!==n.aud){if(Array.isArray(n.aud)){if(n.aud.length>1&&!n.azp)throw new j({message:"missing required JWT property azp",jwt:e});if(!n.aud.includes(this.client_id))throw new j({printf:["aud is missing the client_id, expected %s to be included in %j",this.client_id,n.aud],jwt:e})}else if(n.aud!==this.client_id)throw new j({printf:["aud mismatch, expected %s, got: %s",this.client_id,n.aud],jwt:e})}if(void 0!==n.azp){let t=a._(this,eu);if(!(t="string"==typeof t?[this.client_id,t]:Array.isArray(t)?[this.client_id,...t]:[this.client_id]).includes(n.azp))throw new j({printf:["azp mismatch, got: %s",n.azp],jwt:e})}if(s){try{d(O(n.sub_jwk));let e=await m.importJWK(n.sub_jwk,r.alg);d.equal(e.type,"public"),i=[{keyObject:()=>e}]}catch(t){throw new j({message:"failed to use sub_jwk claim as an asymmetric JSON Web Key",jwt:e})}if(await m.calculateJwkThumbprint(n.sub_jwk)!==n.sub)throw new j({message:"failed to match the subject with sub_jwk",jwt:e})}else r.alg.startsWith("HS")?i=[this.secretForAlg(r.alg)]:"none"!==r.alg&&(i=await W.call(this.issuer,{...r,use:"sig"}));if(!i&&"none"===r.alg)return{protected:r,payload:n};for(let t of i){let i=await m.compactVerify(e,t instanceof Uint8Array?t:await t.keyObject(r.alg)).catch(()=>{});if(i)return{payload:n,protected:i.protectedHeader,key:t}}throw new j({message:"failed to validate JWT signature",jwt:e})}async refresh(e){let{exchangeBody:t,clientAssertionPayload:r,DPoP:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e;if(i instanceof R){if(!i.refresh_token)throw TypeError("refresh_token not present in TokenSet");i=i.refresh_token}let o=await this.grant({...t,grant_type:"refresh_token",refresh_token:String(i)},{clientAssertionPayload:r,DPoP:n});if(o.id_token&&(await this.decryptIdToken(o),await this.validateIdToken(o,G,"token",V),e instanceof R&&e.id_token)){let t=e.claims().sub,r=o.claims().sub;if(r!==t)throw new j({printf:["sub mismatch, expected %s, got: %s",t,r],jwt:o.id_token})}return o}async requestResource(e,t){let{method:r,headers:n,body:i,DPoP:o,tokenType:a=o?"DPoP":t instanceof R?t.token_type:"Bearer"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(t instanceof R){if(!t.access_token)throw TypeError("access_token not present in TokenSet");t=t.access_token}if(t){if("string"!=typeof t)throw TypeError("invalid access token provided")}else throw TypeError("no access token provided");let u={headers:{Authorization:X(t,a),...n},body:i},c=!!this.tls_client_certificate_bound_access_tokens,l=await U.call(this,{...u,responseType:"buffer",method:r,url:e},{accessToken:t,mTLS:c,DPoP:o}),f=l.headers["www-authenticate"];return s!==z&&f&&f.toLowerCase().startsWith("dpop ")&&"use_dpop_nonce"===S(f).error?this.requestResource(e,t,{method:r,headers:n,body:i,DPoP:o,tokenType:a}):l}async userinfo(e){let t,{method:r="GET",via:n="header",tokenType:i,params:o,DPoP:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k(this.issuer,"userinfo_endpoint");let s={tokenType:i,method:String(r).toUpperCase(),DPoP:a};if("GET"!==s.method&&"POST"!==s.method)throw TypeError("#userinfo() method can only be POST or a GET");if("body"===n&&"POST"!==s.method)throw TypeError("can only send body on POST");let u=!!(this.userinfo_signed_response_alg||this.userinfo_encrypted_response_alg);u?s.headers={Accept:"application/jwt"}:s.headers={Accept:"application/json"},this.tls_client_certificate_bound_access_tokens&&this.issuer.mtls_endpoint_aliases&&(t=this.issuer.mtls_endpoint_aliases.userinfo_endpoint),t=new y(t||this.issuer.userinfo_endpoint),"body"===n&&(s.headers.Authorization=void 0,s.headers["Content-Type"]="application/x-www-form-urlencoded",s.body=new g,s.body.append("access_token",e instanceof R?e.access_token:e)),o&&("GET"===s.method?Object.entries(o).forEach(e=>{let[r,n]=e;t.searchParams.append(r,n)}):s.body?Object.entries(o).forEach(e=>{let[t,r]=e;s.body.append(t,r)}):(s.body=new g,s.headers["Content-Type"]="application/x-www-form-urlencoded",Object.entries(o).forEach(e=>{let[t,r]=e;s.body.append(t,r)}))),s.body&&(s.body=s.body.toString());let c=await this.requestResource(t,e,s),l=T(c,{bearer:!0});if(u){if(!/^application\/jwt/.test(c.headers["content-type"]))throw new j({message:"expected application/jwt response from the userinfo_endpoint",response:c});let e=c.body.toString(),t=await this.decryptJWTUserinfo(e);if(this.userinfo_signed_response_alg)({payload:l}=await this.validateJWTUserinfo(t));else try{l=JSON.parse(t),d(O(l))}catch(e){throw new j({message:"failed to parse userinfo JWE payload as JSON",jwt:t})}}else try{l=JSON.parse(c.body)}catch(e){throw Object.defineProperty(e,"response",{value:c}),e}if(e instanceof R&&e.id_token){let t=e.claims().sub;if(l.sub!==t)throw new j({printf:["userinfo sub mismatch, expected %s, got: %s",t,l.sub],body:l,jwt:e.id_token})}return l}encryptionSecret(e){let t=e<=256?"sha256":e<=384?"sha384":e<=512&&"sha512";if(!t)throw Error("unsupported symmetric encryption key derivation");return f.createHash(t).update(this.client_secret).digest().slice(0,e/8)}secretForAlg(e){if(!this.client_secret)throw TypeError("client_secret is required");return/^A(\d{3})(?:GCM)?KW$/.test(e)?this.encryptionSecret(parseInt(RegExp.$1,10)):/^A(\d{3})(?:GCM|CBC-HS(\d{3}))$/.test(e)?this.encryptionSecret(parseInt(RegExp.$2||RegExp.$1,10)):new TextEncoder().encode(this.client_secret)}async grant(e){let t,{clientAssertionPayload:r,DPoP:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;k(this.issuer,"token_endpoint");let o=await L.call(this,"token",{form:e,responseType:"json"},{clientAssertionPayload:r,DPoP:n});try{t=T(o)}catch(t){if(i!==z&&t instanceof P&&"use_dpop_nonce"===t.error)return this.grant(e,{clientAssertionPayload:r,DPoP:n},z);throw t}return new R(t)}async deviceAuthorization(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{exchangeBody:t,clientAssertionPayload:r,DPoP:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k(this.issuer,"device_authorization_endpoint"),k(this.issuer,"token_endpoint");let i=ee.call(this,{client_id:this.client_id,redirect_uri:null,response_type:null,...e}),o=T(await L.call(this,"device_authorization",{responseType:"json",form:i},{clientAssertionPayload:r,endpointAuthMethod:"token"}));return new F({client:this,exchangeBody:t,clientAssertionPayload:r,response:o,maxAge:e.max_age,DPoP:n})}async revoke(e,t){let{revokeBody:r,clientAssertionPayload:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k(this.issuer,"revocation_endpoint"),void 0!==t&&"string"!=typeof t)throw TypeError("hint must be a string");let i={...r,token:e};t&&(i.token_type_hint=t),T(await L.call(this,"revocation",{form:i},{clientAssertionPayload:n}),{body:!1})}async introspect(e,t){let{introspectBody:r,clientAssertionPayload:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k(this.issuer,"introspection_endpoint"),void 0!==t&&"string"!=typeof t)throw TypeError("hint must be a string");let i={...r,token:e};return t&&(i.token_type_hint=t),T(await L.call(this,"introspection",{form:i,responseType:"json"},{clientAssertionPayload:n}))}static async register(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{initialAccessToken:r,jwks:n,...i}=t;return k(this.issuer,"registration_endpoint"),void 0===n||e.jwks||e.jwks_uri||(e.jwks=(await et.call(this,n)).toJWKS()),new this(T(await U.call(this,{headers:{Accept:"application/json",...r?{Authorization:X(r)}:void 0},responseType:"json",json:e,url:this.issuer.registration_endpoint,method:"POST"}),{statusCode:201,bearer:!0}),n,i)}get metadata(){return H(Object.fromEntries(a._(this,eo).entries()))}static async fromUri(e,t,r,n){return new this(T(await U.call(this,{method:"GET",url:e,responseType:"json",headers:{Authorization:X(t),Accept:"application/json"}}),{bearer:!0}),r,n)}async requestObject(){let e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{sign:n=this.request_object_signing_alg||"none",encrypt:{alg:i=this.request_object_encryption_alg,enc:o=this.request_object_encryption_enc||"A128CBC-HS256"}={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!O(r))throw TypeError("requestObject must be a plain object");let a=C(),s={alg:n,typ:"oauth-authz-req+jwt"},u=JSON.stringify(E({},r,{iss:this.client_id,aud:this.issuer.issuer,client_id:this.client_id,jti:I(),iat:a,exp:a+300,...this.fapi()?{nbf:a}:void 0}));if("none"===n)e=[w.encode(JSON.stringify(s)),w.encode(u),""].join(".");else{let r=n.startsWith("HS");if(r)t=this.secretForAlg(n);else{let e=await M.get(this);if(!e)throw TypeError("no keystore present for client, cannot sign using alg ".concat(n));if(!(t=e.get({alg:n,use:"sig"})))throw TypeError("no key to sign with found for alg ".concat(n))}e=await new m.CompactSign(new TextEncoder().encode(u)).setProtectedHeader({...s,kid:r?void 0:t.jwk.kid}).sign(r?t:await t.keyObject(n))}if(!i)return e;let c={alg:i,enc:o,cty:"oauth-authz-req+jwt"};return c.alg.match(/^(RSA|ECDH)/)?[t]=await W.call(this.issuer,{alg:c.alg,use:"enc"},{allowMulti:!0}):t=this.secretForAlg("dir"===c.alg?c.enc:c.alg),new m.CompactEncrypt(new TextEncoder().encode(e)).setProtectedHeader({...c,kid:t instanceof Uint8Array?void 0:t.jwk.kid}).encrypt(t instanceof Uint8Array?t:await t.keyObject(c.alg))}async pushedAuthorizationRequest(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{clientAssertionPayload:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k(this.issuer,"pushed_authorization_request_endpoint");let r={..."request"in e?e:ee.call(this,e),client_id:this.client_id},n=await L.call(this,"pushed_authorization_request",{responseType:"json",form:r},{clientAssertionPayload:t,endpointAuthMethod:"token"}),i=T(n,{statusCode:201});if(!("expires_in"in i))throw new j({message:"expected expires_in in Pushed Authorization Successful Response",response:n});if("number"!=typeof i.expires_in)throw new j({message:"invalid expires_in value in Pushed Authorization Successful Response",response:n});if(!("request_uri"in i))throw new j({message:"expected request_uri in Pushed Authorization Successful Response",response:n});if("string"!=typeof i.request_uri)throw new j({message:"invalid request_uri value in Pushed Authorization Successful Response",response:n});return i}get issuer(){return a._(this,ea)}[ec](){return"".concat(this.constructor.name," ").concat(c(this.metadata,{depth:1/0,colors:i.stdout.isTTY,compact:!1,sorted:!0}))}fapi(){return this.fapi1()||this.fapi2()}fapi1(){return"FAPI1Client"===this.constructor.name}fapi2(){return"FAPI2Client"===this.constructor.name}async validateJARM(e){let t=this.authorization_signed_response_alg,{payload:r}=await this.validateJWT(e,t,["iss","exp","aud"]);return Z(r)}async dpopProof(e,t,r){let i;if(!O(e))throw TypeError("payload must be a plain object");if(_(t))i=t;else if("CryptoKey"===t[Symbol.toStringTag])i=t;else if("node:crypto"===m.cryptoRuntime)i=f.createPrivateKey(t);else throw TypeError("unrecognized crypto runtime");if("private"!==i.type)throw TypeError('"DPoP" option must be a private key');let o=n.call(this,i,t);if(!o)throw TypeError("could not determine DPoP JWS Algorithm");return new m.SignJWT({ath:r?w.encode(f.createHash("sha256").update(r).digest()):void 0,...e}).setProtectedHeader({alg:o,typ:"dpop+jwt",jwk:await ey(i,t)}).setIssuedAt().setJti(I()).sign(i)}constructor(e,t,r={},n,i){if(s._(this,eo,{writable:!0,value:void 0}),s._(this,ea,{writable:!0,value:void 0}),s._(this,es,{writable:!0,value:void 0}),s._(this,eu,{writable:!0,value:void 0}),u._(this,eo,new Map),u._(this,ea,e),u._(this,es,t),"string"!=typeof r.client_id||!r.client_id)throw TypeError("client_id is required");let o={grant_types:["authorization_code"],id_token_signed_response_alg:"RS256",authorization_signed_response_alg:"RS256",response_types:["code"],token_endpoint_auth_method:"client_secret_basic",...this.fapi1()?{grant_types:["authorization_code","implicit"],id_token_signed_response_alg:"PS256",authorization_signed_response_alg:"PS256",response_types:["code id_token"],tls_client_certificate_bound_access_tokens:!0,token_endpoint_auth_method:void 0}:void 0,...this.fapi2()?{id_token_signed_response_alg:"PS256",authorization_signed_response_alg:"PS256",token_endpoint_auth_method:void 0}:void 0,...r};if(this.fapi())switch(o.token_endpoint_auth_method){case"self_signed_tls_client_auth":case"tls_client_auth":break;case"private_key_jwt":if(!n)throw TypeError("jwks is required");break;case void 0:throw TypeError("token_endpoint_auth_method is required");default:throw TypeError("invalid or unsupported token_endpoint_auth_method")}if(this.fapi2()&&(o.tls_client_certificate_bound_access_tokens&&o.dpop_bound_access_tokens||!o.tls_client_certificate_bound_access_tokens&&!o.dpop_bound_access_tokens))throw TypeError("either tls_client_certificate_bound_access_tokens or dpop_bound_access_tokens must be set to true");if(en(this,r,o),A("token",this.issuer,o),["introspection","revocation"].forEach(e=>{ei(e,this.issuer,o),A(e,this.issuer,o)}),Object.entries(o).forEach(e=>{let[t,r]=e;a._(this,eo).set(t,r),this[t]||Object.defineProperty(this,t,{get(){return a._(this,eo).get(t)},enumerable:!0})}),void 0!==n){let e=et.call(this,n);M.set(this,e)}null!=i&&i.additionalAuthorizedParties&&u._(this,eu,H(i.additionalAuthorizedParties)),this[N]=0}}function ef(e){switch(e.algorithm.name){case"Ed25519":case"Ed448":return"EdDSA";case"ECDSA":switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512"}break;case"RSASSA-PKCS1-v1_5":return"RS".concat(e.algorithm.hash.name.slice(4));case"RSA-PSS":return"PS".concat(e.algorithm.hash.name.slice(4));default:throw TypeError("unsupported DPoP private key")}}if("node:crypto"===m.cryptoRuntime){n=function(e,t){if("CryptoKey"===t[Symbol.toStringTag])return ef(e);switch(e.asymmetricKeyType){case"ed25519":case"ed448":return"EdDSA";case"ec":return ep(e,t);case"rsa":case J&&"rsa-pss":return ed(e,t,this.issuer.dpop_signing_alg_values_supported);default:throw TypeError("unsupported DPoP private key")}};let e=/^(?:RS|PS)(?:256|384|512)$/;function ed(t,r,n){if("object"==typeof r&&"jwk"===r.format&&r.key&&r.key.alg)return r.key.alg;if(Array.isArray(n)){let r=n.filter(RegExp.prototype.test.bind(e));return"rsa-pss"===t.asymmetricKeyType&&(r=r.filter(e=>e.startsWith("PS"))),["PS256","PS384","PS512","RS256","RS384","RS384"].find(e=>r.includes(e))}return"PS256"}let t=o.from([42,134,72,206,61,3,1,7]),r=o.from([43,129,4,0,34]),i=o.from([43,129,4,0,35]),a=o.from([43,129,4,0,10]);function ep(e,n){switch("object"==typeof n&&"object"==typeof n.key&&n.key.crv){case"P-256":return"ES256";case"secp256k1":return"ES256K";case"P-384":return"ES384";case"P-512":return"ES512"}let o=e.export({format:"der",type:"pkcs8"}),s=o[1]<128?17:18,u=o[s],c=o.slice(s+1,s+1+u);if(c.equals(t))return"ES256";if(c.equals(r))return"ES384";if(c.equals(i))return"ES512";if(c.equals(a))return"ES256K";throw TypeError("unsupported DPoP private key curve")}}else n=ef;let eh=new WeakMap;async function ey(e,t){if("node:crypto"===m.cryptoRuntime&&"object"==typeof t&&"object"==typeof t.key&&"jwk"===t.format)return x(t.key,"kty","crv","x","y","e","n");if(eh.has(t))return eh.get(t);let r=x(await m.exportJWK(e),"kty","crv","x","y","e","n");return(_(t)||"WebCryptoAPI"===m.cryptoRuntime)&&eh.set(t,r),r}e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class r extends el{static get issuer(){return e}constructor(...r){super(e,t,...r)}}return r},e.exports.BaseClient=el},17313:(e,t,r)=>{let n=r(46755);e.exports=e=>{if("string"!=typeof e||!e)throw TypeError("JWT must be a string");let{0:t,1:r,2:i,length:o}=e.split(".");if(5===o)throw TypeError("encrypted JWTs cannot be decoded");if(3!==o)throw Error("JWTs must have three components");try{return{header:JSON.parse(n.decode(t)),payload:JSON.parse(n.decode(r)),signature:i}}catch(e){throw Error("JWT is malformed")}}},17828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(64054).createAsyncLocalStorage)()},18877:e=>{e.exports=globalThis.structuredClone||(e=>JSON.parse(JSON.stringify(e)))},19087:e=>{var t="/";!function(){"use strict";var r={864:function(e){var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function i(e){console&&console.warn&&console.warn(e)}t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=b,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function u(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){if(u(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=c(e))>0&&s.length>o&&!s.warned){s.warned=!0;var o,a,s,l=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,i(l)}return e}function f(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?m(i):y(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=Array(t),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else for(var c=u.length,l=y(u,c),r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():g(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}},a=!0;try{r[e](o,o.exports,i),a=!1}finally{a&&delete n[e]}return o.exports}i.ab=t+"/",e.exports=i(864)}()},19110:e=>{var t="/";!function(){"use strict";var r={815:function(e){function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,i,o){n=n||"&",i=i||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(n);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l=0?(f=y.substr(0,g),d=y.substr(g+1)):(f=y,d=""),p=decodeURIComponent(f),h=decodeURIComponent(d),t(a,p)?r(a[p])?a[p].push(h):a[p]=[a[p],h]:a[p]=h}return a};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},577:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,o,a,s){return(o=o||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e)?n(i(e),function(i){var s=encodeURIComponent(t(i))+a;return r(e[i])?n(e[i],function(e){return s+encodeURIComponent(t(e))}).join(o):s+encodeURIComponent(t(e[i]))}).join(o):s?encodeURIComponent(t(s))+a+encodeURIComponent(t(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n{e.exports=e=>!!e&&e.constructor===Object},19924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(66117);function i(e){let{url:t,theme:r}=e;return(0,n.h)("div",{className:"verify-request"},r.brandColor&&(0,n.h)("style",{dangerouslySetInnerHTML:{__html:` :root { --brand-color: ${r.brandColor} } `}}),(0,n.h)("div",{className:"card"},r.logo&&(0,n.h)("img",{src:r.logo,alt:"Logo",className:"logo"}),(0,n.h)("h1",null,"Check your email"),(0,n.h)("p",null,"A sign in link has been sent to your email address."),(0,n.h)("p",null,(0,n.h)("a",{className:"site",href:t.origin},t.host))))}},21345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(93673);async function i(e){var t,r,i,o,a,s;let{options:u,sessionStore:c,newSession:l,isUpdate:f}=e,{adapter:d,jwt:p,events:h,callbacks:y,logger:g,session:{strategy:m,maxAge:b}}=u,_={body:{},headers:[{key:"Content-Type",value:"application/json"}],cookies:[]},v=c.value;if(!v)return _;if("jwt"===m)try{let e=await p.decode({...p,token:v});if(!e)throw Error("JWT invalid");let i=await y.jwt({token:e,...f&&{trigger:"update"},session:l}),o=(0,n.fromDate)(b),a=await y.session({session:{user:{name:null==e?void 0:e.name,email:null==e?void 0:e.email,image:null==e?void 0:e.picture},expires:o.toISOString()},token:i});_.body=a;let s=await p.encode({...p,token:i,maxAge:u.session.maxAge}),d=c.chunk(s,{expires:o});null==(t=_.cookies)||t.push(...d),await (null==(r=h.session)?void 0:r.call(h,{session:a,token:i}))}catch(e){g.error("JWT_SESSION_ERROR",e),null==(i=_.cookies)||i.push(...c.clean())}else try{let{getSessionAndUser:e,deleteSession:t,updateSession:r}=d,i=await e(v);if(i&&i.session.expires.valueOf(){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=r(44187)},22474:(e,t)=>{var r=1,n="=";function i(e,t){return u(a(c(e),c(t)))}function o(e){return f(d(l(e),8*e.length))}function a(e,t){var r=l(e);r.length>16&&(r=d(r,8*e.length));for(var n=Array(16),i=Array(16),o=0;o<16;o++)n[o]=0x36363636^r[o],i[o]=0x5c5c5c5c^r[o];var a=d(n.concat(l(t)),512+8*t.length);return f(d(i.concat(a),672))}function s(e){for(var t,n=r?"0123456789ABCDEF":"0123456789abcdef",i="",o=0;o>>4&15)+n.charAt(15&t);return i}function u(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",i=e.length,o=0;o8*e.length?r+=n:r+=t.charAt(a>>>6*(3-s)&63);return r}function c(e){for(var t,r,n="",i=-1;++i>>6&31,128|63&t):t<=65535?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}function l(e){for(var t=Array(e.length>>2),r=0;r>5]|=(255&e.charCodeAt(r/8))<<24-r%32;return t}function f(e){for(var t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}function d(e,t){e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var r=Array(80),n=0x67452301,i=-0x10325477,o=-0x67452302,a=0x10325476,s=-0x3c2d1e10,u=0;u>16)+(t>>16)+(r>>16)<<16|65535&r}function g(e,t){return e<>>32-t}t.HMACSHA1=function(e,t){return i(e,t)}},23378:(e,t)=>{"use strict";async function r(e){var t,r;let{options:n,sessionStore:i}=e,{adapter:o,events:a,jwt:s,callbackUrl:u,logger:c,session:l}=n,f=null==i?void 0:i.value;if(!f)return{redirect:u};if("jwt"===l.strategy)try{let e=await s.decode({...s,token:f});await (null==(t=a.signOut)?void 0:t.call(a,{token:e}))}catch(e){c.error("SIGNOUT_ERROR",e)}else try{let e=await o.deleteSession(f);await (null==(r=a.signOut)?void 0:r.call(a,{session:e}))}catch(e){c.error("SIGNOUT_ERROR",e)}return{redirect:u,cookies:i.clean()}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},23689:(e,t,r)=>{var n=r(49509);let i=r(8777),[o,a]=n.version.substring(1).split(".").map(e=>parseInt(e,10));e.exports=(o>12||12===o&&a>=8)&&i.getHashes().includes("shake256")},24382:(e,t,r)=>{var n=r(44134).Buffer;let i=r(92206),{RPError:o}=r(32608),{assertIssuerConfiguration:a}=r(99403),{random:s}=r(90735),u=r(6796),c=r(6030),{keystores:l}=r(8816),f=r(919),d=e=>encodeURIComponent(e).replace(/%20/g,"+");async function p(e,t){let r=this[`${e}_endpoint_auth_signing_alg`];if(r||a(this.issuer,`${e}_endpoint_auth_signing_alg_values_supported`),"client_secret_jwt"===this[`${e}_endpoint_auth_method`]){if(!r){let t=this.issuer[`${e}_endpoint_auth_signing_alg_values_supported`];r=Array.isArray(t)&&t.find(e=>/^HS(?:256|384|512)/.test(e))}if(!r)throw new o(`failed to determine a JWS Algorithm to use for ${this[`${e}_endpoint_auth_method`]} Client Assertion`);return new i.CompactSign(n.from(JSON.stringify(t))).setProtectedHeader({alg:r}).sign(this.secretForAlg(r))}let s=await l.get(this);if(!s)throw TypeError("no client jwks provided for signing a client assertion with");if(!r){let t=this.issuer[`${e}_endpoint_auth_signing_alg_values_supported`];r=Array.isArray(t)&&t.find(e=>s.get({alg:e,use:"sig"}))}if(!r)throw new o(`failed to determine a JWS Algorithm to use for ${this[`${e}_endpoint_auth_method`]} Client Assertion`);let u=s.get({alg:r,use:"sig"});if(!u)throw new o(`no key found in client jwks to sign a client assertion with using alg ${r}`);return new i.CompactSign(n.from(JSON.stringify(t))).setProtectedHeader({alg:r,kid:u.jwk&&u.jwk.kid}).sign(await u.keyObject(r))}async function h(e,{clientAssertionPayload:t}={}){switch(this[`${e}_endpoint_auth_method`]){case"self_signed_tls_client_auth":case"tls_client_auth":case"none":return{form:{client_id:this.client_id}};case"client_secret_post":if("string"!=typeof this.client_secret)throw TypeError("client_secret_post client authentication method requires a client_secret");return{form:{client_id:this.client_id,client_secret:this.client_secret}};case"private_key_jwt":case"client_secret_jwt":{let r=u(),n=await p.call(this,e,{iat:r,exp:r+60,jti:s(),iss:this.client_id,sub:this.client_id,aud:this.issuer.issuer,...t});return{form:{client_id:this.client_id,client_assertion:n,client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}}case"client_secret_basic":{if("string"!=typeof this.client_secret)throw TypeError("client_secret_basic client authentication method requires a client_secret");let e=`${d(this.client_id)}:${d(this.client_secret)}`,t=n.from(e).toString("base64");return{headers:{Authorization:`Basic ${t}`}}}default:throw TypeError(`missing, or unsupported, ${e}_endpoint_auth_method`)}}async function y(e,t,{clientAssertionPayload:r,endpointAuthMethod:n=e,DPoP:i}={}){let o,a=f(t,await h.call(this,n,{clientAssertionPayload:r})),s=this[`${n}_endpoint_auth_method`].includes("tls_client_auth")||"token"===e&&this.tls_client_certificate_bound_access_tokens;if(s&&this.issuer.mtls_endpoint_aliases&&(o=this.issuer.mtls_endpoint_aliases[`${e}_endpoint`]),o=o||this.issuer[`${e}_endpoint`],"form"in a)for(let[e,t]of Object.entries(a.form))void 0===t&&delete a.form[e];return c.call(this,{...a,method:"POST",url:o,headers:{..."revocation"!==e?{Accept:"application/json"}:void 0,...a.headers}},{mTLS:s,DPoP:i})}e.exports={resolveResponseType:function(){let{length:e,0:t}=this.response_types;if(1===e)return t},resolveRedirectUri:function(){let{length:e,0:t}=this.redirect_uris||[];if(1===e)return t},authFor:h,authenticatedPost:y}},25943:(e,t)=>{"use strict";var r;r={value:!0},t.A=function e(e){return{id:"credentials",name:"Credentials",type:"credentials",credentials:{},authorize:()=>null,options:e}}},27383:(e,t)=>{"use strict";async function r({options:e,paramValue:t,cookieValue:r}){let{url:n,callbacks:i}=e,o=n.origin;return t?o=await i.redirect({url:t,baseUrl:n.origin}):r&&(o=await i.redirect({url:r,baseUrl:n.origin})),{callbackUrl:o,callbackUrlCookie:o!==r?o:void 0}}Object.defineProperty(t,"__esModule",{value:!0}),t.createCallbackUrl=r},27793:(e,t,r)=>{let n=r(66864),{OPError:i,RPError:o}=r(32608),a=r(37619),s=r(61599),{CLOCK_TOLERANCE:u,HTTP_OPTIONS:c}=r(92833),l=r(90735),{setDefaults:f}=r(6030);e.exports={Issuer:n,Strategy:a,TokenSet:s,errors:{OPError:i,RPError:o},custom:{setHttpOptionsDefaults:f,http_options:c,clock_tolerance:u},generators:l}},27988:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION_HEADER:function(){return n},FLIGHT_HEADERS:function(){return f},NEXT_DID_POSTPONE_HEADER:function(){return h},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return u},NEXT_HMR_REFRESH_HEADER:function(){return s},NEXT_IS_PRERENDER_HEADER:function(){return m},NEXT_REWRITTEN_PATH_HEADER:function(){return y},NEXT_REWRITTEN_QUERY_HEADER:function(){return g},NEXT_ROUTER_PREFETCH_HEADER:function(){return o},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return a},NEXT_ROUTER_STALE_TIME_HEADER:function(){return p},NEXT_ROUTER_STATE_TREE_HEADER:function(){return i},NEXT_RSC_UNION_QUERY:function(){return d},NEXT_URL:function(){return c},RSC_CONTENT_TYPE_HEADER:function(){return l},RSC_HEADER:function(){return r}});let r="RSC",n="Next-Action",i="Next-Router-State-Tree",o="Next-Router-Prefetch",a="Next-Router-Segment-Prefetch",s="Next-HMR-Refresh",u="__next_hmr_refresh_hash__",c="Next-Url",l="text/x-component",f=[r,i,o,s,a],d="_rsc",p="x-nextjs-stale-time",h="x-nextjs-postponed",y="x-nextjs-rewritten-path",g="x-nextjs-rewritten-query",m="x-nextjs-prerender";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},28155:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return s}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let i="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return i?new i:new n}function a(e){return i?i.bind(e):n.bind(e)}function s(){return i?i.snapshot():function(e,...t){return e(...t)}}},32443:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>j,render:()=>A,renderToStaticMarkup:()=>A,renderToString:()=>A,shallowRender:()=>E});var n=r(66117),i=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,a=/[\s\n\\/='"\0<>]/,s=/^xlink:?./,u=/["&<]/;function c(e){if(!1===u.test(e+=""))return e;for(var t=0,r=0,n="",i="";r(t||40)||!r&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},d={},p=/([A-Z])/g;function h(e){var t="";for(var r in e){var n=e[r];null!=n&&""!==n&&(t&&(t+=" "),t+="-"==r[0]?r:d[r]||(d[r]=r.replace(p,"-$1").toLowerCase()),t="number"==typeof n&&!1===i.test(r)?t+": "+n+"px;":t+": "+n+";")}return t||void 0}function y(e,t){return Array.isArray(t)?t.reduce(y,e):null!=t&&!1!==t&&e.push(t),e}function g(){this.__d=!0}function m(e,t){return{__v:e,context:t,props:e.props,setState:g,forceUpdate:g,__d:!0,__h:[]}}function b(e,t){var r=e.contextType,n=r&&t[r.__c];return null!=r?n?n.props.value:r.__:t}var _=[];function v(e,t,r,i,u,d){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":c(e);var p=r.pretty,g=p&&"string"==typeof p?p:" ";if(Array.isArray(e)){for(var w="",E=0;E0&&(w+="\n"),w+=v(e[E],t,r,i,u,d);return w}if(void 0!==e.constructor)return"";var S,A=e.type,k=e.props,x=!1;if("function"==typeof A){if(x=!0,!r.shallow||!i&&!1!==r.renderRootComponent){if(A===n.Fragment){var O=[];return y(O,e.props.children),v(O,t,r,!1!==r.shallowHighOrder,u,d)}var T,R=e.__c=m(e,t);n.options.__b&&n.options.__b(e);var P=n.options.__r;if(A.prototype&&"function"==typeof A.prototype.render){var j=b(A,t);(R=e.__c=new A(k,j)).__v=e,R._dirty=R.__d=!0,R.props=k,null==R.state&&(R.state={}),null==R._nextState&&null==R.__s&&(R._nextState=R.__s=R.state),R.context=j,A.getDerivedStateFromProps?R.state=Object.assign({},R.state,A.getDerivedStateFromProps(R.props,R.state)):R.componentWillMount&&(R.componentWillMount(),R.state=R._nextState!==R.state?R._nextState:R.__s!==R.state?R.__s:R.state),P&&P(e),T=R.render(R.props,R.state,R.context)}else for(var C=b(A,t),I=0;R.__d&&I++<25;)R.__d=!1,P&&P(e),T=A.call(e.__c,k,C);return R.getChildContext&&(t=Object.assign({},t,R.getChildContext())),n.options.diffed&&n.options.diffed(e),v(T,t,r,!1!==r.shallowHighOrder,u,d)}A=(S=A).displayName||S!==Function&&S.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var r=-1,n=_.length;n--;)if(_[n]===e){r=n;break}r<0&&(r=_.push(e)-1),t="UnnamedComponent"+r}return t}(S)}var U,N,M="<"+A;if(k){var D=Object.keys(k);r&&!0===r.sortAttributes&&D.sort();for(var H=0;H",a.test(A))throw Error(A+" is not a valid HTML tag name in "+M);var F,q=o.test(A)||r.voidElements&&r.voidElements.test(A),K=[];if(N)p&&f(N)&&(N="\n"+g+l(N,g)),M+=N;else if(null!=U&&y(F=[],U).length){for(var J=p&&~M.indexOf("\n"),z=!1,G=0;G0&&"<"!=Z[0];z&&X?K[K.length-1]+=Z:K.push(Z),z=X}else K.push(Z)}}if(p&&J)for(var Y=K.length;Y--;)K[Y]="\n"+g+l(K[Y],g)}if(K.length||N)M+=K.join("");else if(r&&r.xml)return M.substring(0,M.length-1)+" />";return!q||F||N?(p&&~M.indexOf("\n")&&(M+="\n"),M=M+""):M=M.replace(/>$/," />"),M}var w={shallow:!0};A.render=A;var E=function(e,t){return A(e,t,w)},S=[];function A(e,t,r){t=t||{};var i=n.options.__s;n.options.__s=!0;var o,a=(0,n.h)(n.Fragment,null);return a.__k=[e],o=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?v(e,t,r):P(e,t,!1,void 0,a),n.options.__c&&n.options.__c(e,S),n.options.__s=i,S.length=0,o}function k(e){return null==e||"boolean"==typeof e?null:"string"==typeof e||"number"==typeof e||"bigint"==typeof e?(0,n.h)(null,null,e):e}function x(e,t){return"className"===e?"class":"htmlFor"===e?"for":"defaultValue"===e?"value":"defaultChecked"===e?"checked":"defaultSelected"===e?"selected":t&&s.test(e)?e.toLowerCase().replace(/^xlink:?/,"xlink:"):e}function O(e,t){return"style"===e&&null!=t&&"object"==typeof t?h(t):"a"===e[0]&&"r"===e[1]&&"boolean"==typeof t?String(t):t}var T=Array.isArray,R=Object.assign;function P(e,t,r,i,s){if(null==e||!0===e||!1===e||""===e)return"";if("object"!=typeof e)return"function"==typeof e?"":c(e);if(T(e)){var u="";s.__k=e;for(var l=0;l",a.test(f))throw Error(f+" is not a valid HTML tag name in "+v);var A="",j=!1;if(_)A+=_,j=!0;else if("string"==typeof g)A+=c(g),j=!0;else if(T(g)){e.__k=g;for(var C=0;C";return v+""}A.shallowRender=E;let j=A},32608:(e,t,r)=>{let{format:n}=r(5625);class i extends Error{constructor({error_description:e,error:t,error_uri:r,session_state:n,state:i,scope:o},a){super(e?`${t} (${e})`:t),Object.assign(this,{error:t},e&&{error_description:e},r&&{error_uri:r},i&&{state:i},o&&{scope:o},n&&{session_state:n}),a&&Object.defineProperty(this,"response",{value:a}),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor)}}class o extends Error{constructor(...e){if("string"==typeof e[0])super(n(...e));else{let{message:t,printf:r,response:i,...o}=e[0];r?super(n(...r)):super(t),Object.assign(this,o),i&&Object.defineProperty(this,"response",{value:i})}this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor)}}e.exports={OPError:i,RPError:o}},34002:(e,t,r)=>{"use strict";var n=r(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.assertConfig=c;var i=r(71883),o=n(r(50837)),a=r(82466);let s=!1;function u(e,t){try{return/^https?:/.test(new URL(e,e.startsWith("/")?t:void 0).protocol)}catch(e){return!1}}function c(e){var t,r,n,c,l,f,d;let p,h,y,{options:g,req:m}=e,b=[];if(!s&&(m.origin||b.push("NEXTAUTH_URL"),g.secret,g.debug&&b.push("DEBUG_ENABLED")),!g.secret)return new i.MissingSecret("Please define a `secret` in production.");if(!(null!=(t=m.query)&&t.nextauth)&&!m.action)return new i.MissingAPIRoute("Cannot find [...nextauth].{js,ts} in `/pages/api/auth`. Make sure the filename is written correctly.");let _=null==(r=m.query)?void 0:r.callbackUrl,v=(0,o.default)(m.origin);if(_&&!u(_,v.base))return new i.InvalidCallbackUrl(`Invalid callback URL. Received: ${_}`);let{callbackUrl:w}=(0,a.defaultCookies)(null!=(n=g.useSecureCookies)?n:v.base.startsWith("https://")),E=null==(c=m.cookies)?void 0:c[null!=(l=null==(f=g.cookies)||null==(f=f.callbackUrl)?void 0:f.name)?l:w.name];if(E&&!u(E,v.base))return new i.InvalidCallbackUrl(`Invalid callback URL. Received: ${E}`);for(let e of g.providers)"credentials"===e.type?p=!0:"email"===e.type?h=!0:"twitter"===e.id&&"2.0"===e.version&&(y=!0);if(p){let e=(null==(d=g.session)?void 0:d.strategy)==="database",t=!g.providers.some(e=>"credentials"!==e.type);if(e&&t)return new i.UnsupportedStrategy("Signin in with credentials only supported if JWT strategy is enabled");if(g.providers.some(e=>"credentials"===e.type&&!e.authorize))return new i.MissingAuthorize("Must define an authorize() handler to use credentials authentication provider")}if(h){let{adapter:e}=g;if(!e)return new i.MissingAdapter("E-mail login requires an adapter.");let t=["createVerificationToken","useVerificationToken","getUserByEmail"].filter(t=>!e[t]);if(t.length)return new i.MissingAdapterMethods(`Required adapter methods were missing: ${t.join(", ")}`)}return s||(y&&b.push("TWITTER_OAUTH_2_BETA"),s=!0),b}},34442:(e,t,r)=>{var n=r(44134).Buffer,i=r(8777),o=r(22474),a=r(36088),s=r(79189),u=r(75356),c=r(19110),l=r(9985);t.OAuth=function(e,t,r,n,i,o,a,s,u){if(this._isEcho=!1,this._requestUrl=e,this._accessUrl=t,this._consumerKey=r,this._consumerSecret=this._encodeData(n),"RSA-SHA1"==a&&(this._privateKey=n),this._version=i,void 0===o?this._authorize_callback="oob":this._authorize_callback=o,"PLAINTEXT"!=a&&"HMAC-SHA1"!=a&&"RSA-SHA1"!=a)throw Error("Un-supported signature method: "+a);this._signatureMethod=a,this._nonceSize=s||32,this._headers=u||{Accept:"*/*",Connection:"close","User-Agent":"Node authentication"},this._clientOptions=this._defaultClientOptions={requestTokenHttpMethod:"POST",accessTokenHttpMethod:"POST",followRedirects:!0},this._oauthParameterSeperator=","},t.OAuthEcho=function(e,t,r,n,i,o,a,s){if(this._isEcho=!0,this._realm=e,this._verifyCredentials=t,this._consumerKey=r,this._consumerSecret=this._encodeData(n),"RSA-SHA1"==o&&(this._privateKey=n),this._version=i,"PLAINTEXT"!=o&&"HMAC-SHA1"!=o&&"RSA-SHA1"!=o)throw Error("Un-supported signature method: "+o);this._signatureMethod=o,this._nonceSize=a||32,this._headers=s||{Accept:"*/*",Connection:"close","User-Agent":"Node authentication"},this._oauthParameterSeperator=","},t.OAuthEcho.prototype=t.OAuth.prototype,t.OAuth.prototype._getTimestamp=function(){return Math.floor(new Date().getTime()/1e3)},t.OAuth.prototype._encodeData=function(e){return null==e||""==e?"":encodeURIComponent(e).replace(/\!/g,"%21").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")},t.OAuth.prototype._decodeData=function(e){return null!=e&&(e=e.replace(/\+/g," ")),decodeURIComponent(e)},t.OAuth.prototype._getSignature=function(e,t,r,n){var i=this._createSignatureBase(e,t,r);return this._createSignature(i,n)},t.OAuth.prototype._normalizeUrl=function(e){var t=u.parse(e,!0),r="";return t.port&&("http:"==t.protocol&&"80"!=t.port||"https:"==t.protocol&&"443"!=t.port)&&(r=":"+t.port),t.pathname&&""!=t.pathname||(t.pathname="/"),t.protocol+"//"+t.hostname+r+t.pathname},t.OAuth.prototype._isParameterNameAnOAuthParameter=function(e){var t=e.match("^oauth_");return!!t&&"oauth_"===t[0]},t.OAuth.prototype._buildAuthorizationHeaders=function(e){var t="OAuth ";this._isEcho&&(t+='realm="'+this._realm+'",');for(var r=0;r=200&&n.statusCode<=299?f(null,v,n):(301==n.statusCode||302==n.statusCode)&&_.followRedirects&&n.headers&&n.headers.location?w._performSecureRequest(e,t,r,n.headers.location,o,a,s,f):f({statusCode:n.statusCode,data:v},v,n))};p.on("response",function(e){e.setEncoding("utf8"),e.on("data",function(e){v+=e}),e.on("end",function(){A(e)}),e.on("close",function(){E&&A(e)})}),p.on("error",function(e){S||(S=!0,f(e))}),("POST"==r||"PUT"==r)&&null!=a&&""!=a&&p.write(a),p.end()},t.OAuth.prototype.setClientOptions=function(e){var t,r={},n=Object.prototype.hasOwnProperty;for(t in this._defaultClientOptions)n.call(e,t)?r[t]=e[t]:r[t]=this._defaultClientOptions[t];this._clientOptions=r},t.OAuth.prototype.getOAuthAccessToken=function(e,t,r,n){var i={};"function"==typeof r?n=r:i.oauth_verifier=r,this._performSecureRequest(e,t,this._clientOptions.accessTokenHttpMethod,this._accessUrl,i,null,null,function(e,t,r){if(e)n(e);else{var i=c.parse(t),o=i.oauth_token;delete i.oauth_token;var a=i.oauth_token_secret;delete i.oauth_token_secret,n(null,o,a,i)}})},t.OAuth.prototype.getProtectedResource=function(e,t,r,n,i){this._performSecureRequest(r,n,t,e,null,"",null,i)},t.OAuth.prototype.delete=function(e,t,r,n){return this._performSecureRequest(t,r,"DELETE",e,null,"",null,n)},t.OAuth.prototype.get=function(e,t,r,n){return this._performSecureRequest(t,r,"GET",e,null,"",null,n)},t.OAuth.prototype._putOrPost=function(e,t,r,i,o,a,s){var u=null;return"function"==typeof a&&(s=a,a=null),"string"==typeof o||n.isBuffer(o)||(a="application/x-www-form-urlencoded",u=o,o=null),this._performSecureRequest(r,i,e,t,u,o,a,s)},t.OAuth.prototype.put=function(e,t,r,n,i,o){return this._putOrPost("PUT",e,t,r,n,i,o)},t.OAuth.prototype.post=function(e,t,r,n,i,o){return this._putOrPost("POST",e,t,r,n,i,o)},t.OAuth.prototype.getOAuthRequestToken=function(e,t){"function"==typeof e&&(t=e,e={}),this._authorize_callback&&(e.oauth_callback=this._authorize_callback),this._performSecureRequest(null,null,this._clientOptions.requestTokenHttpMethod,this._requestUrl,e,null,null,function(e,r,n){if(e)t(e);else{var i=c.parse(r),o=i.oauth_token,a=i.oauth_token_secret;delete i.oauth_token,delete i.oauth_token_secret,t(null,o,a,i)}})},t.OAuth.prototype.signUrl=function(e,t,r,n){if(void 0===n)var n="GET";for(var i=this._prepareParameters(t,r,n,e,{}),o=u.parse(e,!1),a="",s=0;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(66117);function i(e){let{url:t,csrfToken:r,theme:i}=e;return(0,n.h)("div",{className:"signout"},i.brandColor&&(0,n.h)("style",{dangerouslySetInnerHTML:{__html:` :root { --brand-color: ${i.brandColor} } `}}),i.buttonText&&(0,n.h)("style",{dangerouslySetInnerHTML:{__html:` :root { --button-text-color: ${i.buttonText} } `}}),(0,n.h)("div",{className:"card"},i.logo&&(0,n.h)("img",{src:i.logo,alt:"Logo",className:"logo"}),(0,n.h)("h1",null,"Signout"),(0,n.h)("p",null,"Are you sure you want to sign out?"),(0,n.h)("form",{action:`${t}/signout`,method:"POST"},(0,n.h)("input",{type:"hidden",name:"csrfToken",value:r}),(0,n.h)("button",{id:"submitButton",type:"submit"},"Sign out"))))}},34895:(e,t,r)=>{"use strict";var n=r(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=r(66117),o=n(r(80208));function a(e,t=1){if(!e)return;3===(e=e.replace(/^#/,"")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let r=parseInt(e,16),n=r>>16&255,i=r>>8&255,o=255&r;return t=Math.min(Math.max(t,0),1),`rgba(${n}, ${i}, ${o}, ${t})`}function s(e){var t;let{csrfToken:r,providers:n,callbackUrl:s,theme:u,email:c,error:l}=e,f=n.filter(e=>"oauth"===e.type||"email"===e.type||"credentials"===e.type&&!!e.credentials);"undefined"!=typeof document&&u.buttonText&&document.documentElement.style.setProperty("--button-text-color",u.buttonText),"undefined"!=typeof document&&u.brandColor&&document.documentElement.style.setProperty("--brand-color",u.brandColor);let d={Signin:"Try signing in with a different account.",OAuthSignin:"Try signing in with a different account.",OAuthCallback:"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.",default:"Unable to sign in."},p=l&&(null!=(t=d[l])?t:d.default),h="https://authjs.dev/img/providers";return(0,i.h)("div",{className:"signin"},u.brandColor&&(0,i.h)("style",{dangerouslySetInnerHTML:{__html:` :root { --brand-color: ${u.brandColor} } `}}),u.buttonText&&(0,i.h)("style",{dangerouslySetInnerHTML:{__html:` :root { --button-text-color: ${u.buttonText} } `}}),(0,i.h)("div",{className:"card"},u.logo&&(0,i.h)("img",{src:u.logo,alt:"Logo",className:"logo"}),p&&(0,i.h)("div",{className:"error"},(0,i.h)("p",null,p)),f.map((e,t)=>{let n,u,l,d,p,y;if("oauth"===e.type){var g;({bg:n="",text:u="",logo:l="",bgDark:p=n,textDark:y=u,logoDark:d=""}=null!=(g=e.style)?g:{}),l=l.startsWith("/")?`${h}${l}`:l,(d=d.startsWith("/")?`${h}${d}`:d||l)||(d=l)}return(0,i.h)("div",{key:e.id,className:"provider"},"oauth"===e.type&&(0,i.h)("form",{action:e.signinUrl,method:"POST"},(0,i.h)("input",{type:"hidden",name:"csrfToken",value:r}),s&&(0,i.h)("input",{type:"hidden",name:"callbackUrl",value:s}),(0,i.h)("button",{type:"submit",className:"button",style:{"--provider-bg":n,"--provider-dark-bg":p,"--provider-color":u,"--provider-dark-color":y,"--provider-bg-hover":a(n,.8),"--provider-dark-bg-hover":a(p,.8)}},l&&(0,i.h)("img",{loading:"lazy",height:24,width:24,id:"provider-logo",src:`${l.startsWith("/")?h:""}${l}`}),d&&(0,i.h)("img",{loading:"lazy",height:24,width:24,id:"provider-logo-dark",src:`${l.startsWith("/")?h:""}${d}`}),(0,i.h)("span",null,"Sign in with ",e.name))),("email"===e.type||"credentials"===e.type)&&t>0&&"email"!==f[t-1].type&&"credentials"!==f[t-1].type&&(0,i.h)("hr",null),"email"===e.type&&(0,i.h)("form",{action:e.signinUrl,method:"POST"},(0,i.h)("input",{type:"hidden",name:"csrfToken",value:r}),(0,i.h)("label",{className:"section-header",htmlFor:`input-email-for-${e.id}-provider`},"Email"),(0,i.h)("input",{id:`input-email-for-${e.id}-provider`,autoFocus:!0,type:"email",name:"email",value:c,placeholder:"email@example.com",required:!0}),(0,i.h)("button",{id:"submitButton",type:"submit"},"Sign in with ",e.name)),"credentials"===e.type&&(0,i.h)("form",{action:e.callbackUrl,method:"POST"},(0,i.h)("input",{type:"hidden",name:"csrfToken",value:r}),Object.keys(e.credentials).map(t=>{var r,n,a;return(0,i.h)("div",{key:`input-group-${e.id}`},(0,i.h)("label",{className:"section-header",htmlFor:`input-${t}-for-${e.id}-provider`},null!=(r=e.credentials[t].label)?r:t),(0,i.h)("input",(0,o.default)({name:t,id:`input-${t}-for-${e.id}-provider`,type:null!=(n=e.credentials[t].type)?n:"text",placeholder:null!=(a=e.credentials[t].placeholder)?a:""},e.credentials[t])))}),(0,i.h)("button",{type:"submit"},"Sign in with ",e.name)),("email"===e.type||"credentials"===e.type)&&t+1{"use strict";function n(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function i(e,t,r){n(e,t),t.set(e,r)}r.r(t),r.d(t,{_:()=>i})},35260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return c}});let n=o(r(12115));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}let a={current:null},s="function"==typeof n.cache?n.cache:e=>e,u=console.warn;function c(e){return function(...t){u(e(...t))}}s(e=>{try{u(a.current)}finally{a.current=null}})},36088:(e,t,r)=>{var n="/",i=r(49509),o=r(44134).Buffer;!function(){var t={523:function(e){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},782:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},646:function(e){"use strict";let t={};function r(e,r,n){function i(e,t,n){return"string"==typeof r?r:r(e,t,n)}n||(n=Error);class o extends n{constructor(e,t,r){super(i(e,t,r))}}o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(!Array.isArray(e))return`of ${t} ${String(e)}`;{let r=e.length;return(e=e.map(e=>String(e)),r>2)?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}}function i(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function a(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){let s,u;if("string"==typeof t&&i(t,"not ")?(s="must not be",t=t.replace(/^not /,"")):s="must be",o(e," argument"))u=`The ${e} ${s} ${n(t,"type")}`;else{let r=a(e,".")?"property":"argument";u=`The "${e}" ${r} ${s} ${n(t,"type")}`}return u+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(709),a=r(337);r(782)(l,o);for(var s=n(a.prototype),u=0;u0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===d.prototype||(t=h(t)),n)s.endEmitted?k(e,new A):j(e,s,t,!0);else if(s.ended)k(e,new E);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?j(e,s,t,!1):L(e,s)):j(e,s,t,!1)}else n||(s.reading=!1,L(e,s));return!s.ended&&(s.length=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function N(e,t){if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&(t.highWaterMark=U(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function M(e,t){if(a("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,H(e)))}}function D(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(H,e))}function H(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,J(e)}function L(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(B,e,t))}function B(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function F(e){a("readable nexttick read 0"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(K,e,t))}function K(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),J(e),t.flowing&&!t.reading&&e.read(0)}function J(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function z(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function G(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(V,t,e))}function V(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Z(e,t){for(var r=0,n=e.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?G(this):D(this),null;if(0===(e=N(e,r))&&r.ended)return 0===r.length&&G(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-e0?z(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&G(this)),null!==t&&this.emit("data",t),t},R.prototype._read=function(e){k(this,new S("_read()"))},R.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?m:u;function s(e,t){a("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,d())}function u(){a("onend"),e.end()}n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=$(r);e.on("drain",c);var f=!1;function d(){a("cleanup"),e.removeListener("close",y),e.removeListener("finish",g),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",p),f=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}function p(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Z(n.pipes,e))&&!f&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){a("onerror",t),m(),e.removeListener("error",h),0===l(e,"error")&&k(e,t)}function y(){e.removeListener("finish",g),m()}function g(){a("onfinish"),e.removeListener("close",y),m()}function m(){a("unpipe"),r.unpipe(e)}return r.on("data",p),O(e,"error",h),e.once("close",y),e.once("finish",g),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},R.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?D(this):n.reading||i.nextTick(F,this)),r},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(e,t){var r=f.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(W,this),r},R.prototype.removeAllListeners=function(e){var t=f.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&i.nextTick(W,this),t},R.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},R.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){if(a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!=i)(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new A(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new b("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||q(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=h.destroy,T.prototype._undestroy=h.undestroy,T.prototype._destroy=function(e,t){t(e)}},871:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,a=r(698),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function h(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[f]=null,e[s]=null,e[u]=null,t(h(r,!1)))}}function g(e){i.nextTick(y,e)}function m(e,t){return function(r,n){e.then(function(){if(t[l])return void r(h(void 0,!0));t[d](r,n)},n)}}var b=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((n(o={get stream(){return this[p]},next:function(){var e,t=this,r=this[c];if(null!==r)return Promise.reject(r);if(this[l])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise(function(e,r){i.nextTick(function(){t[c]?r(t[c]):e(h(void 0,!0))})});var n=this[f];if(n)e=new Promise(m(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(h(o,!1));e=new Promise(this[d])}return this[f]=e,e}},Symbol.asyncIterator,function(){return this}),n(o,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){if(e)return void r(e);t(h(void 0,!0))})})}),o),b);e.exports=function(e){var t,r=Object.create(_,(n(t={},p,{value:e,writable:!0}),n(t,s,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,c,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,d,{value:function(e,t){var n=r[p].read();n?(r[f]=null,r[s]=null,r[u]=null,e(h(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[f]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];null!==t&&(r[f]=null,r[s]=null,r[u]=null,t(e)),r[c]=e;return}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[u]=null,n(h(void 0,!0))),r[l]=!0}),e.on("readable",g.bind(null,r)),r}},379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),r=this.head,n=0;r;)d(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:f,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},25:function(e){"use strict";function t(e,t){n(e,t),r(e)}function r(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.nextTick(n,this,e)):i.nextTick(n,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!o&&e?a._writableState?a._writableState.errorEmitted?i.nextTick(r,a):(a._writableState.errorEmitted=!0,i.nextTick(t,a,e)):i.nextTick(t,a,e):o?(i.nextTick(r,a),o(e)):i.nextTick(r,a)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},698:function(e,t,r){"use strict";var n=r(646).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),i=0;i0,function(t){e||(e=t),t&&o.forEach(f),a||(o.forEach(f),i(e))})});return r.reduce(d)}},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}e.exports={getHighWaterMark:function(e,t,r,o){var a=i(t,o,r);if(null!=a){if(!(isFinite(a)&&Math.floor(a)===a)||a<0)throw new n(o?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},678:function(e,t,r){e.exports=r(781)},726:function(e,t,r){var n=r(781);"disable"===i.env.READABLE_STREAM&&n?(e.exports=n.Readable,Object.assign(e.exports,n),e.exports.Stream=n):((t=e.exports=r(709)).Stream=n||t,t.Readable=t,t.Writable=r(337),t.Duplex=r(403),t.Transform=r(170),t.PassThrough=r(889),t.finished=r(698),t.pipeline=r(442))},55:function(e,t,r){var n=r(300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},813:function(e,t,n){var i=n(450),o=n(254),a=n(911),s=n(523),u=n(310),c=t;c.request=function(e,t){e="string"==typeof e?u.parse(e):a(e);var n=-1===r.g.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||n,s=e.hostname||e.host,c=e.port,l=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?o+"//"+s:"")+(c?":"+c:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var f=new i(e);return t&&f.on("response",t),f},c.get=function(e,t){var r=c.request(e,t);return r.end(),r},c.ClientRequest=i,c.IncomingMessage=o.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=s,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},301:function(e,t){var n;function i(){if(void 0!==n)return n;if(r.g.XMLHttpRequest){n=new r.g.XMLHttpRequest;try{n.open("GET",r.g.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function o(e){var t=i();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}t.fetch=a(r.g.fetch)&&a(r.g.ReadableStream),t.writableStream=a(r.g.WritableStream),t.abortController=a(r.g.AbortController),t.arraybuffer=t.fetch||o("arraybuffer"),t.msstream=!t.fetch&&o("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!i()&&a(i().overrideMimeType),n=null},450:function(e,t,n){var a=n(301),s=n(782),u=n(254),c=n(726),l=u.IncomingMessage,f=u.readyStates;function d(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":"text"}var p=e.exports=function(e){var t,r=this;c.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+o.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!a.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!a.overrideMimeType;else if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw Error("Invalid value for opts.mode");else t=!0;r._mode=d(t,n),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};function h(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}s(p,c.Writable),p.prototype.setHeader=function(e,t){var r=this,n=e.toLowerCase();-1===y.indexOf(n)&&(r._headers[n]={name:e,value:t})},p.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},p.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]},p.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,n=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(o=new Blob(e._body,{type:(n["content-type"]||{}).value||""}));var s=[];if(Object.keys(n).forEach(function(e){var t=n[e].name,r=n[e].value;Array.isArray(r)?r.forEach(function(e){s.push([t,e])}):s.push([t,r])}),"fetch"===e._mode){var u=null;if(a.abortController){var c=new AbortController;u=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=r.g.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}r.g.fetch(e._opts.url,{method:e._opts.method,headers:s,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:u}).then(function(t){e._fetchResponse=t,e._connect()},function(t){r.g.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var l=e._xhr=new r.g.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){i.nextTick(function(){e.emit("error",t)});return}"responseType"in l&&(l.responseType=e._mode),"withCredentials"in l&&(l.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),s.forEach(function(e){l.setRequestHeader(e[0],e[1])}),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case f.LOADING:case f.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||e.emit("error",Error("XHR error"))};try{l.send(o)}catch(t){i.nextTick(function(){e.emit("error",t)});return}}}},p.prototype._onXHRProgress=function(){var e=this;h(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},p.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},p.prototype._write=function(e,t,r){var n=this;n._body.push(e),r()},p.prototype.abort=p.prototype.destroy=function(){var e=this;e._destroyed=!0,r.g.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},p.prototype.end=function(e,t,r){var n=this;"function"==typeof e&&(r=e,e=void 0),c.Writable.prototype.end.call(n,e,t,r)},p.prototype.flushHeaders=function(){},p.prototype.setTimeout=function(){},p.prototype.setNoDelay=function(){},p.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},254:function(e,t,n){var a=n(301),s=n(782),u=n(726),c=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=t.IncomingMessage=function(e,t,n,s){var c=this;if(u.Readable.call(c),c._mode=n,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){i.nextTick(function(){c.emit("close")})}),"fetch"===n){if(c._fetchResponse=t,c.url=t.url,c.statusCode=t.status,c.statusMessage=t.statusText,t.headers.forEach(function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)}),a.writableStream){var l=new WritableStream({write:function(e){return new Promise(function(t,r){c._destroyed?r():c.push(o.from(e))?t():c._resumeFetch=t})},close:function(){r.g.clearTimeout(s),c._destroyed||c.push(null)},abort:function(e){c._destroyed||c.emit("error",e)}});try{t.body.pipeTo(l).catch(function(e){r.g.clearTimeout(s),c._destroyed||c.emit("error",e)});return}catch(e){}}var f=t.body.getReader();function d(){f.read().then(function(e){if(!c._destroyed){if(e.done){r.g.clearTimeout(s),c.push(null);return}c.push(o.from(e.value)),d()}}).catch(function(e){r.g.clearTimeout(s),c._destroyed||c.emit("error",e)})}d()}else if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(t[2])):void 0!==c.headers[r]?c.headers[r]+=", "+t[2]:c.headers[r]=t[2],c.rawHeaders.push(t[1],t[2])}}),c._charset="x-user-defined",!a.overrideMimeType){var p=c.rawHeaders["mime-type"];if(p){var h=p.match(/;\s*charset=([^;])(;|$)/);h&&(c._charset=h[1].toLowerCase())}c._charset||(c._charset="utf-8")}};s(l,u.Readable),l.prototype._read=function(){var e=this,t=e._resumeFetch;t&&(e._resumeFetch=null,t())},l.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text":if((n=t.responseText).length>e._pos){var i=n.substr(e._pos);if("x-user-defined"===e._charset){for(var a=o.alloc(i.length),s=0;se._pos&&(e.push(o.from(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(n)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}},704:function(e,t,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=h,this.end=y,t=4;break;case"utf8":this.fillLast=f,t=4;break;case"base64":this.text=g,this.end=m,t=3;break;default:this.write=b,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function u(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function f(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function d(e,t){var r=c(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function h(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(66117);function i(e){var t;let{url:r,error:i="default",theme:o}=e,a=`${r}/signin`,s={default:{status:200,heading:"Error",message:(0,n.h)("p",null,(0,n.h)("a",{className:"site",href:null==r?void 0:r.origin},null==r?void 0:r.host))},configuration:{status:500,heading:"Server error",message:(0,n.h)("div",null,(0,n.h)("p",null,"There is a problem with the server configuration."),(0,n.h)("p",null,"Check the server logs for more information."))},accessdenied:{status:403,heading:"Access Denied",message:(0,n.h)("div",null,(0,n.h)("p",null,"You do not have permission to sign in."),(0,n.h)("p",null,(0,n.h)("a",{className:"button",href:a},"Sign in")))},verification:{status:403,heading:"Unable to sign in",message:(0,n.h)("div",null,(0,n.h)("p",null,"The sign in link is no longer valid."),(0,n.h)("p",null,"It may have been used already or it may have expired.")),signin:(0,n.h)("a",{className:"button",href:a},"Sign in")}},{status:u,heading:c,message:l,signin:f}=null!=(t=s[i.toLowerCase()])?t:s.default;return{status:u,html:(0,n.h)("div",{className:"error"},(null==o?void 0:o.brandColor)&&(0,n.h)("style",{dangerouslySetInnerHTML:{__html:` :root { --brand-color: ${null==o?void 0:o.brandColor} } `}}),(0,n.h)("div",{className:"card"},(null==o?void 0:o.logo)&&(0,n.h)("img",{src:o.logo,alt:"Logo",className:"logo"}),(0,n.h)("h1",null,c),(0,n.h)("div",{className:"message"},l),f))}}},37619:(e,t,r)=>{let n=r(75356),{format:i}=r(5625),o=r(18877),{RPError:a,OPError:s}=r(32608),{BaseClient:u}=r(16664),{random:c,codeChallenge:l}=r(90735),f=r(58548),{resolveResponseType:d,resolveRedirectUri:p}=r(24382);function h(e,t,r={}){e?this.error(e):t?this.success(t,r):this.fail(r)}function y({client:e,params:t={},passReqToCallback:r=!1,sessionKey:i,usePKCE:a=!0,extras:s={}}={},c){if(!(e instanceof u))throw TypeError("client must be an instance of openid-client Client");if("function"!=typeof c)throw TypeError("verify callback must be a function");if(!e.issuer||!e.issuer.issuer)throw TypeError("client must have an issuer with an identifier");if(this._client=e,this._issuer=e.issuer,this._verify=c,this._passReqToCallback=r,this._usePKCE=a,this._key=i||`oidc:${n.parse(this._issuer.issuer).hostname}`,this._params=o(t),delete this._params.state,delete this._params.nonce,this._extras=o(s),this._params.response_type||(this._params.response_type=d.call(e)),this._params.redirect_uri||(this._params.redirect_uri=p.call(e)),this._params.scope||(this._params.scope="openid"),!0===this._usePKCE){let e=!!Array.isArray(this._issuer.code_challenge_methods_supported)&&this._issuer.code_challenge_methods_supported;if(e&&e.includes("S256"))this._usePKCE="S256";else if(e&&e.includes("plain"))this._usePKCE="plain";else if(e)throw TypeError("neither code_challenge_method supported by the client is supported by the issuer");else this._usePKCE="S256"}else if("string"==typeof this._usePKCE&&!["plain","S256"].includes(this._usePKCE))throw TypeError(`${this._usePKCE} is not valid/implemented PKCE code_challenge_method`);this.name=n.parse(e.issuer.issuer).hostname}y.prototype.authenticate=function(e,t){(async()=>{let r=this._client;if(!e.session)throw TypeError("authentication requires session support");let n=r.callbackParams(e),o=this._key,{0:s,length:u}=Object.keys(n);if(0===u||1===u&&"iss"===s){let n={state:c(),...this._params,...t};if(!n.nonce&&n.response_type.includes("id_token")&&(n.nonce=c()),e.session[o]=f(n,"nonce","state","max_age","response_type"),this._usePKCE&&n.response_type.includes("code")){let t=c();switch(e.session[o].code_verifier=t,this._usePKCE){case"S256":n.code_challenge=l(t),n.code_challenge_method="S256";break;case"plain":n.code_challenge=t}}this.redirect(r.authorizationUrl(n));return}let d=e.session[o];if(0===Object.keys(d||{}).length)throw Error(i('did not find expected authorization request details in session, req.session["%s"] is %j',o,d));let{state:p,nonce:y,max_age:g,code_verifier:m,response_type:b}=d;try{delete e.session[o]}catch(e){}let _={redirect_uri:this._params.redirect_uri,...t},v={state:p,nonce:y,max_age:g,code_verifier:m,response_type:b},w=await r.callback(_.redirect_uri,n,v,this._extras),E=this._passReqToCallback,S=this._verify.length>(E?3:2)&&r.issuer.userinfo_endpoint,A=[w,h.bind(this)];if(S){if(!w.access_token)throw new a({message:"expected access_token to be returned when asking for userinfo in verify callback",tokenset:w});let e=await r.userinfo(w);A.splice(1,0,e)}E&&A.unshift(e),this._verify(...A)})().catch(e=>{e instanceof s&&"server_error"!==e.error&&!e.error.startsWith("invalid")||e instanceof a?this.fail(e):this.error(e)})},e.exports=y},38741:(e,t,r)=>{let n=r(92206),i=r(18877),o=r(19364),a=Symbol(),s=(e,{alg:t,use:r})=>{let n=0;return t&&e.alg&&n++,r&&e.use&&n++,n};function u(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:return}}function c(e,t,r,i){if(t)return new Set([t]);switch(r){case"EC":{let t=[];if(("enc"===e||void 0===e)&&(t=t.concat(["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"])),"sig"===e||void 0===e)switch(i){case"P-256":case"P-384":t=t.concat([`ES${i.slice(-3)}`]);break;case"P-521":t=t.concat(["ES512"]);break;case"secp256k1":"node:crypto"===n.cryptoRuntime&&(t=t.concat(["ES256K"]))}return new Set(t)}case"OKP":return new Set(["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"]);case"RSA":{let t=[];return("enc"===e||void 0===e)&&(t=t.concat(["RSA-OAEP","RSA-OAEP-256","RSA-OAEP-384","RSA-OAEP-512"]),"node:crypto"===n.cryptoRuntime&&(t=t.concat(["RSA1_5"]))),("sig"===e||void 0===e)&&(t=t.concat(["PS256","PS384","PS512","RS256","RS384","RS512"])),new Set(t)}default:throw Error("unreachable")}}e.exports=class{#c;constructor(e,t){if(e!==a)throw Error("invalid constructor call");this.#c=t}toJWKS(){return{keys:this.map(({jwk:{d:e,p:t,q:r,dp:n,dq:i,qi:o,...a}})=>a)}}all({alg:e,kid:t,use:r}={}){if(!r||!e)throw Error();let n=u(e),i={alg:e,use:r};return this.filter(i=>{let o=!0;return void 0!==n&&i.jwk.kty!==n&&(o=!1),o&&void 0!==t&&i.jwk.kid!==t&&(o=!1),o&&void 0!==r&&void 0!==i.jwk.use&&i.jwk.use!==r&&(o=!1),o&&i.jwk.alg&&i.jwk.alg!==e?o=!1:i.algorithms.has(e)||(o=!1),o}).sort((e,t)=>s(t,i)-s(e,i))}get(...e){return this.all(...e)[0]}static async fromJWKS(e,{onlyPublic:t=!1,onlyPrivate:r=!1}={}){if(!o(e)||!Array.isArray(e.keys)||e.keys.some(e=>!o(e)||!("kty"in e)))throw TypeError("jwks must be a JSON Web Key Set formatted object");let s=[];for(let o of e.keys){let{kty:e,kid:a,crv:u}=o=i(o),{alg:l,use:f}=o;if("string"==typeof e&&e&&(void 0===f||"sig"===f||"enc"===f)&&("string"==typeof l||void 0===l)&&("string"==typeof a||void 0===a)){if("EC"===e&&"sig"===f)switch(u){case"P-256":l="ES256";break;case"P-384":l="ES384";break;case"P-521":l="ES512"}if("secp256k1"===u&&(f="sig",l="ES256K"),"OKP"===e)switch(u){case"Ed25519":case"Ed448":f="sig",l="EdDSA";break;case"X25519":case"X448":f="enc"}if(l&&!f)switch(!0){case l.startsWith("ECDH"):case l.startsWith("RSA"):f="enc"}if(r&&("oct"===o.kty||!o.d))throw Error("jwks must only contain private keys");t&&(o.d||o.k)||s.push({jwk:{...o,alg:l,use:f},async keyObject(e){if(this[e])return this[e];let t=await n.importJWK(this.jwk,e);return this[e]=t,t},get algorithms(){return Object.defineProperty(this,"algorithms",{value:c(this.jwk.use,this.jwk.alg,this.jwk.kty,this.jwk.crv),enumerable:!0,configurable:!1}),this.algorithms}})}}return new this(a,s)}filter(...e){return this.#c.filter(...e)}find(...e){return this.#c.find(...e)}every(...e){return this.#c.every(...e)}some(...e){return this.#c.some(...e)}map(...e){return this.#c.map(...e)}forEach(...e){return this.#c.forEach(...e)}reduce(...e){return this.#c.reduce(...e)}sort(...e){return this.#c.sort(...e)}*[Symbol.iterator](){for(let e of this.#c)yield e}}},39439:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DynamicServerError:function(){return n},isDynamicServerError:function(){return i}});let r="DYNAMIC_SERVER_USAGE";class n extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=r}}function i(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},40021:(e,t,r)=>{"use strict";var n=r(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=n(r(49461)),o=n(r(69359)),a=n(r(51792));async function s(e){let{options:t,query:r,body:n}=e,{url:s,callbacks:u,logger:c,provider:l}=t;if(!l.type)return{status:500,text:`Error: Type not specified for ${l.name}`};if("oauth"===l.type)try{return await (0,i.default)({options:t,query:r})}catch(e){return c.error("SIGNIN_OAUTH_ERROR",{error:e,providerId:l.id}),{redirect:`${s}/error?error=OAuthSignin`}}if("email"===l.type){var f;let e=null==n?void 0:n.email;if(!e)return{redirect:`${s}/error?error=EmailSignin`};let r=null!=(f=l.normalizeIdentifier)?f:e=>{let[t,r]=e.toLowerCase().trim().split("@");return r=r.split(",")[0],`${t}@${r}`};try{e=r(null==n?void 0:n.email)}catch(e){return c.error("SIGNIN_EMAIL_ERROR",{error:e,providerId:l.id}),{redirect:`${s}/error?error=EmailSignin`}}let i=await (0,a.default)({email:e,adapter:t.adapter}),d={providerAccountId:e,userId:e,type:"email",provider:l.id};try{let e=await u.signIn({user:i,account:d,email:{verificationRequest:!0}});if(!e)return{redirect:`${s}/error?error=AccessDenied`};if("string"==typeof e)return{redirect:e}}catch(e){return{redirect:`${s}/error?${new URLSearchParams({error:e})}`}}try{return{redirect:await (0,o.default)(e,t)}}catch(e){return c.error("SIGNIN_EMAIL_ERROR",{error:e,providerId:l.id}),{redirect:`${s}/error?error=EmailSignin`}}}return{redirect:`${s}/signin`}}},41525:(e,t,r)=>{var n="/";!function(){var t={55:function(e,t,r){var n=r(300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},300:function(e){"use strict";e.exports=r(44134)}},i={};function o(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}},a=!0;try{t[e](n,n.exports,o),a=!1}finally{a&&delete i[e]}return n.exports}o.ab=n+"/";var a={};!function(){"use strict";var e=a,t=o(55).Buffer,r=t.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var i=n(e);if("string"!=typeof i&&(t.isEncoding===r||!r(e)))throw Error("Unknown encoding: "+e);return i||e}function s(e){var r;switch(this.encoding=i(e),this.encoding){case"utf16le":this.text=h,this.end=y,r=4;break;case"utf8":this.fillLast=f,r=4;break;case"base64":this.text=g,this.end=m,r=3;break;default:this.write=b,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(r)}function u(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function f(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function d(e,t){var r=c(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function h(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):""}e.StringDecoder=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},44134:(e,t,r)=>{"use strict";let n=r(57719),i=r(7610),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=v,t.INSPECT_MAX_BYTES=50;let a=0x7fffffff;function s(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}function u(e){if(e>a)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return p(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return h(e,t);if(ArrayBuffer.isView(e))return g(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ea(e,ArrayBuffer)||e&&ea(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(ea(e,SharedArrayBuffer)||e&&ea(e.buffer,SharedArrayBuffer)))return m(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);let i=b(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function d(e,t,r){return(f(e),e<=0)?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}function p(e){return f(e),u(e<0?0:0|_(e))}function h(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!c.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|w(e,t),n=u(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function y(e){let t=e.length<0?0:0|_(e.length),r=u(t);for(let n=0;n=a)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function v(e){return+e!=e&&(e=0),c.alloc(+e)}function w(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ea(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ei(e).length;default:if(i)return n?-1:et(e).length;t=(""+t).toLowerCase(),i=!0}}function E(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return j(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),es(r*=1)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:k(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return k(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function k(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;no&&(n=o):n=o;let a=t.length;for(n>a/2&&(n=a/2),i=0;i239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(o=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],(192&r)==128&&(192&n)==128&&(192&s)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return U(n)}t.kMaxLength=0x7fffffff,c.TYPED_ARRAY_SUPPORT=s(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return d(e,t,r)},c.allocUnsafe=function(e){return p(e)},c.allocUnsafeSlow=function(e){return p(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(ea(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),ea(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(c.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},c.byteLength=w,c.prototype._isBuffer=!0,c.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(ea(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,a=r-t,s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return O(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return R(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,r);default:if(o)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let I=4096;function U(e){let t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let n=t;nr)throw RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,i,o){if(!c.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw RangeError("Index out of range")}function $(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(0xffffffff));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function W(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(0xffffffff));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function F(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function q(e,t,r,n,o){return t*=1,r>>>=0,o||F(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,o){return t*=1,r>>>=0,o||F(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=ec(function(e){X(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Y(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Y(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||L(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return(e>>>=0,t||L(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=ec(function(e){X(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Y(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Y(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<>>=0,t||L(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;B(this,e,t,r,n,0)}let i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;B(this,e,t,r,n,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=ec(function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=ec(function(e,t=0){return W(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);B(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i>>=0,!n){let n=Math.pow(2,8*r-1);B(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||B(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=ec(function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=ec(function(e,t=0){return W(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r){X(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&Y(t,e.length-(r+1))}function Z(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(o+1)*8}${i}`:`>= -(2${i} ** ${(o+1)*8-1}${i}) and < 2 ** ${(o+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new J.ERR_OUT_OF_RANGE("value",n,e)}V(n,i,o)}function X(e,t){if("number"!=typeof e)throw new J.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,r){if(Math.floor(e)!==e)throw X(e,r),new J.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new J.ERR_BUFFER_OUT_OF_BOUNDS;throw new J.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),z("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=G(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=G(i)),i+="n"),n+=` It must be ${t}. Received ${i}`},RangeError);let Q=/[^+/0-9A-Za-z-_]/g;function ee(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function et(e,t){let r;t=t||1/0;let n=e.length,i=null,o=[];for(let a=0;a55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function er(e){let t=[];for(let r=0;r>8,i.push(r%256),i.push(n);return i}function ei(e){return n.toByteArray(ee(e))}function eo(e,t,r,n){let i;for(i=0;i=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function ea(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function es(e){return e!=e}let eu=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function ec(e){return"undefined"==typeof BigInt?el:e}function el(){throw Error("BigInt not supported")}},44187:e=>{"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let u of n(o))i.call(e,u)||u===a||t(e,u,{get:()=>o[u],enumerable:!(s=r(o,u))||s.enumerable});return e},a=e=>o(t({},"__esModule",{value:!0}),e),s={};function u(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function c(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function l(e){if(!e)return;let[[t,r],...n]=c(e),{domain:i,expires:o,httponly:a,maxage:s,path:u,samesite:l,secure:d,partitioned:h,priority:g}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));return f({name:t,value:decodeURIComponent(r),domain:i,...o&&{expires:new Date(o)},...a&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:u,...l&&{sameSite:p(l)},...d&&{secure:!0},...g&&{priority:y(g)},...h&&{partitioned:!0}})}function f(e){let t={};for(let r in e)e[r]&&(t[r]=e[r]);return t}((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(s,{RequestCookies:()=>m,ResponseCookies:()=>b,parseCookie:()=>c,parseSetCookie:()=>l,stringifyCookie:()=>u}),e.exports=a(s);var d=["strict","lax","none"];function p(e){return e=e.toLowerCase(),d.includes(e)?e:void 0}var h=["low","medium","high"];function y(e){return e=e.toLowerCase(),h.includes(e)?e:void 0}function g(e){if(!e)return[];var t,r,n,i,o,a=[],s=0;function u(){for(;s=e.length)&&a.push(e.substring(t,e.length))}return a}var m=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of c(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>u(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>u(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},b=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(i)?i:g(i)){let t=l(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,v({name:t,value:r,...n})),_(i,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(u).join("; ")}};function _(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=u(r);t.append("set-cookie",e)}}function v(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}},44536:(e,t)=>{"use strict";function r(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isHangingPromiseRejectionError:function(){return r},makeHangingPromise:function(){return a}});let n="HANGING_PROMISE_REJECTION";class i extends Error{constructor(e){super(`During prerendering, ${e} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${e} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context.`),this.expression=e,this.digest=n}}let o=new WeakMap;function a(e,t){if(e.aborted)return Promise.reject(new i(t));{let r=new Promise((r,n)=>{let a=n.bind(null,new i(t)),s=o.get(e);if(s)s.push(a);else{let t=[a];o.set(e,t),e.addEventListener("abort",()=>{for(let e=0;e{e.exports=function(){return':root{--border-width:1px;--border-radius:0.5rem;--color-error:#c94b4b;--color-info:#157efb;--color-info-hover:#0f6ddb;--color-info-text:#fff}.__next-auth-theme-auto,.__next-auth-theme-light{--color-background:#ececec;--color-background-hover:hsla(0,0%,93%,.8);--color-background-card:#fff;--color-text:#000;--color-primary:#444;--color-control-border:#bbb;--color-button-active-background:#f9f9f9;--color-button-active-border:#aaa;--color-separator:#ccc}.__next-auth-theme-dark{--color-background:#161b22;--color-background-hover:rgba(22,27,34,.8);--color-background-card:#0d1117;--color-text:#fff;--color-primary:#ccc;--color-control-border:#555;--color-button-active-background:#060606;--color-button-active-border:#666;--color-separator:#444}@media (prefers-color-scheme:dark){.__next-auth-theme-auto{--color-background:#161b22;--color-background-hover:rgba(22,27,34,.8);--color-background-card:#0d1117;--color-text:#fff;--color-primary:#ccc;--color-control-border:#555;--color-button-active-background:#060606;--color-button-active-border:#666;--color-separator:#444}a.button,button{background-color:var(--provider-dark-bg,var(--color-background));color:var(--provider-dark-color,var(--color-primary))}a.button:hover,button:hover{background-color:var(--provider-dark-bg-hover,var(--color-background-hover))!important}#provider-logo{display:none!important}#provider-logo-dark{display:block!important;width:25px}}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit;margin:0;padding:0}body{background-color:var(--color-background);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;margin:0;padding:0}h1{font-weight:400}h1,p{color:var(--color-text);margin-bottom:1.5rem;padding:0 1rem}form{margin:0;padding:0}label{font-weight:500;margin-bottom:.25rem;text-align:left}input[type],label{color:var(--color-text);display:block}input[type]{background:var(--color-background-card);border:var(--border-width) solid var(--color-control-border);border-radius:var(--border-radius);box-sizing:border-box;font-size:1rem;padding:.5rem 1rem;width:100%}input[type]:focus{box-shadow:none}p{font-size:1.1rem;line-height:2rem}a.button{line-height:1rem;text-decoration:none}a.button:link,a.button:visited{background-color:var(--color-background);color:var(--color-primary)}button span{flex-grow:1}a.button,button{align-items:center;background-color:var(--provider-bg);border-color:rgba(0,0,0,.1);border-radius:var(--border-radius);color:var(--provider-color,var(--color-primary));display:flex;font-size:1.1rem;font-weight:500;justify-content:center;min-height:62px;padding:.75rem 1rem;position:relative;transition:all .1s ease-in-out}a.button:hover,button:hover{background-color:var(--provider-bg-hover,var(--color-background-hover));cursor:pointer}a.button:active,button:active{cursor:pointer}a.button #provider-logo,button #provider-logo{display:block;width:25px}a.button #provider-logo-dark,button #provider-logo-dark{display:none}#submitButton{background-color:var(--brand-color,var(--color-info));color:var(--button-text-color,var(--color-info-text));width:100%}#submitButton:hover{background-color:var(--button-hover-bg,var(--color-info-hover))!important}a.site{color:var(--color-primary);font-size:1rem;line-height:2rem;text-decoration:none}a.site:hover{text-decoration:underline}.page{box-sizing:border-box;display:grid;height:100%;margin:0;padding:0;place-items:center;position:absolute;width:100%}.page>div{text-align:center}.error a.button{margin-top:.5rem;padding-left:2rem;padding-right:2rem}.error .message{margin-bottom:1.5rem}.signin input[type=text]{display:block;margin-left:auto;margin-right:auto}.signin hr{border:0;border-top:1px solid var(--color-separator);display:block;margin:2rem auto 1rem;overflow:visible}.signin hr:before{background:var(--color-background-card);color:#888;content:"or";padding:0 .4rem;position:relative;top:-.7rem}.signin .error{background:#f5f5f5;background:var(--color-error);border-radius:.3rem;font-weight:500}.signin .error p{color:var(--color-info-text);font-size:.9rem;line-height:1.2rem;padding:.5rem 1rem;text-align:left}.signin form,.signin>div{display:block}.signin form input[type],.signin>div input[type]{margin-bottom:.5rem}.signin form button,.signin>div button{width:100%}.signin .provider+.provider{margin-top:1rem}.logo{display:inline-block;margin:1.25rem 0;max-height:70px;max-width:150px}.card{background-color:var(--color-background-card);border-radius:2rem;padding:1.25rem 2rem}.card .header{color:var(--color-primary)}.section-header{color:var(--color-text)}@media screen and (min-width:450px){.card{margin:2rem 0;width:368px}}@media screen and (max-width:450px){.card{margin:1rem 0;width:343px}}'}},46755:(e,t,r)=>{let n;var i=r(44134).Buffer;if(i.isEncoding("base64url"))n=(e,t="utf8")=>i.from(e,t).toString("base64url");else{let e=e=>e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");n=(t,r="utf8")=>e(i.from(t,r).toString("base64"))}let o=e=>i.from(e,"base64");e.exports.decode=o,e.exports.encode=n},49461:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(91023),i=r(91949),o=s(r(54229));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&({}).hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}async function u({options:e,query:t}){var r,a,s;let{logger:u,provider:c}=e,l={};if("string"==typeof c.authorization){let e=Object.fromEntries(new URL(c.authorization).searchParams);l={...l,...e}}else l={...l,...null==(a=c.authorization)?void 0:a.params};if(l={...l,...t},null!=(r=c.version)&&r.startsWith("1.")){let t=(0,i.oAuth1Client)(e),r=await t.getOAuthRequestToken(l),n=`${null==(s=c.authorization)?void 0:s.url}?${new URLSearchParams({oauth_token:r.oauth_token,oauth_token_secret:r.oauth_token_secret,...r.params})}`;return i.oAuth1TokenStore.set(r.oauth_token,r.oauth_token_secret),u.debug("GET_AUTHORIZATION_URL",{url:n,provider:c}),{redirect:n}}let f=await (0,n.openidClient)(e),d=l,p=[];await o.state.create(e,p,d),await o.pkce.create(e,p,d),await o.nonce.create(e,p,d);let h=f.authorizationUrl(d);return u.debug("GET_AUTHORIZATION_URL",{url:h,cookies:p,provider:c}),{redirect:h,cookies:p}}},51792:(e,t)=>{"use strict";async function r({email:e,adapter:t}){let{getUserByEmail:r}=t,n=e?await r(e):null;return n||{id:e,email:e,emailVerified:null}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},52039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"afterTaskAsyncStorage",{enumerable:!0,get:function(){return n.afterTaskAsyncStorageInstance}});let n=r(99422)},52491:e=>{!function(t){e.exports=t()}(function(){return(function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u=void 0;if(!s&&u)return require(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){return i(t[a][1][e]||e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var o=void 0,a=0;a>16),l((65280&n)>>8),l(255&n);return 2==o?l(255&(n=c(e.charAt(r))<<2|c(e.charAt(r+1))>>4)):1==o&&(l((n=c(e.charAt(r))<<10|c(e.charAt(r+1))<<4|c(e.charAt(r+2))>>2)>>8&255),l(255&n)),a},e.fromByteArray=function(e){var t,r,n,i,o=e.length%3,a="";function s(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,n=e.length-o;t>18&63)+s(i>>12&63)+s(i>>6&63)+s(63&i);switch(o){case 1:a+=s((r=e[e.length-1])>>2),a+=s(r<<4&63),a+="==";break;case 2:a+=s((r=(e[e.length-2]<<8)+e[e.length-1])>>10),a+=s(r>>4&63),a+=s(r<<2&63),a+="="}return a}}(void 0===r?this.base64js={}:r)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,r){(function(t,n,i,o,a,s,u,c,l){var f=e("base64-js"),d=e("ieee754");function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var n,o,a,s,u,c=typeof e;if("base64"===t&&"string"==c)for(e=(n=e).trim?n.trim():n.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==c)o=P(e);else if("string"==c)o=i.byteLength(e,t);else{if("object"!=c)throw Error("First argument needs to be a number, array or string.");o=P(e.length)}if(i._useTypedArrays?a=i._augment(new Uint8Array(o)):((a=this).length=o,a._isBuffer=!0),i._useTypedArrays&&"number"==typeof e.byteLength)a._set(e);else if(j(u=e)||i.isBuffer(u)||u&&"object"==typeof u&&"number"==typeof u.length)for(s=0;s>8,n.push(t%256),n.push(r);return n}(t),e,r,n)}function y(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i>>0)):(t+1>>0),i}function b(e,t,r,n){if(n||(B("boolean"==typeof r,"missing or invalid endian"),B(null!=t,"missing offset"),B(t+1>>8*(n?a:1-a)}function S(e,t,r,n,i){i||(B(null!=t,"missing value"),B("boolean"==typeof n,"missing or invalid endian"),B(null!=r,"missing offset"),B(r+3>>8*(n?a:3-a)&255}function A(e,t,r,n,i){i||(B(null!=t,"missing value"),B("boolean"==typeof n,"missing or invalid endian"),B(null!=r,"missing offset"),B(r+1this.length&&(n=this.length),e.length-t=this.length))return this[e]},i.prototype.readUInt16LE=function(e,t){return g(this,e,!0,t)},i.prototype.readUInt16BE=function(e,t){return g(this,e,!1,t)},i.prototype.readUInt32LE=function(e,t){return m(this,e,!0,t)},i.prototype.readUInt32BE=function(e,t){return m(this,e,!1,t)},i.prototype.readInt8=function(e,t){if(t||(B(null!=e,"missing offset"),B(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){return b(this,e,!0,t)},i.prototype.readInt16BE=function(e,t){return b(this,e,!1,t)},i.prototype.readInt32LE=function(e,t){return _(this,e,!0,t)},i.prototype.readInt32BE=function(e,t){return _(this,e,!1,t)},i.prototype.readFloatLE=function(e,t){return v(this,e,!0,t)},i.prototype.readFloatBE=function(e,t){return v(this,e,!1,t)},i.prototype.readDoubleLE=function(e,t){return w(this,e,!0,t)},i.prototype.readDoubleBE=function(e,t){return w(this,e,!1,t)},i.prototype.writeUInt8=function(e,t,r){r||(B(null!=e,"missing value"),B(null!=t,"missing offset"),B(t=this.length||(this[t]=e)},i.prototype.writeUInt16LE=function(e,t,r){E(this,e,t,!0,r)},i.prototype.writeUInt16BE=function(e,t,r){E(this,e,t,!1,r)},i.prototype.writeUInt32LE=function(e,t,r){S(this,e,t,!0,r)},i.prototype.writeUInt32BE=function(e,t,r){S(this,e,t,!1,r)},i.prototype.writeInt8=function(e,t,r){r||(B(null!=e,"missing value"),B(null!=t,"missing offset"),B(t=this.length||(0<=e?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},i.prototype.writeInt16LE=function(e,t,r){A(this,e,t,!0,r)},i.prototype.writeInt16BE=function(e,t,r){A(this,e,t,!1,r)},i.prototype.writeInt32LE=function(e,t,r){k(this,e,t,!0,r)},i.prototype.writeInt32BE=function(e,t,r){k(this,e,t,!1,r)},i.prototype.writeFloatLE=function(e,t,r){x(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){x(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){O(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){O(this,e,t,!1,r)},i.prototype.fill=function(e,t,r){if(e=e||0,t=t||0,r=r||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),B("number"==typeof e&&!isNaN(e),"value is not a number"),B(t<=r,"end < start"),r!==t&&0!==this.length){B(0<=t&&t"},i.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw Error("Buffer.toArrayBuffer not supported in this browser");if(i._useTypedArrays)return new i(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;t=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function D(e,t){B("number"==typeof e,"cannot write a non-number as a number"),B(0<=e,"specified a negative value for writing an unsigned value"),B(e<=t,"value is larger than maximum value for type"),B(Math.floor(e)===e,"value has a fractional component")}function H(e,t,r){B("number"==typeof e,"cannot write a non-number as a number"),B(e<=t,"value larger than maximum allowed value"),B(r<=e,"value smaller than minimum allowed value"),B(Math.floor(e)===e,"value has a fractional component")}function L(e,t,r){B("number"==typeof e,"cannot write a non-number as a number"),B(e<=t,"value larger than maximum allowed value"),B(r<=e,"value smaller than minimum allowed value")}function B(e,t){if(!e)throw Error(t||"Failed assertion")}i._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=T.get,e.set=T.set,e.write=T.write,e.toString=T.toString,e.toLocaleString=T.toString,e.toJSON=T.toJSON,e.copy=T.copy,e.slice=T.slice,e.readUInt8=T.readUInt8,e.readUInt16LE=T.readUInt16LE,e.readUInt16BE=T.readUInt16BE,e.readUInt32LE=T.readUInt32LE,e.readUInt32BE=T.readUInt32BE,e.readInt8=T.readInt8,e.readInt16LE=T.readInt16LE,e.readInt16BE=T.readInt16BE,e.readInt32LE=T.readInt32LE,e.readInt32BE=T.readInt32BE,e.readFloatLE=T.readFloatLE,e.readFloatBE=T.readFloatBE,e.readDoubleLE=T.readDoubleLE,e.readDoubleBE=T.readDoubleBE,e.writeUInt8=T.writeUInt8,e.writeUInt16LE=T.writeUInt16LE,e.writeUInt16BE=T.writeUInt16BE,e.writeUInt32LE=T.writeUInt32LE,e.writeUInt32BE=T.writeUInt32BE,e.writeInt8=T.writeInt8,e.writeInt16LE=T.writeInt16LE,e.writeInt16BE=T.writeInt16BE,e.writeInt32LE=T.writeInt32LE,e.writeInt32BE=T.writeInt32BE,e.writeFloatLE=T.writeFloatLE,e.writeFloatBE=T.writeFloatBE,e.writeDoubleLE=T.writeDoubleLE,e.writeDoubleBE=T.writeDoubleBE,e.fill=T.fill,e.inspect=T.inspect,e.toArrayBuffer=T.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(e,t,r){(function(r,n,i,o,a,s,u,c,l){var i=e("buffer").Buffer,f=4,d=new i(4);d.fill(0),t.exports={hash:function(e,t,r,n){return i.isBuffer(e)||(e=new i(e)),function(e,t,r){for(var n=new i(t),o=r?n.writeInt32BE:n.writeInt32LE,a=0;ay?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var r=0x67452301,n=-0x10325477,i=-0x67452302,o=0x10325476,a=0;a>>32-s,r)}function h(e,t,r,n,i,o,a){return p(t&r|~t&n,e,t,i,o,a)}function y(e,t,r,n,i,o,a){return p(t&n|r&~n,e,t,i,o,a)}function g(e,t,r,n,i,o,a){return p(t^r^n,e,t,i,o,a)}function m(e,t,r,n,i,o,a){return p(r^(t|~n),e,t,i,o,a)}function b(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return f.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,t,r){(function(e,r,n,i,o,a,s,u,c){var l,f;f=function(e){for(var t,r=Array(e),n=0;n>>((3&n)<<3)&255;return r},t.exports=l||f}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(e,t,r){(function(r,n,i,o,a,s,u,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,i,o,a,s=Array(80),u=0x67452301,c=-0x10325477,l=-0x67452302,f=0x10325476,d=-0x3c2d1e10,y=0;y>16)+(t>>16)+(r>>16)<<16|65535&r}function h(e,t){return e<>>32-t}t.exports=function(e){return f.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(e,t,r){(function(r,n,i,o,a,s,u,c,l){function f(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function d(e,t){return e>>>t|e<<32-t}function p(e,t){var r,n,i,o,a,s,u,c,l,p,h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],y=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],g=Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var m,b,_,v,w,E,S,A,k=0;k>>10,g[x-7]),d(S=g[x-15],7)^d(S,18)^S>>>3),g[x-16]),l=f(f(f(f(c,d(E=a,6)^d(E,11)^d(E,25)),(w=a)&s^~w&u),h[x]),g[x]),p=f(d(v=r,2)^d(v,13)^d(v,22),(m=r)&(b=n)^m&(_=i)^b&_),c=u,u=s,s=a,a=f(o,l),o=i,i=n,n=r,r=f(l,p);y[0]=f(r,y[0]),y[1]=f(n,y[1]),y[2]=f(i,y[2]),y[3]=f(o,y[3]),y[4]=f(a,y[4]),y[5]=f(s,y[5]),y[6]=f(u,y[6]),y[7]=f(c,y[7])}return y}var h=e("./helpers");t.exports=function(e){return h.hash(e,p,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,t,r){(function(e,r,n,i,o,a,s,u,c){function l(){}(e=t.exports={}).nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0>1,l=-7,f=r?i-1:0,d=r?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-l)-1,p>>=-l,l+=s;0>=-l,l+=n;0>1,d=5960464477539062e-23*(23===i),p=n?0:o-1,h=n?1:-1,y=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+f?d/u:d*Math.pow(2,1-f))*u&&(a++,u/=2),l<=a+f?(s=0,a=l):1<=a+f?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));8<=i;e[r+p]=255&s,p+=h,s/=256,i-=8);for(a=a<{"use strict";e.exports=JSON.parse('{"name":"openid-client","version":"5.7.1","description":"OpenID Connect Relying Party (RP, Client) implementation for Node.js runtime, supports passportjs","keywords":["auth","authentication","basic","certified","client","connect","dynamic","electron","hybrid","identity","implicit","oauth","oauth2","oidc","openid","passport","relying party","strategy"],"homepage":"https://github.com/panva/openid-client","repository":"panva/openid-client","funding":{"url":"https://github.com/sponsors/panva"},"license":"MIT","author":"Filip Skokan ","exports":{"types":"./types/index.d.ts","import":"./lib/index.mjs","require":"./lib/index.js"},"main":"./lib/index.js","types":"./types/index.d.ts","files":["lib","types/index.d.ts"],"scripts":{"format":"npx prettier --loglevel silent --write ./lib ./test ./certification ./types","test":"mocha test/**/*.test.js"},"dependencies":{"jose":"^4.15.9","lru-cache":"^6.0.0","object-hash":"^2.2.0","oidc-token-hash":"^5.0.3"},"devDependencies":{"@types/node":"^16.18.106","@types/passport":"^1.0.16","base64url":"^3.0.1","chai":"^4.5.0","mocha":"^10.7.3","nock":"^13.5.5","prettier":"^2.8.8","readable-mock-req":"^0.2.2","sinon":"^9.2.4","timekeeper":"^2.3.1"},"standard-version":{"scripts":{"postchangelog":"sed -i \'\' -e \'s/### \\\\[/## [/g\' CHANGELOG.md"},"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Fixes"},{"type":"chore","hidden":true},{"type":"docs","hidden":true},{"type":"style","hidden":true},{"type":"refactor","section":"Refactor","hidden":false},{"type":"perf","section":"Performance","hidden":false},{"type":"test","hidden":true}]}}')},54229:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pkce=t.nonce=t.PKCE_CODE_CHALLENGE_METHOD=void 0,t.signCookie=s,t.state=void 0;var n=r(27793),i=a(r(2454));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&({}).hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}async function s(e,t,r,n){let{cookies:o,logger:a}=n;a.debug(`CREATE_${e.toUpperCase()}`,{value:t,maxAge:r});let{name:s}=o[e],u=new Date;return u.setTime(u.getTime()+1e3*r),{name:s,value:await i.encode({...n.jwt,maxAge:r,token:{value:t},salt:s}),options:{...o[e].options,expires:u}}}let u=900,c=t.PKCE_CODE_CHALLENGE_METHOD="S256";t.pkce={async create(e,t,r){var i,o;if(!(null!=(i=e.provider)&&null!=(i=i.checks)&&i.includes("pkce")))return;let a=n.generators.codeVerifier();r.code_challenge=n.generators.codeChallenge(a),r.code_challenge_method=c;let l=null!=(o=e.cookies.pkceCodeVerifier.options.maxAge)?o:u;t.push(await s("pkceCodeVerifier",a,l,e))},async use(e,t,r,n){var o;if(!(null!=(o=r.provider)&&null!=(o=o.checks)&&o.includes("pkce")))return;let a=null==e?void 0:e[r.cookies.pkceCodeVerifier.name];if(!a)throw TypeError("PKCE code_verifier cookie was missing.");let{name:s}=r.cookies.pkceCodeVerifier,u=await i.decode({...r.jwt,token:a,salt:s});if(!(null!=u&&u.value))throw TypeError("PKCE code_verifier value could not be parsed.");t.push({name:s,value:"",options:{...r.cookies.pkceCodeVerifier.options,maxAge:0}}),n.code_verifier=u.value}};let l=900;t.state={async create(e,t,r){var i,o;if(!(null!=(i=e.provider.checks)&&i.includes("state")))return;let a=n.generators.state();r.state=a;let u=null!=(o=e.cookies.state.options.maxAge)?o:l;t.push(await s("state",a,u,e))},async use(e,t,r,n){var o;if(!(null!=(o=r.provider.checks)&&o.includes("state")))return;let a=null==e?void 0:e[r.cookies.state.name];if(!a)throw TypeError("State cookie was missing.");let{name:s}=r.cookies.state,u=await i.decode({...r.jwt,token:a,salt:s});if(!(null!=u&&u.value))throw TypeError("State value could not be parsed.");t.push({name:s,value:"",options:{...r.cookies.state.options,maxAge:0}}),n.state=u.value}};let f=900;t.nonce={async create(e,t,r){var i,o;if(!(null!=(i=e.provider.checks)&&i.includes("nonce")))return;let a=n.generators.nonce();r.nonce=a;let u=null!=(o=e.cookies.nonce.options.maxAge)?o:f;t.push(await s("nonce",a,u,e))},async use(e,t,r,n){var o;if(!(null!=(o=r.provider)&&null!=(o=o.checks)&&o.includes("nonce")))return;let a=null==e?void 0:e[r.cookies.nonce.name];if(!a)throw TypeError("Nonce cookie was missing.");let{name:s}=r.cookies.nonce,u=await i.decode({...r.jwt,token:a,salt:s});if(!(null!=u&&u.value))throw TypeError("Nonce value could not be parsed.");t.push({name:s,value:"",options:{...r.cookies.nonce.options,maxAge:0}}),n.nonce=u.value}}},54340:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultCallbacks=void 0,t.defaultCallbacks={signIn:()=>!0,redirect:({url:e,baseUrl:t})=>e.startsWith("/")?`${t}${e}`:new URL(e).origin===t?e:t,session:({session:e})=>e,jwt:({token:e})=>e}},54357:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l,hkdf:()=>l});let n=()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw Error("unable to locate global object")},i=async(e,t,r,i,o)=>{let{crypto:{subtle:a}}=n();return new Uint8Array(await a.deriveBits({name:"HKDF",hash:`SHA-${e.substr(3)}`,salt:r,info:i},await a.importKey("raw",t,"HKDF",!1,["deriveBits"]),o<<3))};function o(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw TypeError('unsupported "digest" value')}}function a(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}function s(e){let t=a(e,"ikm");if(!t.byteLength)throw TypeError('"ikm" must be at least one byte in length');return t}function u(e){let t=a(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}function c(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}async function l(e,t,r,n,l){return i(o(e),s(t),a(r,"salt"),u(n),c(l,e))}},57719:(e,t)=>{"use strict";t.byteLength=c,t.toByteArray=f,t.fromByteArray=h;for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function c(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n}function l(e,t,r){return(t+r)*3/4-r}function f(e){var t,r,o=u(e),a=o[0],s=o[1],c=new i(l(e,a,s)),f=0,d=s>0?a-4:a;for(r=0;r>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c}function d(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function p(e,t,r){for(var n=[],i=t;iu?u:s+a));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")}n[45]=62,n[95]=63},58107:(e,t,r)=>{let n=r(19364);function i(e,t,...r){for(let o of r)if(n(o))for(let[r,a]of Object.entries(o))"__proto__"!==r&&"constructor"!==r&&(void 0===t[r]&&void 0!==a&&(t[r]=a),e&&n(t[r])&&n(a)&&i(!0,t[r],a));return t}e.exports=i.bind(void 0,!1),e.exports.deep=i.bind(void 0,!0)},58548:e=>{e.exports=function(e,...t){let r={};for(let n of t)void 0!==e[n]&&(r[n]=e[n]);return r}},61107:(e,t)=>{"use strict";function r(e){return{headers:[{key:"Content-Type",value:"application/json"}],body:e.reduce((e,{id:t,name:r,type:n,signinUrl:i,callbackUrl:o})=>(e[t]={id:t,name:r,type:n,signinUrl:i,callbackUrl:o},e),{})}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},61599:(e,t,r)=>{let n=r(46755),i=r(6796);class o{constructor(e){Object.assign(this,e);let{constructor:t,...r}=Object.getOwnPropertyDescriptors(this.constructor.prototype);Object.defineProperties(this,r)}set expires_in(e){this.expires_at=i()+Number(e)}get expires_in(){return Math.max.apply(null,[this.expires_at-i(),0])}expired(){return 0===this.expires_in}claims(){if(!this.id_token)throw TypeError("id_token not present in TokenSet");return JSON.parse(n.decode(this.id_token.split(".")[1]))}}e.exports=o},61806:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(71883),i=r(93673);async function o(e){var t,r,o,a,s,u;let{sessionToken:c,profile:l,account:f,options:d}=e;if(!(null!=f&&f.providerAccountId)||!f.type)throw Error("Missing or invalid provider account");if(!["email","oauth"].includes(f.type))throw Error("Provider not supported");let{adapter:p,jwt:h,events:y,session:{strategy:g,generateSessionToken:m}}=d;if(!p)return{user:l,account:f};let b=l,{createUser:_,updateUser:v,getUser:w,getUserByAccount:E,getUserByEmail:S,linkAccount:A,createSession:k,getSessionAndUser:x,deleteSession:O}=p,T=null,R=null,P=!1,j="jwt"===g;if(c)if(j)try{(T=await h.decode({...h,token:c}))&&"sub"in T&&T.sub&&(R=await w(T.sub))}catch(e){}else{let e=await x(c);e&&(T=e.session,R=e.user)}if("email"===f.type){let e=await S(b.email);if(e)(null==(t=R)?void 0:t.id)!==e.id&&!j&&c&&await O(c),R=await v({id:e.id,emailVerified:new Date}),await (null==(r=y.updateUser)?void 0:r.call(y,{user:R}));else{let{id:e,...t}={...b,emailVerified:new Date};R=await _(t),await (null==(o=y.createUser)?void 0:o.call(y,{user:R})),P=!0}return{session:T=j?{}:await k({sessionToken:await m(),userId:R.id,expires:(0,i.fromDate)(d.session.maxAge)}),user:R,isNewUser:P}}if("oauth"===f.type){let e=await E({providerAccountId:f.providerAccountId,provider:f.provider});if(e){if(R){if(e.id===R.id)return{session:T,user:R,isNewUser:P};throw new n.AccountNotLinkedError("The account is already associated with another user")}return{session:T=j?{}:await k({sessionToken:await m(),userId:e.id,expires:(0,i.fromDate)(d.session.maxAge)}),user:e,isNewUser:P}}{if(R)return await A({...f,userId:R.id}),await (null==(u=y.linkAccount)?void 0:u.call(y,{user:R,account:f,profile:b})),{session:T,user:R,isNewUser:P};let e=b.email?await S(b.email):null;if(e){let t=d.provider;if(null!=t&&t.allowDangerousEmailAccountLinking)R=e;else throw new n.AccountNotLinkedError("Another account already exists with the same e-mail address")}else{let{id:e,...t}={...b,emailVerified:null};R=await _(t)}return await (null==(a=y.createUser)?void 0:a.call(y,{user:R})),await A({...f,userId:R.id}),await (null==(s=y.linkAccount)?void 0:s.call(y,{user:R,account:f,profile:b})),{session:T=j?{}:await k({sessionToken:await m(),userId:R.id,expires:(0,i.fromDate)(d.session.maxAge)}),user:R,isNewUser:!0}}}throw Error("Unsupported account type")}},62806:(e,t,r)=>{var n="/",i=r(49509);!function(){var t={782:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},646:function(e){"use strict";let t={};function r(e,r,n){function i(e,t,n){return"string"==typeof r?r:r(e,t,n)}n||(n=Error);class o extends n{constructor(e,t,r){super(i(e,t,r))}}o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(!Array.isArray(e))return`of ${t} ${String(e)}`;{let r=e.length;return(e=e.map(e=>String(e)),r>2)?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}}function i(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function a(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){let s,u;if("string"==typeof t&&i(t,"not ")?(s="must not be",t=t.replace(/^not /,"")):s="must be",o(e," argument"))u=`The ${e} ${s} ${n(t,"type")}`;else{let r=a(e,".")?"property":"argument";u=`The "${e}" ${r} ${s} ${n(t,"type")}`}return u+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(709),a=r(337);r(782)(l,o);for(var s=n(a.prototype),u=0;u0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===d.prototype||(t=h(t)),n)s.endEmitted?k(e,new A):j(e,s,t,!0);else if(s.ended)k(e,new E);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?j(e,s,t,!1):L(e,s)):j(e,s,t,!1)}else n||(s.reading=!1,L(e,s));return!s.ended&&(s.length=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function N(e,t){if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&(t.highWaterMark=U(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function M(e,t){if(a("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,H(e)))}}function D(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(H,e))}function H(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,J(e)}function L(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(B,e,t))}function B(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function F(e){a("readable nexttick read 0"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(K,e,t))}function K(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),J(e),t.flowing&&!t.reading&&e.read(0)}function J(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function z(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function G(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(V,t,e))}function V(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Z(e,t){for(var r=0,n=e.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?G(this):D(this),null;if(0===(e=N(e,r))&&r.ended)return 0===r.length&&G(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-e0?z(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&G(this)),null!==t&&this.emit("data",t),t},R.prototype._read=function(e){k(this,new S("_read()"))},R.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?m:u;function s(e,t){a("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,d())}function u(){a("onend"),e.end()}n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=$(r);e.on("drain",c);var f=!1;function d(){a("cleanup"),e.removeListener("close",y),e.removeListener("finish",g),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",p),f=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}function p(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Z(n.pipes,e))&&!f&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){a("onerror",t),m(),e.removeListener("error",h),0===l(e,"error")&&k(e,t)}function y(){e.removeListener("finish",g),m()}function g(){a("onfinish"),e.removeListener("close",y),m()}function m(){a("unpipe"),r.unpipe(e)}return r.on("data",p),O(e,"error",h),e.once("close",y),e.once("finish",g),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},R.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?D(this):n.reading||i.nextTick(F,this)),r},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(e,t){var r=f.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(W,this),r},R.prototype.removeAllListeners=function(e){var t=f.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&i.nextTick(W,this),t},R.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},R.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){if(a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!=i)(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new A(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new b("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||q(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=h.destroy,T.prototype._undestroy=h.undestroy,T.prototype._destroy=function(e,t){t(e)}},871:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,a=r(698),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function h(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[f]=null,e[s]=null,e[u]=null,t(h(r,!1)))}}function g(e){i.nextTick(y,e)}function m(e,t){return function(r,n){e.then(function(){if(t[l])return void r(h(void 0,!0));t[d](r,n)},n)}}var b=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((n(o={get stream(){return this[p]},next:function(){var e,t=this,r=this[c];if(null!==r)return Promise.reject(r);if(this[l])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise(function(e,r){i.nextTick(function(){t[c]?r(t[c]):e(h(void 0,!0))})});var n=this[f];if(n)e=new Promise(m(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(h(o,!1));e=new Promise(this[d])}return this[f]=e,e}},Symbol.asyncIterator,function(){return this}),n(o,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){if(e)return void r(e);t(h(void 0,!0))})})}),o),b);e.exports=function(e){var t,r=Object.create(_,(n(t={},p,{value:e,writable:!0}),n(t,s,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,c,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,d,{value:function(e,t){var n=r[p].read();n?(r[f]=null,r[s]=null,r[u]=null,e(h(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[f]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];null!==t&&(r[f]=null,r[s]=null,r[u]=null,t(e)),r[c]=e;return}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[u]=null,n(h(void 0,!0))),r[l]=!0}),e.on("readable",g.bind(null,r)),r}},379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),r=this.head,n=0;r;)d(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:f,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},25:function(e){"use strict";function t(e,t){n(e,t),r(e)}function r(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.nextTick(n,this,e)):i.nextTick(n,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!o&&e?a._writableState?a._writableState.errorEmitted?i.nextTick(r,a):(a._writableState.errorEmitted=!0,i.nextTick(t,a,e)):i.nextTick(t,a,e):o?(i.nextTick(r,a),o(e)):i.nextTick(r,a)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},698:function(e,t,r){"use strict";var n=r(646).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),i=0;i0,function(t){e||(e=t),t&&o.forEach(f),a||(o.forEach(f),i(e))})});return r.reduce(d)}},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}e.exports={getHighWaterMark:function(e,t,r,o){var a=i(t,o,r);if(null!=a){if(!(isFinite(a)&&Math.floor(a)===a)||a<0)throw new n(o?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},678:function(e,t,r){e.exports=r(781)},55:function(e,t,r){var n=r(300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},173:function(e,t,r){e.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",c),e.on("error",c),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},704:function(e,t,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=h,this.end=y,t=4;break;case"utf8":this.fillLast=f,t=4;break;case"base64":this.text=g,this.end=m,t=3;break;default:this.write=b,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function u(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function f(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function d(e,t){var r=c(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function h(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return s}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let i="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return i?new i:new n}function a(e){return i?i.bind(e):n.bind(e)}function s(){return i?i.snapshot():function(e,...t){return e(...t)}}},65867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isRequestAPICallableInsideAfter:function(){return u},throwForSearchParamsAccessInUseCache:function(){return s},throwWithStaticGenerationBailoutError:function(){return o},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return a}});let n=r(11881),i=r(52039);function o(e,t){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${e} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E576",enumerable:!1,configurable:!0})}function a(e,t){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${e} with \`dynamic = "error"\` couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function s(e){let t=Object.defineProperty(Error(`Route ${e.route} used "searchParams" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "searchParams" 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:"E634",enumerable:!1,configurable:!0});throw e.invalidUsageError??=t,t}function u(){let e=i.afterTaskAsyncStorage.getStore();return(null==e?void 0:e.rootTaskSpawnPhase)==="action"}},66117:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Component:()=>x,Fragment:()=>k,cloneElement:()=>G,createContext:()=>V,createElement:()=>E,createRef:()=>A,h:()=>E,hydrate:()=>z,isValidElement:()=>a,options:()=>i,render:()=>J,toChildArray:()=>U});var n,i,o,a,s,u,c,l,f,d,p,h,y,g={},m=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function v(e,t){for(var r in t)e[r]=t[r];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function E(e,t,r){var i,o,a,s={};for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return S(e,s,i,o,null)}function S(e,t,r,n,a){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==a?++o:a,__i:-1,__u:0};return null==a&&null!=i.vnode&&i.vnode(s),s}function A(){return{current:null}}function k(e){return e.children}function x(e,t){this.props=e,this.context=t}function O(e,t){if(null==t)return e.__?O(e.__,e.__i+1):null;for(var r;tc&&s.sort(l),e=s.shift(),c=s.length,e.__d&&(r=void 0,o=(n=(t=e).__v).__e,a=[],u=[],t.__P&&((r=v({},n)).__v=n.__v+1,i.vnode&&i.vnode(r),L(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[o]:null,a,null==o?O(n):o,!!(32&n.__u),u),r.__v=n.__v,r.__.__k[r.__i]=r,B(a,r,u),r.__e!=o&&T(r)));P.__r=0}function j(e,t,r,n,i,o,a,s,u,c,l){var f,d,p,h,y,b,_=n&&n.__k||m,v=t.length;for(u=C(r,t,_,u,v),f=0;f0?S(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,-1!=(c=a.__i=N(a,r,u,f))&&(f--,(s=r[c])&&(s.__u|=2)),null==s||null==s.__v?(-1==c&&(i>l?d--:iu?d--:d++,a.__u|=4))):e.__k[o]=null;if(f)for(o=0;o+(null!=u&&0==(2&u.__u)))for(i=r-1,o=r+1;i>=0||o=0){if((u=t[i])&&0==(2&u.__u)&&a==u.key&&s==u.type)return i;i--}if(o0?e:_(e)?e.map($):v({},e)}function W(e,t,r,o,a,s,u,c,l){var f,d,p,h,y,m,b,v=r.props,E=t.props,S=t.type;if("svg"==S?a="http://www.w3.org/2000/svg":"math"==S?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),null!=s){for(f=0;f2&&(u.children=arguments.length>3?n.call(arguments,2):r),S(e.type,u,i||e.key,o||e.ref,null)}function V(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(function(e){e.__e=!0,R(e)})},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+y++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}n=m.slice,i={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},o=0,a=function(e){return null!=e&&null==e.constructor},x.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},r),this.props)),e&&v(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),R(this))},x.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),R(this))},x.prototype.render=k,s=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,d=0,p=H(!1),h=H(!0),y=0},66593:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__esModule:()=>n.B,cookies:()=>n.U,draftMode:()=>o.r,headers:()=>i.b});var n=r(76761),i=r(10064),o=r(76823)},66864:(e,t,r)=>{var n=r(49509);let{inspect:i}=r(5625),o=r(75356),{RPError:a}=r(32608),s=r(16664),u=r(88658),c=r(67604),l=r(75704),f=r(6030),d=r(18877),{keystore:p}=r(69834),h=["https://login.microsoftonline.com/common/.well-known/openid-configuration","https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration"],y=Symbol(),g={claim_types_supported:["normal"],claims_parameter_supported:!1,grant_types_supported:["authorization_code","implicit"],request_parameter_supported:!1,request_uri_parameter_supported:!0,require_request_uri_registration:!1,response_modes_supported:["query","fragment"],token_endpoint_auth_methods_supported:["client_secret_basic"]};class m{#l;constructor(e={}){let t=e[y];delete e[y],["introspection","revocation"].forEach(t=>{e[`${t}_endpoint`]&&void 0===e[`${t}_endpoint_auth_methods_supported`]&&void 0===e[`${t}_endpoint_auth_signing_alg_values_supported`]&&(e.token_endpoint_auth_methods_supported&&(e[`${t}_endpoint_auth_methods_supported`]=e.token_endpoint_auth_methods_supported),e.token_endpoint_auth_signing_alg_values_supported&&(e[`${t}_endpoint_auth_signing_alg_values_supported`]=e.token_endpoint_auth_signing_alg_values_supported))}),this.#l=new Map,Object.entries(e).forEach(([e,t])=>{this.#l.set(e,t),this[e]||Object.defineProperty(this,e,{get(){return this.#l.get(e)},enumerable:!0})}),u.set(this.issuer,this);let r=s(this,t);Object.defineProperties(this,{Client:{value:r,enumerable:!0},FAPI1Client:{value:class extends r{},enumerable:!0},FAPI2Client:{value:class extends r{},enumerable:!0}})}get metadata(){return d(Object.fromEntries(this.#l.entries()))}static async webfinger(e){let t=l(e),{host:r}=o.parse(t),n=`https://${r}/.well-known/webfinger`,i=c(await f.call(this,{method:"GET",url:n,responseType:"json",searchParams:{resource:t,rel:"http://openid.net/specs/connect/1.0/issuer"},headers:{Accept:"application/json"}})),s=Array.isArray(i.links)&&i.links.find(e=>"object"==typeof e&&"http://openid.net/specs/connect/1.0/issuer"===e.rel&&e.href);if(!s)throw new a({message:"no issuer found in webfinger response",body:i});if("string"!=typeof s.href||!s.href.startsWith("https://"))throw new a({printf:["invalid issuer location %s",s.href],body:i});let d=s.href;if(u.has(d))return u.get(d);let p=await this.discover(d);if(p.issuer!==d)throw u.del(p.issuer),new a("discovered issuer mismatch, expected %s, got: %s",d,p.issuer);return p}static async discover(e){let t=b(e),r=c(await f.call(this,{method:"GET",responseType:"json",url:t,headers:{Accept:"application/json"}}));return new m({...g,...r,[y]:!!h.find(e=>t.startsWith(e))})}async reloadJwksUri(){await p.call(this,!0)}[i.custom](){return`${this.constructor.name} ${i(this.metadata,{depth:1/0,colors:n.stdout.isTTY,compact:!1,sorted:!0})}`}}function b(e){let t=o.parse(e);if(t.pathname.includes("/.well-known/"))return e;{let e;return e=t.pathname.endsWith("/")?`${t.pathname}.well-known/openid-configuration`:`${t.pathname}/.well-known/openid-configuration`,o.format({...t,pathname:e})}}e.exports=m},67604:(e,t,r)=>{var n=r(44134).Buffer;let{STATUS_CODES:i}=r(36088),{format:o}=r(5625),{OPError:a}=r(32608),s=r(88070),u=e=>{let t=s(e.headers["www-authenticate"]);if(t.error)throw new a(t,e)},c=e=>{let t=!1;try{let r;r="object"!=typeof e.body||n.isBuffer(e.body)?JSON.parse(e.body):e.body,(t="string"==typeof r.error&&r.error.length)&&Object.defineProperty(e,"body",{value:r,configurable:!0})}catch(e){}return t};e.exports=function(e,{statusCode:t=200,body:r=!0,bearer:n=!1}={}){if(e.statusCode!==t){if(n&&u(e),c(e))throw new a(e.body,e);throw new a({error:o("expected %i %s, got: %i %s",t,i[t],e.statusCode,i[e.statusCode])},e)}if(r&&!e.body)throw new a({error:o("expected %i %s with body but no body was returned",t,i[t])},e);return e.body}},69359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(8777),i=r(93673);async function o(e,t){var r,o,a,s;let{url:u,adapter:c,provider:l,callbackUrl:f,theme:d}=t,p=null!=(r=await (null==(o=l.generateVerificationToken)?void 0:o.call(l)))?r:(0,n.randomBytes)(32).toString("hex"),h=86400,y=new Date(Date.now()+(null!=(a=l.maxAge)?a:h)*1e3),g=new URLSearchParams({callbackUrl:f,token:p,email:e}),m=`${u}/callback/${l.id}?${g}`;return await Promise.all([l.sendVerificationRequest({identifier:e,token:p,expires:y,url:m,provider:l,theme:d}),null==(s=c.createVerificationToken)?void 0:s.call(c,{identifier:e,token:(0,i.hashToken)(p,t),expires:y})]),`${u}/verify-request?${new URLSearchParams({provider:l.id,type:l.type})}`}},69834:(e,t,r)=>{let n=r(52491),i=r(71383),{RPError:o}=r(32608),{assertIssuerConfiguration:a}=r(99403),s=r(38741),{keystores:u}=r(8816),c=r(67604),l=r(6030),f=new WeakMap,d=new WeakMap,p=e=>(d.has(e)||d.set(e,new i({max:100})),d.get(e));async function h(e=!1){a(this,"jwks_uri");let t=u.get(this),r=p(this);return e||!t?(f.has(this)||(r.reset(),f.set(this,(async()=>{let e=c(await l.call(this,{method:"GET",responseType:"json",url:this.jwks_uri,headers:{Accept:"application/json, application/jwk-set+json"}}).finally(()=>{f.delete(this)})),t=s.fromJWKS(e,{onlyPublic:!0});return r.set("throttle",!0,6e4),u.set(this,t),t})())),f.get(this)):t}async function y({kid:e,kty:t,alg:r,use:i},{allowMulti:a=!1}={}){let s=p(this),u={kid:e,kty:t,alg:r,use:i},c=n(u,{algorithm:"sha256",ignoreUnknown:!0,unorderedArrays:!0,unorderedSets:!0,respectType:!1}),l=s.get(c)||s.get("throttle"),f=await h.call(this,!l),d=f.all(u);if(delete u.use,0===d.length)throw new o({printf:["no valid key found in issuer's jwks_uri for key parameters %j",u],jwks:f});if(!a&&d.length>1&&!e)throw new o({printf:["multiple matching keys found in issuer's jwks_uri for key parameters %j, kid must be provided in this case",u],jwks:f});return s.set(c,!0),d}e.exports.queryKeyStore=y,e.exports.keystore=h},70283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=r(27793),i=r(91023),o=r(91949),a=c(r(54229)),s=r(71883);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&({}).hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}async function l(e){var t,r,u,c,l,d;let{options:p,query:h,body:y,method:g,cookies:m}=e,{logger:b,provider:_}=p,v=null!=(t=null==y?void 0:y.error)?t:null==h?void 0:h.error;if(v){let e=Error(v);throw b.error("OAUTH_CALLBACK_HANDLER_ERROR",{error:e,error_description:null==h?void 0:h.error_description,providerId:_.id}),b.debug("OAUTH_CALLBACK_HANDLER_ERROR",{body:y}),e}if(null!=(r=_.version)&&r.startsWith("1."))try{let e=await (0,o.oAuth1Client)(p),{oauth_token:t,oauth_verifier:r}=null!=h?h:{},n=await e.getOAuthAccessToken(t,o.oAuth1TokenStore.get(t),r),i=await e.get(_.profileUrl,n.oauth_token,n.oauth_token_secret);return"string"==typeof i&&(i=JSON.parse(i)),{...await f({profile:i,tokens:n,provider:_,logger:b}),cookies:[]}}catch(e){throw b.error("OAUTH_V1_GET_ACCESS_TOKEN_ERROR",e),e}null!=h&&h.oauth_token&&o.oAuth1TokenStore.delete(h.oauth_token);try{let e,t,r=await (0,i.openidClient)(p),o={},s=[];await a.state.use(m,s,p,o),await a.pkce.use(m,s,p,o),await a.nonce.use(m,s,p,o);let v={...r.callbackParams({url:`http://n?${new URLSearchParams(h)}`,body:y,method:g}),...null==(u=_.token)?void 0:u.params};if(null!=(c=_.token)&&c.request){let t=await _.token.request({provider:_,params:v,checks:o,client:r});e=new n.TokenSet(t.tokens)}else e=_.idToken?await r.callback(_.callbackUrl,v,o):await r.oauthCallback(_.callbackUrl,v,o);return Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),t=null!=(l=_.userinfo)&&l.request?await _.userinfo.request({provider:_,tokens:e,client:r}):_.idToken?e.claims():await r.userinfo(e,{params:null==(d=_.userinfo)?void 0:d.params}),{...await f({profile:t,provider:_,tokens:e,logger:b}),cookies:s}}catch(e){throw new s.OAuthCallbackError(e)}}async function f({profile:e,tokens:t,provider:r,logger:n}){try{var i;n.debug("PROFILE_DATA",{OAuthProfile:e});let o=await r.profile(e,t);if(o.email=null==(i=o.email)?void 0:i.toLowerCase(),!o.id)throw TypeError(`Profile id is missing in ${r.name} OAuth profile response`);return{profile:o,account:{provider:r.id,type:r.type,providerAccountId:o.id.toString(),...t},OAuthProfile:e}}catch(t){n.error("OAUTH_PARSE_PROFILE_ERROR",{error:t,OAuthProfile:e})}}},70405:(e,t,r)=>{"use strict";function n(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=r}}r.r(t),r.d(t,{_:()=>o});var i=r(6004);function o(e,t,r){var o=(0,i._)(e,t,"set");return n(e,o,r),r}},70965:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n{"use strict";let n;r.d(t,{z:()=>u});var i,o,a,s,u={};r.r(u),r.d(u,{BRAND:()=>eB,DIRTY:()=>S,EMPTY_PATH:()=>_,INVALID:()=>E,NEVER:()=>tE,OK:()=>A,ParseStatus:()=>w,Schema:()=>C,ZodAny:()=>ef,ZodArray:()=>ey,ZodBigInt:()=>eo,ZodBoolean:()=>ea,ZodBranded:()=>e$,ZodCatch:()=>eH,ZodDate:()=>es,ZodDefault:()=>eD,ZodDiscriminatedUnion:()=>ev,ZodEffects:()=>eU,ZodEnum:()=>ej,ZodError:()=>p,ZodFirstPartyTypeKind:()=>s,ZodFunction:()=>eO,ZodIntersection:()=>eE,ZodIssueCode:()=>f,ZodLazy:()=>eT,ZodLiteral:()=>eR,ZodMap:()=>ek,ZodNaN:()=>eL,ZodNativeEnum:()=>eC,ZodNever:()=>ep,ZodNull:()=>el,ZodNullable:()=>eM,ZodNumber:()=>ei,ZodObject:()=>em,ZodOptional:()=>eN,ZodParsedType:()=>c,ZodPipeline:()=>eW,ZodPromise:()=>eI,ZodReadonly:()=>eF,ZodRecord:()=>eA,ZodSchema:()=>C,ZodSet:()=>ex,ZodString:()=>er,ZodSymbol:()=>eu,ZodTransformer:()=>eU,ZodTuple:()=>eS,ZodType:()=>C,ZodUndefined:()=>ec,ZodUnion:()=>eb,ZodUnknown:()=>ed,ZodVoid:()=>eh,addIssueToContext:()=>v,any:()=>e6,array:()=>e8,bigint:()=>eX,boolean:()=>eY,coerce:()=>tw,custom:()=>eK,date:()=>eQ,datetimeRegex:()=>Y,defaultErrorMap:()=>h,discriminatedUnion:()=>tt,effect:()=>tp,enum:()=>tl,function:()=>ts,getErrorMap:()=>m,getParsedType:()=>l,instanceof:()=>ez,intersection:()=>tr,isAborted:()=>k,isAsync:()=>T,isDirty:()=>x,isValid:()=>O,late:()=>eJ,lazy:()=>tu,literal:()=>tc,makeIssue:()=>b,map:()=>to,nan:()=>eZ,nativeEnum:()=>tf,never:()=>e4,null:()=>e2,nullable:()=>ty,number:()=>eV,object:()=>e9,objectUtil:()=>o,oboolean:()=>tv,onumber:()=>t_,optional:()=>th,ostring:()=>tb,pipeline:()=>tm,preprocess:()=>tg,promise:()=>td,quotelessJson:()=>d,record:()=>ti,set:()=>ta,setErrorMap:()=>g,strictObject:()=>e7,string:()=>eG,symbol:()=>e0,transformer:()=>tp,tuple:()=>tn,undefined:()=>e1,union:()=>te,unknown:()=>e5,util:()=>i,void:()=>e3}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},e.getValidEnumValues=t=>{let r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(let e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(let r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(i||(i={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(o||(o={}));let c=i.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),l=e=>{switch(typeof e){case"undefined":return c.undefined;case"string":return c.string;case"number":return Number.isNaN(e)?c.nan:c.number;case"boolean":return c.boolean;case"function":return c.function;case"bigint":return c.bigint;case"symbol":return c.symbol;case"object":if(Array.isArray(e))return c.array;if(null===e)return c.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return c.promise;if("undefined"!=typeof Map&&e instanceof Map)return c.map;if("undefined"!=typeof Set&&e instanceof Set)return c.set;if("undefined"!=typeof Date&&e instanceof Date)return c.date;return c.object;default:return c.unknown}},f=i.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),d=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class p extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;ne.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}p.create=e=>new p(e);let h=(e,t)=>{let r;switch(e.code){case f.invalid_type:r=e.received===c.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case f.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,i.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:r=`Unrecognized key(s) in object: ${i.joinValues(e.keys,", ")}`;break;case f.invalid_union:r="Invalid input";break;case f.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${i.joinValues(e.options)}`;break;case f.invalid_enum_value:r=`Invalid enum value. Expected ${i.joinValues(e.options)}, received '${e.received}'`;break;case f.invalid_arguments:r="Invalid function arguments";break;case f.invalid_return_type:r="Invalid function return type";break;case f.invalid_date:r="Invalid date";break;case f.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:i.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case f.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case f.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case f.custom:r="Invalid input";break;case f.invalid_intersection_types:r="Intersection results could not be merged";break;case f.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case f.not_finite:r="Number must be finite";break;default:r=t.defaultError,i.assertNever(e)}return{message:r}},y=h;function g(e){y=e}function m(){return y}let b=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],a={...i,path:o};if(void 0!==i.message)return{...i,path:o,message:i.message};let s="";for(let e of n.filter(e=>!!e).slice().reverse())s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},_=[];function v(e,t){let r=m(),n=b({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===h?void 0:h].filter(e=>!!e)});e.common.issues.push(n)}class w{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return E;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return w.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:i}=n;if("aborted"===t.status||"aborted"===i.status)return E;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||n.alwaysSet)&&(r[t.value]=i.value)}return{status:e.value,value:r}}}let E=Object.freeze({status:"aborted"}),S=e=>({status:"dirty",value:e}),A=e=>({status:"valid",value:e}),k=e=>"aborted"===e.status,x=e=>"dirty"===e.status,O=e=>"valid"===e.status,T=e=>"undefined"!=typeof Promise&&e instanceof Promise;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(a||(a={}));class R{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let P=(e,t)=>{if(O(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new p(e.common.issues);return this._error=t,this._error}}};function j(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:o}=e;return"invalid_enum_value"===t.code?{message:o??i.defaultError}:void 0===i.data?{message:o??n??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:o??r??i.defaultError}},description:i}}class C{get description(){return this._def.description}_getType(e){return l(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(T(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},n=this._parseSync({data:e,path:r.path,parent:r});return P(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return O(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>O(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},n=this._parse({data:e,path:r.path,parent:r});return P(r,await (T(n)?n:Promise.resolve(n)))}refine(e,t){let r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{let i=e(t),o=()=>n.addIssue({code:f.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(o(),!1)):!!i||(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new eU({schema:this,typeName:s.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return eN.create(this,this._def)}nullable(){return eM.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ey.create(this)}promise(){return eI.create(this,this._def)}or(e){return eb.create([this,e],this._def)}and(e){return eE.create(this,e,this._def)}transform(e){return new eU({...j(this._def),schema:this,typeName:s.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t="function"==typeof e?e:()=>e;return new eD({...j(this._def),innerType:this,defaultValue:t,typeName:s.ZodDefault})}brand(){return new e$({typeName:s.ZodBranded,type:this,...j(this._def)})}catch(e){let t="function"==typeof e?e:()=>e;return new eH({...j(this._def),innerType:this,catchValue:t,typeName:s.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eW.create(this,e)}readonly(){return eF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let I=/^c[^\s-]{8,}$/i,U=/^[0-9a-z]+$/,N=/^[0-9A-HJKMNP-TV-Z]{26}$/i,M=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,D=/^[a-z0-9_-]{21}$/i,H=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,L=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,B=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",W=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,F=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,q=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,J=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",V=RegExp(`^${G}$`);function Z(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function X(e){return RegExp(`^${Z(e)}$`)}function Y(e){let t=`${G}T${Z(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}function Q(e,t){return!!(("v4"===t||!t)&&W.test(e)||("v6"===t||!t)&&q.test(e))}function ee(e,t){if(!H.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));if("object"!=typeof i||null===i||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)return!1;return!0}catch{return!1}}function et(e,t){return!!(("v4"===t||!t)&&F.test(e)||("v6"===t||!t)&&K.test(e))}class er extends C{_parse(e){let t;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.string){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.string,received:t.parsedType}),E}let r=new w;for(let o of this._def.checks)if("min"===o.kind)e.data.lengtho.value&&(v(t=this._getOrReturnCtx(e,t),{code:f.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("length"===o.kind){let n=e.data.length>o.value,i=e.data.lengthe.test(t),{validation:t,code:f.invalid_string,...a.errToObj(r)})}_addCheck(e){return new er({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...a.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...a.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...a.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...a.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...a.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...a.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...a.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...a.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...a.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...a.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...a.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...a.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...a.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...a.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...a.errToObj(t)})}nonempty(e){return this.min(1,a.errToObj(e))}trim(){return new er({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new er({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new er({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}er.create=e=>new er({checks:[],typeName:s.ZodString,coerce:e?.coerce??!1,...j(e)});class ei extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==c.number){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.number,received:t.parsedType}),E}let r=new w;for(let n of this._def.checks)"int"===n.kind?i.isInteger(e.data)||(v(t=this._getOrReturnCtx(e,t),{code:f.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(v(t=this._getOrReturnCtx(e,t),{code:f.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==en(e.data,n.value)&&(v(t=this._getOrReturnCtx(e,t),{code:f.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(v(t=this._getOrReturnCtx(e,t),{code:f.not_finite,message:n.message}),r.dirty()):i.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.toString(t))}setLimit(e,t,r,n){return new ei({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.toString(n)}]})}_addCheck(e){return new ei({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:a.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&i.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew ei({checks:[],typeName:s.ZodNumber,coerce:e?.coerce||!1,...j(e)});class eo extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==c.bigint)return this._getInvalidInput(e);let r=new w;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(v(t=this._getOrReturnCtx(e,t),{code:f.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(v(t=this._getOrReturnCtx(e,t),{code:f.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):i.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.bigint,received:t.parsedType}),E}gte(e,t){return this.setLimit("min",e,!0,a.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.toString(t))}setLimit(e,t,r,n){return new eo({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.toString(n)}]})}_addCheck(e){return new eo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew eo({checks:[],typeName:s.ZodBigInt,coerce:e?.coerce??!1,...j(e)});class ea extends C{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==c.boolean){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.boolean,received:t.parsedType}),E}return A(e.data)}}ea.create=e=>new ea({typeName:s.ZodBoolean,coerce:e?.coerce||!1,...j(e)});class es extends C{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.date){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.date,received:t.parsedType}),E}if(Number.isNaN(e.data.getTime()))return v(this._getOrReturnCtx(e),{code:f.invalid_date}),E;let r=new w;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(v(t=this._getOrReturnCtx(e,t),{code:f.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):i.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new es({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:a.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:a.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew es({checks:[],coerce:e?.coerce||!1,typeName:s.ZodDate,...j(e)});class eu extends C{_parse(e){if(this._getType(e)!==c.symbol){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.symbol,received:t.parsedType}),E}return A(e.data)}}eu.create=e=>new eu({typeName:s.ZodSymbol,...j(e)});class ec extends C{_parse(e){if(this._getType(e)!==c.undefined){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.undefined,received:t.parsedType}),E}return A(e.data)}}ec.create=e=>new ec({typeName:s.ZodUndefined,...j(e)});class el extends C{_parse(e){if(this._getType(e)!==c.null){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.null,received:t.parsedType}),E}return A(e.data)}}el.create=e=>new el({typeName:s.ZodNull,...j(e)});class ef extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return A(e.data)}}ef.create=e=>new ef({typeName:s.ZodAny,...j(e)});class ed extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return A(e.data)}}ed.create=e=>new ed({typeName:s.ZodUnknown,...j(e)});class ep extends C{_parse(e){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.never,received:t.parsedType}),E}}ep.create=e=>new ep({typeName:s.ZodNever,...j(e)});class eh extends C{_parse(e){if(this._getType(e)!==c.undefined){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.void,received:t.parsedType}),E}return A(e.data)}}eh.create=e=>new eh({typeName:s.ZodVoid,...j(e)});class ey extends C{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==c.array)return v(t,{code:f.invalid_type,expected:c.array,received:t.parsedType}),E;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,i=t.data.lengthn.maxLength.value&&(v(t,{code:f.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new R(t,e,t.path,r)))).then(e=>w.mergeArray(r,e));let i=[...t.data].map((e,r)=>n.type._parseSync(new R(t,e,t.path,r)));return w.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new ey({...this._def,minLength:{value:e,message:a.toString(t)}})}max(e,t){return new ey({...this._def,maxLength:{value:e,message:a.toString(t)}})}length(e,t){return new ey({...this._def,exactLength:{value:e,message:a.toString(t)}})}nonempty(e){return this.min(1,e)}}function eg(e){if(e instanceof em){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=eN.create(eg(n))}return new em({...e._def,shape:()=>t})}if(e instanceof ey)return new ey({...e._def,type:eg(e.element)});if(e instanceof eN)return eN.create(eg(e.unwrap()));if(e instanceof eM)return eM.create(eg(e.unwrap()));if(e instanceof eS)return eS.create(e.items.map(e=>eg(e)));else return e}ey.create=(e,t)=>new ey({type:e,minLength:null,maxLength:null,exactLength:null,typeName:s.ZodArray,...j(t)});class em extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=i.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==c.object){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.object,received:t.parsedType}),E}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ep&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||o.push(e);let a=[];for(let e of i){let t=n[e],i=r.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new R(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ep){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)o.length>0&&(v(r,{code:f.unrecognized_keys,keys:o}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of o){let n=r.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new R(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of a){let r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>w.mergeObjectSync(t,e)):w.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return a.errToObj,new em({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:a.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new em({...this._def,unknownKeys:"strip"})}passthrough(){return new em({...this._def,unknownKeys:"passthrough"})}extend(e){return new em({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new em({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:s.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new em({...this._def,catchall:e})}pick(e){let t={};for(let r of i.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new em({...this._def,shape:()=>t})}omit(e){let t={};for(let r of i.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new em({...this._def,shape:()=>t})}deepPartial(){return eg(this)}partial(e){let t={};for(let r of i.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new em({...this._def,shape:()=>t})}required(e){let t={};for(let r of i.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof eN;)e=e._def.innerType;t[r]=e}return new em({...this._def,shape:()=>t})}keyof(){return eP(i.objectKeys(this.shape))}}em.create=(e,t)=>new em({shape:()=>e,unknownKeys:"strip",catchall:ep.create(),typeName:s.ZodObject,...j(t)}),em.strictCreate=(e,t)=>new em({shape:()=>e,unknownKeys:"strict",catchall:ep.create(),typeName:s.ZodObject,...j(t)}),em.lazycreate=(e,t)=>new em({shape:e,unknownKeys:"strip",catchall:ep.create(),typeName:s.ZodObject,...j(t)});class eb extends C{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new p(e.ctx.common.issues));return v(t,{code:f.invalid_union,unionErrors:r}),E}if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(n);{let e,n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=n.map(e=>new p(e));return v(t,{code:f.invalid_union,unionErrors:i}),E}}get options(){return this._def.options}}eb.create=(e,t)=>new eb({options:e,typeName:s.ZodUnion,...j(t)});let e_=e=>{if(e instanceof eT)return e_(e.schema);if(e instanceof eU)return e_(e.innerType());if(e instanceof eR)return[e.value];if(e instanceof ej)return e.options;if(e instanceof eC)return i.objectValues(e.enum);else if(e instanceof eD)return e_(e._def.innerType);else if(e instanceof ec)return[void 0];else if(e instanceof el)return[null];else if(e instanceof eN)return[void 0,...e_(e.unwrap())];else if(e instanceof eM)return[null,...e_(e.unwrap())];else if(e instanceof e$)return e_(e.unwrap());else if(e instanceof eF)return e_(e.unwrap());else if(e instanceof eH)return e_(e._def.innerType);else return[]};class ev extends C{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.object)return v(t,{code:f.invalid_type,expected:c.object,received:t.parsedType}),E;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),E)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=e_(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new ev({typeName:s.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...j(r)})}}function ew(e,t){let r=l(e),n=l(t);if(e===t)return{valid:!0,data:e};if(r===c.object&&n===c.object){let r=i.objectKeys(t),n=i.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(let r of n){let n=ew(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===c.array&&n===c.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let n=0;n{if(k(e)||k(n))return E;let i=ew(e.value,n.value);return i.valid?((x(e)||x(n))&&t.dirty(),{status:t.value,value:i.data}):(v(r,{code:f.invalid_intersection_types}),E)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eE.create=(e,t,r)=>new eE({left:e,right:t,typeName:s.ZodIntersection,...j(r)});class eS extends C{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.array)return v(r,{code:f.invalid_type,expected:c.array,received:r.parsedType}),E;if(r.data.lengththis._def.items.length&&(v(r,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new R(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>w.mergeArray(t,e)):w.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new eS({...this._def,rest:e})}}eS.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new eS({items:e,typeName:s.ZodTuple,rest:null,...j(t)})};class eA extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.object)return v(r,{code:f.invalid_type,expected:c.object,received:r.parsedType}),E;let n=[],i=this._def.keyType,o=this._def.valueType;for(let e in r.data)n.push({key:i._parse(new R(r,e,r.path,e)),value:o._parse(new R(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?w.mergeObjectAsync(t,n):w.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new eA(t instanceof C?{keyType:e,valueType:t,typeName:s.ZodRecord,...j(r)}:{keyType:er.create(),valueType:e,typeName:s.ZodRecord,...j(t)})}}class ek extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.map)return v(r,{code:f.invalid_type,expected:c.map,received:r.parsedType}),E;let n=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([e,t],o)=>({key:n._parse(new R(r,e,r.path,[o,"key"])),value:i._parse(new R(r,t,r.path,[o,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of o){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return E;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of o){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return E;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}ek.create=(e,t,r)=>new ek({valueType:t,keyType:e,typeName:s.ZodMap,...j(r)});class ex extends C{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.set)return v(r,{code:f.invalid_type,expected:c.set,received:r.parsedType}),E;let n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&(v(r,{code:f.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let i=this._def.valueType;function o(e){let r=new Set;for(let n of e){if("aborted"===n.status)return E;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let a=[...r.data.values()].map((e,t)=>i._parse(new R(r,e,r.path,t)));return r.common.async?Promise.all(a).then(e=>o(e)):o(a)}min(e,t){return new ex({...this._def,minSize:{value:e,message:a.toString(t)}})}max(e,t){return new ex({...this._def,maxSize:{value:e,message:a.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ex.create=(e,t)=>new ex({valueType:e,minSize:null,maxSize:null,typeName:s.ZodSet,...j(t)});class eO extends C{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.function)return v(t,{code:f.invalid_type,expected:c.function,received:t.parsedType}),E;function r(e,r){return b({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),h].filter(e=>!!e),issueData:{code:f.invalid_arguments,argumentsError:r}})}function n(e,r){return b({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),h].filter(e=>!!e),issueData:{code:f.invalid_return_type,returnTypeError:r}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof eI){let e=this;return A(async function(...t){let a=new p([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw a.addIssue(r(t,e)),a}),u=await Reflect.apply(o,this,s);return await e._def.returns._def.type.parseAsync(u,i).catch(e=>{throw a.addIssue(n(u,e)),a})})}{let e=this;return A(function(...t){let a=e._def.args.safeParse(t,i);if(!a.success)throw new p([r(t,a.error)]);let s=Reflect.apply(o,this,a.data),u=e._def.returns.safeParse(s,i);if(!u.success)throw new p([n(s,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eO({...this._def,args:eS.create(e).rest(ed.create())})}returns(e){return new eO({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new eO({args:e||eS.create([]).rest(ed.create()),returns:t||ed.create(),typeName:s.ZodFunction,...j(r)})}}class eT extends C{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}eT.create=(e,t)=>new eT({getter:e,typeName:s.ZodLazy,...j(t)});class eR extends C{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),E}return{status:"valid",value:e.data}}get value(){return this._def.value}}function eP(e,t){return new ej({values:e,typeName:s.ZodEnum,...j(t)})}eR.create=(e,t)=>new eR({value:e,typeName:s.ZodLiteral,...j(t)});class ej extends C{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return v(t,{expected:i.joinValues(r),received:t.parsedType,code:f.invalid_type}),E}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return v(t,{received:t.data,code:f.invalid_enum_value,options:r}),E}return A(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ej.create(e,{...this._def,...t})}exclude(e,t=this._def){return ej.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ej.create=eP;class eC extends C{_parse(e){let t=i.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==c.string&&r.parsedType!==c.number){let e=i.objectValues(t);return v(r,{expected:i.joinValues(e),received:r.parsedType,code:f.invalid_type}),E}if(this._cache||(this._cache=new Set(i.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=i.objectValues(t);return v(r,{received:r.data,code:f.invalid_enum_value,options:e}),E}return A(e.data)}get enum(){return this._def.values}}eC.create=(e,t)=>new eC({values:e,typeName:s.ZodNativeEnum,...j(t)});class eI extends C{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==c.promise&&!1===t.common.async?(v(t,{code:f.invalid_type,expected:c.promise,received:t.parsedType}),E):A((t.parsedType===c.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}eI.create=(e,t)=>new eI({type:e,typeName:s.ZodPromise,...j(t)});class eU extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===s.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{v(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){let e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return E;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?E:"dirty"===n.status||"dirty"===t.value?S(n.value):n});{if("aborted"===t.value)return E;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?E:"dirty"===n.status||"dirty"===t.value?S(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?E:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?E:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>O(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):E);else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!O(e))return E;let i=n.transform(e.value,o);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}i.assertNever(n)}}eU.create=(e,t,r)=>new eU({schema:e,typeName:s.ZodEffects,effect:t,...j(r)}),eU.createWithPreprocess=(e,t,r)=>new eU({schema:t,effect:{type:"preprocess",transform:e},typeName:s.ZodEffects,...j(r)});class eN extends C{_parse(e){return this._getType(e)===c.undefined?A(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eN.create=(e,t)=>new eN({innerType:e,typeName:s.ZodOptional,...j(t)});class eM extends C{_parse(e){return this._getType(e)===c.null?A(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eM.create=(e,t)=>new eM({innerType:e,typeName:s.ZodNullable,...j(t)});class eD extends C{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===c.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eD.create=(e,t)=>new eD({innerType:e,typeName:s.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...j(t)});class eH extends C{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return T(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new p(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new p(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}eH.create=(e,t)=>new eH({innerType:e,typeName:s.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...j(t)});class eL extends C{_parse(e){if(this._getType(e)!==c.nan){let t=this._getOrReturnCtx(e);return v(t,{code:f.invalid_type,expected:c.nan,received:t.parsedType}),E}return{status:"valid",value:e.data}}}eL.create=e=>new eL({typeName:s.ZodNaN,...j(e)});let eB=Symbol("zod_brand");class e$ extends C{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eW extends C{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?E:"dirty"===e.status?(t.dirty(),S(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?E:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eW({in:e,out:t,typeName:s.ZodPipeline})}}class eF extends C{_parse(e){let t=this._def.innerType._parse(e),r=e=>(O(e)&&(e.value=Object.freeze(e.value)),e);return T(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function eq(e,t){let r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function eK(e,t={},r){return e?ef.create().superRefine((n,i)=>{let o=e(n);if(o instanceof Promise)return o.then(e=>{if(!e){let e=eq(t,n),o=e.fatal??r??!0;i.addIssue({code:"custom",...e,fatal:o})}});if(!o){let e=eq(t,n),o=e.fatal??r??!0;i.addIssue({code:"custom",...e,fatal:o})}}):ef.create()}eF.create=(e,t)=>new eF({innerType:e,typeName:s.ZodReadonly,...j(t)});let eJ={object:em.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(s||(s={}));let ez=(e,t={message:`Input not instance of ${e.name}`})=>eK(t=>t instanceof e,t),eG=er.create,eV=ei.create,eZ=eL.create,eX=eo.create,eY=ea.create,eQ=es.create,e0=eu.create,e1=ec.create,e2=el.create,e6=ef.create,e5=ed.create,e4=ep.create,e3=eh.create,e8=ey.create,e9=em.create,e7=em.strictCreate,te=eb.create,tt=ev.create,tr=eE.create,tn=eS.create,ti=eA.create,to=ek.create,ta=ex.create,ts=eO.create,tu=eT.create,tc=eR.create,tl=ej.create,tf=eC.create,td=eI.create,tp=eU.create,th=eN.create,ty=eM.create,tg=eU.createWithPreprocess,tm=eW.create,tb=()=>eG().optional(),t_=()=>eV().optional(),tv=()=>eY().optional(),tw={string:e=>er.create({...e,coerce:!0}),number:e=>ei.create({...e,coerce:!0}),boolean:e=>ea.create({...e,coerce:!0}),bigint:e=>eo.create({...e,coerce:!0}),date:e=>es.create({...e,coerce:!0})},tE=E},71383:(e,t,r)=>{"use strict";let n=r(70965),i=Symbol("max"),o=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),u=Symbol("maxAge"),c=Symbol("dispose"),l=Symbol("noDisposeOnSet"),f=Symbol("lruList"),d=Symbol("cache"),p=Symbol("updateAgeOnGet"),h=()=>1;class y{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw TypeError("max must be a non-negative number");this[i]=e.max||1/0;let t=e.length||h;if(this[a]="function"!=typeof t?h:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw TypeError("maxAge must be a number");this[u]=e.maxAge||0,this[c]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw TypeError("max must be a non-negative number");this[i]=e||1/0,b(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw TypeError("maxAge must be a non-negative number");this[u]=e,b(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[a]&&(this[a]=e,this[o]=0,this[f].forEach(e=>{e.length=this[a](e.value,e.key),this[o]+=e.length})),b(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[f].length}rforEach(e,t){t=t||this;for(let r=this[f].tail;null!==r;){let n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[f].head;null!==r;){let n=r.next;w(this,e,r,t),r=n}}keys(){return this[f].toArray().map(e=>e.key)}values(){return this[f].toArray().map(e=>e.value)}reset(){this[c]&&this[f]&&this[f].length&&this[f].forEach(e=>this[c](e.key,e.value)),this[d]=new Map,this[f]=new n,this[o]=0}dump(){return this[f].map(e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[f]}set(e,t,r){if((r=r||this[u])&&"number"!=typeof r)throw TypeError("maxAge must be a number");let n=r?Date.now():0,s=this[a](t,e);if(this[d].has(e)){if(s>this[i])return _(this,this[d].get(e)),!1;let a=this[d].get(e).value;return this[c]&&!this[l]&&this[c](e,a.value),a.now=n,a.maxAge=r,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),b(this),!0}let p=new v(e,t,s,n,r);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[f].unshift(p),this[d].set(e,this[f].head),b(this),!0)}has(e){return!!this[d].has(e)&&!m(this,this[d].get(e).value)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){let e=this[f].tail;return e?(_(this,e),e.value):null}del(e){_(this,this[d].get(e))}load(e){this.reset();let t=Date.now();for(let r=e.length-1;r>=0;r--){let n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{let e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach((e,t)=>g(this,t,!1))}}let g=(e,t,r)=>{let n=e[d].get(t);if(n){let t=n.value;if(m(e,t)){if(_(e,n),!e[s])return}else r&&(e[p]&&(n.value.now=Date.now()),e[f].unshiftNode(n));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;let r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[u]&&r>e[u]},b=e=>{if(e[o]>e[i])for(let t=e[f].tail;e[o]>e[i]&&null!==t;){let r=t.prev;_(e,t),t=r}},_=(e,t)=>{if(t){let r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[f].removeNode(t)}};class v{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}let w=(e,t,r,n)=>{let i=r.value;m(e,i)&&(_(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=y},74931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workUnitAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(64054).createAsyncLocalStorage)()},75356:(e,t,r)=>{var n="/";!function(){var t={452:function(e){"use strict";e.exports=r(19110)}},i={};function o(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}},a=!0;try{t[e](n,n.exports,o),a=!1}finally{a&&delete i[e]}return n.exports}o.ab=n+"/";var a={};!function(){var e,t=a,r=(e=o(452))&&"object"==typeof e&&"default"in e?e.default:e,n=/https?|ftp|gopher|file/;function i(e){"string"==typeof e&&(e=_(e));var t=function(e,t,r){var n=e.auth,i=e.hostname,o=e.protocol||"",a=e.pathname||"",s=e.hash||"",u=e.query||"",c=!1;n=n?encodeURIComponent(n).replace(/%3A/i,":")+"@":"",e.host?c=n+e.host:i&&(c=n+(~i.indexOf(":")?"["+i+"]":i),e.port&&(c+=":"+e.port)),u&&"object"==typeof u&&(u=t.encode(u));var l=e.search||u&&"?"+u||"";return o&&":"!==o.substr(-1)&&(o+=":"),e.slashes||(!o||r.test(o))&&!1!==c?(c="//"+(c||""),a&&"/"!==a[0]&&(a="/"+a)):c||(c=""),s&&"#"!==s[0]&&(s="#"+s),l&&"?"!==l[0]&&(l="?"+l),{protocol:o,host:c,pathname:a=a.replace(/[?#]/g,encodeURIComponent),search:l=l.replace("#","%23"),hash:s}}(e,r,n);return""+t.protocol+t.host+t.pathname+t.search+t.hash}var s="http://",u="w.w",c=s+u,l=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,f=/https?|ftp|gopher|file/;function d(e,t){var r="string"==typeof e?_(e):e;e="object"==typeof e?i(e):e;var n=_(t),o="";r.protocol&&!r.slashes&&(o=r.protocol,e=e.replace(r.protocol,""),o+="/"===t[0]||"/"===e[0]?"/":""),o&&n.protocol&&(o="",n.slashes||(o=n.protocol,t=t.replace(n.protocol,"")));var a=e.match(l);a&&!n.protocol&&(e=e.substr((o=a[1]+(a[2]||"")).length),/^\/\/[^/]/.test(t)&&(o=o.slice(0,-1)));var u=new URL(e,c+"/"),d=new URL(t,u).toString().replace(c,""),p=n.protocol||r.protocol;return p+=r.slashes||n.slashes?"//":"",!o&&p?d=d.replace(s,p):o&&(d=d.replace(s,"")),f.test(d)||~t.indexOf(".")||"/"===e.slice(-1)||"/"===t.slice(-1)||"/"!==d.slice(-1)||(d=d.slice(0,-1)),o&&(d=o+("/"===d[0]?d.substr(1):d)),d}function p(){}p.prototype.parse=_,p.prototype.format=i,p.prototype.resolve=d,p.prototype.resolveObject=d;var h=/^https?|ftp|gopher|file/,y=/^(.*?)([#?].*)/,g=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,m=/^([a-z0-9.+-]*:)?\/\/\/*/i,b=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function _(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=!1),e&&"object"==typeof e&&e instanceof p)return e;var o=(e=e.trim()).match(y);e=o?o[1].replace(/\\/g,"/")+o[2]:e.replace(/\\/g,"/"),b.test(e)&&"/"!==e.slice(-1)&&(e+="/");var a=!/(^javascript)/.test(e)&&e.match(g),s=m.test(e),l="";a&&(h.test(a[1])||(l=a[1].toLowerCase(),e=""+a[2]+a[3]),a[2]||(s=!1,h.test(a[1])?(l=a[1],e=""+a[3]):e="//"+a[3]),3!==a[2].length&&1!==a[2].length||(l=a[1],e="/"+a[3]));var f,d=(o?o[1]:e).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),_=d&&d[1],v=new p,w="",E="";try{f=new URL(e)}catch(t){w=t,l||n||!/^\/\//.test(e)||/^\/\/.+[@.]/.test(e)||(E="/",e=e.substr(1));try{f=new URL(e,c)}catch(e){return v.protocol=l,v.href=l,v}}v.slashes=s&&!E,v.host=f.host===u?"":f.host,v.hostname=f.hostname===u?"":f.hostname.replace(/(\[|\])/g,""),v.protocol=w?l||null:f.protocol,v.search=f.search.replace(/\\/g,"%5C"),v.hash=f.hash.replace(/\\/g,"%5C");var S=e.split("#");!v.search&&~S[0].indexOf("?")&&(v.search="?"),v.hash||""!==S[1]||(v.hash="#"),v.query=t?r.decode(f.search.substr(1)):v.search.substr(1),v.pathname=E+(a?function(e){return e.replace(/['^|`]/g,function(e){return"%"+e.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(e,t){try{return decodeURIComponent(t).split("").map(function(e){var t=e.charCodeAt();return t>256||/^[a-z0-9]$/i.test(e)?e:"%"+t.toString(16).toUpperCase()}).join("")}catch(e){return t}})}(f.pathname):f.pathname),"about:"===v.protocol&&"blank"===v.pathname&&(v.protocol="",v.pathname=""),w&&"/"!==e[0]&&(v.pathname=v.pathname.substr(1)),l&&!h.test(l)&&"/"!==e.slice(-1)&&"/"===v.pathname&&(v.pathname=""),v.path=v.pathname+v.search,v.auth=[f.username,f.password].map(decodeURIComponent).filter(Boolean).join(":"),v.port=f.port,_&&!v.host.endsWith(_)&&(v.host+=_,v.port=_.slice(1)),v.href=E?""+v.pathname+v.search+v.hash:i(v);var A=/^(file)/.test(v.href)?["host","hostname"]:[];return Object.keys(v).forEach(function(e){~A.indexOf(e)||(v[e]=v[e]||null)}),v}t.parse=_,t.format=i,t.resolve=d,t.resolveObject=function(e,t){return _(d(e,t))},t.Url=p}(),e.exports=a}()},75704:e=>{let t=/^\d+$/;function r(e){if(e.includes("://"))return!0;let r=e.replace(/(\/|\?)/g,"#").split("#")[0];if(r.includes(":")){let e=r.indexOf(":"),n=r.slice(e+1);if(!t.test(n))return!0}return!1}function n(e){if(!e.includes("@"))return!1;let t=e.split("@"),r=t[t.length-1];return!(r.includes(":")||r.includes("/")||r.includes("?"))}e.exports=function(e){let t;if("string"!=typeof e)throw TypeError("input must be a string");return(t=r(e)?e:n(e)?`acct:${e}`:`https://${e}`).split("#")[0]}},75759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBody=o,t.setCookie=i,t.toResponse=a;var n=r(83074);function i(e,t){var r;let i=null!=(r=e.getHeader("Set-Cookie"))?r:[];Array.isArray(i)||(i=[i]);let{name:o,value:a,options:s}=t,u=(0,n.serialize)(o,a,s);i.push(u),e.setHeader("Set-Cookie",i)}async function o(e){if(!("body"in e)||!e.body||"POST"!==e.method)return;let t=e.headers.get("content-type");return null!=t&&t.includes("application/json")?await e.json():null!=t&&t.includes("application/x-www-form-urlencoded")?Object.fromEntries(new URLSearchParams(await e.text())):void 0}function a(e){var t,r,i;let o=new Headers(null==(t=e.headers)?void 0:t.reduce((e,{key:t,value:r})=>(e[t]=r,e),{}));null==(r=e.cookies)||r.forEach(e=>{let{name:t,value:r,options:i}=e,a=(0,n.serialize)(t,r,i);o.has("Set-Cookie")?o.append("Set-Cookie",a):o.set("Set-Cookie",a)});let a=e.body;"application/json"===o.get("content-type")?a=JSON.stringify(e.body):"application/x-www-form-urlencoded"===o.get("content-type")&&(a=new URLSearchParams(e.body).toString());let s=new Response(a,{headers:o,status:e.redirect?302:null!=(i=e.status)?i:200});return e.redirect&&s.headers.set("Location",e.redirect),s}},76510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCSRFToken=i;var n=r(8777);function i({options:e,cookieValue:t,isPost:r,bodyValue:i}){if(t){let[o,a]=t.split("|");if(a===(0,n.createHash)("sha256").update(`${o}${e.secret}`).digest("hex"))return{csrfTokenVerified:r&&o===i,csrfToken:o}}let o=(0,n.randomBytes)(32).toString("hex"),a=(0,n.createHash)("sha256").update(`${o}${e.secret}`).digest("hex");return{cookie:`${o}|${a}`,csrfToken:o}}},76688:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HeadersAdapter:function(){return o},ReadonlyHeadersError:function(){return i}});let n=r(93107);class i extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new i}}class o extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,i){if("symbol"==typeof r)return n.ReflectAdapter.get(t,r,i);let o=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===o);if(void 0!==a)return n.ReflectAdapter.get(t,a,i)},set(t,r,i,o){if("symbol"==typeof r)return n.ReflectAdapter.set(t,r,i,o);let a=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===a);return n.ReflectAdapter.set(t,s??r,i,o)},has(t,r){if("symbol"==typeof r)return n.ReflectAdapter.has(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0!==o&&n.ReflectAdapter.has(t,o)},deleteProperty(t,r){if("symbol"==typeof r)return n.ReflectAdapter.deleteProperty(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===o||n.ReflectAdapter.deleteProperty(t,o)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return i.callable;default:return n.ReflectAdapter.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},76733:(e,t,r)=>{var n="/",i=r(49509),o=r(44134).Buffer;!function(){var t={992:function(e){e.exports=function(e,r,n){if(e.filter)return e.filter(r,n);if(null==e||"function"!=typeof r)throw TypeError();for(var i=[],o=0;o1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;ie.length)&&(r=e.length),e.substring(r-t.length,r)===t}function E(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}var S="",A="",k="",x="",O={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},T=10;function R(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function P(e){return _(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function j(e,t,r){var n="",o="",a=0,s="",u=!1,c=P(e),l=c.split("\n"),f=P(t).split("\n"),d=0,p="";if("strictEqual"===r&&"object"===b(e)&&"object"===b(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===f.length&&l[0]!==f[0]){var h=l[0].length+f[0].length;if(h<=T){if(("object"!==b(e)||null===e)&&("object"!==b(t)||null===t)&&(0!==e||0!==t))return"".concat(O[r],"\n\n")+"".concat(l[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&h<(i.stderr&&i.stderr.isTTY?i.stderr.columns:80)){for(;l[0][d]===f[0][d];)d++;d>2&&(p="\n ".concat(E(" ",d),"^"),d=0)}}for(var y=l[l.length-1],g=f[f.length-1];y===g&&(d++<2?s="\n ".concat(y).concat(s):n=y,l.pop(),f.pop(),0!==l.length&&0!==f.length);)y=l[l.length-1],g=f[f.length-1];var m=Math.max(l.length,f.length);if(0===m){var _=c.split("\n");if(_.length>30)for(_[26]="".concat(S,"...").concat(x);_.length>27;)_.pop();return"".concat(O.notIdentical,"\n\n").concat(_.join("\n"),"\n")}d>3&&(s="\n".concat(S,"...").concat(x).concat(s),u=!0),""!==n&&(s="\n ".concat(n).concat(s),n="");var v=0,R=O[r]+"\n".concat(A,"+ actual").concat(x," ").concat(k,"- expected").concat(x),j=" ".concat(S,"...").concat(x," Lines skipped");for(d=0;d1&&d>2&&(C>4?(o+="\n".concat(S,"...").concat(x),u=!0):C>3&&(o+="\n ".concat(f[d-2]),v++),o+="\n ".concat(f[d-1]),v++),a=d,n+="\n".concat(k,"-").concat(x," ").concat(f[d]),v++;else if(f.length1&&d>2&&(C>4?(o+="\n".concat(S,"...").concat(x),u=!0):C>3&&(o+="\n ".concat(l[d-2]),v++),o+="\n ".concat(l[d-1]),v++),a=d,o+="\n".concat(A,"+").concat(x," ").concat(l[d]),v++;else{var I=f[d],U=l[d],N=U!==I&&(!w(U,",")||U.slice(0,-1)!==I);N&&w(I,",")&&I.slice(0,-1)===U&&(N=!1,U+=","),N?(C>1&&d>2&&(C>4?(o+="\n".concat(S,"...").concat(x),u=!0):C>3&&(o+="\n ".concat(l[d-2]),v++),o+="\n ".concat(l[d-1]),v++),a=d,o+="\n".concat(A,"+").concat(x," ").concat(U),n+="\n".concat(k,"-").concat(x," ").concat(I),v+=2):(o+=n,n="",(1===C||0===d)&&(o+="\n ".concat(U),v++))}if(v>20&&d30)for(h[26]="".concat(S,"...").concat(x);h.length>27;)h.pop();r=1===h.length?c(this,m(t).call(this,"".concat(p," ").concat(h[0]))):c(this,m(t).call(this,"".concat(p,"\n\n").concat(h.join("\n"),"\n")))}else{var y=P(u),g="",_=O[o];"notDeepEqual"===o||"notEqual"===o?(y="".concat(O[o],"\n\n").concat(y)).length>1024&&(y="".concat(y.slice(0,1021),"...")):(g="".concat(P(f)),y.length>512&&(y="".concat(y.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===o||"equal"===o?y="".concat(_,"\n\n").concat(y,"\n\nshould equal\n\n"):g=" ".concat(o," ").concat(g)),r=c(this,m(t).call(this,"".concat(y).concat(g)))}return Error.stackTraceLimit=d,r.generatedMessage=!n,Object.defineProperty(l(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=f,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(l(r),s),r.stack,r.name="AssertionError",c(r)}return f(t,e),u(t,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:_.custom,value:function(e,t){return _(this,n({},t,{customInspect:!1,depth:0}))}}]),t}(d(Error))},23:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function o(e,t){return t&&("object"===n(t)||"function"==typeof t)?t:a(e)}function a(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l,f,d={};function p(e,t,r){function n(e,r,n){return"string"==typeof t?t:t(e,r,n)}r||(r=Error);var a=function(t){function r(t,a,u){var c;return i(this,r),(c=o(this,s(r).call(this,n(t,a,u)))).code=e,c}return u(r,t),r}(r);d[e]=a}function h(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));var r=e.length;return(e=e.map(function(e){return String(e)}),r>2)?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}function y(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function g(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function m(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}p("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),p("ERR_INVALID_ARG_TYPE",function(e,t,i){if(void 0===l&&(l=r(167)),l("string"==typeof e,"'name' must be a string"),"string"==typeof t&&y(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be",g(e," argument"))a="The ".concat(e," ").concat(o," ").concat(h(t,"type"));else{var o,a,s=m(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(s," ").concat(o," ").concat(h(t,"type"))}return a+". Received type ".concat(n(i))},TypeError),p("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===f&&(f=r(177));var i=f.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)},TypeError,RangeError),p("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError),p("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")},TypeError),e.exports.codes=d},176:function(e,t,r){"use strict";function n(e,t){return a(e)||o(e,t)||i()}function i(){throw TypeError("Invalid attempt to destructure non-iterable instance")}function o(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}function a(e){if(Array.isArray(e))return e}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var u=void 0!==/a/g.flags,c=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},l=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},f=Object.is?Object.is:r(208),d=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},p=Number.isNaN?Number.isNaN:r(718);function h(e){return e.call.bind(e)}var y=h(Object.prototype.hasOwnProperty),g=h(Object.prototype.propertyIsEnumerable),m=h(Object.prototype.toString),b=r(177).types,_=b.isAnyArrayBuffer,v=b.isArrayBufferView,w=b.isDate,E=b.isMap,S=b.isRegExp,A=b.isSet,k=b.isNativeError,x=b.isBoxedPrimitive,O=b.isNumberObject,T=b.isStringObject,R=b.isBooleanObject,P=b.isBigIntObject,j=b.isSymbolObject,C=b.isFloat32Array,I=b.isFloat64Array;function U(e){if(0===e.length||e.length>10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=0x100000000}function N(e){return Object.keys(e).filter(U).concat(d(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function M(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i-1?i(r):r}},139:function(e,t,r){"use strict";var n=r(212),i=r(192),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=s(n,a,arguments);return u&&c&&u(t,"length").configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))}),t};var f=function(){return s(n,o,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},69:function(e,t,r){"use strict";var n=r(935),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=function(e){return"function"==typeof e&&"[object Function]"===o.call(e)},c=function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}},l=s&&c(),f=function(e,t,r,n){(!(t in e)||u(n)&&n())&&(l?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},d=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=U(e),n=r.length>0?r[0]:"",i=N("%"+n+"%",t),o=i.name,a=i.value,s=!1,l=i.alias;l&&(n=l[0],T(r,O([0,1],l)));for(var f=1,d=!0;f=r.length){var m=p(a,h);a=(d=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[h]}else d=x(a,h),a=a[h];d&&!s&&(w[o]=a)}}return a}},14:function(e){"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return({__proto__:t}).foo===t.foo&&!(t instanceof r)}},942:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(773);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},773:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;var n=42;for(t in e[t]=n,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==n||!0!==o.enumerable)return!1}return!0}},115:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(832);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},832:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;var n=42;for(t in e[t]=n,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==n||!0!==o.enumerable)return!1}return!0}},270:function(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;e.exports=r(212).call(n,i)},782:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},157:function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(e){return(!t||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===r.call(e)},i=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r.call(e)&&"[object Function]"===r.call(e.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,e.exports=o?n:i},391:function(e){"use strict";var t=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(e){}}(),s=a?o(a):{};e.exports=function(e){return"function"==typeof e&&(!!n.test(r.call(e))||(i?o(e)===s:"[object GeneratorFunction]"===t.call(e)))}},460:function(e){"use strict";e.exports=function(e){return e!=e}},718:function(e,t,r){"use strict";var n=r(139),i=r(69),o=r(460),a=r(625),s=r(171),u=n(a(),Number);i(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},625:function(e,t,r){"use strict";var n=r(460);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},171:function(e,t,r){"use strict";var n=r(69),i=r(625);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},994:function(e,t,n){"use strict";var i=n(144),o=n(349),a=n(256),s=a("Object.prototype.toString"),u=n(942)()&&"symbol"==typeof Symbol.toStringTag,c=o(),l=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1)}},208:function(e){"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:!!(e===r||t(e)&&t(r))}},579:function(e,t,r){"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(412),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}(),h=function(e){if("undefined"==typeof window||!p)return f(e);try{return f(e)}catch(e){return!1}};n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=a(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!n)throw TypeError("Object.keys called on a non-object");var d=c&&r;if(s&&e.length>0&&!i.call(e,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===t.call(e.callee)),n}},369:function(e){e.exports=function(e){return e instanceof o}},584:function(e,t,r){"use strict";var n=r(157),i=r(391),o=r(490),a=r(994);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),f=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(u)var h=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===l(e)}function b(e){return"[object Set]"===l(e)}function _(e){return"[object WeakMap]"===l(e)}function v(e){return"[object WeakSet]"===l(e)}function w(e){return"[object ArrayBuffer]"===l(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(w.working?w(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===l(e)}function A(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(_.working?_(e):e instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),t.isWeakSet=function(e){return v(e)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),t.isArrayBuffer=E,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(e){return"[object SharedArrayBuffer]"===l(e)}function O(e){return void 0!==k&&(void 0===x.working&&(x.working=x(new k)),x.working?x(e):e instanceof k)}function T(e){return g(e,f)}function R(e){return g(e,d)}function P(e){return g(e,p)}function j(e){return u&&g(e,h)}function C(e){return c&&g(e,y)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=T,t.isStringObject=R,t.isBooleanObject=P,t.isBigIntObject=j,t.isSymbolObject=C,t.isBoxedPrimitive=function(e){return T(e)||R(e)||P(e)||j(e)||C(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})},177:function(e,t,r){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),v(r)?n.showHidden=r:r&&t._extend(n,r),A(n.showHidden)&&(n.showHidden=!1),A(n.depth)&&(n.depth=2),A(n.colors)&&(n.colors=!1),A(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),p(n,e,n.depth)}function l(e,t){var r=c.styles[t];return r?"\x1b["+c.colors[r][0]+"m"+e+"\x1b["+c.colors[r][1]+"m":e}function f(e,t){return e}function d(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function p(e,r,n){if(e.customInspect&&r&&R(r.inspect)&&r.inspect!==t.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o=r.inspect(n,e);return S(o)||(o=p(e,o,n)),o}var a=h(e,r);if(a)return a;var s=Object.keys(r),u=d(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return y(r);if(0===s.length){if(R(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(k(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(O(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return y(r)}var l="",f=!1,v=["{","}"];if(_(r)&&(f=!0,v=["[","]"]),R(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),k(r)&&(l=" "+RegExp.prototype.toString.call(r)),O(r)&&(l=" "+Date.prototype.toUTCString.call(r)),T(r)&&(l=" "+y(r)),0===s.length&&(!f||0==r.length))return v[0]+l+v[1];if(n<0)if(k(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");else return e.stylize("[Object]","special");return e.seen.push(r),i=f?g(e,r,n,u,s):s.map(function(t){return m(e,r,n,u,t,f)}),e.seen.pop(),b(i,l,v)}function h(e,t){if(A(t))return e.stylize("undefined","undefined");if(S(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return E(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):w(t)?e.stylize("null","null"):void 0}function y(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i){for(var o=[],a=0,s=t.length;ae.seen.indexOf(u.value)?(s=w(r)?p(e,u.value,null):p(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),A(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function b(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function _(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function w(e){return null===e}function E(e){return"number"==typeof e}function S(e){return"string"==typeof e}function A(e){return void 0===e}function k(e){return x(e)&&"[object RegExp]"===P(e)}function x(e){return"object"==typeof e&&null!==e}function O(e){return x(e)&&"[object Date]"===P(e)}function T(e){return x(e)&&("[object Error]"===P(e)||e instanceof Error)}function R(e){return"function"==typeof e}function P(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(!a[e=e.toUpperCase()])if(s.test(e)){var r=i.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(584),t.isArray=_,t.isBoolean=v,t.isNull=w,t.isNullOrUndefined=function(e){return null==e},t.isNumber=E,t.isString=S,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=A,t.isRegExp=k,t.types.isRegExp=k,t.isObject=x,t.isDate=O,t.types.isDate=O,t.isError=T,t.types.isNativeError=T,t.isFunction=R,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(369);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}function U(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",I(),t.format.apply(t,arguments))},t.inherits=r(782),t._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var N="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function M(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(N&&e[N]){var t=e[N];if("function"!=typeof t)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,N,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o{"use strict";Object.defineProperty(t,"B",{value:!0}),Object.defineProperty(t,"U",{enumerable:!0,get:function(){return d}});let n=r(16397),i=r(22116),o=r(85744),a=r(9597),s=r(87101),u=r(11881),c=r(44536),l=r(35260),f=(r(4117),r(65867));function d(){let e="cookies",t=o.workAsyncStorage.getStore(),r=a.workUnitAsyncStorage.getStore();if(t){if(r&&"after"===r.phase&&!(0,f.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:"E88",enumerable:!1,configurable:!0});if(t.forceStatic)return g(p());if(r){if("cache"===r.type)throw 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:"E398",enumerable:!1,configurable:!0});else if("unstable-cache"===r.type)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:"E157",enumerable:!1,configurable:!0})}if(t.dynamicShouldError)throw Object.defineProperty(new u.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:"E549",enumerable:!1,configurable:!0});if(r)if("prerender"===r.type)return y(t.route,r);else"prerender-ppr"===r.type?(0,s.postponeWithTracking)(t.route,e,r.dynamicTracking):"prerender-legacy"===r.type&&(0,s.throwToInterruptStaticGeneration)(e,t,r);(0,s.trackDynamicDataInDynamicRender)(t,r)}let i=(0,a.getExpectedRequestStore)(e);return g((0,n.areCookiesMutableInCurrentPhase)(i)?i.userspaceMutableCookies:i.cookies)}function p(){return n.RequestCookiesAdapter.seal(new i.RequestCookies(new Headers({})))}let h=new WeakMap;function y(e,t){let r=h.get(t);if(r)return r;let n=(0,c.makeHangingPromise)(t.renderSignal,"`cookies()`");return h.set(t,n),Object.defineProperties(n,{[Symbol.iterator]:{value:function(){let r="`cookies()[Symbol.iterator]()`",n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},size:{get(){let r="`cookies().size`",n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},get:{value:function(){let r;r=0==arguments.length?"`cookies().get()`":`\`cookies().get(${m(arguments[0])})\``;let n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},getAll:{value:function(){let r;r=0==arguments.length?"`cookies().getAll()`":`\`cookies().getAll(${m(arguments[0])})\``;let n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},has:{value:function(){let r;r=0==arguments.length?"`cookies().has()`":`\`cookies().has(${m(arguments[0])})\``;let n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},set:{value:function(){let r;if(0==arguments.length)r="`cookies().set()`";else{let e=arguments[0];r=e?`\`cookies().set(${m(e)}, ...)\``:"`cookies().set(...)`"}let n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},delete:{value:function(){let r;r=0==arguments.length?"`cookies().delete()`":1==arguments.length?`\`cookies().delete(${m(arguments[0])})\``:`\`cookies().delete(${m(arguments[0])}, ...)\``;let n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},clear:{value:function(){let r="`cookies().clear()`",n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}},toString:{value:function(){let r="`cookies().toString()`",n=_(e,r);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(e,r,n,t)}}}),n}function g(e){let t=h.get(e);if(t)return t;let r=Promise.resolve(e);return h.set(e,r),Object.defineProperties(r,{[Symbol.iterator]:{value:e[Symbol.iterator]?e[Symbol.iterator].bind(e):v.bind(e)},size:{get:()=>e.size},get:{value:e.get.bind(e)},getAll:{value:e.getAll.bind(e)},has:{value:e.has.bind(e)},set:{value:e.set.bind(e)},delete:{value:e.delete.bind(e)},clear:{value:"function"==typeof e.clear?e.clear.bind(e):w.bind(e,r)},toString:{value:e.toString.bind(e)}}),r}function m(e){return"object"==typeof e&&null!==e&&"string"==typeof e.name?`'${e.name}'`:"string"==typeof e?`'${e}'`:"..."}let b=(0,l.createDedupedByCallsiteServerErrorLoggerDev)(_);function _(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`cookies()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E223",enumerable:!1,configurable:!0})}function v(){return this.getAll().map(e=>[e.name,e]).values()}function w(e){for(let e of this.getAll())this.delete(e.name);return e}},76823:(e,t,r)=>{"use strict";var n;n={value:!0},Object.defineProperty(t,"r",{enumerable:!0,get:function(){return l}});let i=r(9597),o=r(85744),a=r(87101),s=r(35260),u=r(11881),c=r(39439);function l(){let e="draftMode",t=o.workAsyncStorage.getStore(),r=i.workUnitAsyncStorage.getStore();switch((!t||!r)&&(0,i.throwForMissingRequestStore)(e),r.type){case"request":return f(r.draftMode,t);case"cache":case"unstable-cache":let n=(0,i.getDraftModeProviderForCacheScope)(t,r);if(n)return f(n,t);case"prerender":case"prerender-ppr":case"prerender-legacy":return p(null);default:return r}}function f(e,t){let r,n=d.get(l);return n||(r=p(e),d.set(e,r),r)}let d=new WeakMap;function p(e){let t=new h(e),r=Promise.resolve(t);return Object.defineProperty(r,"isEnabled",{get:()=>t.isEnabled,set(e){Object.defineProperty(r,"isEnabled",{value:e,writable:!0,enumerable:!0})},enumerable:!0,configurable:!0}),r.enable=t.enable.bind(t),r.disable=t.disable.bind(t),r}class h{constructor(e){this._provider=e}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){m("draftMode().enable()"),null!==this._provider&&this._provider.enable()}disable(){m("draftMode().disable()"),null!==this._provider&&this._provider.disable()}}let y=(0,s.createDedupedByCallsiteServerErrorLoggerDev)(g);function g(e,t){let r=e?`Route "${e}" `:"This route ";return Object.defineProperty(Error(`${r}used ${t}. \`draftMode()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E377",enumerable:!1,configurable:!0})}function m(e){let t=o.workAsyncStorage.getStore(),r=i.workUnitAsyncStorage.getStore();if(t){if(r){if("cache"===r.type)throw Object.defineProperty(Error(`Route ${t.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:"E246",enumerable:!1,configurable:!0});else if("unstable-cache"===r.type)throw Object.defineProperty(Error(`Route ${t.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:"E259",enumerable:!1,configurable:!0});else if("after"===r.phase)throw Object.defineProperty(Error(`Route ${t.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:"E348",enumerable:!1,configurable:!0})}if(t.dynamicShouldError)throw Object.defineProperty(new u.StaticGenBailoutError(`Route ${t.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(r){if("prerender"===r.type){let n=Object.defineProperty(Error(`Route ${t.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});(0,a.abortAndThrowOnSynchronousRequestDataAccess)(t.route,e,n,r)}else if("prerender-ppr"===r.type)(0,a.postponeWithTracking)(t.route,e,r.dynamicTracking);else if("prerender-legacy"===r.type){r.revalidate=0;let n=Object.defineProperty(new c.DynamicServerError(`Route ${t.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 t.dynamicUsageDescription=e,t.dynamicUsageStack=n.stack,n}}}}},78229:module=>{var __dirname="/";!function(){var __webpack_modules__={950:function(__unused_webpack_module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r{var n="/";!function(){var t={528:function(e,t,r){var n=r(685),i=r(310),o=e.exports;for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);function s(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}o.request=function(e,t){return e=s(e),n.request.call(this,e,t)},o.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},685:function(e){"use strict";e.exports=r(36088)},310:function(e){"use strict";e.exports=r(75356)}},i={};function o(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}},a=!0;try{t[e](n,n.exports,o),a=!1}finally{a&&delete i[e]}return n.exports}o.ab=n+"/",e.exports=o(528)}()},80208:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";r.r(t),r.d(t,{NIL:()=>D,parse:()=>g,stringify:()=>d,v1:()=>y,v3:()=>C,v4:()=>I,v5:()=>M,validate:()=>c,version:()=>H});var n,i,o,a=new Uint8Array(16);function s(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(a)}let u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,c=function(e){return"string"==typeof e&&u.test(e)};for(var l=[],f=0;f<256;++f)l.push((f+256).toString(16).substr(1));let d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!c(r))throw TypeError("Stringified UUID is invalid");return r};var p=0,h=0;let y=function(e,t,r){var n=t&&r||0,a=t||Array(16),u=(e=e||{}).node||i,c=void 0!==e.clockseq?e.clockseq:o;if(null==u||null==c){var l=e.random||(e.rng||s)();null==u&&(u=i=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==c&&(c=o=(l[6]<<8|l[7])&16383)}var f=void 0!==e.msecs?e.msecs:Date.now(),y=void 0!==e.nsecs?e.nsecs:h+1,g=f-p+(y-h)/1e4;if(g<0&&void 0===e.clockseq&&(c=c+1&16383),(g<0||f>p)&&void 0===e.nsecs&&(y=0),y>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");p=f,h=y,o=c;var m=((0xfffffff&(f+=122192928e5))*1e4+y)%0x100000000;a[n++]=m>>>24&255,a[n++]=m>>>16&255,a[n++]=m>>>8&255,a[n++]=255&m;var b=f/0x100000000*1e4&0xfffffff;a[n++]=b>>>8&255,a[n++]=255&b,a[n++]=b>>>24&15|16,a[n++]=b>>>16&255,a[n++]=c>>>8|128,a[n++]=255&c;for(var _=0;_<6;++_)a[n+_]=u[_];return t||d(a)},g=function(e){if(!c(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/0x10000000000&255,r[11]=t/0x100000000&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function m(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r>5]>>>i%32&255,a=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);t.push(a)}return t}function E(e){return(e+64>>>9<<4)+14+1}function S(e,t){e[t>>5]|=128<>5]|=(255&e[n/8])<>16)+(t>>16)+(r>>16)<<16|65535&r}function x(e,t){return e<>>32-t}function O(e,t,r,n,i,o){return k(x(k(k(t,e),k(n,o)),i),r)}function T(e,t,r,n,i,o,a){return O(t&r|~t&n,e,t,i,o,a)}function R(e,t,r,n,i,o,a){return O(t&n|r&~n,e,t,i,o,a)}function P(e,t,r,n,i,o,a){return O(t^r^n,e,t,i,o,a)}function j(e,t,r,n,i,o,a){return O(r^(t|~n),e,t,i,o,a)}let C=v("v3",48,function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r>>32-t}let M=v("v5",80,function(e){var t=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i>>0;b=m,m=g,g=N(y,30)>>>0,y=h,h=w}r[0]=r[0]+h>>>0,r[1]=r[1]+y>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}),D="00000000-0000-0000-0000-000000000000",H=function(e){if(!c(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},82466:(e,t)=>{"use strict";function r(e,t){i(e,t),t.add(e)}function n(e,t,r){i(e,t),t.set(e,r)}function i(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function o(e,t){return e.get(s(e,t))}function a(e,t,r){return e.set(s(e,t),r),r}function s(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}Object.defineProperty(t,"__esModule",{value:!0}),t.SessionStore=void 0,t.defaultCookies=f;let u=4096,c=163,l=3933;function f(e){let t=e?"__Secure-":"";return{sessionToken:{name:`${t}next-auth.session-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},callbackUrl:{name:`${t}next-auth.callback-url`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},csrfToken:{name:`${e?"__Host-":""}next-auth.csrf-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},pkceCodeVerifier:{name:`${t}next-auth.pkce.code_verifier`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},state:{name:`${t}next-auth.state`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},nonce:{name:`${t}next-auth.nonce`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}}}}var d=new WeakMap,p=new WeakMap,h=new WeakMap,y=new WeakSet;class g{constructor(e,t,i){r(this,y),n(this,d,{}),n(this,p,void 0),n(this,h,void 0),a(h,this,i),a(p,this,e);let{cookies:s}=t,{name:u}=e;if("function"==typeof(null==s?void 0:s.getAll))for(let{name:e,value:t}of s.getAll())e.startsWith(u)&&(o(d,this)[e]=t);else if(s instanceof Map)for(let e of s.keys())e.startsWith(u)&&(o(d,this)[e]=s.get(e));else for(let e in s)e.startsWith(u)&&(o(d,this)[e]=s[e])}get value(){return Object.keys(o(d,this)).sort((e,t)=>{var r,n;return parseInt(null!=(r=e.split(".").pop())?r:"0")-parseInt(null!=(n=t.split(".").pop())?n:"0")}).map(e=>o(d,this)[e]).join("")}chunk(e,t){let r=s(y,this,b).call(this);for(let n of s(y,this,m).call(this,{name:o(p,this).name,value:e,options:{...o(p,this).options,...t}}))r[n.name]=n;return Object.values(r)}clean(){return Object.values(s(y,this,b).call(this))}}function m(e){let t=Math.ceil(e.value.length/l);if(1===t)return o(d,this)[e.name]=e.value,[e];let r=[];for(let n=0;ne.value.length+c)}),r}function b(){let e={};for(let r in o(d,this)){var t;null==(t=o(d,this))||delete t[r],e[r]={name:r,value:"",options:{...o(p,this).options,maxAge:0}}}return e}t.SessionStore=g},82967:(e,t,r)=>{"use strict";function n(e,t){return t.get?t.get.call(e):t.value}r.r(t),r.d(t,{_:()=>o});var i=r(6004);function o(e,t){var r=(0,i._)(e,t,"get");return n(e,r)}},83074:(e,t)=>{"use strict";t.parse=u,t.serialize=f;var r=Object.prototype.toString,n=Object.prototype.hasOwnProperty,i=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,o=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/;function u(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");var r={},i=e.length;if(i<2)return r;var o=t&&t.decode||d,a=0,s=0,u=0;do{if(-1===(s=e.indexOf("=",a)))break;if(-1===(u=e.indexOf(";",a)))u=i;else if(s>u){a=e.lastIndexOf(";",s-1)+1;continue}var f=c(e,a,s),p=l(e,s,f),y=e.slice(f,p);if(!n.call(r,y)){var g=c(e,s+1,u),m=l(e,u,g);34===e.charCodeAt(g)&&34===e.charCodeAt(m-1)&&(g++,m--);var b=e.slice(g,m);r[y]=h(b,o)}a=u+1}while(ar;){var n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return r}function f(e,t,r){var n=r&&r.encode||encodeURIComponent;if("function"!=typeof n)throw TypeError("option encode is invalid");if(!i.test(e))throw TypeError("argument name is invalid");var u=n(t);if(!o.test(u))throw TypeError("argument val is invalid");var c=e+"="+u;if(!r)return c;if(null!=r.maxAge){var l=Math.floor(r.maxAge);if(!isFinite(l))throw TypeError("option maxAge is invalid");c+="; Max-Age="+l}if(r.domain){if(!a.test(r.domain))throw TypeError("option domain is invalid");c+="; Domain="+r.domain}if(r.path){if(!s.test(r.path))throw TypeError("option path is invalid");c+="; Path="+r.path}if(r.expires){var f=r.expires;if(!p(f)||isNaN(f.valueOf()))throw TypeError("option expires is invalid");c+="; Expires="+f.toUTCString()}if(r.httpOnly&&(c+="; HttpOnly"),r.secure&&(c+="; Secure"),r.partitioned&&(c+="; Partitioned"),r.priority)switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:case"strict":c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"none":c+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return c}function d(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function p(e){return"[object Date]"===r.call(e)}function h(e,t){try{return t(e)}catch(t){return e}}},85744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(17828)},86204:(e,t,r)=>{"use strict";var n=r(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var i=n(r(70283)),o=n(r(61806)),a=r(93673),s=n(r(51792));async function u(e){var t,r,n,u,c,l;let{options:f,query:d,body:p,method:h,headers:y,sessionStore:g}=e,{provider:m,adapter:b,url:_,callbackUrl:v,pages:w,jwt:E,events:S,callbacks:A,session:{strategy:k,maxAge:x},logger:O}=f,T=[],R="jwt"===k;if("oauth"===m.type)try{let{profile:n,account:a,OAuthProfile:s,cookies:u}=await (0,i.default)({query:d,body:p,method:h,options:f,cookies:e.cookies});u.length&&T.push(...u);try{if(O.debug("OAUTH_CALLBACK_RESPONSE",{profile:n,account:a,OAuthProfile:s}),!n||!a||!s)return{redirect:`${_}/signin`,cookies:T};let e=n;if(b){let{getUserByAccount:t}=b,r=await t({providerAccountId:a.providerAccountId,provider:m.id});r&&(e=r)}try{let t=await A.signIn({user:e,account:a,profile:s});if(!t)return{redirect:`${_}/error?error=AccessDenied`,cookies:T};if("string"==typeof t)return{redirect:t,cookies:T}}catch(e){return{redirect:`${_}/error?error=${encodeURIComponent(e.message)}`,cookies:T}}let{user:i,session:u,isNewUser:c}=await (0,o.default)({sessionToken:g.value,profile:n,account:a,options:f});if(R){let e={name:i.name,email:i.email,picture:i.image,sub:null==(r=i.id)?void 0:r.toString()},t=await A.jwt({token:e,user:i,account:a,profile:s,isNewUser:c,trigger:c?"signUp":"signIn"}),n=await E.encode({...E,token:t}),o=new Date;o.setTime(o.getTime()+1e3*x);let u=g.chunk(n,{expires:o});T.push(...u)}else T.push({name:f.cookies.sessionToken.name,value:u.sessionToken,options:{...f.cookies.sessionToken.options,expires:u.expires}});if(await (null==(t=S.signIn)?void 0:t.call(S,{user:i,account:a,profile:n,isNewUser:c})),c&&w.newUser)return{redirect:`${w.newUser}${w.newUser.includes("?")?"&":"?"}callbackUrl=${encodeURIComponent(v)}`,cookies:T};return{redirect:v,cookies:T}}catch(e){if("AccountNotLinkedError"===e.name)return{redirect:`${_}/error?error=OAuthAccountNotLinked`,cookies:T};if("CreateUserError"===e.name)return{redirect:`${_}/error?error=OAuthCreateAccount`,cookies:T};return O.error("OAUTH_CALLBACK_HANDLER_ERROR",e),{redirect:`${_}/error?error=Callback`,cookies:T}}}catch(e){if("OAuthCallbackError"===e.name)return O.error("OAUTH_CALLBACK_ERROR",{error:e,providerId:m.id}),{redirect:`${_}/error?error=OAuthCallback`,cookies:T};return O.error("OAUTH_CALLBACK_ERROR",e),{redirect:`${_}/error?error=Callback`,cookies:T}}if("email"===m.type)try{let e=null==d?void 0:d.token,t=null==d?void 0:d.email;if(!e)return{redirect:`${_}/error?error=configuration`,cookies:T};let r=await b.useVerificationToken({identifier:t,token:(0,a.hashToken)(e,f)});if(!r||r.expires.valueOf(){"use strict";var n=r(56620);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callback",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"providers",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"session",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"signin",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"signout",{enumerable:!0,get:function(){return a.default}});var i=n(r(86204)),o=n(r(40021)),a=n(r(23378)),s=n(r(21345)),u=n(r(61107))},87101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{Postpone:function(){return k},abortAndThrowOnSynchronousRequestDataAccess:function(){return S},abortOnSynchronousPlatformIOAccess:function(){return w},accessedDynamicData:function(){return I},annotateDynamicAccess:function(){return L},consumeDynamicAccess:function(){return U},createDynamicTrackingState:function(){return p},createDynamicValidationState:function(){return h},createHangingInputAbortSignal:function(){return H},createPostponedAbortSignal:function(){return D},formatDynamicAPIAccesses:function(){return N},getFirstDynamicReason:function(){return y},isDynamicPostpone:function(){return T},isPrerenderInterruptedError:function(){return C},markCurrentScopeAsDynamic:function(){return g},postponeWithTracking:function(){return x},throwIfDisallowedDynamic:function(){return z},throwToInterruptStaticGeneration:function(){return b},trackAllowedDynamicAccess:function(){return K},trackDynamicDataInDynamicRender:function(){return _},trackFallbackParamAccessed:function(){return m},trackSynchronousPlatformIOAccessInDev:function(){return E},trackSynchronousRequestDataAccessInDev:function(){return A},useDynamicRouteParams:function(){return B}});let n=f(r(12115)),i=r(39439),o=r(11881),a=r(9597),s=r(85744),u=r(44536),c=r(38287),l=r(4117);function f(e){return e&&e.__esModule?e:{default:e}}let d="function"==typeof n.default.unstable_postpone;function p(e){return{isDebugDynamicAccesses:e,dynamicAccesses:[],syncDynamicExpression:void 0,syncDynamicErrorWithStack:null}}function h(){return{hasSuspendedDynamic:!1,hasDynamicMetadata:!1,hasDynamicViewport:!1,hasSyncDynamicErrors:!1,dynamicErrors:[]}}function y(e){var t;return null==(t=e.dynamicAccesses[0])?void 0:t.expression}function g(e,t,r){if((!t||"cache"!==t.type&&"unstable-cache"!==t.type)&&!e.forceDynamic&&!e.forceStatic){if(e.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${r}\`. 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(t){if("prerender-ppr"===t.type)x(e.route,r,t.dynamicTracking);else if("prerender-legacy"===t.type){t.revalidate=0;let n=Object.defineProperty(new i.DynamicServerError(`Route ${e.route} couldn't be rendered statically because it used ${r}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw e.dynamicUsageDescription=r,e.dynamicUsageStack=n.stack,n}}}}function m(e,t){let r=a.workUnitAsyncStorage.getStore();r&&"prerender-ppr"===r.type&&x(e.route,t,r.dynamicTracking)}function b(e,t,r){let n=Object.defineProperty(new i.DynamicServerError(`Route ${t.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.revalidate=0,t.dynamicUsageDescription=e,t.dynamicUsageStack=n.stack,n}function _(e,t){t&&"cache"!==t.type&&"unstable-cache"!==t.type&&("prerender"===t.type||"prerender-legacy"===t.type)&&(t.revalidate=0)}function v(e,t,r){let n=j(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`);r.controller.abort(n);let i=r.dynamicTracking;i&&i.dynamicAccesses.push({stack:i.isDebugDynamicAccesses?Error().stack:void 0,expression:t})}function w(e,t,r,n){let i=n.dynamicTracking;i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicExpression=t,i.syncDynamicErrorWithStack=r),v(e,t,n)}function E(e){e.prerenderPhase=!1}function S(e,t,r,n){if(!1===n.controller.signal.aborted){let i=n.dynamicTracking;i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicExpression=t,i.syncDynamicErrorWithStack=r,!0===n.validating&&(i.syncDynamicLogged=!0)),v(e,t,n)}throw j(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`)}let A=E;function k({reason:e,route:t}){let r=a.workUnitAsyncStorage.getStore();x(t,e,r&&"prerender-ppr"===r.type?r.dynamicTracking:null)}function x(e,t,r){M(),r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:t}),n.default.unstable_postpone(O(e,t))}function O(e,t){return`Route ${e} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function T(e){return"object"==typeof e&&null!==e&&"string"==typeof e.message&&R(e.message)}function R(e){return e.includes("needs to bail out of prerendering at this point because it used")&&e.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(!1===R(O("%%%","^^^")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});let P="NEXT_PRERENDER_INTERRUPTED";function j(e){let t=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t.digest=P,t}function C(e){return"object"==typeof e&&null!==e&&e.digest===P&&"name"in e&&"message"in e&&e instanceof Error}function I(e){return e.length>0}function U(e,t){return e.dynamicAccesses.push(...t.dynamicAccesses),e.dynamicAccesses}function N(e){return e.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" ()")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}: ${t}`))}function M(){if(!d)throw Object.defineProperty(Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})}function D(e){M();let t=new AbortController;try{n.default.unstable_postpone(e)}catch(e){t.abort(e)}return t.signal}function H(e){let t=new AbortController;return e.cacheSignal?e.cacheSignal.inputReady().then(()=>{t.abort()}):(0,l.scheduleOnNextTick)(()=>t.abort()),t.signal}function L(e,t){let r=t.dynamicTracking;r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:e})}function B(e){let t=s.workAsyncStorage.getStore();if(t&&t.isStaticGeneration&&t.fallbackRouteParams&&t.fallbackRouteParams.size>0){let r=a.workUnitAsyncStorage.getStore();r&&("prerender"===r.type?n.default.use((0,u.makeHangingPromise)(r.renderSignal,e)):"prerender-ppr"===r.type?x(t.route,e,r.dynamicTracking):"prerender-legacy"===r.type&&b(e,t,r))}}let $=/\n\s+at Suspense \(\)/,W=RegExp(`\\n\\s+at ${c.METADATA_BOUNDARY_NAME}[\\n\\s]`),F=RegExp(`\\n\\s+at ${c.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),q=RegExp(`\\n\\s+at ${c.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function K(e,t,r,n,i){if(!q.test(t)){if(W.test(t)){r.hasDynamicMetadata=!0;return}if(F.test(t)){r.hasDynamicViewport=!0;return}if($.test(t)){r.hasSuspendedDynamic=!0;return}else if(n.syncDynamicErrorWithStack||i.syncDynamicErrorWithStack){r.hasSyncDynamicErrors=!0;return}else{let n=J(`Route "${e}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`,t);r.dynamicErrors.push(n);return}}}function J(e,t){let r=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r.stack="Error: "+e+t,r}function z(e,t,r,n){let i,a,s;if(r.syncDynamicErrorWithStack?(i=r.syncDynamicErrorWithStack,a=r.syncDynamicExpression,s=!0===r.syncDynamicLogged):n.syncDynamicErrorWithStack?(i=n.syncDynamicErrorWithStack,a=n.syncDynamicExpression,s=!0===n.syncDynamicLogged):(i=null,a=void 0,s=!1),t.hasSyncDynamicErrors&&i)throw s||console.error(i),new o.StaticGenBailoutError;let u=t.dynamicErrors;if(u.length){for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(94258);function i(e){let{url:t,providerId:r}=e,i=e.providers.map(({options:e,...r})=>{var i,a;if("oauth"===r.type){let i=o(r),s=o(e,!0),u=null!=(a=null==s?void 0:s.id)?a:r.id;return(0,n.merge)(i,{...s,signinUrl:`${t}/signin/${u}`,callbackUrl:`${t}/callback/${u}`})}let s=null!=(i=null==e?void 0:e.id)?i:r.id;return(0,n.merge)(r,{...e,signinUrl:`${t}/signin/${s}`,callbackUrl:`${t}/callback/${s}`})});return{providers:i,provider:i.find(({id:e})=>e===r)}}function o(e,t=!1){var r,n,i,a,s;if(!e)return;let u=Object.entries(e).reduce((e,[t,r])=>{if(["authorization","token","userinfo"].includes(t)&&"string"==typeof r){var n;let i=new URL(r);e[t]={url:`${i.origin}${i.pathname}`,params:Object.fromEntries(null!=(n=i.searchParams)?n:[])}}else e[t]=r;return e},{});return t||null!=(r=u.version)&&r.startsWith("1.")||(u.idToken=!!(null!=(n=null!=(i=u.idToken)?i:null==(a=u.wellKnown)?void 0:a.includes("openid-configuration"))?n:null==(s=u.authorization)||null==(s=s.params)||null==(s=s.scope)?void 0:s.includes("openid")),u.checks||(u.checks=["state"])),u}},88070:e=>{let t=/(\w+)=("[^"]*")/g;e.exports=e=>{let r={};try{for(;null!==t.exec(e);)RegExp.$1&&RegExp.$2&&(r[RegExp.$1]=RegExp.$2.slice(1,-1))}catch(e){}return r}},88599:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88658:(e,t,r)=>{e.exports=new(r(71383))({max:100})},88820:(e,t,r)=>{"use strict";var n=r(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.AuthHandler=g;var i=p(r(35146)),o=r(91070),a=p(r(86781)),s=n(r(8303)),u=r(99178),c=r(34002),l=r(82466),f=r(83074);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&({}).hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}async function h(e){try{return await e.json()}catch(e){}}async function y(e){var t,r,n,i;if(e instanceof Request){let t=new URL(e.url),a=t.pathname.split("/").slice(3),s=Object.fromEntries(e.headers),u=Object.fromEntries(t.searchParams);return u.nextauth=a,{action:a[0],method:e.method,headers:s,body:await h(e),cookies:(0,f.parse)(null!=(r=e.headers.get("cookie"))?r:""),providerId:a[1],error:null!=(n=t.searchParams.get("error"))?n:a[1],origin:(0,o.detectOrigin)(null!=(i=s["x-forwarded-host"])?i:s.host,s["x-forwarded-proto"]),query:u}}let{headers:a}=e,s=null!=(t=null==a?void 0:a["x-forwarded-host"])?t:null==a?void 0:a.host;return e.origin=(0,o.detectOrigin)(s,null==a?void 0:a["x-forwarded-proto"]),e}async function g(e){var t,r,n,o,f,d,p;let{options:h,req:g}=e,m=await y(g);(0,i.setLogger)(h.logger,h.debug);let b=(0,c.assertConfig)({options:h,req:m});if(Array.isArray(b))b.forEach(i.default.warn);else if(b instanceof Error){if(i.default.error(b.code,b),!["signin","signout","error","verify-request"].includes(m.action)||"GET"!==m.method)return{status:500,headers:[{key:"Content-Type",value:"application/json"}],body:{message:"There is a problem with the server configuration. Check the server logs for more information."}};let{pages:e,theme:t}=h,r=(null==e?void 0:e.error)&&(null==(f=m.query)||null==(f=f.callbackUrl)?void 0:f.startsWith(e.error));return!(null!=e&&e.error)||r?(r&&i.default.error("AUTH_ON_ERROR_PAGE_ERROR",Error(`The error page ${null==e?void 0:e.error} should not require authentication`)),(0,s.default)({theme:t}).error({error:"configuration"})):{redirect:`${e.error}?error=Configuration`}}let{action:_,providerId:v,error:w,method:E="GET"}=m,{options:S,cookies:A}=await (0,u.init)({authOptions:h,action:_,providerId:v,origin:m.origin,callbackUrl:null!=(t=null==(r=m.body)?void 0:r.callbackUrl)?t:null==(n=m.query)?void 0:n.callbackUrl,csrfToken:null==(o=m.body)?void 0:o.csrfToken,cookies:m.cookies,isPost:"POST"===E}),k=new l.SessionStore(S.cookies.sessionToken,m,S.logger);if("GET"===E){let e=(0,s.default)({...S,query:m.query,cookies:A}),{pages:t}=S;switch(_){case"providers":return await a.providers(S.providers);case"session":{let e=await a.session({options:S,sessionStore:k});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}case"csrf":return{headers:[{key:"Content-Type",value:"application/json"}],body:{csrfToken:S.csrfToken},cookies:A};case"signin":if(t.signIn){let e=`${t.signIn}${t.signIn.includes("?")?"&":"?"}callbackUrl=${encodeURIComponent(S.callbackUrl)}`;return w&&(e=`${e}&error=${encodeURIComponent(w)}`),{redirect:e,cookies:A}}return e.signin();case"signout":if(t.signOut)return{redirect:t.signOut,cookies:A};return e.signout();case"callback":if(S.provider){let e=await a.callback({body:m.body,query:m.query,headers:m.headers,cookies:m.cookies,method:E,options:S,sessionStore:k});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}break;case"verify-request":if(t.verifyRequest)return{redirect:t.verifyRequest,cookies:A};return e.verifyRequest();case"error":if(["Signin","OAuthSignin","OAuthCallback","OAuthCreateAccount","EmailCreateAccount","Callback","OAuthAccountNotLinked","EmailSignin","CredentialsSignin","SessionRequired"].includes(w))return{redirect:`${S.url}/signin?error=${w}`,cookies:A};if(t.error)return{redirect:`${t.error}${t.error.includes("?")?"&":"?"}error=${w}`,cookies:A};return e.error({error:w})}}else if("POST"===E)switch(_){case"signin":if(S.csrfTokenVerified&&S.provider){let e=await a.signin({query:m.query,body:m.body,options:S});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}return{redirect:`${S.url}/signin?csrf=true`,cookies:A};case"signout":if(S.csrfTokenVerified){let e=await a.signout({options:S,sessionStore:k});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}return{redirect:`${S.url}/signout?csrf=true`,cookies:A};case"callback":if(S.provider){if("credentials"===S.provider.type&&!S.csrfTokenVerified)return{redirect:`${S.url}/signin?csrf=true`,cookies:A};let e=await a.callback({body:m.body,query:m.query,headers:m.headers,cookies:m.cookies,method:E,options:S,sessionStore:k});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}break;case"_log":if(h.logger)try{let{code:e,level:t,...r}=null!=(d=m.body)?d:{};i.default[t](e,r)}catch(e){i.default.error("LOGGER_ERROR",e)}return{};case"session":if(S.csrfTokenVerified){let e=await a.session({options:S,sessionStore:k,newSession:null==(p=m.body)?void 0:p.data,isUpdate:!0});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}return{status:400,body:{},cookies:A}}return{status:400,body:`Error: This action with HTTP ${E} is not supported by NextAuth.js`}}},89417:(e,t,r)=>{let n=r(5625),i=r(8777);e.exports=n.types.isKeyObject||(e=>e&&e instanceof i.KeyObject)},89909:(e,t,r)=>{t.OAuth=r(34442).OAuth,t.OAuthEcho=r(34442).OAuthEcho,t.OAuth2=r(14740).OAuth2},90735:(e,t,r)=>{let{createHash:n,randomBytes:i}=r(8777),o=r(46755),a=(e=32)=>o.encode(i(e));e.exports={random:a,state:a,nonce:a,codeVerifier:a,codeChallenge:e=>o.encode(n("sha256").update(e).digest())}},91023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openidClient=i;var n=r(27793);async function i(e){let t,r=e.provider;if(r.httpOptions&&n.custom.setHttpOptionsDefaults(r.httpOptions),r.wellKnown)t=await n.Issuer.discover(r.wellKnown);else{var i,o,a;t=new n.Issuer({issuer:r.issuer,authorization_endpoint:null==(i=r.authorization)?void 0:i.url,token_endpoint:null==(o=r.token)?void 0:o.url,userinfo_endpoint:null==(a=r.userinfo)?void 0:a.url,jwks_uri:r.jwks_endpoint})}let s=new t.Client({client_id:r.clientId,client_secret:r.clientSecret,redirect_uris:[r.callbackUrl],...r.client},r.jwks);return s[n.custom.clock_tolerance]=10,s}},91070:(e,t,r)=>{"use strict";var n=r(49509);function i(e,t){var r;return(null!=(r=n.env.VERCEL)?r:n.env.AUTH_TRUST_HOST)?`${"http"===t?"http":"https"}://${e}`:n.env.NEXTAUTH_URL}Object.defineProperty(t,"__esModule",{value:!0}),t.detectOrigin=i},91949:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.oAuth1Client=i,t.oAuth1TokenStore=void 0;var n=r(89909);function i(e){var t,r;let i=e.provider,o=new n.OAuth(i.requestTokenUrl,i.accessTokenUrl,i.clientId,i.clientSecret,null!=(t=i.version)?t:"1.0",i.callbackUrl,null!=(r=i.encoding)?r:"HMAC-SHA1"),a=o.get.bind(o);o.get=async(...e)=>await new Promise((t,r)=>{a(...e,(e,n)=>{if(e)return r(e);t(n)})});let s=o.getOAuthAccessToken.bind(o);o.getOAuthAccessToken=async(...e)=>await new Promise((t,r)=>{s(...e,(e,n,i)=>{if(e)return r(e);t({oauth_token:n,oauth_token_secret:i})})});let u=o.getOAuthRequestToken.bind(o);return o.getOAuthRequestToken=async(e={})=>await new Promise((t,r)=>{u(e,(e,n,i,o)=>{if(e)return r(e);t({oauth_token:n,oauth_token_secret:i,params:o})})}),o}t.oAuth1TokenStore=new Map},92206:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CompactEncrypt:()=>tO,CompactSign:()=>tP,EmbeddedJWK:()=>tL,EncryptJWT:()=>tN,FlattenedEncrypt:()=>to,FlattenedSign:()=>tR,GeneralEncrypt:()=>ts,GeneralSign:()=>tC,SignJWT:()=>tU,UnsecuredJWT:()=>tX,base64url:()=>i,calculateJwkThumbprint:()=>tD,calculateJwkThumbprintUri:()=>tH,compactDecrypt:()=>e8,compactVerify:()=>td,createLocalJWKSet:()=>tJ,createRemoteJWKSet:()=>tZ,cryptoRuntime:()=>t8,decodeJwt:()=>t1,decodeProtectedHeader:()=>t0,errors:()=>n,exportJWK:()=>tr,exportPKCS8:()=>tt,exportSPKI:()=>te,flattenedDecrypt:()=>e3,flattenedVerify:()=>tf,generalDecrypt:()=>e9,generalVerify:()=>tp,generateKeyPair:()=>t4,generateSecret:()=>t3,importJWK:()=>eG,importPKCS8:()=>ez,importSPKI:()=>eK,importX509:()=>eJ,jwtDecrypt:()=>tx,jwtVerify:()=>tk});var n={};r.r(n),r.d(n,{JOSEAlgNotAllowed:()=>k,JOSEError:()=>E,JOSENotSupported:()=>x,JWEDecompressionFailed:()=>T,JWEDecryptionFailed:()=>O,JWEInvalid:()=>R,JWKInvalid:()=>C,JWKSInvalid:()=>I,JWKSMultipleMatchingKeys:()=>N,JWKSNoMatchingKey:()=>U,JWKSTimeout:()=>M,JWSInvalid:()=>P,JWSSignatureVerificationFailed:()=>D,JWTClaimValidationFailed:()=>S,JWTExpired:()=>A,JWTInvalid:()=>j});var i={};r.r(i),r.d(i,{decode:()=>tQ,encode:()=>tY});let o=crypto,a=e=>e instanceof CryptoKey,s=async(e,t)=>{let r=`SHA-${e.slice(-3)}`;return new Uint8Array(await o.subtle.digest(r,t))},u=new TextEncoder,c=new TextDecoder,l=0x100000000;function f(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;return e.forEach(e=>{t.set(e,r),r+=e.length}),t}function d(e,t){return f(u.encode(e),new Uint8Array([0]),t)}function p(e,t,r){if(t<0||t>=l)throw RangeError(`value must be >= 0 and <= ${l-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function h(e){let t=Math.floor(e/l),r=e%l,n=new Uint8Array(8);return p(n,t,0),p(n,r,4),n}function y(e){let t=new Uint8Array(4);return p(t,e),t}function g(e){return f(y(e.length),e)}async function m(e,t,r){let n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t>3)}let b=e=>{let t=e;"string"==typeof t&&(t=u.encode(t));let r=32768,n=[];for(let e=0;eb(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),v=e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=c.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return v(t)}catch(e){throw TypeError("The input to be decoded is not correctly encoded.")}};class E extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null==(t=Error.captureStackTrace)||t.call(Error,this,this.constructor)}}class S extends E{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}class A extends E{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}class k extends E{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class x extends E{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class O extends E{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class T extends E{constructor(){super(...arguments),this.code="ERR_JWE_DECOMPRESSION_FAILED",this.message="decompression operation failed"}static get code(){return"ERR_JWE_DECOMPRESSION_FAILED"}}class R extends E{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class P extends E{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class j extends E{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class C extends E{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}class I extends E{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class U extends E{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class N extends E{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator;class M extends E{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class D extends E{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}let H=o.getRandomValues.bind(o);function L(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 x(`Unsupported JWE Algorithm: ${e}`)}}let B=e=>H(new Uint8Array(L(e)>>3)),$=(e,t)=>{if(t.length<<3!==L(e))throw new R("Invalid Initialization Vector length")},W=(e,t)=>{let r=e.byteLength<<3;if(r!==t)throw new R(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)},F=(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");if(e.length!==t.length)throw TypeError("Input buffers must have the same length");let r=e.length,n=0,i=-1;for(;++ie.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){let r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function V(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!K(e.algorithm,"HMAC"))throw q("HMAC");let r=parseInt(t.slice(2),10);if(J(e.algorithm.hash)!==r)throw q(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!K(e.algorithm,"RSASSA-PKCS1-v1_5"))throw q("RSASSA-PKCS1-v1_5");let r=parseInt(t.slice(2),10);if(J(e.algorithm.hash)!==r)throw q(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!K(e.algorithm,"RSA-PSS"))throw q("RSA-PSS");let r=parseInt(t.slice(2),10);if(J(e.algorithm.hash)!==r)throw q(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw q("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!K(e.algorithm,"ECDSA"))throw q("ECDSA");let r=z(t);if(e.algorithm.namedCurve!==r)throw q(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}G(e,r)}function Z(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!K(e.algorithm,"AES-GCM"))throw q("AES-GCM");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw q(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!K(e.algorithm,"AES-KW"))throw q("AES-KW");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw q(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw q("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!K(e.algorithm,"PBKDF2"))throw q("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!K(e.algorithm,"RSA-OAEP"))throw q("RSA-OAEP");let r=parseInt(t.slice(9),10)||1;if(J(e.algorithm.hash)!==r)throw q(`SHA-${r}`,"algorithm.hash");break}default:throw TypeError("CryptoKey does not support this operation")}G(e,r)}function X(e,t,...r){if(r.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&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let Y=(e,...t)=>X("Key must be ",e,...t);function Q(e,t,...r){return X(`Key for the ${e} algorithm must be `,t,...r)}let ee=e=>a(e),et=["CryptoKey"];async function er(e,t,r,n,i,a){let s,u;if(!(t instanceof Uint8Array))throw TypeError(Y(t,"Uint8Array"));let c=parseInt(e.slice(1,4),10),l=await o.subtle.importKey("raw",t.subarray(c>>3),"AES-CBC",!1,["decrypt"]),d=await o.subtle.importKey("raw",t.subarray(0,c>>3),{hash:`SHA-${c<<1}`,name:"HMAC"},!1,["sign"]),p=f(a,n,r,h(a.length<<3)),y=new Uint8Array((await o.subtle.sign("HMAC",d,p)).slice(0,c>>3));try{s=F(i,y)}catch(e){}if(!s)throw new O;try{u=new Uint8Array(await o.subtle.decrypt({iv:n,name:"AES-CBC"},l,r))}catch(e){}if(!u)throw new O;return u}async function en(e,t,r,n,i,a){let s;t instanceof Uint8Array?s=await o.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Z(t,e,"decrypt"),s=t);try{return new Uint8Array(await o.subtle.decrypt({additionalData:a,iv:n,name:"AES-GCM",tagLength:128},s,f(r,i)))}catch(e){throw new O}}let ei=async(e,t,r,n,i,o)=>{if(!a(t)&&!(t instanceof Uint8Array))throw TypeError(Y(t,...et,"Uint8Array"));switch($(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&W(t,parseInt(e.slice(-3),10)),er(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&W(t,parseInt(e.slice(1,4),10)),en(e,t,r,n,i,o);default:throw new x("Unsupported JWE Content Encryption Algorithm")}},eo=async()=>{throw new x('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},ea=async()=>{throw new x('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},es=(...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};function eu(e){return"object"==typeof e&&null!==e}function ec(e){if(!eu(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}let el=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function ef(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function ed(e,t,r){if(a(e))return Z(e,t,r),e;if(e instanceof Uint8Array)return o.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw TypeError(Y(e,...et,"Uint8Array"))}let ep=async(e,t,r)=>{let n=await ed(t,e,"wrapKey");ef(n,e);let i=await o.subtle.importKey("raw",r,...el);return new Uint8Array(await o.subtle.wrapKey("raw",i,n,"AES-KW"))},eh=async(e,t,r)=>{let n=await ed(t,e,"unwrapKey");ef(n,e);let i=await o.subtle.unwrapKey("raw",r,n,"AES-KW",...el);return new Uint8Array(await o.subtle.exportKey("raw",i))};async function ey(e,t,r,n,i=new Uint8Array(0),s=new Uint8Array(0)){let c;if(!a(e))throw TypeError(Y(e,...et));if(Z(e,"ECDH"),!a(t))throw TypeError(Y(t,...et));Z(t,"ECDH","deriveBits");let l=f(g(u.encode(r)),g(i),g(s),y(n));return c="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,m(new Uint8Array(await o.subtle.deriveBits({name:e.algorithm.name,public:e},t,c)),n,l)}async function eg(e){if(!a(e))throw TypeError(Y(e,...et));return o.subtle.generateKey(e.algorithm,!0,["deriveBits"])}function em(e){if(!a(e))throw TypeError(Y(e,...et));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}function eb(e){if(!(e instanceof Uint8Array)||e.length<8)throw new R("PBES2 Salt Input must be 8 or more octets")}function e_(e,t){if(e instanceof Uint8Array)return o.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(a(e))return Z(e,t,"deriveBits","deriveKey"),e;throw TypeError(Y(e,...et,"Uint8Array"))}async function ev(e,t,r,n){eb(e);let i=d(t,e),a=parseInt(t.slice(13,16),10),s={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},u={length:a,name:"AES-KW"},c=await e_(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await o.subtle.deriveBits(s,c,a));if(c.usages.includes("deriveKey"))return o.subtle.deriveKey(s,c,u,!1,["wrapKey","unwrapKey"]);throw TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}let ew=async(e,t,r,n=2048,i=H(new Uint8Array(16)))=>{let o=await ev(i,e,n,t);return{encryptedKey:await ep(e.slice(-6),o,r),p2c:n,p2s:_(i)}},eE=async(e,t,r,n,i)=>{let o=await ev(i,e,n,t);return eh(e.slice(-6),o,r)};function eS(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new x(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}let eA=(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`)}},ek=async(e,t,r)=>{if(!a(t))throw TypeError(Y(t,...et));if(Z(t,e,"encrypt","wrapKey"),eA(e,t),t.usages.includes("encrypt"))return new Uint8Array(await o.subtle.encrypt(eS(e),t,r));if(t.usages.includes("wrapKey")){let n=await o.subtle.importKey("raw",r,...el);return new Uint8Array(await o.subtle.wrapKey("raw",n,t,eS(e)))}throw TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},ex=async(e,t,r)=>{if(!a(t))throw TypeError(Y(t,...et));if(Z(t,e,"decrypt","unwrapKey"),eA(e,t),t.usages.includes("decrypt"))return new Uint8Array(await o.subtle.decrypt(eS(e),t,r));if(t.usages.includes("unwrapKey")){let n=await o.subtle.unwrapKey("raw",r,t,eS(e),...el);return new Uint8Array(await o.subtle.exportKey("raw",n))}throw TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function eO(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 x(`Unsupported JWE Algorithm: ${e}`)}}let eT=e=>H(new Uint8Array(eO(e)>>3)),eR=(e,t)=>{let r=(e.match(/.{1,64}/g)||[]).join("\n");return`-----BEGIN ${t}----- ${r} -----END ${t}-----`},eP=async(e,t,r)=>{if(!a(r))throw TypeError(Y(r,...et));if(!r.extractable)throw TypeError("CryptoKey is not extractable");if(r.type!==e)throw TypeError(`key is not a ${e} key`);return eR(b(new Uint8Array(await o.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},ej=e=>eP("public","spki",e),eC=e=>eP("private","pkcs8",e),eI=(e,t,r=0)=>{0===r&&(t.unshift(t.length),t.unshift(6));let n=e.indexOf(t[0],r);if(-1===n)return!1;let i=e.subarray(n,n+t.length);return i.length===t.length&&(i.every((e,r)=>e===t[r])||eI(e,t,n+1))},eU=e=>{switch(!0){case eI(e,[42,134,72,206,61,3,1,7]):return"P-256";case eI(e,[43,129,4,0,34]):return"P-384";case eI(e,[43,129,4,0,35]):return"P-521";case eI(e,[43,101,110]):return"X25519";case eI(e,[43,101,111]):return"X448";case eI(e,[43,101,112]):return"Ed25519";case eI(e,[43,101,113]):return"Ed448";default:throw new x("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},eN=async(e,t,r,n,i)=>{var a;let s,u,c=new Uint8Array(atob(r.replace(e,"")).split("").map(e=>e.charCodeAt(0))),l="spki"===t;switch(n){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},u=l?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},u=l?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},u=l?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},u=l?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},u=l?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},u=l?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let e=eU(c);s=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},u=l?[]:["deriveBits"];break}case"EdDSA":s={name:eU(c)},u=l?["verify"]:["sign"];break;default:throw new x('Invalid or unsupported "alg" (Algorithm) value')}return o.subtle.importKey(t,c,s,null!=(a=null==i?void 0:i.extractable)&&a,u)},eM=(e,t,r)=>eN(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,r),eD=(e,t,r)=>eN(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,r);function eH(e){let t=[],r=0;for(;r=128;)r=128*r+e[t]-128,t++;r=128*r+e[t]-128,t++}let n=0;if(e[t]<128)n=e[t],t++;else if(128===n){for(n=0;0!==e[t+n]||0!==e[t+n+1];){if(n>e.byteLength)throw TypeError("invalid indefinite form length");n++}let r=t+n+2;return{byteLength:r,contents:e.subarray(t,t+n),raw:e.subarray(0,r)}}else{let r=127&e[t];t++,n=0;for(let i=0;i{let n;try{n=e$(e)}catch(e){throw TypeError("Failed to parse the X.509 certificate",{cause:e})}return eD(n,t,r)};function eF(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new x(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new x('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}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 x('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},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 x('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},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 x('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new x('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}let eq=async e=>{var t,r;if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:n,keyUsages:i}=eF(e),a=[n,null!=(t=e.ext)&&t,null!=(r=e.key_ops)?r:i];if("PBKDF2"===n.name)return o.subtle.importKey("raw",w(e.k),...a);let s={...e};return delete s.alg,delete s.use,o.subtle.importKey("jwk",s,...a)};async function eK(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw TypeError('"spki" must be SPKI formatted string');return eD(e,t,r)}async function eJ(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw TypeError('"x509" must be X.509 formatted string');return eW(e,t,r)}async function ez(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return eM(e,t,r)}async function eG(e,t,r){var n;if(!ec(e))throw TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');if(null!=r||(r=!0!==e.ext),r)return eq({...e,alg:t,ext:null!=(n=e.ext)&&n});return w(e.k);case"RSA":if(void 0!==e.oth)throw new x('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return eq({...e,alg:t});default:throw new x('Unsupported "kty" (Key Type) Parameter value')}}let eV=(e,t)=>{if(!(t instanceof Uint8Array)){if(!ee(t))throw TypeError(Q(e,t,...et,"Uint8Array"));if("secret"!==t.type)throw TypeError(`${et.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},eZ=(e,t,r)=>{if(!ee(t))throw TypeError(Q(e,t,...et));if("secret"===t.type)throw TypeError(`${et.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw TypeError(`${et.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw TypeError(`${et.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw TypeError(`${et.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw TypeError(`${et.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)},eX=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?eV(e,t):eZ(e,t,r)};async function eY(e,t,r,n,i){if(!(r instanceof Uint8Array))throw TypeError(Y(r,"Uint8Array"));let a=parseInt(e.slice(1,4),10),s=await o.subtle.importKey("raw",r.subarray(a>>3),"AES-CBC",!1,["encrypt"]),u=await o.subtle.importKey("raw",r.subarray(0,a>>3),{hash:`SHA-${a<<1}`,name:"HMAC"},!1,["sign"]),c=new Uint8Array(await o.subtle.encrypt({iv:n,name:"AES-CBC"},s,t)),l=f(i,n,c,h(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await o.subtle.sign("HMAC",u,l)).slice(0,a>>3))}}async function eQ(e,t,r,n,i){let a;r instanceof Uint8Array?a=await o.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(Z(r,e,"encrypt"),a=r);let s=new Uint8Array(await o.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},a,t)),u=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:u}}let e0=async(e,t,r,n,i)=>{if(!a(r)&&!(r instanceof Uint8Array))throw TypeError(Y(r,...et,"Uint8Array"));switch($(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&W(r,parseInt(e.slice(-3),10)),eY(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&W(r,parseInt(e.slice(1,4),10)),eQ(e,t,r,n,i);default:throw new x("Unsupported JWE Content Encryption Algorithm")}};async function e1(e,t,r,n){let i=e.slice(0,7);n||(n=B(i));let{ciphertext:o,tag:a}=await e0(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:_(n),tag:_(a)}}async function e2(e,t,r,n,i){return ei(e.slice(0,7),t,r,n,i,new Uint8Array(0))}let e6=async function(e,t,r,n,i){switch(eX(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new R("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new R("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let i,o;if(!ec(n.epk))throw new R('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!em(t))throw new x("ECDH with the provided key is not allowed or not supported by your javascript runtime");let a=await eG(n.epk,e);if(void 0!==n.apu){if("string"!=typeof n.apu)throw new R('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{i=w(n.apu)}catch(e){throw new R("Failed to base64url decode the apu")}}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new R('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{o=w(n.apv)}catch(e){throw new R("Failed to base64url decode the apv")}}let s=await ey(a,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?eO(n.enc):parseInt(e.slice(-5,-2),10),i,o);if("ECDH-ES"===e)return s;if(void 0===r)throw new R("JWE Encrypted Key missing");return eh(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new R("JWE Encrypted Key missing");return ex(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{let o;if(void 0===r)throw new R("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new R('JOSE Header "p2c" (PBES2 Count) missing or invalid');let a=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>a)throw new R('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new R('JOSE Header "p2s" (PBES2 Salt) missing or invalid');try{o=w(n.p2s)}catch(e){throw new R("Failed to base64url decode the p2s")}return eE(e,t,r,n.p2c,o)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new R("JWE Encrypted Key missing");return eh(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{let i,o;if(void 0===r)throw new R("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new R('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new R('JOSE Header "tag" (Authentication Tag) missing or invalid');try{i=w(n.iv)}catch(e){throw new R("Failed to base64url decode the iv")}try{o=w(n.tag)}catch(e){throw new R("Failed to base64url decode the tag")}return e2(e,t,r,i,o)}default:throw new x('Invalid or unsupported "alg" (JWE Algorithm) header value')}},e5=function(e,t,r,n,i){let o;if(void 0!==i.crit&&void 0===n.crit)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 a of(o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,n.crit)){if(!o.has(a))throw new x(`Extension Header Parameter "${a}" is not recognized`);if(void 0===i[a])throw new e(`Extension Header Parameter "${a}" is missing`);if(o.get(a)&&void 0===n[a])throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(n.crit)},e4=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function e3(e,t,r){var n;let i,o,a,s,l,d,p;if(!ec(e))throw new R("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new R("JOSE Header missing");if("string"!=typeof e.iv)throw new R("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new R("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new R("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new R("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new R("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new R("JWE AAD incorrect type");if(void 0!==e.header&&!ec(e.header))throw new R("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!ec(e.unprotected))throw new R("JWE Per-Recipient Unprotected Header incorrect type");if(e.protected)try{let t=w(e.protected);i=JSON.parse(c.decode(t))}catch(e){throw new R("JWE Protected Header is invalid")}if(!es(i,e.header,e.unprotected))throw new R("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let h={...i,...e.header,...e.unprotected};if(e5(R,new Map,null==r?void 0:r.crit,i,h),void 0!==h.zip){if(!i||!i.zip)throw new R('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==h.zip)throw new x('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}let{alg:y,enc:g}=h;if("string"!=typeof y||!y)throw new R("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof g||!g)throw new R("missing JWE Encryption Algorithm (enc) in JWE Header");let m=r&&e4("keyManagementAlgorithms",r.keyManagementAlgorithms),b=r&&e4("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(m&&!m.has(y))throw new k('"alg" (Algorithm) Header Parameter not allowed');if(b&&!b.has(g))throw new k('"enc" (Encryption Algorithm) Header Parameter not allowed');if(void 0!==e.encrypted_key)try{o=w(e.encrypted_key)}catch(e){throw new R("Failed to base64url decode the encrypted_key")}let _=!1;"function"==typeof t&&(t=await t(i,e),_=!0);try{a=await e6(y,t,o,h,r)}catch(e){if(e instanceof TypeError||e instanceof R||e instanceof x)throw e;a=eT(g)}try{s=w(e.iv)}catch(e){throw new R("Failed to base64url decode the iv")}try{l=w(e.tag)}catch(e){throw new R("Failed to base64url decode the tag")}let v=u.encode(null!=(n=e.protected)?n:"");d=void 0!==e.aad?f(v,u.encode("."),u.encode(e.aad)):v;try{p=w(e.ciphertext)}catch(e){throw new R("Failed to base64url decode the ciphertext")}let E=await ei(g,a,p,s,l,d);"DEF"===h.zip&&(E=await ((null==r?void 0:r.inflateRaw)||eo)(E));let S={plaintext:E};if(void 0!==e.protected&&(S.protectedHeader=i),void 0!==e.aad)try{S.additionalAuthenticatedData=w(e.aad)}catch(e){throw new R("Failed to base64url decode the aad")}return(void 0!==e.unprotected&&(S.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(S.unprotectedHeader=e.header),_)?{...S,key:t}:S}async function e8(e,t,r){if(e instanceof Uint8Array&&(e=c.decode(e)),"string"!=typeof e)throw new R("Compact JWE must be a string or Uint8Array");let{0:n,1:i,2:o,3:a,4:s,length:u}=e.split(".");if(5!==u)throw new R("Invalid Compact JWE");let l=await e3({ciphertext:a,iv:o||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:i||void 0},t,r),f={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return"function"==typeof t?{...f,key:l.key}:f}async function e9(e,t,r){if(!ec(e))throw new R("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(ec))throw new R("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new R("JWE Recipients has no members");for(let n of e.recipients)try{return await e3({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:n.encrypted_key,header:n.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,r)}catch(e){}throw new O}let e7=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:_(e)};if(!a(e))throw TypeError(Y(e,...et,"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,...s}=await o.subtle.exportKey("jwk",e);return s};async function te(e){return ej(e)}async function tt(e){return eC(e)}async function tr(e){return e7(e)}let tn=async function(e,t,r,n,i={}){let o,a,s;switch(eX(e,r,"encrypt"),e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!em(r))throw new x("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:u,apv:c}=i,{epk:l}=i;l||(l=(await eg(r)).privateKey);let{x:f,y:d,crv:p,kty:h}=await tr(l),y=await ey(r,l,"ECDH-ES"===e?t:e,"ECDH-ES"===e?eO(t):parseInt(e.slice(-5,-2),10),u,c);if(a={epk:{x:f,crv:p,kty:h}},"EC"===h&&(a.epk.y=d),u&&(a.apu=_(u)),c&&(a.apv=_(c)),"ECDH-ES"===e){s=y;break}s=n||eT(t);let g=e.slice(-6);o=await ep(g,y,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||eT(t),o=await ek(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||eT(t);let{p2c:u,p2s:c}=i;({encryptedKey:o,...a}=await ew(e,r,s,u,c));break}case"A128KW":case"A192KW":case"A256KW":s=n||eT(t),o=await ep(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||eT(t);let{iv:u}=i;({encryptedKey:o,...a}=await e1(e,r,s,u));break}default:throw new x('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}},ti=Symbol();class to{constructor(e){if(!(e instanceof Uint8Array))throw TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){let r,n,i,o,a,s,l;if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new R("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!es(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new R("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let d={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(e5(R,new Map,null==t?void 0:t.crit,this._protectedHeader,d),void 0!==d.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new R('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==d.zip)throw new x('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}let{alg:p,enc:h}=d;if("string"!=typeof p||!p)throw new R('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof h||!h)throw new R('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if("dir"===p){if(this._cek)throw TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===p&&this._cek)throw TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let i;({cek:n,encryptedKey:r,parameters:i}=await tn(p,h,e,this._cek,this._keyManagementParameters)),i&&(t&&ti in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...i}:this.setUnprotectedHeader(i):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...i}:this.setProtectedHeader(i))}if(this._iv||(this._iv=B(h)),o=this._protectedHeader?u.encode(_(JSON.stringify(this._protectedHeader))):u.encode(""),this._aad?(a=_(this._aad),i=f(o,u.encode("."),u.encode(a))):i=o,"DEF"===d.zip){let e=await ((null==t?void 0:t.deflateRaw)||ea)(this._plaintext);({ciphertext:s,tag:l}=await e0(h,e,n,this._iv,i))}else({ciphertext:s,tag:l}=await e0(h,this._plaintext,n,this._iv,i));let y={ciphertext:_(s),iv:_(this._iv),tag:_(l)};return r&&(y.encrypted_key=_(r)),a&&(y.aad=a),this._protectedHeader&&(y.protected=c.decode(o)),this._sharedUnprotectedHeader&&(y.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(y.header=this._unprotectedHeader),y}}class ta{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}}class ts{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){let r=new ta(this,e,{crit:null==t?void 0:t.crit});return this._recipients.push(r),r}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(e){var t,r,n;let i;if(!this._recipients.length)throw new R("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){let[t]=this._recipients,r=await new to(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e}),n={ciphertext:r.ciphertext,iv:r.iv,recipients:[{}],tag:r.tag};return r.aad&&(n.aad=r.aad),r.protected&&(n.protected=r.protected),r.unprotected&&(n.unprotected=r.unprotected),r.encrypted_key&&(n.recipients[0].encrypted_key=r.encrypted_key),r.header&&(n.recipients[0].header=r.header),n}for(let e=0;e>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new x(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function tc(e,t,r){if(a(t))return V(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(Y(t,...et));return o.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw TypeError(Y(t,...et,"Uint8Array"))}let tl=async(e,t,r,n)=>{let i=await tc(e,t,"verify");eA(e,i);let a=tu(e,i.algorithm);try{return await o.subtle.verify(a,i,r,n)}catch(e){return!1}};async function tf(e,t,r){var n;let i,o;if(!ec(e))throw new P("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new P('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new P("JWS Protected Header incorrect type");if(void 0===e.payload)throw new P("JWS Payload missing");if("string"!=typeof e.signature)throw new P("JWS Signature missing or incorrect type");if(void 0!==e.header&&!ec(e.header))throw new P("JWS Unprotected Header incorrect type");let a={};if(e.protected)try{let t=w(e.protected);a=JSON.parse(c.decode(t))}catch(e){throw new P("JWS Protected Header is invalid")}if(!es(a,e.header))throw new P("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let s={...a,...e.header},l=e5(P,new Map([["b64",!0]]),null==r?void 0:r.crit,a,s),d=!0;if(l.has("b64")&&"boolean"!=typeof(d=a.b64))throw new P('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:p}=s;if("string"!=typeof p||!p)throw new P('JWS "alg" (Algorithm) Header Parameter missing or invalid');let h=r&&e4("algorithms",r.algorithms);if(h&&!h.has(p))throw new k('"alg" (Algorithm) Header Parameter not allowed');if(d){if("string"!=typeof e.payload)throw new P("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new P("JWS Payload must be a string or an Uint8Array instance");let y=!1;"function"==typeof t&&(t=await t(a,e),y=!0),eX(p,t,"verify");let g=f(u.encode(null!=(n=e.protected)?n:""),u.encode("."),"string"==typeof e.payload?u.encode(e.payload):e.payload);try{i=w(e.signature)}catch(e){throw new P("Failed to base64url decode the signature")}if(!await tl(p,t,i,g))throw new D;if(d)try{o=w(e.payload)}catch(e){throw new P("Failed to base64url decode the payload")}else o="string"==typeof e.payload?u.encode(e.payload):e.payload;let m={payload:o};return(void 0!==e.protected&&(m.protectedHeader=a),void 0!==e.header&&(m.unprotectedHeader=e.header),y)?{...m,key:t}:m}async function td(e,t,r){if(e instanceof Uint8Array&&(e=c.decode(e)),"string"!=typeof e)throw new P("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new P("Invalid Compact JWS");let s=await tf({payload:i,protected:n,signature:o},t,r),u={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...u,key:s.key}:u}async function tp(e,t,r){if(!ec(e))throw new P("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(ec))throw new P("JWS Signatures missing or incorrect type");for(let n of e.signatures)try{return await tf({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new D}let th=e=>Math.floor(e.getTime()/1e3),ty=60,tg=3600,tm=86400,tb=604800,t_=0x1e187e0,tv=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,tw=e=>{let t=tv.exec(e);if(!t)throw TypeError("Invalid time period format");let r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(r*ty);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(r*tg);case"day":case"days":case"d":return Math.round(r*tm);case"week":case"weeks":case"w":return Math.round(r*tb);default:return Math.round(r*t_)}},tE=e=>e.toLowerCase().replace(/^application\//,""),tS=(e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e))),tA=(e,t,r={})=>{let n,i,{typ:o}=r;if(o&&("string"!=typeof e.typ||tE(e.typ)!==tE(o)))throw new S('unexpected "typ" JWT header value',"typ","check_failed");try{n=JSON.parse(c.decode(t))}catch(e){}if(!ec(n))throw new j("JWT Claims Set must be a top-level JSON object");let{requiredClaims:a=[],issuer:s,subject:u,audience:l,maxTokenAge:f}=r;for(let e of(void 0!==f&&a.push("iat"),void 0!==l&&a.push("aud"),void 0!==u&&a.push("sub"),void 0!==s&&a.push("iss"),new Set(a.reverse())))if(!(e in n))throw new S(`missing required "${e}" claim`,e,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(n.iss))throw new S('unexpected "iss" claim value',"iss","check_failed");if(u&&n.sub!==u)throw new S('unexpected "sub" claim value',"sub","check_failed");if(l&&!tS(n.aud,"string"==typeof l?[l]:l))throw new S('unexpected "aud" claim value',"aud","check_failed");switch(typeof r.clockTolerance){case"string":i=tw(r.clockTolerance);break;case"number":i=r.clockTolerance;break;case"undefined":i=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:d}=r,p=th(d||new Date);if((void 0!==n.iat||f)&&"number"!=typeof n.iat)throw new S('"iat" claim must be a number',"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new S('"nbf" claim must be a number',"nbf","invalid");if(n.nbf>p+i)throw new S('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new S('"exp" claim must be a number',"exp","invalid");if(n.exp<=p-i)throw new A('"exp" claim timestamp check failed',"exp","check_failed")}if(f){let e=p-n.iat;if(e-i>("number"==typeof f?f:tw(f)))throw new A('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-i)throw new S('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return n};async function tk(e,t,r){var n;let i=await td(e,t,r);if((null==(n=i.protectedHeader.crit)?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new j("JWTs MUST NOT use unencoded payload");let o={payload:tA(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}async function tx(e,t,r){let n=await e8(e,t,r),i=tA(n.protectedHeader,n.plaintext,r),{protectedHeader:o}=n;if(void 0!==o.iss&&o.iss!==i.iss)throw new S('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==o.sub&&o.sub!==i.sub)throw new S('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==o.aud&&JSON.stringify(o.aud)!==JSON.stringify(i.aud))throw new S('replicated "aud" claim header parameter mismatch',"aud","mismatch");let a={payload:i,protectedHeader:o};return"function"==typeof t?{...a,key:n.key}:a}class tO{constructor(e){this._flattened=new to(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}let tT=async(e,t,r)=>{let n=await tc(e,t,"sign");return eA(e,n),new Uint8Array(await o.subtle.sign(tu(e,n.algorithm),n,r))};class tR{constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){let r;if(!this._protectedHeader&&!this._unprotectedHeader)throw new P("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!es(this._protectedHeader,this._unprotectedHeader))throw new P("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this._protectedHeader,...this._unprotectedHeader},i=e5(P,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,n),o=!0;if(i.has("b64")&&"boolean"!=typeof(o=this._protectedHeader.b64))throw new P('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:a}=n;if("string"!=typeof a||!a)throw new P('JWS "alg" (Algorithm) Header Parameter missing or invalid');eX(a,e,"sign");let s=this._payload;o&&(s=u.encode(_(s)));let l=f(r=this._protectedHeader?u.encode(_(JSON.stringify(this._protectedHeader))):u.encode(""),u.encode("."),s),d={signature:_(await tT(a,e,l)),payload:""};return o&&(d.payload=c.decode(s)),this._unprotectedHeader&&(d.header=this._unprotectedHeader),this._protectedHeader&&(d.protected=c.decode(r)),d}}class tP{constructor(e){this._flattened=new tR(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){let r=await this._flattened.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class tj{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class tC{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){let r=new tj(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new P("at least one signature must be added");let e={signatures:[],payload:""};for(let t=0;t{if("string"!=typeof e||!e)throw new C(`${t} missing or invalid`)};async function tD(e,t){let r;if(!ec(e))throw TypeError("JWK must be an object");if(null!=t||(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');switch(e.kty){case"EC":tM(e.crv,'"crv" (Curve) Parameter'),tM(e.x,'"x" (X Coordinate) Parameter'),tM(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":tM(e.crv,'"crv" (Subtype of Key Pair) Parameter'),tM(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":tM(e.e,'"e" (Exponent) Parameter'),tM(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":tM(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new x('"kty" (Key Type) Parameter missing or unsupported')}let n=u.encode(JSON.stringify(r));return _(await s(t,n))}async function tH(e,t){null!=t||(t="sha256");let r=await tD(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}async function tL(e,t){let r={...e,...null==t?void 0:t.header};if(!ec(r.jwk))throw new P('"jwk" (JSON Web Key) Header Parameter must be a JSON object');let n=await eG({...r.jwk,ext:!0},r.alg,!0);if(n instanceof Uint8Array||"public"!==n.type)throw new P('"jwk" (JSON Web Key) Header Parameter must be a public key');return n}function tB(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new x('Unsupported "alg" value for a JSON Web Key Set')}}function t$(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(tW)}function tW(e){return ec(e)}function tF(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}class tq{constructor(e){if(this._cached=new WeakMap,!t$(e))throw new I("JSON Web Key Set malformed");this._jwks=tF(e)}async getKey(e,t){let{alg:r,kid:n}={...e,...null==t?void 0:t.header},i=tB(r),o=this._jwks.keys.filter(e=>{let t=i===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t}),{0:a,length:s}=o;if(0===s)throw new U;if(1!==s){let e=new N,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(let e of o)try{yield await tK(t,e,r)}catch(e){continue}},e}return tK(this._cached,a,r)}}async function tK(e,t,r){let n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){let e=await eG({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new I("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function tJ(e){let t=new tq(e);return async function(e,r){return t.getKey(e,r)}}let tz=async(e,t,r)=>{let n,i,o=!1;"function"==typeof AbortController&&(n=new AbortController,i=setTimeout(()=>{o=!0,n.abort()},t));let a=await fetch(e.href,{signal:n?n.signal:void 0,redirect:"manual",headers:r.headers}).catch(e=>{if(o)throw new M;throw e});if(void 0!==i&&clearTimeout(i),200!==a.status)throw new E("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch(e){throw new E("Failed to parse the JSON Web Key Set HTTP response as JSON")}};function tG(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}class tV extends tq{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now(){if(!t$(e))throw new I("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e})),await this._pendingFetch}}function tZ(e,t){let r=new tV(e,t);return async function(e,t){return r.getKey(e,t)}}class tX extends tI{encode(){let e=_(JSON.stringify({alg:"none"})),t=_(JSON.stringify(this._payload));return`${e}.${t}.`}static decode(e,t){let r;if("string"!=typeof e)throw new j("Unsecured JWT must be a string");let{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a||""!==o)throw new j("Invalid Unsecured JWT");try{if(r=JSON.parse(c.decode(w(n))),"none"!==r.alg)throw Error()}catch(e){throw new j("Invalid Unsecured JWT")}return{payload:tA(r,w(i),t),header:r}}}let tY=_,tQ=w;function t0(e){let t;if("string"==typeof e){let r=e.split(".");(3===r.length||5===r.length)&&([t]=r)}else if("object"==typeof e&&e)if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header");try{if("string"!=typeof t||!t)throw Error();let e=JSON.parse(c.decode(tQ(t)));if(!ec(e))throw Error();return e}catch(e){throw TypeError("Invalid Token or Protected Header formatting")}}function t1(e){let t,r;if("string"!=typeof e)throw new j("JWTs must use Compact JWS serialization, JWT must be a string");let{1:n,length:i}=e.split(".");if(5===i)throw new j("Only JWTs using Compact JWS serialization can be decoded");if(3!==i)throw new j("Invalid JWT");if(!n)throw new j("JWTs must contain a payload");try{t=tQ(n)}catch(e){throw new j("Failed to base64url decode the payload")}try{r=JSON.parse(c.decode(t))}catch(e){throw new j("Failed to parse the decoded payload as JSON")}if(!ec(r))throw new j("Invalid JWT Claims Set");return r}async function t2(e,t){var r;let n,i,a;switch(e){case"HS256":case"HS384":case"HS512":n=parseInt(e.slice(-3),10),i={name:"HMAC",hash:`SHA-${n}`,length:n},a=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return H(new Uint8Array((n=parseInt(e.slice(-3),10))>>3));case"A128KW":case"A192KW":case"A256KW":i={name:"AES-KW",length:n=parseInt(e.slice(1,4),10)},a=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":i={name:"AES-GCM",length:n=parseInt(e.slice(1,4),10)},a=["encrypt","decrypt"];break;default:throw new x('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return o.subtle.generateKey(i,null!=(r=null==t?void 0:t.extractable)&&r,a)}function t6(e){var t;let r=null!=(t=null==e?void 0:e.modulusLength)?t:2048;if("number"!=typeof r||r<2048)throw new x("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return r}async function t5(e,t){var r,n,i;let a,s;switch(e){case"PS256":case"PS384":case"PS512":a={name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:t6(t)},s=["sign","verify"];break;case"RS256":case"RS384":case"RS512":a={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:t6(t)},s=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a={name:"RSA-OAEP",hash:`SHA-${parseInt(e.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:t6(t)},s=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":a={name:"ECDSA",namedCurve:"P-256"},s=["sign","verify"];break;case"ES384":a={name:"ECDSA",namedCurve:"P-384"},s=["sign","verify"];break;case"ES512":a={name:"ECDSA",namedCurve:"P-521"},s=["sign","verify"];break;case"EdDSA":s=["sign","verify"];let u=null!=(r=null==t?void 0:t.crv)?r:"Ed25519";switch(u){case"Ed25519":case"Ed448":a={name:u};break;default:throw new x("Invalid or unsupported crv option provided")}break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{s=["deriveKey","deriveBits"];let e=null!=(n=null==t?void 0:t.crv)?n:"P-256";switch(e){case"P-256":case"P-384":case"P-521":a={name:"ECDH",namedCurve:e};break;case"X25519":case"X448":a={name:e};break;default:throw new x("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new x('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return o.subtle.generateKey(a,null!=(i=null==t?void 0:t.extractable)&&i,s)}async function t4(e,t){return t5(e,t)}async function t3(e,t){return t2(e,t)}let t8="WebCryptoAPI"},92833:e=>{let t=Symbol();e.exports={CLOCK_TOLERANCE:Symbol(),HTTP_OPTIONS:t}},93107:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return r}});class r{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},93673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSecret=a,t.fromDate=i,t.hashToken=o;var n=r(8777);function i(e,t=Date.now()){return new Date(t+1e3*e)}function o(e,t){var r;let{provider:i,secret:o}=t;return(0,n.createHash)("sha256").update(`${e}${null!=(r=i.secret)?r:o}`).digest("hex")}function a(e){var t;let{authOptions:r,url:i}=e;return null!=(t=r.secret)?t:(0,n.createHash)("sha256").update(JSON.stringify({...i,...r})).digest("hex")}},94258:(e,t)=>{"use strict";function r(e){return e&&"object"==typeof e&&!Array.isArray(e)}function n(e,...t){if(!t.length)return e;let i=t.shift();if(r(e)&&r(i))for(let t in i)r(i[t])?(e[t]||Object.assign(e,{[t]:{}}),n(e[t],i[t])):Object.assign(e,{[t]:i[t]});return n(e,...t)}Object.defineProperty(t,"__esModule",{value:!0}),t.merge=n},94274:(e,t,r)=>{"use strict";var n,i=r(49509);n={value:!0},n=void 0,n=c,n=l;var o=r(88820),a=r(75759);async function s(e,t,r){var n,s,u,c,l,f,d,p,h;let{nextauth:y,...g}=e.query;null!=(n=r.secret)||(r.secret=null!=(s=null!=(u=null==(c=r.jwt)?void 0:c.secret)?u:i.env.NEXTAUTH_SECRET)?s:i.env.AUTH_SECRET);let m=await (0,o.AuthHandler)({req:{body:e.body,query:g,cookies:e.cookies,headers:e.headers,method:e.method,action:null==y?void 0:y[0],providerId:null==y?void 0:y[1],error:null!=(l=e.query.error)?l:null==y?void 0:y[1]},options:r});if(t.status(null!=(f=m.status)?f:200),null==(d=m.cookies)||d.forEach(e=>(0,a.setCookie)(t,e)),null==(p=m.headers)||p.forEach(e=>t.setHeader(e.key,e.value)),m.redirect){if((null==(h=e.body)?void 0:h.json)!=="true"){t.status(302).setHeader("Location",m.redirect),t.end();return}return t.json({url:m.redirect})}return t.send(m.body)}async function u(e,t,n){var s,u,c,l;null!=(s=n.secret)||(n.secret=null!=(u=i.env.NEXTAUTH_SECRET)?u:i.env.AUTH_SECRET);let{headers:f,cookies:d}=r(66593),p=null==(c=await t.params)?void 0:c.nextauth,h=Object.fromEntries(e.nextUrl.searchParams),y=await (0,a.getBody)(e),g=await (0,o.AuthHandler)({req:{body:y,query:h,cookies:Object.fromEntries((await d()).getAll().map(e=>[e.name,e.value])),headers:Object.fromEntries(await f()),method:e.method,action:null==p?void 0:p[0],providerId:null==p?void 0:p[1],error:null!=(l=h.error)?l:null==p?void 0:p[1]},options:n}),m=(0,a.toResponse)(g),b=m.headers.get("Location");return(null==y?void 0:y.json)==="true"&&b?(m.headers.delete("Location"),m.headers.set("Content-Type","application/json"),new Response(JSON.stringify({url:b}),{status:g.status,headers:m.headers})):m}async function c(...e){var t,n,s;let u,l,f,d=0===e.length||1===e.length;if(d){f=Object.assign({},e[0],{providers:[]});let{headers:t,cookies:n}=r(66593);u={headers:Object.fromEntries(await t()),cookies:Object.fromEntries((await n()).getAll().map(e=>[e.name,e.value]))},l={getHeader(){},setCookie(){},setHeader(){}}}else u=e[0],l=e[1],f=Object.assign({},e[2],{providers:[]});null!=(n=(t=f).secret)||(t.secret=null!=(s=i.env.NEXTAUTH_SECRET)?s:i.env.AUTH_SECRET);let{body:p,cookies:h,status:y=200}=await (0,o.AuthHandler)({options:f,req:{action:"session",method:"GET",cookies:u.cookies,headers:u.headers}});if(null==h||h.forEach(e=>(0,a.setCookie)(l,e)),p&&"string"!=typeof p&&Object.keys(p).length){if(200===y)return d&&delete p.expires,p;throw Error(p.message)}return null}n=function(...e){var t;return 1===e.length?async(t,r)=>null!=r&&r.params?await u(t,r,e[0]):await s(t,r,e[0]):null!=(t=e[1])&&t.params?u(...e):s(...e)};async function l(...e){return await c(...e)}},99178:(e,t,r)=>{"use strict";var n=r(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.init=m;var i=r(8777),o=n(r(35146)),a=r(71883),s=n(r(87550)),u=r(93673),c=g(r(82466)),l=g(r(2454)),f=r(54340),d=r(76510),p=r(27383),h=n(r(50837));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&({}).hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}async function m({authOptions:e,providerId:t,action:r,origin:n,cookies:y,callbackUrl:g,csrfToken:m,isPost:b}){var _,v;let w=(0,h.default)(n),E=(0,u.createSecret)({authOptions:e,url:w}),{providers:S,provider:A}=(0,s.default)({providers:e.providers,url:w,providerId:t}),k=2592e3,x={debug:!1,pages:{},theme:{colorScheme:"auto",logo:"",brandColor:"",buttonText:""},...e,url:w,action:r,provider:A,cookies:{...c.defaultCookies(null!=(_=e.useSecureCookies)?_:w.base.startsWith("https://")),...e.cookies},secret:E,providers:S,session:{strategy:e.adapter?"database":"jwt",maxAge:k,updateAge:86400,generateSessionToken:()=>{var e;return null!=(e=null===i.randomUUID||void 0===i.randomUUID?void 0:(0,i.randomUUID)())?e:(0,i.randomBytes)(32).toString("hex")},...e.session},jwt:{secret:E,maxAge:k,encode:l.encode,decode:l.decode,...e.jwt},events:(0,a.eventsErrorHandler)(null!=(v=e.events)?v:{},o.default),adapter:(0,a.adapterErrorHandler)(e.adapter,o.default),callbacks:{...f.defaultCallbacks,...e.callbacks},logger:o.default,callbackUrl:w.origin},O=[],{csrfToken:T,cookie:R,csrfTokenVerified:P}=(0,d.createCSRFToken)({options:x,cookieValue:null==y?void 0:y[x.cookies.csrfToken.name],isPost:b,bodyValue:m});x.csrfToken=T,x.csrfTokenVerified=P,R&&O.push({name:x.cookies.csrfToken.name,value:R,options:x.cookies.csrfToken.options});let{callbackUrl:j,callbackUrlCookie:C}=await (0,p.createCallbackUrl)({options:x,cookieValue:null==y?void 0:y[x.cookies.callbackUrl.name],paramValue:g});return x.callbackUrl=j,C&&O.push({name:x.cookies.callbackUrl.name,value:C,options:x.cookies.callbackUrl.options}),{options:x,cookies:O}}},99403:e=>{e.exports={assertSigningAlgValuesSupport:function(e,t,r){if(!t[`${e}_endpoint`])return;let n=`${e}_endpoint_auth_method`,i=`${e}_endpoint_auth_signing_alg`,o=`${e}_endpoint_auth_signing_alg_values_supported`;if(r[n]&&r[n].endsWith("_jwt")&&!r[i]&&!t[o])throw TypeError(`${o} must be configured on the issuer if ${i} is not defined on a client`)},assertIssuerConfiguration:function(e,t){if(!e[t])throw TypeError(`${t} must be configured on the issuer`)}}},99422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"afterTaskAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(28155).createAsyncLocalStorage)()}}]);