Files
scrap/node_modules/next/dist/compiled/next-server/server.runtime.prod.js
2024-09-24 03:52:46 +00:00

18 lines
162 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var e={"../next-env/dist/index.js":(e,t,r)=>{(()=>{var t={383:e=>{"use strict";e.exports.j=function(e){let t=e.ignoreProcessEnv?{}:process.env;for(let r in e.parsed){let i=Object.prototype.hasOwnProperty.call(t,r)?t[r]:e.parsed[r];e.parsed[r]=(function e(t,r,i){let s=function(e,t){let r=Array.from(e.matchAll(t));return r.length>0?r.slice(-1)[0].index:-1}(t,/(?!(?<=\\))\$/g);if(-1===s)return t;let n=t.slice(s).match(/((?!(?<=\\))\${?([\w]+)(?::-([^}\\]*))?}?)/);if(null!=n){let[,s,a,o]=n;return e(t.replace(s,r[a]||o||i.parsed[a]||""),r,i)}return t})(i,t,e).replace(/\\\$/g,"$")}for(let r in e.parsed)t[r]=e.parsed[r];return e}},234:(e,t,r)=>{let i=r(147),s=r(17),n=r(37),a=r(113),o=r(803).version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function h(e){console.log(`[dotenv@${o}][DEBUG] ${e}`)}function d(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function u(e){let t=s.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:`${t}.vault`}let c={configDotenv:function(e){let t=s.resolve(process.cwd(),".env"),r="utf8",a=!!(e&&e.debug);if(e){if(null!=e.path){var o;t="~"===(o=e.path)[0]?s.join(n.homedir(),o.slice(1)):o}null!=e.encoding&&(r=e.encoding)}try{let s=c.parse(i.readFileSync(t,{encoding:r})),n=process.env;return e&&null!=e.processEnv&&(n=e.processEnv),c.populate(n,s,e),{parsed:s}}catch(e){return a&&h(`Failed to load ${t} ${e.message}`),{error:e}}},_configVault:function(e){console.log(`[dotenv@${o}][INFO] Loading env from encrypted .env.vault`);let t=c._parseVault(e),r=process.env;return e&&null!=e.processEnv&&(r=e.processEnv),c.populate(r,t,e),{parsed:t}},_parseVault:function(e){let t;let r=u(e),i=c.configDotenv({path:r});if(!i.parsed)throw Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);let s=d(e).split(","),n=s.length;for(let e=0;e<n;e++)try{let r=s[e].trim(),n=function(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code)throw Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development");throw e}let i=r.password;if(!i)throw Error("INVALID_DOTENV_KEY: Missing key part");let s=r.searchParams.get("environment");if(!s)throw Error("INVALID_DOTENV_KEY: Missing environment part");let n=`DOTENV_VAULT_${s.toUpperCase()}`,a=e.parsed[n];if(!a)throw Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:a,key:i}}(i,r);t=c.decrypt(n.ciphertext,n.key);break}catch(t){if(e+1>=n)throw t}return c.parse(t)},config:function(e){let t=u(e);if(0===d(e).length)return c.configDotenv(e);if(!i.existsSync(t)){var r;return r=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.log(`[dotenv@${o}][WARN] ${r}`),c.configDotenv(e)}return c._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),i=Buffer.from(e,"base64"),s=i.slice(0,12),n=i.slice(-16);i=i.slice(12,-16);try{let e=a.createDecipheriv("aes-256-gcm",r,s);return e.setAuthTag(n),`${e.update(i)}${e.final()}`}catch(i){let e=i instanceof RangeError,t="Invalid key length"===i.message,r="Unsupported state or unable to authenticate data"===i.message;if(e||t)throw Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");if(r)throw Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw console.error("Error: ",i.code),console.error("Error: ",i.message),i}},parse:function(e){let t;let r={},i=e.toString();for(i=i.replace(/\r\n?/gm,"\n");null!=(t=l.exec(i));){let e=t[1],i=t[2]||"",s=(i=i.trim())[0];i=i.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),'"'===s&&(i=(i=i.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=i}return r},populate:function(e,t,r={}){let i=!!(r&&r.debug),s=!!(r&&r.override);if("object"!=typeof t)throw Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===s&&(e[r]=t[r]),i&&(!0===s?h(`"${r}" is already defined and WAS overwritten`):h(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=c.configDotenv,e.exports._configVault=c._configVault,e.exports._parseVault=c._parseVault,e.exports.config=c.config,e.exports.decrypt=c.decrypt,e.exports.parse=c.parse,e.exports.populate=c.populate,e.exports=c},113:e=>{"use strict";e.exports=r("crypto")},147:e=>{"use strict";e.exports=r("fs")},37:e=>{"use strict";e.exports=r("os")},17:e=>{"use strict";e.exports=r("path")},803:e=>{"use strict";e.exports=JSON.parse('{"name":"dotenv","version":"16.3.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"funding":"https://github.com/motdotla/dotenv?sponsor=1","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3","decache":"^4.6.1","sinon":"^14.0.1","standard":"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0","tap":"^16.3.0","tar":"^6.1.11","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}')}},i={};function s(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,s),a=!1}finally{a&&delete i[e]}return n.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.ab=__dirname+"/";var n={};(()=>{"use strict";let e,t;s.r(n),s.d(n,{initialEnv:()=>e,updateInitialEnv:()=>d,processEnv:()=>c,resetEnv:()=>p,loadEnvConfig:()=>f});var r=s(147);s.n(r);var i=s(17);s.n(i);var a=s(234);s.n(a);var o=s(383);let l=[],h=[];function d(t){Object.assign(e||{},t)}function u(e){Object.keys(process.env).forEach(t=>{t.startsWith("__NEXT_PRIVATE")||void 0!==e[t]&&""!==e[t]||delete process.env[t]}),Object.entries(e).forEach(([e,t])=>{process.env[e]=t})}function c(t,r,s=console,n=!1,l){var d;if(e||(e=Object.assign({},process.env)),!n&&(process.env.__NEXT_PROCESSED_ENV||0===t.length))return process.env;process.env.__NEXT_PROCESSED_ENV="true";let u=Object.assign({},e),c={};for(let e of t)try{let t={};for(let r of(t.parsed=a.parse(e.contents),(t=(0,o.j)(t)).parsed&&!h.some(t=>t.contents===e.contents&&t.path===e.path)&&(null==l||l(e.path)),Object.keys(t.parsed||{})))void 0===c[r]&&void 0===u[r]&&(c[r]=null===(d=t.parsed)||void 0===d?void 0:d[r])}catch(t){s.error(`Failed to load env from ${i.join(r||"",e.path)}`,t)}return Object.assign(process.env,c)}function p(){e&&u(e)}function f(s,n,a=console,o=!1,d){if(e||(e=Object.assign({},process.env)),t&&!o)return{combinedEnv:t,loadedEnvFiles:l};u(e),h=l,l=[];let p=n?"development":"production";for(let e of[`.env.${p}.local`,"test"!==p&&".env.local",`.env.${p}`,".env"].filter(Boolean)){let t=i.join(s,e);try{if(!r.statSync(t).isFile())continue;let i=r.readFileSync(t,"utf8");l.push({path:e,contents:i})}catch(t){"ENOENT"!==t.code&&a.error(`Failed to load env from ${e}`,t)}}return{combinedEnv:t=c(l,s,a,o,d),loadedEnvFiles:l}}})(),e.exports=n})()},"./dist/compiled/@edge-runtime/cookies/index.js":e=>{"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,n={};function a(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),i=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?i:`${i}; ${r.join("; ")}`}function o(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[i,s]=[r.slice(0,e),r.slice(e+1)];try{t.set(i,decodeURIComponent(null!=s?s:"true"))}catch{}}return t}function l(e){var t,r;if(!e)return;let[[i,s],...n]=o(e),{domain:a,expires:l,httponly:u,maxage:c,path:p,samesite:f,secure:m,partitioned:g,priority:v}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase(),t]));return function(e){let t={};for(let r in e)e[r]&&(t[r]=e[r]);return t}({name:i,value:decodeURIComponent(s),domain:a,...l&&{expires:new Date(l)},...u&&{httpOnly:!0},..."string"==typeof c&&{maxAge:Number(c)},path:p,...f&&{sameSite:h.includes(t=(t=f).toLowerCase())?t:void 0},...m&&{secure:!0},...v&&{priority:d.includes(r=(r=v).toLowerCase())?r:void 0},...g&&{partitioned:!0}})}((e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:!0})})(n,{RequestCookies:()=>u,ResponseCookies:()=>c,parseCookie:()=>o,parseSetCookie:()=>l,stringifyCookie:()=>a}),e.exports=((e,n,a,o)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of i(n))s.call(e,l)||l===a||t(e,l,{get:()=>n[l],enumerable:!(o=r(n,l))||o.enumerable});return e})(t({},"__esModule",{value:!0}),n);var h=["strict","lax","none"],d=["low","medium","high"],u=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of o(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 i="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===i).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,i=this._parsed;return i.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(i).map(([e,t])=>a(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])=>a(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("; ")}},c=class{constructor(e){var t,r,i;this._parsed=new Map,this._headers=e;let s=null!=(i=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?i:[];for(let e of Array.isArray(s)?s:function(e){if(!e)return[];var t,r,i,s,n,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,n=!1;l();)if(","===(r=e.charAt(o))){for(i=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(n=!0,o=s,a.push(e.substring(t,i)),t=o):o=i+1}else o+=1;(!n||o>=e.length)&&a.push(e.substring(t,e.length))}return a}(s)){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 i="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===i)}has(e){return this._parsed.has(e)}set(...e){let[t,r,i]=1===e.length?[e[0].name,e[0].value,e[0]]:e,s=this._parsed;return s.set(t,function(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}({name:t,value:r,...i})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=a(r);t.append("set-cookie",e)}}(s,this._headers),this}delete(...e){let[t,r,i]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:r,domain:i,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(a).join("; ")}}},"./dist/compiled/cookie/index.js":e=>{(()=>{"use strict";"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var t={};(()=>{/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/t.parse=function(t,r){if("string"!=typeof t)throw TypeError("argument str must be a string");for(var s={},n=t.split(i),a=(r||{}).decode||e,o=0;o<n.length;o++){var l=n[o],h=l.indexOf("=");if(!(h<0)){var d=l.substr(0,h).trim(),u=l.substr(++h,l.length).trim();'"'==u[0]&&(u=u.slice(1,-1)),void 0==s[d]&&(s[d]=function(e,t){try{return t(e)}catch(t){return e}}(u,a))}}return s},t.serialize=function(e,t,i){var n=i||{},a=n.encode||r;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!s.test(e))throw TypeError("argument name is invalid");var o=a(t);if(o&&!s.test(o))throw TypeError("argument val is invalid");var l=e+"="+o;if(null!=n.maxAge){var h=n.maxAge-0;if(isNaN(h)||!isFinite(h))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(h)}if(n.domain){if(!s.test(n.domain))throw TypeError("option domain is invalid");l+="; Domain="+n.domain}if(n.path){if(!s.test(n.path))throw TypeError("option path is invalid");l+="; Path="+n.path}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw TypeError("option expires is invalid");l+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(l+="; HttpOnly"),n.secure&&(l+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l};var e=decodeURIComponent,r=encodeURIComponent,i=/; */,s=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/})(),e.exports=t})()},"./dist/compiled/fresh/index.js":e=>{(()=>{"use strict";var t={695:e=>{/*!
* fresh
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2016-2017 Douglas Christopher Wilson
* MIT Licensed
*/var t=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function r(e){var t=e&&Date.parse(e);return"number"==typeof t?t:NaN}e.exports=function(e,i){var s=e["if-modified-since"],n=e["if-none-match"];if(!s&&!n)return!1;var a=e["cache-control"];if(a&&t.test(a))return!1;if(n&&"*"!==n){var o=i.etag;if(!o)return!1;for(var l=!0,h=function(e){for(var t=0,r=[],i=0,s=0,n=e.length;s<n;s++)switch(e.charCodeAt(s)){case 32:i===t&&(i=t=s+1);break;case 44:r.push(e.substring(i,t)),i=t=s+1;break;default:t=s+1}return r.push(e.substring(i,t)),r}(n),d=0;d<h.length;d++){var u=h[d];if(u===o||u==="W/"+o||"W/"+u===o){l=!1;break}}if(l)return!1}if(s){var c=i["last-modified"];if(!c||!(r(c)<=r(s)))return!1}return!0}}},r={};function i(e){var s=r[e];if(void 0!==s)return s.exports;var n=r[e]={exports:{}},a=!0;try{t[e](n,n.exports,i),a=!1}finally{a&&delete r[e]}return n.exports}i.ab=__dirname+"/";var s=i(695);e.exports=s})()},"./dist/compiled/lru-cache/index.js":e=>{(()=>{"use strict";var t={806:(e,t,r)=>{let i=r(190),s=Symbol("max"),n=Symbol("length"),a=Symbol("lengthCalculator"),o=Symbol("allowStale"),l=Symbol("maxAge"),h=Symbol("dispose"),d=Symbol("noDisposeOnSet"),u=Symbol("lruList"),c=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1,m=(e,t,r)=>{let i=e[c].get(t);if(i){let t=i.value;if(g(e,t)){if(y(e,i),!e[o])return}else r&&(e[p]&&(i.value.now=Date.now()),e[u].unshiftNode(i));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;let r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},v=e=>{if(e[n]>e[s])for(let t=e[u].tail;e[n]>e[s]&&null!==t;){let r=t.prev;y(e,t),t=r}},y=(e,t)=>{if(t){let r=t.value;e[h]&&e[h](r.key,r.value),e[n]-=r.length,e[c].delete(r.key),e[u].removeNode(t)}};class x{constructor(e,t,r,i,s){this.key=e,this.value=t,this.length=r,this.now=i,this.maxAge=s||0}}let w=(e,t,r,i)=>{let s=r.value;g(e,s)&&(y(e,r),e[o]||(s=void 0)),s&&t.call(i,s.value,s.key,e)};e.exports=class{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[s]=e.max||1/0;let t=e.length||f;if(this[a]="function"!=typeof t?f:t,this[o]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[h]=e.dispose,this[d]=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[s]=e||1/0,v(this)}get max(){return this[s]}set allowStale(e){this[o]=!!e}get allowStale(){return this[o]}set maxAge(e){if("number"!=typeof e)throw TypeError("maxAge must be a non-negative number");this[l]=e,v(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[a]&&(this[a]=e,this[n]=0,this[u].forEach(e=>{e.length=this[a](e.value,e.key),this[n]+=e.length})),v(this)}get lengthCalculator(){return this[a]}get length(){return this[n]}get itemCount(){return this[u].length}rforEach(e,t){t=t||this;for(let r=this[u].tail;null!==r;){let i=r.prev;w(this,e,r,t),r=i}}forEach(e,t){t=t||this;for(let r=this[u].head;null!==r;){let i=r.next;w(this,e,r,t),r=i}}keys(){return this[u].toArray().map(e=>e.key)}values(){return this[u].toArray().map(e=>e.value)}reset(){this[h]&&this[u]&&this[u].length&&this[u].forEach(e=>this[h](e.key,e.value)),this[c]=new Map,this[u]=new i,this[n]=0}dump(){return this[u].map(e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[u]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw TypeError("maxAge must be a number");let i=r?Date.now():0,o=this[a](t,e);if(this[c].has(e)){if(o>this[s])return y(this,this[c].get(e)),!1;let a=this[c].get(e).value;return this[h]&&!this[d]&&this[h](e,a.value),a.now=i,a.maxAge=r,a.value=t,this[n]+=o-a.length,a.length=o,this.get(e),v(this),!0}let p=new x(e,t,o,i,r);return p.length>this[s]?(this[h]&&this[h](e,t),!1):(this[n]+=p.length,this[u].unshift(p),this[c].set(e,this[u].head),v(this),!0)}has(e){return!!this[c].has(e)&&!g(this,this[c].get(e).value)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){let e=this[u].tail;return e?(y(this,e),e.value):null}del(e){y(this,this[c].get(e))}load(e){this.reset();let t=Date.now();for(let r=e.length-1;r>=0;r--){let i=e[r],s=i.e||0;if(0===s)this.set(i.k,i.v);else{let e=s-t;e>0&&this.set(i.k,i.v,e)}}}prune(){this[c].forEach((e,t)=>m(this,t,!1))}}},76:e=>{e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},190:(e,t,r)=>{function i(e){var t=this;if(t instanceof i||(t=new i),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,s=arguments.length;r<s;r++)t.push(arguments[r]);return t}function s(e,t,r,i){if(!(this instanceof s))return new s(e,t,r,i);this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=i,i.Node=s,i.create=i,i.prototype.removeNode=function(e){if(e.list!==this)throw Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},i.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},i.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},i.prototype.push=function(){for(var e,t=0,r=arguments.length;t<r;t++)e=arguments[t],this.tail=new s(e,this.tail,null,this),this.head||(this.head=this.tail),this.length++;return this.length},i.prototype.unshift=function(){for(var e,t=0,r=arguments.length;t<r;t++)e=arguments[t],this.head=new s(e,null,this.head,this),this.tail||(this.tail=this.head),this.length++;return this.length},i.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},i.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},i.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,i=0;null!==r;i++)e.call(t,r.value,i,this),r=r.next},i.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,i=this.length-1;null!==r;i--)e.call(t,r.value,i,this),r=r.prev},i.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},i.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},i.prototype.map=function(e,t){t=t||this;for(var r=new i,s=this.head;null!==s;)r.push(e.call(t,s.value,this)),s=s.next;return r},i.prototype.mapReverse=function(e,t){t=t||this;for(var r=new i,s=this.tail;null!==s;)r.push(e.call(t,s.value,this)),s=s.prev;return r},i.prototype.reduce=function(e,t){var r,i=this.head;if(arguments.length>1)r=t;else if(this.head)i=this.head.next,r=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var s=0;null!==i;s++)r=e(r,i.value,s),i=i.next;return r},i.prototype.reduceReverse=function(e,t){var r,i=this.tail;if(arguments.length>1)r=t;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;null!==i;s--)r=e(r,i.value,s),i=i.prev;return r},i.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},i.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},i.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=0,n=this.head;null!==n&&s<e;s++)n=n.next;for(;null!==n&&s<t;s++,n=n.next)r.push(n.value);return r},i.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=this.length,n=this.tail;null!==n&&s>t;s--)n=n.prev;for(;null!==n&&s>e;s--,n=n.prev)r.push(n.value);return r},i.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;null!==i&&r<e;r++)i=i.next;for(var n=[],r=0;i&&r<t;r++)n.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=2;r<arguments.length;r++)i=function(e,t,r){var i=t===e.head?new s(r,null,t,e):new s(r,t,t.next,e);return null===i.next&&(e.tail=i),null===i.prev&&(e.head=i),e.length++,i}(this,i,arguments[r]);return n},i.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=t,this.tail=e,this};try{r(76)(i)}catch(e){}}},r={};function i(e){var s=r[e];if(void 0!==s)return s.exports;var n=r[e]={exports:{}},a=!0;try{t[e](n,n.exports,i),a=!1}finally{a&&delete r[e]}return n.exports}i.ab=__dirname+"/";var s=i(806);e.exports=s})()},"./dist/compiled/path-to-regexp/index.js":(e,t)=>{"use strict";function r(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var i=e[r];if("*"===i||"+"===i||"?"===i){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if("\\"===i){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if("{"===i){t.push({type:"OPEN",index:r,value:e[r++]});continue}if("}"===i){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(":"===i){for(var s="",n=r+1;n<e.length;){var a=e.charCodeAt(n);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){s+=e[n++];continue}break}if(!s)throw TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:s}),r=n;continue}if("("===i){var o=1,l="",n=r+1;if("?"===e[n])throw TypeError('Pattern cannot start with "?" at '+n);for(;n<e.length;){if("\\"===e[n]){l+=e[n++]+e[n++];continue}if(")"===e[n]){if(0==--o){n++;break}}else if("("===e[n]&&(o++,"?"!==e[n+1]))throw TypeError("Capturing groups are not allowed at "+n);l+=e[n++]}if(o)throw TypeError("Unbalanced pattern at "+r);if(!l)throw TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:l}),r=n;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),s=t.prefixes,n=void 0===s?"./":s,a="[^"+i(t.delimiter||"/#?")+"]+?",o=[],l=0,h=0,d="",u=function(e){if(h<r.length&&r[h].type===e)return r[h++].value},c=function(e){var t=u(e);if(void 0!==t)return t;var i=r[h];throw TypeError("Unexpected "+i.type+" at "+i.index+", expected "+e)},p=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};h<r.length;){var f=u("CHAR"),m=u("NAME"),g=u("PATTERN");if(m||g){var v=f||"";-1===n.indexOf(v)&&(d+=v,v=""),d&&(o.push(d),d=""),o.push({name:m||l++,prefix:v,suffix:"",pattern:g||a,modifier:u("MODIFIER")||""});continue}var y=f||u("ESCAPED_CHAR");if(y){d+=y;continue}if(d&&(o.push(d),d=""),u("OPEN")){var v=p(),x=u("NAME")||"",w=u("PATTERN")||"",b=p();c("CLOSE"),o.push({name:x||(w?l++:""),pattern:x&&!w?a:w,prefix:v,suffix:b,modifier:u("MODIFIER")||""});continue}c("END")}return o}function i(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function s(e){return e&&e.sensitive?"":"i"}t.MY=function(e,t){var i,n,a,o,l,h,d,u;return i=r(e,t),void 0===(n=t)&&(n={}),a=s(n),l=void 0===(o=n.encode)?function(e){return e}:o,d=void 0===(h=n.validate)||h,u=i.map(function(e){if("object"==typeof e)return RegExp("^(?:"+e.pattern+")$",a)}),function(e){for(var t="",r=0;r<i.length;r++){var s=i[r];if("string"==typeof s){t+=s;continue}var n=e?e[s.name]:void 0,a="?"===s.modifier||"*"===s.modifier,o="*"===s.modifier||"+"===s.modifier;if(Array.isArray(n)){if(!o)throw TypeError('Expected "'+s.name+'" to not repeat, but got an array');if(0===n.length){if(a)continue;throw TypeError('Expected "'+s.name+'" to not be empty')}for(var h=0;h<n.length;h++){var c=l(n[h],s);if(d&&!u[r].test(c))throw TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'", but got "'+c+'"');t+=s.prefix+c+s.suffix}continue}if("string"==typeof n||"number"==typeof n){var c=l(String(n),s);if(d&&!u[r].test(c))throw TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but got "'+c+'"');t+=s.prefix+c+s.suffix;continue}if(!a){var p=o?"an array":"a string";throw TypeError('Expected "'+s.name+'" to be '+p)}}return t}},t.WS=function(e,t,r){void 0===r&&(r={});var i=r.decode,s=void 0===i?function(e){return e}:i;return function(r){var i=e.exec(r);if(!i)return!1;for(var n=i[0],a=i.index,o=Object.create(null),l=1;l<i.length;l++)!function(e){if(void 0!==i[e]){var r=t[e-1];"*"===r.modifier||"+"===r.modifier?o[r.name]=i[e].split(r.prefix+r.suffix).map(function(e){return s(e,r)}):o[r.name]=s(i[e],r)}}(l);return{path:n,index:a,params:o}}},t.Bo=function e(t,n,a){return t instanceof RegExp?function(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var i=0;i<r.length;i++)t.push({name:i,prefix:"",suffix:"",modifier:"",pattern:""});return e}(t,n):Array.isArray(t)?RegExp("(?:"+t.map(function(t){return e(t,n,a).source}).join("|")+")",s(a)):function(e,t,r){void 0===r&&(r={});for(var n=r.strict,a=void 0!==n&&n,o=r.start,l=r.end,h=r.encode,d=void 0===h?function(e){return e}:h,u="["+i(r.endsWith||"")+"]|$",c="["+i(r.delimiter||"/#?")+"]",p=void 0===o||o?"^":"",f=0;f<e.length;f++){var m=e[f];if("string"==typeof m)p+=i(d(m));else{var g=i(d(m.prefix)),v=i(d(m.suffix));if(m.pattern){if(t&&t.push(m),g||v){if("+"===m.modifier||"*"===m.modifier){var y="*"===m.modifier?"?":"";p+="(?:"+g+"((?:"+m.pattern+")(?:"+v+g+"(?:"+m.pattern+"))*)"+v+")"+y}else p+="(?:"+g+"("+m.pattern+")"+v+")"+m.modifier}else p+="("+m.pattern+")"+m.modifier}else p+="(?:"+g+v+")"+m.modifier}}if(void 0===l||l)a||(p+=c+"?"),p+=r.endsWith?"(?="+u+")":"$";else{var x=e[e.length-1],w="string"==typeof x?c.indexOf(x[x.length-1])>-1:void 0===x;a||(p+="(?:"+c+"(?="+u+"))?"),w||(p+="(?="+c+"|"+u+")")}return new RegExp(p,s(r))}(r(t,a),n,a)}},"./dist/esm/lib/constants.js":(e,t,r)=>{"use strict";r.d(t,{Ar:()=>c,BR:()=>m,EX:()=>d,Et:()=>u,JT:()=>h,Jp:()=>v,Qq:()=>n,Sx:()=>a,Vz:()=>l,X_:()=>f,dN:()=>i,hd:()=>o,o$:()=>g,of:()=>p,y3:()=>s});let i="nxtP",s="x-prerender-revalidate",n="x-prerender-revalidate-if-generated",a=".prefetch.rsc",o=".rsc",l=".action",h=".json",d=".meta",u="x-next-cache-tags",c="x-next-cache-soft-tags",p="x-next-revalidated-tags",f="x-next-revalidate-tag-token",m=31536e3,g="instrumentation",v={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},y={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"};({...y,GROUP:{serverOnly:[y.reactServerComponents,y.actionBrowser,y.appMetadataRoute,y.appRouteHandler,y.instrument],clientOnly:[y.serverSideRendering,y.appPagesBrowser],nonClientServerTarget:[y.middleware,y.api],app:[y.reactServerComponents,y.actionBrowser,y.appMetadataRoute,y.appRouteHandler,y.serverSideRendering,y.appPagesBrowser,y.shared,y.instrument]}})},"./dist/esm/server/api-utils/index.js":(e,t,r)=>{"use strict";r.d(t,{Di:()=>l,Iq:()=>n,Lm:()=>d,OF:()=>h,QM:()=>o,dS:()=>a});var i=r("./dist/esm/server/web/spec-extension/adapters/headers.js"),s=r("./dist/esm/lib/constants.js");function n(e,t){let r=i.h.from(e.headers);return{isOnDemandRevalidate:r.get(s.y3)===t.previewModeId,revalidateOnlyGenerated:r.has(s.Qq)}}r("./lib/trace/tracer"),r("./dist/esm/server/lib/trace/constants.js");let a="__prerender_bypass",o="__next_preview_data",l=Symbol(o),h=Symbol(a);function d(e,t={}){if(h in e)return e;let{serialize:i}=r("./dist/compiled/cookie/index.js"),s=e.getHeader("Set-Cookie");return e.setHeader("Set-Cookie",[..."string"==typeof s?[s]:Array.isArray(s)?s:[],i(a,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0}),i(o,"",{expires:new Date(0),httpOnly:!0,sameSite:"none",secure:!0,path:"/",...void 0!==t.path?{path:t.path}:void 0})]),Object.defineProperty(e,h,{value:!0,enumerable:!1}),e}},"./dist/esm/server/api-utils/node/try-get-preview-data.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{tryGetPreviewData:()=>a});var i=r("./dist/esm/server/api-utils/index.js"),s=r("./dist/esm/server/web/spec-extension/cookies.js"),n=r("./dist/esm/server/web/spec-extension/adapters/headers.js");function a(e,t,a,o){var l,h;let d;if(a&&(0,i.Iq)(e,a).isOnDemandRevalidate)return!1;if(i.Di in e)return e[i.Di];let u=n.h.from(e.headers),c=new s.qC(u),p=null==(l=c.get(i.dS))?void 0:l.value,f=null==(h=c.get(i.QM))?void 0:h.value;if(p&&!f&&p===a.previewModeId){let t={};return Object.defineProperty(e,i.Di,{value:t,enumerable:!1}),t}if(!p&&!f)return!1;if(!p||!f||p!==a.previewModeId)return o||(0,i.Lm)(t),!1;try{d=r("next/dist/compiled/jsonwebtoken").verify(f,a.previewModeSigningKey)}catch{return(0,i.Lm)(t),!1}let{decryptWithSecret:m}=r("./dist/esm/server/crypto-utils.js"),g=m(Buffer.from(a.previewModeEncryptionKey),d.data);try{let t=JSON.parse(g);return Object.defineProperty(e,i.Di,{value:t,enumerable:!1}),t}catch{return!1}}},"./dist/esm/server/crypto-utils.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptWithSecret:()=>o,encryptWithSecret:()=>a});var i=r("crypto"),s=r.n(i);let n="aes-256-gcm";function a(e,t){let r=s().randomBytes(16),i=s().randomBytes(64),a=s().pbkdf2Sync(e,i,1e5,32,"sha512"),o=s().createCipheriv(n,a,r),l=Buffer.concat([o.update(t,"utf8"),o.final()]),h=o.getAuthTag();return Buffer.concat([i,r,h,l]).toString("hex")}function o(e,t){let r=Buffer.from(t,"hex"),i=r.slice(0,64),a=r.slice(64,80),o=r.slice(80,96),l=r.slice(96),h=s().pbkdf2Sync(e,i,1e5,32,"sha512"),d=s().createDecipheriv(n,h,a);return d.setAuthTag(o),d.update(l)+d.final("utf8")}},"./dist/esm/server/lib/server-ipc/request-utils.js":(e,t,r)=>{"use strict";r.d(t,{p:()=>l}),Symbol.for("NextjsError");var i=r("./dist/esm/shared/lib/utils.js");let s=["accept-encoding","keepalive","keep-alive","content-encoding","transfer-encoding","connection","expect"];[...s];let n=(e,t)=>{for(let[r,i]of(e["content-length"]&&"0"===e["content-length"]&&delete e["content-length"],Object.entries(e)))(t.includes(r)||!(Array.isArray(i)||"string"==typeof i))&&delete e[r];return e},a=async(e,t,r)=>{let i=n({"cache-control":"",...t.headers},s);return await fetch(e,{headers:i,method:t.method,redirect:"manual",signal:t.signal,..."GET"!==t.method&&"HEAD"!==t.method&&r?{body:r,duplex:"half"}:{},next:{internal:!0}})},o=e=>{if(!e||"object"!=typeof e||!e.stack)return e;let t=Error;"PageNotFoundError"===e.name&&(t=i.GP);let r=new t(e.message);return r.stack=e.stack,r.name=e.name,r.digest=e.digest,r};async function l({fetchHostname:e="localhost",method:t,args:r,ipcPort:i,ipcKey:s}){if(i){let n=await a(`http://${e}:${i}?key=${s}&method=${t}&args=${encodeURIComponent(JSON.stringify(r))}`,{method:"GET",headers:{}}),l=await n.text();if(l.startsWith("{")&&l.endsWith("}")){let e=JSON.parse(l);if(e&&"object"==typeof e&&"err"in e&&"stack"in e.err)throw o(e.err);return e}}}},"./dist/esm/server/lib/trace/constants.js":(e,t,r)=>{"use strict";var i,s,n,a,o,l,h,d,u,c,p,f;r.d(t,{Xy:()=>a,_J:()=>i,qj:()=>s}),function(e){e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404"}(i||(i={})),function(e){e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents"}(s||(s={})),function(e){e.getRequestHandler="NextServer.getRequestHandler",e.getServer="NextServer.getServer",e.getServerRequestHandler="NextServer.getServerRequestHandler",e.createServer="createServer.createServer"}(n||(n={})),function(e){e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch"}(a||(a={})),(o||(o={})).startServer="startServer.startServer",function(e){e.getServerSideProps="Render.getServerSideProps",e.getStaticProps="Render.getStaticProps",e.renderToString="Render.renderToString",e.renderDocument="Render.renderDocument",e.createBodyResult="Render.createBodyResult"}(l||(l={})),function(e){e.renderToString="AppRender.renderToString",e.renderToReadableStream="AppRender.renderToReadableStream",e.getBodyResult="AppRender.getBodyResult",e.fetch="AppRender.fetch"}(h||(h={})),(d||(d={})).executeRoute="Router.executeRoute",(u||(u={})).runHandler="Node.runHandler",(c||(c={})).runHandler="AppRouteRouteHandlers.runHandler",function(e){e.generateMetadata="ResolveMetadata.generateMetadata",e.generateViewport="ResolveMetadata.generateViewport"}(p||(p={})),(f||(f={})).execute="Middleware.execute"},"./dist/esm/server/node-environment.js":(e,t,r)=>{if("function"!=typeof globalThis.AsyncLocalStorage){let{AsyncLocalStorage:e}=r("async_hooks");globalThis.AsyncLocalStorage=e}"function"!=typeof globalThis.WebSocket&&Object.defineProperty(globalThis,"WebSocket",{get:()=>r("next/dist/compiled/ws").WebSocket})},"./dist/esm/server/node-polyfill-crypto.js":(e,t,r)=>{if(!global.crypto){let e;Object.defineProperty(global,"crypto",{enumerable:!1,configurable:!0,get:()=>(e||(e=r("node:crypto").webcrypto),e),set(t){e=t}})}},"./dist/esm/server/web/spec-extension/adapters/headers.js":(e,t,r)=>{"use strict";r.d(t,{h:()=>n});class i{static get(e,t,r){let i=Reflect.get(e,t,r);return"function"==typeof i?i.bind(e):i}static set(e,t,r,i){return Reflect.set(e,t,r,i)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}class s extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new s}}class n extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,s){if("symbol"==typeof r)return i.get(t,r,s);let n=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===n);if(void 0!==a)return i.get(t,a,s)},set(t,r,s,n){if("symbol"==typeof r)return i.set(t,r,s,n);let a=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===a);return i.set(t,o??r,s,n)},has(t,r){if("symbol"==typeof r)return i.has(t,r);let s=r.toLowerCase(),n=Object.keys(e).find(e=>e.toLowerCase()===s);return void 0!==n&&i.has(t,n)},deleteProperty(t,r){if("symbol"==typeof r)return i.deleteProperty(t,r);let s=r.toLowerCase(),n=Object.keys(e).find(e=>e.toLowerCase()===s);return void 0===n||i.deleteProperty(t,n)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return s.callable;default:return i.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new n(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,i]of this.entries())e.call(t,i,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()}}},"./dist/esm/server/web/spec-extension/cookies.js":(e,t,r)=>{"use strict";r.d(t,{qC:()=>i.RequestCookies});var i=r("./dist/compiled/@edge-runtime/cookies/index.js")},"./dist/esm/server sync recursive":e=>{function t(e){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id="./dist/esm/server sync recursive",e.exports=t},"./dist/esm/shared/lib/isomorphic/path.js":(e,t,r)=>{let i;i=r("path"),e.exports=i},"./dist/esm/shared/lib/modern-browserslist-target.js":e=>{e.exports=["chrome 64","edge 79","firefox 67","opera 51","safari 12"]},"./dist/esm/shared/lib/utils.js":(e,t,r)=>{"use strict";function i(e){let t,r=!1;return function(){for(var i=arguments.length,s=Array(i),n=0;n<i;n++)s[n]=arguments[n];return r||(r=!0,t=e(...s)),t}}function s(e){return e.finished||e.headersSent}function n(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}r.d(t,{At:()=>h,GP:()=>l,JW:()=>d,KM:()=>o,U3:()=>n,_9:()=>a,aC:()=>s,gf:()=>i}),"undefined"!=typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class a extends Error{}class o extends Error{}class l extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class h extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class d extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}},"./lib/trace/tracer":e=>{"use strict";e.exports=require("next/dist/server/lib/trace/tracer")},"next/dist/compiled/jsonwebtoken":e=>{"use strict";e.exports=require("next/dist/compiled/jsonwebtoken")},"next/dist/compiled/node-html-parser":e=>{"use strict";e.exports=require("next/dist/compiled/node-html-parser")},"next/dist/compiled/ws":e=>{"use strict";e.exports=require("next/dist/compiled/ws")},"./web/sandbox":e=>{"use strict";e.exports=require("next/dist/server/web/sandbox")},async_hooks:e=>{"use strict";e.exports=require("async_hooks")},crypto:e=>{"use strict";e.exports=require("crypto")},fs:e=>{"use strict";e.exports=require("fs")},module:e=>{"use strict";e.exports=require("module")},"node:crypto":e=>{"use strict";e.exports=require("node:crypto")},os:e=>{"use strict";e.exports=require("os")},path:e=>{"use strict";e.exports=require("path")}},t={};function r(i){var s=t[i];if(void 0!==s)return s.exports;var n=t[i]={exports:{}};return e[i](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";let e,t,s;r.r(i),r.d(i,{NoFallbackError:()=>ro,WrappedBuildError:()=>rl,default:()=>r6,isRSCRequestCheck:()=>rd});var n,a,o,l,h={};r.r(h),r.d(h,{bootstrap:()=>em,error:()=>ev,event:()=>eb,info:()=>ew,prefixes:()=>ec,ready:()=>ex,trace:()=>eE,wait:()=>eg,warn:()=>ey,warnOnce:()=>eC}),r("./dist/esm/server/node-environment.js");let d=r("path"),u=r("module"),c=u.prototype.require,p=u._resolveFilename,f=require.resolve,m=new Map;(function(e=[]){for(let[t,r]of e)m.set(t,r)})(Object.entries({"styled-jsx":d.dirname(f("styled-jsx/package.json")),"styled-jsx/style":f("styled-jsx/style"),"styled-jsx/style.js":f("styled-jsx/style")}).map(([e,t])=>[e,f(t)])),u._resolveFilename=(function(e,t,r,i,s,n){let a=t.get(r);return a&&(r=a),e.call(u,r,i,s,n)}).bind(null,p,m),u.prototype.require=function(e){return e.endsWith(".shared-runtime")?c.call(this,`next/dist/server/future/route-modules/pages/vendored/contexts/${d.basename(e,".shared-runtime")}`):c.call(this,e)},r("./dist/esm/server/node-polyfill-crypto.js");var g=r("./dist/esm/shared/lib/utils.js"),v=r("fs"),y=r.n(v),x=r("path"),w=r.n(x);function b(e){let{re:t,groups:r}=e;return e=>{let i=t.exec(e);if(!i)return!1;let s=e=>{try{return decodeURIComponent(e)}catch(e){throw new g._9("failed to decode param")}},n={};return Object.keys(r).forEach(e=>{let t=r[e],a=i[t.pos];void 0!==a&&(n[e]=~a.indexOf("/")?a.split("/").map(e=>s(e)):t.repeat?[s(a)]:s(a))}),n}}let E=Symbol.for("NextInternalRequestMeta");function _(e,t){let r=e[E]||{};return"string"==typeof t?r[t]:r}function C(e,t,r){let i=_(e);return i[t]=r,e[E]=i,i}r("./dist/esm/shared/lib/modern-browserslist-target.js");let R={client:"client",server:"server",edgeServer:"edge-server"};R.client,R.server,R.edgeServer;let P="/_not-found",S=""+P+"/page",T="pages-manifest.json",A="app-paths-manifest.json",D="server",N=["/_document","/_app","/_error"];Symbol("polyfills");let O=["/500"];function M(e,t){let r=w().join(e,t);return y().existsSync(r)?r:(r=w().join(e,"src",t),y().existsSync(r))?r:null}var k=r("./dist/esm/server/api-utils/index.js");function j(e){return function(){let{cookie:t}=e;if(!t)return{};let{parse:i}=r("./dist/compiled/cookie/index.js");return i(Array.isArray(t)?t.join("; "):t)}}!function(e){e[e.SeeOther=303]="SeeOther",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect"}(n||(n={}));class L{constructor(e,t,r){this.method=e,this.url=t,this.body=r}get cookies(){return this._cookies?this._cookies:this._cookies=j(this.headers)()}}class I{constructor(e){this.destination=e}redirect(e,t){return this.setHeader("Location",e),this.statusCode=t,t===n.PermanentRedirect&&this.setHeader("Refresh",`0;url=${e}`),this}}class q extends L{get originalRequest(){return this._req[E]=this[E],this._req.url=this.url,this._req.cookies=this.cookies,this._req}set originalRequest(e){this._req=e}constructor(e){var t;super(e.method.toUpperCase(),e.url,e),this._req=e,this.headers=this._req.headers,this.fetchMetrics=null==(t=this._req)?void 0:t.fetchMetrics,this[E]=this._req[E]||{}}}class $ extends I{get originalResponse(){return k.OF in this&&(this._res[k.OF]=this[k.OF]),this._res}constructor(e){super(e),this._res=e,this.textBody=void 0}get sent(){return this._res.finished||this._res.headersSent}get statusCode(){return this._res.statusCode}set statusCode(e){this._res.statusCode=e}get statusMessage(){return this._res.statusMessage}set statusMessage(e){this._res.statusMessage=e}setHeader(e,t){return this._res.setHeader(e,t),this}removeHeader(e){return this._res.removeHeader(e),this}getHeaderValues(e){let t=this._res.getHeader(e);if(void 0!==t)return(Array.isArray(t)?t:[t]).map(e=>e.toString())}hasHeader(e){return this._res.hasHeader(e)}getHeader(e){let t=this.getHeaderValues(e);return Array.isArray(t)?t.join(","):void 0}getHeaders(){return this._res.getHeaders()}appendHeader(e,t){let r=this.getHeaderValues(e)??[];return r.includes(t)||this._res.setHeader(e,[...r,t]),this}body(e){return this.textBody=e,this}send(){this._res.end(this.textBody)}}let H=e=>{let t=e.length,r=0,i=0,s=8997,n=0,a=33826,o=0,l=40164,h=0,d=52210;for(;r<t;)s^=e.charCodeAt(r++),i=435*s,n=435*a,o=435*l,h=435*d,o+=s<<8,h+=a<<8,n+=i>>>16,s=65535&i,o+=n>>>16,a=65535&n,d=h+(o>>>16)&65535,l=65535&o;return(15&d)*281474976710656+4294967296*l+65536*a+(s^d>>4)},F=(e,t=!1)=>(t?'W/"':'"')+H(e).toString(36)+e.length.toString(36)+'"';var z=r("./dist/compiled/fresh/index.js"),U=r.n(z),W=r("./dist/esm/lib/constants.js");function B({revalidate:e,swrDelta:t}){let r=t?`stale-while-revalidate=${t}`:"stale-while-revalidate";return 0===e?"private, no-cache, no-store, max-age=0, must-revalidate":"number"==typeof e?`s-maxage=${e}, ${r}`:`s-maxage=${W.BR}, ${r}`}let G="Next-Action",K="Next-Router-State-Tree",V="Next-Router-Prefetch",X="Next-Url",J=[["RSC"],[K],[V]],Y="_rsc";async function Q({req:e,res:t,result:i,type:s,generateEtags:n,poweredByHeader:a,revalidate:o,swrDelta:l}){if((0,g.aC)(t))return;a&&"html"===s&&t.setHeader("X-Powered-By","Next.js"),void 0===o||t.getHeader("Cache-Control")||t.setHeader("Cache-Control",B({revalidate:o,swrDelta:l}));let h=i.isDynamic?null:i.toUnchunkedString();if(null!==h){var d;let i=h;if("rsc"===s)i=h.split("\n").sort().join("\n");else if("html"===s&&h.includes("__next_f")){let{parse:e}=r("next/dist/compiled/node-html-parser");try{let t=e(h),r=null==(d=t.querySelector("body"))?void 0:d.querySelectorAll("script").filter(e=>{var t;return!e.hasAttribute("src")&&(null==(t=e.innerHTML)?void 0:t.includes("__next_f"))});null==r||r.sort((e,t)=>e.innerHTML.localeCompare(t.innerHTML)),null==r||r.forEach(e=>e.remove()),null==r||r.forEach(e=>{var r;return null==(r=t.querySelector("body"))?void 0:r.appendChild(e)}),i=t.toString()}catch(e){console.error("Error parsing HTML payload",e)}}let a=n?F(i):void 0;if(a&&t.setHeader("ETag",a),U()(e.headers,{etag:a})&&(t.statusCode=304,t.end(),1))return}if(t.getHeader("Content-Type")||t.setHeader("Content-Type",i.contentType?i.contentType:"rsc"===s?"text/x-component":"json"===s?"application/json":"text/html; charset=utf-8"),h&&t.setHeader("Content-Length",Buffer.byteLength(h)),"HEAD"===e.method){t.end(null);return}if(null!==h){t.end(h);return}await i.pipeToNodeResponse(t)}function Z(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t}function ee(e){if(e.startsWith("/"))return function(e,t){let r=new URL("http://n"),i=e.startsWith(".")?new URL("http://n"):r,{pathname:s,searchParams:n,search:a,hash:o,href:l,origin:h}=new URL(e,i);if(h!==r.origin)throw Error("invariant: invalid relative URL, router received "+e);return{pathname:s,query:Z(n),search:a,hash:o,href:l.slice(r.origin.length)}}(e);let t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:Z(t.searchParams),search:t.search}}let{env:et,stdout:er}=(null==(a=globalThis)?void 0:a.process)??{},ei=et&&!et.NO_COLOR&&(et.FORCE_COLOR||(null==er?void 0:er.isTTY)&&!et.CI&&"dumb"!==et.TERM),es=(e,t,r,i)=>{let s=e.substring(0,i)+r,n=e.substring(i+t.length),a=n.indexOf(t);return~a?s+es(n,t,r,a):s+n},en=(e,t,r=e)=>ei?i=>{let s=""+i,n=s.indexOf(t,e.length);return~n?e+es(s,t,r,n)+t:e+s+t}:String,ea=en("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m");en("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),en("\x1b[3m","\x1b[23m"),en("\x1b[4m","\x1b[24m"),en("\x1b[7m","\x1b[27m"),en("\x1b[8m","\x1b[28m"),en("\x1b[9m","\x1b[29m"),en("\x1b[30m","\x1b[39m");let eo=en("\x1b[31m","\x1b[39m"),el=en("\x1b[32m","\x1b[39m"),eh=en("\x1b[33m","\x1b[39m");en("\x1b[34m","\x1b[39m");let ed=en("\x1b[35m","\x1b[39m");en("\x1b[38;2;173;127;168m","\x1b[39m"),en("\x1b[36m","\x1b[39m");let eu=en("\x1b[37m","\x1b[39m");en("\x1b[90m","\x1b[39m"),en("\x1b[40m","\x1b[49m"),en("\x1b[41m","\x1b[49m"),en("\x1b[42m","\x1b[49m"),en("\x1b[43m","\x1b[49m"),en("\x1b[44m","\x1b[49m"),en("\x1b[45m","\x1b[49m"),en("\x1b[46m","\x1b[49m"),en("\x1b[47m","\x1b[49m");let ec={wait:eu(ea("○")),error:eo(ea("")),warn:eh(ea("⚠")),ready:"▲",info:eu(ea(" ")),event:el(ea("✓")),trace:ed(ea("»"))},ep={log:"log",warn:"warn",error:"error"};function ef(e,...t){(""===t[0]||void 0===t[0])&&1===t.length&&t.shift();let r=e in ep?ep[e]:"log",i=ec[e];0===t.length?console[r](""):console[r](" "+i,...t)}function em(...e){console.log(" ",...e)}function eg(...e){ef("wait",...e)}function ev(...e){ef("error",...e)}function ey(...e){ef("warn",...e)}function ex(...e){ef("ready",...e)}function ew(...e){ef("info",...e)}function eb(...e){ef("event",...e)}function eE(...e){ef("trace",...e)}let e_=new Set;function eC(...e){e_.has(e[0])||(e_.add(e.join(" ")),ey(...e))}let eR=require("url"),eP="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",eS=`(${eP}[.]){3}${eP}`,eT="(?:[0-9a-fA-F]{1,4})",eA=RegExp(`^((?:${eT}:){7}(?:${eT}|:)|(?:${eT}:){6}(?:${eS}|:${eT}|:)|(?:${eT}:){5}(?::${eS}|(:${eT}){1,2}|:)|(?:${eT}:){4}(?:(:${eT}){0,1}:${eS}|(:${eT}){1,3}|:)|(?:${eT}:){3}(?:(:${eT}){0,2}:${eS}|(:${eT}){1,4}|:)|(?:${eT}:){2}(?:(:${eT}){0,3}:${eS}|(:${eT}){1,5}|:)|(?:${eT}:){1}(?:(:${eT}){0,4}:${eS}|(:${eT}){1,6}|:)|(?::((?::${eT}){0,5}:${eS}|(?::${eT}){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})?$`);function eD(e){return e.startsWith("/")?e:"/"+e}function eN(e){return eD(e.split("/").reduce((e,t,r,i)=>t?"("===t[0]&&t.endsWith(")")||"@"===t[0]||("page"===t||"route"===t)&&r===i.length-1?e:e+"/"+t:e,""))}function eO(e){return e.replace(/\.rsc($|\?)/,"$1")}let eM=["(..)(..)","(.)","(..)","(...)"];function ek(e){return void 0!==e.split("/").find(e=>eM.find(t=>e.startsWith(t)))}let ej=/\/\[[^/]+?\](?=\/|$)/;function eL(e){return ek(e)&&(e=function(e){let t,r,i;for(let s of e.split("/"))if(r=eM.find(e=>s.startsWith(e))){[t,i]=e.split(r,2);break}if(!t||!r||!i)throw Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(t=eN(t),r){case"(.)":i="/"===t?`/${i}`:t+"/"+i;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);i=t.split("/").slice(0,-1).concat(i).join("/");break;case"(...)":i="/"+i;break;case"(..)(..)":let s=t.split("/");if(s.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);i=s.slice(0,-2).concat(i).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:i}}(e).interceptedRoute),ej.test(e)}let eI=require("next/dist/shared/lib/runtime-config.external.js");function eq(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}var e$=r("./lib/trace/tracer"),eH=r("./dist/esm/server/lib/trace/constants.js");function eF(){}new Uint8Array([60,104,116,109,108]),new Uint8Array([60,98,111,100,121]),new Uint8Array([60,47,104,101,97,100,62]),new Uint8Array([60,47,98,111,100,121,62]),new Uint8Array([60,47,104,116,109,108,62]),new Uint8Array([60,47,98,111,100,121,62,60,47,104,116,109,108,62]);let ez=new TextEncoder;async function eU(e){let t=new TextDecoder("utf-8",{fatal:!0}),r="";for await(let i of e)r+=t.decode(i,{stream:!0});return r+t.decode()}function eW(e){let t=new Headers;for(let[r,i]of Object.entries(e))for(let e of Array.isArray(i)?i:[i])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}function eB(e){var t,r,i,s,n,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,n=!1;l();)if(","===(r=e.charAt(o))){for(i=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(n=!0,o=s,a.push(e.substring(t,i)),t=o):o=i+1}else o+=1;(!n||o>=e.length)&&a.push(e.substring(t,e.length))}return a}function eG(e){let t={},r=[];if(e)for(let[i,s]of e.entries())"set-cookie"===i.toLowerCase()?(r.push(...eB(s)),t[i]=1===r.length?r[0]:r):t[i]=s;return t}function eK(e){return e.replace(/\/$/,"")||"/"}function eV(e){let t=e.indexOf("#"),r=e.indexOf("?"),i=r>-1&&(t<0||r<t);return i||t>-1?{pathname:e.substring(0,i?r:t),query:i?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}function eX(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:i,hash:s}=eV(e);return""+t+r+i+s}function eJ(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:i,hash:s}=eV(e);return""+r+t+i+s}function eY(e,t){if("string"!=typeof e)return!1;let{pathname:r}=eV(e);return r===t||r.startsWith(t+"/")}function eQ(e,t){let r;if((null==t?void 0:t.host)&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}function eZ(e,t){let r;let i=e.split("/");return(t||[]).some(t=>!!i[1]&&i[1].toLowerCase()===t.toLowerCase()&&(r=t,i.splice(1,1),e=i.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}function e0(e,t){if(!eY(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:"/"+r}function e1(e,t){var r,i;let{basePath:s,i18n:n,trailingSlash:a}=null!=(r=t.nextConfig)?r:{},o={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):a};s&&eY(o.pathname,s)&&(o.pathname=e0(o.pathname,s),o.basePath=s);let l=o.pathname;if(o.pathname.startsWith("/_next/data/")&&o.pathname.endsWith(".json")){let e=o.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),r=e[0];o.buildId=r,l="index"!==e[1]?"/"+e.slice(1).join("/"):"/",!0===t.parseData&&(o.pathname=l)}if(n){let e=t.i18nProvider?t.i18nProvider.analyze(o.pathname):eZ(o.pathname,n.locales);o.locale=e.detectedLocale,o.pathname=null!=(i=e.pathname)?i:o.pathname,!e.detectedLocale&&o.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(l):eZ(l,n.locales)).detectedLocale&&(o.locale=e.detectedLocale)}return o}let e4=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function e8(e,t){return new URL(String(e).replace(e4,"localhost"),t&&String(t).replace(e4,"localhost"))}let e3=Symbol("NextURLInternal");class e2{constructor(e,t,r){let i,s;"object"==typeof t&&"pathname"in t||"string"==typeof t?(i=t,s=r||{}):s=r||t||{},this[e3]={url:e8(e,i??s.base),options:s,basePath:""},this.analyze()}analyze(){var e,t,r,i,s;let n=e1(this[e3].url.pathname,{nextConfig:this[e3].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[e3].options.i18nProvider}),a=eQ(this[e3].url,this[e3].options.headers);this[e3].domainLocale=this[e3].options.i18nProvider?this[e3].options.i18nProvider.detectDomainLocale(a):function(e,t,r){if(e)for(let n of(r&&(r=r.toLowerCase()),e)){var i,s;if(t===(null==(i=n.domain)?void 0:i.split(":",1)[0].toLowerCase())||r===n.defaultLocale.toLowerCase()||(null==(s=n.locales)?void 0:s.some(e=>e.toLowerCase()===r)))return n}}(null==(t=this[e3].options.nextConfig)?void 0:null==(e=t.i18n)?void 0:e.domains,a);let o=(null==(r=this[e3].domainLocale)?void 0:r.defaultLocale)||(null==(s=this[e3].options.nextConfig)?void 0:null==(i=s.i18n)?void 0:i.defaultLocale);this[e3].url.pathname=n.pathname,this[e3].defaultLocale=o,this[e3].basePath=n.basePath??"",this[e3].buildId=n.buildId,this[e3].locale=n.locale??o,this[e3].trailingSlash=n.trailingSlash}formatPathname(){var e;let t;return t=function(e,t,r,i){if(!t||t===r)return e;let s=e.toLowerCase();return!i&&(eY(s,"/api")||eY(s,"/"+t.toLowerCase()))?e:eX(e,"/"+t)}((e={basePath:this[e3].basePath,buildId:this[e3].buildId,defaultLocale:this[e3].options.forceLocale?void 0:this[e3].defaultLocale,locale:this[e3].locale,pathname:this[e3].url.pathname,trailingSlash:this[e3].trailingSlash}).pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix),(e.buildId||!e.trailingSlash)&&(t=eK(t)),e.buildId&&(t=eJ(eX(t,"/_next/data/"+e.buildId),"/"===e.pathname?"index.json":".json")),t=eX(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:eJ(t,"/"):eK(t)}formatSearch(){return this[e3].url.search}get buildId(){return this[e3].buildId}set buildId(e){this[e3].buildId=e}get locale(){return this[e3].locale??""}set locale(e){var t,r;if(!this[e3].locale||!(null==(r=this[e3].options.nextConfig)?void 0:null==(t=r.i18n)?void 0:t.locales.includes(e)))throw TypeError(`The NextURL configuration includes no locale "${e}"`);this[e3].locale=e}get defaultLocale(){return this[e3].defaultLocale}get domainLocale(){return this[e3].domainLocale}get searchParams(){return this[e3].url.searchParams}get host(){return this[e3].url.host}set host(e){this[e3].url.host=e}get hostname(){return this[e3].url.hostname}set hostname(e){this[e3].url.hostname=e}get port(){return this[e3].url.port}set port(e){this[e3].url.port=e}get protocol(){return this[e3].url.protocol}set protocol(e){this[e3].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[e3].url=e8(e),this.analyze()}get origin(){return this[e3].url.origin}get pathname(){return this[e3].url.pathname}set pathname(e){this[e3].url.pathname=e}get hash(){return this[e3].url.hash}set hash(e){this[e3].url.hash=e}get search(){return this[e3].url.search}set search(e){this[e3].url.search=e}get password(){return this[e3].url.password}set password(e){this[e3].url.password=e}get username(){return this[e3].url.username}set username(e){this[e3].url.username=e}get basePath(){return this[e3].basePath}set basePath(e){this[e3].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new e2(String(this),this[e3].options)}}class e6 extends Error{constructor(){super(`The request.page has been deprecated in favour of \`URLPattern\`.
Read more: https://nextjs.org/docs/messages/middleware-request-page
`)}}class e9 extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
`)}}var e5=r("./dist/esm/server/web/spec-extension/cookies.js");let e7=Symbol("internal request");class te extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);(function(e){try{String(new URL(String(e)))}catch(t){throw Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t})}})(r),e instanceof Request?super(e,t):super(r,t);let i=new e2(r,{headers:eG(this.headers),nextConfig:t.nextConfig});this[e7]={cookies:new e5.qC(this.headers),geo:t.geo||{},ip:t.ip,nextUrl:i,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?r:i.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[e7].cookies}get geo(){return this[e7].geo}get ip(){return this[e7].ip}get nextUrl(){return this[e7].nextUrl}get page(){throw new e6}get ua(){throw new e9}get url(){return this[e7].url}}let tt="ResponseAborted";class tr extends Error{constructor(...e){super(...e),this.name=tt}}function ti(e){let t=new AbortController;return e.once("close",()=>{e.writableFinished||t.abort(new tr)}),t}class ts{static fromBaseNextRequest(e,t){return"request"in e&&e.request?ts.fromWebNextRequest(e):ts.fromNodeNextRequest(e,t)}static fromNodeNextRequest(e,t){let r,i=null;if("GET"!==e.method&&"HEAD"!==e.method&&e.body&&(i=e.body),e.url.startsWith("http"))r=new URL(e.url);else{let t=_(e,"initURL");r=t&&t.startsWith("http")?new URL(e.url,t):new URL(e.url,"http://n")}return new te(r,{method:e.method,headers:eW(e.headers),duplex:"half",signal:t,...t.aborted?{}:{body:i}})}static fromWebNextRequest(e){let t=null;return"GET"!==e.method&&"HEAD"!==e.method&&(t=e.body),new te(e.url,{method:e.method,headers:eW(e.headers),duplex:"half",signal:e.request.signal,...e.request.signal.aborted?{}:{body:t}})}}class tn{constructor(){let e,t;this.promise=new Promise((r,i)=>{e=r,t=i}),this.resolve=e,this.reject=t}}let ta=0,to=0,tl=0;function th(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===tt}async function td(e,t,r){try{let{errored:i,destroyed:s}=t;if(i||s)return;let n=ti(t),a=function(e,t){let r=!1,i=new tn;function s(){i.resolve()}e.on("drain",s),e.once("close",()=>{e.off("drain",s),i.resolve()});let n=new tn;return e.once("finish",()=>{n.resolve()}),new WritableStream({write:async t=>{if(!r){if(r=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let e=function(e={}){let t=0===ta?void 0:{clientComponentLoadStart:ta,clientComponentLoadTimes:to,clientComponentLoadCount:tl};return e.reset&&(ta=0,to=0,tl=0),t}();e&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:e.clientComponentLoadStart,end:e.clientComponentLoadStart+e.clientComponentLoadTimes})}e.flushHeaders(),(0,e$.getTracer)().trace(eH.Xy.startResponse,{spanName:"start response"},()=>void 0)}try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await i.promise,i=new tn)}catch(t){throw e.end(),Error("failed to write chunk to response",{cause:t})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),n.promise}})}(t,r);await e.pipeTo(a,{signal:n.signal})}catch(e){if(th(e))return;throw Error("failed to pipe response",{cause:e})}}class tu{static fromStatic(e){return new tu(e,{metadata:{}})}constructor(e,{contentType:t,waitUntil:r,metadata:i}){this.response=e,this.contentType=t,this.metadata=i,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)throw Error("Invariant: null responses cannot be unchunked");if("string"!=typeof this.response){if(!e)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return eU(this.readable)}return this.response}get readable(){if(null===this.response)throw Error("Invariant: null responses cannot be streamed");if("string"==typeof this.response)throw Error("Invariant: static responses cannot be streamed");return Array.isArray(this.response)?function(...e){if(0===e.length)throw Error("Invariant: chainStreams requires at least one stream");if(1===e.length)return e[0];let{readable:t,writable:r}=new TransformStream,i=e[0].pipeTo(r,{preventClose:!0}),s=1;for(;s<e.length-1;s++){let t=e[s];i=i.then(()=>t.pipeTo(r,{preventClose:!0}))}let n=e[s];return(i=i.then(()=>n.pipeTo(r))).catch(eF),t}(...this.response):this.response}chain(e){let t;if(null===this.response)throw Error("Invariant: response is null. This is a bug in Next.js");if("string"==typeof this.response){var r;t=[(r=this.response,new ReadableStream({start(e){e.enqueue(ez.encode(r)),e.close()}}))]}else t=Array.isArray(this.response)?this.response:[this.response];t.push(e),this.response=t}async pipeTo(e){try{await this.readable.pipeTo(e,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await e.close()}catch(t){if(th(t)){await e.abort(t);return}throw t}}async pipeToNodeResponse(e){await td(this.readable,e,this.waitUntil)}}function tc(e){let t=e.replace(/\\/g,"/");return t.startsWith("/index/")&&!eL(t)?t.slice(6):"/index"!==t?t:"/"}var tp=r("./dist/compiled/path-to-regexp/index.js");function tf(e,t){let r=[],i=(0,tp.Bo)(e,r,{delimiter:"/",sensitive:"boolean"==typeof(null==t?void 0:t.sensitive)&&t.sensitive,strict:null==t?void 0:t.strict}),s=(0,tp.WS)((null==t?void 0:t.regexModifier)?new RegExp(t.regexModifier(i.source),i.flags):i,r);return(e,i)=>{if("string"!=typeof e)return!1;let n=s(e);if(!n)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete n.params[e.name];return{...i,...n.params}}}let tm=/[|\\{}()[\]^$+*?.-]/,tg=/[|\\{}()[\]^$+*?.-]/g;function tv(e){return tm.test(e)?e.replace(tg,"\\$&"):e}function ty(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function tx(e){let{parameterizedRoute:t,groups:r}=function(e){let t=eK(e).slice(1).split("/"),r={},i=1;return{parameterizedRoute:t.map(e=>{let t=eM.find(t=>e.startsWith(t)),s=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&s){let{key:e,optional:n,repeat:a}=ty(s[1]);return r[e]={pos:i++,repeat:a,optional:n},"/"+tv(t)+"([^/]+?)"}if(!s)return"/"+tv(e);{let{key:e,repeat:t,optional:n}=ty(s[1]);return r[e]={pos:i++,repeat:t,optional:n},t?n?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:r}}function tw(e){let{interceptionMarker:t,getSafeRouteKey:r,segment:i,routeKeys:s,keyPrefix:n}=e,{key:a,optional:o,repeat:l}=ty(i),h=a.replace(/\W/g,"");n&&(h=""+n+h);let d=!1;(0===h.length||h.length>30)&&(d=!0),isNaN(parseInt(h.slice(0,1)))||(d=!0),d&&(h=r()),n?s[h]=""+n+a:s[h]=a;let u=t?tv(t):"";return l?o?"(?:/"+u+"(?<"+h+">.+?))?":"/"+u+"(?<"+h+">.+?)":"/"+u+"(?<"+h+">[^/]+?)"}function tb(e){return e.replace(/__ESC_COLON_/gi,":")}function tE(e,t,r,i){void 0===r&&(r=[]),void 0===i&&(i=[]);let s={},n=r=>{let i;let n=r.key;switch(r.type){case"header":n=n.toLowerCase(),i=e.headers[n];break;case"cookie":i="cookies"in e?e.cookies[r.key]:j(e.headers)()[r.key];break;case"query":i=t[n];break;case"host":{let{host:t}=(null==e?void 0:e.headers)||{};i=null==t?void 0:t.split(":",1)[0].toLowerCase()}}if(!r.value&&i)return s[function(e){let t="";for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);(i>64&&i<91||i>96&&i<123)&&(t+=e[r])}return t}(n)]=i,!0;if(i){let e=RegExp("^"+r.value+"$"),t=Array.isArray(i)?i.slice(-1)[0].match(e):i.match(e);if(t)return Array.isArray(t)&&(t.groups?Object.keys(t.groups).forEach(e=>{s[e]=t.groups[e]}):"host"===r.type&&t[0]&&(s.host=t[0])),!0}return!1};return!!r.every(e=>n(e))&&!i.some(e=>n(e))&&s}function t_(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(":"+r)&&(e=e.replace(RegExp(":"+r+"\\*","g"),":"+r+"--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":"+r+"\\?","g"),":"+r+"--ESCAPED_PARAM_QUESTION").replace(RegExp(":"+r+"\\+","g"),":"+r+"--ESCAPED_PARAM_PLUS").replace(RegExp(":"+r+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+r));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,tp.MY)("/"+e,{validate:!1})(t).slice(1)}function tC(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function tR(e){return tC(e)?e:Error(!function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}(e)?e+"":JSON.stringify(e))}class tP{constructor(e){this.provider=e}normalize(e){return this.provider.analyze(e).pathname}}class tS{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e){void 0===e&&(e="/");let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let r=t.map(t=>this.children.get(t)._smoosh(""+e+t+"/")).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get("[]")._smoosh(e+"["+this.slugName+"]/")),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+t+'" and "'+t+"[[..."+this.optionalRestSlugName+']]").');r.unshift(t)}return null!==this.restSlugName&&r.push(...this.children.get("[...]")._smoosh(e+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&r.push(...this.children.get("[[...]]")._smoosh(e+"[[..."+this.optionalRestSlugName+"]]/")),r}_insert(e,t,r){if(0===e.length){this.placeholder=!1;return}if(r)throw Error("Catch-all must be the last part of the URL.");let i=e[0];if(i.startsWith("[")&&i.endsWith("]")){let n=i.slice(1,-1),a=!1;if(n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1),a=!0),n.startsWith("...")&&(n=n.substring(3),r=!0),n.startsWith("[")||n.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+n+"').");if(n.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+n+"').");function s(e,r){if(null!==e&&e!==r)throw Error("You cannot use different slug names for the same dynamic path ('"+e+"' !== '"+r+"').");t.forEach(e=>{if(e===r)throw Error('You cannot have the same slug name "'+r+'" repeat within a single dynamic path');if(e.replace(/\W/g,"")===i.replace(/\W/g,""))throw Error('You cannot have the slug names "'+e+'" and "'+r+'" differ only by non-word symbols within a single dynamic path')}),t.push(r)}if(r){if(a){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+e[0]+'" ).');s(this.optionalRestSlugName,n),this.optionalRestSlugName=n,i="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+e[0]+'").');s(this.restSlugName,n),this.restSlugName=n,i="[...]"}}else{if(a)throw Error('Optional route parameters are not yet supported ("'+e[0]+'").');s(this.slugName,n),this.slugName=n,i="[]"}}this.children.has(i)||this.children.set(i,new tS),this.children.get(i)._insert(e.slice(1),t,r)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}class tT{constructor(e){this.definition=e,eL(e.pathname)&&(this.dynamic=b(tx(e.pathname)))}get identity(){return this.definition.pathname}get isDynamic(){return void 0!==this.dynamic}match(e){let t=this.test(e);return t?{definition:this.definition,params:t.params}:null}test(e){if(this.dynamic){let t=this.dynamic(e);return t?{params:t}:null}return e===this.definition.pathname?{}:null}}class tA extends tT{get identity(){var e;return`${this.definition.pathname}?__nextLocale=${null==(e=this.definition.i18n)?void 0:e.locale}`}match(e,t){var r,i;let s=this.test(e,t);return s?{definition:this.definition,params:s.params,detectedLocale:(null==t?void 0:null==(r=t.i18n)?void 0:r.detectedLocale)??(null==(i=this.definition.i18n)?void 0:i.locale)}:null}test(e,t){return this.definition.i18n&&(null==t?void 0:t.i18n)?this.definition.i18n.locale&&t.i18n.detectedLocale&&this.definition.i18n.locale!==t.i18n.detectedLocale?null:super.test(t.i18n.pathname):super.test(e)}}class tD{get compilationID(){return this.providers.length}async waitTillReady(){this.waitTillReadyPromise&&(await this.waitTillReadyPromise,delete this.waitTillReadyPromise)}async reload(){let{promise:e,resolve:t,reject:r}=new tn;this.waitTillReadyPromise=e;let i=this.compilationID;try{let e=[],t=await Promise.all(this.providers.map(e=>e.matchers())),r=new Map,s={};for(let i of t)for(let t of i){t.duplicated&&delete t.duplicated;let i=r.get(t.definition.pathname);if(i){let e=s[t.definition.pathname]??[i];e.push(t),s[t.definition.pathname]=e,i.duplicated=e,t.duplicated=e}e.push(t),r.set(t.definition.pathname,t)}if(this.matchers.duplicates=s,this.previousMatchers.length===e.length&&this.previousMatchers.every((t,r)=>t===e[r]))return;this.previousMatchers=e,this.matchers.static=e.filter(e=>!e.isDynamic);let n=e.filter(e=>e.isDynamic),a=new Map,o=[];for(let e=0;e<n.length;e++){let t=n[e].definition.pathname,r=a.get(t)??[];r.push(e),1===r.length&&(a.set(t,r),o.push(t))}let l=function(e){let t=new tS;return e.forEach(e=>t.insert(e)),t.smoosh()}(o),h=[];for(let e of l){let t=a.get(e);if(!Array.isArray(t))throw Error("Invariant: expected to find identity in indexes map");let r=t.map(e=>n[e]);h.push(...r)}if(this.matchers.dynamic=h,this.compilationID!==i)throw Error("Invariant: expected compilation to finish before new matchers were added, possible missing await")}catch(e){r(e)}finally{this.lastCompilationID=i,t()}}push(e){this.providers.push(e)}async test(e,t){return null!==await this.match(e,t)}async match(e,t){for await(let r of this.matchAll(e,t))return r;return null}validate(e,t,r){var i;return t instanceof tA?t.match(e,r):(null==(i=r.i18n)?void 0:i.inferredFromDefault)?t.match(r.i18n.pathname):t.match(e)}async *matchAll(e,t){if(this.lastCompilationID!==this.compilationID)throw Error("Invariant: expected routes to have been loaded before match");if(!eL(e=eD(e)))for(let r of this.matchers.static){let i=this.validate(e,r,t);i&&(yield i)}if(null==t?void 0:t.skipDynamic)return null;for(let r of this.matchers.dynamic){let i=this.validate(e,r,t);i&&(yield i)}return null}constructor(){this.providers=[],this.matchers={static:[],dynamic:[],duplicates:{}},this.lastCompilationID=this.compilationID,this.previousMatchers=[]}}class tN{constructor(e=[]){this.normalizers=e}push(e){this.normalizers.push(e)}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}var tO=r("./dist/esm/shared/lib/isomorphic/path.js"),tM=r.n(tO);class tk{constructor(...e){this.prefix=tM().posix.join(...e)}normalize(e){return tM().posix.join(this.prefix,e)}}function tj(e){let t=/^\/index(\/|$)/.test(e)&&!eL(e)?"/index"+e:"/"===e?"/index":eD(e);{let{posix:e}=r("path"),i=e.normalize(t);if(i!==t)throw new g.KM("Requested and resolved page mismatch: "+t+" "+i)}return t}class tL extends tk{constructor(){super("app")}normalize(e){return super.normalize(tj(e))}}class tI extends tk{constructor(e){super(e,D)}normalize(e){return super.normalize(e)}}function tq(e){return{normalize:e}}!function(e){e.PAGES="pages",e.ROOT="root",e.APP="app"}(o||(o={}));class t${normalize(e){return e.replace(/%5F/g,"_")}}class tH extends tN{constructor(){super([tq(eN),new t$])}normalize(e){return super.normalize(e)}}class tF{constructor(e){this.filename=new tI(e),this.pathname=new tH,this.bundlePath=new tL}}!function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE"}(l||(l={}));class tz extends tT{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class tU{constructor(e){this.loader=e,this.cached=[]}async matchers(){let e=await this.loader.load();if(!e)return[];if(this.data&&this.loader.compare(this.data,e))return this.cached;this.data=e;let t=await this.transform(e);return this.cached=t,t}}class tW extends tU{constructor(e,t){super({load:async()=>t.load(e),compare:(e,t)=>e===t})}}class tB extends tW{constructor(e,t){super(A,t),this.normalizers=new tF(e)}async transform(e){let t=Object.keys(e).filter(e=>e.endsWith("/page")),r={};for(let e of t){let t=this.normalizers.pathname.normalize(e);t in r?r[t].push(e):r[t]=[e]}let i=[];for(let[t,s]of Object.entries(r)){let r=s[0],n=this.normalizers.filename.normalize(e[r]),a=this.normalizers.bundlePath.normalize(r);i.push(new tz({kind:l.APP_PAGE,pathname:t,page:r,bundlePath:a,filename:n,appPaths:s}))}return i}}class tG extends tT{}class tK extends tW{constructor(e,t){super(A,t),this.normalizers=new tF(e)}async transform(e){let t=Object.keys(e).filter(e=>e.endsWith("/route")),r=[];for(let i of t){let t=this.normalizers.filename.normalize(e[i]),s=this.normalizers.pathname.normalize(i),n=this.normalizers.bundlePath.normalize(i);r.push(new tG({kind:l.APP_ROUTE,pathname:s,page:i,bundlePath:n,filename:t}))}return r}}function tV(e){return"/api"===e||!!(null==e?void 0:e.startsWith("/api/"))}class tX extends tT{}class tJ extends tA{}class tY extends tN{constructor(){super([tq(tj),new tk("pages")])}normalize(e){return super.normalize(e)}}class tQ extends tk{constructor(e){super(e,D)}normalize(e){return super.normalize(e)}}class tZ{constructor(e){this.filename=new tQ(e),this.bundlePath=new tY}}class t0 extends tW{constructor(e,t,r){super(T,t),this.i18nProvider=r,this.normalizers=new tZ(e)}async transform(e){let t=Object.keys(e).filter(e=>tV(e)),r=[];for(let i of t)if(this.i18nProvider){let{detectedLocale:t,pathname:s}=this.i18nProvider.analyze(i);r.push(new tJ({kind:l.PAGES_API,pathname:s,page:i,bundlePath:this.normalizers.bundlePath.normalize(i),filename:this.normalizers.filename.normalize(e[i]),i18n:{locale:t}}))}else r.push(new tX({kind:l.PAGES_API,pathname:i,page:i,bundlePath:this.normalizers.bundlePath.normalize(i),filename:this.normalizers.filename.normalize(e[i])}));return r}}class t1 extends tT{}class t4 extends tA{}class t8 extends tW{constructor(e,t,r){super(T,t),this.i18nProvider=r,this.normalizers=new tZ(e)}async transform(e){let t=Object.keys(e).filter(e=>!tV(e)).filter(e=>{var t;let r=(null==(t=this.i18nProvider)?void 0:t.analyze(e).pathname)??e;return!N.includes(r)}),r=[];for(let i of t)if(this.i18nProvider){let{detectedLocale:t,pathname:s}=this.i18nProvider.analyze(i);r.push(new t4({kind:l.PAGES,pathname:s,page:i,bundlePath:this.normalizers.bundlePath.normalize(i),filename:this.normalizers.filename.normalize(e[i]),i18n:{locale:t}}))}else r.push(new t1({kind:l.PAGES,pathname:i,page:i,bundlePath:this.normalizers.bundlePath.normalize(i),filename:this.normalizers.filename.normalize(e[i])}));return r}}class t3{constructor(e){this.getter=e}load(e){return this.getter(e)}}class t2{constructor(e){var t;if(this.config=e,!e.locales.length)throw Error("Invariant: No locales provided");this.lowerCaseLocales=e.locales.map(e=>e.toLowerCase()),this.lowerCaseDomains=null==(t=e.domains)?void 0:t.map(e=>{var t;let r=e.domain.toLowerCase();return{defaultLocale:e.defaultLocale.toLowerCase(),hostname:r.split(":",1)[0],domain:r,locales:null==(t=e.locales)?void 0:t.map(e=>e.toLowerCase()),http:e.http}})}detectDomainLocale(e,t){if(e&&this.lowerCaseDomains&&this.config.domains){t&&(t=t.toLowerCase());for(let i=0;i<this.lowerCaseDomains.length;i++){var r;let s=this.lowerCaseDomains[i];if(s.hostname===e||(null==(r=s.locales)?void 0:r.some(e=>e===t)))return this.config.domains[i]}}}fromQuery(e,t){let r=t.__nextLocale;if(r){let t=this.analyze(e);if(t.detectedLocale){if(t.detectedLocale!==r)throw Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${r}' in '${e}' but found '${t.detectedLocale}'}`);e=t.pathname}}return{pathname:e,detectedLocale:r,inferredFromDefault:"1"===t.__nextInferredLocaleFromDefault}}analyze(e,t={}){let r=t.defaultLocale,i="string"==typeof r,s=e.split("/",2);if(!s[1])return{detectedLocale:r,pathname:e,inferredFromDefault:i};let n=s[1].toLowerCase(),a=this.lowerCaseLocales.indexOf(n);return a<0||(r=this.config.locales[a],i=!1,e=e.slice(r.length+1)||"/"),{detectedLocale:r,pathname:e,inferredFromDefault:i}}}async function t6(e,t,r,i){{var s;t.statusCode=r.status,t.statusMessage=r.statusText,null==(s=r.headers)||s.forEach((e,r)=>{if("set-cookie"===r.toLowerCase())for(let i of eB(e))t.appendHeader(r,i);else t.appendHeader(r,e)});let n=t.originalResponse;r.body&&"HEAD"!==e.method?await td(r.body,n,i):n.end()}}require("next/dist/client/components/static-generation-async-storage.external.js"),Symbol.for("next.mutated.cookies");let t9=tf("/_next/data/:path*");class t5{constructor(e){this.suffix=e}match(e){return!!e.endsWith(this.suffix)}normalize(e,t){return t||this.match(e)?e.substring(0,e.length-this.suffix.length):e}}class t7 extends t5{constructor(){super(W.hd)}}class re{constructor(e){if(this.prefix=e,e.endsWith("/"))throw Error(`PrefixPathnameNormalizer: prefix "${e}" should not end with a slash`)}match(e){return!!(e===this.prefix||e.startsWith(this.prefix+"/"))}normalize(e,t){return t||this.match(e)?e.length===this.prefix.length?"/":e.substring(this.prefix.length):e}}class rt extends re{constructor(){super("/_next/postponed/resume")}normalize(e,t){return t||this.match(e)?tc(e=super.normalize(e,!0)):e}}class rr extends t5{constructor(){super(W.Vz)}}function ri(e){for(let[t]of J)delete e[t.toLowerCase()]}class rs extends t5{constructor(){super(W.Sx)}}class rn{constructor(e){if(this.suffix=new t5(".json"),!e)throw Error("Invariant: buildID is required");this.prefix=new re(`/_next/data/${e}`)}match(e){return this.prefix.match(e)&&this.suffix.match(e)}normalize(e,t){return t||this.match(e)?(e=this.prefix.normalize(e,!0),tc(e=this.suffix.normalize(e,!0))):e}}function ra(e){return e.replace(/(?:\/index)?\/?$/,"")||"/"}class ro extends Error{}class rl extends Error{constructor(e){super(),this.innerError=e}}class rh{constructor(e){var t,i,s;this.handleRSCRequest=(e,t,r)=>{var i,s;if(!r.pathname)return!1;if(null==(i=this.normalizers.prefetchRSC)?void 0:i.match(r.pathname))r.pathname=this.normalizers.prefetchRSC.normalize(r.pathname,!0),e.headers["RSC".toLowerCase()]="1",e.headers[V.toLowerCase()]="1",C(e,"isRSCRequest",!0),C(e,"isPrefetchRSCRequest",!0);else if(null==(s=this.normalizers.rsc)?void 0:s.match(r.pathname))r.pathname=this.normalizers.rsc.normalize(r.pathname,!0),e.headers["RSC".toLowerCase()]="1",C(e,"isRSCRequest",!0);else if(e.headers["x-now-route-matches"])return ri(e.headers),!1;else return!1;if(e.url){let t=(0,eR.parse)(e.url);t.pathname=r.pathname,e.url=(0,eR.format)(t)}return!1},this.handleNextDataRequest=async(e,t,r)=>{let i=this.getMiddleware(),s=function(e){return"string"==typeof e&&t9(e)}(r.pathname);if(!s||!s.path)return!1;if(s.path[0]!==this.buildId)return!_(e,"middlewareInvoke")&&(await this.render404(e,t,r),!0);s.path.shift();let n=s.path[s.path.length-1];if("string"!=typeof n||!n.endsWith(".json"))return await this.render404(e,t,r),!0;let a=`/${s.path.join("/")}`;if(a=function(e,t){return void 0===t&&(t=""),e=e.replace(/\\/g,"/"),(e=t&&e.endsWith(t)?e.slice(0,-t.length):e).startsWith("/index/")&&!eL(e)?e=e.slice(6):"/index"===e&&(e="/"),e}(a,".json"),i&&(this.nextConfig.trailingSlash&&!a.endsWith("/")&&(a+="/"),!this.nextConfig.trailingSlash&&a.length>1&&a.endsWith("/")&&(a=a.substring(0,a.length-1))),this.i18nProvider){var o;let s=null==e?void 0:null==(o=e.headers.host)?void 0:o.split(":",1)[0].toLowerCase(),n=this.i18nProvider.detectDomainLocale(s),l=(null==n?void 0:n.defaultLocale)??this.i18nProvider.config.defaultLocale,h=this.i18nProvider.analyze(a);if(h.detectedLocale&&(a=h.pathname),r.query.__nextLocale=h.detectedLocale,r.query.__nextDefaultLocale=l,h.detectedLocale||delete r.query.__nextInferredLocaleFromDefault,!h.detectedLocale&&!i)return r.query.__nextLocale=l,await this.render404(e,t,r),!0}return r.pathname=a,r.query.__nextDataReq="1",!1},this.handleNextImageRequest=()=>!1,this.handleCatchallRenderRequest=()=>!1,this.handleCatchallMiddlewareRequest=()=>!1,this.normalize=e=>{let t=[];for(let r of(this.normalizers.data&&t.push(this.normalizers.data),this.normalizers.postponed&&t.push(this.normalizers.postponed),this.normalizers.prefetchRSC&&t.push(this.normalizers.prefetchRSC),this.normalizers.rsc&&t.push(this.normalizers.rsc),this.normalizers.action&&t.push(this.normalizers.action),t))if(r.match(e))return r.normalize(e,!0);return e},this.normalizeAndAttachMetadata=async(e,t,r)=>{let i=await this.handleNextImageRequest(e,t,r);return!!(i||this.enabledDirectories.pages&&(i=await this.handleNextDataRequest(e,t,r)))},this.prepared=!1,this.preparedPromise=null,this.customErrorNo404Warn=(0,g.gf)(()=>{ey(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:n=".",quiet:a=!1,conf:o,dev:l=!1,minimalMode:h=!1,customServer:d=!0,hostname:u,port:c,experimentalTestProxy:p}=e;this.experimentalTestProxy=p,this.serverOptions=e,this.dir=r("path").resolve(n),this.quiet=a,this.loadEnvConfig({dev:l}),this.nextConfig=o,this.hostname=u,this.hostname&&(this.fetchHostname=function(e){return eA.test(e)?`[${e}]`:e}(this.hostname)),this.port=c,this.distDir=r("path").join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!h&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new t2(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new tP(this.i18nProvider):void 0;let{serverRuntimeConfig:f={},publicRuntimeConfig:m,assetPrefix:v,generateEtags:y}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=h||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(l),this.normalizers={postponed:this.enabledDirectories.app&&this.nextConfig.experimental.ppr?new rt:void 0,rsc:this.enabledDirectories.app?new t7:void 0,prefetchRSC:this.enabledDirectories.app&&this.nextConfig.experimental.ppr?new rs:void 0,data:this.enabledDirectories.pages?new rn(this.buildId):void 0,action:this.enabledDirectories.app?new rr:void 0},this.nextFontManifest=this.getNextFontManifest(),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"",this.renderOpts={supportsDynamicResponse:!0,trailingSlash:this.nextConfig.trailingSlash,deploymentId:this.nextConfig.deploymentId,strictNextHead:!!this.nextConfig.experimental.strictNextHead,poweredByHeader:this.nextConfig.poweredByHeader,canonicalBase:this.nextConfig.amp.canonicalBase||"",buildId:this.buildId,generateEtags:y,previewProps:this.getPrerenderManifest().preview,customServer:!0===d||void 0,ampOptimizerConfig:null==(i=this.nextConfig.experimental.amp)?void 0:i.optimizer,basePath:this.nextConfig.basePath,images:this.nextConfig.images,optimizeFonts:this.nextConfig.optimizeFonts,fontManifest:this.nextConfig.optimizeFonts&&!l?this.getFontManifest():void 0,optimizeCss:this.nextConfig.experimental.optimizeCss,nextConfigOutput:this.nextConfig.output,nextScriptWorkers:this.nextConfig.experimental.nextScriptWorkers,disableOptimizedLoading:this.nextConfig.experimental.disableOptimizedLoading,domainLocales:null==(s=this.nextConfig.i18n)?void 0:s.domains,distDir:this.distDir,serverComponents:this.enabledDirectories.app,enableTainting:this.nextConfig.experimental.taint,crossOrigin:this.nextConfig.crossOrigin?this.nextConfig.crossOrigin:void 0,largePageDataBytes:this.nextConfig.experimental.largePageDataBytes,runtimeConfig:Object.keys(m).length>0?m:void 0,isExperimentalCompile:this.nextConfig.experimental.isExperimentalCompile,experimental:{ppr:this.enabledDirectories.app&&!0===this.nextConfig.experimental.ppr,missingSuspenseWithCSRBailout:!0===this.nextConfig.experimental.missingSuspenseWithCSRBailout,swrDelta:this.nextConfig.experimental.swrDelta}},(0,eI.setConfig)({serverRuntimeConfig:f,publicRuntimeConfig:m}),this.pagesManifest=this.getPagesManifest(),this.appPathsManifest=this.getAppPathsManifest(),this.appPathRoutes=this.getAppPathRoutes(),this.interceptionRoutePatterns=this.getinterceptionRoutePatterns(),this.matchers=this.getRouteMatchers(),this.matchers.reload(),this.setAssetPrefix(v),this.responseCache=this.getResponseCache({dev:l})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let e=new t3(e=>{switch(e){case T:return this.getPagesManifest()??null;case A:return this.getAppPathsManifest()??null;default:return null}}),t=new tD;return t.push(new t8(this.distDir,e,this.i18nProvider)),t.push(new t0(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new tB(this.distDir,e)),t.push(new tK(this.distDir,e))),t}logError(e){this.quiet||ev(e)}async handleRequest(e,t,r){await this.prepare();let i=e.method.toUpperCase(),s=rd(e)?"RSC ":"",n=(0,e$.getTracer)();return n.withPropagatedContext(e.headers,()=>n.trace(eH._J.handleRequest,{spanName:`${s}${i} ${e.url}`,kind:e$.SpanKind.SERVER,attributes:{"http.method":i,"http.target":e.url,"next.rsc":!!s}},async a=>this.handleRequestImpl(e,t,r).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":t.statusCode});let e=n.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==eH._J.handleRequest){console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);return}let r=e.get("next.route");if(r){let e=`${s}${i} ${r}`;a.setAttributes({"next.route":r,"http.route":r,"next.span_name":e}),a.updateName(e)}})))}async handleRequestImpl(e,t,r){try{var i,s,n,a,o,l,h,d,u,c;await this.matchers.waitTillReady();let p=t.originalResponse||t,f=p.setHeader.bind(p);p.setHeader=(t,r)=>{if(!p.headersSent){if("set-cookie"===t.toLowerCase()){let t=_(e,"middlewareCookie");t&&Array.isArray(r)&&r.every((e,r)=>e===t[r])||(r=[...new Set([...t||[],..."string"==typeof r?[r]:Array.isArray(r)?r:[]])])}return f(t,r)}};let m=(e.url||"").split("?",1)[0];if(null==m?void 0:m.match(/(\\|\/\/)/)){let r=(0,g.U3)(e.url);t.redirect(r,308).body(r).send();return}if(!r||"object"!=typeof r){if(!e.url)throw Error("Invariant: url can not be undefined");r=(0,eR.parse)(e.url,!0)}if(!r.pathname)throw Error("Invariant: pathname can't be empty");"string"==typeof r.query&&(r.query=Object.fromEntries(new URLSearchParams(r.query)));let{originalRequest:v}=e,y=null==v?void 0:v.headers["x-forwarded-proto"],x=y?"https"===y:!!(null==v?void 0:null==(i=v.socket)?void 0:i.encrypted);if(e.headers["x-forwarded-host"]??=e.headers.host??this.hostname,e.headers["x-forwarded-port"]??=this.port?this.port.toString():x?"443":"80",e.headers["x-forwarded-proto"]??=x?"https":"http",e.headers["x-forwarded-for"]??=null==(s=v.socket)?void 0:s.remoteAddress,this.attachRequestMeta(e,r),this.enabledDirectories.app&&await this.handleRSCRequest(e,t,r))return;let w=null==(n=this.i18nProvider)?void 0:n.detectDomainLocale(eQ(r,e.headers)),E=(null==w?void 0:w.defaultLocale)||(null==(a=this.nextConfig.i18n)?void 0:a.defaultLocale);r.query.__nextDefaultLocale=E;let R=ee(e.url.replace(/^\/+/,"/")),P=e1(R.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});R.pathname=P.pathname,P.basePath&&(e.url=e0(e.url,this.nextConfig.basePath));let S="string"==typeof e.headers["x-matched-path"];if(S)try{this.enabledDirectories.app&&(e.url.match(/^\/index($|\?)/)&&(e.url=e.url.replace(/^\/index/,"/")),r.pathname="/index"===r.pathname?"/":r.pathname);let{pathname:i}=new URL(e.headers["x-matched-path"],"http://localhost"),{pathname:s}=new URL(e.url,"http://localhost");if(null==(o=this.normalizers.data)?void 0:o.match(s))r.query.__nextDataReq="1";else if((null==(l=this.normalizers.postponed)?void 0:l.match(i))&&"POST"===e.method){let t=[];for await(let r of e.body)t.push(r);let r=Buffer.concat(t).toString("utf8");C(e,"postponed",r),e.headers["x-now-route-matches"]||(s=this.normalizers.postponed.normalize(i,!0))}i=this.normalize(i);let n=this.stripNextDataPath(s),a=null==(h=this.i18nProvider)?void 0:h.analyze(i,{defaultLocale:E});a&&(r.query.__nextLocale=a.detectedLocale,a.inferredFromDefault?r.query.__nextInferredLocaleFromDefault="1":delete r.query.__nextInferredLocaleFromDefault);let c=i=tc(i),p=eL(c);if(!p){let e=await this.matchers.match(c,{i18n:a});e&&(c=e.definition.pathname,p=void 0!==e.params)}a&&(i=a.pathname);let f=function({page:e,i18n:t,basePath:r,rewrites:i,pageIsDynamic:s,trailingSlash:n,caseSensitive:a}){let o,l,h;return s&&(h=(l=b(o=function(e,t){let r=function(e,t){let r;let i=eK(e).slice(1).split("/"),s=(r=0,()=>{let e="",t=++r;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),n={};return{namedParameterizedRoute:i.map(e=>{let r=eM.some(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(r&&i){let[r]=e.split(i[0]);return tw({getSafeRouteKey:s,interceptionMarker:r,segment:i[1],routeKeys:n,keyPrefix:t?"nxtI":void 0})}return i?tw({getSafeRouteKey:s,segment:i[1],routeKeys:n,keyPrefix:t?"nxtP":void 0}):"/"+tv(e)}).join(""),routeKeys:n}}(e,t);return{...tx(e),namedRegex:"^"+r.namedParameterizedRoute+"(?:/)?$",routeKeys:r.routeKeys}}(e,!1)))(e)),{handleRewrites:function(o,h){let d={},u=h.pathname,c=i=>{let c=tf(i.source+(n?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!a})(h.pathname);if((i.has||i.missing)&&c){let e=tE(o,h.query,i.has,i.missing);e?Object.assign(c,e):c=!1}if(c){let{parsedDestination:n,destQuery:a}=function(e){let t;let r=Object.assign({},e.query);delete r.__nextLocale,delete r.__nextDefaultLocale,delete r.__nextDataReq,delete r.__nextInferredLocaleFromDefault,delete r[Y];let i=e.destination;for(let t of Object.keys({...e.params,...r}))i=i.replace(RegExp(":"+tv(t),"g"),"__ESC_COLON_"+t);let s=ee(i),n=s.query,a=tb(""+s.pathname+(s.hash||"")),o=tb(s.hostname||""),l=[],h=[];(0,tp.Bo)(a,l),(0,tp.Bo)(o,h);let d=[];l.forEach(e=>d.push(e.name)),h.forEach(e=>d.push(e.name));let u=(0,tp.MY)(a,{validate:!1}),c=(0,tp.MY)(o,{validate:!1});for(let[t,r]of Object.entries(n))Array.isArray(r)?n[t]=r.map(t=>t_(tb(t),e.params)):"string"==typeof r&&(n[t]=t_(tb(r),e.params));let p=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!p.some(e=>d.includes(e)))for(let t of p)t in n||(n[t]=e.params[t]);if(ek(a))for(let t of a.split("/")){let r=eM.find(e=>t.startsWith(e));if(r){e.params["0"]=r;break}}try{let[r,i]=(t=u(e.params)).split("#",2);s.hostname=c(e.params),s.pathname=r,s.hash=(i?"#":"")+(i||""),delete s.search}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw e}return s.query={...r,...s.query},{newUrl:t,destQuery:n,parsedDestination:s}}({appendParamsToQuery:!0,destination:i.destination,params:c,query:h.query});if(n.protocol)return!0;if(Object.assign(d,a,c),Object.assign(h.query,n.query),delete n.query,Object.assign(h,n),u=h.pathname,r&&(u=u.replace(RegExp(`^${r}`),"")||"/"),t){let e=eZ(u,t.locales);u=e.pathname,h.query.nextInternalLocale=e.detectedLocale||c.nextInternalLocale}if(u===e)return!0;if(s&&l){let e=l(u);if(e)return h.query={...h.query,...e},!0}}return!1};for(let e of i.beforeFiles||[])c(e);if(u!==e){let t=!1;for(let e of i.afterFiles||[])if(t=c(e))break;if(!t&&!(()=>{let t=eK(u||"");return t===eK(e)||(null==l?void 0:l(t))})()){for(let e of i.fallback||[])if(t=c(e))break}}return d},defaultRouteRegex:o,dynamicRouteMatcher:l,defaultRouteMatches:h,getParamsFromRouteMatches:function(e,r,i){return b(function(){let{groups:e,routeKeys:s}=o;return{re:{exec:n=>{let a=Object.fromEntries(new URLSearchParams(n)),o=t&&i&&a["1"]===i;for(let e of Object.keys(a)){let t=a[e];e!==W.dN&&e.startsWith(W.dN)&&(a[e.substring(W.dN.length)]=t,delete a[e])}let l=Object.keys(s||{}),h=e=>{if(t){let s=Array.isArray(e),n=s?e[0]:e;if("string"==typeof n&&t.locales.some(e=>e.toLowerCase()===n.toLowerCase()&&(i=e,r.locale=i,!0)))return s&&e.splice(0,1),!s||0===e.length}return!1};return l.every(e=>a[e])?l.reduce((t,r)=>{let i=null==s?void 0:s[r];return i&&!h(a[r])&&(t[e[i].pos]=a[r]),t},{}):Object.keys(a).reduce((e,t)=>{if(!h(a[t])){let r=t;return o&&(r=parseInt(t,10)-1+""),Object.assign(e,{[r]:a[t]})}return e},{})}},groups:e}}())(e.headers["x-now-route-matches"])},normalizeDynamicRouteParams:(e,t)=>{var r,i,s;let n;return r=e,i=o,s=h,n=!0,i?{params:r=Object.keys(i.groups).reduce((e,a)=>{let o=r[a];"string"==typeof o&&(o=eO(o)),Array.isArray(o)&&(o=o.map(e=>("string"==typeof e&&(e=eO(e)),e)));let l=s[a],h=i.groups[a].optional;return((Array.isArray(l)?l.some(e=>Array.isArray(o)?o.some(t=>t.includes(e)):null==o?void 0:o.includes(e)):null==o?void 0:o.includes(l))||void 0===o&&!(h&&t))&&(n=!1),h&&(!o||Array.isArray(o)&&1===o.length&&("index"===o[0]||o[0]===`[[...${a}]]`))&&(o=void 0,delete r[a]),o&&"string"==typeof o&&i.groups[a].repeat&&(o=o.split("/")),o&&(e[a]=o),e},{}),hasValidParams:n}:{params:r,hasValidParams:!1}},normalizeVercelUrl:(e,t,r)=>(function(e,t,r,i,s){if(i&&t&&s){let t=(0,eR.parse)(e.url,!0);for(let e of(delete t.search,Object.keys(t.query)))(e!==W.dN&&e.startsWith(W.dN)||(r||Object.keys(s.groups)).includes(e))&&delete t.query[e];e.url=(0,eR.format)(t)}})(e,t,r,s,o),interpolateDynamicPath:(e,t)=>(function(e,t,r){if(!r)return e;for(let i of Object.keys(r.groups)){let{optional:s,repeat:n}=r.groups[i],a=`[${n?"...":""}${i}]`;s&&(a=`[${a}]`);let o=e.indexOf(a);if(o>-1){let r;let s=t[i];r=Array.isArray(s)?s.map(e=>e&&encodeURIComponent(e)).join("/"):s?encodeURIComponent(s):"",e=e.slice(0,o)+r+e.slice(o+a.length)}}return e})(e,t,o)}}({pageIsDynamic:p,page:c,i18n:this.nextConfig.i18n,basePath:this.nextConfig.basePath,rewrites:(null==(d=this.getRoutesManifest())?void 0:d.rewrites)||{beforeFiles:[],afterFiles:[],fallback:[]},caseSensitive:!!this.nextConfig.experimental.caseSensitiveRoutes});E&&!P.locale&&(r.pathname=`/${E}${r.pathname}`);let m=r.pathname,g=f.handleRewrites(e,r),v=Object.keys(g),y=m!==r.pathname;y&&r.pathname&&C(e,"rewroteURL",r.pathname);let x=new Set;for(let e of Object.keys(r.query)){let t=r.query[e];if(e!==W.dN&&e.startsWith(W.dN)){let i=e.substring(W.dN.length);r.query[i]=t,x.add(i),delete r.query[e]}}if(p){let t={},s=f.normalizeDynamicRouteParams(r.query);if(!s.hasValidParams&&p&&!eL(n)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,n);e&&(f.normalizeDynamicRouteParams(e),Object.assign(s.params,e),s.hasValidParams=!0)}if(s.hasValidParams&&(t=s.params),e.headers["x-now-route-matches"]&&eL(i)&&!s.hasValidParams){let i={},n=f.getParamsFromRouteMatches(e,i,r.query.__nextLocale||"");i.locale&&(r.query.__nextLocale=i.locale,delete r.query.__nextInferredLocaleFromDefault),(s=f.normalizeDynamicRouteParams(n,!0)).hasValidParams&&(t=s.params)}p&&f.defaultRouteMatches&&n===c&&!s.hasValidParams&&!f.normalizeDynamicRouteParams({...t},!0).hasValidParams&&(t=f.defaultRouteMatches),t&&(i=f.interpolateDynamicPath(c,t),e.url=f.interpolateDynamicPath(e.url,t))}for(let t of((p||y)&&f.normalizeVercelUrl(e,!0,[...v,...Object.keys((null==(u=f.defaultRouteRegex)?void 0:u.groups)||{})]),x))delete r.query[t];if(r.pathname=i,R.pathname=r.pathname,await this.normalizeAndAttachMetadata(e,t,r))return}catch(r){if(r instanceof g._9||r instanceof g.KM)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(C(e,"isLocaleDomain",!!w),P.locale&&(e.url=(0,eR.format)(R),C(e,"didStripLocale",!0)),!r.query.__nextLocale&&(P.locale?r.query.__nextLocale=P.locale:E&&(r.query.__nextLocale=E,r.query.__nextInferredLocaleFromDefault="1")),!this.serverOptions.webServerConfig&&!_(e,"incrementalCache")){let t="https:";try{t=new URL(_(e,"initURL")||"/","http://n").protocol}catch{}let r=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers),requestProtocol:t.substring(0,t.length-1)});r.resetRequestCache(),C(e,"incrementalCache",r),globalThis.__incrementalCache=r}let T=_(e,"invokePath");if(!S&&T){let i=_(e,"invokeStatus");if(i){let s=_(e,"invokeQuery");s&&Object.assign(r.query,s),t.statusCode=i;let n=_(e,"invokeError")||null;return this.renderError(n,e,t,"/_error",r.query)}let s=new URL(T||"/","http://n"),n=e1(s.pathname,{nextConfig:this.nextConfig,parseData:!1});n.locale&&(r.query.__nextLocale=n.locale),r.pathname!==s.pathname&&(r.pathname=s.pathname,C(e,"rewroteURL",n.pathname));let a=eZ(e0(r.pathname,this.nextConfig.basePath||""),(null==(c=this.nextConfig.i18n)?void 0:c.locales)||[]);for(let e of(a.detectedLocale&&(r.query.__nextLocale=a.detectedLocale),r.pathname=a.pathname,Object.keys(r.query)))e.startsWith("__next")||e.startsWith("_next")||delete r.query[e];let o=_(e,"invokeQuery");if(o&&Object.assign(r.query,o),await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(_(e,"middlewareInvoke")){if(await this.normalizeAndAttachMetadata(e,t,r)||await this.handleCatchallMiddlewareRequest(e,t,r))return;let i=Error();throw i.result={response:new Response(null,{headers:{"x-middleware-next":"1"}})},i.bubble=!0,i}return!S&&P.basePath&&(r.pathname=e0(r.pathname,P.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof ro)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof g._9||r instanceof g.KM)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,i,s)=>(r[E]=e,t(r,i,s))}getRequestHandler(){return this.handleRequest.bind(this)}setAssetPrefix(e){this.renderOpts.assetPrefix=e?e.replace(/\/$/,""):""}async prepare(){if(!this.prepared)return null===this.preparedPromise&&(this.preparedPromise=this.prepareImpl().then(()=>{this.prepared=!0,this.preparedPromise=null})),this.preparedPromise}async prepareImpl(){}async close(){}getAppPathRoutes(){let e={};return Object.keys(this.appPathsManifest||{}).forEach(t=>{let r=eN(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,e$.getTracer)().trace(eH._J.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,e$.getTracer)().trace(eH._J.pipe,async()=>this.pipeImpl(e,t))}async pipeImpl(e,t){let r=eq(t.req.headers["user-agent"]||""),i={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!r,isBot:!!r}},s=await e(i);if(null===s)return;let{req:n,res:a}=i,o=a.statusCode,{body:l,type:h}=s,{revalidate:d}=s;if(!a.sent){let{generateEtags:e,poweredByHeader:t,dev:r}=this.renderOpts;r&&(a.setHeader("Cache-Control","no-store, must-revalidate"),d=void 0),await this.sendRenderResult(n,a,{result:l,type:h,generateEtags:e,poweredByHeader:t,revalidate:d,swrDelta:this.nextConfig.experimental.swrDelta}),a.statusCode=o}}async getStaticHTML(e,t){let r={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!1}},i=await e(r);return null===i?null:i.body.toUnchunkedString()}async render(e,t,r,i={},s,n=!1){return(0,e$.getTracer)().trace(eH._J.render,async()=>this.renderImpl(e,t,r,i,s,n))}async renderImpl(e,t,r,i={},s,n=!1){var a;return r.startsWith("/")||console.warn(`Cannot render page with path "${r}", did you mean "/${r}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`),this.renderOpts.customServer&&"/index"===r&&!await this.hasPage("/index")&&(r="/"),(a=r,N.includes(a))?this.render404(e,t,s):this.pipe(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:i})}async getStaticPaths({pathname:e}){var t;let r=null==(t=this.getPrerenderManifest().dynamicRoutes[e])?void 0:t.fallback;return{staticPaths:void 0,fallbackMode:"string"==typeof r?"static":null===r?"blocking":r}}async renderToResponseWithComponents(e,t){return(0,e$.getTracer)().trace(eH._J.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return ek(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,i){let s=`RSC, ${K}, ${V}`,n=rd(e),a=!1;r&&this.pathCouldBeIntercepted(i)?(t.setHeader("vary",`${s}, ${X}`),a=!0):(r||n)&&t.setHeader("vary",s),a||delete e.headers[X]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:i,renderOpts:s},{components:a,query:o}){var h,d,u,c,p,f,m;let v,y,x;i===P&&(i="/404");let w="/404"===i,b="/500"===i,E=!0===a.isAppPath,R=!!a.getServerSideProps,S=!!a.getStaticPaths,T=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(G.toLowerCase())??null,r=e.headers.get("content-type")):(t=e.headers[G.toLowerCase()]??null,r=e.headers["content-type"]??null);let i=!!("POST"===e.method&&"application/x-www-form-urlencoded"===r),s=!!("POST"===e.method&&(null==r?void 0:r.startsWith("multipart/form-data"))),n=!!(void 0!==t&&"string"==typeof t&&"POST"===e.method);return{actionId:t,isURLEncodedAction:i,isMultipartAction:s,isFetchAction:n,isServerAction:!!(n||i||s)}}(e).isServerAction,A=!!(null==(h=a.Component)?void 0:h.getInitialProps),D=!!a.getStaticProps,N=(0,eR.parse)(e.url||"").pathname||"/",M=_(e,"rewroteURL")||N;this.setVaryHeader(e,t,E,M);let j=!1,L=eL(a.page),I=this.getPrerenderManifest();if(E&&L){let t=await this.getStaticPaths({pathname:i,page:a.page,isAppPath:E,requestHeaders:e.headers});if(v=t.staticPaths,j=void 0!==(y=t.fallbackMode),"export"===this.nextConfig.output){let e=a.page;if("static"!==y)throw Error(`Page "${e}" is missing exported function "generateStaticParams()", which is required with "output: export" config.`);let t=eK(M);if(!(null==v?void 0:v.includes(t)))throw Error(`Page "${e}" is missing param "${t}" in "generateStaticParams()", which is required with "output: export" config.`)}j&&(S=!0)}j||(null==v?void 0:v.includes(M))||e.headers["x-now-route-matches"]?D=!0:D||=!!I.routes[ra(i)];let q=!!(o.__nextDataReq||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(D||R),$=("1"===e.headers[V.toLowerCase()]||_(e,"isPrefetchRSCRequest"))??!1;if(!D&&e.headers["x-middleware-prefetch"]&&!(w||"/_error"===i))return t.setHeader("x-matched-path",i),t.setHeader("x-middleware-skip","1"),t.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),t.body("{}").send(),null;delete o.__nextDataReq,D&&e.headers["x-matched-path"]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url)),e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${o.__nextLocale?`/${o.__nextLocale}`:""}${i}`);let H=rd(e),F=_(e,"postponed"),z=s.experimental.ppr&&H&&!$;if(!w||q||H||(t.statusCode=404),O.includes(i)&&(t.statusCode=parseInt(i.slice(1),10)),!T&&!F&&!w&&!b&&"/_error"!==i&&"HEAD"!==e.method&&"GET"!==e.method&&("string"==typeof a.Component||D))return t.statusCode=405,t.setHeader("Allow",["GET","HEAD"]),await this.renderError(null,e,t,i),null;if("string"==typeof a.Component)return{type:"html",body:tu.fromStatic(a.Component)};if(o.amp||delete o.amp,!0===s.supportsDynamicResponse){let t=eq(e.headers["user-agent"]||""),r="function"!=typeof(null==(p=a.Document)?void 0:p.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in a.Document;s.supportsDynamicResponse=!D&&!t&&!o.amp&&r,s.isBot=t}!q&&E&&s.dev&&(s.supportsDynamicResponse=!0);let U=D?null==(d=this.nextConfig.i18n)?void 0:d.defaultLocale:o.__nextDefaultLocale,K=o.__nextLocale,X=null==(u=this.nextConfig.i18n)?void 0:u.locales,J=!1;if(R||D||E){let{tryGetPreviewData:i}=r("./dist/esm/server/api-utils/node/try-get-preview-data.js");J=!1!==i(e,t,this.renderOpts.previewProps,!!this.nextConfig.experimental.multiZoneDraftMode)}E&&!s.dev&&!J&&D&&H&&!z&&(!((m=s.runtime)===W.Jp.experimentalEdge||m===W.Jp.edge)||this.serverOptions.webServerConfig)&&ri(e.headers);let Y=!1,Q=!1;D&&({isOnDemandRevalidate:Y,revalidateOnlyGenerated:Q}=(0,k.Iq)(e,this.renderOpts.previewProps)),D&&e.headers["x-matched-path"]&&(M=N),N=eK(N),M=eK(M),this.localeNormalizer&&(M=this.localeNormalizer.normalize(M)),q&&(M=this.stripNextDataPath(M),N=this.stripNextDataPath(N));let Z=null;J||!D||s.supportsDynamicResponse||T||F||z||(Z=`${K?`/${K}`:""}${("/"===i||"/"===M)&&K?"":M}${o.amp?".amp":""}`),(w||b)&&D&&(Z=`${K?`/${K}`:""}${i}${o.amp?".amp":""}`),Z&&(Z="/index"===(Z=Z.split("/").map(e=>{try{e=decodeURIComponent(e).replace(RegExp("([/#?]|%(2f|23|3f))","gi"),e=>encodeURIComponent(e))}catch(e){throw new g._9("failed to decode param")}return e}).join("/"))&&"/"===i?"/":Z);let ee="https:";try{ee=new URL(_(e,"initURL")||"/","http://n").protocol}catch{}let et=globalThis.__incrementalCache||await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers),requestProtocol:ee.substring(0,ee.length-1)});null==et||et.resetRequestCache();let{routeModule:er}=a,ei=!!(this.nextConfig.experimental.ppr&&this.experimentalTestProxy&&o.__nextppronly),es=async({postponed:r})=>{let n,h=!q&&!0===s.dev||!D&&!S||"string"==typeof r||z,d=(0,eR.parse)(e.url||"",!0).query;s.params&&Object.keys(s.params).forEach(e=>{delete d[e]});let u="/"!==N&&this.nextConfig.trailingSlash,c=(0,eR.format)({pathname:`${M}${u?"/":""}`,query:d}),p={...a,...s,...E?{incrementalCache:et,isRevalidate:D&&!r&&!z,originalPathname:a.ComponentMod.originalPathname,serverActions:this.nextConfig.experimental.serverActions}:{},isNextDataRequest:q,resolvedUrl:c,locale:K,locales:X,defaultLocale:U,multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode,resolvedAsPath:R||A?(0,eR.format)({pathname:`${N}${u?"/":""}`,query:d}):c,supportsDynamicResponse:h,isOnDemandRevalidate:Y,isDraftMode:J,isServerAction:T,postponed:r};if(ei&&(h=!1,p.nextExport=!0,p.supportsDynamicResponse=!1,p.isStaticGeneration=!0,p.isRevalidate=!0,p.isDebugPPRSkeleton=!0),er){if(er.definition.kind===l.APP_ROUTE){let r={params:s.params,prerenderManifest:I,renderOpts:{experimental:{ppr:!1},originalPathname:a.ComponentMod.originalPathname,supportsDynamicResponse:h,incrementalCache:et,isRevalidate:D}};try{let i=ts.fromBaseNextRequest(e,function(e){let{errored:t,destroyed:r}=e;if(t||r)return AbortSignal.abort(t??new tr);let{signal:i}=ti(e);return i}(t.originalResponse)),s=await er.handle(i,r);e.fetchMetrics=r.renderOpts.fetchMetrics;let n=r.renderOpts.fetchTags;if(D){var f;let e=await s.blob(),t=eG(s.headers);n&&(t[W.Et]=n),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let i=(null==(f=r.renderOpts.store)?void 0:f.revalidate)??!1;return{value:{kind:"ROUTE",status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},revalidate:i}}return await t6(e,t,s,r.renderOpts.waitUntil),null}catch(r){if(D)throw r;return ev(r),await t6(e,t,new Response(null,{status:500})),null}}else if(er.definition.kind===l.PAGES)p.nextFontManifest=this.nextFontManifest,p.clientReferenceManifest=a.clientReferenceManifest,n=await er.render(e.originalRequest??e,t.originalResponse??t,{page:i,params:s.params,query:o,renderOpts:p});else if(er.definition.kind===l.APP_PAGE){let r=a.routeModule;p.nextFontManifest=this.nextFontManifest,n=await r.render(e.originalRequest??e,t.originalResponse??t,{page:w?"/404":i,params:s.params,query:o,renderOpts:p})}else throw Error("Invariant: Unknown route module type")}else n=await this.renderHTML(e,t,i,o,p);let{metadata:m}=n,{headers:g={},fetchTags:v}=m;if(v&&(g[W.Et]=v),e.fetchMetrics=m.fetchMetrics,E&&D&&0===m.revalidate&&!p.experimental.ppr){let e=m.staticBailoutInfo,t=Error(`Page changed from static to dynamic at runtime ${N}${(null==e?void 0:e.description)?`, reason: ${e.description}`:""}
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`);if(null==e?void 0:e.stack){let r=e.stack;t.stack=t.message+r.substring(r.indexOf("\n"))}throw t}return"isNotFound"in m&&m.isNotFound?{value:null,revalidate:m.revalidate}:m.isRedirect?{value:{kind:"REDIRECT",props:m.pageData??m.flightData},revalidate:m.revalidate}:n.isNull?null:{value:{kind:"PAGE",html:n,pageData:m.pageData??m.flightData,postponed:m.postponed,headers:g,status:E?t.statusCode:void 0},revalidate:m.revalidate}},en=await this.responseCache.get(Z,async(r,n,l)=>{r||t.sent,v||({staticPaths:v,fallbackMode:y}=S?await this.getStaticPaths({pathname:i,requestHeaders:e.headers,isAppPath:E,page:a.page}):{staticPaths:void 0,fallbackMode:!1}),"static"===y&&eq(e.headers["user-agent"]||"")&&(y="blocking"),(null==n?void 0:n.isStale)===-1&&(Y=!0),Y&&(!1!==y||n)&&(y="blocking");let h=Z??(s.dev&&E?M:null);h&&o.amp&&(h=h.replace(/\.amp$/,"")),h&&(null==v||v.includes(h)),this.nextConfig.experimental.isExperimentalCompile&&(y="blocking");let d=await es({postponed:Y||l||!F?void 0:F});return d?{...d,revalidate:d.revalidate}:null},{routeKind:null==er?void 0:er.definition.kind,incrementalCache:et,isOnDemandRevalidate:Y,isPrefetch:"prefetch"===e.headers.purpose});if(J&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),!en){if(Z&&!(Y&&Q))throw Error("invariant: cache entry required but not generated");return null}(null==(c=en.value)?void 0:c.kind)==="PAGE"&&en.value.postponed;let{value:ea}=en;if((null==ea?void 0:ea.kind)==="IMAGE")throw Error("invariant SSG should not return an image cache value");if(F)x=0;else if(H&&!$&&s.experimental.ppr)x=0;else if(1){if(J||w&&!q)x=0;else if(D){if(w){let t=_(e,"notFoundRevalidate");x=void 0===t?0:t}else if("number"==typeof en.revalidate){if(en.revalidate<1)throw Error(`Invariant: invalid Cache-Control duration provided: ${en.revalidate} < 1`);x=en.revalidate}else!1===en.revalidate&&(x=W.BR)}else t.getHeader("Cache-Control")||(x=0)}en.revalidate=x;let eo=_(e,"onCacheEntry");if(eo&&await eo(en,{url:_(e,"initURL")}))return null;if(ea){if("REDIRECT"===ea.kind)return(en.revalidate&&!t.getHeader("Cache-Control")&&t.setHeader("Cache-Control",B({revalidate:en.revalidate,swrDelta:this.nextConfig.experimental.swrDelta})),q)?{type:"json",body:tu.fromStatic(JSON.stringify(ea.props)),revalidate:en.revalidate}:(await (e=>{let r={destination:e.pageProps.__N_REDIRECT,statusCode:e.pageProps.__N_REDIRECT_STATUS,basePath:e.pageProps.__N_REDIRECT_BASE_PATH},i=r.statusCode||(r.permanent?n.PermanentRedirect:n.TemporaryRedirect),{basePath:s}=this.nextConfig;s&&!1!==r.basePath&&r.destination.startsWith("/")&&(r.destination=`${s}${r.destination}`),r.destination.startsWith("/")&&(r.destination=(0,g.U3)(r.destination)),t.redirect(r.destination,i).body(r.destination).send()})(ea.props),null);if("ROUTE"===ea.kind){let r={...ea.headers};return D||delete r[W.Et],await t6(e,t,new Response(ea.body,{headers:eW(r),status:ea.status||200})),null}if(E){if(ea.postponed&&F)throw Error("Invariant: postponed state should not be present on a resume request");if(ea.headers){let e={...ea.headers};for(let[r,i]of(D||delete e[W.Et],Object.entries(e)))if(void 0!==i){if(Array.isArray(i))for(let e of i)t.appendHeader(r,e);else"number"==typeof i&&(i=i.toString()),t.appendHeader(r,i)}}if(D&&(null==(f=ea.headers)?void 0:f[W.Et])&&t.setHeader(W.Et,ea.headers[W.Et]),!ea.status||H&&s.experimental.ppr||(t.statusCode=ea.status),ea.postponed&&H&&t.setHeader("x-nextjs-postponed","1"),H&&!J){if("string"!=typeof ea.pageData){if(ea.postponed)throw Error("Invariant: Expected postponed to be undefined");return{type:"rsc",body:ea.html,revalidate:z?0:en.revalidate}}return{type:"rsc",body:tu.fromStatic(ea.pageData),revalidate:en.revalidate}}let e=ea.html;return ea.postponed,{type:"html",body:e,revalidate:en.revalidate}}return q?{type:"json",body:tu.fromStatic(JSON.stringify(ea.pageData)),revalidate:en.revalidate}:{type:"html",body:ea.html,revalidate:en.revalidate}}return(C(e,"notFoundRevalidate",en.revalidate),en.revalidate&&!t.getHeader("Cache-Control")&&t.setHeader("Cache-Control",B({revalidate:en.revalidate,swrDelta:this.nextConfig.experimental.swrDelta})),q)?(t.statusCode=404,t.body('{"notFound":true}').send()):await this.render404(e,t,{pathname:i,query:o},!1),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=tc(e.substring(e.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&t)?this.localeNormalizer.normalize(e):e}getOriginalAppPaths(e){if(this.enabledDirectories.app){var t;return(null==(t=this.appPathRoutes)?void 0:t[e])||null}return null}async renderPageComponent(e,t){var r,i;let{query:s,pathname:n}=e,a=this.getOriginalAppPaths(n),o=Array.isArray(a),l=n;o&&(l=a[a.length-1]);let h=await this.findPageComponents({page:l,query:s,params:e.renderOpts.params||{},isAppPath:o,sriEnabled:!!(null==(r=this.nextConfig.experimental.sri)?void 0:r.algorithm),appPaths:a,shouldEnsure:!1});if(h){null==(i=(0,e$.getTracer)().getRootSpanAttributes())||i.set("next.route",n);try{return await this.renderToResponseWithComponents(e,h)}catch(r){let e=r instanceof ro;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,e$.getTracer)().trace(eH._J.renderToResponse,{spanName:"rendering page",attributes:{"next.route":e.pathname}},async()=>this.renderToResponseImpl(e))}async renderToResponseImpl(e){var t;let{res:r,query:i,pathname:s}=e,n=!!i._nextBubbleNoFallback;delete i[Y],delete i._nextBubbleNoFallback;let a={i18n:null==(t=this.i18nProvider)?void 0:t.fromQuery(s,i)};try{for await(let t of this.matchers.matchAll(s,a)){_(e.req,"invokeOutput");let r=await this.renderPageComponent({...e,pathname:t.definition.pathname,renderOpts:{...e.renderOpts,params:t.params}},n);if(!1!==r)return r}if(this.serverOptions.webServerConfig){e.pathname=this.serverOptions.webServerConfig.page;let t=await this.renderPageComponent(e,n);if(!1!==t)return t}}catch(a){let t=tR(a);if(a instanceof g.At)throw console.error("Invariant: failed to load static page",JSON.stringify({page:s,url:e.req.url,matchedPath:e.req.headers["x-matched-path"],initUrl:_(e.req,"initURL"),didRewrite:!!_(e.req,"rewroteURL"),rewroteUrl:_(e.req,"rewroteURL")},null,2)),t;if(t instanceof ro&&n)throw t;if(t instanceof g._9||t instanceof g.KM)return r.statusCode=400,await this.renderErrorToResponse(e,t);r.statusCode=500,await this.hasPage("/500")&&(e.query.__nextCustomErrorRender="1",await this.renderErrorToResponse(e,t),delete e.query.__nextCustomErrorRender);let i=t instanceof rl;if(!i)throw tC(t)&&(t.page=s),t;return await this.renderErrorToResponse(e,i?t.innerError:t)}return this.getMiddleware()&&e.req.headers["x-nextjs-data"]&&(!r.statusCode||200===r.statusCode||404===r.statusCode)?(r.setHeader("x-nextjs-matched-path",`${i.__nextLocale?`/${i.__nextLocale}`:""}${s}`),r.statusCode=200,r.setHeader("content-type","application/json"),r.body("{}"),r.send(),null):(r.statusCode=404,this.renderErrorToResponse(e,null))}async renderToHTML(e,t,r,i={}){return(0,e$.getTracer)().trace(eH._J.renderToHTML,async()=>this.renderToHTMLImpl(e,t,r,i))}async renderToHTMLImpl(e,t,r,i={}){return this.getStaticHTML(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:i})}async renderError(e,t,r,i,s={},n=!0){return(0,e$.getTracer)().trace(eH._J.renderError,async()=>this.renderErrorImpl(e,t,r,i,s,n))}async renderErrorImpl(e,t,r,i,s={},n=!0){return n&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async t=>{let i=await this.renderErrorToResponse(t,e);if(500===r.statusCode)throw e;return i},{req:t,res:r,pathname:i,query:s})}async renderErrorToResponse(e,t){return(0,e$.getTracer)().trace(eH._J.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:i}=e;try{let s=null;404===r.statusCode&&(this.enabledDirectories.app&&(s=await this.findPageComponents({page:S,query:i,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!s&&await this.hasPage("/404")&&(s=await this.findPageComponents({page:"/404",query:i,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let n=`/${r.statusCode}`;if(!e.query.__nextCustomErrorRender&&!s&&O.includes(n)&&(s=await this.findPageComponents({page:n,query:i,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),s||(s=await this.findPageComponents({page:"/_error",query:i,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),n="/_error"),!s)throw new rl(Error("missing required error components"));s.components.routeModule?C(e.req,"match",{definition:s.components.routeModule.definition,params:void 0}):function(e,t){let r=_(e);return delete r[t],e[E]=r,r}(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:n,renderOpts:{...e.renderOpts,err:t}},s)}catch(e){if(e instanceof ro)throw Error("invariant: failed to render error page");throw e}}catch(a){let t=tR(a),s=t instanceof rl;s||this.logError(t),r.statusCode=500;let n=await this.getFallbackErrorComponents(e.req.url);if(n)return C(e.req,"match",{definition:n.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:s?t.innerError:t}},{query:i,components:n});return{type:"html",body:tu.fromStatic("Internal Server Error")}}}async renderErrorToHTML(e,t,r,i,s={}){return this.getStaticHTML(t=>this.renderErrorToResponse(t,e),{req:t,res:r,pathname:i,query:s})}async render404(e,t,r,i=!0){let{pathname:s,query:n}=r||(0,eR.parse)(e.url,!0);return this.nextConfig.i18n&&(n.__nextLocale||=this.nextConfig.i18n.defaultLocale,n.__nextDefaultLocale||=this.nextConfig.i18n.defaultLocale),t.statusCode=404,this.renderError(null,e,t,s,n,i)}}function rd(e){return"1"===e.headers.rsc||!!_(e,"isRSCRequest")}var ru=r("./dist/compiled/lru-cache/index.js"),rc=r.n(ru);let rp=require("vm");function rf(e){if(Object.isFrozen(e))return e;if(Array.isArray(e)){for(let t of e)t&&"object"==typeof t&&rf(t);return Object.freeze(e)}for(let t of Object.values(e))t&&"object"==typeof t&&rf(t);return Object.freeze(e)}let rm=new Map;function rg(e,t=!0,r=rm){let i=t&&r.get(e);if(i)return i;let s=JSON.parse((0,v.readFileSync)(e,"utf8"));return t&&(s=rf(s)),t&&r.set(e,s),s}let rv=new(rc())({max:1e3});function ry(e,t,r,i){let s;let n=`${e}:${t}:${r}:${i}`,a=null==rv?void 0:rv.get(n);if(a)return a;let o=w().join(t,D);i&&(s=rg(w().join(o,A),!0));let l=rg(w().join(o,T),!0);try{e=tc(tj(e))}catch(t){throw console.error(t),new g.GP(e)}let h=t=>{let i=t[e];if(!t[i]&&r){let s={};for(let e of Object.keys(t))s[eZ(e,r).pathname]=l[e];i=s[e]}return i};return(s&&(a=h(s)),a||(a=h(l)),a)?(a=w().join(o,a),null==rv||rv.set(n,a),a):(null==rv||rv.set(n,null),null)}function rx(e,t,r,i){let s=ry(e,t,r,i);if(!s)throw new g.GP(e);return s}function rw(e,t,r){let i=rx(e,t,void 0,r);if(i.endsWith(".html"))return v.promises.readFile(i,"utf8").catch(t=>{throw new g.At(e,t.message)});try{return process.env.__NEXT_PRIVATE_RUNTIME_TYPE=r?"app":"pages",require(i)}finally{process.env.__NEXT_PRIVATE_RUNTIME_TYPE=""}}function rb(e){return e.default||e}async function rE(e){return new Promise(t=>setTimeout(t,e))}let r_=Symbol.for("next.server.action-manifests");async function rC(e,t=3){for(;;)try{return rg(e)}catch(e){if(--t<=0)throw e;await rE(100)}}async function rR(e,t=3){for(;;)try{return function(e,t=!0,r=rm){let i=t&&r.get(e);if(i)return i;let s=(0,v.readFileSync)(e,"utf8");if(0===s.length)throw Error("Manifest file is empty");let n={};return(0,rp.runInNewContext)(s,n),t&&(n=rf(n)),t&&r.set(e,n),n}(e)}catch(e){if(--t<=0)throw e;await rE(100)}}async function rP(e,t){try{return(await rR(e)).__RSC_MANIFEST[t]}catch(e){return}}async function rS({distDir:e,page:t,isAppPath:r}){let i={},s={};r||([i,s]=await Promise.all([Promise.resolve().then(()=>rw("/_document",e,!1)),Promise.resolve().then(()=>rw("/_app",e,!1))]));let n=r&&(t.endsWith("/page")||t===P),[a,o,l,h]=await Promise.all([rC((0,x.join)(e,"build-manifest.json")),rC((0,x.join)(e,"react-loadable-manifest.json")),n?rP((0,x.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_")):void 0,r?rC((0,x.join)(e,"server","server-reference-manifest.json")).catch(()=>null):null]);h&&l&&function({clientReferenceManifest:e,serverActionsManifest:t,serverModuleMap:r}){globalThis[r_]={clientReferenceManifest:e,serverActionsManifest:t,serverModuleMap:r}}({clientReferenceManifest:l,serverActionsManifest:h,serverModuleMap:function({serverActionsManifest:e,pageName:t}){return new Proxy({},{get:(r,i)=>({id:e.node[i].workers[eY(t,"app")?t:"app"+t],name:i,chunks:[]})})}({serverActionsManifest:h,pageName:t})});let d=await Promise.resolve().then(()=>rw(t,e,r)),u=rb(d),c=rb(i),p=rb(s),{getServerSideProps:f,getStaticProps:m,getStaticPaths:g,routeModule:v}=d;return{App:p,Document:c,Component:u,buildManifest:a,reactLoadableManifest:o,pageConfig:d.config||{},ComponentMod:d,getServerSideProps:f,getStaticProps:m,getStaticPaths:g,clientReferenceManifest:l,serverActionsManifest:h,isAppPath:r,page:t,routeModule:v}}let rT=(0,e$.getTracer)().wrap(eH.qj.loadComponents,rS);var rA=r("../next-env/dist/index.js");let rD=require("stream");var rN=r.n(rD);class rO{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new rO(null==e?void 0:e.cacheKeyFn,null==e?void 0:e.schedulerFn)}async batch(e,t){let r=this.cacheKeyFn?await this.cacheKeyFn(e):e;if(null===r)return t(r,Promise.resolve);let i=this.pending.get(r);if(i)return i;let{promise:s,resolve:n,reject:a}=new tn;return this.pending.set(r,s),this.schedulerFn(async()=>{try{let e=await t(r,n);n(e)}catch(e){a(e)}finally{this.pending.delete(r)}}),s}}let rM=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};async function rk(e){var t;return{...e,value:(null==(t=e.value)?void 0:t.kind)==="PAGE"?{kind:"PAGE",html:await e.value.html.toUnchunkedString(!0),postponed:e.value.postponed,pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:e.value}}async function rj(e){var t,r;if(!e)return null;if((null==(t=e.value)?void 0:t.kind)==="FETCH")throw Error("Invariant: unexpected cachedResponse of kind fetch in response cache");return{isMiss:e.isMiss,isStale:e.isStale,revalidate:e.revalidate,value:(null==(r=e.value)?void 0:r.kind)==="PAGE"?{kind:"PAGE",html:tu.fromStatic(e.value.html),pageData:e.value.pageData,postponed:e.value.postponed,headers:e.value.headers,status:e.value.status}:e.value}}class rL{constructor(e){this.batcher=rO.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:rM}),this.minimalMode=e}async get(e,t,r){if(!e)return t(!1,null);let{incrementalCache:i,isOnDemandRevalidate:s=!1}=r;return rj(await this.batcher.batch({key:e,isOnDemandRevalidate:s},async(n,a)=>{var o;if((null==(o=this.previousCacheItem)?void 0:o.key)===n&&this.previousCacheItem.expiresAt>Date.now())return this.previousCacheItem.entry;r.routeKind===l.APP_PAGE||r.routeKind===l.APP_ROUTE||(r.routeKind,l.PAGES);let h=!1,d=null;try{d=null;let e=await t(h,d,!0);if(!e)return this.previousCacheItem=void 0,null;let r=await rk({...e,isMiss:!d});if(!r)return this.previousCacheItem=void 0,null;return s||h||(a(r),h=!0),void 0!==r.revalidate&&(this.previousCacheItem={key:n,entry:r,expiresAt:Date.now()+1e3}),r}catch(t){if(d&&await i.set(e,d.value,{revalidate:Math.min(Math.max(d.revalidate||3,3),30)}),h)return console.error(t),null;throw t}}))}}let rI=0,rq="x-vercel-cache-tags",r$="x-vercel-sc-headers",rH="x-vercel-revalidate",rF="x-vercel-cache-item-name",rz=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;async function rU(e,t,r=0){let i=new AbortController,s=setTimeout(()=>{i.abort()},500);return fetch(e,{...t||{},signal:i.signal}).catch(i=>{if(3!==r)return rz&&console.log(`Fetch failed for ${e} retry ${r}`),rU(e,t,r+1);throw i}).finally(()=>{clearTimeout(s)})}class rW{hasMatchingTags(e,t){if(e.length!==t.length)return!1;let r=new Set(e),i=new Set(t);if(r.size!==i.size)return!1;for(let e of r)if(!i.has(e))return!1;return!0}static isAvailable(e){return!!(e._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL)}constructor(t){if(this.headers={},this.headers["Content-Type"]="application/json",r$ in t._requestHeaders){let e=JSON.parse(t._requestHeaders[r$]);for(let t in e)this.headers[t]=e[t];delete t._requestHeaders[r$]}let r=t._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL,i=t._requestHeaders["x-vercel-sc-basepath"]||process.env.SUSPENSE_CACHE_BASEPATH;if(process.env.SUSPENSE_CACHE_AUTH_TOKEN&&(this.headers.Authorization=`Bearer ${process.env.SUSPENSE_CACHE_AUTH_TOKEN}`),r){let e=process.env.SUSPENSE_CACHE_PROTO||"https";this.cacheEndpoint=`${e}://${r}${i||""}`,rz&&console.log("using cache endpoint",this.cacheEndpoint)}else rz&&console.log("no cache endpoint available");t.maxMemoryCacheSize?e||(rz&&console.log("using memory store for fetch cache"),e=new(rc())({max:t.maxMemoryCacheSize,length({value:e}){var t;if(!e)return 25;if("REDIRECT"===e.kind)return JSON.stringify(e.props).length;if("IMAGE"===e.kind)throw Error("invariant image should not be incremental-cache");return"FETCH"===e.kind?JSON.stringify(e.data||"").length:"ROUTE"===e.kind?e.body.length:e.html.length+((null==(t=JSON.stringify("PAGE"===e.kind&&e.pageData))?void 0:t.length)||0)}})):rz&&console.log("not using memory store for fetch cache")}resetRequestCache(){null==e||e.reset()}async revalidateTag(...e){let[t]=e;if(t="string"==typeof t?[t]:t,rz&&console.log("revalidateTag",t),t.length){if(Date.now()<rI){rz&&console.log("rate limited ",rI);return}for(let e=0;e<Math.ceil(t.length/64);e++){let r=t.slice(64*e,64*e+64);try{let e=await rU(`${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${r.map(e=>encodeURIComponent(e)).join(",")}`,{method:"POST",headers:this.headers,next:{internal:!0}});if(429===e.status){let t=e.headers.get("retry-after")||"60000";rI=Date.now()+parseInt(t)}if(!e.ok)throw Error(`Request failed with status ${e.status}.`)}catch(e){console.warn("Failed to revalidate tag",r,e)}}}}async get(...t){var r;let[i,s={}]=t,{tags:n,softTags:a,kindHint:o,fetchIdx:l,fetchUrl:h}=s;if("fetch"!==o)return null;if(Date.now()<rI)return rz&&console.log("rate limited"),null;let d=null==e?void 0:e.get(i),u=(null==d?void 0:null==(r=d.value)?void 0:r.kind)==="FETCH"&&this.hasMatchingTags(n??[],d.value.tags??[]);if(this.cacheEndpoint&&(!d||!u))try{let t=Date.now(),r=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${i}`,{method:"GET",headers:{...this.headers,[rF]:h,[rq]:(null==n?void 0:n.join(","))||"",[W.Ar]:(null==a?void 0:a.join(","))||""},next:{internal:!0,fetchType:"cache-get",fetchUrl:h,fetchIdx:l}});if(429===r.status){let e=r.headers.get("retry-after")||"60000";rI=Date.now()+parseInt(e)}if(404===r.status)return rz&&console.log(`no fetch cache entry for ${i}, duration: ${Date.now()-t}ms`),null;if(!r.ok)throw console.error(await r.text()),Error(`invalid response from cache ${r.status}`);let s=await r.json();if(!s||"FETCH"!==s.kind)throw rz&&console.log({cached:s}),Error("invalid cache value");if("FETCH"===s.kind)for(let e of(s.tags??=[],n??[]))s.tags.includes(e)||s.tags.push(e);let o=r.headers.get("x-vercel-cache-state"),u=r.headers.get("age");d={value:s,lastModified:"fresh"!==o?Date.now()-W.BR:Date.now()-1e3*parseInt(u||"0",10)},rz&&console.log(`got fetch cache entry for ${i}, duration: ${Date.now()-t}ms, size: ${Object.keys(s).length}, cache-state: ${o} tags: ${null==n?void 0:n.join(",")} softTags: ${null==a?void 0:a.join(",")}`),d&&(null==e||e.set(i,d))}catch(e){rz&&console.error("Failed to get from fetch-cache",e)}return d||null}async set(...t){let[r,i,s]=t,{fetchCache:n,fetchIdx:a,fetchUrl:o,tags:l}=s;if(n){if(Date.now()<rI){rz&&console.log("rate limited");return}if(null==e||e.set(r,{value:i,lastModified:Date.now()}),this.cacheEndpoint)try{let e=Date.now();null!==i&&"revalidate"in i&&(this.headers[rH]=i.revalidate.toString()),!this.headers[rH]&&null!==i&&"data"in i&&(this.headers["x-vercel-cache-control"]=i.data.headers["cache-control"]);let t=JSON.stringify({...i,tags:void 0});rz&&console.log("set cache",r);let s=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${r}`,{method:"POST",headers:{...this.headers,[rF]:o||"",[rq]:(null==l?void 0:l.join(","))||""},body:t,next:{internal:!0,fetchType:"cache-set",fetchUrl:o,fetchIdx:a}});if(429===s.status){let e=s.headers.get("retry-after")||"60000";rI=Date.now()+parseInt(e)}if(!s.ok)throw rz&&console.log(await s.text()),Error(`invalid response ${s.status}`);rz&&console.log(`successfully set to fetch-cache for ${r}, duration: ${Date.now()-e}ms, size: ${t.length}`)}catch(e){rz&&console.error("Failed to update fetch cache",e)}}}}class rB{constructor(e){this.fs=e.fs,this.flushToDisk=e.flushToDisk,this.serverDistDir=e.serverDistDir,this.appDir=!!e._appDir,this.pagesDir=!!e._pagesDir,this.revalidatedTags=e.revalidatedTags,this.experimental=e.experimental,this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE,e.maxMemoryCacheSize&&!t?(this.debug&&console.log("using memory store for fetch cache"),t=new(rc())({max:e.maxMemoryCacheSize,length({value:e}){var t;if(!e)return 25;if("REDIRECT"===e.kind)return JSON.stringify(e.props).length;if("IMAGE"===e.kind)throw Error("invariant image should not be incremental-cache");return"FETCH"===e.kind?JSON.stringify(e.data||"").length:"ROUTE"===e.kind?e.body.length:e.html.length+((null==(t=JSON.stringify(e.pageData))?void 0:t.length)||0)}})):this.debug&&console.log("not using memory store for fetch cache"),this.serverDistDir&&this.fs&&(this.tagsManifestPath=tM().join(this.serverDistDir,"..","cache","fetch-cache","tags-manifest.json"),this.loadTagsManifest())}resetRequestCache(){}loadTagsManifest(){if(this.tagsManifestPath&&this.fs&&!s){try{s=JSON.parse(this.fs.readFileSync(this.tagsManifestPath,"utf8"))}catch(e){s={version:1,items:{}}}this.debug&&console.log("loadTagsManifest",s)}}async revalidateTag(...e){let[t]=e;if(t="string"==typeof t?[t]:t,this.debug&&console.log("revalidateTag",t),0!==t.length&&(await this.loadTagsManifest(),s&&this.tagsManifestPath)){for(let e of t){let t=s.items[e]||{};t.revalidatedAt=Date.now(),s.items[e]=t}try{await this.fs.mkdir(tM().dirname(this.tagsManifestPath)),await this.fs.writeFile(this.tagsManifestPath,JSON.stringify(s||{})),this.debug&&console.log("Updated tags manifest",s)}catch(e){console.warn("Failed to update tags manifest.",e)}}}async get(...e){var r,i,n,a,o;let[l,h={}]=e,{tags:d,softTags:u,kindHint:c}=h,p=null==t?void 0:t.get(l);if(this.debug&&console.log("get",l,d,c,!!p),!p){try{let e=this.getFilePath(`${l}.body`,"app"),t=await this.fs.readFile(e),{mtime:r}=await this.fs.stat(e),i=JSON.parse(await this.fs.readFile(e.replace(/\.body$/,W.EX),"utf8"));return{lastModified:r.getTime(),value:{kind:"ROUTE",body:t,headers:i.headers,status:i.status}}}catch(e){}try{let e=c;e||(e=this.detectFileKind(`${l}.html`));let r="app"===e,i=this.getFilePath("fetch"===e?l:`${l}.html`,e),s=await this.fs.readFile(i,"utf8"),{mtime:o}=await this.fs.stat(i);if("fetch"===e&&this.flushToDisk){let e=o.getTime(),t=JSON.parse(s);if(p={lastModified:e,value:t},(null==(n=p.value)?void 0:n.kind)==="FETCH"){let e=null==(a=p.value)?void 0:a.tags;(null==d?void 0:d.every(t=>null==e?void 0:e.includes(t)))||(this.debug&&console.log("tags vs storedTags mismatch",d,e),await this.set(l,p.value,{tags:d}))}}else{let e;let t=r?await this.fs.readFile(this.getFilePath(`${l}${this.experimental.ppr?W.Sx:W.hd}`,"app"),"utf8"):JSON.parse(await this.fs.readFile(this.getFilePath(`${l}${W.JT}`,"pages"),"utf8"));if(r)try{e=JSON.parse(await this.fs.readFile(i.replace(/\.html$/,W.EX),"utf8"))}catch{}p={lastModified:o.getTime(),value:{kind:"PAGE",html:s,pageData:t,postponed:null==e?void 0:e.postponed,headers:null==e?void 0:e.headers,status:null==e?void 0:e.status}}}p&&(null==t||t.set(l,p))}catch(e){}}if((null==p?void 0:null==(r=p.value)?void 0:r.kind)==="PAGE"){let e;let t=null==(o=p.value.headers)?void 0:o[W.Et];"string"==typeof t&&(e=t.split(",")),(null==e?void 0:e.length)&&(this.loadTagsManifest(),e.some(e=>{var t;return(null==s?void 0:null==(t=s.items[e])?void 0:t.revalidatedAt)&&(null==s?void 0:s.items[e].revalidatedAt)>=((null==p?void 0:p.lastModified)||Date.now())})&&(p=void 0))}return p&&(null==p?void 0:null==(i=p.value)?void 0:i.kind)==="FETCH"&&(this.loadTagsManifest(),[...d||[],...u||[]].some(e=>{var t;return!!this.revalidatedTags.includes(e)||(null==s?void 0:null==(t=s.items[e])?void 0:t.revalidatedAt)&&(null==s?void 0:s.items[e].revalidatedAt)>=((null==p?void 0:p.lastModified)||Date.now())})&&(p=void 0)),p??null}async set(...e){let[r,i,s]=e;if(null==t||t.set(r,{value:i,lastModified:Date.now()}),this.debug&&console.log("set",r),this.flushToDisk){if((null==i?void 0:i.kind)==="ROUTE"){let e=this.getFilePath(`${r}.body`,"app");await this.fs.mkdir(tM().dirname(e)),await this.fs.writeFile(e,i.body);let t={headers:i.headers,status:i.status,postponed:void 0};await this.fs.writeFile(e.replace(/\.body$/,W.EX),JSON.stringify(t,null,2));return}if((null==i?void 0:i.kind)==="PAGE"){let e="string"==typeof i.pageData,t=this.getFilePath(`${r}.html`,e?"app":"pages");if(await this.fs.mkdir(tM().dirname(t)),await this.fs.writeFile(t,i.html),await this.fs.writeFile(this.getFilePath(`${r}${e?this.experimental.ppr?W.Sx:W.hd:W.JT}`,e?"app":"pages"),e?i.pageData:JSON.stringify(i.pageData)),i.headers||i.status){let e={headers:i.headers,status:i.status,postponed:i.postponed};await this.fs.writeFile(t.replace(/\.html$/,W.EX),JSON.stringify(e))}}else if((null==i?void 0:i.kind)==="FETCH"){let e=this.getFilePath(r,"fetch");await this.fs.mkdir(tM().dirname(e)),await this.fs.writeFile(e,JSON.stringify({...i,tags:s.tags}))}}}detectFileKind(e){if(!this.appDir&&!this.pagesDir)throw Error("Invariant: Can't determine file path kind, no page directory enabled");if(!this.appDir&&this.pagesDir)return"pages";if(this.appDir&&!this.pagesDir)return"app";let t=this.getFilePath(e,"pages");if(this.fs.existsSync(t))return"pages";if(t=this.getFilePath(e,"app"),this.fs.existsSync(t))return"app";throw Error(`Invariant: Unable to determine file path kind for ${e}`)}getFilePath(e,t){switch(t){case"fetch":return tM().join(this.serverDistDir,"..","cache","fetch-cache",e);case"pages":return tM().join(this.serverDistDir,"pages",e);case"app":return tM().join(this.serverDistDir,"app",e);default:throw Error("Invariant: Can't determine file path kind")}}}class rG{static #e=this.timings=new Map;constructor(e){this.prerenderManifest=e}get(e){var t;let r=rG.timings.get(e);if(void 0!==r||void 0!==(r=null==(t=this.prerenderManifest.routes[e])?void 0:t.initialRevalidateSeconds))return r}set(e,t){rG.timings.set(e,t)}clear(){rG.timings.clear()}}class rK{constructor({fs:e,dev:t,appDir:r,pagesDir:i,flushToDisk:s,fetchCache:n,minimalMode:a,serverDistDir:o,requestHeaders:l,requestProtocol:h,maxMemoryCacheSize:d,getPrerenderManifest:u,fetchCacheKeyPrefix:c,CurCacheHandler:p,allowedRevalidateHeaderKeys:f,experimental:m}){var g,v,y,x;this.locks=new Map,this.unlocks=new Map;let w=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;this.hasCustomCacheHandler=!!p,p?w&&console.log("using custom cache handler",p.name):(e&&o&&(w&&console.log("using filesystem cache handler"),p=rB),rW.isAvailable({_requestHeaders:l})&&a&&n&&(w&&console.log("using fetch cache handler"),p=rW)),process.env.__NEXT_TEST_MAX_ISR_CACHE&&(d=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=t,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=a,this.requestHeaders=l,this.requestProtocol=h,this.allowedRevalidateHeaderKeys=f,this.prerenderManifest=u(),this.revalidateTimings=new rG(this.prerenderManifest),this.fetchCacheKeyPrefix=c;let b=[];l[W.y3]===(null==(v=this.prerenderManifest)?void 0:null==(g=v.preview)?void 0:g.previewModeId)&&(this.isOnDemandRevalidate=!0),a&&"string"==typeof l[W.of]&&l[W.X_]===(null==(x=this.prerenderManifest)?void 0:null==(y=x.preview)?void 0:y.previewModeId)&&(b=l[W.of].split(",")),p&&(this.cacheHandler=new p({dev:t,fs:e,flushToDisk:s,serverDistDir:o,revalidatedTags:b,maxMemoryCacheSize:d,_pagesDir:!!i,_appDir:!!r,_requestHeaders:l,fetchCacheKeyPrefix:c,experimental:m}))}calculateRevalidate(e,t,r){if(r)return new Date().getTime()-1e3;let i=this.revalidateTimings.get(ra(e))??1;return"number"==typeof i?1e3*i+t:i}_getPathname(e,t){return t?e:tj(e)}resetRequestCache(){var e,t;null==(t=this.cacheHandler)||null==(e=t.resetRequestCache)||e.call(t)}async unlock(e){let t=this.unlocks.get(e);t&&(t(),this.locks.delete(e),this.unlocks.delete(e))}async lock(e){if(process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT&&process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY){let t=r("./dist/esm/server/lib/server-ipc/request-utils.js").p;return await t({method:"lock",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[e]}),async()=>{await t({method:"unlock",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[e]})}}let t=()=>Promise.resolve(),i=this.locks.get(e);if(i)await i;else{let r=new Promise(e=>{t=async()=>{e()}});this.locks.set(e,r),this.unlocks.set(e,t)}return t}async revalidateTag(e){var t,i;return process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT&&process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY?(0,r("./dist/esm/server/lib/server-ipc/request-utils.js").p)({method:"revalidateTag",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[...arguments]}):null==(i=this.cacheHandler)?void 0:null==(t=i.revalidateTag)?void 0:t.call(i,e)}async fetchCacheKey(e,t={}){let i=[],s=new TextEncoder,n=new TextDecoder;if(t.body){if("function"==typeof t.body.getReader){let e=t.body,r=[];try{await e.pipeTo(new WritableStream({write(e){"string"==typeof e?(r.push(s.encode(e)),i.push(e)):(r.push(e),i.push(n.decode(e,{stream:!0})))}})),i.push(n.decode());let a=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),l=0;for(let e of r)o.set(e,l),l+=e.length;t._ogBody=o}catch(e){console.error("Problem reading body",e)}}else if("function"==typeof t.body.keys){let e=t.body;for(let r of(t._ogBody=t.body,new Set([...e.keys()]))){let t=e.getAll(r);i.push(`${r}=${(await Promise.all(t.map(async e=>"string"==typeof e?e:await e.text()))).join(",")}`)}}else if("function"==typeof t.body.arrayBuffer){let e=t.body,r=await e.arrayBuffer();i.push(await e.text()),t._ogBody=new Blob([r],{type:e.type})}else"string"==typeof t.body&&(i.push(t.body),t._ogBody=t.body)}let a="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in a&&delete a.traceparent;let o=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,a,t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity,t.cache,i]);return r("crypto").createHash("sha256").update(o).digest("hex")}async get(e,t={}){var i,s;let n,a;if(process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT&&process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY)return(0,r("./dist/esm/server/lib/server-ipc/request-utils.js").p)({method:"get",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[...arguments]});if(this.disableForTestmode||this.dev&&("fetch"!==t.kindHint||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,"fetch"===t.kindHint);let o=null,l=t.revalidate,h=await (null==(i=this.cacheHandler)?void 0:i.get(e,t));if((null==h?void 0:null==(s=h.value)?void 0:s.kind)==="FETCH")return[...t.tags||[],...t.softTags||[]].some(e=>{var t;return null==(t=this.revalidatedTags)?void 0:t.includes(e)})?null:(l=l||h.value.revalidate,{isStale:(Date.now()-(h.lastModified||0))/1e3>l,value:{kind:"FETCH",data:h.value.data,revalidate:l},revalidateAfter:Date.now()+1e3*l});let d=this.revalidateTimings.get(ra(e));return(null==h?void 0:h.lastModified)===-1?(n=-1,a=-1*W.BR):n=!!(!1!==(a=this.calculateRevalidate(e,(null==h?void 0:h.lastModified)||Date.now(),this.dev&&"fetch"!==t.kindHint))&&a<Date.now())||void 0,h&&(o={isStale:n,curRevalidate:d,revalidateAfter:a,value:h.value}),!h&&this.prerenderManifest.notFoundRoutes.includes(e)&&(o={isStale:n,value:null,curRevalidate:d,revalidateAfter:a},this.set(e,o.value,t)),o}async set(e,t,i){if(process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT&&process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY)return(0,r("./dist/esm/server/lib/server-ipc/request-utils.js").p)({method:"set",ipcPort:process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,ipcKey:process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,args:[...arguments]});if(this.disableForTestmode||this.dev&&!i.fetchCache)return;let s=JSON.stringify(t).length;if(i.fetchCache&&!this.hasCustomCacheHandler&&s>2097152){if(this.dev)throw Error(`Failed to set Next.js data cache, items over 2MB can not be cached (${s} bytes)`);return}e=this._getPathname(e,i.fetchCache);try{var n;void 0===i.revalidate||i.fetchCache||this.revalidateTimings.set(e,i.revalidate),await (null==(n=this.cacheHandler)?void 0:n.set(e,t,i))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}let rV=require("http"),rX=require("https"),rJ={existsSync:y().existsSync,readFile:y().promises.readFile,readFileSync:y().readFileSync,writeFile:(e,t)=>y().promises.writeFile(e,t),mkdir:e=>y().promises.mkdir(e,{recursive:!0}),stat:e=>y().promises.stat(e)};class rY extends rN().Readable{constructor({url:e,headers:t,method:r,socket:i=null,readable:s}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(e,t)=>{if("encrypted"!==t&&"remoteAddress"!==t)throw Error("Method not implemented");if("remoteAddress"!==t)return!1}}),this.url=e,this.headers=t,this.method=r,s&&(this.bodyReadable=s,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),i&&(this.socket=i)}get headersDistinct(){let e={};for(let[t,r]of Object.entries(this.headers))r&&(e[t]=Array.isArray(r)?r:[r]);return e}_read(e){if(this.bodyReadable)return this.bodyReadable._read(e);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Error("Method not implemented")}get complete(){throw Error("Method not implemented")}get trailers(){throw Error("Method not implemented")}get trailersDistinct(){throw Error("Method not implemented")}get rawTrailers(){throw Error("Method not implemented")}get rawHeaders(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}}class rQ extends rN().Writable{constructor(e={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=e.statusCode??200,this.socket=e.socket??null,this.headers=e.headers?eW(e.headers):new Headers,this.headPromise=new Promise(e=>{this.headPromiseResolve=e}),this.hasStreamed=new Promise((e,t)=>{this.on("finish",()=>e(!0)),this.on("end",()=>e(!0)),this.on("error",e=>t(e))}).then(e=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),e)),e.resWriter&&(this.resWriter=e.resWriter)}appendHeader(e,t){for(let r of Array.isArray(t)?t:[t])this.headers.append(e,r);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(e){return this.resWriter?this.resWriter(e):(this.buffers.push(Buffer.isBuffer(e)?e:Buffer.from(e)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(e,t,r){this.write(e),r()}writeHead(e,t,r){if(r||"string"==typeof t?"string"==typeof t&&t.length>0&&(this.statusMessage=t):r=t,r){if(Array.isArray(r))for(let e=0;e<r.length;e+=2)this.setHeader(r[e],r[e+1]);else for(let[e,t]of Object.entries(r))void 0!==t&&this.setHeader(e,t)}return this.statusCode=e,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(e){return this.headers.has(e)}getHeader(e){return this.headers.get(e)??void 0}getHeaders(){return eG(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(e,t){if(Array.isArray(t))for(let r of(this.headers.delete(e),t))this.headers.append(e,r);else"number"==typeof t?this.headers.set(e,t.toString()):this.headers.set(e,t);return this}removeHeader(e){this.headers.delete(e)}flushHeaders(){}get strictContentLength(){throw Error("Method not implemented.")}writeEarlyHints(){throw Error("Method not implemented.")}get req(){throw Error("Method not implemented.")}assignSocket(){throw Error("Method not implemented.")}detachSocket(){throw Error("Method not implemented.")}writeContinue(){throw Error("Method not implemented.")}writeProcessing(){throw Error("Method not implemented.")}get upgrading(){throw Error("Method not implemented.")}get chunkedEncoding(){throw Error("Method not implemented.")}get shouldKeepAlive(){throw Error("Method not implemented.")}get useChunkedEncodingByDefault(){throw Error("Method not implemented.")}get sendDate(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}addTrailers(){throw Error("Method not implemented.")}}class rZ{async load(e){return await require(e)}}class r0{static async load(e,t=new rZ){let r=await t.load(e);if("routeModule"in r)return r.routeModule;throw Error(`Module "${e}" does not export a routeModule.`)}}let r1=(e,t)=>{let r=w().isAbsolute(t)?t:w().join(e,t);return(0,eR.pathToFileURL)(r).toString()};function r4(e){var t,r;return(null==(r=e.has)?void 0:null==(t=r[0])?void 0:t.key)===X}let r8=e=>import(e).then(e=>e.default||e),r3=require,r2=new WeakMap;class r6 extends rh{constructor(e){super(e),this.handleNextImageRequest=async(e,t,r)=>!!(r.pathname&&r.pathname.startsWith("/_next/image"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:i,query:s}=r;if(!i)throw Error("Invariant: pathname is undefined");s._nextBubbleNoFallback="1";try{var n;i=eK(i);let a={i18n:null==(n=this.i18nProvider)?void 0:n.fromQuery(i,s)},o=await this.matchers.match(i,a);if(!o)return await this.render(e,t,i,s,r,!0),!0;for(let i of(C(e,"match",o),this.getEdgeFunctionsPages()))if(i===o.definition.page){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;if(delete s._nextBubbleNoFallback,delete s[Y],await this.runEdgeFunction({req:e,res:t,query:s,params:o.params,page:o.definition.page,match:o,appPaths:null}))return!0}if(o.definition.kind===l.PAGES_API){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;if(delete s._nextBubbleNoFallback,await this.handleApiRequest(e,t,s,o))return!0}return await this.render(e,t,i,s,r,!0),!0}catch(r){if(r instanceof ro)throw r;try{return this.logError(r),t.statusCode=500,await this.renderError(r,e,t,i,s),!0}catch{}throw r}},this.handleCatchallMiddlewareRequest=async(e,t,r)=>{let i;let s=_(e,"middlewareInvoke");if(!s)return!1;let n=()=>(C(e,"middlewareInvoke",!0),t.body("").send(),!0),a=this.getMiddleware();if(!a)return n();let o=ee(_(e,"initURL")),l=e1(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let h=eK(r.pathname||"");if(!a.match(h,e,o.query))return n();let d=!1;try{if(await this.ensureMiddleware(e.url),i=await this.runMiddleware({request:e,response:t,parsedUrl:o,parsed:r}),"response"in i){if(s){d=!0;let e=Error();throw e.result=i,e.bubble=!0,e}for(let[e,r]of Object.entries(eG(i.response.headers)))"content-encoding"!==e&&void 0!==r&&t.setHeader(e,r);t.statusCode=i.response.status;let{originalResponse:e}=t;return i.response.body?await td(i.response.body,e):e.end(),!0}}catch(s){if(d)throw s;if(tC(s)&&"ENOENT"===s.code)return await this.render404(e,t,r),!0;if(s instanceof g._9)return t.statusCode=400,await this.renderError(s,e,t,r.pathname||""),!0;let i=tR(s);return console.error(i),t.statusCode=500,await this.renderError(i,e,t,r.pathname||""),!0}return i.finished},this.renderOpts.optimizeFonts&&(process.env.__NEXT_OPTIMIZE_FONTS=JSON.stringify(this.renderOpts.optimizeFonts)),this.renderOpts.optimizeCss&&(process.env.__NEXT_OPTIMIZE_CSS=JSON.stringify(!0)),this.renderOpts.nextScriptWorkers&&(process.env.__NEXT_SCRIPT_WORKERS=JSON.stringify(!0)),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"";let{appDocumentPreloading:t}=this.nextConfig.experimental;if(e.dev||!0!==t&&void 0===t||(rT({distDir:this.distDir,page:"/_document",isAppPath:!1}).catch(()=>{}),rT({distDir:this.distDir,page:"/_app",isAppPath:!1}).catch(()=>{})),!e.dev&&this.nextConfig.experimental.preloadEntriesOnStart&&this.unstable_preloadEntries(),!e.dev){let{dynamicRoutes:e=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=e.map(e=>{let t=tx(e.page);return{match:b(t),page:e.page,re:t.re}})}(function(e){if(!globalThis.__NEXT_HTTP_AGENT){if(!e)throw Error("Expected config.httpAgentOptions to be an object");globalThis.__NEXT_HTTP_AGENT_OPTIONS=e.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new rV.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new rX.Agent(e.httpAgentOptions)}})(this.nextConfig),this.middlewareManifestPath=(0,x.join)(this.serverDistDir,"middleware-manifest.json"),e.dev||this.prepare().catch(e=>{console.error("Failed to prepare server",e)})}async unstable_preloadEntries(){let e=this.getAppPathsManifest();for(let e of Object.keys(this.getPagesManifest()||{}))await rT({distDir:this.distDir,page:e,isAppPath:!1}).catch(()=>{});for(let t of Object.keys(e||{}))await rT({distDir:this.distDir,page:t,isAppPath:!0}).then(async({ComponentMod:e})=>{let t=e.__next_app__.require;if(null==t?void 0:t.m)for(let e of Object.keys(t.m))await t(e)}).catch(()=>{})}async handleUpgrade(){}async prepareImpl(){if(await super.prepareImpl(),!this.serverOptions.dev&&this.nextConfig.experimental.instrumentationHook)try{let e=await r3((0,x.resolve)(this.serverOptions.dir||".",this.serverOptions.conf.distDir,"server",W.o$));await (null==e.register?void 0:e.register.call(e))}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw e.message=`An error occurred while loading instrumentation hook: ${e.message}`,e}}loadEnvConfig({dev:e,forceReload:t,silent:r}){(0,rA.loadEnvConfig)(this.dir,e,r?{info:()=>{},error:()=>{}}:h,t)}async getIncrementalCache({requestHeaders:e,requestProtocol:t}){let r;let{cacheHandler:i}=this.nextConfig;return i&&(r=rb(await r8(r1(this.distDir,i)))),new rK({fs:this.getCacheFilesystem(),dev:!1,requestHeaders:e,requestProtocol:t,pagesDir:this.enabledDirectories.pages,appDir:this.enabledDirectories.app,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCache:!0,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:r,experimental:this.renderOpts.experimental})}getResponseCache(){return new rL(!0)}getPublicDir(){return(0,x.join)(this.dir,"public")}getHasStaticDir(){return y().existsSync((0,x.join)(this.dir,"static"))}getPagesManifest(){return rg((0,x.join)(this.serverDistDir,T))}getAppPathsManifest(){if(this.enabledDirectories.app)return rg((0,x.join)(this.serverDistDir,A))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(r4).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!ry(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,x.join)(this.distDir,"BUILD_ID");try{return y().readFileSync(e,"utf8").trim()}catch(e){if("ENOENT"===e.code)throw Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`);throw e}}getEnabledDirectories(e){let t=e?this.dir:this.serverDistDir;return{app:!!M(t,"app"),pages:!!M(t,"pages")}}sendRenderResult(e,t,r){return Q({req:e.originalRequest,res:t.originalResponse,result:r.result,type:r.type,generateEtags:r.generateEtags,poweredByHeader:r.poweredByHeader,revalidate:r.revalidate,swrDelta:r.swrDelta})}async runApi(e,t,r,i){for(let s of this.getEdgeFunctionsPages())if(s===i.definition.pathname&&await this.runEdgeFunction({req:e,res:t,query:r,params:i.params,page:i.definition.pathname,appPaths:null}))return!0;let s=await r0.load(i.definition.filename);return r={...r,...i.params},delete r.__nextLocale,delete r.__nextDefaultLocale,delete r.__nextInferredLocaleFromDefault,await s.render(e.originalRequest,t.originalResponse,{previewProps:this.renderOpts.previewProps,revalidate:this.revalidate.bind(this),trustHostHeader:this.nextConfig.experimental.trustHostHeader,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,hostname:this.fetchHostname,minimalMode:!0,dev:!1,query:r,params:i.params,page:i.definition.pathname,multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode}),!0}async renderHTML(e,t,r,i,s){return(0,e$.getTracer)().trace(eH.Xy.renderHTML,async()=>this.renderHTMLImpl(e,t,r,i,s))}async renderHTMLImpl(e,t,r,i,s){throw Error("Invariant: renderHTML should not be called in minimal mode")}async imageOptimizer(e,t,r){throw Error("invariant: imageOptimizer should not be called in minimal mode")}getPagePath(e,t){return rx(e,this.distDir,t,this.enabledDirectories.app)}async renderPageComponent(e,t){let r=this.getEdgeFunctionsPages()||[];if(r.length){let t=this.getOriginalAppPaths(e.pathname),i=Array.isArray(t),s=e.pathname;for(let n of(i&&(s=t[0]),r))if(n===s)return await this.runEdgeFunction({req:e.req,res:e.res,query:e.query,params:e.renderOpts.params,page:s,appPaths:t}),null}return super.renderPageComponent(e,t)}async findPageComponents({page:e,query:t,params:r,isAppPath:i,url:s}){return(0,e$.getTracer)().trace(eH.Xy.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":i?eN(e):e}},()=>this.findPageComponentsImpl({page:e,query:t,params:r,isAppPath:i,url:s}))}async findPageComponentsImpl({page:e,query:t,params:r,isAppPath:i,url:s}){let n=[e];for(let s of(t.amp&&n.unshift((i?eN(e):tj(e))+".amp"),t.__nextLocale&&n.unshift(...n.map(e=>`/${t.__nextLocale}${"/"===e?"":e}`)),n))try{let e=await rT({distDir:this.distDir,page:s,isAppPath:i});if(t.__nextLocale&&"string"==typeof e.Component&&!s.startsWith(`/${t.__nextLocale}`))continue;return{components:e,query:{...!this.renderOpts.isExperimentalCompile&&e.getStaticProps?{amp:t.amp,__nextDataReq:t.__nextDataReq,__nextLocale:t.__nextLocale,__nextDefaultLocale:t.__nextDefaultLocale}:t,...(i?{}:r)||{}}}}catch(e){if(!(e instanceof g.GP))throw e}return null}getFontManifest(){return function(e){let t=w().join(e,D);return rg(w().join(t,"font-manifest.json"))}(this.distDir)}getNextFontManifest(){return rg((0,x.join)(this.distDir,"server","next-font-manifest.json"))}getFallback(e){return e=tj(e),this.getCacheFilesystem().readFile((0,x.join)(this.serverDistDir,"pages",`${e}.html`),"utf8")}async logErrorWithOriginalStack(e,t){throw Error("Invariant: logErrorWithOriginalStack can only be called on the development server")}async ensurePage(e){throw Error("Invariant: ensurePage can only be called on the development server")}async handleApiRequest(e,t,r,i){return this.runApi(e,t,r,i)}getPrefetchRsc(e){return this.getCacheFilesystem().readFile((0,x.join)(this.serverDistDir,"app",`${e}${W.Sx}`),"utf8")}getCacheFilesystem(){return rJ}normalizeReq(e){return e instanceof q?e:new q(e)}normalizeRes(e){return e instanceof $?e:new $(e)}getRequestHandler(){return this.makeRequestHandler()}makeRequestHandler(){this.prepare().catch(e=>{console.error("Failed to prepare server",e)});let e=super.getRequestHandler();return(t,r,i)=>{var s;let n=this.normalizeReq(t),a=this.normalizeRes(r),o=null==(s=this.nextConfig.logging)?void 0:s.fetches;return null==o||o.fullUrl,e(n,a,i)}}async revalidate({urlPath:e,revalidateHeaders:t,opts:r}){let i=function({url:e,headers:t={},method:r="GET",bodyReadable:i,resWriter:s,socket:n=null}){return{req:new rY({url:e,headers:t,method:r,socket:n,readable:i}),res:new rQ({socket:n,resWriter:s})}}({url:e,headers:t}),s=this.getRequestHandler();if(await s(new q(i.req),new $(i.res)),await i.res.hasStreamed,"REVALIDATED"!==i.res.getHeader("x-nextjs-cache")&&!(404===i.res.statusCode&&r.unstable_onlyGenerated))throw Error(`Invalid response ${i.res.statusCode}`)}async render(e,t,r,i,s,n=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,i,s,n)}async renderToHTML(e,t,r,i){return super.renderToHTML(this.normalizeReq(e),this.normalizeRes(t),r,i)}async renderErrorToResponseImpl(e,t){let{req:r,res:i,query:s}=e;return 404===i.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(S)?(await this.runEdgeFunction({req:r,res:i,query:s||{},params:{},page:S,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,i,s,n){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),i,s,n)}async renderErrorToHTML(e,t,r,i,s){return super.renderErrorToHTML(e,this.normalizeReq(t),this.normalizeRes(r),i,s)}async render404(e,t,r,i){return super.render404(this.normalizeReq(e),this.normalizeRes(t),r,i)}getMiddlewareManifest(){return null}getMiddleware(){var e;let t=this.getMiddlewareManifest(),r=null==t?void 0:null==(e=t.middleware)?void 0:e["/"];if(r)return{match:function(e){var t;let r=r2.get(e);if(r)return r;if(!Array.isArray(e.matchers))throw Error(`Invariant: invalid matchers for middleware ${JSON.stringify(e)}`);let i=(t=e.matchers,(e,r,i)=>{for(let s of t)if(new RegExp(s.regexp).exec(e)&&(!s.has&&!s.missing||tE(r,i,s.has,s.missing)))return!0;return!1});return r2.set(e,i),i}(r),page:"/"}}getEdgeFunctionsPages(){let e=this.getMiddlewareManifest();return e?Object.keys(e.functions):[]}getEdgeFunctionInfo(e){let t;let r=this.getMiddlewareManifest();if(!r)return null;try{t=tc(tj(e.page))}catch(e){return null}let i=e.middleware?r.middleware[t]:r.functions[t];if(!i){if(!e.middleware)throw new g.GP(t);return null}return{name:i.name,paths:i.files.map(e=>(0,x.join)(this.distDir,e)),wasm:(i.wasm??[]).map(e=>({...e,filePath:(0,x.join)(this.distDir,e.filePath)})),assets:i.assets&&i.assets.map(e=>({...e,filePath:(0,x.join)(this.distDir,e.filePath)})),env:i.env}}async hasMiddleware(e){let t=this.getEdgeFunctionInfo({page:e,middleware:!0});return!!(t&&t.paths.length>0)}async ensureMiddleware(e){}async ensureEdgeFunction(e){}async runMiddleware(e){throw Error("invariant: runMiddleware should not be called in minimal mode")}getPrerenderManifest(){var e;return this._cachedPreviewManifest||((this.renderOpts,(null==(e=this.serverOptions)?void 0:e.dev)||"phase-production-build"===process.env.NEXT_PHASE)?this._cachedPreviewManifest={version:4,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:{previewModeId:r("crypto").randomBytes(16).toString("hex"),previewModeSigningKey:r("crypto").randomBytes(32).toString("hex"),previewModeEncryptionKey:r("crypto").randomBytes(32).toString("hex")}}:this._cachedPreviewManifest=rg((0,x.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,e$.getTracer)().trace(eH.Xy.getRoutesManifest,()=>{let e=rg((0,x.join)(this.distDir,"routes-manifest.json")),t=e.rewrites??{beforeFiles:[],afterFiles:[],fallback:[]};return Array.isArray(t)&&(t={beforeFiles:[],afterFiles:t,fallback:[]}),{...e,rewrites:t}})}attachRequestMeta(e,t,r){var i;let s=(null==(i=e.headers["x-forwarded-proto"])?void 0:i.includes("https"))?"https":"http",n=this.fetchHostname&&this.port?`${s}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;C(e,"initURL",n),C(e,"initQuery",{...t.query}),C(e,"initProtocol",s),r||C(e,"clonableBody",function(e){let t=null,r=new Promise((t,r)=>{e.on("end",t),e.on("error",r)}).catch(e=>({error:e}));return{async finalize(){if(t){let i=await r;if(i&&"object"==typeof i&&i.error)throw i.error;(function(e,t){for(let r in t){let i=t[r];"function"==typeof i&&(i=i.bind(e)),e[r]=i}})(e,t),t=e}},cloneBodyStream(){let r=t??e,i=new rD.PassThrough,s=new rD.PassThrough;return r.on("data",e=>{i.push(e),s.push(e)}),r.on("end",()=>{i.push(null),s.push(null)}),t=s,i}}}(e.body))}async runEdgeFunction(e){throw Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.")}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let e=(0,x.join)(this.distDir,D);return this._serverDistDir=e,e}async getFallbackErrorComponents(e){return null}}})(),module.exports=i})();
//# sourceMappingURL=server.runtime.prod.js.map