{children}
+
+ );
+}
diff --git a/apps/anycontext-front/src/app/not-found.tsx b/apps/anycontext-front/src/app/not-found.tsx
new file mode 100644
index 00000000..3409889a
--- /dev/null
+++ b/apps/anycontext-front/src/app/not-found.tsx
@@ -0,0 +1,58 @@
+export const runtime = "edge";
+
+export default function NotFound() {
+ return (
+ <>
+ 404: This page could not be found.
+
+
+
+
+ 404
+
+
+
This page could not be found.
+
+
+
+ >
+ );
+}
+
+const styles = {
+ error: {
+ fontFamily:
+ 'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',
+ height: "100vh",
+ textAlign: "center",
+ display: "flex",
+ flexDirection: "column",
+ alignItems: "center",
+ justifyContent: "center",
+ },
+
+ desc: {
+ display: "inline-block",
+ },
+
+ h1: {
+ display: "inline-block",
+ margin: "0 20px 0 0",
+ padding: "0 23px 0 0",
+ fontSize: 24,
+ fontWeight: 500,
+ verticalAlign: "top",
+ lineHeight: "49px",
+ },
+
+ h2: {
+ fontSize: 14,
+ fontWeight: 400,
+ lineHeight: "49px",
+ margin: 0,
+ },
+} as const;
diff --git a/apps/anycontext-front/src/app/page.tsx b/apps/anycontext-front/src/app/page.tsx
new file mode 100644
index 00000000..11e75371
--- /dev/null
+++ b/apps/anycontext-front/src/app/page.tsx
@@ -0,0 +1,11 @@
+import Image from "next/image";
+import MessagePoster from "./MessagePoster";
+import { cookies } from "next/headers";
+
+export default function Home() {
+ return (
+
+
+
+ );
+}
diff --git a/apps/anycontext-front/src/env.js b/apps/anycontext-front/src/env.js
new file mode 100644
index 00000000..2ed9456a
--- /dev/null
+++ b/apps/anycontext-front/src/env.js
@@ -0,0 +1,67 @@
+import { createEnv } from "@t3-oss/env-nextjs";
+import { z } from "zod";
+
+export const env = process.env
+
+// export const env = createEnv({
+// /**
+// * Specify your server-side environment variables schema here. This way you can ensure the app
+// * isn't built with invalid env vars.
+// */
+// server: {
+// DATABASE_URL: z
+// .string()
+// .refine(
+// (str) => !str.includes("YOUR_MYSQL_URL_HERE"),
+// "You forgot to change the default URL"
+// ),
+// NODE_ENV: z
+// .enum(["development", "test", "production"])
+// .default("development"),
+// NEXTAUTH_SECRET:
+// process.env.NODE_ENV === "production"
+// ? z.string()
+// : z.string().optional(),
+// NEXTAUTH_URL: z.preprocess(
+// // This makes Vercel deployments not fail if you don't set NEXTAUTH_URL
+// // Since NextAuth.js automatically uses the VERCEL_URL if present.
+// (str) => process.env.VERCEL_URL ?? str,
+// // VERCEL_URL doesn't include `https` so it cant be validated as a URL
+// process.env.VERCEL ? z.string() : z.string().url()
+// ),
+// GOOGLE_CLIENT_ID: z.string(),
+// GOOGLE_CLIENT_SECRET: z.string()
+// },
+
+// /**
+// * Specify your client-side environment variables schema here. This way you can ensure the app
+// * isn't built with invalid env vars. To expose them to the client, prefix them with
+// * `NEXT_PUBLIC_`.
+// */
+// client: {
+// // NEXT_PUBLIC_CLIENTVAR: z.string(),
+// },
+
+// /**
+// * You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
+// * middlewares) or client-side so we need to destruct manually.
+// */
+// runtimeEnv: {
+// DATABASE_URL: process.env.DATABASE_URL,
+// NODE_ENV: process.env.NODE_ENV,
+// NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
+// NEXTAUTH_URL: process.env.NEXTAUTH_URL,
+// GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
+// GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET,
+// },
+// /**
+// * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
+// * useful for Docker builds.
+// */
+// skipValidation: !!process.env.SKIP_ENV_VALIDATION,
+// /**
+// * Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
+// * `SOME_VAR=''` will throw an error.
+// */
+// emptyStringAsUndefined: true,
+// });
diff --git a/apps/anycontext-front/src/server/auth.ts b/apps/anycontext-front/src/server/auth.ts
new file mode 100644
index 00000000..3b8d749e
--- /dev/null
+++ b/apps/anycontext-front/src/server/auth.ts
@@ -0,0 +1,37 @@
+import { env } from "@/env";
+import { DrizzleAdapter } from "@auth/drizzle-adapter";
+import NextAuth, { DefaultSession } from "next-auth";
+import { Adapter } from "next-auth/adapters";
+import Google from "next-auth/providers/google";
+import { db } from "./db";
+import { createTable } from "./db/schema";
+
+export const {
+ handlers: { GET, POST },
+ auth,
+} = NextAuth({
+ secret: env.NEXTAUTH_SECRET,
+ callbacks: {
+ session: ({session, token}) => ({
+ ...session,
+ user: {
+ ...session.user,
+ id: token.id as string,
+ token
+ },
+ })
+ },
+ adapter: DrizzleAdapter(db, createTable) as Adapter,
+ providers: [
+ Google({
+ clientId: env.GOOGLE_CLIENT_ID,
+ clientSecret: env.GOOGLE_CLIENT_SECRET,
+ authorization: {
+ params: {
+ prompt: "consent",
+ response_type: "code",
+ },
+ },
+ }),
+ ],
+});
diff --git a/apps/anycontext-front/src/server/db/index.ts b/apps/anycontext-front/src/server/db/index.ts
new file mode 100644
index 00000000..b4f4d4ce
--- /dev/null
+++ b/apps/anycontext-front/src/server/db/index.ts
@@ -0,0 +1,8 @@
+import { drizzle } from 'drizzle-orm/d1';
+
+import * as schema from "./schema";
+
+export const db = drizzle(
+ process.env.DATABASE as unknown as D1Database,
+ { schema }
+);
diff --git a/apps/anycontext-front/src/server/db/schema.ts b/apps/anycontext-front/src/server/db/schema.ts
new file mode 100644
index 00000000..7de02f15
--- /dev/null
+++ b/apps/anycontext-front/src/server/db/schema.ts
@@ -0,0 +1,111 @@
+import { relations, sql } from "drizzle-orm";
+import {
+ index,
+ int,
+ primaryKey,
+ sqliteTableCreator,
+ text,
+} from "drizzle-orm/sqlite-core";
+import { type AdapterAccount } from "next-auth/adapters";
+
+/**
+ * This is an example of how to use the multi-project schema feature of Drizzle ORM. Use the same
+ * database instance for multiple projects.
+ *
+ * @see https://orm.drizzle.team/docs/goodies#multi-project-schema
+ */
+export const createTable = sqliteTableCreator((name) => `anycontext_${name}`);
+
+export const posts = createTable(
+ "post",
+ {
+ id: int("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
+ name: text("name", { length: 256 }),
+ createdById: text("createdById", { length: 255 })
+ .notNull()
+ .references(() => users.id),
+ createdAt: int("created_at", { mode: "timestamp" })
+ .default(sql`CURRENT_TIMESTAMP`)
+ .notNull(),
+ updatedAt: int("updatedAt", { mode: "timestamp" }),
+ },
+ (example) => ({
+ createdByIdIdx: index("createdById_idx").on(example.createdById),
+ nameIndex: index("name_idx").on(example.name),
+ })
+);
+
+export const users = createTable("user", {
+ id: text("id", { length: 255 }).notNull().primaryKey(),
+ name: text("name", { length: 255 }),
+ email: text("email", { length: 255 }).notNull(),
+ emailVerified: int("emailVerified", {
+ mode: "timestamp",
+ }).default(sql`CURRENT_TIMESTAMP`),
+ image: text("image", { length: 255 }),
+});
+
+export const usersRelations = relations(users, ({ many }) => ({
+ accounts: many(accounts),
+}));
+
+export const accounts = createTable(
+ "account",
+ {
+ userId: text("userId", { length: 255 })
+ .notNull()
+ .references(() => users.id),
+ type: text("type", { length: 255 })
+ .$type()
+ .notNull(),
+ provider: text("provider", { length: 255 }).notNull(),
+ providerAccountId: text("providerAccountId", { length: 255 }).notNull(),
+ refresh_token: text("refresh_token"),
+ access_token: text("access_token"),
+ expires_at: int("expires_at"),
+ token_type: text("token_type", { length: 255 }),
+ scope: text("scope", { length: 255 }),
+ id_token: text("id_token"),
+ session_state: text("session_state", { length: 255 }),
+ },
+ (account) => ({
+ compoundKey: primaryKey({
+ columns: [account.provider, account.providerAccountId],
+ }),
+ userIdIdx: index("account_userId_idx").on(account.userId),
+ })
+);
+
+export const accountsRelations = relations(accounts, ({ one }) => ({
+ user: one(users, { fields: [accounts.userId], references: [users.id] }),
+}));
+
+export const sessions = createTable(
+ "session",
+ {
+ sessionToken: text("sessionToken", { length: 255 }).notNull().primaryKey(),
+ userId: text("userId", { length: 255 })
+ .notNull()
+ .references(() => users.id),
+ expires: int("expires", { mode: "timestamp" }).notNull(),
+ },
+ (session) => ({
+ userIdIdx: index("session_userId_idx").on(session.userId),
+ })
+);
+
+export const sessionsRelations = relations(sessions, ({ one }) => ({
+ user: one(users, { fields: [sessions.userId], references: [users.id] }),
+}));
+
+export const verificationTokens = createTable(
+ "verificationToken",
+ {
+ identifier: text("identifier", { length: 255 }).notNull(),
+ token: text("token", { length: 255 }).notNull(),
+ expires: int("expires", { mode: "timestamp" }).notNull(),
+ },
+ (vt) => ({
+ compoundKey: primaryKey({ columns: [vt.identifier, vt.token] }),
+ })
+);
diff --git a/apps/anycontext-front/tailwind.config.ts b/apps/anycontext-front/tailwind.config.ts
new file mode 100644
index 00000000..e9a0944e
--- /dev/null
+++ b/apps/anycontext-front/tailwind.config.ts
@@ -0,0 +1,20 @@
+import type { Config } from "tailwindcss";
+
+const config: Config = {
+ content: [
+ "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
+ "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
+ "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
+ ],
+ theme: {
+ extend: {
+ backgroundImage: {
+ "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
+ "gradient-conic":
+ "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
+ },
+ },
+ },
+ plugins: [],
+};
+export default config;
diff --git a/apps/anycontext-front/tsconfig.json b/apps/anycontext-front/tsconfig.json
new file mode 100644
index 00000000..6c14366f
--- /dev/null
+++ b/apps/anycontext-front/tsconfig.json
@@ -0,0 +1,29 @@
+{
+ "compilerOptions": {
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ],
+ "paths": {
+ "@/*": ["./src/*"]
+ },
+ "types": [
+ "@cloudflare/workers-types/2023-07-01"
+ ]
+ },
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
+ "exclude": ["node_modules"]
+}
diff --git a/apps/anycontext-front/wrangler.toml b/apps/anycontext-front/wrangler.toml
new file mode 100644
index 00000000..2d1a52ad
--- /dev/null
+++ b/apps/anycontext-front/wrangler.toml
@@ -0,0 +1,62 @@
+name = "anycontext-front"
+compatibility_date = "2024-02-23"
+
+compatibility_flags = ["nodejs_compat"]
+
+[[d1_databases]]
+binding = "DB" # i.e. available in your Worker on env.DB
+database_name = "dev-d1-anycontext"
+database_id = "fc562605-157a-4f60-b439-2a24ffed5b4c"
+
+# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
+# Note: Use secrets to store sensitive data.
+# Docs: https://developers.cloudflare.com/workers/platform/environment-variables
+# [vars]
+# MY_VARIABLE = "production_value"
+
+# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs.
+# Docs: https://developers.cloudflare.com/workers/runtime-apis/kv
+# [[kv_namespaces]]
+# binding = "MY_KV_NAMESPACE"
+# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+
+# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files.
+# Docs: https://developers.cloudflare.com/r2/api/workers/workers-api-usage/
+# [[r2_buckets]]
+# binding = "MY_BUCKET"
+# bucket_name = "my-bucket"
+
+# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer.
+# Docs: https://developers.cloudflare.com/queues/get-started
+# [[queues.producers]]
+# binding = "MY_QUEUE"
+# queue = "my-queue"
+
+# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them.
+# Docs: https://developers.cloudflare.com/queues/get-started
+# [[queues.consumers]]
+# queue = "my-queue"
+
+# Bind another Worker service. Use this binding to call another Worker without network overhead.
+# Docs: https://developers.cloudflare.com/workers/platform/services
+# [[services]]
+# binding = "MY_SERVICE"
+# service = "my-service"
+
+# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
+# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.
+# Docs: https://developers.cloudflare.com/workers/runtime-apis/durable-objects
+# [[durable_objects.bindings]]
+# name = "MY_DURABLE_OBJECT"
+# class_name = "MyDurableObject"
+
+# Durable Object migrations.
+# Docs: https://developers.cloudflare.com/workers/learning/using-durable-objects#configure-durable-object-classes-with-migrations
+# [[migrations]]
+# tag = "v1"
+# new_classes = ["MyDurableObject"]
+
+# KV Example:
+# [[kv_namespaces]]
+# binding = "MY_KV"
+# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
diff --git a/apps/extension/.eslintrc.cjs b/apps/extension/.eslintrc.cjs
new file mode 100644
index 00000000..d6c95379
--- /dev/null
+++ b/apps/extension/.eslintrc.cjs
@@ -0,0 +1,18 @@
+module.exports = {
+ root: true,
+ env: { browser: true, es2020: true },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:react-hooks/recommended',
+ ],
+ ignorePatterns: ['dist', '.eslintrc.cjs'],
+ parser: '@typescript-eslint/parser',
+ plugins: ['react-refresh'],
+ rules: {
+ 'react-refresh/only-export-components': [
+ 'warn',
+ { allowConstantExport: true },
+ ],
+ },
+}
diff --git a/apps/extension/.gitignore b/apps/extension/.gitignore
new file mode 100644
index 00000000..a547bf36
--- /dev/null
+++ b/apps/extension/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/apps/extension/README.md b/apps/extension/README.md
new file mode 100644
index 00000000..0d6babed
--- /dev/null
+++ b/apps/extension/README.md
@@ -0,0 +1,30 @@
+# React + TypeScript + Vite
+
+This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
+
+Currently, two official plugins are available:
+
+- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
+- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
+
+## Expanding the ESLint configuration
+
+If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
+
+- Configure the top-level `parserOptions` property like this:
+
+```js
+export default {
+ // other rules...
+ parserOptions: {
+ ecmaVersion: 'latest',
+ sourceType: 'module',
+ project: ['./tsconfig.json', './tsconfig.node.json'],
+ tsconfigRootDir: __dirname,
+ },
+}
+```
+
+- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
+- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
+- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
diff --git a/apps/extension/index.html b/apps/extension/index.html
new file mode 100644
index 00000000..e4b78eae
--- /dev/null
+++ b/apps/extension/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ Vite + React + TS
+
+
+
+
+
+
diff --git a/apps/extension/manifest.json b/apps/extension/manifest.json
new file mode 100644
index 00000000..ae7aab95
--- /dev/null
+++ b/apps/extension/manifest.json
@@ -0,0 +1,28 @@
+{
+ "manifest_version": 3,
+ "name": "Extension",
+ "version": "1.0.0",
+ "action": {
+ "default_popup": "index.html"
+ },
+ "content_scripts" : [
+ {
+ "js": [
+ "src/content.tsx"
+ ],
+ "matches": [
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ]
+ }
+ ],
+ "permissions": [
+ "activeTab",
+ "storage",
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ],
+ "background": {
+ "service_worker": "src/background.ts"
+ }
+}
\ No newline at end of file
diff --git a/apps/extension/package.json b/apps/extension/package.json
new file mode 100644
index 00000000..27fa4db0
--- /dev/null
+++ b/apps/extension/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "extension",
+ "private": true,
+ "version": "0.0.0",
+ "type": "module",
+ "scripts": {
+ "dev": "vite",
+ "build": "tsc && vite build",
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
+ "preview": "vite preview"
+ },
+ "dependencies": {
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0"
+ },
+ "devDependencies": {
+ "@types/react": "^18.2.56",
+ "@types/react-dom": "^18.2.19",
+ "@typescript-eslint/eslint-plugin": "^7.0.2",
+ "@typescript-eslint/parser": "^7.0.2",
+ "@vitejs/plugin-react": "^4.2.1",
+ "eslint": "^8.56.0",
+ "eslint-plugin-react-hooks": "^4.6.0",
+ "eslint-plugin-react-refresh": "^0.4.5",
+ "typescript": "^5.2.2",
+ "vite": "^5.1.4"
+ }
+}
diff --git a/apps/extension/postcss.config.js b/apps/extension/postcss.config.js
new file mode 100644
index 00000000..2e7af2b7
--- /dev/null
+++ b/apps/extension/postcss.config.js
@@ -0,0 +1,6 @@
+export default {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+}
diff --git a/apps/extension/public/vite.svg b/apps/extension/public/vite.svg
new file mode 100644
index 00000000..e7b8dfb1
--- /dev/null
+++ b/apps/extension/public/vite.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/apps/extension/src/App.tsx b/apps/extension/src/App.tsx
new file mode 100644
index 00000000..8824a7eb
--- /dev/null
+++ b/apps/extension/src/App.tsx
@@ -0,0 +1,75 @@
+import { useEffect, useState } from 'react';
+import { z } from 'zod';
+import { userObj } from './types/zods';
+
+function App() {
+ const [count] = useState(0);
+ const [userData, setUserData] = useState | null>(
+ null,
+ );
+
+ useEffect(() => {
+ const doStuff = () => {
+ chrome.runtime.sendMessage({ type: 'getJwt' }, (response) => {
+ const jwt = response.jwt;
+ const loginButton = document.getElementById('login');
+
+ if (loginButton)
+ if (jwt) {
+ fetch('http://localhost:3000/api/store', {
+ headers: {
+ Authorization: `Bearer ${jwt}`,
+ },
+ })
+ .then((res) => res.json())
+ .then((data) => {
+ const user = userObj.safeParse(data);
+ if (user.success) {
+ setUserData(user.data);
+ } else {
+ console.error(user.error);
+ }
+ });
+ loginButton.style.display = 'none';
+ } else {
+ loginButton.style.display = 'block';
+ loginButton.addEventListener('click', () => {
+ chrome.tabs.create({
+ url: 'http://localhost:3000/api/auth/signin',
+ });
+ });
+ }
+ });
+ };
+
+ doStuff();
+ // Set event listerner for storage change
+ chrome.storage.onChanged.addListener(() => {
+ doStuff();
+ });
+ }, [count]);
+
+ return (
+
+
+
+ {userData && (
+
+
+
+
{userData.data.user.name}
+
{userData.data.user.email}
+
+
+ )}
+
+
+ );
+}
+
+export default App;
diff --git a/apps/extension/src/assets/react.svg b/apps/extension/src/assets/react.svg
new file mode 100644
index 00000000..6c87de9b
--- /dev/null
+++ b/apps/extension/src/assets/react.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/apps/extension/src/background.ts b/apps/extension/src/background.ts
new file mode 100644
index 00000000..e4d39edd
--- /dev/null
+++ b/apps/extension/src/background.ts
@@ -0,0 +1,9 @@
+chrome.runtime.onMessage.addListener((request, _, sendResponse) => {
+ if (request.type === "getJwt") {
+ chrome.storage.local.get(["jwt"], ({ jwt }) => {
+ sendResponse({ jwt });
+ });
+
+ return true;
+ }
+ });
\ No newline at end of file
diff --git a/apps/extension/src/content.tsx b/apps/extension/src/content.tsx
new file mode 100644
index 00000000..a086c365
--- /dev/null
+++ b/apps/extension/src/content.tsx
@@ -0,0 +1,16 @@
+window.addEventListener("message", (event) => {
+ if (event.source !== window) {
+ return;
+ }
+ const { jwt } = event.data;
+ if (jwt) {
+ chrome.storage.local.set({ jwt }, () => {
+ console.log("JWT saved to local storage", jwt);
+ });
+ } else if (jwt === undefined) {
+ chrome.storage.local.remove("jwt", () => {
+ console.log("JWT removed from local storage");
+ }
+ )
+ }
+});
\ No newline at end of file
diff --git a/apps/extension/src/index.css b/apps/extension/src/index.css
new file mode 100644
index 00000000..b5c61c95
--- /dev/null
+++ b/apps/extension/src/index.css
@@ -0,0 +1,3 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
diff --git a/apps/extension/src/main.tsx b/apps/extension/src/main.tsx
new file mode 100644
index 00000000..3d7150da
--- /dev/null
+++ b/apps/extension/src/main.tsx
@@ -0,0 +1,10 @@
+import React from 'react'
+import ReactDOM from 'react-dom/client'
+import App from './App.tsx'
+import './index.css'
+
+ReactDOM.createRoot(document.getElementById('root')!).render(
+
+
+ ,
+)
diff --git a/apps/extension/src/types/zods.ts b/apps/extension/src/types/zods.ts
new file mode 100644
index 00000000..b85e2684
--- /dev/null
+++ b/apps/extension/src/types/zods.ts
@@ -0,0 +1,19 @@
+import { z } from "zod"
+
+export const userObj = z.object({
+ message: z.string(),
+ data: z.object({
+ session: z.object({
+ sessionToken: z.string(),
+ userId: z.string(),
+ expires: z.string()
+ }),
+ user: z.object({
+ id: z.string(),
+ name: z.string(),
+ email: z.string(),
+ emailVerified: z.string().nullable(),
+ image: z.string().nullable()
+ })
+ })
+})
\ No newline at end of file
diff --git a/apps/extension/src/vite-env.d.ts b/apps/extension/src/vite-env.d.ts
new file mode 100644
index 00000000..11f02fe2
--- /dev/null
+++ b/apps/extension/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/apps/extension/tailwind.config.js b/apps/extension/tailwind.config.js
new file mode 100644
index 00000000..d37737fc
--- /dev/null
+++ b/apps/extension/tailwind.config.js
@@ -0,0 +1,12 @@
+/** @type {import('tailwindcss').Config} */
+export default {
+ content: [
+ "./index.html",
+ "./src/**/*.{js,ts,jsx,tsx}",
+ ],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+}
+
diff --git a/apps/extension/tsconfig.json b/apps/extension/tsconfig.json
new file mode 100644
index 00000000..2fefaeb1
--- /dev/null
+++ b/apps/extension/tsconfig.json
@@ -0,0 +1,26 @@
+{
+ "compilerOptions": {
+ "target": "ES2020",
+ "useDefineForClassFields": true,
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "react-jsx",
+
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true
+ },
+ "include": ["src"],
+ "references": [{ "path": "./tsconfig.node.json" }],
+ "types": ["chrome"]
+}
diff --git a/apps/extension/tsconfig.node.json b/apps/extension/tsconfig.node.json
new file mode 100644
index 00000000..97ede7ee
--- /dev/null
+++ b/apps/extension/tsconfig.node.json
@@ -0,0 +1,11 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "skipLibCheck": true,
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "allowSyntheticDefaultImports": true,
+ "strict": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/apps/extension/vite.config.ts b/apps/extension/vite.config.ts
new file mode 100644
index 00000000..29edff3a
--- /dev/null
+++ b/apps/extension/vite.config.ts
@@ -0,0 +1,11 @@
+import { defineConfig } from 'vite'
+import react from '@vitejs/plugin-react'
+import { crx } from '@crxjs/vite-plugin'
+import manifest from './manifest.json'
+
+export default defineConfig({
+ plugins: [
+ react(),
+ crx({ manifest }),
+ ],
+})
\ No newline at end of file
diff --git a/apps/extension/vite.config.ts.timestamp-1708724797406-b8029634cc785.mjs b/apps/extension/vite.config.ts.timestamp-1708724797406-b8029634cc785.mjs
new file mode 100644
index 00000000..446579ae
--- /dev/null
+++ b/apps/extension/vite.config.ts.timestamp-1708724797406-b8029634cc785.mjs
@@ -0,0 +1,46 @@
+// vite.config.ts
+import { defineConfig } from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/vite/dist/node/index.js";
+import react from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/@vitejs/plugin-react/dist/index.mjs";
+import { crx } from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/@crxjs/vite-plugin/dist/index.mjs";
+
+// manifest.json
+var manifest_default = {
+ manifest_version: 3,
+ name: "Extension",
+ version: "1.0.0",
+ action: {
+ default_popup: "index.html"
+ },
+ content_scripts: [
+ {
+ js: [
+ "src/content.tsx"
+ ],
+ matches: [
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ]
+ }
+ ],
+ permissions: [
+ "activeTab",
+ "storage",
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ],
+ background: {
+ service_worker: "src/background.ts"
+ }
+};
+
+// vite.config.ts
+var vite_config_default = defineConfig({
+ plugins: [
+ react(),
+ crx({ manifest: manifest_default })
+ ]
+});
+export {
+ vite_config_default as default
+};
+//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAibWFuaWZlc3QuanNvbiJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIi9Vc2Vycy9kaHJhdnlhc2hhaC9Eb2N1bWVudHMvY29kZS9hbnljb250ZXh0L2FwcHMvZXh0ZW5zaW9uXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvVXNlcnMvZGhyYXZ5YXNoYWgvRG9jdW1lbnRzL2NvZGUvYW55Y29udGV4dC9hcHBzL2V4dGVuc2lvbi92aXRlLmNvbmZpZy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vVXNlcnMvZGhyYXZ5YXNoYWgvRG9jdW1lbnRzL2NvZGUvYW55Y29udGV4dC9hcHBzL2V4dGVuc2lvbi92aXRlLmNvbmZpZy50c1wiO2ltcG9ydCB7IGRlZmluZUNvbmZpZyB9IGZyb20gJ3ZpdGUnXG5pbXBvcnQgcmVhY3QgZnJvbSAnQHZpdGVqcy9wbHVnaW4tcmVhY3QnXG5pbXBvcnQgeyBjcnggfSBmcm9tICdAY3J4anMvdml0ZS1wbHVnaW4nXG5pbXBvcnQgbWFuaWZlc3QgZnJvbSAnLi9tYW5pZmVzdC5qc29uJ1xuXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICBwbHVnaW5zOiBbXG4gICAgcmVhY3QoKSxcbiAgICBjcngoeyBtYW5pZmVzdCB9KSxcbiAgXSxcbn0pIiwgIntcbiAgICBcIm1hbmlmZXN0X3ZlcnNpb25cIjogMyxcbiAgICBcIm5hbWVcIjogXCJFeHRlbnNpb25cIixcbiAgICBcInZlcnNpb25cIjogXCIxLjAuMFwiLFxuICAgIFwiYWN0aW9uXCI6IHtcbiAgICAgICAgXCJkZWZhdWx0X3BvcHVwXCI6IFwiaW5kZXguaHRtbFwiXG4gICAgfSxcbiAgICBcImNvbnRlbnRfc2NyaXB0c1wiICAgOiBbXG4gICAgICAgIHtcbiAgICAgICAgICAgIFwianNcIjogW1xuICAgICAgICAgICAgICAgIFwic3JjL2NvbnRlbnQudHN4XCJcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcIm1hdGNoZXNcIjogW1xuICAgICAgICAgICAgICAgIFwiaHR0cDovL2xvY2FsaG9zdDozMDAwLypcIixcbiAgICAgICAgICAgICAgICBcImh0dHBzOi8vYW55Y29udGV4dC5kaHIud3RmLypcIlxuICAgICAgICAgICAgXVxuICAgICAgICB9XG4gICAgXSxcbiAgICBcInBlcm1pc3Npb25zXCI6IFtcbiAgICAgICAgXCJhY3RpdmVUYWJcIixcbiAgICAgICAgXCJzdG9yYWdlXCIsXG4gICAgICAgIFwiaHR0cDovL2xvY2FsaG9zdDozMDAwLypcIixcbiAgICAgICAgXCJodHRwczovL2FueWNvbnRleHQuZGhyLnd0Zi8qXCJcbiAgICBdLFxuICAgIFwiYmFja2dyb3VuZFwiOiB7XG4gICAgICAgIFwic2VydmljZV93b3JrZXJcIjogXCJzcmMvYmFja2dyb3VuZC50c1wiXG4gICAgICB9XG59Il0sCiAgIm1hcHBpbmdzIjogIjtBQUFtVyxTQUFTLG9CQUFvQjtBQUNoWSxPQUFPLFdBQVc7QUFDbEIsU0FBUyxXQUFXOzs7QUNGcEI7QUFBQSxFQUNJLGtCQUFvQjtBQUFBLEVBQ3BCLE1BQVE7QUFBQSxFQUNSLFNBQVc7QUFBQSxFQUNYLFFBQVU7QUFBQSxJQUNOLGVBQWlCO0FBQUEsRUFDckI7QUFBQSxFQUNBLGlCQUFzQjtBQUFBLElBQ2xCO0FBQUEsTUFDSSxJQUFNO0FBQUEsUUFDRjtBQUFBLE1BQ0o7QUFBQSxNQUNBLFNBQVc7QUFBQSxRQUNQO0FBQUEsUUFDQTtBQUFBLE1BQ0o7QUFBQSxJQUNKO0FBQUEsRUFDSjtBQUFBLEVBQ0EsYUFBZTtBQUFBLElBQ1g7QUFBQSxJQUNBO0FBQUEsSUFDQTtBQUFBLElBQ0E7QUFBQSxFQUNKO0FBQUEsRUFDQSxZQUFjO0FBQUEsSUFDVixnQkFBa0I7QUFBQSxFQUNwQjtBQUNOOzs7QUR0QkEsSUFBTyxzQkFBUSxhQUFhO0FBQUEsRUFDMUIsU0FBUztBQUFBLElBQ1AsTUFBTTtBQUFBLElBQ04sSUFBSSxFQUFFLDJCQUFTLENBQUM7QUFBQSxFQUNsQjtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
diff --git a/apps/extension/vite.config.ts.timestamp-1708724837352-e87e647be4bdb.mjs b/apps/extension/vite.config.ts.timestamp-1708724837352-e87e647be4bdb.mjs
new file mode 100644
index 00000000..446579ae
--- /dev/null
+++ b/apps/extension/vite.config.ts.timestamp-1708724837352-e87e647be4bdb.mjs
@@ -0,0 +1,46 @@
+// vite.config.ts
+import { defineConfig } from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/vite/dist/node/index.js";
+import react from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/@vitejs/plugin-react/dist/index.mjs";
+import { crx } from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/@crxjs/vite-plugin/dist/index.mjs";
+
+// manifest.json
+var manifest_default = {
+ manifest_version: 3,
+ name: "Extension",
+ version: "1.0.0",
+ action: {
+ default_popup: "index.html"
+ },
+ content_scripts: [
+ {
+ js: [
+ "src/content.tsx"
+ ],
+ matches: [
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ]
+ }
+ ],
+ permissions: [
+ "activeTab",
+ "storage",
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ],
+ background: {
+ service_worker: "src/background.ts"
+ }
+};
+
+// vite.config.ts
+var vite_config_default = defineConfig({
+ plugins: [
+ react(),
+ crx({ manifest: manifest_default })
+ ]
+});
+export {
+ vite_config_default as default
+};
+//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAibWFuaWZlc3QuanNvbiJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIi9Vc2Vycy9kaHJhdnlhc2hhaC9Eb2N1bWVudHMvY29kZS9hbnljb250ZXh0L2FwcHMvZXh0ZW5zaW9uXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvVXNlcnMvZGhyYXZ5YXNoYWgvRG9jdW1lbnRzL2NvZGUvYW55Y29udGV4dC9hcHBzL2V4dGVuc2lvbi92aXRlLmNvbmZpZy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vVXNlcnMvZGhyYXZ5YXNoYWgvRG9jdW1lbnRzL2NvZGUvYW55Y29udGV4dC9hcHBzL2V4dGVuc2lvbi92aXRlLmNvbmZpZy50c1wiO2ltcG9ydCB7IGRlZmluZUNvbmZpZyB9IGZyb20gJ3ZpdGUnXG5pbXBvcnQgcmVhY3QgZnJvbSAnQHZpdGVqcy9wbHVnaW4tcmVhY3QnXG5pbXBvcnQgeyBjcnggfSBmcm9tICdAY3J4anMvdml0ZS1wbHVnaW4nXG5pbXBvcnQgbWFuaWZlc3QgZnJvbSAnLi9tYW5pZmVzdC5qc29uJ1xuXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICBwbHVnaW5zOiBbXG4gICAgcmVhY3QoKSxcbiAgICBjcngoeyBtYW5pZmVzdCB9KSxcbiAgXSxcbn0pIiwgIntcbiAgICBcIm1hbmlmZXN0X3ZlcnNpb25cIjogMyxcbiAgICBcIm5hbWVcIjogXCJFeHRlbnNpb25cIixcbiAgICBcInZlcnNpb25cIjogXCIxLjAuMFwiLFxuICAgIFwiYWN0aW9uXCI6IHtcbiAgICAgICAgXCJkZWZhdWx0X3BvcHVwXCI6IFwiaW5kZXguaHRtbFwiXG4gICAgfSxcbiAgICBcImNvbnRlbnRfc2NyaXB0c1wiICAgOiBbXG4gICAgICAgIHtcbiAgICAgICAgICAgIFwianNcIjogW1xuICAgICAgICAgICAgICAgIFwic3JjL2NvbnRlbnQudHN4XCJcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcIm1hdGNoZXNcIjogW1xuICAgICAgICAgICAgICAgIFwiaHR0cDovL2xvY2FsaG9zdDozMDAwLypcIixcbiAgICAgICAgICAgICAgICBcImh0dHBzOi8vYW55Y29udGV4dC5kaHIud3RmLypcIlxuICAgICAgICAgICAgXVxuICAgICAgICB9XG4gICAgXSxcbiAgICBcInBlcm1pc3Npb25zXCI6IFtcbiAgICAgICAgXCJhY3RpdmVUYWJcIixcbiAgICAgICAgXCJzdG9yYWdlXCIsXG4gICAgICAgIFwiaHR0cDovL2xvY2FsaG9zdDozMDAwLypcIixcbiAgICAgICAgXCJodHRwczovL2FueWNvbnRleHQuZGhyLnd0Zi8qXCJcbiAgICBdLFxuICAgIFwiYmFja2dyb3VuZFwiOiB7XG4gICAgICAgIFwic2VydmljZV93b3JrZXJcIjogXCJzcmMvYmFja2dyb3VuZC50c1wiXG4gICAgICB9XG59Il0sCiAgIm1hcHBpbmdzIjogIjtBQUFtVyxTQUFTLG9CQUFvQjtBQUNoWSxPQUFPLFdBQVc7QUFDbEIsU0FBUyxXQUFXOzs7QUNGcEI7QUFBQSxFQUNJLGtCQUFvQjtBQUFBLEVBQ3BCLE1BQVE7QUFBQSxFQUNSLFNBQVc7QUFBQSxFQUNYLFFBQVU7QUFBQSxJQUNOLGVBQWlCO0FBQUEsRUFDckI7QUFBQSxFQUNBLGlCQUFzQjtBQUFBLElBQ2xCO0FBQUEsTUFDSSxJQUFNO0FBQUEsUUFDRjtBQUFBLE1BQ0o7QUFBQSxNQUNBLFNBQVc7QUFBQSxRQUNQO0FBQUEsUUFDQTtBQUFBLE1BQ0o7QUFBQSxJQUNKO0FBQUEsRUFDSjtBQUFBLEVBQ0EsYUFBZTtBQUFBLElBQ1g7QUFBQSxJQUNBO0FBQUEsSUFDQTtBQUFBLElBQ0E7QUFBQSxFQUNKO0FBQUEsRUFDQSxZQUFjO0FBQUEsSUFDVixnQkFBa0I7QUFBQSxFQUNwQjtBQUNOOzs7QUR0QkEsSUFBTyxzQkFBUSxhQUFhO0FBQUEsRUFDMUIsU0FBUztBQUFBLElBQ1AsTUFBTTtBQUFBLElBQ04sSUFBSSxFQUFFLDJCQUFTLENBQUM7QUFBQSxFQUNsQjtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
diff --git a/apps/extension/vite.config.ts.timestamp-1708725079494-4cfac9d4a560f.mjs b/apps/extension/vite.config.ts.timestamp-1708725079494-4cfac9d4a560f.mjs
new file mode 100644
index 00000000..446579ae
--- /dev/null
+++ b/apps/extension/vite.config.ts.timestamp-1708725079494-4cfac9d4a560f.mjs
@@ -0,0 +1,46 @@
+// vite.config.ts
+import { defineConfig } from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/vite/dist/node/index.js";
+import react from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/@vitejs/plugin-react/dist/index.mjs";
+import { crx } from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/@crxjs/vite-plugin/dist/index.mjs";
+
+// manifest.json
+var manifest_default = {
+ manifest_version: 3,
+ name: "Extension",
+ version: "1.0.0",
+ action: {
+ default_popup: "index.html"
+ },
+ content_scripts: [
+ {
+ js: [
+ "src/content.tsx"
+ ],
+ matches: [
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ]
+ }
+ ],
+ permissions: [
+ "activeTab",
+ "storage",
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ],
+ background: {
+ service_worker: "src/background.ts"
+ }
+};
+
+// vite.config.ts
+var vite_config_default = defineConfig({
+ plugins: [
+ react(),
+ crx({ manifest: manifest_default })
+ ]
+});
+export {
+ vite_config_default as default
+};
+//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAibWFuaWZlc3QuanNvbiJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIi9Vc2Vycy9kaHJhdnlhc2hhaC9Eb2N1bWVudHMvY29kZS9hbnljb250ZXh0L2FwcHMvZXh0ZW5zaW9uXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvVXNlcnMvZGhyYXZ5YXNoYWgvRG9jdW1lbnRzL2NvZGUvYW55Y29udGV4dC9hcHBzL2V4dGVuc2lvbi92aXRlLmNvbmZpZy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vVXNlcnMvZGhyYXZ5YXNoYWgvRG9jdW1lbnRzL2NvZGUvYW55Y29udGV4dC9hcHBzL2V4dGVuc2lvbi92aXRlLmNvbmZpZy50c1wiO2ltcG9ydCB7IGRlZmluZUNvbmZpZyB9IGZyb20gJ3ZpdGUnXG5pbXBvcnQgcmVhY3QgZnJvbSAnQHZpdGVqcy9wbHVnaW4tcmVhY3QnXG5pbXBvcnQgeyBjcnggfSBmcm9tICdAY3J4anMvdml0ZS1wbHVnaW4nXG5pbXBvcnQgbWFuaWZlc3QgZnJvbSAnLi9tYW5pZmVzdC5qc29uJ1xuXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICBwbHVnaW5zOiBbXG4gICAgcmVhY3QoKSxcbiAgICBjcngoeyBtYW5pZmVzdCB9KSxcbiAgXSxcbn0pIiwgIntcbiAgICBcIm1hbmlmZXN0X3ZlcnNpb25cIjogMyxcbiAgICBcIm5hbWVcIjogXCJFeHRlbnNpb25cIixcbiAgICBcInZlcnNpb25cIjogXCIxLjAuMFwiLFxuICAgIFwiYWN0aW9uXCI6IHtcbiAgICAgICAgXCJkZWZhdWx0X3BvcHVwXCI6IFwiaW5kZXguaHRtbFwiXG4gICAgfSxcbiAgICBcImNvbnRlbnRfc2NyaXB0c1wiICAgOiBbXG4gICAgICAgIHtcbiAgICAgICAgICAgIFwianNcIjogW1xuICAgICAgICAgICAgICAgIFwic3JjL2NvbnRlbnQudHN4XCJcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcIm1hdGNoZXNcIjogW1xuICAgICAgICAgICAgICAgIFwiaHR0cDovL2xvY2FsaG9zdDozMDAwLypcIixcbiAgICAgICAgICAgICAgICBcImh0dHBzOi8vYW55Y29udGV4dC5kaHIud3RmLypcIlxuICAgICAgICAgICAgXVxuICAgICAgICB9XG4gICAgXSxcbiAgICBcInBlcm1pc3Npb25zXCI6IFtcbiAgICAgICAgXCJhY3RpdmVUYWJcIixcbiAgICAgICAgXCJzdG9yYWdlXCIsXG4gICAgICAgIFwiaHR0cDovL2xvY2FsaG9zdDozMDAwLypcIixcbiAgICAgICAgXCJodHRwczovL2FueWNvbnRleHQuZGhyLnd0Zi8qXCJcbiAgICBdLFxuICAgIFwiYmFja2dyb3VuZFwiOiB7XG4gICAgICAgIFwic2VydmljZV93b3JrZXJcIjogXCJzcmMvYmFja2dyb3VuZC50c1wiXG4gICAgICB9XG59Il0sCiAgIm1hcHBpbmdzIjogIjtBQUFtVyxTQUFTLG9CQUFvQjtBQUNoWSxPQUFPLFdBQVc7QUFDbEIsU0FBUyxXQUFXOzs7QUNGcEI7QUFBQSxFQUNJLGtCQUFvQjtBQUFBLEVBQ3BCLE1BQVE7QUFBQSxFQUNSLFNBQVc7QUFBQSxFQUNYLFFBQVU7QUFBQSxJQUNOLGVBQWlCO0FBQUEsRUFDckI7QUFBQSxFQUNBLGlCQUFzQjtBQUFBLElBQ2xCO0FBQUEsTUFDSSxJQUFNO0FBQUEsUUFDRjtBQUFBLE1BQ0o7QUFBQSxNQUNBLFNBQVc7QUFBQSxRQUNQO0FBQUEsUUFDQTtBQUFBLE1BQ0o7QUFBQSxJQUNKO0FBQUEsRUFDSjtBQUFBLEVBQ0EsYUFBZTtBQUFBLElBQ1g7QUFBQSxJQUNBO0FBQUEsSUFDQTtBQUFBLElBQ0E7QUFBQSxFQUNKO0FBQUEsRUFDQSxZQUFjO0FBQUEsSUFDVixnQkFBa0I7QUFBQSxFQUNwQjtBQUNOOzs7QUR0QkEsSUFBTyxzQkFBUSxhQUFhO0FBQUEsRUFDMUIsU0FBUztBQUFBLElBQ1AsTUFBTTtBQUFBLElBQ04sSUFBSSxFQUFFLDJCQUFTLENBQUM7QUFBQSxFQUNsQjtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
diff --git a/apps/extension/vite.config.ts.timestamp-1708725168622-ee30a92d0f2bc.mjs b/apps/extension/vite.config.ts.timestamp-1708725168622-ee30a92d0f2bc.mjs
new file mode 100644
index 00000000..446579ae
--- /dev/null
+++ b/apps/extension/vite.config.ts.timestamp-1708725168622-ee30a92d0f2bc.mjs
@@ -0,0 +1,46 @@
+// vite.config.ts
+import { defineConfig } from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/vite/dist/node/index.js";
+import react from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/@vitejs/plugin-react/dist/index.mjs";
+import { crx } from "file:///Users/dhravyashah/Documents/code/anycontext/node_modules/@crxjs/vite-plugin/dist/index.mjs";
+
+// manifest.json
+var manifest_default = {
+ manifest_version: 3,
+ name: "Extension",
+ version: "1.0.0",
+ action: {
+ default_popup: "index.html"
+ },
+ content_scripts: [
+ {
+ js: [
+ "src/content.tsx"
+ ],
+ matches: [
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ]
+ }
+ ],
+ permissions: [
+ "activeTab",
+ "storage",
+ "http://localhost:3000/*",
+ "https://anycontext.dhr.wtf/*"
+ ],
+ background: {
+ service_worker: "src/background.ts"
+ }
+};
+
+// vite.config.ts
+var vite_config_default = defineConfig({
+ plugins: [
+ react(),
+ crx({ manifest: manifest_default })
+ ]
+});
+export {
+ vite_config_default as default
+};
+//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAibWFuaWZlc3QuanNvbiJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIi9Vc2Vycy9kaHJhdnlhc2hhaC9Eb2N1bWVudHMvY29kZS9hbnljb250ZXh0L2FwcHMvZXh0ZW5zaW9uXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvVXNlcnMvZGhyYXZ5YXNoYWgvRG9jdW1lbnRzL2NvZGUvYW55Y29udGV4dC9hcHBzL2V4dGVuc2lvbi92aXRlLmNvbmZpZy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vVXNlcnMvZGhyYXZ5YXNoYWgvRG9jdW1lbnRzL2NvZGUvYW55Y29udGV4dC9hcHBzL2V4dGVuc2lvbi92aXRlLmNvbmZpZy50c1wiO2ltcG9ydCB7IGRlZmluZUNvbmZpZyB9IGZyb20gJ3ZpdGUnXG5pbXBvcnQgcmVhY3QgZnJvbSAnQHZpdGVqcy9wbHVnaW4tcmVhY3QnXG5pbXBvcnQgeyBjcnggfSBmcm9tICdAY3J4anMvdml0ZS1wbHVnaW4nXG5pbXBvcnQgbWFuaWZlc3QgZnJvbSAnLi9tYW5pZmVzdC5qc29uJ1xuXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICBwbHVnaW5zOiBbXG4gICAgcmVhY3QoKSxcbiAgICBjcngoeyBtYW5pZmVzdCB9KSxcbiAgXSxcbn0pIiwgIntcbiAgICBcIm1hbmlmZXN0X3ZlcnNpb25cIjogMyxcbiAgICBcIm5hbWVcIjogXCJFeHRlbnNpb25cIixcbiAgICBcInZlcnNpb25cIjogXCIxLjAuMFwiLFxuICAgIFwiYWN0aW9uXCI6IHtcbiAgICAgICAgXCJkZWZhdWx0X3BvcHVwXCI6IFwiaW5kZXguaHRtbFwiXG4gICAgfSxcbiAgICBcImNvbnRlbnRfc2NyaXB0c1wiICAgOiBbXG4gICAgICAgIHtcbiAgICAgICAgICAgIFwianNcIjogW1xuICAgICAgICAgICAgICAgIFwic3JjL2NvbnRlbnQudHN4XCJcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBcIm1hdGNoZXNcIjogW1xuICAgICAgICAgICAgICAgIFwiaHR0cDovL2xvY2FsaG9zdDozMDAwLypcIixcbiAgICAgICAgICAgICAgICBcImh0dHBzOi8vYW55Y29udGV4dC5kaHIud3RmLypcIlxuICAgICAgICAgICAgXVxuICAgICAgICB9XG4gICAgXSxcbiAgICBcInBlcm1pc3Npb25zXCI6IFtcbiAgICAgICAgXCJhY3RpdmVUYWJcIixcbiAgICAgICAgXCJzdG9yYWdlXCIsXG4gICAgICAgIFwiaHR0cDovL2xvY2FsaG9zdDozMDAwLypcIixcbiAgICAgICAgXCJodHRwczovL2FueWNvbnRleHQuZGhyLnd0Zi8qXCJcbiAgICBdLFxuICAgIFwiYmFja2dyb3VuZFwiOiB7XG4gICAgICAgIFwic2VydmljZV93b3JrZXJcIjogXCJzcmMvYmFja2dyb3VuZC50c1wiXG4gICAgICB9XG59Il0sCiAgIm1hcHBpbmdzIjogIjtBQUFtVyxTQUFTLG9CQUFvQjtBQUNoWSxPQUFPLFdBQVc7QUFDbEIsU0FBUyxXQUFXOzs7QUNGcEI7QUFBQSxFQUNJLGtCQUFvQjtBQUFBLEVBQ3BCLE1BQVE7QUFBQSxFQUNSLFNBQVc7QUFBQSxFQUNYLFFBQVU7QUFBQSxJQUNOLGVBQWlCO0FBQUEsRUFDckI7QUFBQSxFQUNBLGlCQUFzQjtBQUFBLElBQ2xCO0FBQUEsTUFDSSxJQUFNO0FBQUEsUUFDRjtBQUFBLE1BQ0o7QUFBQSxNQUNBLFNBQVc7QUFBQSxRQUNQO0FBQUEsUUFDQTtBQUFBLE1BQ0o7QUFBQSxJQUNKO0FBQUEsRUFDSjtBQUFBLEVBQ0EsYUFBZTtBQUFBLElBQ1g7QUFBQSxJQUNBO0FBQUEsSUFDQTtBQUFBLElBQ0E7QUFBQSxFQUNKO0FBQUEsRUFDQSxZQUFjO0FBQUEsSUFDVixnQkFBa0I7QUFBQSxFQUNwQjtBQUNOOzs7QUR0QkEsSUFBTyxzQkFBUSxhQUFhO0FBQUEsRUFDMUIsU0FBUztBQUFBLElBQ1AsTUFBTTtBQUFBLElBQ04sSUFBSSxFQUFFLDJCQUFTLENBQUM7QUFBQSxFQUNsQjtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
diff --git a/apps/web/.next/BUILD_ID b/apps/web/.next/BUILD_ID
index b5fa64e9..c3738e61 100644
--- a/apps/web/.next/BUILD_ID
+++ b/apps/web/.next/BUILD_ID
@@ -1 +1 @@
-NZ5J5THZSIm48Kb9Sw_O9
\ No newline at end of file
+yGeZZitS1W4Rar-yoH8R4
\ No newline at end of file
diff --git a/apps/web/.next/app-build-manifest.json b/apps/web/.next/app-build-manifest.json
index 1ab29687..1fe13f54 100644
--- a/apps/web/.next/app-build-manifest.json
+++ b/apps/web/.next/app-build-manifest.json
@@ -3,31 +3,24 @@
"/_not-found": [
"static/chunks/webpack-7c56eb6342069862.js",
"static/chunks/1dd3208c-2005e60b0a14e8cf.js",
- "static/chunks/997-22e52d7003e9633c.js",
- "static/chunks/main-app-6394067cfc5308ad.js",
- "static/chunks/app/_not-found-2c355b04f2805185.js"
+ "static/chunks/592-5c5d911cde380a88.js",
+ "static/chunks/main-app-d5cb99754851a14f.js",
+ "static/chunks/app/_not-found-9e9112d43c609e89.js"
],
"/layout": [
"static/chunks/webpack-7c56eb6342069862.js",
"static/chunks/1dd3208c-2005e60b0a14e8cf.js",
- "static/chunks/997-22e52d7003e9633c.js",
- "static/chunks/main-app-6394067cfc5308ad.js",
+ "static/chunks/592-5c5d911cde380a88.js",
+ "static/chunks/main-app-d5cb99754851a14f.js",
"static/css/6c15d7e3526590b3.css",
- "static/chunks/app/layout-d03d6a3648fc999a.js"
- ],
- "/account/page": [
- "static/chunks/webpack-7c56eb6342069862.js",
- "static/chunks/1dd3208c-2005e60b0a14e8cf.js",
- "static/chunks/997-22e52d7003e9633c.js",
- "static/chunks/main-app-6394067cfc5308ad.js",
- "static/chunks/app/account/page-0cdf2840d5548012.js"
+ "static/chunks/app/layout-dff3f08819de4584.js"
],
"/page": [
"static/chunks/webpack-7c56eb6342069862.js",
"static/chunks/1dd3208c-2005e60b0a14e8cf.js",
- "static/chunks/997-22e52d7003e9633c.js",
- "static/chunks/main-app-6394067cfc5308ad.js",
- "static/chunks/app/page-4446d9ce009d4a80.js"
+ "static/chunks/592-5c5d911cde380a88.js",
+ "static/chunks/main-app-d5cb99754851a14f.js",
+ "static/chunks/app/page-eb5778122b1e1134.js"
]
}
}
\ No newline at end of file
diff --git a/apps/web/.next/app-path-routes-manifest.json b/apps/web/.next/app-path-routes-manifest.json
index 8adfaa0f..cd7c89b9 100644
--- a/apps/web/.next/app-path-routes-manifest.json
+++ b/apps/web/.next/app-path-routes-manifest.json
@@ -1 +1 @@
-{"/_not-found":"/_not-found","/account/page":"/account","/api/auth/[...nextauth]/route":"/api/auth/[...nextauth]","/api/store/route":"/api/store","/page":"/"}
\ No newline at end of file
+{"/_not-found":"/_not-found","/api/auth/[...nextauth]/route":"/api/auth/[...nextauth]","/page":"/","/api/store/route":"/api/store"}
\ No newline at end of file
diff --git a/apps/web/.next/build-manifest.json b/apps/web/.next/build-manifest.json
index 6bb7d199..0c7d4420 100644
--- a/apps/web/.next/build-manifest.json
+++ b/apps/web/.next/build-manifest.json
@@ -5,26 +5,26 @@
"devFiles": [],
"ampDevFiles": [],
"lowPriorityFiles": [
- "static/NZ5J5THZSIm48Kb9Sw_O9/_buildManifest.js",
- "static/NZ5J5THZSIm48Kb9Sw_O9/_ssgManifest.js"
+ "static/yGeZZitS1W4Rar-yoH8R4/_buildManifest.js",
+ "static/yGeZZitS1W4Rar-yoH8R4/_ssgManifest.js"
],
"rootMainFiles": [
"static/chunks/webpack-7c56eb6342069862.js",
"static/chunks/1dd3208c-2005e60b0a14e8cf.js",
- "static/chunks/997-22e52d7003e9633c.js",
- "static/chunks/main-app-6394067cfc5308ad.js"
+ "static/chunks/592-5c5d911cde380a88.js",
+ "static/chunks/main-app-d5cb99754851a14f.js"
],
"pages": {
"/_app": [
"static/chunks/webpack-7c56eb6342069862.js",
"static/chunks/framework-9e68550641db712d.js",
- "static/chunks/main-2f8ae24bc202a544.js",
+ "static/chunks/main-c034f34a8f0f2967.js",
"static/chunks/pages/_app-22ef1381f3010e9c.js"
],
"/_error": [
"static/chunks/webpack-7c56eb6342069862.js",
"static/chunks/framework-9e68550641db712d.js",
- "static/chunks/main-2f8ae24bc202a544.js",
+ "static/chunks/main-c034f34a8f0f2967.js",
"static/chunks/pages/_error-2312f57de16788ac.js"
]
},
diff --git a/apps/web/.next/cache/webpack/client-development/0.pack.gz b/apps/web/.next/cache/webpack/client-development/0.pack.gz
deleted file mode 100644
index 1ba2a417..00000000
Binary files a/apps/web/.next/cache/webpack/client-development/0.pack.gz and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-development/1.pack.gz b/apps/web/.next/cache/webpack/client-development/1.pack.gz
deleted file mode 100644
index b1fb0765..00000000
Binary files a/apps/web/.next/cache/webpack/client-development/1.pack.gz and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-development/2.pack.gz b/apps/web/.next/cache/webpack/client-development/2.pack.gz
deleted file mode 100644
index fdd57045..00000000
Binary files a/apps/web/.next/cache/webpack/client-development/2.pack.gz and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-development/index.pack.gz b/apps/web/.next/cache/webpack/client-development/index.pack.gz
deleted file mode 100644
index 0809af9c..00000000
Binary files a/apps/web/.next/cache/webpack/client-development/index.pack.gz and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-development/index.pack.gz.old b/apps/web/.next/cache/webpack/client-development/index.pack.gz.old
deleted file mode 100644
index 7ccac761..00000000
Binary files a/apps/web/.next/cache/webpack/client-development/index.pack.gz.old and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-production/0.pack b/apps/web/.next/cache/webpack/client-production/0.pack
index e63c20c6..1f0fca5e 100644
Binary files a/apps/web/.next/cache/webpack/client-production/0.pack and b/apps/web/.next/cache/webpack/client-production/0.pack differ
diff --git a/apps/web/.next/cache/webpack/client-production/1.pack b/apps/web/.next/cache/webpack/client-production/1.pack
deleted file mode 100644
index f18980d3..00000000
Binary files a/apps/web/.next/cache/webpack/client-production/1.pack and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-production/2.pack b/apps/web/.next/cache/webpack/client-production/2.pack
deleted file mode 100644
index be4ad78c..00000000
Binary files a/apps/web/.next/cache/webpack/client-production/2.pack and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-production/3.pack b/apps/web/.next/cache/webpack/client-production/3.pack
deleted file mode 100644
index 6d940534..00000000
Binary files a/apps/web/.next/cache/webpack/client-production/3.pack and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-production/4.pack b/apps/web/.next/cache/webpack/client-production/4.pack
deleted file mode 100644
index 7aa904e5..00000000
Binary files a/apps/web/.next/cache/webpack/client-production/4.pack and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-production/5.pack b/apps/web/.next/cache/webpack/client-production/5.pack
deleted file mode 100644
index 6c7fea75..00000000
Binary files a/apps/web/.next/cache/webpack/client-production/5.pack and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/client-production/index.pack b/apps/web/.next/cache/webpack/client-production/index.pack
index b0cc06e0..4b0bcf70 100644
Binary files a/apps/web/.next/cache/webpack/client-production/index.pack and b/apps/web/.next/cache/webpack/client-production/index.pack differ
diff --git a/apps/web/.next/cache/webpack/client-production/index.pack.old b/apps/web/.next/cache/webpack/client-production/index.pack.old
deleted file mode 100644
index 30f5d1b0..00000000
Binary files a/apps/web/.next/cache/webpack/client-production/index.pack.old and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/server-development/0.pack.gz b/apps/web/.next/cache/webpack/server-development/0.pack.gz
deleted file mode 100644
index bce9403b..00000000
Binary files a/apps/web/.next/cache/webpack/server-development/0.pack.gz and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/server-development/1.pack.gz b/apps/web/.next/cache/webpack/server-development/1.pack.gz
deleted file mode 100644
index 763051cf..00000000
Binary files a/apps/web/.next/cache/webpack/server-development/1.pack.gz and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/server-development/2.pack.gz b/apps/web/.next/cache/webpack/server-development/2.pack.gz
deleted file mode 100644
index 5b411690..00000000
Binary files a/apps/web/.next/cache/webpack/server-development/2.pack.gz and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/server-development/index.pack.gz b/apps/web/.next/cache/webpack/server-development/index.pack.gz
deleted file mode 100644
index 5164671c..00000000
Binary files a/apps/web/.next/cache/webpack/server-development/index.pack.gz and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/server-development/index.pack.gz.old b/apps/web/.next/cache/webpack/server-development/index.pack.gz.old
deleted file mode 100644
index be8a6682..00000000
Binary files a/apps/web/.next/cache/webpack/server-development/index.pack.gz.old and /dev/null differ
diff --git a/apps/web/.next/cache/webpack/server-production/0.pack b/apps/web/.next/cache/webpack/server-production/0.pack
index 3550895d..b5853edb 100644
Binary files a/apps/web/.next/cache/webpack/server-production/0.pack and b/apps/web/.next/cache/webpack/server-production/0.pack differ
diff --git a/apps/web/.next/cache/webpack/server-production/index.pack b/apps/web/.next/cache/webpack/server-production/index.pack
index ebe8618f..92c505c7 100644
Binary files a/apps/web/.next/cache/webpack/server-production/index.pack and b/apps/web/.next/cache/webpack/server-production/index.pack differ
diff --git a/apps/web/.next/prerender-manifest.js b/apps/web/.next/prerender-manifest.js
index 7240d702..2cfcf2ae 100644
--- a/apps/web/.next/prerender-manifest.js
+++ b/apps/web/.next/prerender-manifest.js
@@ -1 +1 @@
-self.__PRERENDER_MANIFEST="{\"version\":4,\"routes\":{\"/\":{\"experimentalBypassFor\":[{\"type\":\"header\",\"key\":\"Next-Action\"},{\"type\":\"header\",\"key\":\"content-type\",\"value\":\"multipart/form-data\"}],\"initialRevalidateSeconds\":false,\"srcRoute\":\"/\",\"dataRoute\":\"/index.rsc\"}},\"dynamicRoutes\":{},\"notFoundRoutes\":[],\"preview\":{\"previewModeId\":\"601e555451af779f51bebe3d5192c4e1\",\"previewModeSigningKey\":\"02474f00ee5e962a2ec10afff2ab78eee83bf337b304eb667506d5d8e34e0b30\",\"previewModeEncryptionKey\":\"988d34a5620d5d97da6581f3ad688547ee9b9b20a92afdc7647b534d272550e1\"}}"
\ No newline at end of file
+self.__PRERENDER_MANIFEST="{\"version\":4,\"routes\":{},\"dynamicRoutes\":{},\"notFoundRoutes\":[],\"preview\":{\"previewModeId\":\"417742a5ccc596e5e0610b4af55422bc\",\"previewModeSigningKey\":\"e418f6fa63cd3d4396e138fdc0d94b9c40df8ae2a870b0bdd8b31cddbfcdff0f\",\"previewModeEncryptionKey\":\"0aa379bab80d288a5661685816c5bca7f5949e1b3f8f2e2f38b2b05f0a93eca9\"}}"
\ No newline at end of file
diff --git a/apps/web/.next/prerender-manifest.json b/apps/web/.next/prerender-manifest.json
index 104bf066..4022ccc0 100644
--- a/apps/web/.next/prerender-manifest.json
+++ b/apps/web/.next/prerender-manifest.json
@@ -1 +1 @@
-{"version":4,"routes":{"/":{"experimentalBypassFor":[{"type":"header","key":"Next-Action"},{"type":"header","key":"content-type","value":"multipart/form-data"}],"initialRevalidateSeconds":false,"srcRoute":"/","dataRoute":"/index.rsc"}},"dynamicRoutes":{},"notFoundRoutes":[],"preview":{"previewModeId":"601e555451af779f51bebe3d5192c4e1","previewModeSigningKey":"02474f00ee5e962a2ec10afff2ab78eee83bf337b304eb667506d5d8e34e0b30","previewModeEncryptionKey":"988d34a5620d5d97da6581f3ad688547ee9b9b20a92afdc7647b534d272550e1"}}
\ No newline at end of file
+{"version":4,"routes":{},"dynamicRoutes":{},"notFoundRoutes":[],"preview":{"previewModeId":"417742a5ccc596e5e0610b4af55422bc","previewModeSigningKey":"e418f6fa63cd3d4396e138fdc0d94b9c40df8ae2a870b0bdd8b31cddbfcdff0f","previewModeEncryptionKey":"0aa379bab80d288a5661685816c5bca7f5949e1b3f8f2e2f38b2b05f0a93eca9"}}
\ No newline at end of file
diff --git a/apps/web/.next/required-server-files.json b/apps/web/.next/required-server-files.json
index 8e10359b..4cb86219 100644
--- a/apps/web/.next/required-server-files.json
+++ b/apps/web/.next/required-server-files.json
@@ -1 +1 @@
-{"version":1,"config":{"env":{},"webpack":null,"eslint":{"ignoreDuringBuilds":false},"typescript":{"ignoreBuildErrors":false,"tsconfigPath":"tsconfig.json"},"distDir":".next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.js","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"analyticsId":"","images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":60,"formats":["image/webp"],"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"inline","remotePatterns":[],"unoptimized":false},"devIndicators":{"buildActivity":true,"buildActivityPosition":"bottom-right"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"amp":{"canonicalBase":""},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"optimizeFonts":true,"excludeDefaultMomentLocales":true,"serverRuntimeConfig":{},"publicRuntimeConfig":{},"reactProductionProfiling":false,"reactStrictMode":null,"httpAgentOptions":{"keepAlive":true},"outputFileTracing":true,"staticPageGenerationTimeout":60,"swcMinify":true,"modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"},"next/server":{"transform":"next/dist/server/web/exports/{{ kebabCase member }}"}},"experimental":{"serverMinification":true,"serverSourceMaps":false,"caseSensitiveRoutes":false,"useDeploymentId":false,"useDeploymentIdServerActions":false,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","middlewarePrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"outputFileTracingRoot":"","swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"adjustFontFallbacks":false,"adjustFontFallbacksWithSizeAdjust":false,"typedRoutes":false,"instrumentationHook":false,"bundlePagesExternals":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"missingSuspenseWithCSRBailout":true,"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"configFileName":"next.config.js"},"appDir":"/Users/dhravyashah/Documents/code/anycontext/apps/web","relativeAppDir":"","files":[".next/routes-manifest.json",".next/server/pages-manifest.json",".next/build-manifest.json",".next/prerender-manifest.json",".next/prerender-manifest.js",".next/server/middleware-manifest.json",".next/server/middleware-build-manifest.js",".next/server/middleware-react-loadable-manifest.js",".next/server/app-paths-manifest.json",".next/app-path-routes-manifest.json",".next/app-build-manifest.json",".next/server/server-reference-manifest.js",".next/server/server-reference-manifest.json",".next/react-loadable-manifest.json",".next/server/font-manifest.json",".next/BUILD_ID",".next/server/next-font-manifest.js",".next/server/next-font-manifest.json"],"ignore":["../../node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*"]}
\ No newline at end of file
+{"version":1,"config":{"env":{},"webpack":null,"eslint":{"ignoreDuringBuilds":false},"typescript":{"ignoreBuildErrors":false,"tsconfigPath":"tsconfig.json"},"distDir":".next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.js","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":false,"analyticsId":"","images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":60,"formats":["image/webp"],"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"inline","remotePatterns":[],"unoptimized":false},"devIndicators":{"buildActivity":true,"buildActivityPosition":"bottom-right"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"amp":{"canonicalBase":""},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"optimizeFonts":true,"excludeDefaultMomentLocales":true,"serverRuntimeConfig":{},"publicRuntimeConfig":{},"reactProductionProfiling":false,"reactStrictMode":null,"httpAgentOptions":{"keepAlive":true},"outputFileTracing":true,"staticPageGenerationTimeout":60,"swcMinify":true,"modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"},"next/server":{"transform":"next/dist/server/web/exports/{{ kebabCase member }}"}},"experimental":{"serverMinification":true,"serverSourceMaps":false,"caseSensitiveRoutes":false,"useDeploymentId":false,"useDeploymentIdServerActions":false,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","middlewarePrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"outputFileTracingRoot":"/Users/dhravyashah/Documents/code/anycontext/apps/web","swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"adjustFontFallbacks":false,"adjustFontFallbacksWithSizeAdjust":false,"typedRoutes":false,"instrumentationHook":false,"bundlePagesExternals":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"missingSuspenseWithCSRBailout":true,"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":true,"isExperimentalCompile":false},"configFileName":"next.config.js"},"appDir":"/Users/dhravyashah/Documents/code/anycontext/apps/web","relativeAppDir":"","files":[".next/routes-manifest.json",".next/server/pages-manifest.json",".next/build-manifest.json",".next/prerender-manifest.json",".next/prerender-manifest.js",".next/server/middleware-manifest.json",".next/server/middleware-build-manifest.js",".next/server/middleware-react-loadable-manifest.js",".next/server/app-paths-manifest.json",".next/app-path-routes-manifest.json",".next/app-build-manifest.json",".next/server/server-reference-manifest.js",".next/server/server-reference-manifest.json",".next/react-loadable-manifest.json",".next/server/font-manifest.json",".next/BUILD_ID",".next/server/next-font-manifest.js",".next/server/next-font-manifest.json"],"ignore":["../../node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*"]}
\ No newline at end of file
diff --git a/apps/web/.next/routes-manifest.json b/apps/web/.next/routes-manifest.json
index eb5b1287..c2b8ae4b 100644
--- a/apps/web/.next/routes-manifest.json
+++ b/apps/web/.next/routes-manifest.json
@@ -1 +1 @@
-{"version":3,"pages404":true,"caseSensitive":false,"basePath":"","redirects":[{"source":"/:path+/","destination":"/:path+","internal":true,"statusCode":308,"regex":"^(?:/((?:[^/]+?)(?:/(?:[^/]+?))*))/$"}],"headers":[],"dynamicRoutes":[{"page":"/api/auth/[...nextauth]","regex":"^/api/auth/(.+?)(?:/)?$","routeKeys":{"nxtPnextauth":"nxtPnextauth"},"namedRegex":"^/api/auth/(?.+?)(?:/)?$"}],"staticRoutes":[{"page":"/","regex":"^/(?:/)?$","routeKeys":{},"namedRegex":"^/(?:/)?$"},{"page":"/_not-found","regex":"^/_not\\-found(?:/)?$","routeKeys":{},"namedRegex":"^/_not\\-found(?:/)?$"},{"page":"/account","regex":"^/account(?:/)?$","routeKeys":{},"namedRegex":"^/account(?:/)?$"}],"dataRoutes":[],"rsc":{"header":"RSC","varyHeader":"RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url","prefetchHeader":"Next-Router-Prefetch","didPostponeHeader":"x-nextjs-postponed","contentTypeHeader":"text/x-component","suffix":".rsc","prefetchSuffix":".prefetch.rsc"},"rewrites":[]}
\ No newline at end of file
+{"version":3,"pages404":true,"caseSensitive":false,"basePath":"","redirects":[{"source":"/:path+/","destination":"/:path+","internal":true,"statusCode":308,"regex":"^(?:/((?:[^/]+?)(?:/(?:[^/]+?))*))/$"}],"headers":[],"dynamicRoutes":[{"page":"/api/auth/[...nextauth]","regex":"^/api/auth/(.+?)(?:/)?$","routeKeys":{"nxtPnextauth":"nxtPnextauth"},"namedRegex":"^/api/auth/(?.+?)(?:/)?$"}],"staticRoutes":[{"page":"/","regex":"^/(?:/)?$","routeKeys":{},"namedRegex":"^/(?:/)?$"},{"page":"/_not-found","regex":"^/_not\\-found(?:/)?$","routeKeys":{},"namedRegex":"^/_not\\-found(?:/)?$"}],"dataRoutes":[],"rsc":{"header":"RSC","varyHeader":"RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url","prefetchHeader":"Next-Router-Prefetch","didPostponeHeader":"x-nextjs-postponed","contentTypeHeader":"text/x-component","suffix":".rsc","prefetchSuffix":".prefetch.rsc"},"rewrites":[]}
\ No newline at end of file
diff --git a/apps/web/.next/server/app-paths-manifest.json b/apps/web/.next/server/app-paths-manifest.json
index 1c1fb501..c0e9e1fe 100644
--- a/apps/web/.next/server/app-paths-manifest.json
+++ b/apps/web/.next/server/app-paths-manifest.json
@@ -1,7 +1,6 @@
{
"/_not-found": "app/_not-found.js",
- "/account/page": "app/account/page.js",
"/api/auth/[...nextauth]/route": "app/api/auth/[...nextauth]/route.js",
- "/api/store/route": "app/api/store/route.js",
- "/page": "app/page.js"
+ "/page": "app/page.js",
+ "/api/store/route": "app/api/store/route.js"
}
\ No newline at end of file
diff --git a/apps/web/.next/server/app/_not-found.html b/apps/web/.next/server/app/_not-found.html
index 5b9ab9b8..f35dc25b 100644
--- a/apps/web/.next/server/app/_not-found.html
+++ b/apps/web/.next/server/app/_not-found.html
@@ -1 +1 @@
-404: This page could not be found.Create T3 App
404
This page could not be found.
\ No newline at end of file
+404: This page could not be found.Create T3 App
404
This page could not be found.
\ No newline at end of file
diff --git a/apps/web/.next/server/app/_not-found.js b/apps/web/.next/server/app/_not-found.js
index 1b0d12fe..12eaa23f 100644
--- a/apps/web/.next/server/app/_not-found.js
+++ b/apps/web/.next/server/app/_not-found.js
@@ -1 +1 @@
-(()=>{var e={};e.id=165,e.ids=[165],e.modules={7849:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external")},2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},5403:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},4749:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},3145:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GlobalError:()=>i.a,__next_app__:()=>p,originalPathname:()=>u,pages:()=>c,routeModule:()=>x,tree:()=>d});var r=n(9441),s=n(1498),o=n(6580),i=n.n(o),a=n(5511),l={};for(let e in a)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>a[e]);n.d(t,l);let d=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(n.t.bind(n,3250,23)),"next/dist/client/components/not-found-error"]}]},{layout:[()=>Promise.resolve().then(n.bind(n,8205)),"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(n.t.bind(n,3250,23)),"next/dist/client/components/not-found-error"]}],c=[],u="/_not-found",p={require:n,loadChunk:()=>Promise.resolve()},x=new r.AppPageRouteModule({definition:{kind:s.x.APP_PAGE,page:"/_not-found",pathname:"/_not-found",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},7422:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,9489,23)),Promise.resolve().then(n.t.bind(n,6225,23)),Promise.resolve().then(n.t.bind(n,5964,23)),Promise.resolve().then(n.t.bind(n,5804,23)),Promise.resolve().then(n.t.bind(n,7255,23)),Promise.resolve().then(n.t.bind(n,1021,23))},5722:()=>{},8205:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a,metadata:()=>i});var r=n(6491),s=n(1608),o=n.n(s);n(1603);let i={title:"Create T3 App",description:"Generated by create-t3-app",icons:[{rel:"icon",url:"/favicon.ico"}]};function a({children:e}){return r.jsx("html",{lang:"en",children:r.jsx("body",{className:`font-sans ${o().variable}`,children:e})})}},1603:()=>{}};var t=require("../webpack-runtime.js");t.C(e);var n=e=>t(t.s=e),r=t.X(0,[369,38],()=>n(3145));module.exports=r})();
\ No newline at end of file
+(()=>{var e={};e.id=165,e.ids=[165],e.modules={7849:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external")},2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},5403:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},4749:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1608:e=>{e.exports={style:{fontFamily:"'__Inter_aaf875', '__Inter_Fallback_aaf875'",fontStyle:"normal"},className:"__className_aaf875",variable:"__variable_aaf875"}},3145:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>l.a,__next_app__:()=>f,originalPathname:()=>d,pages:()=>c,routeModule:()=>p,tree:()=>s});var n=r(9441),o=r(1498),a=r(6580),l=r.n(a),i=r(5511),u={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(u[e]=()=>i[e]);r.d(t,u);let s=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.t.bind(r,3250,23)),"next/dist/client/components/not-found-error"]}]},{layout:[()=>Promise.resolve().then(r.bind(r,8205)),"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,3250,23)),"next/dist/client/components/not-found-error"]}],c=[],d="/_not-found",f={require:r,loadChunk:()=>Promise.resolve()},p=new n.AppPageRouteModule({definition:{kind:o.x.APP_PAGE,page:"/_not-found",pathname:"/_not-found",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:s}})},7422:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,9489,23)),Promise.resolve().then(r.t.bind(r,6225,23)),Promise.resolve().then(r.t.bind(r,5964,23)),Promise.resolve().then(r.t.bind(r,5804,23)),Promise.resolve().then(r.t.bind(r,7255,23)),Promise.resolve().then(r.t.bind(r,1021,23))},5722:()=>{},9517:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return a}});let n=r(8800),o=r(7294);function a(e,t){return(0,o.normalizePathTrailingSlash)((0,n.addPathPrefix)(e,""))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2641:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callServer",{enumerable:!0,get:function(){return o}});let n=r(9489);async function o(e,t){let r=(0,n.getServerActionDispatcher)();if(!r)throw Error("Invariant: missing action dispatcher.");return new Promise((n,o)=>{r({actionId:e,actionArgs:t,resolve:n,reject:o})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AppRouterAnnouncer",{enumerable:!0,get:function(){return l}});let n=r(3810),o=r(914),a="next-route-announcer";function l(e){let{tree:t}=e,[r,l]=(0,n.useState)(null);(0,n.useEffect)(()=>(l(function(){var e;let t=document.getElementsByName(a)[0];if(null==t?void 0:null==(e=t.shadowRoot)?void 0:e.childNodes[0])return t.shadowRoot.childNodes[0];{let e=document.createElement(a);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(a)[0];(null==e?void 0:e.isConnected)&&document.body.removeChild(e)}),[]);let[i,u]=(0,n.useState)(""),s=(0,n.useRef)();return(0,n.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==s.current&&s.current!==e&&u(e),s.current=e},[t]),r?(0,o.createPortal)(i,r):null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2848:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RSC_HEADER:function(){return r},ACTION:function(){return n},NEXT_ROUTER_STATE_TREE:function(){return o},NEXT_ROUTER_PREFETCH_HEADER:function(){return a},NEXT_URL:function(){return l},RSC_CONTENT_TYPE_HEADER:function(){return i},RSC_VARY_HEADER:function(){return u},FLIGHT_PARAMETERS:function(){return s},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_DID_POSTPONE_HEADER:function(){return d}});let r="RSC",n="Next-Action",o="Next-Router-State-Tree",a="Next-Router-Prefetch",l="Next-Url",i="text/x-component",u=r+", "+o+", "+a+", "+l,s=[[r],[o],[a]],c="_rsc",d="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getServerActionDispatcher:function(){return O},urlToUrlWithoutFlightMarker:function(){return x},createEmptyCacheNode:function(){return M},default:function(){return w}});let n=r(4816),o=r(7685),a=n._(r(3810)),l=r(7874),i=r(4967),u=r(5458),s=r(7321),c=r(1274),d=r(6225),f=r(4782),p=r(8866),g=r(9517),h=r(2023),_=r(5369),v=r(3567),y=r(8937),b=r(2848),m=r(5084),P=r(8977),S=null,R=null;function O(){return R}let E={};function x(e){let t=new URL(e,location.origin);return t.searchParams.delete(b.NEXT_RSC_UNION_QUERY),t}function T(e){return e.origin!==window.location.origin}function j(e){let{appRouterState:t,sync:r}=e;return(0,a.useInsertionEffect)(()=>{let{tree:e,pushRef:n,canonicalUrl:o}=t,a={...n.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:e};n.pendingPush&&(0,u.createHrefFromUrl)(new URL(window.location.href))!==o?(n.pendingPush=!1,window.history.pushState(a,"",o)):window.history.replaceState(a,"",o),r(t)},[t,r]),null}function M(){return{lazyData:null,rsc:null,prefetchRsc:null,parallelRoutes:new Map}}function C(e){null==e&&(e={});let t=window.history.state,r=null==t?void 0:t.__NA;r&&(e.__NA=r);let n=null==t?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;return n&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=n),e}function N(e){let{headCacheNode:t}=e,r=null!==t?t.head:null,n=null!==t?t.prefetchHead:null,o=null!==n?n:r;return(0,a.useDeferredValue)(r,o)}function A(e){let t,{buildId:r,initialHead:n,initialTree:u,initialCanonicalUrl:d,initialSeedData:b,assetPrefix:O,missingSlots:x}=e,M=(0,a.useMemo)(()=>(0,f.createInitialRouterState)({buildId:r,initialSeedData:b,initialCanonicalUrl:d,initialTree:u,initialParallelRoutes:S,isServer:!0,location:null,initialHead:n}),[r,b,d,u,n]),[A,w,I]=(0,c.useReducerWithReduxDevtools)(M);(0,a.useEffect)(()=>{S=null},[]);let{canonicalUrl:D}=(0,c.useUnwrapState)(A),{searchParams:L,pathname:U}=(0,a.useMemo)(()=>{let e=new URL(D,"http://n");return{searchParams:e.searchParams,pathname:(0,P.hasBasePath)(e.pathname)?(0,m.removeBasePath)(e.pathname):e.pathname}},[D]),F=(0,a.useCallback)((e,t,r)=>{(0,a.startTransition)(()=>{w({type:i.ACTION_SERVER_PATCH,flightData:t,previousTree:e,overrideCanonicalUrl:r})})},[w]),G=(0,a.useCallback)((e,t,r)=>{let n=new URL((0,g.addBasePath)(e),location.href);return w({type:i.ACTION_NAVIGATE,url:n,isExternalUrl:T(n),locationSearch:location.search,shouldScroll:null==r||r,navigateType:t})},[w]);R=(0,a.useCallback)(e=>{(0,a.startTransition)(()=>{w({...e,type:i.ACTION_SERVER_ACTION})})},[w]);let H=(0,a.useMemo)(()=>({back:()=>window.history.back(),forward:()=>window.history.forward(),prefetch:(e,t)=>{if((0,p.isBot)(window.navigator.userAgent))return;let r=new URL((0,g.addBasePath)(e),window.location.href);T(r)||(0,a.startTransition)(()=>{var e;w({type:i.ACTION_PREFETCH,url:r,kind:null!=(e=null==t?void 0:t.kind)?e:i.PrefetchKind.FULL})})},replace:(e,t)=>{void 0===t&&(t={}),(0,a.startTransition)(()=>{var r;G(e,"replace",null==(r=t.scroll)||r)})},push:(e,t)=>{void 0===t&&(t={}),(0,a.startTransition)(()=>{var r;G(e,"push",null==(r=t.scroll)||r)})},refresh:()=>{(0,a.startTransition)(()=>{w({type:i.ACTION_REFRESH,origin:window.location.origin})})},fastRefresh:()=>{throw Error("fastRefresh can only be used in development mode. Please use refresh instead.")}}),[w,G]);(0,a.useEffect)(()=>{window.next&&(window.next.router=H)},[H]),(0,a.useEffect)(()=>{function e(e){var t;e.persisted&&(null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE)&&w({type:i.ACTION_RESTORE,url:new URL(window.location.href),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE})}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[w]);let{pushRef:B}=(0,c.useUnwrapState)(A);if(B.mpaNavigation){if(E.pendingMpaPath!==D){let e=window.location;B.pendingPush?e.assign(D):e.replace(D),E.pendingMpaPath=D}(0,a.use)((0,y.createInfinitePromise)())}(0,a.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),r=e=>{let t=window.location.href;(0,a.startTransition)(()=>{w({type:i.ACTION_RESTORE,url:new URL(null!=e?e:t,t),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE})})};window.history.pushState=function(t,n,o){return(null==t?void 0:t.__NA)||(null==t?void 0:t._N)||(t=C(t),o&&r(o)),e(t,n,o)},window.history.replaceState=function(e,n,o){return(null==e?void 0:e.__NA)||(null==e?void 0:e._N)||(e=C(e),o&&r(o)),t(e,n,o)};let n=e=>{let{state:t}=e;if(t){if(!t.__NA){window.location.reload();return}(0,a.startTransition)(()=>{w({type:i.ACTION_RESTORE,url:new URL(window.location.href),tree:t.__PRIVATE_NEXTJS_INTERNALS_TREE})})}};return window.addEventListener("popstate",n),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",n)}},[w]);let{cache:V,tree:k,nextUrl:W,focusAndScrollRef:X}=(0,c.useUnwrapState)(A),K=(0,a.useMemo)(()=>(0,v.findHeadInCache)(V,k[1]),[V,k]);if(null!==K){let[e,r]=K;t=(0,o.jsx)(N,{headCacheNode:e},r)}else t=null;let $=(0,o.jsxs)(_.RedirectBoundary,{children:[t,V.rsc,(0,o.jsx)(h.AppRouterAnnouncer,{tree:k})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(j,{appRouterState:(0,c.useUnwrapState)(A),sync:I}),(0,o.jsx)(s.PathnameContext.Provider,{value:U,children:(0,o.jsx)(s.SearchParamsContext.Provider,{value:L,children:(0,o.jsx)(l.GlobalLayoutRouterContext.Provider,{value:{buildId:r,changeByServerResponse:F,tree:k,focusAndScrollRef:X,nextUrl:W},children:(0,o.jsx)(l.AppRouterContext.Provider,{value:H,children:(0,o.jsx)(l.LayoutRouterContext.Provider,{value:{childNodes:V.parallelRoutes,tree:k,url:D},children:$})})})})})]})}function w(e){let{globalErrorComponent:t,...r}=e;return(0,o.jsx)(d.ErrorBoundary,{errorComponent:t,children:(0,o.jsx)(A,{...r})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7391:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bailoutToClientRendering",{enumerable:!0,get:function(){return a}});let n=r(2768),o=r(4749);function a(e){let t=o.staticGenerationAsyncStorage.getStore();if((null==t||!t.forceStatic)&&(null==t?void 0:t.isStaticGeneration))throw new n.BailoutToCSRError(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6515:(e,t,r)=>{"use strict";function n(e){}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clientHookInServerComponentError",{enumerable:!0,get:function(){return n}}),r(3444),r(3810),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ErrorBoundaryHandler:function(){return c},GlobalError:function(){return d},default:function(){return f},ErrorBoundary:function(){return p}});let n=r(3444),o=r(7685),a=n._(r(3810)),l=r(7435),i=r(2241),u={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},text:{fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"}};function s(e){let{error:t}=e;if("function"==typeof fetch.__nextGetStaticStore){var r;let e=null==(r=fetch.__nextGetStaticStore())?void 0:r.getStore();if((null==e?void 0:e.isRevalidate)||(null==e?void 0:e.isStaticGeneration))throw console.error(t),t}return null}class c extends a.default.Component{static getDerivedStateFromError(e){if((0,i.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,o.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}}function d(e){let{error:t}=e,r=null==t?void 0:t.digest;return(0,o.jsxs)("html",{id:"__next_error__",children:[(0,o.jsx)("head",{}),(0,o.jsxs)("body",{children:[(0,o.jsx)(s,{error:t}),(0,o.jsx)("div",{style:u.error,children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{style:u.text,children:"Application error: a "+(r?"server":"client")+"-side exception has occurred (see the "+(r?"server logs":"browser console")+" for more information)."}),r?(0,o.jsx)("p",{style:u.text,children:"Digest: "+r}):null]})})]})]})}let f=d;function p(e){let{errorComponent:t,errorStyles:r,errorScripts:n,children:a}=e,i=(0,l.usePathname)();return t?(0,o.jsx)(c,{pathname:i,errorComponent:t,errorStyles:r,errorScripts:n,children:a}):(0,o.jsx)(o.Fragment,{children:a})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},999:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DynamicServerError:function(){return n},isDynamicServerError:function(){return o}});let r="DYNAMIC_SERVER_USAGE";class n extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=r}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8937:(e,t)=>{"use strict";let r;function n(){return r||(r=new Promise(()=>{})),r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInfinitePromise",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2241:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return a}});let n=r(1951),o=r(8591);function a(e){return e&&e.digest&&((0,o.isRedirectError)(e)||(0,n.isNotFoundError)(e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5964:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return S}}),r(3444);let n=r(4816),o=r(7685),a=n._(r(3810));r(914);let l=r(7874),i=r(5917),u=r(8937),s=r(6225),c=r(7666),d=r(3848),f=r(5369),p=r(5804),g=r(9010),h=r(3711),_=["bottom","height","left","right","top","width","x","y"];function v(e,t){let r=e.getBoundingClientRect();return r.top>=0&&r.top<=t}class y extends a.default.Component{componentDidMount(){this.handlePotentialScroll()}componentDidUpdate(){this.props.focusAndScrollRef.apply&&this.handlePotentialScroll()}render(){return this.props.children}constructor(...e){super(...e),this.handlePotentialScroll=()=>{let{focusAndScrollRef:e,segmentPath:t}=this.props;if(e.apply){if(0!==e.segmentPaths.length&&!e.segmentPaths.some(e=>t.every((t,r)=>(0,c.matchSegment)(t,e[r]))))return;let r=null,n=e.hashFragment;if(n&&(r=function(e){var t;return"top"===e?document.body:null!=(t=document.getElementById(e))?t:document.getElementsByName(e)[0]}(n)),!r&&(r=null),!(r instanceof Element))return;for(;!(r instanceof HTMLElement)||function(e){if(["sticky","fixed"].includes(getComputedStyle(e).position))return!0;let t=e.getBoundingClientRect();return _.every(e=>0===t[e])}(r);){if(null===r.nextElementSibling)return;r=r.nextElementSibling}e.apply=!1,e.hashFragment=null,e.segmentPaths=[],(0,d.handleSmoothScroll)(()=>{if(n){r.scrollIntoView();return}let e=document.documentElement,t=e.clientHeight;!v(r,t)&&(e.scrollTop=0,v(r,t)||r.scrollIntoView())},{dontForceLayout:!0,onlyHashChange:e.onlyHashChange}),e.onlyHashChange=!1,r.focus()}}}}function b(e){let{segmentPath:t,children:r}=e,n=(0,a.useContext)(l.GlobalLayoutRouterContext);if(!n)throw Error("invariant global layout router not mounted");return(0,o.jsx)(y,{segmentPath:t,focusAndScrollRef:n.focusAndScrollRef,children:r})}function m(e){let{parallelRouterKey:t,url:r,childNodes:n,segmentPath:s,tree:d,cacheKey:f}=e,p=(0,a.useContext)(l.GlobalLayoutRouterContext);if(!p)throw Error("invariant global layout router not mounted");let{buildId:g,changeByServerResponse:h,tree:_}=p,v=n.get(f);if(void 0===v){let e={lazyData:null,rsc:null,prefetchRsc:null,head:null,parallelRoutes:new Map};v=e,n.set(f,e)}let y=null!==v.prefetchRsc?v.prefetchRsc:v.rsc,b=(0,a.useDeferredValue)(v.rsc,y),m="object"==typeof b&&null!==b&&"function"==typeof b.then?(0,a.use)(b):b;if(!m){let e=v.lazyData;if(null===e){let t=function e(t,r){if(t){let[n,o]=t,a=2===t.length;if((0,c.matchSegment)(r[0],n)&&r[1].hasOwnProperty(o)){if(a){let t=e(void 0,r[1][o]);return[r[0],{...r[1],[o]:[t[0],t[1],t[2],"refetch"]}]}return[r[0],{...r[1],[o]:e(t.slice(2),r[1][o])}]}}return r}(["",...s],_);v.lazyData=e=(0,i.fetchServerResponse)(new URL(r,location.origin),t,p.nextUrl,g)}let[t,n]=(0,a.use)(e);v.lazyData=null,setTimeout(()=>{(0,a.startTransition)(()=>{h(_,t,n)})}),(0,a.use)((0,u.createInfinitePromise)())}return(0,o.jsx)(l.LayoutRouterContext.Provider,{value:{tree:d[1][t],childNodes:v.parallelRoutes,url:r},children:m})}function P(e){let{children:t,loading:r,loadingStyles:n,loadingScripts:l,hasLoading:i}=e;return i?(0,o.jsx)(a.Suspense,{fallback:(0,o.jsxs)(o.Fragment,{children:[n,l,r]}),children:t}):(0,o.jsx)(o.Fragment,{children:t})}function S(e){let{parallelRouterKey:t,segmentPath:r,error:n,errorStyles:i,errorScripts:u,templateStyles:c,templateScripts:d,loading:_,loadingStyles:v,loadingScripts:y,hasLoading:S,template:R,notFound:O,notFoundStyles:E,styles:x}=e,T=(0,a.useContext)(l.LayoutRouterContext);if(!T)throw Error("invariant expected layout router to be mounted");let{childNodes:j,tree:M,url:C}=T,N=j.get(t);N||(N=new Map,j.set(t,N));let A=M[1][t][0],w=(0,g.getSegmentValue)(A),I=[A];return(0,o.jsxs)(o.Fragment,{children:[x,I.map(e=>{let a=(0,g.getSegmentValue)(e),x=(0,h.createRouterCacheKey)(e);return(0,o.jsxs)(l.TemplateContext.Provider,{value:(0,o.jsx)(b,{segmentPath:r,children:(0,o.jsx)(s.ErrorBoundary,{errorComponent:n,errorStyles:i,errorScripts:u,children:(0,o.jsx)(P,{hasLoading:S,loading:_,loadingStyles:v,loadingScripts:y,children:(0,o.jsx)(p.NotFoundBoundary,{notFound:O,notFoundStyles:E,children:(0,o.jsx)(f.RedirectBoundary,{children:(0,o.jsx)(m,{parallelRouterKey:t,url:C,tree:M,childNodes:N,segmentPath:r,cacheKey:x,isActive:w===a})})})})})}),children:[c,d,R]},(0,h.createRouterCacheKey)(e,!0))})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{matchSegment:function(){return o},canSegmentBeOverridden:function(){return a}});let n=r(5841),o=(e,t)=>"string"==typeof e?"string"==typeof t&&e===t:"string"!=typeof t&&e[0]===t[0]&&e[1]===t[1],a=(e,t)=>{var r;return!Array.isArray(e)&&!!Array.isArray(t)&&(null==(r=(0,n.getSegmentParam)(e))?void 0:r.param)===t[0]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return g},useSearchParams:function(){return h},usePathname:function(){return _},ServerInsertedHTMLContext:function(){return s.ServerInsertedHTMLContext},useServerInsertedHTML:function(){return s.useServerInsertedHTML},useRouter:function(){return v},useParams:function(){return y},useSelectedLayoutSegments:function(){return b},useSelectedLayoutSegment:function(){return m},redirect:function(){return c.redirect},permanentRedirect:function(){return c.permanentRedirect},RedirectType:function(){return c.RedirectType},notFound:function(){return d.notFound}});let n=r(3810),o=r(7874),a=r(7321),l=r(6515),i=r(9010),u=r(3940),s=r(7932),c=r(8591),d=r(1951),f=Symbol("internal for urlsearchparams readonly");function p(){return Error("ReadonlyURLSearchParams cannot be modified")}class g{[Symbol.iterator](){return this[f][Symbol.iterator]()}append(){throw p()}delete(){throw p()}set(){throw p()}sort(){throw p()}constructor(e){this[f]=e,this.entries=e.entries.bind(e),this.forEach=e.forEach.bind(e),this.get=e.get.bind(e),this.getAll=e.getAll.bind(e),this.has=e.has.bind(e),this.keys=e.keys.bind(e),this.values=e.values.bind(e),this.toString=e.toString.bind(e),this.size=e.size}}function h(){(0,l.clientHookInServerComponentError)("useSearchParams");let e=(0,n.useContext)(a.SearchParamsContext),t=(0,n.useMemo)(()=>e?new g(e):null,[e]);{let{bailoutToClientRendering:e}=r(7391);e("useSearchParams()")}return t}function _(){return(0,l.clientHookInServerComponentError)("usePathname"),(0,n.useContext)(a.PathnameContext)}function v(){(0,l.clientHookInServerComponentError)("useRouter");let e=(0,n.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function y(){(0,l.clientHookInServerComponentError)("useParams");let e=(0,n.useContext)(o.GlobalLayoutRouterContext),t=(0,n.useContext)(a.PathParamsContext);return(0,n.useMemo)(()=>(null==e?void 0:e.tree)?function e(t,r){for(let n of(void 0===r&&(r={}),Object.values(t[1]))){let t=n[0],o=Array.isArray(t),a=o?t[1]:t;!a||a.startsWith(u.PAGE_SEGMENT_KEY)||(o&&("c"===t[2]||"oc"===t[2])?r[t[0]]=t[1].split("/"):o&&(r[t[0]]=t[1]),r=e(n,r))}return r}(e.tree):t,[null==e?void 0:e.tree,t])}function b(e){void 0===e&&(e="children"),(0,l.clientHookInServerComponentError)("useSelectedLayoutSegments");let{tree:t}=(0,n.useContext)(o.LayoutRouterContext);return function e(t,r,n,o){let a;if(void 0===n&&(n=!0),void 0===o&&(o=[]),n)a=t[1][r];else{var l;let e=t[1];a=null!=(l=e.children)?l:Object.values(e)[0]}if(!a)return o;let s=a[0],c=(0,i.getSegmentValue)(s);return!c||c.startsWith(u.PAGE_SEGMENT_KEY)?o:(o.push(c),e(a,r,!1,o))}(t,e)}function m(e){void 0===e&&(e="children"),(0,l.clientHookInServerComponentError)("useSelectedLayoutSegment");let t=b(e);return 0===t.length?null:t[0]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5804:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NotFoundBoundary",{enumerable:!0,get:function(){return c}});let n=r(4816),o=r(7685),a=n._(r(3810)),l=r(7435),i=r(1951);r(4586);let u=r(7874);class s extends a.default.Component{componentDidCatch(){}static getDerivedStateFromError(e){if((0,i.isNotFoundError)(e))return{notFoundTriggered:!0};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.notFoundTriggered?{notFoundTriggered:!1,previousPathname:e.pathname}:{notFoundTriggered:t.notFoundTriggered,previousPathname:e.pathname}}render(){return this.state.notFoundTriggered?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("meta",{name:"robots",content:"noindex"}),!1,this.props.notFoundStyles,this.props.notFound]}):this.props.children}constructor(e){super(e),this.state={notFoundTriggered:!!e.asNotFound,previousPathname:e.pathname}}}function c(e){let{notFound:t,notFoundStyles:r,asNotFound:n,children:i}=e,c=(0,l.usePathname)(),d=(0,a.useContext)(u.MissingSlotContext);return t?(0,o.jsx)(s,{pathname:c,notFound:t,notFoundStyles:r,asNotFound:n,missingSlots:d,children:i}):(0,o.jsx)(o.Fragment,{children:i})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1951:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{notFound:function(){return n},isNotFoundError:function(){return o}});let r="NEXT_NOT_FOUND";function n(){let e=Error(r);throw e.digest=r,e}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PromiseQueue",{enumerable:!0,get:function(){return s}});let n=r(8067),o=r(6296);var a=o._("_maxConcurrency"),l=o._("_runningCount"),i=o._("_queue"),u=o._("_processNext");class s{enqueue(e){let t,r;let o=new Promise((e,n)=>{t=e,r=n}),a=async()=>{try{n._(this,l)[l]++;let r=await e();t(r)}catch(e){r(e)}finally{n._(this,l)[l]--,n._(this,u)[u]()}};return n._(this,i)[i].push({promiseFn:o,task:a}),n._(this,u)[u](),o}bump(e){let t=n._(this,i)[i].findIndex(t=>t.promiseFn===e);if(t>-1){let e=n._(this,i)[i].splice(t,1)[0];n._(this,i)[i].unshift(e),n._(this,u)[u](!0)}}constructor(e=5){Object.defineProperty(this,u,{value:c}),Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,i,{writable:!0,value:void 0}),n._(this,a)[a]=e,n._(this,l)[l]=0,n._(this,i)[i]=[]}}function c(e){if(void 0===e&&(e=!1),(n._(this,l)[l]0){var t;null==(t=n._(this,i)[i].shift())||t.task()}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RedirectErrorBoundary:function(){return s},RedirectBoundary:function(){return c}});let n=r(4816),o=r(7685),a=n._(r(3810)),l=r(7435),i=r(8591);function u(e){let{redirect:t,reset:r,redirectType:n}=e,o=(0,l.useRouter)();return(0,a.useEffect)(()=>{a.default.startTransition(()=>{n===i.RedirectType.push?o.push(t,{}):o.replace(t,{}),r()})},[t,n,r,o]),null}class s extends a.default.Component{static getDerivedStateFromError(e){if((0,i.isRedirectError)(e))return{redirect:(0,i.getURLFromRedirectError)(e),redirectType:(0,i.getRedirectTypeFromError)(e)};throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,o.jsx)(u,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}constructor(e){super(e),this.state={redirect:null,redirectType:null}}}function c(e){let{children:t}=e,r=(0,l.useRouter)();return(0,o.jsx)(s,{router:r,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4011:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return r}}),function(e){e[e.SeeOther=303]="SeeOther",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect"}(r||(r={})),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8591:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RedirectType:function(){return n},getRedirectError:function(){return u},redirect:function(){return s},permanentRedirect:function(){return c},isRedirectError:function(){return d},getURLFromRedirectError:function(){return f},getRedirectTypeFromError:function(){return p},getRedirectStatusCodeFromError:function(){return g}});let o=r(5403),a=r(7849),l=r(4011),i="NEXT_REDIRECT";function u(e,t,r){void 0===r&&(r=l.RedirectStatusCode.TemporaryRedirect);let n=Error(i);n.digest=i+";"+t+";"+e+";"+r+";";let a=o.requestAsyncStorage.getStore();return a&&(n.mutableCookies=a.mutableCookies),n}function s(e,t){void 0===t&&(t="replace");let r=a.actionAsyncStorage.getStore();throw u(e,t,(null==r?void 0:r.isAction)?l.RedirectStatusCode.SeeOther:l.RedirectStatusCode.TemporaryRedirect)}function c(e,t){void 0===t&&(t="replace");let r=a.actionAsyncStorage.getStore();throw u(e,t,(null==r?void 0:r.isAction)?l.RedirectStatusCode.SeeOther:l.RedirectStatusCode.PermanentRedirect)}function d(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,r,n,o]=e.digest.split(";",4),a=Number(o);return t===i&&("replace"===r||"push"===r)&&"string"==typeof n&&!isNaN(a)&&a in l.RedirectStatusCode}function f(e){return d(e)?e.digest.split(";",3)[2]:null}function p(e){if(!d(e))throw Error("Not a redirect error");return e.digest.split(";",2)[1]}function g(e){if(!d(e))throw Error("Not a redirect error");return Number(e.digest.split(";",4)[3])}(function(e){e.push="push",e.replace="replace"})(n||(n={})),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(4816),o=r(7685),a=n._(r(3810)),l=r(7874);function i(){let e=(0,a.useContext)(l.TemplateContext);return(0,o.jsx)(o.Fragment,{children:e})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyFlightData",{enumerable:!0,get:function(){return a}});let n=r(1678),o=r(7756);function a(e,t,r,a){void 0===a&&(a=!1);let[l,i,u]=r.slice(-3);if(null===i)return!1;if(3===r.length){let r=i[2];t.rsc=r,t.prefetchRsc=null,(0,n.fillLazyItemsTillLeafWithHead)(t,e,l,i,u,a)}else t.rsc=e.rsc,t.prefetchRsc=e.prefetchRsc,t.parallelRoutes=new Map(e.parallelRoutes),(0,o.fillCacheWithNewSubTreeData)(t,e,r,a);return!0}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{applyRouterStatePatchToFullTree:function(){return i},applyRouterStatePatchToTreeSkipDefault:function(){return u}});let n=r(3940),o=r(7666);function a(e,t,r){void 0===r&&(r=!1);let[l,i]=e,[u,s]=t;if(!r&&u===n.DEFAULT_SEGMENT_KEY&&l!==n.DEFAULT_SEGMENT_KEY)return e;if((0,o.matchSegment)(l,u)){let t={};for(let e in i)void 0!==s[e]?t[e]=a(i[e],s[e],r):t[e]=i[e];for(let e in s)t[e]||(t[e]=s[e]);let n=[l,t];return e[2]&&(n[2]=e[2]),e[3]&&(n[3]=e[3]),e[4]&&(n[4]=e[4]),n}return t}function l(e,t,r,n){let i;void 0===n&&(n=!1);let[u,s,,,c]=t;if(1===e.length)return a(t,r,n);let[d,f]=e;if(!(0,o.matchSegment)(d,u))return null;if(2===e.length)i=a(s[f],r,n);else if(null===(i=l(e.slice(2),s[f],r,n)))return null;let p=[e[0],{...s,[f]:i}];return c&&(p[4]=!0),p}function i(e,t,r){return l(e,t,r,!0)}function u(e,t,r){return l(e,t,r,!1)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1545:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{extractPathFromFlightRouterState:function(){return s},computeChangedPath:function(){return c}});let n=r(494),o=r(3940),a=r(7666),l=e=>"/"===e[0]?e.slice(1):e,i=e=>"string"==typeof e?e:e[1];function u(e){return e.reduce((e,t)=>""===(t=l(t))||(0,o.isGroupSegment)(t)?e:e+"/"+t,"")||"/"}function s(e){var t;let r=Array.isArray(e[0])?e[0][1]:e[0];if(r===o.DEFAULT_SEGMENT_KEY||n.INTERCEPTION_ROUTE_MARKERS.some(e=>r.startsWith(e)))return;if(r.startsWith(o.PAGE_SEGMENT_KEY))return"";let a=[r],l=null!=(t=e[1])?t:{},i=l.children?s(l.children):void 0;if(void 0!==i)a.push(i);else for(let[e,t]of Object.entries(l)){if("children"===e)continue;let r=s(t);void 0!==r&&a.push(r)}return u(a)}function c(e,t){let r=function e(t,r){let[o,l]=t,[u,c]=r,d=i(o),f=i(u);if(n.INTERCEPTION_ROUTE_MARKERS.some(e=>d.startsWith(e)||f.startsWith(e)))return"";if(!(0,a.matchSegment)(o,u)){var p;return null!=(p=s(r))?p:""}for(let t in l)if(c[t]){let r=e(l[t],c[t]);if(null!==r)return i(u)+"/"+r}return null}(e,t);return null==r||"/"===r?r:u(r.split("/"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5458:(e,t)=>{"use strict";function r(e,t){return void 0===t&&(t=!0),e.pathname+e.search+(t?e.hash:"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createHrefFromUrl",{enumerable:!0,get:function(){return r}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInitialRouterState",{enumerable:!0,get:function(){return l}});let n=r(5458),o=r(1678),a=r(1545);function l(e){var t;let{buildId:r,initialTree:l,initialSeedData:i,initialCanonicalUrl:u,initialParallelRoutes:s,isServer:c,location:d,initialHead:f}=e,p={lazyData:null,rsc:i[2],prefetchRsc:null,parallelRoutes:c?new Map:s};return(null===s||0===s.size)&&(0,o.fillLazyItemsTillLeafWithHead)(p,void 0,l,i,f),{buildId:r,tree:l,cache:p,prefetchCache:new Map,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{apply:!1,onlyHashChange:!1,hashFragment:null,segmentPaths:[]},canonicalUrl:d?(0,n.createHrefFromUrl)(d):u,nextUrl:null!=(t=(0,a.extractPathFromFlightRouterState)(l)||(null==d?void 0:d.pathname))?t:null}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3711:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRouterCacheKey",{enumerable:!0,get:function(){return o}});let n=r(3940);function o(e,t){return(void 0===t&&(t=!1),Array.isArray(e))?(e[0]+"|"+e[1]+"|"+e[2]).toLowerCase():t&&e.startsWith(n.PAGE_SEGMENT_KEY)?n.PAGE_SEGMENT_KEY:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5917:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fetchServerResponse",{enumerable:!0,get:function(){return c}});let n=r(2848),o=r(9489),a=r(2641),l=r(4967),i=r(8467),{createFromFetch:u}=r(5492);function s(e){return[(0,o.urlToUrlWithoutFlightMarker)(e).toString(),void 0]}async function c(e,t,r,c,d){let f={[n.RSC_HEADER]:"1",[n.NEXT_ROUTER_STATE_TREE]:encodeURIComponent(JSON.stringify(t))};d===l.PrefetchKind.AUTO&&(f[n.NEXT_ROUTER_PREFETCH_HEADER]="1"),r&&(f[n.NEXT_URL]=r);let p=(0,i.hexHash)([f[n.NEXT_ROUTER_PREFETCH_HEADER]||"0",f[n.NEXT_ROUTER_STATE_TREE],f[n.NEXT_URL]].join(","));try{let t=new URL(e);t.searchParams.set(n.NEXT_RSC_UNION_QUERY,p);let r=await fetch(t,{credentials:"same-origin",headers:f}),l=(0,o.urlToUrlWithoutFlightMarker)(r.url),i=r.redirected?l:void 0,d=r.headers.get("content-type")||"",g=!!r.headers.get(n.NEXT_DID_POSTPONE_HEADER);if(d!==n.RSC_CONTENT_TYPE_HEADER||!r.ok)return e.hash&&(l.hash=e.hash),s(l.toString());let[h,_]=await u(Promise.resolve(r),{callServer:a.callServer});if(c!==h)return s(r.url);return[_,i,g]}catch(t){return console.error("Failed to fetch RSC payload for "+e+". Falling back to browser navigation.",t),[e.toString(),void 0]}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillCacheWithDataProperty",{enumerable:!0,get:function(){return function e(t,r,o,a){let l=o.length<=2,[i,u]=o,s=(0,n.createRouterCacheKey)(u),c=r.parallelRoutes.get(i),d=t.parallelRoutes.get(i);d&&d!==c||(d=new Map(c),t.parallelRoutes.set(i,d));let f=null==c?void 0:c.get(s),p=d.get(s);if(l){p&&p.lazyData&&p!==f||d.set(s,{lazyData:a(),rsc:null,prefetchRsc:null,parallelRoutes:new Map});return}if(!p||!f){p||d.set(s,{lazyData:a(),rsc:null,prefetchRsc:null,parallelRoutes:new Map});return}return p===f&&(p={lazyData:p.lazyData,rsc:p.rsc,prefetchRsc:p.prefetchRsc,parallelRoutes:new Map(p.parallelRoutes)},d.set(s,p)),e(p,f,o.slice(2),a)}}});let n=r(3711);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillCacheWithNewSubTreeData",{enumerable:!0,get:function(){return function e(t,r,l,i){let u=l.length<=5,[s,c]=l,d=(0,a.createRouterCacheKey)(c),f=r.parallelRoutes.get(s);if(!f)return;let p=t.parallelRoutes.get(s);p&&p!==f||(p=new Map(f),t.parallelRoutes.set(s,p));let g=f.get(d),h=p.get(d);if(u){if(!h||!h.lazyData||h===g){let e=l[3];h={lazyData:null,rsc:e[2],prefetchRsc:null,parallelRoutes:g?new Map(g.parallelRoutes):new Map},g&&(0,n.invalidateCacheByRouterState)(h,g,l[2]),(0,o.fillLazyItemsTillLeafWithHead)(h,g,l[2],e,l[4],i),p.set(d,h)}return}h&&g&&(h===g&&(h={lazyData:h.lazyData,rsc:h.rsc,prefetchRsc:h.prefetchRsc,parallelRoutes:new Map(h.parallelRoutes)},p.set(d,h)),e(h,g,l.slice(2),i))}}});let n=r(7241),o=r(1678),a=r(3711);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillLazyItemsTillLeafWithHead",{enumerable:!0,get:function(){return function e(t,r,o,a,l,i){if(0===Object.keys(o[1]).length){t.head=l;return}for(let u in o[1]){let s;let c=o[1][u],d=c[0],f=(0,n.createRouterCacheKey)(d),p=null!==a&&void 0!==a[1][u]?a[1][u]:null;if(r){let n=r.parallelRoutes.get(u);if(n){let r,o=new Map(n),a=o.get(f);r=null!==p?{lazyData:null,rsc:p[2],prefetchRsc:null,parallelRoutes:new Map(null==a?void 0:a.parallelRoutes)}:i&&a?{lazyData:a.lazyData,rsc:a.rsc,prefetchRsc:a.prefetchRsc,parallelRoutes:new Map(a.parallelRoutes)}:{lazyData:null,rsc:null,prefetchRsc:null,parallelRoutes:new Map(null==a?void 0:a.parallelRoutes)},o.set(f,r),e(r,a,c,p||null,l,i),t.parallelRoutes.set(u,o);continue}}s=null!==p?{lazyData:null,rsc:p[2],prefetchRsc:null,parallelRoutes:new Map}:{lazyData:null,rsc:null,prefetchRsc:null,parallelRoutes:new Map};let g=t.parallelRoutes.get(u);g?g.set(f,s):t.parallelRoutes.set(u,new Map([[f,s]])),e(s,void 0,c,p,l,i)}}}});let n=r(3711);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5011:(e,t)=>{"use strict";var r;function n(e){let{kind:t,prefetchTime:r,lastUsedTime:n}=e;return Date.now()<(null!=n?n:r)+3e4?n?"reusable":"fresh":"auto"===t&&Date.now(){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleMutable",{enumerable:!0,get:function(){return a}});let n=r(1545);function o(e){return void 0!==e}function a(e,t){var r,a,l;let i=null==(a=t.shouldScroll)||a,u=e.nextUrl;if(o(t.patchedTree)){let r=(0,n.computeChangedPath)(e.tree,t.patchedTree);r?u=r:u||(u=e.canonicalUrl)}return{buildId:e.buildId,canonicalUrl:o(t.canonicalUrl)?t.canonicalUrl===e.canonicalUrl?e.canonicalUrl:t.canonicalUrl:e.canonicalUrl,pushRef:{pendingPush:o(t.pendingPush)?t.pendingPush:e.pushRef.pendingPush,mpaNavigation:o(t.mpaNavigation)?t.mpaNavigation:e.pushRef.mpaNavigation,preserveCustomHistoryState:o(t.preserveCustomHistoryState)?t.preserveCustomHistoryState:e.pushRef.preserveCustomHistoryState},focusAndScrollRef:{apply:!!i&&(!!o(null==t?void 0:t.scrollableSegments)||e.focusAndScrollRef.apply),onlyHashChange:!!t.hashFragment&&e.canonicalUrl.split("#",1)[0]===(null==(r=t.canonicalUrl)?void 0:r.split("#",1)[0]),hashFragment:i?t.hashFragment&&""!==t.hashFragment?decodeURIComponent(t.hashFragment.slice(1)):e.focusAndScrollRef.hashFragment:null,segmentPaths:i?null!=(l=null==t?void 0:t.scrollableSegments)?l:e.focusAndScrollRef.segmentPaths:[]},cache:t.cache?t.cache:e.cache,prefetchCache:t.prefetchCache?t.prefetchCache:e.prefetchCache,tree:o(t.patchedTree)?t.patchedTree:e.tree,nextUrl:u}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSegmentMismatch",{enumerable:!0,get:function(){return o}});let n=r(4007);function o(e,t,r){return(0,n.handleExternalUrl)(e,{},e.canonicalUrl,!0)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheBelowFlightSegmentPath",{enumerable:!0,get:function(){return function e(t,r,o){let a=o.length<=2,[l,i]=o,u=(0,n.createRouterCacheKey)(i),s=r.parallelRoutes.get(l);if(!s)return;let c=t.parallelRoutes.get(l);if(c&&c!==s||(c=new Map(s),t.parallelRoutes.set(l,c)),a){c.delete(u);return}let d=s.get(u),f=c.get(u);f&&d&&(f===d&&(f={lazyData:f.lazyData,rsc:f.rsc,prefetchRsc:f.prefetchRsc,parallelRoutes:new Map(f.parallelRoutes)},c.set(u,f)),e(f,d,o.slice(2)))}}});let n=r(3711);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7241:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheByRouterState",{enumerable:!0,get:function(){return o}});let n=r(3711);function o(e,t,r){for(let o in r[1]){let a=r[1][o][0],l=(0,n.createRouterCacheKey)(a),i=t.parallelRoutes.get(o);if(i){let t=new Map(i);t.delete(l),e.parallelRoutes.set(o,t)}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6571:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNavigatingToNewRootLayout",{enumerable:!0,get:function(){return function e(t,r){let n=t[0],o=r[0];if(Array.isArray(n)&&Array.isArray(o)){if(n[0]!==o[0]||n[2]!==o[2])return!0}else if(n!==o)return!0;if(t[4])return!r[4];if(r[4])return!0;let a=Object.values(t[1])[0],l=Object.values(r[1])[0];return!a||!l||e(a,l)}}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5111:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{updateCacheNodeOnNavigation:function(){return function e(t,r,i,s,c,d){let f=r[1],p=i[1],g=s[1],h=t.parallelRoutes,_=new Map(h),v={},y=null;for(let t in p){let r;let i=p[t],s=f[t],b=h.get(t),m=g[t],P=i[0],S=(0,a.createRouterCacheKey)(P),R=void 0!==s?s[0]:void 0,O=void 0!==b?b.get(S):void 0;if(null!==(r=P===n.PAGE_SEGMENT_KEY?l(i,void 0!==m?m:null,c,d):P===n.DEFAULT_SEGMENT_KEY?void 0!==s?{route:s,node:null,children:null}:l(i,void 0!==m?m:null,c,d):void 0!==R&&(0,o.matchSegment)(P,R)&&void 0!==O&&void 0!==s?null!=m?e(O,s,i,m,c,d):function(e){let t=u(e,null,null,!1);return{route:e,node:t,children:null}}(i):l(i,void 0!==m?m:null,c,d))){null===y&&(y=new Map),y.set(t,r);let e=r.node;if(null!==e){let r=new Map(b);r.set(S,e),_.set(t,r)}v[t]=r.route}else v[t]=i}if(null===y)return null;let b={lazyData:null,rsc:t.rsc,prefetchRsc:t.prefetchRsc,head:t.head,prefetchHead:t.prefetchHead,parallelRoutes:_};return{route:function(e,t){let r=[e[0],t];return 2 in e&&(r[2]=e[2]),3 in e&&(r[3]=e[3]),4 in e&&(r[4]=e[4]),r}(i,v),node:b,children:y}}},listenForDynamicRequest:function(){return i},abortTask:function(){return s},updateCacheNodeOnPopstateRestoration:function(){return function e(t,r){let n=r[1],o=t.parallelRoutes,l=new Map(o);for(let t in n){let r=n[t],i=r[0],u=(0,a.createRouterCacheKey)(i),s=o.get(t);if(void 0!==s){let n=s.get(u);if(void 0!==n){let o=e(n,r),a=new Map(s);a.set(u,o),l.set(t,a)}}}let i=t.rsc,u=f(i)&&"pending"===i.status;return{lazyData:null,rsc:i,head:t.head,prefetchHead:u?t.prefetchHead:null,prefetchRsc:u?t.prefetchRsc:null,parallelRoutes:l}}}});let n=r(3940),o=r(7666),a=r(3711);function l(e,t,r,n){let o=u(e,t,r,n);return{route:e,node:o,children:null}}function i(e,t){t.then(t=>{for(let r of t[0]){let t=r.slice(0,-3),n=r[r.length-3],l=r[r.length-2],i=r[r.length-1];"string"!=typeof t&&function(e,t,r,n,l){let i=e;for(let e=0;e{s(e,t)})}function u(e,t,r,n){let o=e[1],l=null!==t?t[1]:null,i=new Map;for(let e in o){let t=o[e],s=null!==l?l[e]:null,c=t[0],d=(0,a.createRouterCacheKey)(c),f=u(t,void 0===s?null:s,r,n),p=new Map;p.set(d,f),i.set(e,p)}let s=0===i.size,c=null!==t?t[2]:null;return{lazyData:null,parallelRoutes:i,prefetchRsc:n||void 0===c?null:c,prefetchHead:!n&&s?r:null,rsc:p(),head:s?p():null}}function s(e,t){let r=e.node;if(null===r)return;let n=e.children;if(null===n)c(e.route,r,t);else for(let e of n.values())s(e,t);e.node=null}function c(e,t,r){let n=e[1],o=t.parallelRoutes;for(let e in n){let t=n[e],l=o.get(e);if(void 0===l)continue;let i=t[0],u=(0,a.createRouterCacheKey)(i),s=l.get(u);void 0!==s&&c(t,s,r)}let l=t.rsc;f(l)&&(null===r?l.resolve(null):l.reject(r));let i=t.head;f(i)&&i.resolve(null)}let d=Symbol();function f(e){return e&&e.tag===d}function p(){let e,t;let r=new Promise((r,n)=>{e=r,t=n});return r.status="pending",r.resolve=t=>{"pending"===r.status&&(r.status="fulfilled",r.value=t,e(t))},r.reject=e=>{"pending"===r.status&&(r.status="rejected",r.reason=e,t(e))},r.tag=d,r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createPrefetchCacheKey",{enumerable:!0,get:function(){return l}});let n=r(8800),o=r(1369),a=r(5458);function l(e,t){let r=(0,a.createHrefFromUrl)(e,!1);return t&&!(0,o.pathHasPrefix)(r,t)?(0,n.addPathPrefix)(r,""+t+"%"):r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fastRefreshReducer",{enumerable:!0,get:function(){return n}}),r(5917),r(5458),r(9219),r(6571),r(4007),r(1206),r(1968),r(9489),r(6939);let n=function(e,t){return e};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3567:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"findHeadInCache",{enumerable:!0,get:function(){return o}});let n=r(3711);function o(e,t){return function e(t,r,o){if(0===Object.keys(r).length)return[t,o];for(let a in r){let[l,i]=r[a],u=t.parallelRoutes.get(a);if(!u)continue;let s=(0,n.createRouterCacheKey)(l),c=u.get(s);if(!c)continue;let d=e(c,i,o+"/"+s);if(d)return d}return null}(e,t,"")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9010:(e,t)=>{"use strict";function r(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return r}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4007:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{handleExternalUrl:function(){return b},navigateReducer:function(){return P}});let n=r(5917),o=r(5458),a=r(5322),l=r(3558),i=r(9219),u=r(9877),s=r(6571),c=r(4967),d=r(1206),f=r(1968),p=r(5011),g=r(4991),h=r(8959),_=r(9489),v=r(3940),y=(r(5111),r(2025));function b(e,t,r,n){return t.mpaNavigation=!0,t.canonicalUrl=r,t.pendingPush=n,t.scrollableSegments=void 0,(0,d.handleMutable)(e,t)}function m(e){let t=[],[r,n]=e;if(0===Object.keys(n).length)return[[r]];for(let[e,o]of Object.entries(n))for(let n of m(o))""===r?t.push([e,...n]):t.push([r,e,...n]);return t}let P=function(e,t){let{url:r,isExternalUrl:P,navigateType:S,shouldScroll:R}=t,O={},{hash:E}=r,x=(0,o.createHrefFromUrl)(r),T="push"===S;if((0,g.prunePrefetchCache)(e.prefetchCache),O.preserveCustomHistoryState=!1,P)return b(e,O,r.toString(),T);let j=(0,y.createPrefetchCacheKey)(r,e.nextUrl),M=e.prefetchCache.get(j);if(!M){let t={data:(0,n.fetchServerResponse)(r,e.tree,e.nextUrl,e.buildId,void 0),kind:c.PrefetchKind.TEMPORARY,prefetchTime:Date.now(),treeAtTimeOfPrefetch:e.tree,lastUsedTime:null};e.prefetchCache.set(j,t),M=t}let C=(0,p.getPrefetchEntryCacheStatus)(M),{treeAtTimeOfPrefetch:N,data:A}=M;return h.prefetchQueue.bump(A),A.then(t=>{let[c,g,h]=t;if(M&&!M.lastUsedTime&&(M.lastUsedTime=Date.now()),"string"==typeof c)return b(e,O,c,T);let y=e.tree,P=e.cache,S=[];for(let t of c){let o=t.slice(0,-4),c=t.slice(-3)[0],d=["",...o],g=(0,i.applyRouterStatePatchToTreeSkipDefault)(d,y,c);if(null===g&&(g=(0,i.applyRouterStatePatchToTreeSkipDefault)(d,N,c)),null!==g){if((0,s.isNavigatingToNewRootLayout)(y,g))return b(e,O,x,T);let i=(0,_.createEmptyCacheNode)(),R=(0,f.applyFlightData)(P,i,t,(null==M?void 0:M.kind)==="auto"&&C===p.PrefetchCacheEntryStatus.reusable);for(let t of((!R&&C===p.PrefetchCacheEntryStatus.stale||h)&&(R=function(e,t,r,n,o){let a=!1;for(let i of(e.rsc=t.rsc,e.prefetchRsc=t.prefetchRsc,e.parallelRoutes=new Map(t.parallelRoutes),m(n).map(e=>[...r,...e])))(0,l.fillCacheWithDataProperty)(e,t,i,o),a=!0;return a}(i,P,o,c,()=>(0,n.fetchServerResponse)(r,y,e.nextUrl,e.buildId))),(0,u.shouldHardNavigate)(d,y)?(i.rsc=P.rsc,i.prefetchRsc=P.prefetchRsc,(0,a.invalidateCacheBelowFlightSegmentPath)(i,P,o),O.cache=i):R&&(O.cache=i),P=i,y=g,m(c))){let e=[...o,...t];e[e.length-1]!==v.DEFAULT_SEGMENT_KEY&&S.push(e)}}}return O.patchedTree=y,O.canonicalUrl=g?(0,o.createHrefFromUrl)(g):x,O.pendingPush=T,O.scrollableSegments=S,O.hashFragment=E,O.shouldScroll=R,(0,d.handleMutable)(e,O)},()=>e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{prefetchQueue:function(){return s},prefetchReducer:function(){return c}});let n=r(5917),o=r(4967),a=r(4991),l=r(2848),i=r(5808),u=r(2025),s=new i.PromiseQueue(5);function c(e,t){(0,a.prunePrefetchCache)(e.prefetchCache);let{url:r}=t;r.searchParams.delete(l.NEXT_RSC_UNION_QUERY);let i=(0,u.createPrefetchCacheKey)(r,e.nextUrl),c=e.prefetchCache.get(i);if(c&&(c.kind===o.PrefetchKind.TEMPORARY&&e.prefetchCache.set(i,{...c,kind:t.kind}),!(c.kind===o.PrefetchKind.AUTO&&t.kind===o.PrefetchKind.FULL)))return e;let d=s.enqueue(()=>(0,n.fetchServerResponse)(r,e.tree,e.nextUrl,e.buildId,t.kind));return e.prefetchCache.set(i,{treeAtTimeOfPrefetch:e.tree,data:d,kind:t.kind,prefetchTime:Date.now(),lastUsedTime:null}),e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"prunePrefetchCache",{enumerable:!0,get:function(){return o}});let n=r(5011);function o(e){for(let[t,r]of e)(0,n.getPrefetchEntryCacheStatus)(r)===n.PrefetchCacheEntryStatus.expired&&e.delete(t)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"refreshReducer",{enumerable:!0,get:function(){return f}});let n=r(5917),o=r(5458),a=r(9219),l=r(6571),i=r(4007),u=r(1206),s=r(1678),c=r(9489),d=r(6939);function f(e,t){let{origin:r}=t,f={},p=e.canonicalUrl,g=e.tree;f.preserveCustomHistoryState=!1;let h=(0,c.createEmptyCacheNode)();return h.lazyData=(0,n.fetchServerResponse)(new URL(p,r),[g[0],g[1],g[2],"refetch"],e.nextUrl,e.buildId),h.lazyData.then(r=>{let[n,c]=r;if("string"==typeof n)return(0,i.handleExternalUrl)(e,f,n,e.pushRef.pendingPush);for(let r of(h.lazyData=null,n)){if(3!==r.length)return console.log("REFRESH FAILED"),e;let[n]=r,u=(0,a.applyRouterStatePatchToFullTree)([""],g,n);if(null===u)return(0,d.handleSegmentMismatch)(e,t,n);if((0,l.isNavigatingToNewRootLayout)(g,u))return(0,i.handleExternalUrl)(e,f,p,e.pushRef.pendingPush);let _=c?(0,o.createHrefFromUrl)(c):void 0;c&&(f.canonicalUrl=_);let[v,y]=r.slice(-2);if(null!==v){let e=v[2];h.rsc=e,h.prefetchRsc=null,(0,s.fillLazyItemsTillLeafWithHead)(h,void 0,n,v,y),f.cache=h,f.prefetchCache=new Map}f.patchedTree=u,f.canonicalUrl=p,g=u}return(0,u.handleMutable)(e,f)},()=>e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"restoreReducer",{enumerable:!0,get:function(){return a}});let n=r(5458),o=r(1545);function a(e,t){var r;let{url:a,tree:l}=t,i=(0,n.createHrefFromUrl)(a),u=e.cache;return{buildId:e.buildId,canonicalUrl:i,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:e.focusAndScrollRef,cache:u,prefetchCache:e.prefetchCache,tree:l,nextUrl:null!=(r=(0,o.extractPathFromFlightRouterState)(l))?r:a.pathname}}r(5111),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8229:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverActionReducer",{enumerable:!0,get:function(){return y}});let n=r(2641),o=r(2848),a=r(9517),l=r(5458),i=r(4007),u=r(9219),s=r(6571),c=r(1206),d=r(1678),f=r(9489),p=r(1545),g=r(6939),{createFromFetch:h,encodeReply:_}=r(5492);async function v(e,t){let r,{actionId:l,actionArgs:i}=t,u=await _(i),s=(0,p.extractPathFromFlightRouterState)(e.tree),c=e.nextUrl&&e.nextUrl!==s,d=await fetch("",{method:"POST",headers:{Accept:o.RSC_CONTENT_TYPE_HEADER,[o.ACTION]:l,[o.NEXT_ROUTER_STATE_TREE]:encodeURIComponent(JSON.stringify(e.tree)),...c?{[o.NEXT_URL]:e.nextUrl}:{}},body:u}),f=d.headers.get("x-action-redirect");try{let e=JSON.parse(d.headers.get("x-action-revalidated")||"[[],0,0]");r={paths:e[0]||[],tag:!!e[1],cookie:e[2]}}catch(e){r={paths:[],tag:!1,cookie:!1}}let g=f?new URL((0,a.addBasePath)(f),new URL(e.canonicalUrl,window.location.href)):void 0;if(d.headers.get("content-type")===o.RSC_CONTENT_TYPE_HEADER){let e=await h(Promise.resolve(d),{callServer:n.callServer});if(f){let[,t]=null!=e?e:[];return{actionFlightData:t,redirectLocation:g,revalidatedParts:r}}let[t,[,o]]=null!=e?e:[];return{actionResult:t,actionFlightData:o,redirectLocation:g,revalidatedParts:r}}return{redirectLocation:g,revalidatedParts:r}}function y(e,t){let{resolve:r,reject:n}=t,o={},a=e.canonicalUrl,p=e.tree;return o.preserveCustomHistoryState=!1,o.inFlightServerAction=v(e,t),o.inFlightServerAction.then(n=>{let{actionResult:h,actionFlightData:_,redirectLocation:v}=n;if(v&&(e.pushRef.pendingPush=!0,o.pendingPush=!0),!_)return(o.actionResultResolved||(r(h),o.actionResultResolved=!0),v)?(0,i.handleExternalUrl)(e,o,v.href,e.pushRef.pendingPush):e;if("string"==typeof _)return(0,i.handleExternalUrl)(e,o,_,e.pushRef.pendingPush);for(let r of(o.inFlightServerAction=null,_)){if(3!==r.length)return console.log("SERVER ACTION APPLY FAILED"),e;let[n]=r,l=(0,u.applyRouterStatePatchToFullTree)([""],p,n);if(null===l)return(0,g.handleSegmentMismatch)(e,t,n);if((0,s.isNavigatingToNewRootLayout)(p,l))return(0,i.handleExternalUrl)(e,o,a,e.pushRef.pendingPush);let[c,h]=r.slice(-2),_=null!==c?c[2]:null;if(null!==_){let e=(0,f.createEmptyCacheNode)();e.rsc=_,e.prefetchRsc=null,(0,d.fillLazyItemsTillLeafWithHead)(e,void 0,n,c,h),o.cache=e,o.prefetchCache=new Map}o.patchedTree=l,o.canonicalUrl=a,p=l}if(v){let e=(0,l.createHrefFromUrl)(v,!1);o.canonicalUrl=e}return o.actionResultResolved||(r(h),o.actionResultResolved=!0),(0,c.handleMutable)(e,o)},t=>{if("rejected"===t.status)return o.actionResultResolved||(n(t.reason),o.actionResultResolved=!0),e;throw t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverPatchReducer",{enumerable:!0,get:function(){return d}});let n=r(5458),o=r(9219),a=r(6571),l=r(4007),i=r(1968),u=r(1206),s=r(9489),c=r(6939);function d(e,t){let{flightData:r,overrideCanonicalUrl:d}=t,f={};if(f.preserveCustomHistoryState=!1,"string"==typeof r)return(0,l.handleExternalUrl)(e,f,r,e.pushRef.pendingPush);let p=e.tree,g=e.cache;for(let u of r){let r=u.slice(0,-4),[h]=u.slice(-3,-2),_=(0,o.applyRouterStatePatchToTreeSkipDefault)(["",...r],p,h);if(null===_)return(0,c.handleSegmentMismatch)(e,t,h);if((0,a.isNavigatingToNewRootLayout)(p,_))return(0,l.handleExternalUrl)(e,f,e.canonicalUrl,e.pushRef.pendingPush);let v=d?(0,n.createHrefFromUrl)(d):void 0;v&&(f.canonicalUrl=v);let y=(0,s.createEmptyCacheNode)();(0,i.applyFlightData)(g,y,u),f.patchedTree=_,f.cache=y,g=y,p=_}return(0,u.handleMutable)(e,f)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4967:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PrefetchKind:function(){return r},ACTION_REFRESH:function(){return n},ACTION_NAVIGATE:function(){return o},ACTION_RESTORE:function(){return a},ACTION_SERVER_PATCH:function(){return l},ACTION_PREFETCH:function(){return i},ACTION_FAST_REFRESH:function(){return u},ACTION_SERVER_ACTION:function(){return s},isThenable:function(){return c}});let n="refresh",o="navigate",a="restore",l="server-patch",i="prefetch",u="fast-refresh",s="server-action";function c(e){return e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}(function(e){e.AUTO="auto",e.FULL="full",e.TEMPORARY="temporary"})(r||(r={})),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reducer",{enumerable:!0,get:function(){return n}}),r(4967),r(4007),r(445),r(4072),r(427),r(8959),r(4814),r(8229);let n=function(e,t){return e};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"shouldHardNavigate",{enumerable:!0,get:function(){return function e(t,r){let[o,a]=r,[l,i]=t;return(0,n.matchSegment)(l,o)?!(t.length<=2)&&e(t.slice(2),a[i]):!!Array.isArray(l)}}});let n=r(7666);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createSearchParamsBailoutProxy",{enumerable:!0,get:function(){return o}});let n=r(3634);function o(){return new Proxy({},{get(e,t){"string"==typeof t&&(0,n.staticGenerationBailout)("searchParams."+t)}})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3634:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isStaticGenBailoutError:function(){return i},staticGenerationBailout:function(){return s}});let n=r(999),o=r(4749),a="NEXT_STATIC_GEN_BAILOUT";class l extends Error{constructor(...e){super(...e),this.code=a}}function i(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===a}function u(e,t){let{dynamic:r,link:n}=t||{};return"Page"+(r?' with `dynamic = "'+r+'"`':"")+" couldn't be rendered statically because it used `"+e+"`."+(n?" See more info here: "+n:"")}let s=(e,t)=>{let{dynamic:r,link:a}=void 0===t?{}:t,i=o.staticGenerationAsyncStorage.getStore();if(!i)return!1;if(i.forceStatic)return!0;if(i.dynamicShouldError)throw new l(u(e,{link:a,dynamic:null!=r?r:"error"}));let s=u(e,{dynamic:r,link:"https://nextjs.org/docs/messages/dynamic-server-error"});if(null==i.postpone||i.postpone.call(i,e),i.revalidate=0,i.isStaticGeneration){let t=new n.DynamicServerError(s);throw i.dynamicUsageDescription=e,i.dynamicUsageStack=t.stack,t}return!1};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}}),r(3444);let n=r(7685);r(3810);let o=r(9523);function a(e){let{Component:t,propsForComponent:r,isStaticGeneration:a}=e;if(a){let e=(0,o.createSearchParamsBailoutProxy)();return(0,n.jsx)(t,{searchParams:e,...r})}return(0,n.jsx)(t,{...r})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{useUnwrapState:function(){return l},useReducerWithReduxDevtools:function(){return i}});let n=r(4816)._(r(3810)),o=r(4967);function a(e){if(e instanceof Map){let t={};for(let[r,n]of e.entries()){if("function"==typeof n){t[r]="fn()";continue}if("object"==typeof n&&null!==n){if(n.$$typeof){t[r]=n.$$typeof.toString();continue}if(n._bundlerConfig){t[r]="FlightData";continue}}t[r]=a(n)}return t}if("object"==typeof e&&null!==e){let t={};for(let r in e){let n=e[r];if("function"==typeof n){t[r]="fn()";continue}if("object"==typeof n&&null!==n){if(n.$$typeof){t[r]=n.$$typeof.toString();continue}if(n.hasOwnProperty("_bundlerConfig")){t[r]="FlightData";continue}}t[r]=a(n)}return t}return Array.isArray(e)?e.map(a):e}function l(e){return(0,o.isThenable)(e)?(0,n.use)(e):e}r(3240);let i=function(e){return[e,()=>{},()=>{}]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return o}});let n=r(1369);function o(e){return(0,n.pathHasPrefix)(e,"")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7294:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return a}});let n=r(3370),o=r(8032),a=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:r,hash:a}=(0,o.parsePath)(e);return""+(0,n.removeTrailingSlash)(t)+r+a};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5084:(e,t,r)=>{"use strict";function n(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return n}}),r(8977),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentParam",{enumerable:!0,get:function(){return o}});let n=r(494);function o(e){let t=n.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t));return(t&&(e=e.slice(t.length)),e.startsWith("[[...")&&e.endsWith("]]"))?{type:"optional-catchall",param:e.slice(5,-2)}:e.startsWith("[...")&&e.endsWith("]")?{type:"catchall",param:e.slice(4,-1)}:e.startsWith("[")&&e.endsWith("]")?{type:"dynamic",param:e.slice(1,-1)}:null}},494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return o},isInterceptionRouteAppPath:function(){return a},extractInterceptionRouteInformation:function(){return l}});let n=r(590),o=["(..)(..)","(.)","(..)","(...)"];function a(e){return void 0!==e.split("/").find(e=>o.find(t=>e.startsWith(t)))}function l(e){let t,r,a;for(let n of e.split("/"))if(r=o.find(e=>n.startsWith(e))){[t,a]=e.split(r,2);break}if(!t||!r||!a)throw Error(`Invalid interception route: ${e}. Must be in the format //(..|...|..)(..)/`);switch(t=(0,n.normalizeAppPath)(t),r){case"(.)":a="/"===t?`/${a}`:t+"/"+a;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);a=t.split("/").slice(0,-1).concat(a).join("/");break;case"(...)":a="/"+a;break;case"(..)(..)":let l=t.split("/");if(l.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);a=l.slice(0,-2).concat(a).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:a}}},943:(e,t,r)=>{"use strict";e.exports=r(399)},7874:(e,t,r)=>{"use strict";e.exports=r(943).vendored.contexts.AppRouterContext},7321:(e,t,r)=>{"use strict";e.exports=r(943).vendored.contexts.HooksClientContext},7932:(e,t,r)=>{"use strict";e.exports=r(943).vendored.contexts.ServerInsertedHtml},914:(e,t,r)=>{"use strict";e.exports=r(943).vendored["react-ssr"].ReactDOM},7685:(e,t,r)=>{"use strict";e.exports=r(943).vendored["react-ssr"].ReactJsxRuntime},5492:(e,t,r)=>{"use strict";e.exports=r(943).vendored["react-ssr"].ReactServerDOMWebpackClientEdge},3810:(e,t,r)=>{"use strict";e.exports=r(943).vendored["react-ssr"].React},8467:(e,t)=>{"use strict";function r(e){let t=5381;for(let r=0;r>>0}function n(e){return r(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{djb2Hash:function(){return r},hexHash:function(){return n}})},2768:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{BailoutToCSRError:function(){return n},isBailoutToCSRError:function(){return o}});let r="BAILOUT_TO_CLIENT_SIDE_RENDERING";class n extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=r}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===r}},8699:(e,t)=>{"use strict";function r(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return r}})},3240:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ActionQueueContext:function(){return i},createMutableActionQueue:function(){return c}});let n=r(4816),o=r(4967),a=r(6417),l=n._(r(3810)),i=l.default.createContext(null);function u(e,t){null!==e.pending&&(e.pending=e.pending.next,null!==e.pending&&s({actionQueue:e,action:e.pending,setState:t}))}async function s(e){let{actionQueue:t,action:r,setState:n}=e,a=t.state;if(!a)throw Error("Invariant: Router state not initialized");t.pending=r;let l=r.payload,i=t.action(a,l);function s(e){if(r.discarded){t.needsRefresh&&null===t.pending&&(t.needsRefresh=!1,t.dispatch({type:o.ACTION_REFRESH,origin:window.location.origin},n));return}t.state=e,t.devToolsInstance&&t.devToolsInstance.send(l,e),u(t,n),r.resolve(e)}(0,o.isThenable)(i)?i.then(s,e=>{u(t,n),r.reject(e)}):s(i)}function c(){let e={state:null,dispatch:(t,r)=>(function(e,t,r){let n={resolve:r,reject:()=>{}};if(t.type!==o.ACTION_RESTORE){let e=new Promise((e,t)=>{n={resolve:e,reject:t}});(0,l.startTransition)(()=>{r(e)})}let a={payload:t,next:null,resolve:n.resolve,reject:n.reject};null===e.pending?(e.last=a,s({actionQueue:e,action:a,setState:r})):t.type===o.ACTION_NAVIGATE?(e.pending.discarded=!0,e.last=a,e.pending.payload.type===o.ACTION_SERVER_ACTION&&(e.needsRefresh=!0),s({actionQueue:e,action:a,setState:r})):(null!==e.last&&(e.last.next=a),e.last=a)})(e,t,r),action:async(e,t)=>{if(null===e)throw Error("Invariant: Router state not initialized");return(0,a.reducer)(e,t)},pending:null,last:null};return e}},8800:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return o}});let n=r(8032);function o(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:o,hash:a}=(0,n.parsePath)(e);return""+t+r+o+a}},590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{normalizeAppPath:function(){return a},normalizeRscURL:function(){return l}});let n=r(8699),o=r(3940);function a(e){return(0,n.ensureLeadingSlash)(e.split("/").reduce((e,t,r,n)=>!t||(0,o.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t,""))}function l(e){return e.replace(/\.rsc($|\?)/,"$1")}},3848:(e,t)=>{"use strict";function r(e,t){if(void 0===t&&(t={}),t.onlyHashChange){e();return}let r=document.documentElement,n=r.style.scrollBehavior;r.style.scrollBehavior="auto",t.dontForceLayout||r.getClientRects(),e(),r.style.scrollBehavior=n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return r}})},8866:(e,t)=>{"use strict";function r(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)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return r}})},8032:(e,t)=>{"use strict";function r(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return r}})},1369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return o}});let n=r(8032);function o(e,t){if("string"!=typeof e)return!1;let{pathname:r}=(0,n.parsePath)(e);return r===t||r.startsWith(t+"/")}},3370:(e,t)=>{"use strict";function r(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return r}})},3940:(e,t)=>{"use strict";function r(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isGroupSegment:function(){return r},PAGE_SEGMENT_KEY:function(){return n},DEFAULT_SEGMENT_KEY:function(){return o}});let n="__PAGE__",o="__DEFAULT__"},4586:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},8205:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u,metadata:()=>l,runtime:()=>i});var n=r(6491),o=r(1608),a=r.n(o);r(1603);let l={title:"Create T3 App",description:"Generated by create-t3-app",icons:[{rel:"icon",url:"/favicon.ico"}]},i="edge";function u({children:e}){return n.jsx("html",{lang:"en",children:n.jsx("body",{className:`font-sans ${a().variable}`,children:e})})}},3181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{prefixes:function(){return o},bootstrap:function(){return i},wait:function(){return u},error:function(){return s},warn:function(){return c},ready:function(){return d},info:function(){return f},event:function(){return p},trace:function(){return g},warnOnce:function(){return _}});let n=r(2761),o={wait:(0,n.white)((0,n.bold)("○")),error:(0,n.red)((0,n.bold)("⨯")),warn:(0,n.yellow)((0,n.bold)("⚠")),ready:"▲",info:(0,n.white)((0,n.bold)(" ")),event:(0,n.green)((0,n.bold)("✓")),trace:(0,n.magenta)((0,n.bold)("\xbb"))},a={log:"log",warn:"warn",error:"error"};function l(e,...t){(""===t[0]||void 0===t[0])&&1===t.length&&t.shift();let r=e in a?a[e]:"log",n=o[e];0===t.length?console[r](""):console[r](" "+n,...t)}function i(...e){console.log(" ",...e)}function u(...e){l("wait",...e)}function s(...e){l("error",...e)}function c(...e){l("warn",...e)}function d(...e){l("ready",...e)}function f(...e){l("info",...e)}function p(...e){l("event",...e)}function g(...e){l("trace",...e)}let h=new Set;function _(...e){h.has(e[0])||(h.add(e.join(" ")),c(...e))}},599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createProxy",{enumerable:!0,get:function(){return n}});let n=r(8187).createClientModuleProxy},8019:(e,t,r)=>{"use strict";let{createProxy:n}=r(599);e.exports=n("/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/app-router.js")},6580:(e,t,r)=>{"use strict";let{createProxy:n}=r(599);e.exports=n("/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/error-boundary.js")},9625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DynamicServerError:function(){return n},isDynamicServerError:function(){return o}});let r="DYNAMIC_SERVER_USAGE";class n extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=r}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9363:(e,t,r)=>{"use strict";let{createProxy:n}=r(599);e.exports=n("/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/layout-router.js")},4860:(e,t,r)=>{"use strict";let{createProxy:n}=r(599);e.exports=n("/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/not-found-boundary.js")},3250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}}),r(2274);let n=r(6491);r(1367);let o={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};function a(){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("title",{children:"404: This page could not be found."}),(0,n.jsx)("div",{style:o.error,children:(0,n.jsxs)("div",{children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,n.jsx)("h1",{className:"next-error-h1",style:o.h1,children:"404"}),(0,n.jsx)("div",{style:o.desc,children:(0,n.jsx)("h2",{style:o.h2,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},277:(e,t,r)=>{"use strict";let{createProxy:n}=r(599);e.exports=n("/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/render-from-template-context.js")},288:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createSearchParamsBailoutProxy",{enumerable:!0,get:function(){return o}});let n=r(2936);function o(){return new Proxy({},{get(e,t){"string"==typeof t&&(0,n.staticGenerationBailout)("searchParams."+t)}})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isStaticGenBailoutError:function(){return i},staticGenerationBailout:function(){return s}});let n=r(9625),o=r(5869),a="NEXT_STATIC_GEN_BAILOUT";class l extends Error{constructor(...e){super(...e),this.code=a}}function i(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===a}function u(e,t){let{dynamic:r,link:n}=t||{};return"Page"+(r?' with `dynamic = "'+r+'"`':"")+" couldn't be rendered statically because it used `"+e+"`."+(n?" See more info here: "+n:"")}let s=(e,t)=>{let{dynamic:r,link:a}=void 0===t?{}:t,i=o.staticGenerationAsyncStorage.getStore();if(!i)return!1;if(i.forceStatic)return!0;if(i.dynamicShouldError)throw new l(u(e,{link:a,dynamic:null!=r?r:"error"}));let s=u(e,{dynamic:r,link:"https://nextjs.org/docs/messages/dynamic-server-error"});if(null==i.postpone||i.postpone.call(i,e),i.revalidate=0,i.isStaticGeneration){let t=new n.DynamicServerError(s);throw i.dynamicUsageDescription=e,i.dynamicUsageStack=t.stack,t}return!1};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9279:(e,t,r)=>{"use strict";let{createProxy:n}=r(599);e.exports=n("/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/static-generation-searchparams-bailout-provider.js")},1405:e=>{"use strict";(()=>{var t={491:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;let n=r(223),o=r(172),a=r(930),l="context",i=new n.NoopContextManager;class u{constructor(){}static getInstance(){return this._instance||(this._instance=new u),this._instance}setGlobalContextManager(e){return(0,o.registerGlobal)(l,e,a.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,r,...n){return this._getContextManager().with(e,t,r,...n)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,o.getGlobal)(l)||i}disable(){this._getContextManager().disable(),(0,o.unregisterGlobal)(l,a.DiagAPI.instance())}}t.ContextAPI=u},930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;let n=r(56),o=r(912),a=r(957),l=r(172);class i{constructor(){function e(e){return function(...t){let r=(0,l.getGlobal)("diag");if(r)return r[e](...t)}}let t=this;t.setLogger=(e,r={logLevel:a.DiagLogLevel.INFO})=>{var n,i,u;if(e===t){let e=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(n=e.stack)&&void 0!==n?n:e.message),!1}"number"==typeof r&&(r={logLevel:r});let s=(0,l.getGlobal)("diag"),c=(0,o.createLogLevelDiagLogger)(null!==(i=r.logLevel)&&void 0!==i?i:a.DiagLogLevel.INFO,e);if(s&&!r.suppressOverrideMessage){let e=null!==(u=Error().stack)&&void 0!==u?u:"";s.warn(`Current logger will be overwritten from ${e}`),c.warn(`Current logger will overwrite one already registered from ${e}`)}return(0,l.registerGlobal)("diag",c,t,!0)},t.disable=()=>{(0,l.unregisterGlobal)("diag",t)},t.createComponentLogger=e=>new n.DiagComponentLogger(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}static instance(){return this._instance||(this._instance=new i),this._instance}}t.DiagAPI=i},653:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;let n=r(660),o=r(172),a=r(930),l="metrics";class i{constructor(){}static getInstance(){return this._instance||(this._instance=new i),this._instance}setGlobalMeterProvider(e){return(0,o.registerGlobal)(l,e,a.DiagAPI.instance())}getMeterProvider(){return(0,o.getGlobal)(l)||n.NOOP_METER_PROVIDER}getMeter(e,t,r){return this.getMeterProvider().getMeter(e,t,r)}disable(){(0,o.unregisterGlobal)(l,a.DiagAPI.instance())}}t.MetricsAPI=i},181:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;let n=r(172),o=r(874),a=r(194),l=r(277),i=r(369),u=r(930),s="propagation",c=new o.NoopTextMapPropagator;class d{constructor(){this.createBaggage=i.createBaggage,this.getBaggage=l.getBaggage,this.getActiveBaggage=l.getActiveBaggage,this.setBaggage=l.setBaggage,this.deleteBaggage=l.deleteBaggage}static getInstance(){return this._instance||(this._instance=new d),this._instance}setGlobalPropagator(e){return(0,n.registerGlobal)(s,e,u.DiagAPI.instance())}inject(e,t,r=a.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,r)}extract(e,t,r=a.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,r)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,n.unregisterGlobal)(s,u.DiagAPI.instance())}_getGlobalPropagator(){return(0,n.getGlobal)(s)||c}}t.PropagationAPI=d},997:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;let n=r(172),o=r(846),a=r(139),l=r(607),i=r(930),u="trace";class s{constructor(){this._proxyTracerProvider=new o.ProxyTracerProvider,this.wrapSpanContext=a.wrapSpanContext,this.isSpanContextValid=a.isSpanContextValid,this.deleteSpan=l.deleteSpan,this.getSpan=l.getSpan,this.getActiveSpan=l.getActiveSpan,this.getSpanContext=l.getSpanContext,this.setSpan=l.setSpan,this.setSpanContext=l.setSpanContext}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalTracerProvider(e){let t=(0,n.registerGlobal)(u,this._proxyTracerProvider,i.DiagAPI.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return(0,n.getGlobal)(u)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,n.unregisterGlobal)(u,i.DiagAPI.instance()),this._proxyTracerProvider=new o.ProxyTracerProvider}}t.TraceAPI=s},277:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;let n=r(491),o=(0,r(780).createContextKey)("OpenTelemetry Baggage Key");function a(e){return e.getValue(o)||void 0}t.getBaggage=a,t.getActiveBaggage=function(){return a(n.ContextAPI.getInstance().active())},t.setBaggage=function(e,t){return e.setValue(o,t)},t.deleteBaggage=function(e){return e.deleteValue(o)}},993:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class r{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map(([e,t])=>[e,t])}setEntry(e,t){let n=new r(this._entries);return n._entries.set(e,t),n}removeEntry(e){let t=new r(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new r(this._entries);for(let r of e)t._entries.delete(r);return t}clear(){return new r}}t.BaggageImpl=r},830:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")},369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;let n=r(930),o=r(993),a=r(830),l=n.DiagAPI.instance();t.createBaggage=function(e={}){return new o.BaggageImpl(new Map(Object.entries(e)))},t.baggageEntryMetadataFromString=function(e){return"string"!=typeof e&&(l.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:a.baggageEntryMetadataSymbol,toString:()=>e}}},67:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;let n=r(491);t.context=n.ContextAPI.getInstance()},223:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;let n=r(780);class o{active(){return n.ROOT_CONTEXT}with(e,t,r,...n){return t.call(r,...n)}bind(e,t){return t}enable(){return this}disable(){return this}}t.NoopContextManager=o},780:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0,t.createContextKey=function(e){return Symbol.for(e)};class r{constructor(e){let t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{let o=new r(t._currentContext);return o._currentContext.set(e,n),o},t.deleteValue=e=>{let n=new r(t._currentContext);return n._currentContext.delete(e),n}}}t.ROOT_CONTEXT=new r},506:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;let n=r(930);t.diag=n.DiagAPI.instance()},56:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;let n=r(172);class o{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return a("debug",this._namespace,e)}error(...e){return a("error",this._namespace,e)}info(...e){return a("info",this._namespace,e)}warn(...e){return a("warn",this._namespace,e)}verbose(...e){return a("verbose",this._namespace,e)}}function a(e,t,r){let o=(0,n.getGlobal)("diag");if(o)return r.unshift(t),o[e](...r)}t.DiagComponentLogger=o},972:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;let r=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class n{constructor(){for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;let n=r(957);t.createLogLevelDiagLogger=function(e,t){function r(r,n){let o=t[r];return"function"==typeof o&&e>=n?o.bind(t):function(){}}return en.DiagLogLevel.ALL&&(e=n.DiagLogLevel.ALL),t=t||{},{error:r("error",n.DiagLogLevel.ERROR),warn:r("warn",n.DiagLogLevel.WARN),info:r("info",n.DiagLogLevel.INFO),debug:r("debug",n.DiagLogLevel.DEBUG),verbose:r("verbose",n.DiagLogLevel.VERBOSE)}}},957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0,function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(t.DiagLogLevel||(t.DiagLogLevel={}))},172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;let n=r(200),o=r(521),a=r(130),l=o.VERSION.split(".")[0],i=Symbol.for(`opentelemetry.js.api.${l}`),u=n._globalThis;t.registerGlobal=function(e,t,r,n=!1){var a;let l=u[i]=null!==(a=u[i])&&void 0!==a?a:{version:o.VERSION};if(!n&&l[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(l.version!==o.VERSION){let t=Error(`@opentelemetry/api: Registration of version v${l.version} for ${e} does not match previously registered API v${o.VERSION}`);return r.error(t.stack||t.message),!1}return l[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${o.VERSION}.`),!0},t.getGlobal=function(e){var t,r;let n=null===(t=u[i])||void 0===t?void 0:t.version;if(n&&(0,a.isCompatible)(n))return null===(r=u[i])||void 0===r?void 0:r[e]},t.unregisterGlobal=function(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${o.VERSION}.`);let r=u[i];r&&delete r[e]}},130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;let n=r(521),o=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function a(e){let t=new Set([e]),r=new Set,n=e.match(o);if(!n)return()=>!1;let a={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=a.prerelease)return function(t){return t===e};function l(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;let n=e.match(o);if(!n)return l(e);let i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};return null!=i.prerelease||a.major!==i.major?l(e):0===a.major?a.minor===i.minor&&a.patch<=i.patch?(t.add(e),!0):l(e):a.minor<=i.minor?(t.add(e),!0):l(e)}}t._makeCompatibilityCheck=a,t.isCompatible=a(n.VERSION)},886:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;let n=r(653);t.metrics=n.MetricsAPI.getInstance()},901:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0,function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"}(t.ValueType||(t.ValueType={}))},102:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class r{constructor(){}createHistogram(e,r){return t.NOOP_HISTOGRAM_METRIC}createCounter(e,r){return t.NOOP_COUNTER_METRIC}createUpDownCounter(e,r){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,r){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,r){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,r){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}t.NoopMeter=r;class n{}t.NoopMetric=n;class o extends n{add(e,t){}}t.NoopCounterMetric=o;class a extends n{add(e,t){}}t.NoopUpDownCounterMetric=a;class l extends n{record(e,t){}}t.NoopHistogramMetric=l;class i{addCallback(e){}removeCallback(e){}}t.NoopObservableMetric=i;class u extends i{}t.NoopObservableCounterMetric=u;class s extends i{}t.NoopObservableGaugeMetric=s;class c extends i{}t.NoopObservableUpDownCounterMetric=c,t.NOOP_METER=new r,t.NOOP_COUNTER_METRIC=new o,t.NOOP_HISTOGRAM_METRIC=new l,t.NOOP_UP_DOWN_COUNTER_METRIC=new a,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new s,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new c,t.createNoopMeter=function(){return t.NOOP_METER}},660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;let n=r(102);class o{getMeter(e,t,r){return n.NOOP_METER}}t.NoopMeterProvider=o,t.NOOP_METER_PROVIDER=new o},200:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(46),t)},651:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis="object"==typeof globalThis?globalThis:global},46:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(651),t)},939:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;let n=r(181);t.propagation=n.PropagationAPI.getInstance()},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0;class r{inject(e,t){}extract(e,t){return e}fields(){return[]}}t.NoopTextMapPropagator=r},194:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},t.defaultTextMapSetter={set(e,t,r){null!=e&&(e[t]=r)}}},845:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;let n=r(997);t.trace=n.TraceAPI.getInstance()},403:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;let n=r(476);class o{constructor(e=n.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}t.NonRecordingSpan=o},614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;let n=r(491),o=r(607),a=r(403),l=r(139),i=n.ContextAPI.getInstance();class u{startSpan(e,t,r=i.active()){if(null==t?void 0:t.root)return new a.NonRecordingSpan;let n=r&&(0,o.getSpanContext)(r);return"object"==typeof n&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&(0,l.isSpanContextValid)(n)?new a.NonRecordingSpan(n):new a.NonRecordingSpan}startActiveSpan(e,t,r,n){let a,l,u;if(arguments.length<2)return;2==arguments.length?u=t:3==arguments.length?(a=t,u=r):(a=t,l=r,u=n);let s=null!=l?l:i.active(),c=this.startSpan(e,a,s),d=(0,o.setSpan)(s,c);return i.with(d,u,void 0,c)}}t.NoopTracer=u},124:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;let n=r(614);class o{getTracer(e,t,r){return new n.NoopTracer}}t.NoopTracerProvider=o},125:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;let n=new(r(614)).NoopTracer;class o{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}startSpan(e,t,r){return this._getTracer().startSpan(e,t,r)}startActiveSpan(e,t,r,n){let o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):n}}t.ProxyTracer=o},846:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;let n=r(125),o=new(r(124)).NoopTracerProvider;class a{getTracer(e,t,r){var o;return null!==(o=this.getDelegateTracer(e,t,r))&&void 0!==o?o:new n.ProxyTracer(this,e,t,r)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:o}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,r){var n;return null===(n=this._delegate)||void 0===n?void 0:n.getTracer(e,t,r)}}t.ProxyTracerProvider=a},996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0,function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(t.SamplingDecision||(t.SamplingDecision={}))},607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;let n=r(780),o=r(403),a=r(491),l=(0,n.createContextKey)("OpenTelemetry Context Key SPAN");function i(e){return e.getValue(l)||void 0}function u(e,t){return e.setValue(l,t)}t.getSpan=i,t.getActiveSpan=function(){return i(a.ContextAPI.getInstance().active())},t.setSpan=u,t.deleteSpan=function(e){return e.deleteValue(l)},t.setSpanContext=function(e,t){return u(e,new o.NonRecordingSpan(t))},t.getSpanContext=function(e){var t;return null===(t=i(e))||void 0===t?void 0:t.spanContext()}},325:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;let n=r(564);class o{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce((e,t)=>{let r=t.trim(),o=r.indexOf("=");if(-1!==o){let a=r.slice(0,o),l=r.slice(o+1,t.length);(0,n.validateKey)(a)&&(0,n.validateValue)(l)&&e.set(a,l)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new o;return e._internalState=new Map(this._internalState),e}}t.TraceStateImpl=o},564:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;let r="[_0-9a-z-*/]",n=`[a-z]${r}{0,255}`,o=`[a-z0-9]${r}{0,240}@[a-z]${r}{0,13}`,a=RegExp(`^(?:${n}|${o})$`),l=/^[ -~]{0,255}[!-~]$/,i=/,|=/;t.validateKey=function(e){return a.test(e)},t.validateValue=function(e){return l.test(e)&&!i.test(e)}},98:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;let n=r(325);t.createTraceState=function(e){return new n.TraceStateImpl(e)}},476:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;let n=r(475);t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:n.TraceFlags.NONE}},357:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0,function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(t.SpanKind||(t.SpanKind={}))},139:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;let n=r(476),o=r(403),a=/^([0-9a-f]{32})$/i,l=/^[0-9a-f]{16}$/i;function i(e){return a.test(e)&&e!==n.INVALID_TRACEID}function u(e){return l.test(e)&&e!==n.INVALID_SPANID}t.isValidTraceId=i,t.isValidSpanId=u,t.isSpanContextValid=function(e){return i(e.traceId)&&u(e.spanId)},t.wrapSpanContext=function(e){return new o.NonRecordingSpan(e)}},847:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0,function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(t.SpanStatusCode||(t.SpanStatusCode={}))},475:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0,function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(t.TraceFlags||(t.TraceFlags={}))},521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.6.0"}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}},l=!0;try{t[e].call(a.exports,a,a.exports,n),l=!1}finally{l&&delete r[e]}return a.exports}n.ab=__dirname+"/";var o={};(()=>{Object.defineProperty(o,"__esModule",{value:!0}),o.trace=o.propagation=o.metrics=o.diag=o.context=o.INVALID_SPAN_CONTEXT=o.INVALID_TRACEID=o.INVALID_SPANID=o.isValidSpanId=o.isValidTraceId=o.isSpanContextValid=o.createTraceState=o.TraceFlags=o.SpanStatusCode=o.SpanKind=o.SamplingDecision=o.ProxyTracerProvider=o.ProxyTracer=o.defaultTextMapSetter=o.defaultTextMapGetter=o.ValueType=o.createNoopMeter=o.DiagLogLevel=o.DiagConsoleLogger=o.ROOT_CONTEXT=o.createContextKey=o.baggageEntryMetadataFromString=void 0;var e=n(369);Object.defineProperty(o,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return e.baggageEntryMetadataFromString}});var t=n(780);Object.defineProperty(o,"createContextKey",{enumerable:!0,get:function(){return t.createContextKey}}),Object.defineProperty(o,"ROOT_CONTEXT",{enumerable:!0,get:function(){return t.ROOT_CONTEXT}});var r=n(972);Object.defineProperty(o,"DiagConsoleLogger",{enumerable:!0,get:function(){return r.DiagConsoleLogger}});var a=n(957);Object.defineProperty(o,"DiagLogLevel",{enumerable:!0,get:function(){return a.DiagLogLevel}});var l=n(102);Object.defineProperty(o,"createNoopMeter",{enumerable:!0,get:function(){return l.createNoopMeter}});var i=n(901);Object.defineProperty(o,"ValueType",{enumerable:!0,get:function(){return i.ValueType}});var u=n(194);Object.defineProperty(o,"defaultTextMapGetter",{enumerable:!0,get:function(){return u.defaultTextMapGetter}}),Object.defineProperty(o,"defaultTextMapSetter",{enumerable:!0,get:function(){return u.defaultTextMapSetter}});var s=n(125);Object.defineProperty(o,"ProxyTracer",{enumerable:!0,get:function(){return s.ProxyTracer}});var c=n(846);Object.defineProperty(o,"ProxyTracerProvider",{enumerable:!0,get:function(){return c.ProxyTracerProvider}});var d=n(996);Object.defineProperty(o,"SamplingDecision",{enumerable:!0,get:function(){return d.SamplingDecision}});var f=n(357);Object.defineProperty(o,"SpanKind",{enumerable:!0,get:function(){return f.SpanKind}});var p=n(847);Object.defineProperty(o,"SpanStatusCode",{enumerable:!0,get:function(){return p.SpanStatusCode}});var g=n(475);Object.defineProperty(o,"TraceFlags",{enumerable:!0,get:function(){return g.TraceFlags}});var h=n(98);Object.defineProperty(o,"createTraceState",{enumerable:!0,get:function(){return h.createTraceState}});var _=n(139);Object.defineProperty(o,"isSpanContextValid",{enumerable:!0,get:function(){return _.isSpanContextValid}}),Object.defineProperty(o,"isValidTraceId",{enumerable:!0,get:function(){return _.isValidTraceId}}),Object.defineProperty(o,"isValidSpanId",{enumerable:!0,get:function(){return _.isValidSpanId}});var v=n(476);Object.defineProperty(o,"INVALID_SPANID",{enumerable:!0,get:function(){return v.INVALID_SPANID}}),Object.defineProperty(o,"INVALID_TRACEID",{enumerable:!0,get:function(){return v.INVALID_TRACEID}}),Object.defineProperty(o,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return v.INVALID_SPAN_CONTEXT}});let y=n(67);Object.defineProperty(o,"context",{enumerable:!0,get:function(){return y.context}});let b=n(506);Object.defineProperty(o,"diag",{enumerable:!0,get:function(){return b.diag}});let m=n(886);Object.defineProperty(o,"metrics",{enumerable:!0,get:function(){return m.metrics}});let P=n(939);Object.defineProperty(o,"propagation",{enumerable:!0,get:function(){return P.propagation}});let S=n(845);Object.defineProperty(o,"trace",{enumerable:!0,get:function(){return S.trace}}),o.default={context:y.context,diag:b.diag,metrics:m.metrics,propagation:P.propagation,trace:S.trace}})(),e.exports=o})()},9226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{NEXT_QUERY_PARAM_PREFIX:function(){return r},PRERENDER_REVALIDATE_HEADER:function(){return n},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return o},RSC_PREFETCH_SUFFIX:function(){return a},RSC_SUFFIX:function(){return l},NEXT_DATA_SUFFIX:function(){return i},NEXT_META_SUFFIX:function(){return u},NEXT_BODY_SUFFIX:function(){return s},NEXT_CACHE_TAGS_HEADER:function(){return c},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return d},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return f},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return p},NEXT_CACHE_TAG_MAX_LENGTH:function(){return g},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return h},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return _},CACHE_ONE_YEAR:function(){return v},MIDDLEWARE_FILENAME:function(){return y},MIDDLEWARE_LOCATION_REGEXP:function(){return b},INSTRUMENTATION_HOOK_FILENAME:function(){return m},PAGES_DIR_ALIAS:function(){return P},DOT_NEXT_ALIAS:function(){return S},ROOT_DIR_ALIAS:function(){return R},APP_DIR_ALIAS:function(){return O},RSC_MOD_REF_PROXY_ALIAS:function(){return E},RSC_ACTION_VALIDATE_ALIAS:function(){return x},RSC_ACTION_PROXY_ALIAS:function(){return T},RSC_ACTION_ENCRYPTION_ALIAS:function(){return j},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return M},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return C},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return N},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return A},SERVER_PROPS_SSG_CONFLICT:function(){return w},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return I},SERVER_PROPS_EXPORT_ERROR:function(){return D},GSP_NO_RETURNED_VALUE:function(){return L},GSSP_NO_RETURNED_VALUE:function(){return U},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return F},GSSP_COMPONENT_MEMBER_ERROR:function(){return G},NON_STANDARD_NODE_ENV:function(){return H},SSG_FALLBACK_EXPORT_ERROR:function(){return B},ESLINT_DEFAULT_DIRS:function(){return V},ESLINT_PROMPT_VALUES:function(){return k},SERVER_RUNTIME:function(){return W},WEBPACK_LAYERS:function(){return K},WEBPACK_RESOURCE_QUERIES:function(){return $}});let r="nxtP",n="x-prerender-revalidate",o="x-prerender-revalidate-if-generated",a=".prefetch.rsc",l=".rsc",i=".json",u=".meta",s=".body",c="x-next-cache-tags",d="x-next-cache-soft-tags",f="x-next-revalidated-tags",p="x-next-revalidate-tag-token",g=256,h=1024,_="_N_T_",v=31536e3,y="middleware",b=`(?:src/)?${y}`,m="instrumentation",P="private-next-pages",S="private-dot-next",R="private-next-root-dir",O="private-next-app-dir",E="next/dist/build/webpack/loaders/next-flight-loader/module-proxy",x="private-next-rsc-action-validate",T="private-next-rsc-action-proxy",j="private-next-rsc-action-encryption",M="private-next-rsc-action-client-wrapper",C="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",N="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",A="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",w="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",I="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",D="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",L="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",U="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",F="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",G="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",H='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',B="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",V=["app","pages","components","lib","src"],k=[{title:"Strict",recommended:!0,config:{extends:"next/core-web-vitals"}},{title:"Base",config:{extends:"next"}},{title:"Cancel",config:null}],W={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},X={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"},K={...X,GROUP:{server:[X.reactServerComponents,X.actionBrowser,X.appMetadataRoute,X.appRouteHandler],nonClientServerTarget:[X.middleware,X.api],app:[X.reactServerComponents,X.actionBrowser,X.appMetadataRoute,X.appRouteHandler,X.serverSideRendering,X.appPagesBrowser,X.shared]}},$={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}},2761:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{reset:function(){return u},bold:function(){return s},dim:function(){return c},italic:function(){return d},underline:function(){return f},inverse:function(){return p},hidden:function(){return g},strikethrough:function(){return h},black:function(){return _},red:function(){return v},green:function(){return y},yellow:function(){return b},blue:function(){return m},magenta:function(){return P},purple:function(){return S},cyan:function(){return R},white:function(){return O},gray:function(){return E},bgBlack:function(){return x},bgRed:function(){return T},bgGreen:function(){return j},bgYellow:function(){return M},bgBlue:function(){return C},bgMagenta:function(){return N},bgCyan:function(){return A},bgWhite:function(){return w}});let{env:n,stdout:o}=(null==(r=globalThis)?void 0:r.process)??{},a=n&&!n.NO_COLOR&&(n.FORCE_COLOR||(null==o?void 0:o.isTTY)&&!n.CI&&"dumb"!==n.TERM),l=(e,t,r,n)=>{let o=e.substring(0,n)+r,a=e.substring(n+t.length),i=a.indexOf(t);return~i?o+l(a,t,r,i):o+a},i=(e,t,r=e)=>a?n=>{let o=""+n,a=o.indexOf(t,e.length);return~a?e+l(o,t,r,a)+t:e+o+t}:String,u=a?e=>`\x1b[0m${e}\x1b[0m`:String,s=i("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),c=i("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),d=i("\x1b[3m","\x1b[23m"),f=i("\x1b[4m","\x1b[24m"),p=i("\x1b[7m","\x1b[27m"),g=i("\x1b[8m","\x1b[28m"),h=i("\x1b[9m","\x1b[29m"),_=i("\x1b[30m","\x1b[39m"),v=i("\x1b[31m","\x1b[39m"),y=i("\x1b[32m","\x1b[39m"),b=i("\x1b[33m","\x1b[39m"),m=i("\x1b[34m","\x1b[39m"),P=i("\x1b[35m","\x1b[39m"),S=i("\x1b[38;2;173;127;168m","\x1b[39m"),R=i("\x1b[36m","\x1b[39m"),O=i("\x1b[37m","\x1b[39m"),E=i("\x1b[90m","\x1b[39m"),x=i("\x1b[40m","\x1b[49m"),T=i("\x1b[41m","\x1b[49m"),j=i("\x1b[42m","\x1b[49m"),M=i("\x1b[43m","\x1b[49m"),C=i("\x1b[44m","\x1b[49m"),N=i("\x1b[45m","\x1b[49m"),A=i("\x1b[46m","\x1b[49m"),w=i("\x1b[47m","\x1b[49m")},5511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{renderToReadableStream:function(){return n.renderToReadableStream},decodeReply:function(){return n.decodeReply},decodeAction:function(){return n.decodeAction},decodeFormState:function(){return n.decodeFormState},AppRouter:function(){return o.default},LayoutRouter:function(){return a.default},RenderFromTemplateContext:function(){return l.default},staticGenerationAsyncStorage:function(){return i.staticGenerationAsyncStorage},requestAsyncStorage:function(){return u.requestAsyncStorage},actionAsyncStorage:function(){return s.actionAsyncStorage},staticGenerationBailout:function(){return c.staticGenerationBailout},createSearchParamsBailoutProxy:function(){return f.createSearchParamsBailoutProxy},serverHooks:function(){return p},preloadStyle:function(){return _.preloadStyle},preloadFont:function(){return _.preloadFont},preconnect:function(){return _.preconnect},taintObjectReference:function(){return v.taintObjectReference},StaticGenerationSearchParamsBailoutProvider:function(){return d.default},NotFoundBoundary:function(){return g.NotFoundBoundary},patchFetch:function(){return m}});let n=r(8187),o=y(r(8019)),a=y(r(9363)),l=y(r(277)),i=r(5869),u=r(4580),s=r(2934),c=r(2936),d=y(r(9279)),f=r(288),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=b(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(n,a,l):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(9625)),g=r(4860),h=r(9308);r(6580);let _=r(2588),v=r(3487);function y(e){return e&&e.__esModule?e:{default:e}}function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(b=function(e){return e?r:t})(e)}function m(){return(0,h.patchFetch)({serverHooks:p,staticGenerationAsyncStorage:i.staticGenerationAsyncStorage})}},2588:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{preloadStyle:function(){return o},preloadFont:function(){return a},preconnect:function(){return l}});let n=function(e){return e&&e.__esModule?e:{default:e}}(r(3429));function o(e,t){let r={as:"style"};"string"==typeof t&&(r.crossOrigin=t),n.default.preload(e,r)}function a(e,t,r){let o={as:"font",type:t};"string"==typeof r&&(o.crossOrigin=r),n.default.preload(e,o)}function l(e,t){n.default.preconnect(e,"string"==typeof t?{crossOrigin:t}:void 0)}},3487:(e,t,r)=>{"use strict";function n(){throw Error("Taint can only be used with the taint flag.")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{taintObjectReference:function(){return o},taintUniqueValue:function(){return a}}),r(1367);let o=n,a=n},1498:(e,t)=>{"use strict";var r;Object.defineProperty(t,"x",{enumerable:!0,get:function(){return r}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE"}(r||(r={}))},9441:(e,t,r)=>{"use strict";e.exports=r(399)},3429:(e,t,r)=>{"use strict";e.exports=r(9441).vendored["react-rsc"].ReactDOM},6491:(e,t,r)=>{"use strict";e.exports=r(9441).vendored["react-rsc"].ReactJsxRuntime},8187:(e,t,r)=>{"use strict";e.exports=r(9441).vendored["react-rsc"].ReactServerDOMWebpackServerEdge},1367:(e,t,r)=>{"use strict";e.exports=r(9441).vendored["react-rsc"].React},9308:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{validateRevalidate:function(){return u},validateTags:function(){return s},addImplicitTags:function(){return d},patchFetch:function(){return p}});let n=r(7087),o=r(8554),a=r(9226),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(n,a,l):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(3181));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function u(e,t){try{let r;if(!1===e)r=e;else if("number"==typeof e&&!isNaN(e)&&e>-1)r=e;else if(void 0!==e)throw Error(`Invalid revalidate value "${e}" on "${t}", must be a non-negative number or "false"`);return r}catch(e){if(e instanceof Error&&e.message.includes("Invalid revalidate"))throw e;return}}function s(e,t){let r=[],n=[];for(let t of e)"string"!=typeof t?n.push({tag:t,reason:"invalid type, must be a string"}):t.length>a.NEXT_CACHE_TAG_MAX_LENGTH?n.push({tag:t,reason:`exceeded max length of ${a.NEXT_CACHE_TAG_MAX_LENGTH}`}):r.push(t);if(n.length>0)for(let{tag:e,reason:r}of(console.warn(`Warning: invalid tags passed to ${t}: `),n))console.log(`tag: "${e}" ${r}`);return r}let c=e=>{let t=["/layout"];if(e.startsWith("/")){let r=e.split("/");for(let e=1;er.every(r=>e[r]===t[r]))||e.fetchMetrics.push({url:t.url,cacheStatus:t.cacheStatus,cacheReason:t.cacheReason,status:t.status,method:t.method,start:t.start,end:Date.now(),idx:e.nextFetchId||0})}function p({serverHooks:e,staticGenerationAsyncStorage:t}){if(globalThis._nextOriginalFetch||(globalThis._nextOriginalFetch=globalThis.fetch),globalThis.fetch.__nextPatched)return;let{DynamicServerError:r}=e,i=globalThis._nextOriginalFetch;globalThis.fetch=async(e,c)=>{var p,g;let h;try{(h=new URL(e instanceof Request?e.url:e)).username="",h.password=""}catch{h=void 0}let _=(null==h?void 0:h.href)??"",v=Date.now(),y=(null==c?void 0:null==(p=c.method)?void 0:p.toUpperCase())||"GET",b=(null==(g=null==c?void 0:c.next)?void 0:g.internal)===!0,m="1"===process.env.NEXT_OTEL_FETCH_DISABLED;return await (0,o.getTracer)().trace(b?n.NextNodeServerSpan.internalFetch:n.AppRenderSpan.fetch,{hideSpan:m,kind:o.SpanKind.CLIENT,spanName:["fetch",y,_].filter(Boolean).join(" "),attributes:{"http.url":_,"http.method":y,"net.peer.name":null==h?void 0:h.hostname,"net.peer.port":(null==h?void 0:h.port)||void 0}},async()=>{var n;let o,p,g;let h=t.getStore()||(null==fetch.__nextGetStaticStore?void 0:fetch.__nextGetStaticStore.call(fetch)),y=e&&"object"==typeof e&&"string"==typeof e.method,m=t=>(null==c?void 0:c[t])||(y?e[t]:null);if(!h||b||h.isDraftMode)return i(e,c);let P=t=>{var r,n,o;return void 0!==(null==c?void 0:null==(r=c.next)?void 0:r[t])?null==c?void 0:null==(n=c.next)?void 0:n[t]:y?null==(o=e.next)?void 0:o[t]:void 0},S=P("revalidate"),R=s(P("tags")||[],`fetch ${e.toString()}`);if(Array.isArray(R))for(let e of(h.tags||(h.tags=[]),R))h.tags.includes(e)||h.tags.push(e);let O=d(h),E="only-cache"===h.fetchCache,x="force-cache"===h.fetchCache,T="default-cache"===h.fetchCache,j="default-no-store"===h.fetchCache,M="only-no-store"===h.fetchCache,C="force-no-store"===h.fetchCache,N=!!h.isUnstableNoStore,A=m("cache"),w="";"string"==typeof A&&void 0!==S&&(y&&"default"===A||l.warn(`fetch for ${_} on ${h.urlPathname} specified "cache: ${A}" and "revalidate: ${S}", only one should be specified.`),A=void 0),"force-cache"===A?S=!1:("no-cache"===A||"no-store"===A||C||M)&&(S=0),("no-cache"===A||"no-store"===A)&&(w=`cache: ${A}`),g=u(S,h.urlPathname);let I=m("headers"),D="function"==typeof(null==I?void 0:I.get)?I:new Headers(I||{}),L=D.get("authorization")||D.get("cookie"),U=!["get","head"].includes((null==(n=m("method"))?void 0:n.toLowerCase())||"get"),F=(L||U)&&0===h.revalidate;if(C&&(w="fetchCache = force-no-store"),M){if("force-cache"===A||void 0!==g&&(!1===g||g>0))throw Error(`cache: 'force-cache' used on fetch for ${_} with 'export const fetchCache = 'only-no-store'`);w="fetchCache = only-no-store"}if(E&&"no-store"===A)throw Error(`cache: 'no-store' used on fetch for ${_} with 'export const fetchCache = 'only-cache'`);x&&(void 0===S||0===S)&&(w="fetchCache = force-cache",g=!1),void 0===g?T?(g=!1,w="fetchCache = default-cache"):F?(g=0,w="auto no cache"):j?(g=0,w="fetchCache = default-no-store"):N?(g=0,w="noStore call"):(w="auto cache",g="boolean"!=typeof h.revalidate&&void 0!==h.revalidate&&h.revalidate):w||(w=`revalidate: ${g}`),h.forceStatic&&0===g||F||void 0!==h.revalidate&&("number"!=typeof g||!1!==h.revalidate&&("number"!=typeof h.revalidate||!(g0||!1===g;if(h.incrementalCache&&G)try{o=await h.incrementalCache.fetchCacheKey(_,y?e:c)}catch(t){console.error("Failed to generate cache key for",e)}let H=h.nextFetchId??1;h.nextFetchId=H+1;let B="number"!=typeof g?a.CACHE_ONE_YEAR:g,V=async(t,r)=>{let n=["cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","window","duplex",...t?[]:["signal"]];if(y){let t=e,r={body:t._ogBody||t.body};for(let e of n)r[e]=t[e];e=new Request(t.url,r)}else if(c){let e=c;for(let t of(c={body:c._ogBody||c.body},n))c[t]=e[t]}let a={...c,next:{...null==c?void 0:c.next,fetchType:"origin",fetchIdx:H}};return i(e,a).then(async n=>{if(t||f(h,{start:v,url:_,cacheReason:r||w,cacheStatus:0===g||r?"skip":"miss",status:n.status,method:a.method||"GET"}),200===n.status&&h.incrementalCache&&o&&G){let t=Buffer.from(await n.arrayBuffer());try{await h.incrementalCache.set(o,{kind:"FETCH",data:{headers:Object.fromEntries(n.headers.entries()),body:t.toString("base64"),status:n.status,url:n.url},revalidate:B},{fetchCache:!0,revalidate:g,fetchUrl:_,fetchIdx:H,tags:R})}catch(t){console.warn("Failed to set fetch cache",e,t)}let r=new Response(t,{headers:new Headers(n.headers),status:n.status});return Object.defineProperty(r,"url",{value:n.url}),r}return n})},k=()=>Promise.resolve();if(o&&h.incrementalCache){k=await h.incrementalCache.lock(o);let e=h.isOnDemandRevalidate?null:await h.incrementalCache.get(o,{kindHint:"fetch",revalidate:g,fetchUrl:_,fetchIdx:H,tags:R,softTags:O});if(e?await k():p="cache-control: no-cache (hard refresh)",(null==e?void 0:e.value)&&"FETCH"===e.value.kind&&!(h.isRevalidate&&e.isStale)){e.isStale&&(h.pendingRevalidates??={},h.pendingRevalidates[o]||(h.pendingRevalidates[o]=V(!0).catch(console.error)));let t=e.value.data;f(h,{start:v,url:_,cacheReason:w,cacheStatus:"hit",status:t.status||200,method:(null==c?void 0:c.method)||"GET"});let r=new Response(Buffer.from(t.body,"base64"),{headers:t.headers,status:t.status});return Object.defineProperty(r,"url",{value:e.value.data.url}),r}}if(h.isStaticGeneration&&c&&"object"==typeof c){let{cache:t}=c;if(!h.forceStatic&&"no-store"===t){let t=`no-store fetch ${e}${h.urlPathname?` ${h.urlPathname}`:""}`;null==h.postpone||h.postpone.call(h,t),h.revalidate=0;let n=new r(t);h.dynamicUsageErr=n,h.dynamicUsageDescription=t}let n="next"in c,{next:o={}}=c;if("number"==typeof o.revalidate&&(void 0===h.revalidate||"number"==typeof h.revalidate&&o.revalidatet,globalThis.fetch.__nextPatched=!0}},7087:(e,t)=>{"use strict";var r,n,o,a,l,i,u,s,c,d,f;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{NextVanillaSpanAllowlist:function(){return p},BaseServerSpan:function(){return r},LoadComponentsSpan:function(){return n},NextServerSpan:function(){return o},NextNodeServerSpan:function(){return a},StartServerSpan:function(){return l},RenderSpan:function(){return i},RouterSpan:function(){return s},AppRenderSpan:function(){return u},NodeSpan:function(){return c},AppRouteRouteHandlersSpan:function(){return d},ResolveMetadataSpan:function(){return f}}),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"}(r||(r={})),function(e){e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents"}(n||(n={})),function(e){e.getRequestHandler="NextServer.getRequestHandler",e.getServer="NextServer.getServer",e.getServerRequestHandler="NextServer.getServerRequestHandler",e.createServer="createServer.createServer"}(o||(o={})),function(e){e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",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.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch"}(a||(a={})),(l||(l={})).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"}(i||(i={})),function(e){e.renderToString="AppRender.renderToString",e.renderToReadableStream="AppRender.renderToReadableStream",e.getBodyResult="AppRender.getBodyResult",e.fetch="AppRender.fetch"}(u||(u={})),(s||(s={})).executeRoute="Router.executeRoute",(c||(c={})).runHandler="Node.runHandler",(d||(d={})).runHandler="AppRouteRouteHandlers.runHandler",function(e){e.generateMetadata="ResolveMetadata.generateMetadata",e.generateViewport="ResolveMetadata.generateViewport"}(f||(f={}));let p=["BaseServer.handleRequest","Render.getServerSideProps","Render.getStaticProps","AppRender.fetch","AppRender.getBodyResult","Render.renderDocument","Node.runHandler","AppRouteRouteHandlers.runHandler","ResolveMetadata.generateMetadata","ResolveMetadata.generateViewport","NextNodeServer.findPageComponents","NextNodeServer.getLayoutOrPageModule"]},8554:(e,t,r)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getTracer:function(){return y},SpanStatusCode:function(){return u},SpanKind:function(){return s}});let o=r(7087);try{n=r(1405)}catch(e){n=r(1405)}let{context:a,propagation:l,trace:i,SpanStatusCode:u,SpanKind:s,ROOT_CONTEXT:c}=n,d=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then,f=(e,t)=>{(null==t?void 0:t.bubble)===!0?e.setAttribute("next.bubble",!0):(t&&e.recordException(t),e.setStatus({code:u.ERROR,message:null==t?void 0:t.message})),e.end()},p=new Map,g=n.createContextKey("next.rootSpanId"),h=0,_=()=>h++;class v{getTracerInstance(){return i.getTracer("next.js","0.0.1")}getContext(){return a}getActiveScopeSpan(){return i.getSpan(null==a?void 0:a.active())}withPropagatedContext(e,t,r){let n=a.active();if(i.getSpanContext(n))return t();let o=l.extract(n,e,r);return a.with(o,t)}trace(...e){var t;let[r,n,l]=e,{fn:u,options:s}="function"==typeof n?{fn:n,options:{}}:{fn:l,options:{...n}};if(!o.NextVanillaSpanAllowlist.includes(r)&&"1"!==process.env.NEXT_OTEL_VERBOSE||s.hideSpan)return u();let h=s.spanName??r,v=this.getSpanContext((null==s?void 0:s.parentSpan)??this.getActiveScopeSpan()),y=!1;v?(null==(t=i.getSpanContext(v))?void 0:t.isRemote)&&(y=!0):(v=c,y=!0);let b=_();return s.attributes={"next.span_name":h,"next.span_type":r,...s.attributes},a.with(v.setValue(g,b),()=>this.getTracerInstance().startActiveSpan(h,s,e=>{let t=()=>{p.delete(b)};y&&p.set(b,new Map(Object.entries(s.attributes??{})));try{if(u.length>1)return u(e,t=>f(e,t));let r=u(e);if(d(r))return r.then(t=>(e.end(),t)).catch(t=>{throw f(e,t),t}).finally(t);return e.end(),t(),r}catch(r){throw f(e,r),t(),r}}))}wrap(...e){let t=this,[r,n,l]=3===e.length?e:[e[0],{},e[1]];return o.NextVanillaSpanAllowlist.includes(r)||"1"===process.env.NEXT_OTEL_VERBOSE?function(){let e=n;"function"==typeof e&&"function"==typeof l&&(e=e.apply(this,arguments));let o=arguments.length-1,i=arguments[o];if("function"!=typeof i)return t.trace(r,e,()=>l.apply(this,arguments));{let n=t.getContext().bind(a.active(),i);return t.trace(r,e,(e,t)=>(arguments[o]=function(e){return null==t||t(e),n.apply(this,arguments)},l.apply(this,arguments)))}}:l}startSpan(...e){let[t,r]=e,n=this.getSpanContext((null==r?void 0:r.parentSpan)??this.getActiveScopeSpan());return this.getTracerInstance().startSpan(t,r,n)}getSpanContext(e){return e?i.setSpan(a.active(),e):void 0}getRootSpanAttributes(){let e=a.active().getValue(g);return p.get(e)}}let y=(()=>{let e=new v;return()=>e})()},1603:()=>{},8067:(e,t,r)=>{"use strict";function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}r.r(t),r.d(t,{_:()=>n,_class_private_field_loose_base:()=>n})},6296:(e,t,r)=>{"use strict";r.r(t),r.d(t,{_:()=>o,_class_private_field_loose_key:()=>o});var n=0;function o(e){return"__private_"+n+++"_"+e}},3444:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.r(t),r.d(t,{_:()=>n,_interop_require_default:()=>n})},4816:(e,t,r)=>{"use strict";function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var i=a?Object.getOwnPropertyDescriptor(e,l):null;i&&(i.get||i.set)?Object.defineProperty(o,l,i):o[l]=e[l]}return o.default=e,r&&r.set(e,o),o}r.r(t),r.d(t,{_:()=>o,_interop_require_wildcard:()=>o})},2274:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.r(t),r.d(t,{_:()=>n,_interop_require_default:()=>n})}};var t=require("../webpack-runtime.js");t.C(e);var r=t(t.s=3145);module.exports=r})();
\ No newline at end of file
diff --git a/apps/web/.next/server/app/_not-found.js.nft.json b/apps/web/.next/server/app/_not-found.js.nft.json
index f6282d10..f1414531 100644
--- a/apps/web/.next/server/app/_not-found.js.nft.json
+++ b/apps/web/.next/server/app/_not-found.js.nft.json
@@ -1 +1 @@
-{"version":1,"files":["../../package.json","../chunks/369.js","../chunks/38.js","../webpack-runtime.js","_not-found_client-reference-manifest.js"]}
\ No newline at end of file
+{"version":1,"files":["../../package.json","../webpack-runtime.js","_not-found_client-reference-manifest.js"]}
\ No newline at end of file
diff --git a/apps/web/.next/server/app/_not-found.rsc b/apps/web/.next/server/app/_not-found.rsc
index 4d3be41a..e3a1ecbe 100644
--- a/apps/web/.next/server/app/_not-found.rsc
+++ b/apps/web/.next/server/app/_not-found.rsc
@@ -4,6 +4,6 @@
5:{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"}
6:{"display":"inline-block"}
7:{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0}
-0:["NZ5J5THZSIm48Kb9Sw_O9",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"font-sans __variable_aaf875","children":["$","$L2",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$4","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$5","children":"404"}],["$","div",null,{"style":"$6","children":["$","h2",null,{"style":"$7","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/6c15d7e3526590b3.css","precedence":"next","crossOrigin":""}]],"$L8"]]]]
+0:["yGeZZitS1W4Rar-yoH8R4",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"font-sans __variable_aaf875","children":["$","$L2",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$4","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$5","children":"404"}],["$","div",null,{"style":"$6","children":["$","h2",null,{"style":"$7","children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/6c15d7e3526590b3.css","precedence":"next","crossOrigin":""}]],"$L8"]]]]
8:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Create T3 App"}],["$","meta","3",{"name":"description","content":"Generated by create-t3-app"}],["$","link","4",{"rel":"icon","href":"/favicon.ico"}],["$","meta","5",{"name":"next-size-adjust"}]]
1:null
diff --git a/apps/web/.next/server/app/_not-found_client-reference-manifest.js b/apps/web/.next/server/app/_not-found_client-reference-manifest.js
index 5b986991..4140e457 100644
--- a/apps/web/.next/server/app/_not-found_client-reference-manifest.js
+++ b/apps/web/.next/server/app/_not-found_client-reference-manifest.js
@@ -1 +1 @@
-globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/_not-found"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"2172":{"*":{"id":"5964","name":"*","chunks":[],"async":false}},"2533":{"*":{"id":"7255","name":"*","chunks":[],"async":false}},"3398":{"*":{"id":"5804","name":"*","chunks":[],"async":false}},"5119":{"*":{"id":"6225","name":"*","chunks":[],"async":false}},"8950":{"*":{"id":"9489","name":"*","chunks":[],"async":false}},"9256":{"*":{"id":"1021","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/app-router.js":{"id":8950,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/app-router.js":{"id":8950,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/error-boundary.js":{"id":5119,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":5119,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/layout-router.js":{"id":2172,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/layout-router.js":{"id":2172,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/not-found-boundary.js":{"id":3398,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":3398,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/render-from-template-context.js":{"id":2533,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":2533,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/static-generation-searchparams-bailout-provider.js":{"id":9256,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/static-generation-searchparams-bailout-provider.js":{"id":9256,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Inter\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--font-sans\"}],\"variableName\":\"inter\"}":{"id":425,"name":"*","chunks":["185","static/chunks/app/layout-d03d6a3648fc999a.js"],"async":false},"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/styles/globals.css":{"id":3744,"name":"*","chunks":["185","static/chunks/app/layout-d03d6a3648fc999a.js"],"async":false}},"entryCSSFiles":{"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/_not-found":[],"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/layout":["static/css/6c15d7e3526590b3.css"],"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/page":[]}}
\ No newline at end of file
+globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/_not-found"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"2172":{"*":{"id":"5964","name":"*","chunks":[],"async":false}},"2533":{"*":{"id":"7255","name":"*","chunks":[],"async":false}},"3398":{"*":{"id":"5804","name":"*","chunks":[],"async":false}},"5119":{"*":{"id":"6225","name":"*","chunks":[],"async":false}},"8950":{"*":{"id":"9489","name":"*","chunks":[],"async":false}},"9256":{"*":{"id":"1021","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{"2172":{"*":{"id":"7364","name":"*","chunks":[],"async":false}},"2533":{"*":{"id":"8535","name":"*","chunks":[],"async":false}},"3362":{"*":{"id":"3054","name":"*","chunks":[],"async":false}},"3398":{"*":{"id":"188","name":"*","chunks":[],"async":false}},"4841":{"*":{"id":"991","name":"*","chunks":[],"async":false}},"5119":{"*":{"id":"990","name":"*","chunks":[],"async":false}},"6379":{"*":{"id":"4198","name":"*","chunks":[],"async":false}},"7167":{"*":{"id":"1271","name":"*","chunks":[],"async":false}},"8251":{"*":{"id":"7125","name":"*","chunks":[],"async":false}},"8950":{"*":{"id":"7560","name":"*","chunks":[],"async":false}},"9256":{"*":{"id":"8486","name":"*","chunks":[],"async":false}}},"clientModules":{"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/app-router.js":{"id":8950,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/app-router.js":{"id":8950,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/error-boundary.js":{"id":5119,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":5119,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/layout-router.js":{"id":2172,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/layout-router.js":{"id":2172,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/not-found-boundary.js":{"id":3398,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":3398,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/render-from-template-context.js":{"id":2533,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":2533,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/static-generation-searchparams-bailout-provider.js":{"id":9256,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/static-generation-searchparams-bailout-provider.js":{"id":9256,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js":{"id":8251,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/app-router-context.shared-runtime.js":{"id":8251,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js":{"id":6379,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/hooks-client-context.shared-runtime.js":{"id":6379,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/shared/lib/loadable-context.shared-runtime.js":{"id":3362,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/loadable-context.shared-runtime.js":{"id":3362,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js":{"id":7167,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/server-inserted-html.shared-runtime.js":{"id":7167,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Inter\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--font-sans\"}],\"variableName\":\"inter\"}":{"id":425,"name":"*","chunks":["185","static/chunks/app/layout-dff3f08819de4584.js"],"async":false},"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/styles/globals.css":{"id":3744,"name":"*","chunks":["185","static/chunks/app/layout-dff3f08819de4584.js"],"async":false},"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/MessagePoster.tsx":{"id":4841,"name":"*","chunks":["931","static/chunks/app/page-eb5778122b1e1134.js"],"async":false}},"entryCSSFiles":{"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/_not-found":[],"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/layout":["static/css/6c15d7e3526590b3.css"],"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/page":[]}}
\ No newline at end of file
diff --git a/apps/web/.next/server/app/account/page.js b/apps/web/.next/server/app/account/page.js
deleted file mode 100644
index 94f45e43..00000000
--- a/apps/web/.next/server/app/account/page.js
+++ /dev/null
@@ -1 +0,0 @@
-(()=>{var e={};e.id=346,e.ids=[346],e.modules={7849:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external")},2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},5403:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},4749:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},419:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>a.a,__next_app__:()=>p,originalPathname:()=>d,pages:()=>c,routeModule:()=>f,tree:()=>u});var n=r(9441),s=r(1498),o=r(6580),a=r.n(o),i=r(5511),l={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>i[e]);r.d(t,l);let u=["",{children:["account",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,829)),"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/account/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,8205)),"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,3250,23)),"next/dist/client/components/not-found-error"]}],c=["/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/account/page.tsx"],d="/account/page",p={require:r,loadChunk:()=>Promise.resolve()},f=new n.AppPageRouteModule({definition:{kind:s.x.APP_PAGE,page:"/account/page",pathname:"/account",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:u}})},5209:(e,t,r)=>{Promise.resolve().then(r.bind(r,6196))},7422:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,9489,23)),Promise.resolve().then(r.t.bind(r,6225,23)),Promise.resolve().then(r.t.bind(r,5964,23)),Promise.resolve().then(r.t.bind(r,5804,23)),Promise.resolve().then(r.t.bind(r,7255,23)),Promise.resolve().then(r.t.bind(r,1021,23))},5722:()=>{},6196:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var n=r(3810);let s=function({jwt:e}){return(0,n.useEffect)(()=>{},[e]),null}},829:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(6491),s=r(7167);let o=(0,r(599).createProxy)(String.raw`/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/account/client.tsx`),{__esModule:a,$$typeof:i}=o,l=o.default,u=async function(){let e=s.cookies().get("next-auth.session-token")?.value;return n.jsx(l,{jwt:e})}},8205:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i,metadata:()=>a});var n=r(6491),s=r(1608),o=r.n(s);r(1603);let a={title:"Create T3 App",description:"Generated by create-t3-app",icons:[{rel:"icon",url:"/favicon.ico"}]};function i({children:e}){return n.jsx("html",{lang:"en",children:n.jsx("body",{className:`font-sans ${o().variable}`,children:e})})}},7167:(e,t,r)=>{"use strict";r.r(t);var n=r(9767),s={};for(let e in n)"default"!==e&&(s[e]=()=>n[e]);r.d(t,s)},1847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraftMode",{enumerable:!0,get:function(){return s}});let n=r(2936);class s{get isEnabled(){return this._provider.isEnabled}enable(){if(!(0,n.staticGenerationBailout)("draftMode().enable()"))return this._provider.enable()}disable(){if(!(0,n.staticGenerationBailout)("draftMode().disable()"))return this._provider.disable()}constructor(e){this._provider=e}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9767:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{headers:function(){return c},cookies:function(){return d},draftMode:function(){return p}});let n=r(9839),s=r(270),o=r(8005),a=r(4580),i=r(2934),l=r(2936),u=r(1847);function c(){if((0,l.staticGenerationBailout)("headers",{link:"https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering"}))return s.HeadersAdapter.seal(new Headers({}));let e=a.requestAsyncStorage.getStore();if(!e)throw Error("Invariant: headers() expects to have requestAsyncStorage, none available.");return e.headers}function d(){if((0,l.staticGenerationBailout)("cookies",{link:"https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering"}))return n.RequestCookiesAdapter.seal(new o.RequestCookies(new Headers({})));let e=a.requestAsyncStorage.getStore();if(!e)throw Error("Invariant: cookies() expects to have requestAsyncStorage, none available.");let t=i.actionAsyncStorage.getStore();return t&&(t.isAction||t.isAppRoute)?e.mutableCookies:e.cookies}function p(){let e=a.requestAsyncStorage.getStore();if(!e)throw Error("Invariant: draftMode() expects to have requestAsyncStorage, none available.");return new u.DraftMode(e.draftMode)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8263:e=>{"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={};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}`,"priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean);return`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}; ${r.join("; ")}`}function i(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,s]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=s?s:"true"))}catch{}}return t}function l(e){var t,r;if(!e)return;let[[n,s],...o]=i(e),{domain:a,expires:l,httponly:d,maxage:p,path:f,samesite:h,secure:y,priority:g}=Object.fromEntries(o.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:n,value:decodeURIComponent(s),domain:a,...l&&{expires:new Date(l)},...d&&{httpOnly:!0},..."string"==typeof p&&{maxAge:Number(p)},path:f,...h&&{sameSite:u.includes(t=(t=h).toLowerCase())?t:void 0},...y&&{secure:!0},...g&&{priority:c.includes(r=(r=g).toLowerCase())?r:void 0}})}((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(o,{RequestCookies:()=>d,ResponseCookies:()=>p,parseCookie:()=>i,parseSetCookie:()=>l,stringifyCookie:()=>a}),e.exports=((e,o,a,i)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let a of n(o))s.call(e,a)||void 0===a||t(e,a,{get:()=>o[a],enumerable:!(i=r(o,a))||i.enumerable});return e})(t({},"__esModule",{value:!0}),o);var u=["strict","lax","none"],c=["low","medium","high"],d=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of i(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>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("; ")}},p=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let s=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(s)?s:function(e){if(!e)return[];var t,r,n,s,o,a=[],i=0;function l(){for(;i=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 n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,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,...n})),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,n]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:r,domain:n,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("; ")}}},270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyHeadersError:function(){return s},HeadersAdapter:function(){return o}});let n=r(5444);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 o extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,s){if("symbol"==typeof r)return n.ReflectAdapter.get(t,r,s);let o=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===o);if(void 0!==a)return n.ReflectAdapter.get(t,a,s)},set(t,r,s,o){if("symbol"==typeof r)return n.ReflectAdapter.set(t,r,s,o);let a=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===a);return n.ReflectAdapter.set(t,i??r,s,o)},has(t,r){if("symbol"==typeof r)return n.ReflectAdapter.has(t,r);let s=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===s);return void 0!==o&&n.ReflectAdapter.has(t,o)},deleteProperty(t,r){if("symbol"==typeof r)return n.ReflectAdapter.deleteProperty(t,r);let s=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===s);return void 0===o||n.ReflectAdapter.deleteProperty(t,o)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return s.callable;default:return n.ReflectAdapter.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},5444:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return r}});class r{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},9839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyRequestCookiesError:function(){return o},RequestCookiesAdapter:function(){return a},getModifiedCookieValues:function(){return l},appendMutableCookies:function(){return u},MutableRequestCookiesAdapter:function(){return c}});let n=r(8005),s=r(5444);class o extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options")}static callable(){throw new o}}class a{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return o.callable;default:return s.ReflectAdapter.get(e,t,r)}}})}}let i=Symbol.for("next.mutated.cookies");function l(e){let t=e[i];return t&&Array.isArray(t)&&0!==t.length?t:[]}function u(e,t){let r=l(t);if(0===r.length)return!1;let s=new n.ResponseCookies(e),o=s.getAll();for(let e of r)s.set(e);for(let e of o)s.set(e);return!0}class c{static wrap(e,t){let r=new n.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let o=[],a=new Set,l=()=>{var e;let s=null==fetch.__nextGetStaticStore?void 0:null==(e=fetch.__nextGetStaticStore.call(fetch))?void 0:e.getStore();if(s&&(s.pathWasRevalidated=!0),o=r.getAll().filter(e=>a.has(e.name)),t){let e=[];for(let t of o){let r=new n.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}};return new Proxy(r,{get(e,t,r){switch(t){case i:return o;case"delete":return function(...t){a.add("string"==typeof t[0]?t[0]:t[0].name);try{e.delete(...t)}finally{l()}};case"set":return function(...t){a.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t)}finally{l()}};default:return s.ReflectAdapter.get(e,t,r)}}})}}},8005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies}});let n=r(8263)},1603:()=>{}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[369,38],()=>r(419));module.exports=n})();
\ No newline at end of file
diff --git a/apps/web/.next/server/app/account/page.js.nft.json b/apps/web/.next/server/app/account/page.js.nft.json
deleted file mode 100644
index f4e8c4e6..00000000
--- a/apps/web/.next/server/app/account/page.js.nft.json
+++ /dev/null
@@ -1 +0,0 @@
-{"version":1,"files":["../../../package.json","../../chunks/369.js","../../chunks/38.js","../../webpack-runtime.js","page_client-reference-manifest.js"]}
\ No newline at end of file
diff --git a/apps/web/.next/server/app/account/page_client-reference-manifest.js b/apps/web/.next/server/app/account/page_client-reference-manifest.js
deleted file mode 100644
index a4174cae..00000000
--- a/apps/web/.next/server/app/account/page_client-reference-manifest.js
+++ /dev/null
@@ -1 +0,0 @@
-globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/account/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"2172":{"*":{"id":"5964","name":"*","chunks":[],"async":false}},"2533":{"*":{"id":"7255","name":"*","chunks":[],"async":false}},"3398":{"*":{"id":"5804","name":"*","chunks":[],"async":false}},"5119":{"*":{"id":"6225","name":"*","chunks":[],"async":false}},"6695":{"*":{"id":"6196","name":"*","chunks":[],"async":false}},"8950":{"*":{"id":"9489","name":"*","chunks":[],"async":false}},"9256":{"*":{"id":"1021","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/app-router.js":{"id":8950,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/app-router.js":{"id":8950,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/error-boundary.js":{"id":5119,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":5119,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/layout-router.js":{"id":2172,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/layout-router.js":{"id":2172,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/not-found-boundary.js":{"id":3398,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":3398,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/render-from-template-context.js":{"id":2533,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":2533,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/client/components/static-generation-searchparams-bailout-provider.js":{"id":9256,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/client/components/static-generation-searchparams-bailout-provider.js":{"id":9256,"name":"*","chunks":[],"async":false},"/Users/dhravyashah/Documents/code/anycontext/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Inter\",\"arguments\":[{\"subsets\":[\"latin\"],\"variable\":\"--font-sans\"}],\"variableName\":\"inter\"}":{"id":425,"name":"*","chunks":["185","static/chunks/app/layout-d03d6a3648fc999a.js"],"async":false},"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/styles/globals.css":{"id":3744,"name":"*","chunks":["185","static/chunks/app/layout-d03d6a3648fc999a.js"],"async":false},"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/account/client.tsx":{"id":6695,"name":"*","chunks":["346","static/chunks/app/account/page-0cdf2840d5548012.js"],"async":false}},"entryCSSFiles":{"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/_not-found":[],"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/layout":["static/css/6c15d7e3526590b3.css"],"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/page":[],"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/account/page":[]}}
\ No newline at end of file
diff --git a/apps/web/.next/server/app/api/auth/[...nextauth]/route.js b/apps/web/.next/server/app/api/auth/[...nextauth]/route.js
index b1472e8b..fd45c788 100644
--- a/apps/web/.next/server/app/api/auth/[...nextauth]/route.js
+++ b/apps/web/.next/server/app/api/auth/[...nextauth]/route.js
@@ -1,51 +1,404 @@
-(()=>{var e={};e.id=912,e.ids=[912],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},517:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},3477:e=>{"use strict";e.exports=require("querystring")},7310:e=>{"use strict";e.exports=require("url")},3849:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},2789:(e,t,r)=>{"use strict";let i;r.r(t),r.d(t,{headerHooks:()=>tN,originalPathname:()=>tW,patchFetch:()=>tK,requestAsyncStorage:()=>t$,routeModule:()=>tI,serverHooks:()=>tM,staticGenerationAsyncStorage:()=>tJ,staticGenerationBailout:()=>tR});var n={};r.r(n),r.d(n,{GET:()=>tC,POST:()=>tC});var o=r(2390),s=r(1498),a=r(9308),l=r(7345),c=r.n(l),u=r(4869),d=r(4143),h=r(2877),p=r(4456),f=r(9105),y=r(9349),g=r(2393),m=r(3543),_=r(9324),v=r(776),w=r(4990),b=r(6702),S=r(6711);let k=Symbol.for("drizzle:MySqlInlineForeignKeys");class E extends m.iA{static{m.iA.Symbol.Columns,i=m.iA.Symbol.ExtraConfigBuilder}static{this[u.Q]="MySqlTable"}static{this.Symbol=Object.assign({},m.iA.Symbol,{InlineForeignKeys:k})}constructor(...e){super(...e),this[k]=[],this[i]=void 0}}let A=(e,t,r)=>(function(e,t,r,i,n=e){let o=new E(e,i,n),s=Object.fromEntries(Object.entries(t).map(([e,t])=>{let r=t.build(o);return o[k].push(...t.buildForeignKeys(r,o)),[e,r]})),a=Object.assign(o,s);return a[m.iA.Symbol.Columns]=s,r&&(a[E.Symbol.ExtraConfigBuilder]=r),a})(e,t,r,void 0,e);class x{static{this[u.Q]="MySqlForeignKeyBuilder"}constructor(e,t){this.reference=()=>{let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignTable:i[0].table,foreignColumns:i}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new O(e,this)}}class O{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static{this[u.Q]="MySqlForeignKey"}getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map(e=>e.name),n=r.map(e=>e.name),o=[this.table[E.Symbol.Name],...i,r[0].table[E.Symbol.Name],...n];return e??`${o.join("_")}_fk`}}function T(e,t){return`${e[E.Symbol.Name]}_${t.join("_")}_unique`}class P{constructor(e,t){this.name=t,this.columns=e}static{this[u.Q]="MySqlUniqueConstraintBuilder"}build(e){return new C(e,this.columns,this.name)}}class j{static{this[u.Q]="MySqlUniqueOnConstraintBuilder"}constructor(e){this.name=e}on(...e){return new P(e,this.name)}}class C{constructor(e,t,r){this.nullsNotDistinct=!1,this.table=e,this.columns=t,this.name=r??T(this.table,this.columns.map(e=>e.name))}static{this[u.Q]="MySqlUniqueConstraint"}getName(){return this.name}}class I extends S.L{static{this[u.Q]="MySqlColumnBuilder"}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>((r,i)=>{let n=new x(()=>({columns:[e],foreignColumns:[r()]}));return i.onUpdate&&n.onUpdate(i.onUpdate),i.onDelete&&n.onDelete(i.onDelete),n.build(t)})(r,i))}constructor(...e){super(...e),this.foreignKeyConfigs=[]}}class $ extends f.s{constructor(e,t){t.uniqueName||(t.uniqueName=T(e,[t.name])),super(e,t),this.table=e}static{this[u.Q]="MySqlColumn"}}class J extends I{static{this[u.Q]="MySqlColumnBuilderWithAutoIncrement"}constructor(e,t,r){super(e,t,r),this.config.autoIncrement=!1}autoincrement(){return this.config.autoIncrement=!0,this.config.hasDefault=!0,this}}class M extends ${static{this[u.Q]="MySqlColumnWithAutoIncrement"}constructor(...e){super(...e),this.autoIncrement=this.config.autoIncrement}}class N extends g.G7{static{this[u.Q]="MySqlViewBase"}}class R{static{this[u.Q]="MySqlDialect"}async migrate(e,t,r){let i=r.migrationsTable??"__drizzle_migrations",n=g.i6`
- create table if not exists ${g.i6.identifier(i)} (
+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[912],{2067:e=>{"use strict";e.exports=require("node:async_hooks")},6195:e=>{"use strict";e.exports=require("node:buffer")},6817:(e,t,r)=>{"use strict";let i,n,s,a;r.r(t),r.d(t,{ComponentMod:()=>un,default:()=>us});var o={};r.r(o),r.d(o,{GET:()=>l6,POST:()=>l2,runtime:()=>l5});var l={};r.r(l),r.d(l,{headerHooks:()=>ue,originalPathname:()=>ur,patchFetch:()=>ui,requestAsyncStorage:()=>l8,routeModule:()=>l3,serverHooks:()=>l7,staticGenerationAsyncStorage:()=>l9,staticGenerationBailout:()=>ut});var u=r(4915),c=r(4392),d=r(4399),h=r(5373);!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},e.getValidEnumValues=t=>{let r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),i={};for(let e of r)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(let r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(sG||(sG={})),(sX||(sX={})).mergeShapes=(e,t)=>({...e,...t});let p=sG.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),f=e=>{switch(typeof e){case"undefined":return p.undefined;case"string":return p.string;case"number":return isNaN(e)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":if(Array.isArray(e))return p.array;if(null===e)return p.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return p.promise;if("undefined"!=typeof Map&&e instanceof Map)return p.map;if("undefined"!=typeof Set&&e instanceof Set)return p.set;if("undefined"!=typeof Date&&e instanceof Date)return p.date;return p.object;default:return p.unknown}},m=sG.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class g extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},r={_errors:[]},i=e=>{for(let n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(i);else if("invalid_return_type"===n.code)i(n.returnTypeError);else if("invalid_arguments"===n.code)i(n.argumentsError);else if(0===n.path.length)r._errors.push(t(n));else{let e=r,i=0;for(;ie.message){let t={},r=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}g.create=e=>new g(e);let y=(e,t)=>{let r;switch(e.code){case m.invalid_type:r=e.received===p.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,sG.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:r=`Unrecognized key(s) in object: ${sG.joinValues(e.keys,", ")}`;break;case m.invalid_union:r="Invalid input";break;case m.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${sG.joinValues(e.options)}`;break;case m.invalid_enum_value:r=`Invalid enum value. Expected ${sG.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:r="Invalid function arguments";break;case m.invalid_return_type:r="Invalid function return type";break;case m.invalid_date:r="Invalid date";break;case m.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:sG.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case m.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case m.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case m.custom:r="Invalid input";break;case m.invalid_intersection_types:r="Intersection results could not be merged";break;case m.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:r="Number must be finite";break;default:r=t.defaultError,sG.assertNever(e)}return{message:r}},v=y;function b(){return v}let w=e=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,s=[...r,...n.path||[]],a={...n,path:s},o="";for(let e of i.filter(e=>!!e).slice().reverse())o=e(a,{data:t,defaultError:o}).message;return{...n,path:s,message:n.message||o}};function _(e,t){let r=w({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,b(),y].filter(e=>!!e)});e.common.issues.push(r)}class S{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let i of t){if("aborted"===i.status)return x;"dirty"===i.status&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t)r.push({key:await e.key,value:await e.value});return S.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let i of t){let{key:t,value:n}=i;if("aborted"===t.status||"aborted"===n.status)return x;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==n.value||i.alwaysSet)&&(r[t.value]=n.value)}return{status:e.value,value:r}}}let x=Object.freeze({status:"aborted"}),k=e=>({status:"dirty",value:e}),E=e=>({status:"valid",value:e}),A=e=>"aborted"===e.status,T=e=>"dirty"===e.status,C=e=>"valid"===e.status,O=e=>"undefined"!=typeof Promise&&e instanceof Promise;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(sY||(sY={}));class P{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let $=(e,t)=>{if(C(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new g(e.common.issues);return this._error=t,this._error}}};function N(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=i?i:t.defaultError}:{message:null!=r?r:t.defaultError},description:n}}class R{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return f(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:f(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:f(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(O(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let i={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:f(e)},n=this._parseSync({data:e,path:i.path,parent:i});return $(i,n)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:f(e)},i=this._parse({data:e,path:r.path,parent:r});return $(r,await (O(i)?i:Promise.resolve(i)))}refine(e,t){let r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,i)=>{let n=e(t),s=()=>i.addIssue({code:m.custom,...r(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then(e=>!!e||(s(),!1)):!!n||(s(),!1)})}refinement(e,t){return this._refinement((r,i)=>!!e(r)||(i.addIssue("function"==typeof t?t(r,i):t),!1))}_refinement(e){return new ey({schema:this,typeName:s0.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ev.create(this,this._def)}nullable(){return eb.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ee.create(this,this._def)}promise(){return eg.create(this,this._def)}or(e){return er.create([this,e],this._def)}and(e){return es.create(this,e,this._def)}transform(e){return new ey({...N(this._def),schema:this,typeName:s0.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ew({...N(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:s0.ZodDefault})}brand(){return new ek({typeName:s0.ZodBranded,type:this,...N(this._def)})}catch(e){return new e_({...N(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:s0.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eE.create(this,e)}readonly(){return eA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let I=/^c[^\s-]{8,}$/i,j=/^[a-z][a-z0-9]*$/,L=/^[0-9A-HJKMNP-TV-Z]{26}$/,D=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,M=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,U=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,q=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Q=e=>e.precision?e.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");class B extends R{_parse(e){let t;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==p.string){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.string,received:t.parsedType}),x}let r=new S;for(let a of this._def.checks)if("min"===a.kind)e.data.lengtha.value&&(_(t=this._getOrReturnCtx(e,t),{code:m.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if("length"===a.kind){let i=e.data.length>a.value,n=e.data.lengthe.test(t),{validation:t,code:m.invalid_string,...sY.errToObj(r)})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...sY.errToObj(e)})}url(e){return this._addCheck({kind:"url",...sY.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...sY.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...sY.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...sY.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...sY.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...sY.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...sY.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...sY.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...sY.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...sY.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...sY.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...sY.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...sY.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...sY.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...sY.errToObj(t)})}nonempty(e){return this.min(1,sY.errToObj(e))}trim(){return new B({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new B({checks:[],typeName:s0.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...N(e)})};class H extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==p.number){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.number,received:t.parsedType}),x}let r=new S;for(let i of this._def.checks)"int"===i.kind?sG.isInteger(e.data)||(_(t=this._getOrReturnCtx(e,t),{code:m.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):"min"===i.kind?(i.inclusive?e.datai.value:e.data>=i.value)&&(_(t=this._getOrReturnCtx(e,t),{code:m.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):"multipleOf"===i.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}(e.data,i.value)&&(_(t=this._getOrReturnCtx(e,t),{code:m.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(_(t=this._getOrReturnCtx(e,t),{code:m.not_finite,message:i.message}),r.dirty()):sG.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,sY.toString(t))}gt(e,t){return this.setLimit("min",e,!1,sY.toString(t))}lte(e,t){return this.setLimit("max",e,!0,sY.toString(t))}lt(e,t){return this.setLimit("max",e,!1,sY.toString(t))}setLimit(e,t,r,i){return new H({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:sY.toString(i)}]})}_addCheck(e){return new H({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:sY.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:sY.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:sY.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:sY.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:sY.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:sY.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:sY.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:sY.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:sY.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&sG.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew H({checks:[],typeName:s0.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...N(e)});class K extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==p.bigint){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.bigint,received:t.parsedType}),x}let r=new S;for(let i of this._def.checks)"min"===i.kind?(i.inclusive?e.datai.value:e.data>=i.value)&&(_(t=this._getOrReturnCtx(e,t),{code:m.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(_(t=this._getOrReturnCtx(e,t),{code:m.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):sG.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,sY.toString(t))}gt(e,t){return this.setLimit("min",e,!1,sY.toString(t))}lte(e,t){return this.setLimit("max",e,!0,sY.toString(t))}lt(e,t){return this.setLimit("max",e,!1,sY.toString(t))}setLimit(e,t,r,i){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:sY.toString(i)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:sY.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:sY.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:sY.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:sY.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:sY.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new K({checks:[],typeName:s0.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...N(e)})};class F extends R{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==p.boolean){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.boolean,received:t.parsedType}),x}return E(e.data)}}F.create=e=>new F({typeName:s0.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...N(e)});class V extends R{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==p.date){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.date,received:t.parsedType}),x}if(isNaN(e.data.getTime()))return _(this._getOrReturnCtx(e),{code:m.invalid_date}),x;let r=new S;for(let i of this._def.checks)"min"===i.kind?e.data.getTime()i.value&&(_(t=this._getOrReturnCtx(e,t),{code:m.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):sG.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:sY.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:sY.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew V({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:s0.ZodDate,...N(e)});class W extends R{_parse(e){if(this._getType(e)!==p.symbol){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.symbol,received:t.parsedType}),x}return E(e.data)}}W.create=e=>new W({typeName:s0.ZodSymbol,...N(e)});class z extends R{_parse(e){if(this._getType(e)!==p.undefined){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.undefined,received:t.parsedType}),x}return E(e.data)}}z.create=e=>new z({typeName:s0.ZodUndefined,...N(e)});class J extends R{_parse(e){if(this._getType(e)!==p.null){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.null,received:t.parsedType}),x}return E(e.data)}}J.create=e=>new J({typeName:s0.ZodNull,...N(e)});class Z extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return E(e.data)}}Z.create=e=>new Z({typeName:s0.ZodAny,...N(e)});class G extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return E(e.data)}}G.create=e=>new G({typeName:s0.ZodUnknown,...N(e)});class X extends R{_parse(e){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.never,received:t.parsedType}),x}}X.create=e=>new X({typeName:s0.ZodNever,...N(e)});class Y extends R{_parse(e){if(this._getType(e)!==p.undefined){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.void,received:t.parsedType}),x}return E(e.data)}}Y.create=e=>new Y({typeName:s0.ZodVoid,...N(e)});class ee extends R{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==p.array)return _(t,{code:m.invalid_type,expected:p.array,received:t.parsedType}),x;if(null!==i.exactLength){let e=t.data.length>i.exactLength.value,n=t.data.lengthi.maxLength.value&&(_(t,{code:m.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>i.type._parseAsync(new P(t,e,t.path,r)))).then(e=>S.mergeArray(r,e));let n=[...t.data].map((e,r)=>i.type._parseSync(new P(t,e,t.path,r)));return S.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new ee({...this._def,minLength:{value:e,message:sY.toString(t)}})}max(e,t){return new ee({...this._def,maxLength:{value:e,message:sY.toString(t)}})}length(e,t){return new ee({...this._def,exactLength:{value:e,message:sY.toString(t)}})}nonempty(e){return this.min(1,e)}}ee.create=(e,t)=>new ee({type:e,minLength:null,maxLength:null,exactLength:null,typeName:s0.ZodArray,...N(t)});class et extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=sG.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==p.object){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.object,received:t.parsedType}),x}let{status:t,ctx:r}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),s=[];if(!(this._def.catchall instanceof X&&"strip"===this._def.unknownKeys))for(let e in r.data)n.includes(e)||s.push(e);let a=[];for(let e of n){let t=i[e],n=r.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new P(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof X){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of s)a.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)s.length>0&&(_(r,{code:m.unrecognized_keys,keys:s}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of s){let i=r.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new P(r,i,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of a){let r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>S.mergeObjectSync(t,e)):S.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return sY.errToObj,new et({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var i,n,s,a;let o=null!==(s=null===(n=(i=this._def).errorMap)||void 0===n?void 0:n.call(i,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=sY.errToObj(e).message)&&void 0!==a?a:o}:{message:o}}}:{}})}strip(){return new et({...this._def,unknownKeys:"strip"})}passthrough(){return new et({...this._def,unknownKeys:"passthrough"})}extend(e){return new et({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:s0.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new et({...this._def,catchall:e})}pick(e){let t={};return sG.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new et({...this._def,shape:()=>t})}omit(e){let t={};return sG.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new et({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof et){let r={};for(let i in t.shape){let n=t.shape[i];r[i]=ev.create(e(n))}return new et({...t._def,shape:()=>r})}return t instanceof ee?new ee({...t._def,type:e(t.element)}):t instanceof ev?ev.create(e(t.unwrap())):t instanceof eb?eb.create(e(t.unwrap())):t instanceof ea?ea.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};return sG.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}),new et({...this._def,shape:()=>t})}required(e){let t={};return sG.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ev;)e=e._def.innerType;t[r]=e}}),new et({...this._def,shape:()=>t})}keyof(){return ep(sG.objectKeys(this.shape))}}et.create=(e,t)=>new et({shape:()=>e,unknownKeys:"strip",catchall:X.create(),typeName:s0.ZodObject,...N(t)}),et.strictCreate=(e,t)=>new et({shape:()=>e,unknownKeys:"strict",catchall:X.create(),typeName:s0.ZodObject,...N(t)}),et.lazycreate=(e,t)=>new et({shape:e,unknownKeys:"strip",catchall:X.create(),typeName:s0.ZodObject,...N(t)});class er extends R{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new g(e.ctx.common.issues));return _(t,{code:m.invalid_union,unionErrors:r}),x});{let e;let i=[];for(let n of r){let r={...t,common:{...t.common,issues:[]},parent:null},s=n._parseSync({data:t.data,path:t.path,parent:r});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:r}),r.common.issues.length&&i.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let n=i.map(e=>new g(e));return _(t,{code:m.invalid_union,unionErrors:n}),x}}get options(){return this._def.options}}er.create=(e,t)=>new er({options:e,typeName:s0.ZodUnion,...N(t)});let ei=e=>{if(e instanceof ed)return ei(e.schema);if(e instanceof ey)return ei(e.innerType());if(e instanceof eh)return[e.value];if(e instanceof ef)return e.options;if(e instanceof em)return Object.keys(e.enum);if(e instanceof ew)return ei(e._def.innerType);if(e instanceof z)return[void 0];else if(e instanceof J)return[null];else return null};class en extends R{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==p.object)return _(t,{code:m.invalid_type,expected:p.object,received:t.parsedType}),x;let r=this.discriminator,i=t.data[r],n=this.optionsMap.get(i);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(_(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let i=new Map;for(let r of t){let t=ei(r.shape[e]);if(!t)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of t){if(i.has(n))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,r)}}return new en({typeName:s0.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...N(r)})}}class es extends R{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=(e,i)=>{if(A(e)||A(i))return x;let n=function e(t,r){let i=f(t),n=f(r);if(t===r)return{valid:!0,data:t};if(i===p.object&&n===p.object){let i=sG.objectKeys(r),n=sG.objectKeys(t).filter(e=>-1!==i.indexOf(e)),s={...t,...r};for(let i of n){let n=e(t[i],r[i]);if(!n.valid)return{valid:!1};s[i]=n.data}return{valid:!0,data:s}}if(i===p.array&&n===p.array){if(t.length!==r.length)return{valid:!1};let i=[];for(let n=0;ni(e,t)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}es.create=(e,t,r)=>new es({left:e,right:t,typeName:s0.ZodIntersection,...N(r)});class ea extends R{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==p.array)return _(r,{code:m.invalid_type,expected:p.array,received:r.parsedType}),x;if(r.data.lengththis._def.items.length&&(_(r,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...r.data].map((e,t)=>{let i=this._def.items[t]||this._def.rest;return i?i._parse(new P(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(i).then(e=>S.mergeArray(t,e)):S.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new ea({...this._def,rest:e})}}ea.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ea({items:e,typeName:s0.ZodTuple,rest:null,...N(t)})};class eo extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==p.object)return _(r,{code:m.invalid_type,expected:p.object,received:r.parsedType}),x;let i=[],n=this._def.keyType,s=this._def.valueType;for(let e in r.data)i.push({key:n._parse(new P(r,e,r.path,e)),value:s._parse(new P(r,r.data[e],r.path,e))});return r.common.async?S.mergeObjectAsync(t,i):S.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return new eo(t instanceof R?{keyType:e,valueType:t,typeName:s0.ZodRecord,...N(r)}:{keyType:B.create(),valueType:e,typeName:s0.ZodRecord,...N(t)})}}class el extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==p.map)return _(r,{code:m.invalid_type,expected:p.map,received:r.parsedType}),x;let i=this._def.keyType,n=this._def.valueType,s=[...r.data.entries()].map(([e,t],s)=>({key:i._parse(new P(r,e,r.path,[s,"key"])),value:n._parse(new P(r,t,r.path,[s,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of s){let i=await r.key,n=await r.value;if("aborted"===i.status||"aborted"===n.status)return x;("dirty"===i.status||"dirty"===n.status)&&t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of s){let i=r.key,n=r.value;if("aborted"===i.status||"aborted"===n.status)return x;("dirty"===i.status||"dirty"===n.status)&&t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}}}el.create=(e,t,r)=>new el({valueType:t,keyType:e,typeName:s0.ZodMap,...N(r)});class eu extends R{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==p.set)return _(r,{code:m.invalid_type,expected:p.set,received:r.parsedType}),x;let i=this._def;null!==i.minSize&&r.data.sizei.maxSize.value&&(_(r,{code:m.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let n=this._def.valueType;function s(e){let r=new Set;for(let i of e){if("aborted"===i.status)return x;"dirty"===i.status&&t.dirty(),r.add(i.value)}return{status:t.value,value:r}}let a=[...r.data.values()].map((e,t)=>n._parse(new P(r,e,r.path,t)));return r.common.async?Promise.all(a).then(e=>s(e)):s(a)}min(e,t){return new eu({...this._def,minSize:{value:e,message:sY.toString(t)}})}max(e,t){return new eu({...this._def,maxSize:{value:e,message:sY.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}eu.create=(e,t)=>new eu({valueType:e,minSize:null,maxSize:null,typeName:s0.ZodSet,...N(t)});class ec extends R{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==p.function)return _(t,{code:m.invalid_type,expected:p.function,received:t.parsedType}),x;function r(e,r){return w({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,b(),y].filter(e=>!!e),issueData:{code:m.invalid_arguments,argumentsError:r}})}function i(e,r){return w({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,b(),y].filter(e=>!!e),issueData:{code:m.invalid_return_type,returnTypeError:r}})}let n={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof eg){let e=this;return E(async function(...t){let a=new g([]),o=await e._def.args.parseAsync(t,n).catch(e=>{throw a.addIssue(r(t,e)),a}),l=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(l,n).catch(e=>{throw a.addIssue(i(l,e)),a})})}{let e=this;return E(function(...t){let a=e._def.args.safeParse(t,n);if(!a.success)throw new g([r(t,a.error)]);let o=Reflect.apply(s,this,a.data),l=e._def.returns.safeParse(o,n);if(!l.success)throw new g([i(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ec({...this._def,args:ea.create(e).rest(G.create())})}returns(e){return new ec({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ec({args:e||ea.create([]).rest(G.create()),returns:t||G.create(),typeName:s0.ZodFunction,...N(r)})}}class ed extends R{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ed.create=(e,t)=>new ed({getter:e,typeName:s0.ZodLazy,...N(t)});class eh extends R{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return _(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ep(e,t){return new ef({values:e,typeName:s0.ZodEnum,...N(t)})}eh.create=(e,t)=>new eh({value:e,typeName:s0.ZodLiteral,...N(t)});class ef extends R{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return _(t,{expected:sG.joinValues(r),received:t.parsedType,code:m.invalid_type}),x}if(-1===this._def.values.indexOf(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return _(t,{received:t.data,code:m.invalid_enum_value,options:r}),x}return E(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return ef.create(e)}exclude(e){return ef.create(this.options.filter(t=>!e.includes(t)))}}ef.create=ep;class em extends R{_parse(e){let t=sG.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==p.string&&r.parsedType!==p.number){let e=sG.objectValues(t);return _(r,{expected:sG.joinValues(e),received:r.parsedType,code:m.invalid_type}),x}if(-1===t.indexOf(e.data)){let e=sG.objectValues(t);return _(r,{received:r.data,code:m.invalid_enum_value,options:e}),x}return E(e.data)}get enum(){return this._def.values}}em.create=(e,t)=>new em({values:e,typeName:s0.ZodNativeEnum,...N(t)});class eg extends R{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==p.promise&&!1===t.common.async?(_(t,{code:m.invalid_type,expected:p.promise,received:t.parsedType}),x):E((t.parsedType===p.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}eg.create=(e,t)=>new eg({type:e,typeName:s0.ZodPromise,...N(t)});class ey extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===s0.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:e=>{_(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){let e=i.transform(r.data,n);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then(e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r})):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===i.type){let e=e=>{let t=i.refinement(e,n);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?x:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===i.status?x:("dirty"===i.status&&t.dirty(),e(i.value),{status:t.value,value:i.value})}}if("transform"===i.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>C(e)?Promise.resolve(i.transform(e.value,n)).then(e=>({status:t.value,value:e})):e);{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!C(e))return e;let s=i.transform(e.value,n);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}}sG.assertNever(i)}}ey.create=(e,t,r)=>new ey({schema:e,typeName:s0.ZodEffects,effect:t,...N(r)}),ey.createWithPreprocess=(e,t,r)=>new ey({schema:t,effect:{type:"preprocess",transform:e},typeName:s0.ZodEffects,...N(r)});class ev extends R{_parse(e){return this._getType(e)===p.undefined?E(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ev.create=(e,t)=>new ev({innerType:e,typeName:s0.ZodOptional,...N(t)});class eb extends R{_parse(e){return this._getType(e)===p.null?E(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eb.create=(e,t)=>new eb({innerType:e,typeName:s0.ZodNullable,...N(t)});class ew extends R{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===p.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ew.create=(e,t)=>new ew({innerType:e,typeName:s0.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...N(t)});class e_ extends R{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return O(i)?i.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new g(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new g(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}e_.create=(e,t)=>new e_({innerType:e,typeName:s0.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...N(t)});class eS extends R{_parse(e){if(this._getType(e)!==p.nan){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:p.nan,received:t.parsedType}),x}return{status:"valid",value:e.data}}}eS.create=e=>new eS({typeName:s0.ZodNaN,...N(e)});let ex=Symbol("zod_brand");class ek extends R{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eE extends R{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),k(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eE({in:e,out:t,typeName:s0.ZodPipeline})}}class eA extends R{_parse(e){let t=this._def.innerType._parse(e);return C(t)&&(t.value=Object.freeze(t.value)),t}}eA.create=(e,t)=>new eA({innerType:e,typeName:s0.ZodReadonly,...N(t)});let eT=(e,t={},r)=>e?Z.create().superRefine((i,n)=>{var s,a;if(!e(i)){let e="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,o=null===(a=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===a||a;n.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:o})}}):Z.create(),eC={object:et.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(s0||(s0={}));let eO=B.create,eP=H.create,e$=eS.create,eN=K.create,eR=F.create,eI=V.create,ej=W.create,eL=z.create,eD=J.create,eM=Z.create,eU=G.create,eq=X.create,eQ=Y.create,eB=ee.create,eH=et.create,eK=et.strictCreate,eF=er.create,eV=en.create,eW=es.create,ez=ea.create,eJ=eo.create,eZ=el.create,eG=eu.create,eX=ec.create,eY=ed.create,e0=eh.create,e1=ef.create,e6=em.create,e2=eg.create,e4=ey.create,e5=ev.create,e3=eb.create,e8=ey.createWithPreprocess,e9=eE.create;var e7=Object.freeze({__proto__:null,defaultErrorMap:y,setErrorMap:function(e){v=e},getErrorMap:b,makeIssue:w,EMPTY_PATH:[],addIssueToContext:_,ParseStatus:S,INVALID:x,DIRTY:k,OK:E,isAborted:A,isDirty:T,isValid:C,isAsync:O,get util(){return sG},get objectUtil(){return sX},ZodParsedType:p,getParsedType:f,ZodType:R,ZodString:B,ZodNumber:H,ZodBigInt:K,ZodBoolean:F,ZodDate:V,ZodSymbol:W,ZodUndefined:z,ZodNull:J,ZodAny:Z,ZodUnknown:G,ZodNever:X,ZodVoid:Y,ZodArray:ee,ZodObject:et,ZodUnion:er,ZodDiscriminatedUnion:en,ZodIntersection:es,ZodTuple:ea,ZodRecord:eo,ZodMap:el,ZodSet:eu,ZodFunction:ec,ZodLazy:ed,ZodLiteral:eh,ZodEnum:ef,ZodNativeEnum:em,ZodPromise:eg,ZodEffects:ey,ZodTransformer:ey,ZodOptional:ev,ZodNullable:eb,ZodDefault:ew,ZodCatch:e_,ZodNaN:eS,BRAND:ex,ZodBranded:ek,ZodPipeline:eE,ZodReadonly:eA,custom:eT,Schema:R,ZodSchema:R,late:eC,get ZodFirstPartyTypeKind(){return s0},coerce:{string:e=>B.create({...e,coerce:!0}),number:e=>H.create({...e,coerce:!0}),boolean:e=>F.create({...e,coerce:!0}),bigint:e=>K.create({...e,coerce:!0}),date:e=>V.create({...e,coerce:!0})},any:eM,array:eB,bigint:eN,boolean:eR,date:eI,discriminatedUnion:eV,effect:e4,enum:e1,function:eX,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>eT(t=>t instanceof e,t),intersection:eW,lazy:eY,literal:e0,map:eZ,nan:e$,nativeEnum:e6,never:eq,null:eD,nullable:e3,number:eP,object:eH,oboolean:()=>eR().optional(),onumber:()=>eP().optional(),optional:e5,ostring:()=>eO().optional(),pipeline:e9,preprocess:e8,promise:e2,record:eJ,set:eG,strictObject:eK,string:eO,symbol:ej,transformer:e4,tuple:ez,undefined:eL,union:eF,unknown:eU,void:eQ,NEVER:x,ZodIssueCode:m,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:g});let te=function(e){let t="object"==typeof e.client?e.client:{},r="object"==typeof e.server?e.server:{},i=e.shared,n=e.runtimeEnv?e.runtimeEnv:{...process.env,...e.experimental__runtimeEnv};return function(e){let t=e.runtimeEnvStrict??e.runtimeEnv??process.env;if(e.emptyStringAsUndefined)for(let[e,r]of Object.entries(t))""===r&&delete t[e];if(e.skipValidation)return t;let r="object"==typeof e.client?e.client:{},i="object"==typeof e.server?e.server:{},n="object"==typeof e.shared?e.shared:{},s=e7.object(r),a=e7.object(i),o=e7.object(n),l=e.isServer??!0,u=s.merge(o),c=a.merge(o).merge(s),d=l?c.safeParse(t):u.safeParse(t),h=e.onValidationError??(e=>{throw console.error("❌ Invalid environment variables:",e.flatten().fieldErrors),Error("Invalid environment variables")}),p=e.onInvalidAccess??(e=>{throw Error("❌ Attempted to access a server-side environment variable on the client")});return!1===d.success?h(d.error):new Proxy(d.data,{get(t,r){if("string"==typeof r&&"__esModule"!==r&&"$$typeof"!==r)return l||!e.clientPrefix||r.startsWith(e.clientPrefix)||void 0!==o.shape[r]?t[r]:p(r)}})}({...e,shared:i,client:t,server:r,clientPrefix:"NEXT_PUBLIC_",runtimeEnv:n})}({server:{DATABASE_URL:e7.string().refine(e=>!e.includes("YOUR_MYSQL_URL_HERE"),"You forgot to change the default URL"),NODE_ENV:e7.enum(["development","test","production"]).default("development"),NEXTAUTH_SECRET:e7.string(),NEXTAUTH_URL:e7.preprocess(e=>process.env.VERCEL_URL??e,process.env.VERCEL?e7.string():e7.string().url()),GOOGLE_CLIENT_ID:e7.string(),GOOGLE_CLIENT_SECRET:e7.string()},client:{},runtimeEnv:{DATABASE_URL:process.env.DATABASE_URL,NODE_ENV:"production",NEXTAUTH_SECRET:process.env.NEXTAUTH_SECRET,NEXTAUTH_URL:process.env.NEXTAUTH_URL,GOOGLE_CLIENT_ID:process.env.GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET:process.env.GOOGLE_CLIENT_SECRET},skipValidation:!!process.env.SKIP_ENV_VALIDATION,emptyStringAsUndefined:!0});var tt=r(2209),tr=r(4711),ti=r(4135),tn=r(7921),ts=r(2396),ta=r(2801),to=r(5469),tl=r(1677),tu=r(753),tc=r(1404),td=r(9355),th=r(2688),tp=r(2878);let tf=Symbol.for("drizzle:MySqlInlineForeignKeys");class tm extends tl.iA{static{tl.iA.Symbol.Columns,n=tl.iA.Symbol.ExtraConfigBuilder}static{this[tt.Q]="MySqlTable"}static{this.Symbol=Object.assign({},tl.iA.Symbol,{InlineForeignKeys:tf})}constructor(...e){super(...e),this[tf]=[],this[n]=void 0}}let tg=(e,t,r)=>(function(e,t,r,i,n=e){let s=new tm(e,i,n),a=Object.fromEntries(Object.entries(t).map(([e,t])=>{let r=t.build(s);return s[tf].push(...t.buildForeignKeys(r,s)),[e,r]})),o=Object.assign(s,a);return o[tl.iA.Symbol.Columns]=a,r&&(o[tm.Symbol.ExtraConfigBuilder]=r),o})(e,t,r,void 0,e);class ty{static{this[tt.Q]="MySqlForeignKeyBuilder"}constructor(e,t){this.reference=()=>{let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignTable:i[0].table,foreignColumns:i}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new tv(e,this)}}class tv{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static{this[tt.Q]="MySqlForeignKey"}getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map(e=>e.name),n=r.map(e=>e.name),s=[this.table[tm.Symbol.Name],...i,r[0].table[tm.Symbol.Name],...n];return e??`${s.join("_")}_fk`}}function tb(e,t){return`${e[tm.Symbol.Name]}_${t.join("_")}_unique`}class tw{constructor(e,t){this.name=t,this.columns=e}static{this[tt.Q]="MySqlUniqueConstraintBuilder"}build(e){return new tS(e,this.columns,this.name)}}class t_{static{this[tt.Q]="MySqlUniqueOnConstraintBuilder"}constructor(e){this.name=e}on(...e){return new tw(e,this.name)}}class tS{constructor(e,t,r){this.nullsNotDistinct=!1,this.table=e,this.columns=t,this.name=r??tb(this.table,this.columns.map(e=>e.name))}static{this[tt.Q]="MySqlUniqueConstraint"}getName(){return this.name}}class tx extends tp.L{static{this[tt.Q]="MySqlColumnBuilder"}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>((r,i)=>{let n=new ty(()=>({columns:[e],foreignColumns:[r()]}));return i.onUpdate&&n.onUpdate(i.onUpdate),i.onDelete&&n.onDelete(i.onDelete),n.build(t)})(r,i))}constructor(...e){super(...e),this.foreignKeyConfigs=[]}}class tk extends ts.s{constructor(e,t){t.uniqueName||(t.uniqueName=tb(e,[t.name])),super(e,t),this.table=e}static{this[tt.Q]="MySqlColumn"}}class tE extends tx{static{this[tt.Q]="MySqlColumnBuilderWithAutoIncrement"}constructor(e,t,r){super(e,t,r),this.config.autoIncrement=!1}autoincrement(){return this.config.autoIncrement=!0,this.config.hasDefault=!0,this}}class tA extends tk{static{this[tt.Q]="MySqlColumnWithAutoIncrement"}constructor(...e){super(...e),this.autoIncrement=this.config.autoIncrement}}class tT extends to.G7{static{this[tt.Q]="MySqlViewBase"}}class tC{static{this[tt.Q]="MySqlDialect"}async migrate(e,t,r){let i=r.migrationsTable??"__drizzle_migrations",n=to.i6`
+ create table if not exists ${to.i6.identifier(i)} (
id serial primary key,
hash text not null,
created_at bigint
)
- `;await t.execute(n);let o=(await t.all(g.i6`select id, hash, created_at from ${g.i6.identifier(i)} order by created_at desc limit 1`))[0];await t.transaction(async t=>{for(let r of e)if(!o||Number(o.created_at){let o=e[m.iA.Symbol.Columns][t],s=g.i6`${g.i6.identifier(o.name)} = ${r}`;return n{let n=[];if((0,u.is)(e,g.$s.Aliased)&&e.isSelectionField)n.push(g.i6.identifier(e.fieldAlias));else if((0,u.is)(e,g.$s.Aliased)||(0,u.is)(e,g.$s)){let r=(0,u.is)(e,g.$s.Aliased)?e.sql:e;t?n.push(new g.$s(r.queryChunks.map(e=>(0,u.is)(e,$)?g.i6.identifier(e.name):e))):n.push(r),(0,u.is)(e,g.$s.Aliased)&&n.push(g.i6` as ${g.i6.identifier(e.fieldAlias)}`)}else(0,u.is)(e,f.s)&&(t?n.push(g.i6.identifier(e.name)):n.push(e));return ie===(O[m.iA.Symbol.IsAlias]?m.SP(O):O[m.iA.Symbol.BaseName])))){let t=(0,m.SP)(e.field.table);throw Error(`Your "${e.path.join("->")}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}}let T=!s||0===s.length;if(e?.length){let t=[g.i6`with `];for(let[r,i]of e.entries())t.push(g.i6`${g.i6.identifier(i[h.g1].alias)} as (${i[h.g1].sql})`),r0&&(S=g.i6` order by ${g.i6.join(a,g.i6`, `)}`),l&&l.length>0&&(k=g.i6` group by ${g.i6.join(l,g.i6`, `)}`);let R=c?g.i6` limit ${c}`:void 0,W=d?g.i6` offset ${d}`:void 0;if(p){let{config:e,strength:t}=p;A=g.i6` for ${g.i6.raw(t)}`,e.noWait?A.append(g.i6` no wait`):e.skipLocked&&A.append(g.i6` skip locked`)}let K=g.i6`${b}select${P} ${j} from ${C}${$}${J}${k}${M}${S}${R}${W}${A}`;return w.length>0?this.buildSetOperations(K,w):K}buildSetOperations(e,t){let[r,...i]=t;if(!r)throw Error("Cannot pass undefined values to any set operator");return 0===i.length?this.buildSetOperationQuery({leftSelect:e,setOperator:r}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:r}),i)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:r,rightSelect:i,limit:n,orderBy:o,offset:s}}){let a;let l=g.i6`(${e.getSQL()}) `,c=g.i6`(${i.getSQL()})`;if(o&&o.length>0){let e=[];for(let t of o)if((0,u.is)(t,$))e.push(g.i6.identifier(t.name));else if((0,u.is)(t,g.$s)){for(let e=0;eg.i6.identifier(e.name));for(let[e,r]of t.entries()){let i=[];for(let[e,t]of o){let n=r[e];if(void 0===n||(0,u.is)(n,g.dO)&&void 0===n.value){if(void 0!==t.defaultFn){let e=t.defaultFn(),r=(0,u.is)(e,g.$s)?e:g.i6.param(e,t);i.push(r)}else i.push(g.i6`default`)}else i.push(n)}n.push(i),e({dbKey:t.name,tsKey:e,field:(0,p.lw)(t,s),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let i=Object.fromEntries(Object.entries(n.columns).map(([e,t])=>[e,(0,p.lw)(t,s)]));if(o.where){let e="function"==typeof o.where?o.where(i,(0,y.vU)()):o.where;v=e&&(0,p.UI)(e,s)}let a=[],l=[];if(o.columns){let e=!1;for(let[t,r]of Object.entries(o.columns))void 0!==r&&t in n.columns&&(e||!0!==r||(e=!0),l.push(t));l.length>0&&(l=e?l.filter(e=>o.columns?.[e]===!0):Object.keys(n.columns).filter(e=>!l.includes(e)))}else l=Object.keys(n.columns);for(let e of l){let t=n.columns[e];a.push({tsKey:e,value:t})}let b=[];if(o.with&&(b=Object.entries(o.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:n.relations[e]}))),o.extras)for(let[e,t]of Object.entries("function"==typeof o.extras?o.extras(i,{sql:g.i6}):o.extras))a.push({tsKey:e,value:(0,p.qD)(t,s)});for(let{tsKey:e,value:t}of a)k.push({dbKey:(0,u.is)(t,g.$s.Aliased)?t.fieldAlias:n.columns[e].name,tsKey:e,field:(0,u.is)(t,f.s)?(0,p.lw)(t,s):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let S="function"==typeof o.orderBy?o.orderBy(i,(0,y.pl)()):o.orderBy??[];for(let{tsKey:i,queryConfig:n,relation:a}of(Array.isArray(S)||(S=[S]),_=S.map(e=>(0,u.is)(e,f.s)?(0,p.lw)(e,s):(0,p.UI)(e,s)),c=o.limit,d=o.offset,b)){let o=(0,y.wG)(t,r,a),l=r[a.referencedTable[m.iA.Symbol.Name]],c=`${s}_${i}`,d=(0,w.xD)(...o.fields.map((e,t)=>(0,w.eq)((0,p.lw)(o.references[t],c),(0,p.lw)(e,s)))),f=this.buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:r,table:e[l],tableConfig:t[l],queryConfig:(0,u.is)(a,y.fh)?!0===n?{limit:1}:{...n,limit:1}:n,tableAlias:c,joinOn:d,nestedQueryRelation:a}),_=g.i6`${g.i6.identifier(c)}.${g.i6.identifier("data")}`.as(i);A.push({on:g.i6`true`,table:new h.k(f.sql,{},c),alias:c,joinType:"left",lateral:!0}),k.push({dbKey:i,tsKey:i,field:_,relationTableTsKey:l,isJson:!0,selection:f.selection})}}if(0===k.length)throw new b.k({message:`No fields selected for table "${n.tsName}" ("${s}")`});if(v=(0,w.xD)(l,v),a){let e=g.i6`json_array(${g.i6.join(k.map(({field:e,tsKey:t,isJson:r})=>r?g.i6`${g.i6.identifier(`${s}_${t}`)}.${g.i6.identifier("data")}`:(0,u.is)(e,g.$s.Aliased)?e.sql:e),g.i6`, `)})`;(0,u.is)(a,y.sj)&&(e=g.i6`coalesce(json_arrayagg(${e}), json_array())`);let t=[{dbKey:"data",tsKey:"data",field:e.as("data"),isJson:!0,relationTableTsKey:n.tsName,selection:k}];void 0!==c||void 0!==d||(_?.length??0)>0?(S=this.buildSelectQuery({table:(0,p.RQ)(i,s),fields:{},fieldsFlat:[{path:[],field:g.i6.raw("*")},...(_?.length??0)>0?[{path:[],field:g.i6`row_number() over (order by ${g.i6.join(_,g.i6`, `)})`}]:[]],where:v,limit:c,offset:d,setOperators:[]}),v=void 0,c=void 0,d=void 0,_=void 0):S=(0,p.RQ)(i,s),S=this.buildSelectQuery({table:(0,u.is)(S,E)?S:new h.k(S,{},s),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:(0,u.is)(e,f.s)?(0,p.lw)(e,s):e})),joins:A,where:v,limit:c,offset:d,orderBy:_,setOperators:[]})}else S=this.buildSelectQuery({table:(0,p.RQ)(i,s),fields:{},fieldsFlat:k.map(({field:e})=>({path:[],field:(0,u.is)(e,f.s)?(0,p.lw)(e,s):e})),joins:A,where:v,limit:c,offset:d,orderBy:_,setOperators:[]});return{tableTsKey:n.tsName,sql:S,selection:k}}buildRelationalQueryWithoutLateralSubqueries({fullSchema:e,schema:t,tableNamesMap:r,table:i,tableConfig:n,queryConfig:o,tableAlias:s,nestedQueryRelation:a,joinOn:l}){let c,d=[],_,v,S=[],k;if(!0===o)d=Object.entries(n.columns).map(([e,t])=>({dbKey:t.name,tsKey:e,field:(0,p.lw)(t,s),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let i=Object.fromEntries(Object.entries(n.columns).map(([e,t])=>[e,(0,p.lw)(t,s)]));if(o.where){let e="function"==typeof o.where?o.where(i,(0,y.vU)()):o.where;k=e&&(0,p.UI)(e,s)}let a=[],l=[];if(o.columns){let e=!1;for(let[t,r]of Object.entries(o.columns))void 0!==r&&t in n.columns&&(e||!0!==r||(e=!0),l.push(t));l.length>0&&(l=e?l.filter(e=>o.columns?.[e]===!0):Object.keys(n.columns).filter(e=>!l.includes(e)))}else l=Object.keys(n.columns);for(let e of l){let t=n.columns[e];a.push({tsKey:e,value:t})}let c=[];if(o.with&&(c=Object.entries(o.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:n.relations[e]}))),o.extras)for(let[e,t]of Object.entries("function"==typeof o.extras?o.extras(i,{sql:g.i6}):o.extras))a.push({tsKey:e,value:(0,p.qD)(t,s)});for(let{tsKey:e,value:t}of a)d.push({dbKey:(0,u.is)(t,g.$s.Aliased)?t.fieldAlias:n.columns[e].name,tsKey:e,field:(0,u.is)(t,f.s)?(0,p.lw)(t,s):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let h="function"==typeof o.orderBy?o.orderBy(i,(0,y.pl)()):o.orderBy??[];for(let{tsKey:i,queryConfig:n,relation:a}of(Array.isArray(h)||(h=[h]),S=h.map(e=>(0,u.is)(e,f.s)?(0,p.lw)(e,s):(0,p.UI)(e,s)),_=o.limit,v=o.offset,c)){let o=(0,y.wG)(t,r,a),l=r[a.referencedTable[m.iA.Symbol.Name]],c=`${s}_${i}`,h=(0,w.xD)(...o.fields.map((e,t)=>(0,w.eq)((0,p.lw)(o.references[t],c),(0,p.lw)(e,s)))),f=this.buildRelationalQueryWithoutLateralSubqueries({fullSchema:e,schema:t,tableNamesMap:r,table:e[l],tableConfig:t[l],queryConfig:(0,u.is)(a,y.fh)?!0===n?{limit:1}:{...n,limit:1}:n,tableAlias:c,joinOn:h,nestedQueryRelation:a}),_=g.i6`(${f.sql})`;(0,u.is)(a,y.sj)&&(_=g.i6`coalesce(${_}, json_array())`);let v=_.as(i);d.push({dbKey:i,tsKey:i,field:v,relationTableTsKey:l,isJson:!0,selection:f.selection})}}if(0===d.length)throw new b.k({message:`No fields selected for table "${n.tsName}" ("${s}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});if(k=(0,w.xD)(l,k),a){let e=g.i6`json_array(${g.i6.join(d.map(({field:e})=>(0,u.is)(e,$)?g.i6.identifier(e.name):(0,u.is)(e,g.$s.Aliased)?e.sql:e),g.i6`, `)})`;(0,u.is)(a,y.sj)&&(e=g.i6`json_arrayagg(${e})`);let t=[{dbKey:"data",tsKey:"data",field:e,isJson:!0,relationTableTsKey:n.tsName,selection:d}];void 0!==_||void 0!==v||S.length>0?(c=this.buildSelectQuery({table:(0,p.RQ)(i,s),fields:{},fieldsFlat:[{path:[],field:g.i6.raw("*")},...S.length>0?[{path:[],field:g.i6`row_number() over (order by ${g.i6.join(S,g.i6`, `)})`}]:[]],where:k,limit:_,offset:v,setOperators:[]}),k=void 0,_=void 0,v=void 0,S=void 0):c=(0,p.RQ)(i,s),c=this.buildSelectQuery({table:(0,u.is)(c,E)?c:new h.k(c,{},s),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:(0,u.is)(e,f.s)?(0,p.lw)(e,s):e})),where:k,limit:_,offset:v,orderBy:S,setOperators:[]})}else c=this.buildSelectQuery({table:(0,p.RQ)(i,s),fields:{},fieldsFlat:d.map(({field:e})=>({path:[],field:(0,u.is)(e,f.s)?(0,p.lw)(e,s):e})),where:k,limit:_,offset:v,orderBy:S,setOperators:[]});return{tableTsKey:n.tsName,sql:c,selection:d}}}var W=r(6834),K=r(2852);class U{static{this[u.Q]="MySqlSelectBuilder"}constructor(e){this.withList=[],this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}from(e){let t;let r=!!this.fields;return t=this.fields?this.fields:(0,u.is)(e,h.k)?Object.fromEntries(Object.keys(e[h.g1].selection).map(t=>[t,e[t]])):(0,u.is)(e,N)?e[v.d].selectedFields:(0,u.is)(e,g.$s)?{}:(0,_.SS)(e),new D({table:e,fields:t,isPartialSelect:r,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class H extends W.b{static{this[u.Q]="MySqlSelectQueryBuilder"}constructor({table:e,fields:t,isPartialSelect:r,session:i,dialect:n,withList:o,distinct:s}){super(),this.leftJoin=this.createJoin("left"),this.rightJoin=this.createJoin("right"),this.innerJoin=this.createJoin("inner"),this.fullJoin=this.createJoin("full"),this.union=this.createSetOperator("union",!1),this.unionAll=this.createSetOperator("union",!0),this.intersect=this.createSetOperator("intersect",!1),this.intersectAll=this.createSetOperator("intersect",!0),this.except=this.createSetOperator("except",!1),this.exceptAll=this.createSetOperator("except",!0),this.config={withList:o,table:e,fields:{...t},distinct:s,setOperators:[]},this.isPartialSelect=r,this.session=i,this.dialect=n,this._={selectedFields:t},this.tableName=(0,_.dP)(e),this.joinsNotNullableMap="string"==typeof this.tableName?{[this.tableName]:!0}:{}}createJoin(e){return(t,r)=>{let i=this.tableName,n=(0,_.dP)(t);if("string"==typeof n&&this.config.joins?.some(e=>e.alias===n))throw Error(`Alias "${n}" is already used in this query`);if(!this.isPartialSelect&&(1===Object.keys(this.joinsNotNullableMap).length&&"string"==typeof i&&(this.config.fields={[i]:this.config.fields}),"string"==typeof n&&!(0,u.is)(t,g.$s))){let e=(0,u.is)(t,h.k)?t[h.g1].selection:(0,u.is)(t,g.G7)?t[v.d].selectedFields:t[m.iA.Symbol.Columns];this.config.fields[n]=e}if("function"==typeof r&&(r=r(new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:t,joinType:e,alias:n}),"string"==typeof n)switch(e){case"left":this.joinsNotNullableMap[n]=!1;break;case"right":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[n]=!0;break;case"inner":this.joinsNotNullableMap[n]=!0;break;case"full":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[n]=!1}return this}}createSetOperator(e,t){return r=>{let i="function"==typeof r?r(L()):r;if(!(0,_.ux)(this.getSelectedFields(),i.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:t,rightSelect:i}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=r:this.config.orderBy=r}else this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=e:this.config.orderBy=e;return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){return new Proxy(new h.k(this.getSQL(),this.config.fields,e),new d.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new d.e({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class D extends H{static{this[u.Q]="MySqlSelect"}prepare(){if(!this.session)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");let e=(0,_.ZS)(this.config.fields),t=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),e);return t.joinsNotNullableMap=this.joinsNotNullableMap,t}constructor(...e){super(...e),this.execute=e=>this.prepare().execute(e),this.createIterator=()=>{let e=this;return async function*(t){yield*e.prepare().iterator(t)}},this.iterator=this.createIterator()}}function q(e,t){return(r,i,...n)=>{let o=[i,...n].map(r=>({type:e,isAll:t,rightSelect:r}));for(let e of o)if(!(0,_.ux)(r.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return r.addSetOperators(o)}}(0,_.ef)(D,[K.N]);let L=()=>({union:B,unionAll:Q,intersect:z,intersectAll:F,except:V,exceptAll:G}),B=q("union",!1),Q=q("union",!0),z=q("intersect",!1),F=q("intersect",!0),V=q("except",!1),G=q("except",!0);class X{static{this[u.Q]="MySqlQueryBuilder"}$with(e){let t=this;return{as:r=>("function"==typeof r&&(r=r(t)),new Proxy(new h.SC(r.getSQL(),r.getSelectedFields(),e,!0),new d.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(r){return new U({fields:r??void 0,session:void 0,dialect:t.getDialect(),withList:e})},selectDistinct:function(r){return new U({fields:r??void 0,session:void 0,dialect:t.getDialect(),withList:e,distinct:!0})}}}select(e){return new U({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new U({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){return this.dialect||(this.dialect=new R),this.dialect}}class Y{constructor(e,t,r){this.table=e,this.session=t,this.dialect=r}static{this[u.Q]="MySqlUpdateBuilder"}set(e){return new Z(this.table,(0,_.M6)(this.table,e),this.session,this.dialect)}}class Z extends K.N{constructor(e,t,r,i){super(),this.execute=e=>this.prepare().execute(e),this.createIterator=()=>{let e=this;return async function*(t){yield*e.prepare().iterator(t)}},this.iterator=this.createIterator(),this.session=r,this.dialect=i,this.config={set:t,table:e}}static{this[u.Q]="MySqlUpdate"}where(e){return this.config.where=e,this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}prepare(){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning)}$dynamic(){return this}}class ee{constructor(e,t,r){this.shouldIgnore=!1,this.table=e,this.session=t,this.dialect=r}static{this[u.Q]="MySqlInsertBuilder"}ignore(){return this.shouldIgnore=!0,this}values(e){if(0===(e=Array.isArray(e)?e:[e]).length)throw Error("values() must be called with at least one value");let t=e.map(e=>{let t={},r=this.table[m.iA.Symbol.Columns];for(let i of Object.keys(e)){let n=e[i];t[i]=(0,u.is)(n,g.$s)?n:new g.dO(n,r[i])}return t});return new et(this.table,t,this.shouldIgnore,this.session,this.dialect)}}class et extends K.N{constructor(e,t,r,i,n){super(),this.execute=e=>this.prepare().execute(e),this.createIterator=()=>{let e=this;return async function*(t){yield*e.prepare().iterator(t)}},this.iterator=this.createIterator(),this.session=i,this.dialect=n,this.config={table:e,values:t,ignore:r}}static{this[u.Q]="MySqlInsert"}onDuplicateKeyUpdate(e){let t=this.dialect.buildUpdateSet(this.config.table,(0,_.M6)(this.config.table,e.set));return this.config.onConflict=g.i6`update ${t}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}prepare(){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0)}$dynamic(){return this}}class er extends K.N{constructor(e,t,r){super(),this.execute=e=>this.prepare().execute(e),this.createIterator=()=>{let e=this;return async function*(t){yield*e.prepare().iterator(t)}},this.iterator=this.createIterator(),this.table=e,this.session=t,this.dialect=r,this.config={table:e}}static{this[u.Q]="MySqlDelete"}where(e){return this.config.where=e,this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}prepare(){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning)}$dynamic(){return this}}class ei{constructor(e,t,r,i,n,o,s,a){this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=i,this.tableConfig=n,this.dialect=o,this.session=s,this.mode=a}static{this[u.Q]="MySqlRelationalQueryBuilder"}findMany(e){return new en(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many",this.mode)}findFirst(e){return new en(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first",this.mode)}}class en extends K.N{constructor(e,t,r,i,n,o,s,a,l,c){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=i,this.tableConfig=n,this.dialect=o,this.session=s,this.config=a,this.queryMode=l,this.mode=c}static{this[u.Q]="MySqlRelationalQuery"}prepare(){let{query:e,builtQuery:t}=this._toSQL();return this.session.prepareQuery(t,void 0,t=>{let r=t.map(t=>(0,y.WX)(this.schema,this.tableConfig,t,e.selection));return"first"===this.queryMode?r[0]:r})}_getQuery(){return"planetscale"===this.mode?this.dialect.buildRelationalQueryWithoutLateralSubqueries({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}):this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}_toSQL(){let e=this._getQuery();return{builtQuery:this.dialect.sqlToQuery(e.sql),query:e}}getSQL(){return this._getQuery().sql}toSQL(){return this._toSQL().builtQuery}execute(){return this.prepare().execute()}}class eo{constructor(e,t,r,i){if(this.dialect=e,this.session=t,this.mode=i,this._=r?{schema:r.schema,tableNamesMap:r.tableNamesMap}:{schema:void 0,tableNamesMap:{}},this.query={},this._.schema)for(let[i,n]of Object.entries(this._.schema))this.query[i]=new ei(r.fullSchema,this._.schema,this._.tableNamesMap,r.fullSchema[i],n,e,t,this.mode)}static{this[u.Q]="MySqlDatabase"}$with(e){return{as:t=>("function"==typeof t&&(t=t(new X)),new Proxy(new h.SC(t.getSQL(),t.getSelectedFields(),e,!0),new d.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(r){return new U({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e})},selectDistinct:function(r){return new U({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}}}select(e){return new U({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new U({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}update(e){return new Y(e,this.session,this.dialect)}insert(e){return new ee(e,this.session,this.dialect)}delete(e){return new er(e,this.session,this.dialect)}execute(e){return this.session.execute(e.getSQL())}transaction(e,t){return this.session.transaction(e,t)}}var es=r(3851);class ea{static{this[u.Q]="PgForeignKeyBuilder"}constructor(e,t){this._onUpdate="no action",this._onDelete="no action",this.reference=()=>{let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignTable:i[0].table,foreignColumns:i}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=void 0===e?"no action":e,this}onDelete(e){return this._onDelete=void 0===e?"no action":e,this}build(e){return new el(e,this)}}class el{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static{this[u.Q]="PgForeignKey"}getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map(e=>e.name),n=r.map(e=>e.name),o=[this.table[es.YA.Symbol.Name],...i,r[0].table[es.YA.Symbol.Name],...n];return e??`${o.join("_")}_fk`}}function ec(e,t){return`${e[es.YA.Symbol.Name]}_${t.join("_")}_unique`}class eu{constructor(e,t){this.nullsNotDistinctConfig=!1,this.name=t,this.columns=e}static{this[u.Q]="PgUniqueConstraintBuilder"}nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new eh(e,this.columns,this.nullsNotDistinctConfig,this.name)}}class ed{static{this[u.Q]="PgUniqueOnConstraintBuilder"}constructor(e){this.name=e}on(...e){return new eu(e,this.name)}}class eh{constructor(e,t,r,i){this.nullsNotDistinct=!1,this.table=e,this.columns=t,this.name=i??ec(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=r}static{this[u.Q]="PgUniqueConstraint"}getName(){return this.name}}function ep(e,t,r){for(let i=t;i(0,ef.t)((r,i)=>{let n=new ea(()=>({columns:[e],foreignColumns:[r()]}));return i.onUpdate&&n.onUpdate(i.onUpdate),i.onDelete&&n.onDelete(i.onDelete),n.build(t)},r,i))}constructor(...e){super(...e),this.foreignKeyConfigs=[]}}class eg extends f.s{constructor(e,t){t.uniqueName||(t.uniqueName=ec(e,[t.name])),super(e,t),this.table=e}static{this[u.Q]="PgColumn"}}class em extends ey{static{this[u.Q]="PgArrayBuilder"}constructor(e,t,r){super(e,"array","PgArray"),this.config.baseBuilder=t,this.config.size=r}build(e){let t=this.config.baseBuilder.build(e);return new e_(e,this.config,t)}}class e_ extends eg{constructor(e,t,r,i){super(e,t),this.baseColumn=r,this.range=i,this.size=t.size}static{this[u.Q]="PgArray"}getSQLType(){return`${this.baseColumn.getSQLType()}[${"number"==typeof this.size?this.size:""}]`}mapFromDriverValue(e){return"string"==typeof e&&(e=function(e){let[t]=function e(t,r=0){let i=[],n=r,o=!1;for(;nthis.baseColumn.mapFromDriverValue(e))}mapToDriverValue(e,t=!1){let r=e.map(e=>null===e?null:(0,u.is)(this.baseColumn,e_)?this.baseColumn.mapToDriverValue(e,!0):this.baseColumn.mapToDriverValue(e));return t?r:function e(t){return`{${t.map(t=>Array.isArray(t)?e(t):"string"==typeof t?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}(r)}}class ev extends ey{static{this[u.Q]="PgJsonbBuilder"}constructor(e){super(e,"json","PgJsonb")}build(e){return new ew(e,this.config)}}class ew extends eg{static{this[u.Q]="PgJsonb"}constructor(e,t){super(e,t)}getSQLType(){return"jsonb"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}}class eb extends ey{static{this[u.Q]="PgJsonBuilder"}constructor(e){super(e,"json","PgJson")}build(e){return new eS(e,this.config)}}class eS extends eg{static{this[u.Q]="PgJson"}constructor(e,t){super(e,t)}getSQLType(){return"json"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}}class ek extends ey{static{this[u.Q]="PgNumericBuilder"}constructor(e,t,r){super(e,"string","PgNumeric"),this.config.precision=t,this.config.scale=r}build(e){return new eE(e,this.config)}}class eE extends eg{static{this[u.Q]="PgNumeric"}constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}getSQLType(){return void 0!==this.precision&&void 0!==this.scale?`numeric(${this.precision}, ${this.scale})`:void 0===this.precision?"numeric":`numeric(${this.precision})`}}class eA extends ey{static{this[u.Q]="PgDateColumnBaseBuilder"}defaultNow(){return this.default(g.i6`now()`)}}class ex extends eA{constructor(e,t,r){super(e,"string","PgTime"),this.withTimezone=t,this.precision=r,this.config.withTimezone=t,this.config.precision=r}static{this[u.Q]="PgTimeBuilder"}build(e){return new eO(e,this.config)}}class eO extends eg{static{this[u.Q]="PgTime"}constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":`(${this.precision})`;return`time${e}${this.withTimezone?" with time zone":""}`}}class eT extends eA{static{this[u.Q]="PgTimestampBuilder"}constructor(e,t,r){super(e,"date","PgTimestamp"),this.config.withTimezone=t,this.config.precision=r}build(e){return new eP(e,this.config)}}class eP extends eg{static{this[u.Q]="PgTimestamp"}constructor(e,t){super(e,t),this.mapFromDriverValue=e=>new Date(this.withTimezone?e:e+"+0000"),this.mapToDriverValue=e=>this.withTimezone?e.toUTCString():e.toISOString(),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":` (${this.precision})`;return`timestamp${e}${this.withTimezone?" with time zone":""}`}}class ej extends eA{static{this[u.Q]="PgTimestampStringBuilder"}constructor(e,t,r){super(e,"string","PgTimestampString"),this.config.withTimezone=t,this.config.precision=r}build(e){return new eC(e,this.config)}}class eC extends eg{static{this[u.Q]="PgTimestampString"}constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":`(${this.precision})`;return`timestamp${e}${this.withTimezone?" with time zone":""}`}}function eI(e,t={}){return"string"===t.mode?new ej(e,t.withTimezone??!1,t.precision):new eT(e,t.withTimezone??!1,t.precision)}class e$ extends eA{static{this[u.Q]="PgDateBuilder"}constructor(e){super(e,"date","PgDate")}build(e){return new eJ(e,this.config)}}class eJ extends eg{static{this[u.Q]="PgDate"}getSQLType(){return"date"}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}}class eM extends eA{static{this[u.Q]="PgDateStringBuilder"}constructor(e){super(e,"string","PgDateString")}build(e){return new eN(e,this.config)}}class eN extends eg{static{this[u.Q]="PgDateString"}getSQLType(){return"date"}}class eR extends ey{static{this[u.Q]="PgUUIDBuilder"}constructor(e){super(e,"string","PgUUID")}defaultRandom(){return this.default(g.i6`gen_random_uuid()`)}build(e){return new eW(e,this.config)}}class eW extends eg{static{this[u.Q]="PgUUID"}getSQLType(){return"uuid"}}class eK extends g.G7{static{this[u.Q]="PgViewBase"}}class eU{static{this[u.Q]="PgDialect"}async migrate(e,t){let r=g.i6`
+ `;await t.execute(n);let s=(await t.all(to.i6`select id, hash, created_at from ${to.i6.identifier(i)} order by created_at desc limit 1`))[0];await t.transaction(async t=>{for(let r of e)if(!s||Number(s.created_at){let s=e[tl.iA.Symbol.Columns][t],a=to.i6`${to.i6.identifier(s.name)} = ${r}`;return n{let n=[];if((0,tt.is)(e,to.$s.Aliased)&&e.isSelectionField)n.push(to.i6.identifier(e.fieldAlias));else if((0,tt.is)(e,to.$s.Aliased)||(0,tt.is)(e,to.$s)){let r=(0,tt.is)(e,to.$s.Aliased)?e.sql:e;t?n.push(new to.$s(r.queryChunks.map(e=>(0,tt.is)(e,tk)?to.i6.identifier(e.name):e))):n.push(r),(0,tt.is)(e,to.$s.Aliased)&&n.push(to.i6` as ${to.i6.identifier(e.fieldAlias)}`)}else(0,tt.is)(e,ts.s)&&(t?n.push(to.i6.identifier(e.name)):n.push(e));return ie===(b[tl.iA.Symbol.IsAlias]?tl.SP(b):b[tl.iA.Symbol.BaseName])))){let t=(0,tl.SP)(e.field.table);throw Error(`Your "${e.path.join("->")}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}}let w=!a||0===a.length;if(e?.length){let t=[to.i6`with `];for(let[r,i]of e.entries())t.push(to.i6`${to.i6.identifier(i[ti.g1].alias)} as (${i[ti.g1].sql})`),r0&&(m=to.i6` order by ${to.i6.join(o,to.i6`, `)}`),l&&l.length>0&&(g=to.i6` group by ${to.i6.join(l,to.i6`, `)}`);let C=u?to.i6` limit ${u}`:void 0,O=c?to.i6` offset ${c}`:void 0;if(d){let{config:e,strength:t}=d;y=to.i6` for ${to.i6.raw(t)}`,e.noWait?y.append(to.i6` no wait`):e.skipLocked&&y.append(to.i6` skip locked`)}let P=to.i6`${f}select${_} ${S} from ${x}${E}${A}${g}${T}${m}${C}${O}${y}`;return p.length>0?this.buildSetOperations(P,p):P}buildSetOperations(e,t){let[r,...i]=t;if(!r)throw Error("Cannot pass undefined values to any set operator");return 0===i.length?this.buildSetOperationQuery({leftSelect:e,setOperator:r}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:r}),i)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:r,rightSelect:i,limit:n,orderBy:s,offset:a}}){let o;let l=to.i6`(${e.getSQL()}) `,u=to.i6`(${i.getSQL()})`;if(s&&s.length>0){let e=[];for(let t of s)if((0,tt.is)(t,tk))e.push(to.i6.identifier(t.name));else if((0,tt.is)(t,to.$s)){for(let e=0;eto.i6.identifier(e.name));for(let[e,r]of t.entries()){let i=[];for(let[e,t]of s){let n=r[e];if(void 0===n||(0,tt.is)(n,to.dO)&&void 0===n.value){if(void 0!==t.defaultFn){let e=t.defaultFn(),r=(0,tt.is)(e,to.$s)?e:to.i6.param(e,t);i.push(r)}else i.push(to.i6`default`)}else i.push(n)}n.push(i),e({dbKey:t.name,tsKey:e,field:(0,tn.lw)(t,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let i=Object.fromEntries(Object.entries(n.columns).map(([e,t])=>[e,(0,tn.lw)(t,a)]));if(s.where){let e="function"==typeof s.where?s.where(i,(0,ta.vU)()):s.where;h=e&&(0,tn.UI)(e,a)}let o=[],l=[];if(s.columns){let e=!1;for(let[t,r]of Object.entries(s.columns))void 0!==r&&t in n.columns&&(e||!0!==r||(e=!0),l.push(t));l.length>0&&(l=e?l.filter(e=>s.columns?.[e]===!0):Object.keys(n.columns).filter(e=>!l.includes(e)))}else l=Object.keys(n.columns);for(let e of l){let t=n.columns[e];o.push({tsKey:e,value:t})}let p=[];if(s.with&&(p=Object.entries(s.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:n.relations[e]}))),s.extras)for(let[e,t]of Object.entries("function"==typeof s.extras?s.extras(i,{sql:to.i6}):s.extras))o.push({tsKey:e,value:(0,tn.qD)(t,a)});for(let{tsKey:e,value:t}of o)f.push({dbKey:(0,tt.is)(t,to.$s.Aliased)?t.fieldAlias:n.columns[e].name,tsKey:e,field:(0,tt.is)(t,ts.s)?(0,tn.lw)(t,a):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let g="function"==typeof s.orderBy?s.orderBy(i,(0,ta.pl)()):s.orderBy??[];for(let{tsKey:i,queryConfig:n,relation:o}of(Array.isArray(g)||(g=[g]),d=g.map(e=>(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):(0,tn.UI)(e,a)),u=s.limit,c=s.offset,p)){let s=(0,ta.wG)(t,r,o),l=r[o.referencedTable[tl.iA.Symbol.Name]],u=`${a}_${i}`,c=(0,td.xD)(...s.fields.map((e,t)=>(0,td.eq)((0,tn.lw)(s.references[t],u),(0,tn.lw)(e,a)))),d=this.buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:r,table:e[l],tableConfig:t[l],queryConfig:(0,tt.is)(o,ta.fh)?!0===n?{limit:1}:{...n,limit:1}:n,tableAlias:u,joinOn:c,nestedQueryRelation:o}),h=to.i6`${to.i6.identifier(u)}.${to.i6.identifier("data")}`.as(i);m.push({on:to.i6`true`,table:new ti.k(d.sql,{},u),alias:u,joinType:"left",lateral:!0}),f.push({dbKey:i,tsKey:i,field:h,relationTableTsKey:l,isJson:!0,selection:d.selection})}}if(0===f.length)throw new th.k({message:`No fields selected for table "${n.tsName}" ("${a}")`});if(h=(0,td.xD)(l,h),o){let e=to.i6`json_array(${to.i6.join(f.map(({field:e,tsKey:t,isJson:r})=>r?to.i6`${to.i6.identifier(`${a}_${t}`)}.${to.i6.identifier("data")}`:(0,tt.is)(e,to.$s.Aliased)?e.sql:e),to.i6`, `)})`;(0,tt.is)(o,ta.sj)&&(e=to.i6`coalesce(json_arrayagg(${e}), json_array())`);let t=[{dbKey:"data",tsKey:"data",field:e.as("data"),isJson:!0,relationTableTsKey:n.tsName,selection:f}];void 0!==u||void 0!==c||(d?.length??0)>0?(p=this.buildSelectQuery({table:(0,tn.RQ)(i,a),fields:{},fieldsFlat:[{path:[],field:to.i6.raw("*")},...(d?.length??0)>0?[{path:[],field:to.i6`row_number() over (order by ${to.i6.join(d,to.i6`, `)})`}]:[]],where:h,limit:u,offset:c,setOperators:[]}),h=void 0,u=void 0,c=void 0,d=void 0):p=(0,tn.RQ)(i,a),p=this.buildSelectQuery({table:(0,tt.is)(p,tm)?p:new ti.k(p,{},a),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):e})),joins:m,where:h,limit:u,offset:c,orderBy:d,setOperators:[]})}else p=this.buildSelectQuery({table:(0,tn.RQ)(i,a),fields:{},fieldsFlat:f.map(({field:e})=>({path:[],field:(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):e})),joins:m,where:h,limit:u,offset:c,orderBy:d,setOperators:[]});return{tableTsKey:n.tsName,sql:p,selection:f}}buildRelationalQueryWithoutLateralSubqueries({fullSchema:e,schema:t,tableNamesMap:r,table:i,tableConfig:n,queryConfig:s,tableAlias:a,nestedQueryRelation:o,joinOn:l}){let u,c=[],d,h,p=[],f;if(!0===s)c=Object.entries(n.columns).map(([e,t])=>({dbKey:t.name,tsKey:e,field:(0,tn.lw)(t,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let i=Object.fromEntries(Object.entries(n.columns).map(([e,t])=>[e,(0,tn.lw)(t,a)]));if(s.where){let e="function"==typeof s.where?s.where(i,(0,ta.vU)()):s.where;f=e&&(0,tn.UI)(e,a)}let o=[],l=[];if(s.columns){let e=!1;for(let[t,r]of Object.entries(s.columns))void 0!==r&&t in n.columns&&(e||!0!==r||(e=!0),l.push(t));l.length>0&&(l=e?l.filter(e=>s.columns?.[e]===!0):Object.keys(n.columns).filter(e=>!l.includes(e)))}else l=Object.keys(n.columns);for(let e of l){let t=n.columns[e];o.push({tsKey:e,value:t})}let u=[];if(s.with&&(u=Object.entries(s.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:n.relations[e]}))),s.extras)for(let[e,t]of Object.entries("function"==typeof s.extras?s.extras(i,{sql:to.i6}):s.extras))o.push({tsKey:e,value:(0,tn.qD)(t,a)});for(let{tsKey:e,value:t}of o)c.push({dbKey:(0,tt.is)(t,to.$s.Aliased)?t.fieldAlias:n.columns[e].name,tsKey:e,field:(0,tt.is)(t,ts.s)?(0,tn.lw)(t,a):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let m="function"==typeof s.orderBy?s.orderBy(i,(0,ta.pl)()):s.orderBy??[];for(let{tsKey:i,queryConfig:n,relation:o}of(Array.isArray(m)||(m=[m]),p=m.map(e=>(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):(0,tn.UI)(e,a)),d=s.limit,h=s.offset,u)){let s=(0,ta.wG)(t,r,o),l=r[o.referencedTable[tl.iA.Symbol.Name]],u=`${a}_${i}`,d=(0,td.xD)(...s.fields.map((e,t)=>(0,td.eq)((0,tn.lw)(s.references[t],u),(0,tn.lw)(e,a)))),h=this.buildRelationalQueryWithoutLateralSubqueries({fullSchema:e,schema:t,tableNamesMap:r,table:e[l],tableConfig:t[l],queryConfig:(0,tt.is)(o,ta.fh)?!0===n?{limit:1}:{...n,limit:1}:n,tableAlias:u,joinOn:d,nestedQueryRelation:o}),p=to.i6`(${h.sql})`;(0,tt.is)(o,ta.sj)&&(p=to.i6`coalesce(${p}, json_array())`);let f=p.as(i);c.push({dbKey:i,tsKey:i,field:f,relationTableTsKey:l,isJson:!0,selection:h.selection})}}if(0===c.length)throw new th.k({message:`No fields selected for table "${n.tsName}" ("${a}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});if(f=(0,td.xD)(l,f),o){let e=to.i6`json_array(${to.i6.join(c.map(({field:e})=>(0,tt.is)(e,tk)?to.i6.identifier(e.name):(0,tt.is)(e,to.$s.Aliased)?e.sql:e),to.i6`, `)})`;(0,tt.is)(o,ta.sj)&&(e=to.i6`json_arrayagg(${e})`);let t=[{dbKey:"data",tsKey:"data",field:e,isJson:!0,relationTableTsKey:n.tsName,selection:c}];void 0!==d||void 0!==h||p.length>0?(u=this.buildSelectQuery({table:(0,tn.RQ)(i,a),fields:{},fieldsFlat:[{path:[],field:to.i6.raw("*")},...p.length>0?[{path:[],field:to.i6`row_number() over (order by ${to.i6.join(p,to.i6`, `)})`}]:[]],where:f,limit:d,offset:h,setOperators:[]}),f=void 0,d=void 0,h=void 0,p=void 0):u=(0,tn.RQ)(i,a),u=this.buildSelectQuery({table:(0,tt.is)(u,tm)?u:new ti.k(u,{},a),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):e})),where:f,limit:d,offset:h,orderBy:p,setOperators:[]})}else u=this.buildSelectQuery({table:(0,tn.RQ)(i,a),fields:{},fieldsFlat:c.map(({field:e})=>({path:[],field:(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):e})),where:f,limit:d,offset:h,orderBy:p,setOperators:[]});return{tableTsKey:n.tsName,sql:u,selection:c}}}var tO=r(678),tP=r(130);class t${static{this[tt.Q]="MySqlSelectBuilder"}constructor(e){this.withList=[],this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}from(e){let t;let r=!!this.fields;return t=this.fields?this.fields:(0,tt.is)(e,ti.k)?Object.fromEntries(Object.keys(e[ti.g1].selection).map(t=>[t,e[t]])):(0,tt.is)(e,tT)?e[tc.d].selectedFields:(0,tt.is)(e,to.$s)?{}:(0,tu.SS)(e),new tR({table:e,fields:t,isPartialSelect:r,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class tN extends tO.b{static{this[tt.Q]="MySqlSelectQueryBuilder"}constructor({table:e,fields:t,isPartialSelect:r,session:i,dialect:n,withList:s,distinct:a}){super(),this.leftJoin=this.createJoin("left"),this.rightJoin=this.createJoin("right"),this.innerJoin=this.createJoin("inner"),this.fullJoin=this.createJoin("full"),this.union=this.createSetOperator("union",!1),this.unionAll=this.createSetOperator("union",!0),this.intersect=this.createSetOperator("intersect",!1),this.intersectAll=this.createSetOperator("intersect",!0),this.except=this.createSetOperator("except",!1),this.exceptAll=this.createSetOperator("except",!0),this.config={withList:s,table:e,fields:{...t},distinct:a,setOperators:[]},this.isPartialSelect=r,this.session=i,this.dialect=n,this._={selectedFields:t},this.tableName=(0,tu.dP)(e),this.joinsNotNullableMap="string"==typeof this.tableName?{[this.tableName]:!0}:{}}createJoin(e){return(t,r)=>{let i=this.tableName,n=(0,tu.dP)(t);if("string"==typeof n&&this.config.joins?.some(e=>e.alias===n))throw Error(`Alias "${n}" is already used in this query`);if(!this.isPartialSelect&&(1===Object.keys(this.joinsNotNullableMap).length&&"string"==typeof i&&(this.config.fields={[i]:this.config.fields}),"string"==typeof n&&!(0,tt.is)(t,to.$s))){let e=(0,tt.is)(t,ti.k)?t[ti.g1].selection:(0,tt.is)(t,to.G7)?t[tc.d].selectedFields:t[tl.iA.Symbol.Columns];this.config.fields[n]=e}if("function"==typeof r&&(r=r(new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:t,joinType:e,alias:n}),"string"==typeof n)switch(e){case"left":this.joinsNotNullableMap[n]=!1;break;case"right":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[n]=!0;break;case"inner":this.joinsNotNullableMap[n]=!0;break;case"full":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[n]=!1}return this}}createSetOperator(e,t){return r=>{let i="function"==typeof r?r(tj()):r;if(!(0,tu.ux)(this.getSelectedFields(),i.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:t,rightSelect:i}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=r:this.config.orderBy=r}else this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=e:this.config.orderBy=e;return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){return new Proxy(new ti.k(this.getSQL(),this.config.fields,e),new tr.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new tr.e({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class tR extends tN{static{this[tt.Q]="MySqlSelect"}prepare(){if(!this.session)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");let e=(0,tu.ZS)(this.config.fields),t=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),e);return t.joinsNotNullableMap=this.joinsNotNullableMap,t}constructor(...e){super(...e),this.execute=e=>this.prepare().execute(e),this.createIterator=()=>{let e=this;return async function*(t){yield*e.prepare().iterator(t)}},this.iterator=this.createIterator()}}function tI(e,t){return(r,i,...n)=>{let s=[i,...n].map(r=>({type:e,isAll:t,rightSelect:r}));for(let e of s)if(!(0,tu.ux)(r.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return r.addSetOperators(s)}}(0,tu.ef)(tR,[tP.N]);let tj=()=>({union:tL,unionAll:tD,intersect:tM,intersectAll:tU,except:tq,exceptAll:tQ}),tL=tI("union",!1),tD=tI("union",!0),tM=tI("intersect",!1),tU=tI("intersect",!0),tq=tI("except",!1),tQ=tI("except",!0);class tB{static{this[tt.Q]="MySqlQueryBuilder"}$with(e){let t=this;return{as:r=>("function"==typeof r&&(r=r(t)),new Proxy(new ti.SC(r.getSQL(),r.getSelectedFields(),e,!0),new tr.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(r){return new t$({fields:r??void 0,session:void 0,dialect:t.getDialect(),withList:e})},selectDistinct:function(r){return new t$({fields:r??void 0,session:void 0,dialect:t.getDialect(),withList:e,distinct:!0})}}}select(e){return new t$({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new t$({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){return this.dialect||(this.dialect=new tC),this.dialect}}class tH{constructor(e,t,r){this.table=e,this.session=t,this.dialect=r}static{this[tt.Q]="MySqlUpdateBuilder"}set(e){return new tK(this.table,(0,tu.M6)(this.table,e),this.session,this.dialect)}}class tK extends tP.N{constructor(e,t,r,i){super(),this.execute=e=>this.prepare().execute(e),this.createIterator=()=>{let e=this;return async function*(t){yield*e.prepare().iterator(t)}},this.iterator=this.createIterator(),this.session=r,this.dialect=i,this.config={set:t,table:e}}static{this[tt.Q]="MySqlUpdate"}where(e){return this.config.where=e,this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}prepare(){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning)}$dynamic(){return this}}class tF{constructor(e,t,r){this.shouldIgnore=!1,this.table=e,this.session=t,this.dialect=r}static{this[tt.Q]="MySqlInsertBuilder"}ignore(){return this.shouldIgnore=!0,this}values(e){if(0===(e=Array.isArray(e)?e:[e]).length)throw Error("values() must be called with at least one value");let t=e.map(e=>{let t={},r=this.table[tl.iA.Symbol.Columns];for(let i of Object.keys(e)){let n=e[i];t[i]=(0,tt.is)(n,to.$s)?n:new to.dO(n,r[i])}return t});return new tV(this.table,t,this.shouldIgnore,this.session,this.dialect)}}class tV extends tP.N{constructor(e,t,r,i,n){super(),this.execute=e=>this.prepare().execute(e),this.createIterator=()=>{let e=this;return async function*(t){yield*e.prepare().iterator(t)}},this.iterator=this.createIterator(),this.session=i,this.dialect=n,this.config={table:e,values:t,ignore:r}}static{this[tt.Q]="MySqlInsert"}onDuplicateKeyUpdate(e){let t=this.dialect.buildUpdateSet(this.config.table,(0,tu.M6)(this.config.table,e.set));return this.config.onConflict=to.i6`update ${t}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}prepare(){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0)}$dynamic(){return this}}class tW extends tP.N{constructor(e,t,r){super(),this.execute=e=>this.prepare().execute(e),this.createIterator=()=>{let e=this;return async function*(t){yield*e.prepare().iterator(t)}},this.iterator=this.createIterator(),this.table=e,this.session=t,this.dialect=r,this.config={table:e}}static{this[tt.Q]="MySqlDelete"}where(e){return this.config.where=e,this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}prepare(){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning)}$dynamic(){return this}}class tz{constructor(e,t,r,i,n,s,a,o){this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=i,this.tableConfig=n,this.dialect=s,this.session=a,this.mode=o}static{this[tt.Q]="MySqlRelationalQueryBuilder"}findMany(e){return new tJ(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many",this.mode)}findFirst(e){return new tJ(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first",this.mode)}}class tJ extends tP.N{constructor(e,t,r,i,n,s,a,o,l,u){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=i,this.tableConfig=n,this.dialect=s,this.session=a,this.config=o,this.queryMode=l,this.mode=u}static{this[tt.Q]="MySqlRelationalQuery"}prepare(){let{query:e,builtQuery:t}=this._toSQL();return this.session.prepareQuery(t,void 0,t=>{let r=t.map(t=>(0,ta.WX)(this.schema,this.tableConfig,t,e.selection));return"first"===this.queryMode?r[0]:r})}_getQuery(){return"planetscale"===this.mode?this.dialect.buildRelationalQueryWithoutLateralSubqueries({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}):this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}_toSQL(){let e=this._getQuery();return{builtQuery:this.dialect.sqlToQuery(e.sql),query:e}}getSQL(){return this._getQuery().sql}toSQL(){return this._toSQL().builtQuery}execute(){return this.prepare().execute()}}class tZ{constructor(e,t,r,i){if(this.dialect=e,this.session=t,this.mode=i,this._=r?{schema:r.schema,tableNamesMap:r.tableNamesMap}:{schema:void 0,tableNamesMap:{}},this.query={},this._.schema)for(let[i,n]of Object.entries(this._.schema))this.query[i]=new tz(r.fullSchema,this._.schema,this._.tableNamesMap,r.fullSchema[i],n,e,t,this.mode)}static{this[tt.Q]="MySqlDatabase"}$with(e){return{as:t=>("function"==typeof t&&(t=t(new tB)),new Proxy(new ti.SC(t.getSQL(),t.getSelectedFields(),e,!0),new tr.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(r){return new t$({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e})},selectDistinct:function(r){return new t$({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}}}select(e){return new t$({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new t$({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}update(e){return new tH(e,this.session,this.dialect)}insert(e){return new tF(e,this.session,this.dialect)}delete(e){return new tW(e,this.session,this.dialect)}execute(e){return this.session.execute(e.getSQL())}transaction(e,t){return this.session.transaction(e,t)}}var tG=r(4131);class tX{static{this[tt.Q]="PgForeignKeyBuilder"}constructor(e,t){this._onUpdate="no action",this._onDelete="no action",this.reference=()=>{let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignTable:i[0].table,foreignColumns:i}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=void 0===e?"no action":e,this}onDelete(e){return this._onDelete=void 0===e?"no action":e,this}build(e){return new tY(e,this)}}class tY{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static{this[tt.Q]="PgForeignKey"}getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map(e=>e.name),n=r.map(e=>e.name),s=[this.table[tG.YA.Symbol.Name],...i,r[0].table[tG.YA.Symbol.Name],...n];return e??`${s.join("_")}_fk`}}function t0(e,t){return`${e[tG.YA.Symbol.Name]}_${t.join("_")}_unique`}class t1{constructor(e,t){this.nullsNotDistinctConfig=!1,this.name=t,this.columns=e}static{this[tt.Q]="PgUniqueConstraintBuilder"}nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new t2(e,this.columns,this.nullsNotDistinctConfig,this.name)}}class t6{static{this[tt.Q]="PgUniqueOnConstraintBuilder"}constructor(e){this.name=e}on(...e){return new t1(e,this.name)}}class t2{constructor(e,t,r,i){this.nullsNotDistinct=!1,this.table=e,this.columns=t,this.name=i??t0(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=r}static{this[tt.Q]="PgUniqueConstraint"}getName(){return this.name}}function t4(e,t,r){for(let i=t;i(0,t5.t)((r,i)=>{let n=new tX(()=>({columns:[e],foreignColumns:[r()]}));return i.onUpdate&&n.onUpdate(i.onUpdate),i.onDelete&&n.onDelete(i.onDelete),n.build(t)},r,i))}constructor(...e){super(...e),this.foreignKeyConfigs=[]}}class t8 extends ts.s{constructor(e,t){t.uniqueName||(t.uniqueName=t0(e,[t.name])),super(e,t),this.table=e}static{this[tt.Q]="PgColumn"}}class t9 extends t3{static{this[tt.Q]="PgArrayBuilder"}constructor(e,t,r){super(e,"array","PgArray"),this.config.baseBuilder=t,this.config.size=r}build(e){let t=this.config.baseBuilder.build(e);return new t7(e,this.config,t)}}class t7 extends t8{constructor(e,t,r,i){super(e,t),this.baseColumn=r,this.range=i,this.size=t.size}static{this[tt.Q]="PgArray"}getSQLType(){return`${this.baseColumn.getSQLType()}[${"number"==typeof this.size?this.size:""}]`}mapFromDriverValue(e){return"string"==typeof e&&(e=function(e){let[t]=function e(t,r=0){let i=[],n=r,s=!1;for(;nthis.baseColumn.mapFromDriverValue(e))}mapToDriverValue(e,t=!1){let r=e.map(e=>null===e?null:(0,tt.is)(this.baseColumn,t7)?this.baseColumn.mapToDriverValue(e,!0):this.baseColumn.mapToDriverValue(e));return t?r:function e(t){return`{${t.map(t=>Array.isArray(t)?e(t):"string"==typeof t?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}(r)}}class re extends t3{static{this[tt.Q]="PgJsonbBuilder"}constructor(e){super(e,"json","PgJsonb")}build(e){return new rt(e,this.config)}}class rt extends t8{static{this[tt.Q]="PgJsonb"}constructor(e,t){super(e,t)}getSQLType(){return"jsonb"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}}class rr extends t3{static{this[tt.Q]="PgJsonBuilder"}constructor(e){super(e,"json","PgJson")}build(e){return new ri(e,this.config)}}class ri extends t8{static{this[tt.Q]="PgJson"}constructor(e,t){super(e,t)}getSQLType(){return"json"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}}class rn extends t3{static{this[tt.Q]="PgNumericBuilder"}constructor(e,t,r){super(e,"string","PgNumeric"),this.config.precision=t,this.config.scale=r}build(e){return new rs(e,this.config)}}class rs extends t8{static{this[tt.Q]="PgNumeric"}constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}getSQLType(){return void 0!==this.precision&&void 0!==this.scale?`numeric(${this.precision}, ${this.scale})`:void 0===this.precision?"numeric":`numeric(${this.precision})`}}class ra extends t3{static{this[tt.Q]="PgDateColumnBaseBuilder"}defaultNow(){return this.default(to.i6`now()`)}}class ro extends ra{constructor(e,t,r){super(e,"string","PgTime"),this.withTimezone=t,this.precision=r,this.config.withTimezone=t,this.config.precision=r}static{this[tt.Q]="PgTimeBuilder"}build(e){return new rl(e,this.config)}}class rl extends t8{static{this[tt.Q]="PgTime"}constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":`(${this.precision})`;return`time${e}${this.withTimezone?" with time zone":""}`}}class ru extends ra{static{this[tt.Q]="PgTimestampBuilder"}constructor(e,t,r){super(e,"date","PgTimestamp"),this.config.withTimezone=t,this.config.precision=r}build(e){return new rc(e,this.config)}}class rc extends t8{static{this[tt.Q]="PgTimestamp"}constructor(e,t){super(e,t),this.mapFromDriverValue=e=>new Date(this.withTimezone?e:e+"+0000"),this.mapToDriverValue=e=>this.withTimezone?e.toUTCString():e.toISOString(),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":` (${this.precision})`;return`timestamp${e}${this.withTimezone?" with time zone":""}`}}class rd extends ra{static{this[tt.Q]="PgTimestampStringBuilder"}constructor(e,t,r){super(e,"string","PgTimestampString"),this.config.withTimezone=t,this.config.precision=r}build(e){return new rh(e,this.config)}}class rh extends t8{static{this[tt.Q]="PgTimestampString"}constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":`(${this.precision})`;return`timestamp${e}${this.withTimezone?" with time zone":""}`}}function rp(e,t={}){return"string"===t.mode?new rd(e,t.withTimezone??!1,t.precision):new ru(e,t.withTimezone??!1,t.precision)}class rf extends ra{static{this[tt.Q]="PgDateBuilder"}constructor(e){super(e,"date","PgDate")}build(e){return new rm(e,this.config)}}class rm extends t8{static{this[tt.Q]="PgDate"}getSQLType(){return"date"}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}}class rg extends ra{static{this[tt.Q]="PgDateStringBuilder"}constructor(e){super(e,"string","PgDateString")}build(e){return new ry(e,this.config)}}class ry extends t8{static{this[tt.Q]="PgDateString"}getSQLType(){return"date"}}class rv extends t3{static{this[tt.Q]="PgUUIDBuilder"}constructor(e){super(e,"string","PgUUID")}defaultRandom(){return this.default(to.i6`gen_random_uuid()`)}build(e){return new rb(e,this.config)}}class rb extends t8{static{this[tt.Q]="PgUUID"}getSQLType(){return"uuid"}}class rw extends to.G7{static{this[tt.Q]="PgViewBase"}}class r_{static{this[tt.Q]="PgDialect"}async migrate(e,t){let r=to.i6`
CREATE TABLE IF NOT EXISTS "drizzle"."__drizzle_migrations" (
id SERIAL PRIMARY KEY,
hash text NOT NULL,
created_at bigint
)
- `;await t.execute(g.i6`CREATE SCHEMA IF NOT EXISTS "drizzle"`),await t.execute(r);let i=(await t.all(g.i6`select id, hash, created_at from "drizzle"."__drizzle_migrations" order by created_at desc limit 1`))[0];await t.transaction(async t=>{for await(let r of e)if(!i||Number(i.created_at){let o=e[m.iA.Symbol.Columns][t],s=g.i6`${g.i6.identifier(o.name)} = ${r}`;return n{let n=[];if((0,u.is)(e,g.$s.Aliased)&&e.isSelectionField)n.push(g.i6.identifier(e.fieldAlias));else if((0,u.is)(e,g.$s.Aliased)||(0,u.is)(e,g.$s)){let r=(0,u.is)(e,g.$s.Aliased)?e.sql:e;t?n.push(new g.$s(r.queryChunks.map(e=>(0,u.is)(e,eg)?g.i6.identifier(e.name):e))):n.push(r),(0,u.is)(e,g.$s.Aliased)&&n.push(g.i6` as ${g.i6.identifier(e.fieldAlias)}`)}else(0,u.is)(e,f.s)&&(t?n.push(g.i6.identifier(e.name)):n.push(e));return ie===(x[m.iA.Symbol.IsAlias]?m.SP(x):x[m.iA.Symbol.BaseName])))){let t=(0,m.SP)(e.field.table);throw Error(`Your "${e.path.join("->")}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}}let O=!s||0===s.length;if(e?.length){let t=[g.i6`with `];for(let[r,i]of e.entries())t.push(g.i6`${g.i6.identifier(i[h.g1].alias)} as (${i[h.g1].sql})`),r{if((0,u.is)(o,m.iA)&&o[m.iA.Symbol.OriginalName]!==o[m.iA.Symbol.Name]){let e=g.i6`${g.i6.identifier(o[m.iA.Symbol.OriginalName])}`;return o[m.iA.Symbol.Schema]&&(e=g.i6`${g.i6.identifier(o[m.iA.Symbol.Schema])}.${e}`),g.i6`${e} ${g.i6.identifier(o[m.iA.Symbol.Name])}`}return o})(),j=[];if(s)for(let[e,t]of s.entries()){0===e&&j.push(g.i6` `);let r=t.table,i=t.lateral?g.i6` lateral`:void 0;if((0,u.is)(r,es.YA)){let e=r[es.YA.Symbol.Name],n=r[es.YA.Symbol.Schema],o=r[es.YA.Symbol.OriginalName],s=e===o?void 0:t.alias;j.push(g.i6`${g.i6.raw(t.joinType)} join${i} ${n?g.i6`${g.i6.identifier(n)}.`:void 0}${g.i6.identifier(o)}${s&&g.i6` ${g.i6.identifier(s)}`} on ${t.on}`)}else if((0,u.is)(r,g.G7)){let e=r[v.d].name,n=r[v.d].schema,o=r[v.d].originalName,s=e===o?void 0:t.alias;j.push(g.i6`${g.i6.raw(t.joinType)} join${i} ${n?g.i6`${g.i6.identifier(n)}.`:void 0}${g.i6.identifier(o)}${s&&g.i6` ${g.i6.identifier(s)}`} on ${t.on}`)}else j.push(g.i6`${g.i6.raw(t.joinType)} join${i} ${r} on ${t.on}`);e0&&(k=g.i6` order by ${g.i6.join(a,g.i6`, `)}`),l&&l.length>0&&(E=g.i6` group by ${g.i6.join(l,g.i6`, `)}`);let J=c?g.i6` limit ${c}`:void 0,M=d?g.i6` offset ${d}`:void 0,N=g.i6.empty();if(p){let e=g.i6` for ${g.i6.raw(p.strength)}`;p.config.of&&e.append(g.i6` of ${g.i6.join(Array.isArray(p.config.of)?p.config.of:[p.config.of],g.i6`, `)}`),p.config.noWait?e.append(g.i6` no wait`):p.config.skipLocked&&e.append(g.i6` skip locked`),N.append(e)}let R=g.i6`${b}select${S} ${T} from ${P}${C}${I}${E}${$}${k}${J}${M}${N}`;return w.length>0?this.buildSetOperations(R,w):R}buildSetOperations(e,t){let[r,...i]=t;if(!r)throw Error("Cannot pass undefined values to any set operator");return 0===i.length?this.buildSetOperationQuery({leftSelect:e,setOperator:r}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:r}),i)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:r,rightSelect:i,limit:n,orderBy:o,offset:s}}){let a;let l=g.i6`(${e.getSQL()}) `,c=g.i6`(${i.getSQL()})`;if(o&&o.length>0){let e=[];for(let t of o)if((0,u.is)(t,eg))e.push(g.i6.identifier(t.name));else if((0,u.is)(t,g.$s)){for(let e=0;eg.i6.identifier(e.name));for(let[e,r]of t.entries()){let i=[];for(let[e,t]of o){let n=r[e];if(void 0===n||(0,u.is)(n,g.dO)&&void 0===n.value){if(void 0!==t.defaultFn){let e=t.defaultFn(),r=(0,u.is)(e,g.$s)?e:g.i6.param(e,t);i.push(r)}else i.push(g.i6`default`)}else i.push(n)}n.push(i),e({dbKey:t.name,tsKey:e,field:(0,p.lw)(t,s),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let i=Object.fromEntries(Object.entries(n.columns).map(([e,t])=>[e,(0,p.lw)(t,s)]));if(o.where){let e="function"==typeof o.where?o.where(i,(0,y.vU)()):o.where;k=e&&(0,p.UI)(e,s)}let a=[],l=[];if(o.columns){let e=!1;for(let[t,r]of Object.entries(o.columns))void 0!==r&&t in n.columns&&(e||!0!==r||(e=!0),l.push(t));l.length>0&&(l=e?l.filter(e=>o.columns?.[e]===!0):Object.keys(n.columns).filter(e=>!l.includes(e)))}else l=Object.keys(n.columns);for(let e of l){let t=n.columns[e];a.push({tsKey:e,value:t})}let c=[];if(o.with&&(c=Object.entries(o.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:n.relations[e]}))),o.extras)for(let[e,t]of Object.entries("function"==typeof o.extras?o.extras(i,{sql:g.i6}):o.extras))a.push({tsKey:e,value:(0,p.qD)(t,s)});for(let{tsKey:e,value:t}of a)d.push({dbKey:(0,u.is)(t,g.$s.Aliased)?t.fieldAlias:n.columns[e].name,tsKey:e,field:(0,u.is)(t,f.s)?(0,p.lw)(t,s):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let b="function"==typeof o.orderBy?o.orderBy(i,(0,y.pl)()):o.orderBy??[];for(let{tsKey:i,queryConfig:n,relation:a}of(Array.isArray(b)||(b=[b]),S=b.map(e=>(0,u.is)(e,f.s)?(0,p.lw)(e,s):(0,p.UI)(e,s)),_=o.limit,v=o.offset,c)){let o=(0,y.wG)(t,r,a),l=r[a.referencedTable[m.iA.Symbol.Name]],c=`${s}_${i}`,f=(0,w.xD)(...o.fields.map((e,t)=>(0,w.eq)((0,p.lw)(o.references[t],c),(0,p.lw)(e,s)))),_=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:r,table:e[l],tableConfig:t[l],queryConfig:(0,u.is)(a,y.fh)?!0===n?{limit:1}:{...n,limit:1}:n,tableAlias:c,joinOn:f,nestedQueryRelation:a}),v=g.i6`${g.i6.identifier(c)}.${g.i6.identifier("data")}`.as(i);E.push({on:g.i6`true`,table:new h.k(_.sql,{},c),alias:c,joinType:"left",lateral:!0}),d.push({dbKey:i,tsKey:i,field:v,relationTableTsKey:l,isJson:!0,selection:_.selection})}}if(0===d.length)throw new b.k({message:`No fields selected for table "${n.tsName}" ("${s}")`});if(k=(0,w.xD)(l,k),a){let e=g.i6`json_build_array(${g.i6.join(d.map(({field:e,tsKey:t,isJson:r})=>r?g.i6`${g.i6.identifier(`${s}_${t}`)}.${g.i6.identifier("data")}`:(0,u.is)(e,g.$s.Aliased)?e.sql:e),g.i6`, `)})`;(0,u.is)(a,y.sj)&&(e=g.i6`coalesce(json_agg(${e}${S.length>0?g.i6` order by ${g.i6.join(S,g.i6`, `)}`:void 0}), '[]'::json)`);let t=[{dbKey:"data",tsKey:"data",field:e.as("data"),isJson:!0,relationTableTsKey:n.tsName,selection:d}];void 0!==_||void 0!==v||S.length>0?(c=this.buildSelectQuery({table:(0,p.RQ)(i,s),fields:{},fieldsFlat:[{path:[],field:g.i6.raw("*")}],where:k,limit:_,offset:v,orderBy:S,setOperators:[]}),k=void 0,_=void 0,v=void 0,S=[]):c=(0,p.RQ)(i,s),c=this.buildSelectQuery({table:(0,u.is)(c,es.YA)?c:new h.k(c,{},s),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:(0,u.is)(e,f.s)?(0,p.lw)(e,s):e})),joins:E,where:k,limit:_,offset:v,orderBy:S,setOperators:[]})}else c=this.buildSelectQuery({table:(0,p.RQ)(i,s),fields:{},fieldsFlat:d.map(({field:e})=>({path:[],field:(0,u.is)(e,f.s)?(0,p.lw)(e,s):e})),joins:E,where:k,limit:_,offset:v,orderBy:S,setOperators:[]});return{tableTsKey:n.tsName,sql:c,selection:d}}}var eH=r(7415);class eD{static{this[u.Q]="PgSelectBuilder"}constructor(e){this.withList=[],this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}from(e){let t;let r=!!this.fields;return t=this.fields?this.fields:(0,u.is)(e,h.k)?Object.fromEntries(Object.keys(e[h.g1].selection).map(t=>[t,e[t]])):(0,u.is)(e,eK)?e[v.d].selectedFields:(0,u.is)(e,g.$s)?{}:(0,_.SS)(e),new eL({table:e,fields:t,isPartialSelect:r,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class eq extends W.b{static{this[u.Q]="PgSelectQueryBuilder"}constructor({table:e,fields:t,isPartialSelect:r,session:i,dialect:n,withList:o,distinct:s}){super(),this.leftJoin=this.createJoin("left"),this.rightJoin=this.createJoin("right"),this.innerJoin=this.createJoin("inner"),this.fullJoin=this.createJoin("full"),this.union=this.createSetOperator("union",!1),this.unionAll=this.createSetOperator("union",!0),this.intersect=this.createSetOperator("intersect",!1),this.intersectAll=this.createSetOperator("intersect",!0),this.except=this.createSetOperator("except",!1),this.exceptAll=this.createSetOperator("except",!0),this.config={withList:o,table:e,fields:{...t},distinct:s,setOperators:[]},this.isPartialSelect=r,this.session=i,this.dialect=n,this._={selectedFields:t},this.tableName=(0,_.dP)(e),this.joinsNotNullableMap="string"==typeof this.tableName?{[this.tableName]:!0}:{}}createJoin(e){return(t,r)=>{let i=this.tableName,n=(0,_.dP)(t);if("string"==typeof n&&this.config.joins?.some(e=>e.alias===n))throw Error(`Alias "${n}" is already used in this query`);if(!this.isPartialSelect&&(1===Object.keys(this.joinsNotNullableMap).length&&"string"==typeof i&&(this.config.fields={[i]:this.config.fields}),"string"==typeof n&&!(0,u.is)(t,g.$s))){let e=(0,u.is)(t,h.k)?t[h.g1].selection:(0,u.is)(t,g.G7)?t[v.d].selectedFields:t[m.iA.Symbol.Columns];this.config.fields[n]=e}if("function"==typeof r&&(r=r(new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:t,joinType:e,alias:n}),"string"==typeof n)switch(e){case"left":this.joinsNotNullableMap[n]=!1;break;case"right":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[n]=!0;break;case"inner":this.joinsNotNullableMap[n]=!0;break;case"full":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[n]=!1}return this}}createSetOperator(e,t){return r=>{let i="function"==typeof r?r(eQ()):r;if(!(0,_.ux)(this.getSelectedFields(),i.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:t,rightSelect:i}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new d.e({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=r:this.config.orderBy=r}else this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=e:this.config.orderBy=e;return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){return new Proxy(new h.k(this.getSQL(),this.config.fields,e),new d.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new d.e({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class eL extends eq{static{this[u.Q]="PgSelect"}_prepare(e){let{session:t,config:r,dialect:i,joinsNotNullableMap:n}=this;if(!t)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");return eH.Z.startActiveSpan("drizzle.prepareQuery",()=>{let o=(0,_.ZS)(r.fields),s=t.prepareQuery(i.sqlToQuery(this.getSQL()),o,e);return s.joinsNotNullableMap=n,s})}prepare(e){return this._prepare(e)}constructor(...e){super(...e),this.execute=e=>eH.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e))}}function eB(e,t){return(r,i,...n)=>{let o=[i,...n].map(r=>({type:e,isAll:t,rightSelect:r}));for(let e of o)if(!(0,_.ux)(r.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return r.addSetOperators(o)}}(0,_.ef)(eL,[K.N]);let eQ=()=>({union:ez,unionAll:eF,intersect:eV,intersectAll:eG,except:eX,exceptAll:eY}),ez=eB("union",!1),eF=eB("union",!0),eV=eB("intersect",!1),eG=eB("intersect",!0),eX=eB("except",!1),eY=eB("except",!0);class eZ{static{this[u.Q]="PgQueryBuilder"}$with(e){let t=this;return{as:r=>("function"==typeof r&&(r=r(t)),new Proxy(new h.SC(r.getSQL(),r.getSelectedFields(),e,!0),new d.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(r){return new eD({fields:r??void 0,session:void 0,dialect:t.getDialect(),withList:e})},selectDistinct:function(e){return new eD({fields:e??void 0,session:void 0,dialect:t.getDialect(),distinct:!0})},selectDistinctOn:function(e,r){return new eD({fields:r??void 0,session:void 0,dialect:t.getDialect(),distinct:{on:e}})}}}select(e){return new eD({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new eD({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,t){return new eD({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||(this.dialect=new eU),this.dialect}}class e0{constructor(e,t,r){this.table=e,this.session=t,this.dialect=r}static{this[u.Q]="PgUpdateBuilder"}set(e){return new e1(this.table,(0,_.M6)(this.table,e),this.session,this.dialect)}}class e1 extends K.N{constructor(e,t,r,i){super(),this.execute=e=>this._prepare().execute(e),this.session=r,this.dialect=i,this.config={set:t,table:e}}static{this[u.Q]="PgUpdate"}where(e){return this.config.where=e,this}returning(e=this.config.table[m.iA.Symbol.Columns]){return this.config.returning=(0,_.ZS)(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e)}prepare(e){return this._prepare(e)}$dynamic(){return this}}class e2{constructor(e,t,r){this.table=e,this.session=t,this.dialect=r}static{this[u.Q]="PgInsertBuilder"}values(e){if(0===(e=Array.isArray(e)?e:[e]).length)throw Error("values() must be called with at least one value");let t=e.map(e=>{let t={},r=this.table[m.iA.Symbol.Columns];for(let i of Object.keys(e)){let n=e[i];t[i]=(0,u.is)(n,g.$s)?n:new g.dO(n,r[i])}return t});return new e6(this.table,t,this.session,this.dialect)}}class e6 extends K.N{constructor(e,t,r,i){super(),this.execute=e=>eH.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e)),this.session=r,this.dialect=i,this.config={table:e,values:t}}static{this[u.Q]="PgInsert"}returning(e=this.config.table[m.iA.Symbol.Columns]){return this.config.returning=(0,_.ZS)(e),this}onConflictDoNothing(e={}){if(void 0===e.target)this.config.onConflict=g.i6`do nothing`;else{let t="";t=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(e.name)).join(","):this.dialect.escapeName(e.target.name);let r=e.where?g.i6` where ${e.where}`:void 0;this.config.onConflict=g.i6`(${g.i6.raw(t)}) do nothing${r}`}return this}onConflictDoUpdate(e){let t=e.where?g.i6` where ${e.where}`:void 0,r=this.dialect.buildUpdateSet(this.config.table,(0,_.M6)(this.config.table,e.set)),i="";return i=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(e.name)).join(","):this.dialect.escapeName(e.target.name),this.config.onConflict=g.i6`(${g.i6.raw(i)}) do update set ${r}${t}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return eH.Z.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e))}prepare(e){return this._prepare(e)}$dynamic(){return this}}class e5 extends K.N{constructor(e,t,r){super(),this.execute=e=>eH.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e)),this.session=t,this.dialect=r,this.config={table:e}}static{this[u.Q]="PgDelete"}where(e){return this.config.where=e,this}returning(e=this.config.table[m.iA.Symbol.Columns]){return this.config.returning=(0,_.ZS)(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return eH.Z.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e))}prepare(e){return this._prepare(e)}$dynamic(){return this}}class e8{constructor(e,t,r,i,n,o,s){this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=i,this.tableConfig=n,this.dialect=o,this.session=s}static{this[u.Q]="PgRelationalQueryBuilder"}findMany(e){return new e4(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many")}findFirst(e){return new e4(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first")}}class e4 extends K.N{constructor(e,t,r,i,n,o,s,a,l){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=i,this.tableConfig=n,this.dialect=o,this.session=s,this.config=a,this.mode=l}static{this[u.Q]="PgRelationalQuery"}_prepare(e){return eH.Z.startActiveSpan("drizzle.prepareQuery",()=>{let{query:t,builtQuery:r}=this._toSQL();return this.session.prepareQuery(r,void 0,e,(e,r)=>{let i=e.map(e=>(0,y.WX)(this.schema,this.tableConfig,e,t.selection,r));return"first"===this.mode?i[0]:i})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let e=this._getQuery(),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}execute(){return eH.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute())}}class e3 extends K.N{constructor(e,t,r){super(),this.execute=e=>eH.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e)),this.session=t,this.dialect=r,this.config={view:e}}static{this[u.Q]="PgRefreshMaterializedView"}concurrently(){if(void 0!==this.config.withNoData)throw Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(void 0!==this.config.concurrently)throw Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return eH.Z.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e))}prepare(e){return this._prepare(e)}}class e9{constructor(e,t,r){if(this.dialect=e,this.session=t,this._=r?{schema:r.schema,tableNamesMap:r.tableNamesMap}:{schema:void 0,tableNamesMap:{}},this.query={},this._.schema)for(let[i,n]of Object.entries(this._.schema))this.query[i]=new e8(r.fullSchema,this._.schema,this._.tableNamesMap,r.fullSchema[i],n,e,t)}static{this[u.Q]="PgDatabase"}$with(e){return{as:t=>("function"==typeof t&&(t=t(new eZ)),new Proxy(new h.SC(t.getSQL(),t.getSelectedFields(),e,!0),new d.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(r){return new eD({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e})}}}select(e){return new eD({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new eD({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,t){return new eD({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new e0(e,this.session,this.dialect)}insert(e){return new e2(e,this.session,this.dialect)}delete(e){return new e5(e,this.session,this.dialect)}refreshMaterializedView(e){return new e3(e,this.session,this.dialect)}execute(e){return this.session.execute(e.getSQL())}transaction(e,t){return this.session.transaction(e,t)}}var e7=r(8728);class te extends I{static{this[u.Q]="MySqlVarCharBuilder"}constructor(e,t){super(e,"string","MySqlVarChar"),this.config.length=t.length,this.config.enum=t.enum}build(e){return new tt(e,this.config)}}class tt extends ${static{this[u.Q]="MySqlVarChar"}getSQLType(){return void 0===this.length?"varchar":`varchar(${this.length})`}constructor(...e){super(...e),this.length=this.config.length,this.enumValues=this.config.enum}}function tr(e,t){return new te(e,t)}class ti extends I{static{this[u.Q]="MySqlDateColumnBuilder"}defaultNow(){return this.default(g.i6`(now())`)}onUpdateNow(){return this.config.hasOnUpdateNow=!0,this.config.hasDefault=!0,this}}class tn extends ${static{this[u.Q]="MySqlDateColumn"}constructor(...e){super(...e),this.hasOnUpdateNow=this.config.hasOnUpdateNow}}class to extends ti{static{this[u.Q]="MySqlTimestampBuilder"}constructor(e,t){super(e,"date","MySqlTimestamp"),this.config.fsp=t?.fsp}build(e){return new ts(e,this.config)}}class ts extends tn{static{this[u.Q]="MySqlTimestamp"}getSQLType(){let e=void 0===this.fsp?"":`(${this.fsp})`;return`timestamp${e}`}mapFromDriverValue(e){return new Date(e+"+0000")}mapToDriverValue(e){return e.toISOString().slice(0,-1).replace("T"," ")}constructor(...e){super(...e),this.fsp=this.config.fsp}}class ta extends ti{static{this[u.Q]="MySqlTimestampStringBuilder"}constructor(e,t){super(e,"string","MySqlTimestampString"),this.config.fsp=t?.fsp}build(e){return new tl(e,this.config)}}class tl extends tn{static{this[u.Q]="MySqlTimestampString"}getSQLType(){let e=void 0===this.fsp?"":`(${this.fsp})`;return`timestamp${e}`}constructor(...e){super(...e),this.fsp=this.config.fsp}}function tc(e,t={}){return"string"===t.mode?new ta(e,t):new to(e,t)}class tu extends J{static{this[u.Q]="MySqlIntBuilder"}constructor(e,t){super(e,"number","MySqlInt"),this.config.unsigned=!!t&&t.unsigned}build(e){return new td(e,this.config)}}class td extends M{static{this[u.Q]="MySqlInt"}getSQLType(){return`int${this.config.unsigned?" unsigned":""}`}mapFromDriverValue(e){return"string"==typeof e?Number(e):e}}function th(...e){return e[0].columns?new tp(e[0].columns,e[0].name):new tp(e)}class tp{static{this[u.Q]="MySqlPrimaryKeyBuilder"}constructor(e,t){this.columns=e,this.name=t}build(e){return new tf(e,this.columns,this.name)}}class tf{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static{this[u.Q]="MySqlPrimaryKey"}getName(){return this.name??`${this.table[E.Symbol.Name]}_${this.columns.map(e=>e.name).join("_")}_pk`}}class ty extends ey{static{this[u.Q]="PgTextBuilder"}constructor(e,t){super(e,"string","PgText"),this.config.enumValues=t.enum}build(e){return new tg(e,this.config)}}class tg extends eg{static{this[u.Q]="PgText"}getSQLType(){return"text"}constructor(...e){super(...e),this.enumValues=this.config.enumValues}}function tm(e,t={}){return new ty(e,t)}class t_ extends ey{static{this[u.Q]="PgIntegerBuilder"}constructor(e){super(e,"number","PgInteger")}build(e){return new tv(e,this.config)}}class tv extends eg{static{this[u.Q]="PgInteger"}getSQLType(){return"integer"}mapFromDriverValue(e){return"string"==typeof e?Number.parseInt(e):e}}var tw=r(6655);function tb(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var tS=r(440),tk=r(9415),tE=r(7357),tA=r(5225),tx=r(4569),tO=r(8654),tT=r(5054),tP=r(246);let tj={callbacks:{session:({session:e,token:t})=>({...e,user:{...e.user,id:t.id,token:t}})},adapter:function(e,t){if((0,u.is)(e,eo))return function(e,t=A){let{users:r,accounts:i,sessions:n,verificationTokens:o}=function(e){let t=e("user",{id:tr("id",{length:255}).notNull().primaryKey(),name:tr("name",{length:255}),email:tr("email",{length:255}).notNull(),emailVerified:tc("emailVerified",{mode:"date",fsp:3}).defaultNow(),image:tr("image",{length:255})}),r=e("account",{userId:tr("userId",{length:255}).notNull().references(()=>t.id,{onDelete:"cascade"}),type:tr("type",{length:255}).$type().notNull(),provider:tr("provider",{length:255}).notNull(),providerAccountId:tr("providerAccountId",{length:255}).notNull(),refresh_token:tr("refresh_token",{length:255}),access_token:tr("access_token",{length:255}),expires_at:new tu("expires_at",void 0),token_type:tr("token_type",{length:255}),scope:tr("scope",{length:255}),id_token:tr("id_token",{length:255}),session_state:tr("session_state",{length:255})},e=>({compoundKey:th(e.provider,e.providerAccountId)})),i=e("session",{sessionToken:tr("sessionToken",{length:255}).notNull().primaryKey(),userId:tr("userId",{length:255}).notNull().references(()=>t.id,{onDelete:"cascade"}),expires:tc("expires",{mode:"date"}).notNull()});return{users:t,accounts:r,sessions:i,verificationTokens:e("verificationToken",{identifier:tr("identifier",{length:255}).notNull(),token:tr("token",{length:255}).notNull(),expires:tc("expires",{mode:"date"}).notNull()},e=>({compoundKey:th(e.identifier,e.token)}))}}(t);return{async createUser(t){let i=crypto.randomUUID();return await e.insert(r).values({...t,id:i}),await e.select().from(r).where((0,w.eq)(r.id,i)).then(e=>e[0])},getUser:async t=>await e.select().from(r).where((0,w.eq)(r.id,t)).then(e=>e[0])??null,getUserByEmail:async t=>await e.select().from(r).where((0,w.eq)(r.email,t)).then(e=>e[0])??null,createSession:async t=>(await e.insert(n).values(t),await e.select().from(n).where((0,w.eq)(n.sessionToken,t.sessionToken)).then(e=>e[0])),getSessionAndUser:async t=>await e.select({session:n,user:r}).from(n).where((0,w.eq)(n.sessionToken,t)).innerJoin(r,(0,w.eq)(r.id,n.userId)).then(e=>e[0])??null,async updateUser(t){if(!t.id)throw Error("No user id.");return await e.update(r).set(t).where((0,w.eq)(r.id,t.id)),await e.select().from(r).where((0,w.eq)(r.id,t.id)).then(e=>e[0])},updateSession:async t=>(await e.update(n).set(t).where((0,w.eq)(n.sessionToken,t.sessionToken)),await e.select().from(n).where((0,w.eq)(n.sessionToken,t.sessionToken)).then(e=>e[0])),async linkAccount(t){await e.insert(i).values(t)},async getUserByAccount(t){let n=await e.select().from(i).where((0,w.xD)((0,w.eq)(i.providerAccountId,t.providerAccountId),(0,w.eq)(i.provider,t.provider))).leftJoin(r,(0,w.eq)(i.userId,r.id)).then(e=>e[0])??null;return n?n.user:null},async deleteSession(t){let r=await e.select().from(n).where((0,w.eq)(n.sessionToken,t)).then(e=>e[0])??null;return await e.delete(n).where((0,w.eq)(n.sessionToken,t)),r},createVerificationToken:async t=>(await e.insert(o).values(t),await e.select().from(o).where((0,w.eq)(o.identifier,t.identifier)).then(e=>e[0])),async useVerificationToken(t){try{let r=await e.select().from(o).where((0,w.xD)((0,w.eq)(o.identifier,t.identifier),(0,w.eq)(o.token,t.token))).then(e=>e[0])??null;return await e.delete(o).where((0,w.xD)((0,w.eq)(o.identifier,t.identifier),(0,w.eq)(o.token,t.token))),r}catch(e){throw Error("No verification token found.")}},async deleteUser(t){let i=await e.select().from(r).where((0,w.eq)(r.id,t)).then(e=>e[0]??null);return await e.delete(r).where((0,w.eq)(r.id,t)),i},async unlinkAccount(t){await e.delete(i).where((0,w.xD)((0,w.eq)(i.providerAccountId,t.providerAccountId),(0,w.eq)(i.provider,t.provider)))}}}(e,t);if((0,u.is)(e,e9))return function(e,t=es.af){let{users:r,accounts:i,sessions:n,verificationTokens:o}=function(e){let t=e("user",{id:tm("id").notNull().primaryKey(),name:tm("name"),email:tm("email").notNull(),emailVerified:eI("emailVerified",{mode:"date"}),image:tm("image")}),r=e("account",{userId:tm("userId").notNull().references(()=>t.id,{onDelete:"cascade"}),type:tm("type").$type().notNull(),provider:tm("provider").notNull(),providerAccountId:tm("providerAccountId").notNull(),refresh_token:tm("refresh_token"),access_token:tm("access_token"),expires_at:new t_("expires_at"),token_type:tm("token_type"),scope:tm("scope"),id_token:tm("id_token"),session_state:tm("session_state")},e=>({compoundKey:(0,tw.CK)(e.provider,e.providerAccountId)})),i=e("session",{sessionToken:tm("sessionToken").notNull().primaryKey(),userId:tm("userId").notNull().references(()=>t.id,{onDelete:"cascade"}),expires:eI("expires",{mode:"date"}).notNull()});return{users:t,accounts:r,sessions:i,verificationTokens:e("verificationToken",{identifier:tm("identifier").notNull(),token:tm("token").notNull(),expires:eI("expires",{mode:"date"}).notNull()},e=>({compoundKey:(0,tw.CK)(e.identifier,e.token)}))}}(t);return{createUser:async t=>await e.insert(r).values({...t,id:crypto.randomUUID()}).returning().then(e=>e[0]??null),getUser:async t=>await e.select().from(r).where((0,w.eq)(r.id,t)).then(e=>e[0]??null),getUserByEmail:async t=>await e.select().from(r).where((0,w.eq)(r.email,t)).then(e=>e[0]??null),createSession:async t=>await e.insert(n).values(t).returning().then(e=>e[0]),getSessionAndUser:async t=>await e.select({session:n,user:r}).from(n).where((0,w.eq)(n.sessionToken,t)).innerJoin(r,(0,w.eq)(r.id,n.userId)).then(e=>e[0]??null),async updateUser(t){if(!t.id)throw Error("No user id.");return await e.update(r).set(t).where((0,w.eq)(r.id,t.id)).returning().then(e=>e[0])},updateSession:async t=>await e.update(n).set(t).where((0,w.eq)(n.sessionToken,t.sessionToken)).returning().then(e=>e[0]),linkAccount:async t=>tb(await e.insert(i).values(t).returning().then(e=>e[0])),async getUserByAccount(t){let n=await e.select().from(i).where((0,w.xD)((0,w.eq)(i.providerAccountId,t.providerAccountId),(0,w.eq)(i.provider,t.provider))).leftJoin(r,(0,w.eq)(i.userId,r.id)).then(e=>e[0])??null;return n?.user??null},deleteSession:async t=>await e.delete(n).where((0,w.eq)(n.sessionToken,t)).returning().then(e=>e[0]??null),createVerificationToken:async t=>await e.insert(o).values(t).returning().then(e=>e[0]),async useVerificationToken(t){try{return await e.delete(o).where((0,w.xD)((0,w.eq)(o.identifier,t.identifier),(0,w.eq)(o.token,t.token))).returning().then(e=>e[0]??null)}catch(e){throw Error("No verification token found.")}},async deleteUser(t){await e.delete(r).where((0,w.eq)(r.id,t)).returning().then(e=>e[0]??null)},async unlinkAccount(t){let{type:r,provider:n,providerAccountId:o,userId:s}=await e.delete(i).where((0,w.xD)((0,w.eq)(i.providerAccountId,t.providerAccountId),(0,w.eq)(i.provider,t.provider))).returning().then(e=>e[0]??null);return{provider:n,type:r,providerAccountId:o,userId:s}}}}(e,t);if((0,u.is)(e,e7.z))return function(e,t=tA.Px){let{users:r,accounts:i,sessions:n,verificationTokens:o}=function(e){let t=e("user",{id:(0,tS.fL)("id").notNull().primaryKey(),name:(0,tS.fL)("name"),email:(0,tS.fL)("email").notNull(),emailVerified:(0,tk._L)("emailVerified",{mode:"timestamp_ms"}),image:(0,tS.fL)("image")}),r=e("account",{userId:(0,tS.fL)("userId").notNull().references(()=>t.id,{onDelete:"cascade"}),type:(0,tS.fL)("type").$type().notNull(),provider:(0,tS.fL)("provider").notNull(),providerAccountId:(0,tS.fL)("providerAccountId").notNull(),refresh_token:(0,tS.fL)("refresh_token"),access_token:(0,tS.fL)("access_token"),expires_at:(0,tk._L)("expires_at"),token_type:(0,tS.fL)("token_type"),scope:(0,tS.fL)("scope"),id_token:(0,tS.fL)("id_token"),session_state:(0,tS.fL)("session_state")},e=>({compoundKey:(0,tE.CK)(e.provider,e.providerAccountId)})),i=e("session",{sessionToken:(0,tS.fL)("sessionToken").notNull().primaryKey(),userId:(0,tS.fL)("userId").notNull().references(()=>t.id,{onDelete:"cascade"}),expires:(0,tk._L)("expires",{mode:"timestamp_ms"}).notNull()});return{users:t,accounts:r,sessions:i,verificationTokens:e("verificationToken",{identifier:(0,tS.fL)("identifier").notNull(),token:(0,tS.fL)("token").notNull(),expires:(0,tk._L)("expires",{mode:"timestamp_ms"}).notNull()},e=>({compoundKey:(0,tE.CK)(e.identifier,e.token)}))}}(t);return{createUser:async t=>await e.insert(r).values({...t,id:crypto.randomUUID()}).returning().get(),getUser:async t=>await e.select().from(r).where((0,w.eq)(r.id,t)).get()??null,getUserByEmail:async t=>await e.select().from(r).where((0,w.eq)(r.email,t)).get()??null,createSession:t=>e.insert(n).values(t).returning().get(),getSessionAndUser:async t=>await e.select({session:n,user:r}).from(n).where((0,w.eq)(n.sessionToken,t)).innerJoin(r,(0,w.eq)(r.id,n.userId)).get()??null,async updateUser(t){if(!t.id)throw Error("No user id.");return await e.update(r).set(t).where((0,w.eq)(r.id,t.id)).returning().get()??null},updateSession:async t=>await e.update(n).set(t).where((0,w.eq)(n.sessionToken,t.sessionToken)).returning().get()??null,linkAccount:async t=>tb(await e.insert(i).values(t).returning().get()),async getUserByAccount(t){let n=await e.select().from(i).leftJoin(r,(0,w.eq)(r.id,i.userId)).where((0,w.xD)((0,w.eq)(i.provider,t.provider),(0,w.eq)(i.providerAccountId,t.providerAccountId))).get();return n?Promise.resolve(n).then(e=>e.user):null},deleteSession:async t=>await e.delete(n).where((0,w.eq)(n.sessionToken,t)).returning().get()??null,createVerificationToken:async t=>await e.insert(o).values(t).returning().get()??null,async useVerificationToken(t){try{return await e.delete(o).where((0,w.xD)((0,w.eq)(o.identifier,t.identifier),(0,w.eq)(o.token,t.token))).returning().get()??null}catch(e){throw Error("No verification token found.")}},deleteUser:async t=>await e.delete(r).where((0,w.eq)(r.id,t)).returning().get()??null,async unlinkAccount(t){await e.delete(i).where((0,w.xD)((0,w.eq)(i.providerAccountId,t.providerAccountId),(0,w.eq)(i.provider,t.provider))).run()}}}(e,t);throw Error(`Unsupported database type (${typeof e}) in Auth.js Drizzle adapter.`)}(tT.db,tP.createTable),providers:[(0,tx.Z)({clientId:tO.O.GOOGLE_CLIENT_ID,clientSecret:tO.O.GOOGLE_CLIENT_SECRET})]},tC=c()(tj),tI=new o.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/auth/[...nextauth]/route",pathname:"/api/auth/[...nextauth]",filename:"route",bundlePath:"app/api/auth/[...nextauth]/route"},resolvedPagePath:"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/api/auth/[...nextauth]/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:t$,staticGenerationAsyncStorage:tJ,serverHooks:tM,headerHooks:tN,staticGenerationBailout:tR}=tI,tW="/api/auth/[...nextauth]/route";function tK(){return(0,a.patchFetch)({serverHooks:tM,staticGenerationAsyncStorage:tJ})}},5054:(e,t,r)=>{"use strict";r.d(t,{db:()=>l});let i=require("better-sqlite3");var n=r.n(i),o=r(9404),s=r(8654),a=r(246);let l=(0,o.t)(new(n())(s.O.DATABASE_URL,{fileMustExist:!1}),{schema:a})},246:(e,t,r)=>{"use strict";r.r(t),r.d(t,{accounts:()=>f,accountsRelations:()=>y,createTable:()=>u,posts:()=>d,sessions:()=>g,sessionsRelations:()=>m,users:()=>h,usersRelations:()=>p,verificationTokens:()=>_});var i=r(2393),n=r(9349),o=r(5225),s=r(9415),a=r(440),l=r(7591),c=r(7357);let u=(0,o._9)(e=>`anycontext_${e}`),d=u("post",{id:(0,s.e$)("id",{mode:"number"}).primaryKey({autoIncrement:!0}),name:(0,a.fL)("name",{length:256}),createdById:(0,a.fL)("createdById",{length:255}).notNull().references(()=>h.id),createdAt:(0,s.e$)("created_at",{mode:"timestamp"}).default(i.i6`CURRENT_TIMESTAMP`).notNull(),updatedAt:(0,s.e$)("updatedAt",{mode:"timestamp"})},e=>({createdByIdIdx:(0,l.Kz)("createdById_idx").on(e.createdById),nameIndex:(0,l.Kz)("name_idx").on(e.name)})),h=u("user",{id:(0,a.fL)("id",{length:255}).notNull().primaryKey(),name:(0,a.fL)("name",{length:255}),email:(0,a.fL)("email",{length:255}).notNull(),emailVerified:(0,s.e$)("emailVerified",{mode:"timestamp"}).default(i.i6`CURRENT_TIMESTAMP`),image:(0,a.fL)("image",{length:255})}),p=(0,n.lE)(h,({many:e})=>({accounts:e(f)})),f=u("account",{userId:(0,a.fL)("userId",{length:255}).notNull().references(()=>h.id),type:(0,a.fL)("type",{length:255}).$type().notNull(),provider:(0,a.fL)("provider",{length:255}).notNull(),providerAccountId:(0,a.fL)("providerAccountId",{length:255}).notNull(),refresh_token:(0,a.fL)("refresh_token"),access_token:(0,a.fL)("access_token"),expires_at:(0,s.e$)("expires_at"),token_type:(0,a.fL)("token_type",{length:255}),scope:(0,a.fL)("scope",{length:255}),id_token:(0,a.fL)("id_token"),session_state:(0,a.fL)("session_state",{length:255})},e=>({compoundKey:(0,c.CK)({columns:[e.provider,e.providerAccountId]}),userIdIdx:(0,l.Kz)("account_userId_idx").on(e.userId)})),y=(0,n.lE)(f,({one:e})=>({user:e(h,{fields:[f.userId],references:[h.id]})})),g=u("session",{sessionToken:(0,a.fL)("sessionToken",{length:255}).notNull().primaryKey(),userId:(0,a.fL)("userId",{length:255}).notNull().references(()=>h.id),expires:(0,s.e$)("expires",{mode:"timestamp"}).notNull()},e=>({userIdIdx:(0,l.Kz)("session_userId_idx").on(e.userId)})),m=(0,n.lE)(g,({one:e})=>({user:e(h,{fields:[g.userId],references:[h.id]})})),_=u("verificationToken",{identifier:(0,a.fL)("identifier",{length:255}).notNull(),token:(0,a.fL)("token",{length:255}).notNull(),expires:(0,s.e$)("expires",{mode:"timestamp"}).notNull()},e=>({compoundKey:(0,c.CK)({columns:[e.identifier,e.token]})}))},217:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.hkdf=void 0;let i=r(3153);function n(e,t){if("string"==typeof e)return new TextEncoder().encode(e);if(!(e instanceof Uint8Array))throw TypeError(`"${t}"" must be an instance of Uint8Array or a string`);return e}async function o(e,t,r,o,s){return(0,i.default)(function(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw TypeError('unsupported "digest" value')}}(e),function(e){let t=n(e,"ikm");if(!t.byteLength)throw TypeError('"ikm" must be at least one byte in length');return t}(t),n(r,"salt"),function(e){let t=n(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}(o),function(e,t){if("number"!=typeof e||!Number.isInteger(e)||e<1)throw TypeError('"keylen" must be a positive integer');if(e>255*(parseInt(t.substr(3),10)>>3||20))throw TypeError('"keylen" too large');return e}(s,e))}t.hkdf=o,t.default=o},4483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113);t.default=(e,t,r,n,o)=>{let s=parseInt(e.substr(3),10)>>3||20,a=(0,i.createHmac)(e,r.byteLength?r:new Uint8Array(s)).update(t).digest(),l=Math.ceil(o/s),c=new Uint8Array(s*l+n.byteLength+1),u=0,d=0;for(let t=1;t<=l;t++)c.set(n,d),c[d+n.byteLength]=t,c.set((0,i.createHmac)(e,a).update(c.subarray(u,d+n.byteLength+1)).digest(),d),u=d,d+=s;return c.slice(0,o)}},3153:(e,t,r)=>{"use strict";let i;Object.defineProperty(t,"__esModule",{value:!0});let n=r(6113),o=r(4483);"function"!=typeof n.hkdf||process.versions.electron||(i=async(...e)=>new Promise((t,r)=>{n.hkdf(...e,(e,i)=>{e?r(e):t(new Uint8Array(i))})})),t.default=async(e,t,r,n,s)=>(i||o.default)(e,t,r,n,s)},7162:(e,t)=>{"use strict";/*!
+ `;await t.execute(to.i6`CREATE SCHEMA IF NOT EXISTS "drizzle"`),await t.execute(r);let i=(await t.all(to.i6`select id, hash, created_at from "drizzle"."__drizzle_migrations" order by created_at desc limit 1`))[0];await t.transaction(async t=>{for await(let r of e)if(!i||Number(i.created_at){let s=e[tl.iA.Symbol.Columns][t],a=to.i6`${to.i6.identifier(s.name)} = ${r}`;return n{let n=[];if((0,tt.is)(e,to.$s.Aliased)&&e.isSelectionField)n.push(to.i6.identifier(e.fieldAlias));else if((0,tt.is)(e,to.$s.Aliased)||(0,tt.is)(e,to.$s)){let r=(0,tt.is)(e,to.$s.Aliased)?e.sql:e;t?n.push(new to.$s(r.queryChunks.map(e=>(0,tt.is)(e,t8)?to.i6.identifier(e.name):e))):n.push(r),(0,tt.is)(e,to.$s.Aliased)&&n.push(to.i6` as ${to.i6.identifier(e.fieldAlias)}`)}else(0,tt.is)(e,ts.s)&&(t?n.push(to.i6.identifier(e.name)):n.push(e));return ie===(b[tl.iA.Symbol.IsAlias]?tl.SP(b):b[tl.iA.Symbol.BaseName])))){let t=(0,tl.SP)(e.field.table);throw Error(`Your "${e.path.join("->")}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}}let w=!a||0===a.length;if(e?.length){let t=[to.i6`with `];for(let[r,i]of e.entries())t.push(to.i6`${to.i6.identifier(i[ti.g1].alias)} as (${i[ti.g1].sql})`),r{if((0,tt.is)(s,tl.iA)&&s[tl.iA.Symbol.OriginalName]!==s[tl.iA.Symbol.Name]){let e=to.i6`${to.i6.identifier(s[tl.iA.Symbol.OriginalName])}`;return s[tl.iA.Symbol.Schema]&&(e=to.i6`${to.i6.identifier(s[tl.iA.Symbol.Schema])}.${e}`),to.i6`${e} ${to.i6.identifier(s[tl.iA.Symbol.Name])}`}return s})(),x=[];if(a)for(let[e,t]of a.entries()){0===e&&x.push(to.i6` `);let r=t.table,i=t.lateral?to.i6` lateral`:void 0;if((0,tt.is)(r,tG.YA)){let e=r[tG.YA.Symbol.Name],n=r[tG.YA.Symbol.Schema],s=r[tG.YA.Symbol.OriginalName],a=e===s?void 0:t.alias;x.push(to.i6`${to.i6.raw(t.joinType)} join${i} ${n?to.i6`${to.i6.identifier(n)}.`:void 0}${to.i6.identifier(s)}${a&&to.i6` ${to.i6.identifier(a)}`} on ${t.on}`)}else if((0,tt.is)(r,to.G7)){let e=r[tc.d].name,n=r[tc.d].schema,s=r[tc.d].originalName,a=e===s?void 0:t.alias;x.push(to.i6`${to.i6.raw(t.joinType)} join${i} ${n?to.i6`${to.i6.identifier(n)}.`:void 0}${to.i6.identifier(s)}${a&&to.i6` ${to.i6.identifier(a)}`} on ${t.on}`)}else x.push(to.i6`${to.i6.raw(t.joinType)} join${i} ${r} on ${t.on}`);e0&&(g=to.i6` order by ${to.i6.join(o,to.i6`, `)}`),l&&l.length>0&&(y=to.i6` group by ${to.i6.join(l,to.i6`, `)}`);let T=u?to.i6` limit ${u}`:void 0,C=c?to.i6` offset ${c}`:void 0,O=to.i6.empty();if(d){let e=to.i6` for ${to.i6.raw(d.strength)}`;d.config.of&&e.append(to.i6` of ${to.i6.join(Array.isArray(d.config.of)?d.config.of:[d.config.of],to.i6`, `)}`),d.config.noWait?e.append(to.i6` no wait`):d.config.skipLocked&&e.append(to.i6` skip locked`),O.append(e)}let P=to.i6`${f}select${m} ${_} from ${S}${k}${E}${y}${A}${g}${T}${C}${O}`;return p.length>0?this.buildSetOperations(P,p):P}buildSetOperations(e,t){let[r,...i]=t;if(!r)throw Error("Cannot pass undefined values to any set operator");return 0===i.length?this.buildSetOperationQuery({leftSelect:e,setOperator:r}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:r}),i)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:r,rightSelect:i,limit:n,orderBy:s,offset:a}}){let o;let l=to.i6`(${e.getSQL()}) `,u=to.i6`(${i.getSQL()})`;if(s&&s.length>0){let e=[];for(let t of s)if((0,tt.is)(t,t8))e.push(to.i6.identifier(t.name));else if((0,tt.is)(t,to.$s)){for(let e=0;eto.i6.identifier(e.name));for(let[e,r]of t.entries()){let i=[];for(let[e,t]of s){let n=r[e];if(void 0===n||(0,tt.is)(n,to.dO)&&void 0===n.value){if(void 0!==t.defaultFn){let e=t.defaultFn(),r=(0,tt.is)(e,to.$s)?e:to.i6.param(e,t);i.push(r)}else i.push(to.i6`default`)}else i.push(n)}n.push(i),e({dbKey:t.name,tsKey:e,field:(0,tn.lw)(t,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let i=Object.fromEntries(Object.entries(n.columns).map(([e,t])=>[e,(0,tn.lw)(t,a)]));if(s.where){let e="function"==typeof s.where?s.where(i,(0,ta.vU)()):s.where;f=e&&(0,tn.UI)(e,a)}let o=[],l=[];if(s.columns){let e=!1;for(let[t,r]of Object.entries(s.columns))void 0!==r&&t in n.columns&&(e||!0!==r||(e=!0),l.push(t));l.length>0&&(l=e?l.filter(e=>s.columns?.[e]===!0):Object.keys(n.columns).filter(e=>!l.includes(e)))}else l=Object.keys(n.columns);for(let e of l){let t=n.columns[e];o.push({tsKey:e,value:t})}let u=[];if(s.with&&(u=Object.entries(s.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:n.relations[e]}))),s.extras)for(let[e,t]of Object.entries("function"==typeof s.extras?s.extras(i,{sql:to.i6}):s.extras))o.push({tsKey:e,value:(0,tn.qD)(t,a)});for(let{tsKey:e,value:t}of o)c.push({dbKey:(0,tt.is)(t,to.$s.Aliased)?t.fieldAlias:n.columns[e].name,tsKey:e,field:(0,tt.is)(t,ts.s)?(0,tn.lw)(t,a):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let g="function"==typeof s.orderBy?s.orderBy(i,(0,ta.pl)()):s.orderBy??[];for(let{tsKey:i,queryConfig:n,relation:o}of(Array.isArray(g)||(g=[g]),p=g.map(e=>(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):(0,tn.UI)(e,a)),d=s.limit,h=s.offset,u)){let s=(0,ta.wG)(t,r,o),l=r[o.referencedTable[tl.iA.Symbol.Name]],u=`${a}_${i}`,d=(0,td.xD)(...s.fields.map((e,t)=>(0,td.eq)((0,tn.lw)(s.references[t],u),(0,tn.lw)(e,a)))),h=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:r,table:e[l],tableConfig:t[l],queryConfig:(0,tt.is)(o,ta.fh)?!0===n?{limit:1}:{...n,limit:1}:n,tableAlias:u,joinOn:d,nestedQueryRelation:o}),p=to.i6`${to.i6.identifier(u)}.${to.i6.identifier("data")}`.as(i);m.push({on:to.i6`true`,table:new ti.k(h.sql,{},u),alias:u,joinType:"left",lateral:!0}),c.push({dbKey:i,tsKey:i,field:p,relationTableTsKey:l,isJson:!0,selection:h.selection})}}if(0===c.length)throw new th.k({message:`No fields selected for table "${n.tsName}" ("${a}")`});if(f=(0,td.xD)(l,f),o){let e=to.i6`json_build_array(${to.i6.join(c.map(({field:e,tsKey:t,isJson:r})=>r?to.i6`${to.i6.identifier(`${a}_${t}`)}.${to.i6.identifier("data")}`:(0,tt.is)(e,to.$s.Aliased)?e.sql:e),to.i6`, `)})`;(0,tt.is)(o,ta.sj)&&(e=to.i6`coalesce(json_agg(${e}${p.length>0?to.i6` order by ${to.i6.join(p,to.i6`, `)}`:void 0}), '[]'::json)`);let t=[{dbKey:"data",tsKey:"data",field:e.as("data"),isJson:!0,relationTableTsKey:n.tsName,selection:c}];void 0!==d||void 0!==h||p.length>0?(u=this.buildSelectQuery({table:(0,tn.RQ)(i,a),fields:{},fieldsFlat:[{path:[],field:to.i6.raw("*")}],where:f,limit:d,offset:h,orderBy:p,setOperators:[]}),f=void 0,d=void 0,h=void 0,p=[]):u=(0,tn.RQ)(i,a),u=this.buildSelectQuery({table:(0,tt.is)(u,tG.YA)?u:new ti.k(u,{},a),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):e})),joins:m,where:f,limit:d,offset:h,orderBy:p,setOperators:[]})}else u=this.buildSelectQuery({table:(0,tn.RQ)(i,a),fields:{},fieldsFlat:c.map(({field:e})=>({path:[],field:(0,tt.is)(e,ts.s)?(0,tn.lw)(e,a):e})),joins:m,where:f,limit:d,offset:h,orderBy:p,setOperators:[]});return{tableTsKey:n.tsName,sql:u,selection:c}}}var rS=r(8772);class rx{static{this[tt.Q]="PgSelectBuilder"}constructor(e){this.withList=[],this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}from(e){let t;let r=!!this.fields;return t=this.fields?this.fields:(0,tt.is)(e,ti.k)?Object.fromEntries(Object.keys(e[ti.g1].selection).map(t=>[t,e[t]])):(0,tt.is)(e,rw)?e[tc.d].selectedFields:(0,tt.is)(e,to.$s)?{}:(0,tu.SS)(e),new rE({table:e,fields:t,isPartialSelect:r,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class rk extends tO.b{static{this[tt.Q]="PgSelectQueryBuilder"}constructor({table:e,fields:t,isPartialSelect:r,session:i,dialect:n,withList:s,distinct:a}){super(),this.leftJoin=this.createJoin("left"),this.rightJoin=this.createJoin("right"),this.innerJoin=this.createJoin("inner"),this.fullJoin=this.createJoin("full"),this.union=this.createSetOperator("union",!1),this.unionAll=this.createSetOperator("union",!0),this.intersect=this.createSetOperator("intersect",!1),this.intersectAll=this.createSetOperator("intersect",!0),this.except=this.createSetOperator("except",!1),this.exceptAll=this.createSetOperator("except",!0),this.config={withList:s,table:e,fields:{...t},distinct:a,setOperators:[]},this.isPartialSelect=r,this.session=i,this.dialect=n,this._={selectedFields:t},this.tableName=(0,tu.dP)(e),this.joinsNotNullableMap="string"==typeof this.tableName?{[this.tableName]:!0}:{}}createJoin(e){return(t,r)=>{let i=this.tableName,n=(0,tu.dP)(t);if("string"==typeof n&&this.config.joins?.some(e=>e.alias===n))throw Error(`Alias "${n}" is already used in this query`);if(!this.isPartialSelect&&(1===Object.keys(this.joinsNotNullableMap).length&&"string"==typeof i&&(this.config.fields={[i]:this.config.fields}),"string"==typeof n&&!(0,tt.is)(t,to.$s))){let e=(0,tt.is)(t,ti.k)?t[ti.g1].selection:(0,tt.is)(t,to.G7)?t[tc.d].selectedFields:t[tl.iA.Symbol.Columns];this.config.fields[n]=e}if("function"==typeof r&&(r=r(new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:t,joinType:e,alias:n}),"string"==typeof n)switch(e){case"left":this.joinsNotNullableMap[n]=!1;break;case"right":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[n]=!0;break;case"inner":this.joinsNotNullableMap[n]=!0;break;case"full":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[n]=!1}return this}}createSetOperator(e,t){return r=>{let i="function"==typeof r?r(rT()):r;if(!(0,tu.ux)(this.getSelectedFields(),i.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:t,rightSelect:i}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return"function"==typeof e&&(e=e(new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.fields,new tr.e({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=r:this.config.orderBy=r}else this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=e:this.config.orderBy=e;return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){return new Proxy(new ti.k(this.getSQL(),this.config.fields,e),new tr.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new tr.e({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class rE extends rk{static{this[tt.Q]="PgSelect"}_prepare(e){let{session:t,config:r,dialect:i,joinsNotNullableMap:n}=this;if(!t)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");return rS.Z.startActiveSpan("drizzle.prepareQuery",()=>{let s=(0,tu.ZS)(r.fields),a=t.prepareQuery(i.sqlToQuery(this.getSQL()),s,e);return a.joinsNotNullableMap=n,a})}prepare(e){return this._prepare(e)}constructor(...e){super(...e),this.execute=e=>rS.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e))}}function rA(e,t){return(r,i,...n)=>{let s=[i,...n].map(r=>({type:e,isAll:t,rightSelect:r}));for(let e of s)if(!(0,tu.ux)(r.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return r.addSetOperators(s)}}(0,tu.ef)(rE,[tP.N]);let rT=()=>({union:rC,unionAll:rO,intersect:rP,intersectAll:r$,except:rN,exceptAll:rR}),rC=rA("union",!1),rO=rA("union",!0),rP=rA("intersect",!1),r$=rA("intersect",!0),rN=rA("except",!1),rR=rA("except",!0);class rI{static{this[tt.Q]="PgQueryBuilder"}$with(e){let t=this;return{as:r=>("function"==typeof r&&(r=r(t)),new Proxy(new ti.SC(r.getSQL(),r.getSelectedFields(),e,!0),new tr.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(r){return new rx({fields:r??void 0,session:void 0,dialect:t.getDialect(),withList:e})},selectDistinct:function(e){return new rx({fields:e??void 0,session:void 0,dialect:t.getDialect(),distinct:!0})},selectDistinctOn:function(e,r){return new rx({fields:r??void 0,session:void 0,dialect:t.getDialect(),distinct:{on:e}})}}}select(e){return new rx({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new rx({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,t){return new rx({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||(this.dialect=new r_),this.dialect}}class rj{constructor(e,t,r){this.table=e,this.session=t,this.dialect=r}static{this[tt.Q]="PgUpdateBuilder"}set(e){return new rL(this.table,(0,tu.M6)(this.table,e),this.session,this.dialect)}}class rL extends tP.N{constructor(e,t,r,i){super(),this.execute=e=>this._prepare().execute(e),this.session=r,this.dialect=i,this.config={set:t,table:e}}static{this[tt.Q]="PgUpdate"}where(e){return this.config.where=e,this}returning(e=this.config.table[tl.iA.Symbol.Columns]){return this.config.returning=(0,tu.ZS)(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e)}prepare(e){return this._prepare(e)}$dynamic(){return this}}class rD{constructor(e,t,r){this.table=e,this.session=t,this.dialect=r}static{this[tt.Q]="PgInsertBuilder"}values(e){if(0===(e=Array.isArray(e)?e:[e]).length)throw Error("values() must be called with at least one value");let t=e.map(e=>{let t={},r=this.table[tl.iA.Symbol.Columns];for(let i of Object.keys(e)){let n=e[i];t[i]=(0,tt.is)(n,to.$s)?n:new to.dO(n,r[i])}return t});return new rM(this.table,t,this.session,this.dialect)}}class rM extends tP.N{constructor(e,t,r,i){super(),this.execute=e=>rS.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e)),this.session=r,this.dialect=i,this.config={table:e,values:t}}static{this[tt.Q]="PgInsert"}returning(e=this.config.table[tl.iA.Symbol.Columns]){return this.config.returning=(0,tu.ZS)(e),this}onConflictDoNothing(e={}){if(void 0===e.target)this.config.onConflict=to.i6`do nothing`;else{let t="";t=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(e.name)).join(","):this.dialect.escapeName(e.target.name);let r=e.where?to.i6` where ${e.where}`:void 0;this.config.onConflict=to.i6`(${to.i6.raw(t)}) do nothing${r}`}return this}onConflictDoUpdate(e){let t=e.where?to.i6` where ${e.where}`:void 0,r=this.dialect.buildUpdateSet(this.config.table,(0,tu.M6)(this.config.table,e.set)),i="";return i=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(e.name)).join(","):this.dialect.escapeName(e.target.name),this.config.onConflict=to.i6`(${to.i6.raw(i)}) do update set ${r}${t}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return rS.Z.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e))}prepare(e){return this._prepare(e)}$dynamic(){return this}}class rU extends tP.N{constructor(e,t,r){super(),this.execute=e=>rS.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e)),this.session=t,this.dialect=r,this.config={table:e}}static{this[tt.Q]="PgDelete"}where(e){return this.config.where=e,this}returning(e=this.config.table[tl.iA.Symbol.Columns]){return this.config.returning=(0,tu.ZS)(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return rS.Z.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e))}prepare(e){return this._prepare(e)}$dynamic(){return this}}class rq{constructor(e,t,r,i,n,s,a){this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=i,this.tableConfig=n,this.dialect=s,this.session=a}static{this[tt.Q]="PgRelationalQueryBuilder"}findMany(e){return new rQ(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many")}findFirst(e){return new rQ(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first")}}class rQ extends tP.N{constructor(e,t,r,i,n,s,a,o,l){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=i,this.tableConfig=n,this.dialect=s,this.session=a,this.config=o,this.mode=l}static{this[tt.Q]="PgRelationalQuery"}_prepare(e){return rS.Z.startActiveSpan("drizzle.prepareQuery",()=>{let{query:t,builtQuery:r}=this._toSQL();return this.session.prepareQuery(r,void 0,e,(e,r)=>{let i=e.map(e=>(0,ta.WX)(this.schema,this.tableConfig,e,t.selection,r));return"first"===this.mode?i[0]:i})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let e=this._getQuery(),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}execute(){return rS.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute())}}class rB extends tP.N{constructor(e,t,r,i){super(),this.execute=e,this.sql=t,this.query=r,this.mapBatchResult=i}static{this[tt.Q]="PgRaw"}getSQL(){return this.sql}getQuery(){return this.query}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}}class rH extends tP.N{constructor(e,t,r){super(),this.execute=e=>rS.Z.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e)),this.session=t,this.dialect=r,this.config={view:e}}static{this[tt.Q]="PgRefreshMaterializedView"}concurrently(){if(void 0!==this.config.withNoData)throw Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(void 0!==this.config.concurrently)throw Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return rS.Z.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e))}prepare(e){return this._prepare(e)}}class rK{constructor(e,t,r){if(this.dialect=e,this.session=t,this._=r?{schema:r.schema,tableNamesMap:r.tableNamesMap}:{schema:void 0,tableNamesMap:{}},this.query={},this._.schema)for(let[i,n]of Object.entries(this._.schema))this.query[i]=new rq(r.fullSchema,this._.schema,this._.tableNamesMap,r.fullSchema[i],n,e,t)}static{this[tt.Q]="PgDatabase"}$with(e){return{as:t=>("function"==typeof t&&(t=t(new rI)),new Proxy(new ti.SC(t.getSQL(),t.getSelectedFields(),e,!0),new tr.e({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}}with(...e){let t=this;return{select:function(r){return new rx({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e})}}}select(e){return new rx({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new rx({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,t){return new rx({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new rj(e,this.session,this.dialect)}insert(e){return new rD(e,this.session,this.dialect)}delete(e){return new rU(e,this.session,this.dialect)}refreshMaterializedView(e){return new rH(e,this.session,this.dialect)}execute(e){let t=e.getSQL(),r=this.dialect.sqlToQuery(t),i=this.session.prepareQuery(r,void 0,void 0);return new rB(()=>i.execute(),t,r,e=>i.mapResult(e,!1))}transaction(e,t){return this.session.transaction(e,t)}}var rF=r(4078);class rV extends tx{static{this[tt.Q]="MySqlVarCharBuilder"}constructor(e,t){super(e,"string","MySqlVarChar"),this.config.length=t.length,this.config.enum=t.enum}build(e){return new rW(e,this.config)}}class rW extends tk{static{this[tt.Q]="MySqlVarChar"}getSQLType(){return void 0===this.length?"varchar":`varchar(${this.length})`}constructor(...e){super(...e),this.length=this.config.length,this.enumValues=this.config.enum}}function rz(e,t){return new rV(e,t)}class rJ extends tx{static{this[tt.Q]="MySqlDateColumnBuilder"}defaultNow(){return this.default(to.i6`(now())`)}onUpdateNow(){return this.config.hasOnUpdateNow=!0,this.config.hasDefault=!0,this}}class rZ extends tk{static{this[tt.Q]="MySqlDateColumn"}constructor(...e){super(...e),this.hasOnUpdateNow=this.config.hasOnUpdateNow}}class rG extends rJ{static{this[tt.Q]="MySqlTimestampBuilder"}constructor(e,t){super(e,"date","MySqlTimestamp"),this.config.fsp=t?.fsp}build(e){return new rX(e,this.config)}}class rX extends rZ{static{this[tt.Q]="MySqlTimestamp"}getSQLType(){let e=void 0===this.fsp?"":`(${this.fsp})`;return`timestamp${e}`}mapFromDriverValue(e){return new Date(e+"+0000")}mapToDriverValue(e){return e.toISOString().slice(0,-1).replace("T"," ")}constructor(...e){super(...e),this.fsp=this.config.fsp}}class rY extends rJ{static{this[tt.Q]="MySqlTimestampStringBuilder"}constructor(e,t){super(e,"string","MySqlTimestampString"),this.config.fsp=t?.fsp}build(e){return new r0(e,this.config)}}class r0 extends rZ{static{this[tt.Q]="MySqlTimestampString"}getSQLType(){let e=void 0===this.fsp?"":`(${this.fsp})`;return`timestamp${e}`}constructor(...e){super(...e),this.fsp=this.config.fsp}}function r1(e,t={}){return"string"===t.mode?new rY(e,t):new rG(e,t)}class r6 extends tE{static{this[tt.Q]="MySqlIntBuilder"}constructor(e,t){super(e,"number","MySqlInt"),this.config.unsigned=!!t&&t.unsigned}build(e){return new r2(e,this.config)}}class r2 extends tA{static{this[tt.Q]="MySqlInt"}getSQLType(){return`int${this.config.unsigned?" unsigned":""}`}mapFromDriverValue(e){return"string"==typeof e?Number(e):e}}function r4(...e){return e[0].columns?new r5(e[0].columns,e[0].name):new r5(e)}class r5{static{this[tt.Q]="MySqlPrimaryKeyBuilder"}constructor(e,t){this.columns=e,this.name=t}build(e){return new r3(e,this.columns,this.name)}}class r3{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static{this[tt.Q]="MySqlPrimaryKey"}getName(){return this.name??`${this.table[tm.Symbol.Name]}_${this.columns.map(e=>e.name).join("_")}_pk`}}class r8 extends t3{static{this[tt.Q]="PgTextBuilder"}constructor(e,t){super(e,"string","PgText"),this.config.enumValues=t.enum}build(e){return new r9(e,this.config)}}class r9 extends t8{static{this[tt.Q]="PgText"}getSQLType(){return"text"}constructor(...e){super(...e),this.enumValues=this.config.enumValues}}function r7(e,t={}){return new r8(e,t)}class ie extends t3{static{this[tt.Q]="PgIntegerBuilder"}constructor(e){super(e,"number","PgInteger")}build(e){return new it(e,this.config)}}class it extends t8{static{this[tt.Q]="PgInteger"}getSQLType(){return"integer"}mapFromDriverValue(e){return"string"==typeof e?Number.parseInt(e):e}}var ir=r(8018);function ii(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}var is=r(1701),ia=r(2404),io=r(9352),il=r(5315),iu=function(e,t,r,i,n){if("m"===i)throw TypeError("Private method is not writable");if("a"===i&&!n)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,r):n?n.value=r:t.set(e,r),r},ic=function(e,t,r,i){if("a"===r&&!i)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};function id(e){let t=e?"__Secure-":"";return{sessionToken:{name:`${t}authjs.session-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},callbackUrl:{name:`${t}authjs.callback-url`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},csrfToken:{name:`${e?"__Host-":""}authjs.csrf-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},pkceCodeVerifier:{name:`${t}authjs.pkce.code_verifier`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},state:{name:`${t}authjs.state`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},nonce:{name:`${t}authjs.nonce`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},webauthnChallenge:{name:`${t}authjs.challenge`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}}}}class ih{constructor(e,t,r){if(s1.add(this),s6.set(this,{}),s2.set(this,void 0),s4.set(this,void 0),iu(this,s4,r,"f"),iu(this,s2,e,"f"),!t)return;let{name:i}=e;for(let[e,r]of Object.entries(t))e.startsWith(i)&&r&&(ic(this,s6,"f")[e]=r)}get value(){return Object.keys(ic(this,s6,"f")).sort((e,t)=>parseInt(e.split(".").pop()||"0")-parseInt(t.split(".").pop()||"0")).map(e=>ic(this,s6,"f")[e]).join("")}chunk(e,t){let r=ic(this,s1,"m",s3).call(this);for(let i of ic(this,s1,"m",s5).call(this,{name:ic(this,s2,"f").name,value:e,options:{...ic(this,s2,"f").options,...t}}))r[i.name]=i;return Object.values(r)}clean(){return Object.values(ic(this,s1,"m",s3).call(this))}}s6=new WeakMap,s2=new WeakMap,s4=new WeakMap,s1=new WeakSet,s5=function(e){let t=Math.ceil(e.value.length/3936);if(1===t)return ic(this,s6,"f")[e.name]=e.value,[e];let r=[];for(let i=0;ie.value.length+160)}),r},s3=function(){let e={};for(let t in ic(this,s6,"f"))delete ic(this,s6,"f")?.[t],e[t]={name:t,value:"",options:{...ic(this,s2,"f").options,maxAge:0}};return e};class ip extends Error{constructor(e,t){e instanceof Error?super(void 0,{cause:{err:e,...e.cause,...t}}):"string"==typeof e?(t instanceof Error&&(t={err:t,...t.cause}),super(e,t)):super(void 0,e),this.name=this.constructor.name,this.type=this.constructor.type??"AuthError",this.kind=this.constructor.kind??"error",Error.captureStackTrace?.(this,this.constructor);let r=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?" .":""}Read more at ${r}`}}class im extends ip{}im.kind="signIn";class ig extends ip{}ig.type="AdapterError";class iy extends ip{}iy.type="AuthorizedCallbackError";class iv extends ip{}iv.type="CallbackRouteError";class ib extends ip{}ib.type="ErrorPageLoop";class iw extends ip{}iw.type="EventError";class i_ extends ip{}i_.type="InvalidCallbackUrl";class iS extends im{}iS.type="CredentialsSignin";class ix extends ip{}ix.type="InvalidEndpoints";class ik extends ip{}ik.type="InvalidCheck";class iE extends ip{}iE.type="JWTSessionError";class iA extends ip{}iA.type="MissingAdapter";class iT extends ip{}iT.type="MissingAdapterMethods";class iC extends ip{}iC.type="MissingAuthorize";class iO extends ip{}iO.type="MissingSecret";class iP extends im{}iP.type="OAuthAccountNotLinked";class i$ extends im{}i$.type="OAuthCallbackError";class iN extends ip{}iN.type="OAuthProfileParseError";class iR extends ip{}iR.type="SessionTokenError";class iI extends im{}iI.type="OAuthSignInError";class ij extends im{}ij.type="EmailSignInError";class iL extends ip{}iL.type="SignOutError";class iD extends ip{}iD.type="UnknownAction";class iM extends ip{}iM.type="UnsupportedStrategy";class iU extends ip{}iU.type="InvalidProvider";class iq extends ip{}iq.type="UntrustedHost";class iQ extends ip{}iQ.type="Verification";class iB extends im{}iB.type="MissingCSRF";class iH extends ip{}iH.type="DuplicateConditionalUI";class iK extends ip{}iK.type="MissingWebAuthnAutocomplete";class iF extends ip{}iF.type="WebAuthnVerificationError";class iV extends im{}iV.type="AccountNotLinked";class iW extends ip{}iW.type="ExperimentalFeatureNotEnabled";let iz=!1;function iJ(e,t){try{return/^https?:/.test(new URL(e,e.startsWith("/")?t:void 0).protocol)}catch{return!1}}let iZ=!1,iG=!1,iX=!1,iY=["createVerificationToken","useVerificationToken","getUserByEmail"],i0=["createUser","getUser","getUserByEmail","getUserByAccount","updateUser","linkAccount","createSession","getSessionAndUser","updateSession","deleteSession"],i1=["createUser","getUser","linkAccount","getAccount","getAuthenticator","createAuthenticator","listAuthenticatorsByUserId","updateAuthenticatorCounter"],i6=()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;throw Error("unable to locate global object")},i2=async(e,t,r,i,n)=>{let{crypto:{subtle:s}}=i6();return new Uint8Array(await s.deriveBits({name:"HKDF",hash:`SHA-${e.substr(3)}`,salt:r,info:i},await s.importKey("raw",t,"HKDF",!1,["deriveBits"]),n<<3))};function i4(e,t){if("string"==typeof e)return new TextEncoder().encode(e);if(!(e instanceof Uint8Array))throw TypeError(`"${t}"" must be an instance of Uint8Array or a string`);return e}async function i5(e,t,r,i,n){return i2(function(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw TypeError('unsupported "digest" value')}}(e),function(e){let t=i4(e,"ikm");if(!t.byteLength)throw TypeError('"ikm" must be at least one byte in length');return t}(t),i4(r,"salt"),function(e){let t=i4(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}(i),function(e,t){if("number"!=typeof e||!Number.isInteger(e)||e<1)throw TypeError('"keylen" must be a positive integer');if(e>255*(parseInt(t.substr(3),10)>>3||20))throw TypeError('"keylen" too large');return e}(n,e))}let i3=crypto,i8=e=>e instanceof CryptoKey,i9=async(e,t)=>{let r=`SHA-${e.slice(-3)}`;return new Uint8Array(await i3.subtle.digest(r,t))},i7=new TextEncoder,ne=new TextDecoder;function nt(...e){let t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return r}function nr(e,t,r){if(t<0||t>=4294967296)throw RangeError(`value must be >= 0 and <= ${4294967296-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function ni(e){let t=new Uint8Array(8);return nr(t,Math.floor(e/4294967296),0),nr(t,e%4294967296,4),t}function nn(e){let t=new Uint8Array(4);return nr(t,e),t}function ns(e){return nt(nn(e.length),e)}async function na(e,t,r){let i=Math.ceil((t>>3)/32),n=new Uint8Array(32*i);for(let t=0;t>3)}let no=e=>{let t=e;"string"==typeof t&&(t=i7.encode(t));let r=[];for(let e=0;eno(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),nu=e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=ne.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return nu(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}};class nd extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class nh extends nd{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}class np extends nd{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}class nf extends nd{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class nm extends nd{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class ng extends nd{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class ny extends nd{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class nv extends nd{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class nb extends nd{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}Symbol.asyncIterator;let nw=i3.getRandomValues.bind(i3);function n_(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new nm(`Unsupported JWE Algorithm: ${e}`)}}let nS=e=>nw(new Uint8Array(n_(e)>>3)),nx=(e,t)=>{if(t.length<<3!==n_(e))throw new ny("Invalid Initialization Vector length")},nk=(e,t)=>{let r=e.byteLength<<3;if(r!==t)throw new ny(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)},nE=(e,t)=>{if(!(e instanceof Uint8Array))throw TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw TypeError("Second argument must be a buffer");if(e.length!==t.length)throw TypeError("Input buffers must have the same length");let r=e.length,i=0,n=-1;for(;++ne.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){let r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}(e,r)}function nO(e,t,...r){if(r.length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let nP=(e,...t)=>nO("Key must be ",e,...t);function n$(e,t,...r){return nO(`Key for the ${e} algorithm must be `,t,...r)}let nN=e=>i8(e),nR=["CryptoKey"];async function nI(e,t,r,i,n,s){let a,o;if(!(t instanceof Uint8Array))throw TypeError(nP(t,"Uint8Array"));let l=parseInt(e.slice(1,4),10),u=await i3.subtle.importKey("raw",t.subarray(l>>3),"AES-CBC",!1,["decrypt"]),c=await i3.subtle.importKey("raw",t.subarray(0,l>>3),{hash:`SHA-${l<<1}`,name:"HMAC"},!1,["sign"]),d=nt(s,i,r,ni(s.length<<3)),h=new Uint8Array((await i3.subtle.sign("HMAC",c,d)).slice(0,l>>3));try{a=nE(n,h)}catch{}if(!a)throw new ng;try{o=new Uint8Array(await i3.subtle.decrypt({iv:i,name:"AES-CBC"},u,r))}catch{}if(!o)throw new ng;return o}async function nj(e,t,r,i,n,s){let a;t instanceof Uint8Array?a=await i3.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(nC(t,e,"decrypt"),a=t);try{return new Uint8Array(await i3.subtle.decrypt({additionalData:s,iv:i,name:"AES-GCM",tagLength:128},a,nt(r,n)))}catch{throw new ng}}let nL=async(e,t,r,i,n,s)=>{if(!i8(t)&&!(t instanceof Uint8Array))throw TypeError(nP(t,...nR,"Uint8Array"));if(!i)throw new ny("JWE Initialization Vector missing");if(!n)throw new ny("JWE Authentication Tag missing");switch(nx(e,i),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&nk(t,parseInt(e.slice(-3),10)),nI(e,t,r,i,n,s);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&nk(t,parseInt(e.slice(1,4),10)),nj(e,t,r,i,n,s);default:throw new nm("Unsupported JWE Content Encryption Algorithm")}},nD=(...e)=>{let t;let r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0};function nM(e){if(!("object"==typeof e&&null!==e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}let nU=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function nq(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function nQ(e,t,r){if(i8(e))return nC(e,t,r),e;if(e instanceof Uint8Array)return i3.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw TypeError(nP(e,...nR,"Uint8Array"))}let nB=async(e,t,r)=>{let i=await nQ(t,e,"wrapKey");nq(i,e);let n=await i3.subtle.importKey("raw",r,...nU);return new Uint8Array(await i3.subtle.wrapKey("raw",n,i,"AES-KW"))},nH=async(e,t,r)=>{let i=await nQ(t,e,"unwrapKey");nq(i,e);let n=await i3.subtle.unwrapKey("raw",r,i,"AES-KW",...nU);return new Uint8Array(await i3.subtle.exportKey("raw",n))};async function nK(e,t,r,i,n=new Uint8Array(0),s=new Uint8Array(0)){let a;if(!i8(e))throw TypeError(nP(e,...nR));if(nC(e,"ECDH"),!i8(t))throw TypeError(nP(t,...nR));nC(t,"ECDH","deriveBits");let o=nt(ns(i7.encode(r)),ns(n),ns(s),nn(i));return a="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,na(new Uint8Array(await i3.subtle.deriveBits({name:e.algorithm.name,public:e},t,a)),i,o)}async function nF(e){if(!i8(e))throw TypeError(nP(e,...nR));return i3.subtle.generateKey(e.algorithm,!0,["deriveBits"])}function nV(e){if(!i8(e))throw TypeError(nP(e,...nR));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function nW(e,t,r,i){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new ny("PBES2 Salt Input must be 8 or more octets")}(e);let n=nt(i7.encode(t),new Uint8Array([0]),e),s=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:n},o=await function(e,t){if(e instanceof Uint8Array)return i3.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(i8(e))return nC(e,t,"deriveBits","deriveKey"),e;throw TypeError(nP(e,...nR,"Uint8Array"))}(i,t);if(o.usages.includes("deriveBits"))return new Uint8Array(await i3.subtle.deriveBits(a,o,s));if(o.usages.includes("deriveKey"))return i3.subtle.deriveKey(a,o,{length:s,name:"AES-KW"},!1,["wrapKey","unwrapKey"]);throw TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}let nz=async(e,t,r,i=2048,n=nw(new Uint8Array(16)))=>{let s=await nW(n,e,i,t);return{encryptedKey:await nB(e.slice(-6),s,r),p2c:i,p2s:nl(n)}},nJ=async(e,t,r,i,n)=>{let s=await nW(n,e,i,t);return nH(e.slice(-6),s,r)};function nZ(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new nm(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}let nG=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},nX=async(e,t,r)=>{if(!i8(t))throw TypeError(nP(t,...nR));if(nC(t,e,"encrypt","wrapKey"),nG(e,t),t.usages.includes("encrypt"))return new Uint8Array(await i3.subtle.encrypt(nZ(e),t,r));if(t.usages.includes("wrapKey")){let i=await i3.subtle.importKey("raw",r,...nU);return new Uint8Array(await i3.subtle.wrapKey("raw",i,t,nZ(e)))}throw TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},nY=async(e,t,r)=>{if(!i8(t))throw TypeError(nP(t,...nR));if(nC(t,e,"decrypt","unwrapKey"),nG(e,t),t.usages.includes("decrypt"))return new Uint8Array(await i3.subtle.decrypt(nZ(e),t,r));if(t.usages.includes("unwrapKey")){let i=await i3.subtle.unwrapKey("raw",r,t,nZ(e),...nU);return new Uint8Array(await i3.subtle.exportKey("raw",i))}throw TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function n0(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new nm(`Unsupported JWE Algorithm: ${e}`)}}let n1=e=>nw(new Uint8Array(n0(e)>>3)),n6=async e=>{if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new nm('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new nm('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new nm('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new nm('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),i=[t,e.ext??!1,e.key_ops??r],n={...e};return delete n.alg,delete n.use,i3.subtle.importKey("jwk",n,...i)};async function n2(e,t){if(!nM(e))throw TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return nc(e.k);case"RSA":if(void 0!==e.oth)throw new nm('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return n6({...e,alg:t});default:throw new nm('Unsupported "kty" (Key Type) Parameter value')}}let n4=(e,t)=>{if(!(t instanceof Uint8Array)){if(!nN(t))throw TypeError(n$(e,t,...nR,"Uint8Array"));if("secret"!==t.type)throw TypeError(`${nR.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},n5=(e,t,r)=>{if(!nN(t))throw TypeError(n$(e,t,...nR));if("secret"===t.type)throw TypeError(`${nR.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw TypeError(`${nR.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw TypeError(`${nR.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw TypeError(`${nR.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw TypeError(`${nR.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)},n3=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?n4(e,t):n5(e,t,r)};async function n8(e,t,r,i,n){if(!(r instanceof Uint8Array))throw TypeError(nP(r,"Uint8Array"));let s=parseInt(e.slice(1,4),10),a=await i3.subtle.importKey("raw",r.subarray(s>>3),"AES-CBC",!1,["encrypt"]),o=await i3.subtle.importKey("raw",r.subarray(0,s>>3),{hash:`SHA-${s<<1}`,name:"HMAC"},!1,["sign"]),l=new Uint8Array(await i3.subtle.encrypt({iv:i,name:"AES-CBC"},a,t)),u=nt(n,i,l,ni(n.length<<3));return{ciphertext:l,tag:new Uint8Array((await i3.subtle.sign("HMAC",o,u)).slice(0,s>>3))}}async function n9(e,t,r,i,n){let s;r instanceof Uint8Array?s=await i3.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(nC(r,e,"encrypt"),s=r);let a=new Uint8Array(await i3.subtle.encrypt({additionalData:n,iv:i,name:"AES-GCM",tagLength:128},s,t)),o=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:o}}let n7=async(e,t,r,i,n)=>{if(!i8(r)&&!(r instanceof Uint8Array))throw TypeError(nP(r,...nR,"Uint8Array"));switch(nx(e,i),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&nk(r,parseInt(e.slice(-3),10)),n8(e,t,r,i,n);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&nk(r,parseInt(e.slice(1,4),10)),n9(e,t,r,i,n);default:throw new nm("Unsupported JWE Content Encryption Algorithm")}};async function se(e,t,r,i){let n=e.slice(0,7);i||(i=nS(n));let{ciphertext:s,tag:a}=await n7(n,r,t,i,new Uint8Array(0));return{encryptedKey:s,iv:nl(i),tag:nl(a)}}async function st(e,t,r,i,n){return nL(e.slice(0,7),t,r,i,n,new Uint8Array(0))}async function sr(e,t,r,i,n){switch(n3(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new ny("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new ny("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let n,s;if(!nM(i.epk))throw new ny('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!nV(t))throw new nm("ECDH with the provided key is not allowed or not supported by your javascript runtime");let a=await n2(i.epk,e);if(void 0!==i.apu){if("string"!=typeof i.apu)throw new ny('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{n=nc(i.apu)}catch{throw new ny("Failed to base64url decode the apu")}}if(void 0!==i.apv){if("string"!=typeof i.apv)throw new ny('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{s=nc(i.apv)}catch{throw new ny("Failed to base64url decode the apv")}}let o=await nK(a,t,"ECDH-ES"===e?i.enc:e,"ECDH-ES"===e?n0(i.enc):parseInt(e.slice(-5,-2),10),n,s);if("ECDH-ES"===e)return o;if(void 0===r)throw new ny("JWE Encrypted Key missing");return nH(e.slice(-6),o,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new ny("JWE Encrypted Key missing");return nY(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{let s;if(void 0===r)throw new ny("JWE Encrypted Key missing");if("number"!=typeof i.p2c)throw new ny('JOSE Header "p2c" (PBES2 Count) missing or invalid');let a=n?.maxPBES2Count||1e4;if(i.p2c>a)throw new ny('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof i.p2s)throw new ny('JOSE Header "p2s" (PBES2 Salt) missing or invalid');try{s=nc(i.p2s)}catch{throw new ny("Failed to base64url decode the p2s")}return nJ(e,t,r,i.p2c,s)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new ny("JWE Encrypted Key missing");return nH(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{let n,s;if(void 0===r)throw new ny("JWE Encrypted Key missing");if("string"!=typeof i.iv)throw new ny('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof i.tag)throw new ny('JOSE Header "tag" (Authentication Tag) missing or invalid');try{n=nc(i.iv)}catch{throw new ny("Failed to base64url decode the iv")}try{s=nc(i.tag)}catch{throw new ny("Failed to base64url decode the tag")}return st(e,t,r,n,s)}default:throw new nm('Invalid or unsupported "alg" (JWE Algorithm) header value')}}let si=function(e,t,r,i,n){let s;if(void 0!==n.crit&&void 0===i.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||void 0===i.crit)return new Set;if(!Array.isArray(i.crit)||0===i.crit.length||i.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let a of(s=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,i.crit)){if(!s.has(a))throw new nm(`Extension Header Parameter "${a}" is not recognized`);if(void 0===n[a])throw new e(`Extension Header Parameter "${a}" is missing`);if(s.get(a)&&void 0===i[a])throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(i.crit)},sn=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function ss(e,t,r){let i,n,s,a,o,l,u;if(!nM(e))throw new ny("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new ny("JOSE Header missing");if(void 0!==e.iv&&"string"!=typeof e.iv)throw new ny("JWE Initialization Vector incorrect type");if("string"!=typeof e.ciphertext)throw new ny("JWE Ciphertext missing or incorrect type");if(void 0!==e.tag&&"string"!=typeof e.tag)throw new ny("JWE Authentication Tag incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new ny("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new ny("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new ny("JWE AAD incorrect type");if(void 0!==e.header&&!nM(e.header))throw new ny("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!nM(e.unprotected))throw new ny("JWE Per-Recipient Unprotected Header incorrect type");if(e.protected)try{let t=nc(e.protected);i=JSON.parse(ne.decode(t))}catch{throw new ny("JWE Protected Header is invalid")}if(!nD(i,e.header,e.unprotected))throw new ny("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let c={...i,...e.header,...e.unprotected};if(si(ny,new Map,r?.crit,i,c),void 0!==c.zip)throw new nm('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:d,enc:h}=c;if("string"!=typeof d||!d)throw new ny("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof h||!h)throw new ny("missing JWE Encryption Algorithm (enc) in JWE Header");let p=r&&sn("keyManagementAlgorithms",r.keyManagementAlgorithms),f=r&&sn("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(p&&!p.has(d)||!p&&d.startsWith("PBES2"))throw new nf('"alg" (Algorithm) Header Parameter value not allowed');if(f&&!f.has(h))throw new nf('"enc" (Encryption Algorithm) Header Parameter value not allowed');if(void 0!==e.encrypted_key)try{n=nc(e.encrypted_key)}catch{throw new ny("Failed to base64url decode the encrypted_key")}let m=!1;"function"==typeof t&&(t=await t(i,e),m=!0);try{s=await sr(d,t,n,c,r)}catch(e){if(e instanceof TypeError||e instanceof ny||e instanceof nm)throw e;s=n1(h)}if(void 0!==e.iv)try{a=nc(e.iv)}catch{throw new ny("Failed to base64url decode the iv")}if(void 0!==e.tag)try{o=nc(e.tag)}catch{throw new ny("Failed to base64url decode the tag")}let g=i7.encode(e.protected??"");l=void 0!==e.aad?nt(g,i7.encode("."),i7.encode(e.aad)):g;try{u=nc(e.ciphertext)}catch{throw new ny("Failed to base64url decode the ciphertext")}let y={plaintext:await nL(h,s,u,a,o,l)};if(void 0!==e.protected&&(y.protectedHeader=i),void 0!==e.aad)try{y.additionalAuthenticatedData=nc(e.aad)}catch{throw new ny("Failed to base64url decode the aad")}return(void 0!==e.unprotected&&(y.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(y.unprotectedHeader=e.header),m)?{...y,key:t}:y}async function sa(e,t,r){if(e instanceof Uint8Array&&(e=ne.decode(e)),"string"!=typeof e)throw new ny("Compact JWE must be a string or Uint8Array");let{0:i,1:n,2:s,3:a,4:o,length:l}=e.split(".");if(5!==l)throw new ny("Invalid Compact JWE");let u=await ss({ciphertext:a,iv:s||void 0,protected:i,tag:o||void 0,encrypted_key:n||void 0},t,r),c={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...c,key:u.key}:c}let so=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:nl(e)};if(!i8(e))throw TypeError(nP(e,...nR,"Uint8Array"));if(!e.extractable)throw TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:i,use:n,...s}=await i3.subtle.exportKey("jwk",e);return s};async function sl(e){return so(e)}async function su(e,t,r,i,n={}){let s,a,o;switch(n3(e,r,"encrypt"),e){case"dir":o=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!nV(r))throw new nm("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:l,apv:u}=n,{epk:c}=n;c||(c=(await nF(r)).privateKey);let{x:d,y:h,crv:p,kty:f}=await sl(c),m=await nK(r,c,"ECDH-ES"===e?t:e,"ECDH-ES"===e?n0(t):parseInt(e.slice(-5,-2),10),l,u);if(a={epk:{x:d,crv:p,kty:f}},"EC"===f&&(a.epk.y=h),l&&(a.apu=nl(l)),u&&(a.apv=nl(u)),"ECDH-ES"===e){o=m;break}o=i||n1(t);let g=e.slice(-6);s=await nB(g,m,o);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":o=i||n1(t),s=await nX(e,r,o);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{o=i||n1(t);let{p2c:l,p2s:u}=n;({encryptedKey:s,...a}=await nz(e,r,o,l,u));break}case"A128KW":case"A192KW":case"A256KW":o=i||n1(t),s=await nB(e,r,o);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{o=i||n1(t);let{iv:l}=n;({encryptedKey:s,...a}=await se(e,r,o,l));break}default:throw new nm('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:o,encryptedKey:s,parameters:a}}let sc=Symbol();class sd{constructor(e){if(!(e instanceof Uint8Array))throw TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){let r,i,n,s,a;if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new ny("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!nD(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new ny("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let o={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(si(ny,new Map,t?.crit,this._protectedHeader,o),void 0!==o.zip)throw new nm('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:l,enc:u}=o;if("string"!=typeof l||!l)throw new ny('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof u||!u)throw new ny('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if("dir"===l){if(this._cek)throw TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===l&&this._cek)throw TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let n;({cek:i,encryptedKey:r,parameters:n}=await su(l,u,e,this._cek,this._keyManagementParameters)),n&&(t&&sc in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}this._iv||(this._iv=nS(u)),s=this._protectedHeader?i7.encode(nl(JSON.stringify(this._protectedHeader))):i7.encode(""),this._aad?(a=nl(this._aad),n=nt(s,i7.encode("."),i7.encode(a))):n=s;let{ciphertext:c,tag:d}=await n7(u,this._plaintext,i,this._iv,n),h={ciphertext:nl(c),iv:nl(this._iv),tag:nl(d)};return r&&(h.encrypted_key=nl(r)),a&&(h.aad=a),this._protectedHeader&&(h.protected=ne.decode(s)),this._sharedUnprotectedHeader&&(h.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(h.header=this._unprotectedHeader),h}}let sh=e=>Math.floor(e.getTime()/1e3),sp=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,sf=e=>{let t;let r=sp.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let i=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(i);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*i);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*i);break;case"day":case"days":case"d":t=Math.round(86400*i);break;case"week":case"weeks":case"w":t=Math.round(604800*i);break;default:t=Math.round(31557600*i)}return"-"===r[1]||"ago"===r[4]?-t:t},sm=e=>e.toLowerCase().replace(/^application\//,""),sg=(e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e))),sy=(e,t,r={})=>{let i,n;let{typ:s}=r;if(s&&("string"!=typeof e.typ||sm(e.typ)!==sm(s)))throw new nh('unexpected "typ" JWT header value',"typ","check_failed");try{i=JSON.parse(ne.decode(t))}catch{}if(!nM(i))throw new nv("JWT Claims Set must be a top-level JSON object");let{requiredClaims:a=[],issuer:o,subject:l,audience:u,maxTokenAge:c}=r,d=[...a];for(let e of(void 0!==c&&d.push("iat"),void 0!==u&&d.push("aud"),void 0!==l&&d.push("sub"),void 0!==o&&d.push("iss"),new Set(d.reverse())))if(!(e in i))throw new nh(`missing required "${e}" claim`,e,"missing");if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss))throw new nh('unexpected "iss" claim value',"iss","check_failed");if(l&&i.sub!==l)throw new nh('unexpected "sub" claim value',"sub","check_failed");if(u&&!sg(i.aud,"string"==typeof u?[u]:u))throw new nh('unexpected "aud" claim value',"aud","check_failed");switch(typeof r.clockTolerance){case"string":n=sf(r.clockTolerance);break;case"number":n=r.clockTolerance;break;case"undefined":n=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:h}=r,p=sh(h||new Date);if((void 0!==i.iat||c)&&"number"!=typeof i.iat)throw new nh('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new nh('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>p+n)throw new nh('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new nh('"exp" claim must be a number',"exp","invalid");if(i.exp<=p-n)throw new np('"exp" claim timestamp check failed',"exp","check_failed")}if(c){let e=p-i.iat;if(e-n>("number"==typeof c?c:sf(c)))throw new np('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-n)throw new nh('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function sv(e,t,r){let i=await sa(e,t,r),n=sy(i.protectedHeader,i.plaintext,r),{protectedHeader:s}=i;if(void 0!==s.iss&&s.iss!==n.iss)throw new nh('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==s.sub&&s.sub!==n.sub)throw new nh('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==s.aud&&JSON.stringify(s.aud)!==JSON.stringify(n.aud))throw new nh('replicated "aud" claim header parameter mismatch',"aud","mismatch");let a={payload:n,protectedHeader:s};return"function"==typeof t?{...a,key:i.key}:a}class sb{constructor(e){this._flattened=new sd(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}function sw(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}class s_{constructor(e={}){if(!nM(e))throw TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return"number"==typeof e?this._payload={...this._payload,nbf:sw("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:sw("setNotBefore",sh(e))}:this._payload={...this._payload,nbf:sh(new Date)+sf(e)},this}setExpirationTime(e){return"number"==typeof e?this._payload={...this._payload,exp:sw("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:sw("setExpirationTime",sh(e))}:this._payload={...this._payload,exp:sh(new Date)+sf(e)},this}setIssuedAt(e){return void 0===e?this._payload={...this._payload,iat:sh(new Date)}:e instanceof Date?this._payload={...this._payload,iat:sw("setIssuedAt",sh(e))}:"string"==typeof e?this._payload={...this._payload,iat:sw("setIssuedAt",sh(new Date)+sf(e))}:this._payload={...this._payload,iat:sw("setIssuedAt",e)},this}}class sS extends s_{setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){let r=new sb(i7.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(e,t)}}let sx=(e,t)=>{if("string"!=typeof e||!e)throw new nb(`${t} missing or invalid`)};async function sk(e,t){let r;if(!nM(e))throw TypeError("JWK must be an object");if(t??(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');switch(e.kty){case"EC":sx(e.crv,'"crv" (Curve) Parameter'),sx(e.x,'"x" (X Coordinate) Parameter'),sx(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":sx(e.crv,'"crv" (Subtype of Key Pair) Parameter'),sx(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":sx(e.e,'"e" (Exponent) Parameter'),sx(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":sx(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new nm('"kty" (Key Type) Parameter missing or unsupported')}let i=i7.encode(JSON.stringify(r));return nl(await i9(t,i))}"undefined"!=typeof navigator&&navigator.userAgent?.startsWith?.("Mozilla/5.0 ");var sE=r(6076);let sA=()=>Date.now()/1e3|0,sT="A256CBC-HS512";async function sC(e){let{token:t={},secret:r,maxAge:i=2592e3,salt:n}=e,s=Array.isArray(r)?r:[r],a=await sP(sT,s[0],n),o=await sk({kty:"oct",k:nl(a)},`sha${a.byteLength<<3}`);return await new sS(t).setProtectedHeader({alg:"dir",enc:sT,kid:o}).setIssuedAt().setExpirationTime(sA()+i).setJti(crypto.randomUUID()).encrypt(a)}async function sO(e){let{token:t,secret:r,salt:i}=e,n=Array.isArray(r)?r:[r];if(!t)return null;let{payload:s}=await sv(t,async({kid:e,enc:t})=>{for(let r of n){let n=await sP(t,r,i);if(void 0===e||e===await sk({kty:"oct",k:nl(n)},`sha${n.byteLength<<3}`))return n}throw Error("no matching decryption secret")},{clockTolerance:15,keyManagementAlgorithms:["dir"],contentEncryptionAlgorithms:[sT,"A256GCM"]});return s}async function sP(e,t,r){let i;switch(e){case"A256CBC-HS512":i=64;break;case"A256GCM":i=32;break;default:throw Error("Unsupported JWT Content Encryption Algorithm")}return await i5("sha256",t,r,`Auth.js Generated Encryption Key (${r})`,i)}async function s$({options:e,paramValue:t,cookieValue:r}){let{url:i,callbacks:n}=e,s=i.origin;return t?s=await n.redirect({url:t,baseUrl:i.origin}):r&&(s=await n.redirect({url:r,baseUrl:i.origin})),{callbackUrl:s,callbackUrlCookie:s!==r?s:void 0}}let sN=["providers","session","csrf","signin","signout","callback","verify-request","error","webauthn-options"];async function sR(e){if(!("body"in e)||!e.body||"POST"!==e.method)return;let t=e.headers.get("content-type");return t?.includes("application/json")?await e.json():t?.includes("application/x-www-form-urlencoded")?Object.fromEntries(new URLSearchParams(await e.text())):void 0}async function sI(e,t){try{if("GET"!==e.method&&"POST"!==e.method)throw new iD("Only GET and POST requests are supported.");t.basePath??(t.basePath="/auth");let r=new URL(e.url),{action:i,providerId:n}=function(e,t){let r=e.match(RegExp(`^${t}(.+)`));if(null===r)throw new iD(`Cannot parse action at ${e}`);let[i,n]=r,s=n.replace(/^\//,"").split("/");if(1!==s.length&&2!==s.length)throw new iD(`Cannot parse action at ${e}`);let[a,o]=s;if(!sN.includes(a)||o&&!["signin","callback","webauthn-options"].includes(a))throw new iD(`Cannot parse action at ${e}`);return{action:a,providerId:o}}(r.pathname,t.basePath);return{url:r,action:i,providerId:n,method:e.method,headers:Object.fromEntries(e.headers),body:e.body?await sR(e):void 0,cookies:(0,sE.Q)(e.headers.get("cookie")??"")??{},error:r.searchParams.get("error")??void 0,query:Object.fromEntries(r.searchParams)}}catch(e){return e}}function sj(e){let t=new Headers(e.headers);e.cookies?.forEach(e=>{let{name:r,value:i,options:n}=e,s=sE.q(r,i,n);t.has("Set-Cookie")?t.append("Set-Cookie",s):t.set("Set-Cookie",s)});let r=e.body;"application/json"===t.get("content-type")?r=JSON.stringify(e.body):"application/x-www-form-urlencoded"===t.get("content-type")&&(r=new URLSearchParams(e.body).toString());let i=e.redirect?302:e.status??200,n=new Response(r,{headers:t,status:i});return e.redirect&&n.headers.set("Location",e.redirect),n}async function sL(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,"0")).join("").toString()}function sD(e){let t=e=>("0"+e.toString(16)).slice(-2);return Array.from(crypto.getRandomValues(new Uint8Array(e))).reduce((e,r)=>e+t(r),"")}async function sM({options:e,cookieValue:t,isPost:r,bodyValue:i}){if(t){let[n,s]=t.split("|");if(s===await sL(`${n}${e.secret}`))return{csrfTokenVerified:r&&n===i,csrfToken:n}}let n=sD(32),s=await sL(`${n}${e.secret}`);return{cookie:`${n}|${s}`,csrfToken:n}}function sU(e,t){if(!t)throw new iB(`CSRF token was missing during an action ${e}.`)}function sq(e){return e&&"object"==typeof e&&!Array.isArray(e)}function sQ(e,...t){if(!t.length)return e;let r=t.shift();if(sq(e)&&sq(r))for(let t in r)sq(r[t])?(e[t]||Object.assign(e,{[t]:{}}),sQ(e[t],r[t])):Object.assign(e,{[t]:r[t]});return sQ(e,...t)}let sB=e=>sK({id:e.sub??e.id??crypto.randomUUID(),name:e.name??e.nickname??e.preferred_username,email:e.email,image:e.picture}),sH=e=>sK({access_token:e.access_token,id_token:e.id_token,refresh_token:e.refresh_token,expires_at:e.expires_at,scope:e.scope,token_type:e.token_type,session_state:e.session_state});function sK(e){let t={};for(let[r,i]of Object.entries(e))void 0!==i&&(t[r]=i);return t}function sF(e,t){if(!e&&t)return;if("string"==typeof e)return{url:new URL(e)};let r=new URL(e?.url??"https://authjs.dev");if(e?.params!=null)for(let[t,i]of Object.entries(e.params))"claims"===t&&(i=JSON.stringify(i)),r.searchParams.set(t,String(i));return{url:r,request:e?.request,conform:e?.conform}}let sV="\x1b[31m",sW="\x1b[0m",sz={error(e){let t=e instanceof ip?e.type:e.name;if(console.error(`${sV}[auth][error]${sW} ${t}: ${e.message}`),e.cause&&"object"==typeof e.cause&&"err"in e.cause&&e.cause.err instanceof Error){let{err:t,...r}=e.cause;console.error(`${sV}[auth][cause]${sW}:`,t.stack),r&&console.error(`${sV}[auth][details]${sW}:`,JSON.stringify(r,null,2))}else e.stack&&console.error(e.stack.replace(/.*/,"").substring(1))},warn(e){let t=`https://warnings.authjs.dev#${e}`;console.warn(`[33m[auth][warn][${e}]${sW}`,`Read more: ${t}`)},debug(e,t){console.log(`[90m[auth][debug]:${sW} ${e}`,JSON.stringify(t,null,2))}},sJ={signIn:()=>!0,redirect:({url:e,baseUrl:t})=>e.startsWith("/")?`${t}${e}`:new URL(e).origin===t?e:t,session:({session:e})=>({user:{name:e.user?.name,email:e.user?.email,image:e.user?.image},expires:e.expires?.toISOString?.()??e.expires}),jwt:({token:e})=>e};async function sZ({authOptions:e,providerId:t,action:r,url:i,cookies:n,callbackUrl:s,csrfToken:a,csrfDisabled:o,isPost:l}){var u;let{providers:c,provider:d}=function(e){let{providerId:t,options:r}=e,i=new URL(r.basePath??"/auth",e.url.origin),n=e.providers.map(e=>{let t="function"==typeof e?e():e,{options:n,...s}=t,a=n?.id??s.id,o=sQ(s,n,{signinUrl:`${i}/signin/${a}`,callbackUrl:`${i}/callback/${a}`});return"oauth"===t.type||"oidc"===t.type?(o.redirectProxyUrl??(o.redirectProxyUrl=r.redirectProxyUrl),function(e){e.issuer&&(e.wellKnown??(e.wellKnown=`${e.issuer}/.well-known/openid-configuration`));let t=sF(e.authorization,e.issuer);t&&!t.url?.searchParams.has("scope")&&t.url.searchParams.set("scope","openid profile email");let r=sF(e.token,e.issuer),i=sF(e.userinfo,e.issuer),n=e.checks??["pkce"];return e.redirectProxyUrl&&(n.includes("state")||n.push("state"),e.redirectProxyUrl=`${e.redirectProxyUrl}/callback/${e.id}`),{...e,authorization:t,token:r,checks:n,userinfo:i,profile:e.profile??sB,account:e.account??sH}}(o)):o});return{providers:n,provider:n.find(({id:e})=>e===t)}}({providers:e.providers,url:i,providerId:t,options:e}),h=!1;if((d?.type==="oauth"||d?.type==="oidc")&&d.redirectProxyUrl)try{h=new URL(d.redirectProxyUrl).origin===i.origin}catch{throw TypeError(`redirectProxyUrl must be a valid URL. Received: ${d.redirectProxyUrl}`)}let p={debug:!1,pages:{},theme:{colorScheme:"auto",logo:"",brandColor:"",buttonText:""},...e,url:i,action:r,provider:d,cookies:sQ(id(e.useSecureCookies??"https:"===i.protocol),e.cookies),providers:c,session:{strategy:e.adapter?"database":"jwt",maxAge:2592e3,updateAge:86400,generateSessionToken:()=>crypto.randomUUID(),...e.session},jwt:{secret:e.secret,maxAge:e.session?.maxAge??2592e3,encode:sC,decode:sO,...e.jwt},events:Object.keys(u=e.events??{}).reduce((e,t)=>(e[t]=async(...e)=>{try{let r=u[t];return await r(...e)}catch(e){sz.error(new iw(e))}},e),{}),adapter:function(e,t){if(e)return Object.keys(e).reduce((r,i)=>(r[i]=async(...r)=>{try{t.debug(`adapter_${i}`,{args:r});let n=e[i];return await n(...r)}catch(r){let e=new ig(r);throw t.error(e),e}},r),{})}(e.adapter,sz),callbacks:{...sJ,...e.callbacks},logger:sz,callbackUrl:i.origin,isOnRedirectProxy:h,experimental:{...e.experimental}},f=[];if(o)p.csrfTokenVerified=!0;else{let{csrfToken:e,cookie:t,csrfTokenVerified:r}=await sM({options:p,cookieValue:n?.[p.cookies.csrfToken.name],isPost:l,bodyValue:a});p.csrfToken=e,p.csrfTokenVerified=r,t&&f.push({name:p.cookies.csrfToken.name,value:t,options:p.cookies.csrfToken.options})}let{callbackUrl:m,callbackUrlCookie:g}=await s$({options:p,cookieValue:n?.[p.cookies.callbackUrl.name],paramValue:s});return p.callbackUrl=m,g&&f.push({name:p.cookies.callbackUrl.name,value:g,options:p.cookies.callbackUrl.options}),{options:p,cookies:f}}var sG,sX,sY,s0,s1,s6,s2,s4,s5,s3,s8,s9,s7,ae,at,ar={},ai=[],an=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function as(e,t){for(var r in t)e[r]=t[r];return e}function aa(e){var t=e.parentNode;t&&t.removeChild(e)}function ao(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==n?++s7:n};return null==n&&null!=s9.vnode&&s9.vnode(s),s}function al(e){return e.children}function au(e,t){this.props=e,this.context=t}function ac(e,t){if(null==t)return e.__?ac(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t0?ao(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=r,p.__b=r.__b+1,null===(h=y[c])||h&&p.key==h.key&&p.type===h.type)y[c]=void 0;else for(d=0;d2&&(a.children=arguments.length>3?s8.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return ao(e,a,i,n,null)}(al,null,[r]),n||ar,ar,void 0!==t.ownerSVGElement,!i&&ax?[ax]:n?null:t.firstChild?s8.call(t.childNodes):null,s,!i&&ax?ax:n?n.__e:t.firstChild,i),aw(s,r)}s8=ai.slice,s9={__e:function(e,t,r,i){for(var n,s,a;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),a=n.__d),a)return n.__E=n}catch(t){e=t}throw e}},s7=0,au.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=as({},this.state),"function"==typeof e&&(e=e(as({},r),this.props)),e&&as(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),ad(this))},au.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ad(this))},au.prototype.render=al,ae=[],ah.__r=0;var ak=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,aE=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,aA=/[\s\n\\/='"\0<>]/,aT=/^xlink:?./,aC=/["&<]/;function aO(e){if(!1===aC.test(e+=""))return e;for(var t=0,r=0,i="",n="";r(t||40)||!r&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},aN={},aR=/([A-Z])/g;function aI(e){var t="";for(var r in e){var i=e[r];null!=i&&""!==i&&(t&&(t+=" "),t+="-"==r[0]?r:aN[r]||(aN[r]=r.replace(aR,"-$1").toLowerCase()),t="number"==typeof i&&!1===ak.test(r)?t+": "+i+"px;":t+": "+i+";")}return t||void 0}function aj(e,t){return Array.isArray(t)?t.reduce(aj,e):null!=t&&!1!==t&&e.push(t),e}function aL(){this.__d=!0}function aD(e,t){return{__v:e,context:t,props:e.props,setState:aL,forceUpdate:aL,__d:!0,__h:[]}}function aM(e,t){var r=e.contextType,i=r&&t[r.__c];return null!=r?i?i.props.value:r.__:t}var aU=[],aq={shallow:!0};aB.render=aB;var aQ=[];function aB(e,t,r){t=t||{};var i,n=s9.__s;return s9.__s=!0,i=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?function e(t,r,i,n,s,a){if(null==t||"boolean"==typeof t)return"";if("object"!=typeof t)return aO(t);var o=i.pretty,l=o&&"string"==typeof o?o:" ";if(Array.isArray(t)){for(var u="",c=0;c0&&(u+="\n"),u+=e(t[c],r,i,n,s,a);return u}var d,h=t.type,p=t.props,f=!1;if("function"==typeof h){if(f=!0,!i.shallow||!n&&!1!==i.renderRootComponent){if(h===al){var m=[];return aj(m,t.props.children),e(m,r,i,!1!==i.shallowHighOrder,s,a)}var g,y=t.__c=aD(t,r);s9.__b&&s9.__b(t);var v=s9.__r;if(h.prototype&&"function"==typeof h.prototype.render){var b=aM(h,r);(y=t.__c=new h(p,b)).__v=t,y._dirty=y.__d=!0,y.props=p,null==y.state&&(y.state={}),null==y._nextState&&null==y.__s&&(y._nextState=y.__s=y.state),y.context=b,h.getDerivedStateFromProps?y.state=Object.assign({},y.state,h.getDerivedStateFromProps(y.props,y.state)):y.componentWillMount&&(y.componentWillMount(),y.state=y._nextState!==y.state?y._nextState:y.__s!==y.state?y.__s:y.state),v&&v(t),g=y.render(y.props,y.state,y.context)}else for(var w=aM(h,r),_=0;y.__d&&_++<25;)y.__d=!1,v&&v(t),g=h.call(t.__c,p,w);return y.getChildContext&&(r=Object.assign({},r,y.getChildContext())),s9.diffed&&s9.diffed(t),e(g,r,i,!1!==i.shallowHighOrder,s,a)}h=(d=h).displayName||d!==Function&&d.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var r=-1,i=aU.length;i--;)if(aU[i]===e){r=i;break}r<0&&(r=aU.push(e)-1),t="UnnamedComponent"+r}return t}(d)}var S,x,k="<"+h;if(p){var E=Object.keys(p);i&&!0===i.sortAttributes&&E.sort();for(var A=0;A",aA.test(h))throw Error(h+" is not a valid HTML tag name in "+k);var $,N=aE.test(h)||i.voidElements&&i.voidElements.test(h),R=[];if(x)o&&a$(x)&&(x="\n"+l+aP(x,l)),k+=x;else if(null!=S&&aj($=[],S).length){for(var I=o&&~k.indexOf("\n"),j=!1,L=0;L<$.length;L++){var D=$[L];if(null!=D&&!1!==D){var M=e(D,r,i,!0,"svg"===h||"foreignObject"!==h&&s,a);if(o&&!I&&a$(M)&&(I=!0),M){if(o){var U=M.length>0&&"<"!=M[0];j&&U?R[R.length-1]+=M:R.push(M),j=U}else R.push(M)}}}if(o&&I)for(var q=R.length;q--;)R[q]="\n"+l+aP(R[q],l)}if(R.length||x)k+=R.join("");else if(i&&i.xml)return k.substring(0,k.length-1)+" />";return!N||$||x?(o&&~k.indexOf("\n")&&(k+="\n"),k=k+""+h+">"):k=k.replace(/>$/," />"),k}(e,t,r):function e(t,r,i,n){if(null==t||!0===t||!1===t||""===t)return"";if("object"!=typeof t)return aO(t);if(aH(t)){for(var s="",a=0;a",aA.test(o))throw Error(o+" is not a valid HTML tag name in "+b);var A="",T=!1;if(v)A+=v,T=!0;else if("string"==typeof y)A+=aO(y),T=!0;else if(aH(y))for(var C=0;C";return b+""+o+">"}(e,t,!1,void 0),s9.__c&&s9.__c(e,aQ),s9.__s=n,aQ.length=0,i}var aH=Array.isArray,aK=Object.assign;aB.shallowRender=function(e,t){return aB(e,t,aq)};var aF=0;function aV(e,t,r,i,n){var s,a,o={};for(a in t)"ref"==a?s=t[a]:o[a]=t[a];var l={type:e,props:o,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--aF,__source:n,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===o[a]&&(o[a]=s[a]);return s9.vnode&&s9.vnode(l),l}async function aW(e,t){let r=window.SimpleWebAuthnBrowser;async function i(r){let i=new URL(`${e}/webauthn-options/${t}`);r&&i.searchParams.append("action",r),s().forEach(e=>{i.searchParams.append(e.name,e.value)});let n=await fetch(i);if(!n.ok){console.error("Failed to fetch options",n);return}return n.json()}function n(){let e=`#${t}-form`,r=document.querySelector(e);if(!r)throw Error(`Form '${e}' not found`);return r}function s(){return Array.from(n().querySelectorAll("input[data-form-field]"))}async function a(e,t){let r=n();if(e){let t=document.createElement("input");t.type="hidden",t.name="action",t.value=e,r.appendChild(t)}if(t){let e=document.createElement("input");e.type="hidden",e.name="data",e.value=JSON.stringify(t),r.appendChild(e)}return r.submit()}async function o(e,t){let i=await r.startAuthentication(e,t);return await a("authenticate",i)}async function l(e){s().forEach(e=>{if(e.required&&!e.value)throw Error(`Missing required field: ${e.name}`)});let t=await r.startRegistration(e);return await a("register",t)}async function u(){if(!r.browserSupportsWebAuthnAutofill())return;let e=await i("authenticate");if(!e){console.error("Failed to fetch option for autofill authentication");return}try{await o(e.options,!0)}catch(e){console.error(e)}}(async function(){let e=n();if(!r.browserSupportsWebAuthn()){e.style.display="none";return}e&&e.addEventListener("submit",async e=>{e.preventDefault();let t=await i(void 0);if(!t){console.error("Failed to fetch options for form submission");return}if("authenticate"===t.action)try{await o(t.options,!1)}catch(e){console.error(e)}else if("register"===t.action)try{await l(t.options)}catch(e){console.error(e)}})})(),u()}let az={default:"Unable to sign in.",Signin:"Try signing in with a different account.",OAuthSignin:"Try signing in with a different account.",OAuthCallbackError:"Try signing in with a different account.",OAuthCreateAccount:"Try signing in with a different account.",EmailCreateAccount:"Try signing in with a different account.",Callback:"Try signing in with a different account.",OAuthAccountNotLinked:"To confirm your identity, sign in with the same account you used originally.",EmailSignin:"The e-mail could not be sent.",CredentialsSignin:"Sign in failed. Check the details you provided are correct.",SessionRequired:"Please sign in to access this page."};function aJ(e,t=1){if(!e)return;3===(e=e.replace(/^#/,"")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let r=parseInt(e,16);return t=Math.min(Math.max(t,0),1),`rgba(${r>>16&255}, ${r>>8&255}, ${255&r}, ${t})`}let aZ=`:root {
+ --border-width: 1px;
+ --border-radius: 0.5rem;
+ --color-error: #c94b4b;
+ --color-info: #157efb;
+ --color-info-hover: #0f6ddb;
+ --color-info-text: #fff;
+}
+
+.__next-auth-theme-auto,
+.__next-auth-theme-light {
+ --color-background: #ececec;
+ --color-background-hover: rgba(236, 236, 236, 0.8);
+ --color-background-card: #fff;
+ --color-text: #000;
+ --color-primary: #444;
+ --color-control-border: #bbb;
+ --color-button-active-background: #f9f9f9;
+ --color-button-active-border: #aaa;
+ --color-separator: #ccc;
+}
+
+.__next-auth-theme-dark {
+ --color-background: #161b22;
+ --color-background-hover: rgba(22, 27, 34, 0.8);
+ --color-background-card: #0d1117;
+ --color-text: #fff;
+ --color-primary: #ccc;
+ --color-control-border: #555;
+ --color-button-active-background: #060606;
+ --color-button-active-border: #666;
+ --color-separator: #444;
+}
+
+@media (prefers-color-scheme: dark) {
+ .__next-auth-theme-auto {
+ --color-background: #161b22;
+ --color-background-hover: rgba(22, 27, 34, 0.8);
+ --color-background-card: #0d1117;
+ --color-text: #fff;
+ --color-primary: #ccc;
+ --color-control-border: #555;
+ --color-button-active-background: #060606;
+ --color-button-active-border: #666;
+ --color-separator: #444;
+ }
+
+ button,
+ a.button {
+ color: var(--provider-dark-color, var(--color-primary));
+ background-color: var(--provider-dark-bg, var(--color-background));
+ }
+ :is(button,a.button):hover {
+ background-color: var(
+ --provider-dark-bg-hover,
+ var(--color-background-hover)
+ ) !important;
+ }
+ #provider-logo {
+ display: none !important;
+ }
+ #provider-logo-dark {
+ width: 25px;
+ display: block !important;
+ }
+}
+html {
+ box-sizing: border-box;
+}
+*,
+*:before,
+*:after {
+ box-sizing: inherit;
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ background-color: var(--color-background);
+ margin: 0;
+ padding: 0;
+ font-family:
+ ui-sans-serif,
+ system-ui,
+ -apple-system,
+ BlinkMacSystemFont,
+ "Segoe UI",
+ Roboto,
+ "Helvetica Neue",
+ Arial,
+ "Noto Sans",
+ sans-serif,
+ "Apple Color Emoji",
+ "Segoe UI Emoji",
+ "Segoe UI Symbol",
+ "Noto Color Emoji";
+}
+
+h1 {
+ margin-bottom: 1.5rem;
+ padding: 0 1rem;
+ font-weight: 400;
+ color: var(--color-text);
+}
+
+p {
+ margin-bottom: 1.5rem;
+ padding: 0 1rem;
+ color: var(--color-text);
+}
+
+form {
+ margin: 0;
+ padding: 0;
+}
+
+label {
+ font-weight: 500;
+ text-align: left;
+ margin-bottom: 0.25rem;
+ display: block;
+ color: var(--color-text);
+}
+
+input[type] {
+ box-sizing: border-box;
+ display: block;
+ width: 100%;
+ padding: 0.5rem 1rem;
+ border: var(--border-width) solid var(--color-control-border);
+ background: var(--color-background-card);
+ font-size: 1rem;
+ border-radius: var(--border-radius);
+ color: var(--color-text);
+}
+
+input[type]:focus {
+ box-shadow: none;
+ }
+
+p {
+ font-size: 1.1rem;
+ line-height: 2rem;
+}
+
+a.button {
+ text-decoration: none;
+ line-height: 1rem;
+}
+
+a.button:link,
+ a.button:visited {
+ background-color: var(--color-background);
+ color: var(--color-primary);
+ }
+
+button span {
+ flex-grow: 1;
+}
+
+button,
+a.button {
+ padding: 0.75rem 1rem;
+ color: var(--provider-color, var(--color-primary));
+ background-color: var(--provider-bg);
+ font-size: 1.1rem;
+ min-height: 62px;
+ border-color: rgba(0, 0, 0, 0.1);
+ border-radius: var(--border-radius);
+ transition: all 0.1s ease-in-out;
+ font-weight: 500;
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+:is(button,a.button):hover {
+ background-color: var(--provider-bg-hover, var(--color-background-hover));
+ cursor: pointer;
+ }
+
+:is(button,a.button):active {
+ cursor: pointer;
+ }
+
+:is(button,a.button) #provider-logo {
+ width: 25px;
+ display: block;
+ }
+
+:is(button,a.button) #provider-logo-dark {
+ display: none;
+ }
+
+#submitButton {
+ color: var(--button-text-color, var(--color-info-text));
+ background-color: var(--brand-color, var(--color-info));
+ width: 100%;
+}
+
+#submitButton:hover {
+ background-color: var(
+ --button-hover-bg,
+ var(--color-info-hover)
+ ) !important;
+ }
+
+a.site {
+ color: var(--color-primary);
+ text-decoration: none;
+ font-size: 1rem;
+ line-height: 2rem;
+}
+
+a.site:hover {
+ text-decoration: underline;
+ }
+
+.page {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ display: grid;
+ place-items: center;
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+.page > div {
+ text-align: center;
+ }
+
+.error a.button {
+ padding-left: 2rem;
+ padding-right: 2rem;
+ margin-top: 0.5rem;
+ }
+
+.error .message {
+ margin-bottom: 1.5rem;
+ }
+
+.signin input[type="text"] {
+ margin-left: auto;
+ margin-right: auto;
+ display: block;
+ }
+
+.signin hr {
+ display: block;
+ border: 0;
+ border-top: 1px solid var(--color-separator);
+ margin: 2rem auto 1rem auto;
+ overflow: visible;
+ }
+
+.signin hr::before {
+ content: "or";
+ background: var(--color-background-card);
+ color: #888;
+ padding: 0 0.4rem;
+ position: relative;
+ top: -0.7rem;
+ }
+
+.signin .error {
+ background: #f5f5f5;
+ font-weight: 500;
+ border-radius: 0.3rem;
+ background: var(--color-error);
+ }
+
+.signin .error p {
+ text-align: left;
+ padding: 0.5rem 1rem;
+ font-size: 0.9rem;
+ line-height: 1.2rem;
+ color: var(--color-info-text);
+ }
+
+.signin > div,
+ .signin form {
+ display: block;
+ }
+
+.signin > div input[type], .signin form input[type] {
+ margin-bottom: 0.5rem;
+ }
+
+.signin > div button, .signin form button {
+ width: 100%;
+ }
+
+.signin .provider + .provider {
+ margin-top: 1rem;
+ }
+
+.logo {
+ display: inline-block;
+ max-width: 150px;
+ margin: 1.25rem 0;
+ max-height: 70px;
+}
+
+.card {
+ background-color: var(--color-background-card);
+ border-radius: 2rem;
+ padding: 1.25rem 2rem;
+}
+
+.card .header {
+ color: var(--color-primary);
+ }
+
+.section-header {
+ color: var(--color-text);
+}
+
+@media screen and (min-width: 450px) {
+ .card {
+ margin: 2rem 0;
+ width: 368px;
+ }
+}
+@media screen and (max-width: 450px) {
+ .card {
+ margin: 1rem 0;
+ width: 343px;
+ }
+}
+`;function aG({html:e,title:t,status:r,cookies:i,theme:n,headTags:s}){return{cookies:i,status:r,headers:{"Content-Type":"text/html"},body:`${t}${s??""}
${aB(e)}
`}}function aX(e){let{url:t,theme:r,query:i,cookies:n,pages:s,providers:a}=e;return{csrf:(e,t,r)=>e?(t.logger.warn("csrf-disabled"),r.push({name:t.cookies.csrfToken.name,value:"",options:{...t.cookies.csrfToken.options,maxAge:0}}),{status:404,cookies:r}):{headers:{"Content-Type":"application/json"},body:{csrfToken:t.csrfToken},cookies:r},providers:e=>({headers:{"Content-Type":"application/json"},body:e.reduce((e,{id:t,name:r,type:i,signinUrl:n,callbackUrl:s})=>(e[t]={id:t,name:r,type:i,signinUrl:n,callbackUrl:s},e),{})}),signin(t,o){if(t)throw new iD("Unsupported action");if(s?.signIn){let t=`${s.signIn}${s.signIn.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:e.callbackUrl??"/"})}`;return o&&(t=`${t}&${new URLSearchParams({error:o})}`),{redirect:t,cookies:n}}let l=a?.find(e=>"webauthn"===e.type&&e.enableConditionalUI&&!!e.simpleWebAuthnBrowserVersion),u="";if(l){let{simpleWebAuthnBrowserVersion:e}=l;u=``}return aG({cookies:n,theme:r,html:function(e){let{csrfToken:t,providers:r=[],callbackUrl:i,theme:n,email:s,error:a}=e;"undefined"!=typeof document&&n?.brandColor&&document.documentElement.style.setProperty("--brand-color",n.brandColor),"undefined"!=typeof document&&n?.buttonText&&document.documentElement.style.setProperty("--button-text-color",n.buttonText);let o=a&&(az[a]??az.default),l="https://authjs.dev/img/providers",u=r.find(e=>"webauthn"===e.type&&e.enableConditionalUI)?.id;return aV("div",{className:"signin",children:[n?.brandColor&&aV("style",{dangerouslySetInnerHTML:{__html:`:root {--brand-color: ${n.brandColor}}`}}),n?.buttonText&&aV("style",{dangerouslySetInnerHTML:{__html:`
+ :root {
+ --button-text-color: ${n.buttonText}
+ }
+ `}}),aV("div",{className:"card",children:[o&&aV("div",{className:"error",children:aV("p",{children:o})}),n?.logo&&aV("img",{src:n.logo,alt:"Logo",className:"logo"}),r.map((e,n)=>{let a,o,u,c,d,h;return("oauth"===e.type||"oidc"===e.type)&&({bg:a="",text:o="",logo:u="",bgDark:d=a,textDark:h=o,logoDark:c=""}=e.style??{},u=u.startsWith("/")?l+u:u,(c=c.startsWith("/")?l+c:c||u)||(c=u)),aV("div",{className:"provider",children:["oauth"===e.type||"oidc"===e.type?aV("form",{action:e.signinUrl,method:"POST",children:[aV("input",{type:"hidden",name:"csrfToken",value:t}),i&&aV("input",{type:"hidden",name:"callbackUrl",value:i}),aV("button",{type:"submit",className:"button",style:{"--provider-bg":a,"--provider-dark-bg":d,"--provider-color":o,"--provider-dark-color":h,"--provider-bg-hover":aJ(a,.8),"--provider-dark-bg-hover":aJ(d,.8)},tabIndex:0,children:[u&&aV("img",{loading:"lazy",height:24,width:24,id:"provider-logo",src:u}),c&&aV("img",{loading:"lazy",height:24,width:24,id:"provider-logo-dark",src:c}),aV("span",{children:["Sign in with ",e.name]})]})]}):null,("email"===e.type||"credentials"===e.type||"webauthn"===e.type)&&n>0&&"email"!==r[n-1].type&&"credentials"!==r[n-1].type&&"webauthn"!==r[n-1].type&&aV("hr",{}),"email"===e.type&&aV("form",{action:e.signinUrl,method:"POST",children:[aV("input",{type:"hidden",name:"csrfToken",value:t}),aV("label",{className:"section-header",htmlFor:`input-email-for-${e.id}-provider`,children:"Email"}),aV("input",{id:`input-email-for-${e.id}-provider`,autoFocus:!0,type:"email",name:"email",value:s,placeholder:"email@example.com",required:!0}),aV("button",{id:"submitButton",type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),"credentials"===e.type&&aV("form",{action:e.callbackUrl,method:"POST",children:[aV("input",{type:"hidden",name:"csrfToken",value:t}),Object.keys(e.credentials).map(t=>aV("div",{children:[aV("label",{className:"section-header",htmlFor:`input-${t}-for-${e.id}-provider`,children:e.credentials[t].label??t}),aV("input",{name:t,id:`input-${t}-for-${e.id}-provider`,type:e.credentials[t].type??"text",placeholder:e.credentials[t].placeholder??"",...e.credentials[t]})]},`input-group-${e.id}`)),aV("button",{id:"submitButton",type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),"webauthn"===e.type&&aV("form",{action:e.callbackUrl,method:"POST",id:`${e.id}-form`,children:[aV("input",{type:"hidden",name:"csrfToken",value:t}),Object.keys(e.formFields).map(t=>aV("div",{children:[aV("label",{className:"section-header",htmlFor:`input-${t}-for-${e.id}-provider`,children:e.formFields[t].label??t}),aV("input",{name:t,"data-form-field":!0,id:`input-${t}-for-${e.id}-provider`,type:e.formFields[t].type??"text",placeholder:e.formFields[t].placeholder??"",...e.formFields[t]})]},`input-group-${e.id}`)),aV("button",{id:`submitButton-${e.id}`,type:"submit",tabIndex:0,children:["Sign in with ",e.name]})]}),("email"===e.type||"credentials"===e.type||"webauthn"===e.type)&&n+1["email","oauth","oidc"].includes(e.type)||"credentials"===e.type&&e.credentials||"webauthn"===e.type&&e.formFields||!1),callbackUrl:e.callbackUrl,theme:e.theme,error:o,...i}),title:"Sign In",headTags:u})},signout:()=>s?.signOut?{redirect:s.signOut,cookies:n}:aG({cookies:n,theme:r,html:function(e){let{url:t,csrfToken:r,theme:i}=e;return aV("div",{className:"signout",children:[i?.brandColor&&aV("style",{dangerouslySetInnerHTML:{__html:`
+ :root {
+ --brand-color: ${i.brandColor}
+ }
+ `}}),i?.buttonText&&aV("style",{dangerouslySetInnerHTML:{__html:`
+ :root {
+ --button-text-color: ${i.buttonText}
+ }
+ `}}),aV("div",{className:"card",children:[i?.logo&&aV("img",{src:i.logo,alt:"Logo",className:"logo"}),aV("h1",{children:"Signout"}),aV("p",{children:"Are you sure you want to sign out?"}),aV("form",{action:t?.toString(),method:"POST",children:[aV("input",{type:"hidden",name:"csrfToken",value:r}),aV("button",{id:"submitButton",type:"submit",children:"Sign out"})]})]})]})}({csrfToken:e.csrfToken,url:t,theme:r}),title:"Sign Out"}),verifyRequest:e=>s?.verifyRequest?{redirect:s.verifyRequest,cookies:n}:aG({cookies:n,theme:r,html:function(e){let{url:t,theme:r}=e;return aV("div",{className:"verify-request",children:[r.brandColor&&aV("style",{dangerouslySetInnerHTML:{__html:`
+ :root {
+ --brand-color: ${r.brandColor}
+ }
+ `}}),aV("div",{className:"card",children:[r.logo&&aV("img",{src:r.logo,alt:"Logo",className:"logo"}),aV("h1",{children:"Check your email"}),aV("p",{children:"A sign in link has been sent to your email address."}),aV("p",{children:aV("a",{className:"site",href:t.origin,children:t.host})})]})]})}({url:t,theme:r,...e}),title:"Verify Request"}),error:e=>s?.error?{redirect:`${s.error}${s.error.includes("?")?"&":"?"}error=${e}`,cookies:n}:aG({cookies:n,theme:r,...function(e){let{url:t,error:r="default",theme:i}=e,n=`${t}/signin`,s={default:{status:200,heading:"Error",message:aV("p",{children:aV("a",{className:"site",href:t?.origin,children:t?.host})})},Configuration:{status:500,heading:"Server error",message:aV("div",{children:[aV("p",{children:"There is a problem with the server configuration."}),aV("p",{children:"Check the server logs for more information."})]})},AccessDenied:{status:403,heading:"Access Denied",message:aV("div",{children:[aV("p",{children:"You do not have permission to sign in."}),aV("p",{children:aV("a",{className:"button",href:n,children:"Sign in"})})]})},Verification:{status:403,heading:"Unable to sign in",message:aV("div",{children:[aV("p",{children:"The sign in link is no longer valid."}),aV("p",{children:"It may have been used already or it may have expired."})]}),signin:aV("a",{className:"button",href:n,children:"Sign in"})}},{status:a,heading:o,message:l,signin:u}=s[r]??s.default;return{status:a,html:aV("div",{className:"error",children:[i?.brandColor&&aV("style",{dangerouslySetInnerHTML:{__html:`
+ :root {
+ --brand-color: ${i?.brandColor}
+ }
+ `}}),aV("div",{className:"card",children:[i?.logo&&aV("img",{src:i?.logo,alt:"Logo",className:"logo"}),aV("h1",{children:o}),aV("div",{className:"message",children:l}),u]})]})}}({url:t,theme:r,error:e}),title:"Error"})}}function aY(e,t=Date.now()){return new Date(t+1e3*e)}async function a0(e,t,r,i){if(!r?.providerAccountId||!r.type)throw Error("Missing or invalid provider account");if(!["email","oauth","oidc","webauthn"].includes(r.type))throw Error("Provider not supported");let{adapter:n,jwt:s,events:a,session:{strategy:o,generateSessionToken:l}}=i;if(!n)return{user:t,account:r};let u=r,{createUser:c,updateUser:d,getUser:h,getUserByAccount:p,getUserByEmail:f,linkAccount:m,createSession:g,getSessionAndUser:y,deleteSession:v}=n,b=null,w=null,_=!1,S="jwt"===o;if(e){if(S)try{let t=i.cookies.sessionToken.name;(b=await s.decode({...s,token:e,salt:t}))&&"sub"in b&&b.sub&&(w=await h(b.sub))}catch{}else{let t=await y(e);t&&(b=t.session,w=t.user)}}if("email"===u.type){let r=await f(t.email);return r?(w?.id!==r.id&&!S&&e&&await v(e),w=await d({id:r.id,emailVerified:new Date}),await a.updateUser?.({user:w})):(w=await c({...t,emailVerified:new Date}),await a.createUser?.({user:w}),_=!0),{session:b=S?{}:await g({sessionToken:l(),userId:w.id,expires:aY(i.session.maxAge)}),user:w,isNewUser:_}}if("webauthn"===u.type){let e=await p({providerAccountId:u.providerAccountId,provider:u.provider});if(e){if(w){if(e.id===w.id){let e={...u,userId:w.id};return{session:b,user:w,isNewUser:_,account:e}}throw new iV("The account is already associated with another user",{provider:u.provider})}b=S?{}:await g({sessionToken:l(),userId:e.id,expires:aY(i.session.maxAge)});let t={...u,userId:e.id};return{session:b,user:e,isNewUser:_,account:t}}{if(w){await m({...u,userId:w.id}),await a.linkAccount?.({user:w,account:u,profile:t});let e={...u,userId:w.id};return{session:b,user:w,isNewUser:_,account:e}}if(t.email?await f(t.email):null)throw new iV("Another account already exists with the same e-mail address",{provider:u.provider});w=await c({...t}),await a.createUser?.({user:w}),await m({...u,userId:w.id}),await a.linkAccount?.({user:w,account:u,profile:t}),b=S?{}:await g({sessionToken:l(),userId:w.id,expires:aY(i.session.maxAge)});let e={...u,userId:w.id};return{session:b,user:w,isNewUser:!0,account:e}}}let x=await p({providerAccountId:u.providerAccountId,provider:u.provider});if(x){if(w){if(x.id===w.id)return{session:b,user:w,isNewUser:_};throw new iP("The account is already associated with another user",{provider:u.provider})}return{session:b=S?{}:await g({sessionToken:l(),userId:x.id,expires:aY(i.session.maxAge)}),user:x,isNewUser:_}}{let{provider:e}=i,{type:r,provider:n,providerAccountId:s,userId:o,...d}=u;if(u=Object.assign(e.account(d)??{},{providerAccountId:s,provider:n,type:r,userId:o}),w)return await m({...u,userId:w.id}),await a.linkAccount?.({user:w,account:u,profile:t}),{session:b,user:w,isNewUser:_};let h=t.email?await f(t.email):null;if(h){let e=i.provider;if(e?.allowDangerousEmailAccountLinking)w=h;else throw new iP("Another account already exists with the same e-mail address",{provider:u.provider})}else w=await c({...t,emailVerified:null});return await a.createUser?.({user:w}),await m({...u,userId:w.id}),await a.linkAccount?.({user:w,account:u,profile:t}),{session:b=S?{}:await g({sessionToken:l(),userId:w.id,expires:aY(i.session.maxAge)}),user:w,isNewUser:!0}}}function a1(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}"undefined"!=typeof navigator&&navigator.userAgent?.startsWith?.("Mozilla/5.0 ")||(s="oauth4webapi/v2.10.3");let a6=Symbol(),a2=Symbol(),a4=Symbol(),a5=Symbol(),a3=new TextEncoder,a8=new TextDecoder;function a9(e){return"string"==typeof e?a3.encode(e):a8.decode(e)}function a7(e){return"string"==typeof e?function(e){try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),r=new Uint8Array(t.length);for(let e=0;e=this.maxSize&&(this._cache=this.cache,this.cache=new Map)}}class ot extends Error{constructor(e){super(e??"operation not supported"),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class or extends Error{constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}let oi=or,on=new oe(100);function os(e){return e instanceof CryptoKey}function oa(e){return os(e)&&"private"===e.type}function oo(e){try{let t=e.headers.get("dpop-nonce");t&&on.set(new URL(e.url).origin,t)}catch{}return e}function ol(e){return!(null===e||"object"!=typeof e||Array.isArray(e))}function ou(e){a1(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e);if(s&&!t.has("user-agent")&&t.set("user-agent",s),t.has("authorization"))throw TypeError('"options.headers" must not include the "authorization" header name');if(t.has("dpop"))throw TypeError('"options.headers" must not include the "dpop" header name');return t}function oc(e){if("function"==typeof e&&(e=e()),!(e instanceof AbortSignal))throw TypeError('"options.signal" must return or be an instance of AbortSignal');return e}async function od(e,t){if(!(e instanceof URL))throw TypeError('"issuerIdentifier" must be an instance of URL');if("https:"!==e.protocol&&"http:"!==e.protocol)throw TypeError('"issuer.protocol" must be "https:" or "http:"');let r=new URL(e.href);switch(t?.algorithm){case void 0:case"oidc":r.pathname=`${r.pathname}/.well-known/openid-configuration`.replace("//","/");break;case"oauth2":"/"===r.pathname?r.pathname=".well-known/oauth-authorization-server":r.pathname=`.well-known/oauth-authorization-server/${r.pathname}`.replace("//","/");break;default:throw TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"')}let i=ou(t?.headers);return i.set("accept","application/json"),(t?.[a4]||fetch)(r.href,{headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:t?.signal?oc(t.signal):null}).then(oo)}function oh(e){return"string"==typeof e&&0!==e.length}async function op(e,t){let r;if(!(e instanceof URL))throw TypeError('"expectedIssuer" must be an instance of URL');if(!a1(t,Response))throw TypeError('"response" must be an instance of Response');if(200!==t.status)throw new oi('"response" is not a conform Authorization Server Metadata response');o0(t);try{r=await t.json()}catch(e){throw new oi('failed to parse "response" body as JSON',{cause:e})}if(!ol(r))throw new oi('"response" body must be a top level object');if(!oh(r.issuer))throw new oi('"response" body "issuer" property must be a non-empty string');if(new URL(r.issuer).href!==e.href)throw new oi('"response" body "issuer" does not match "expectedIssuer"');return r}function of(){return a7(crypto.getRandomValues(new Uint8Array(32)))}async function om(e){if(!oh(e))throw TypeError('"codeVerifier" must be a non-empty string');return a7(await crypto.subtle.digest("SHA-256",a9(e)))}function og(e){return encodeURIComponent(e).replace(/%20/g,"+")}function oy(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new ot("unsupported RsaHashedKeyAlgorithm hash name")}}(e);case"RSASSA-PKCS1-v1_5":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new ot("unsupported RsaHashedKeyAlgorithm hash name")}}(e);case"ECDSA":return function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new ot("unsupported EcKeyAlgorithm namedCurve")}}(e);case"Ed25519":case"Ed448":return"EdDSA";default:throw new ot("unsupported CryptoKey algorithm name")}}function ov(e){let t=e?.[a6];return"number"==typeof t&&Number.isFinite(t)?t:0}function ob(e){let t=e?.[a2];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function ow(){return Math.floor(Date.now()/1e3)}async function o_(e,t,r,i){return oC({alg:oy(r),kid:i},function(e,t){let r=ow()+ov(t);return{jti:of(),aud:[e.issuer,e.token_endpoint],exp:r+60,iat:r,nbf:r,iss:t.client_id,sub:t.client_id}}(e,t),r)}function oS(e){if("object"!=typeof e||null===e)throw TypeError('"as" must be an object');if(!oh(e.issuer))throw TypeError('"as.issuer" property must be a non-empty string');return!0}function ox(e){if("object"!=typeof e||null===e)throw TypeError('"client" must be an object');if(!oh(e.client_id))throw TypeError('"client.client_id" property must be a non-empty string');return!0}function ok(e){if(!oh(e))throw TypeError('"client.client_secret" property must be a non-empty string');return e}function oE(e,t){if(void 0!==t)throw TypeError(`"options.clientPrivateKey" property must not be provided when ${e} client authentication method is used.`)}function oA(e,t){if(void 0!==t)throw TypeError(`"client.client_secret" property must not be provided when ${e} client authentication method is used.`)}async function oT(e,t,r,i,n){switch(r.delete("client_secret"),r.delete("client_assertion_type"),r.delete("client_assertion"),t.token_endpoint_auth_method){case void 0:case"client_secret_basic":oE("client_secret_basic",n),i.set("authorization",function(e,t){let r=og(e),i=og(t),n=btoa(`${r}:${i}`);return`Basic ${n}`}(t.client_id,ok(t.client_secret)));break;case"client_secret_post":oE("client_secret_post",n),r.set("client_id",t.client_id),r.set("client_secret",ok(t.client_secret));break;case"private_key_jwt":{if(oA("private_key_jwt",t.client_secret),void 0===n)throw TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');let{key:i,kid:s}=function(e){if(e instanceof CryptoKey)return{key:e};if(!(e?.key instanceof CryptoKey))return{};if(void 0!==e.kid&&!oh(e.kid))throw TypeError('"kid" must be a non-empty string');return{key:e.key,kid:e.kid}}(n);if(!oa(i))throw TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');r.set("client_id",t.client_id),r.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),r.set("client_assertion",await o_(e,t,i,s));break}case"tls_client_auth":case"self_signed_tls_client_auth":case"none":oA(t.token_endpoint_auth_method,t.client_secret),oE(t.token_endpoint_auth_method,n),r.set("client_id",t.client_id);break;default:throw new ot("unsupported client token_endpoint_auth_method")}}async function oC(e,t,r){if(!r.usages.includes("sign"))throw TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');let i=`${a7(a9(JSON.stringify(e)))}.${a7(a9(JSON.stringify(t)))}`,n=a7(await crypto.subtle.sign(o2(r),r,a9(i)));return`${i}.${n}`}async function oO(e,t,r,i,n,s){let{privateKey:a,publicKey:o,nonce:l=on.get(r.origin)}=t;if(!oa(a))throw TypeError('"DPoP.privateKey" must be a private CryptoKey');if(!(os(o)&&"public"===o.type))throw TypeError('"DPoP.publicKey" must be a public CryptoKey');if(void 0!==l&&!oh(l))throw TypeError('"DPoP.nonce" must be a non-empty string or undefined');if(!o.extractable)throw TypeError('"DPoP.publicKey.extractable" must be true');let u=ow()+n,c=await oC({alg:oy(a),typ:"dpop+jwt",jwk:await o$(o)},{iat:u,jti:of(),htm:i,nonce:l,htu:`${r.origin}${r.pathname}`,ath:s?a7(await crypto.subtle.digest("SHA-256",a9(s))):void 0},a);e.set("dpop",c)}async function oP(e){let{kty:t,e:r,n:i,x:n,y:s,crv:o}=await crypto.subtle.exportKey("jwk",e),l={kty:t,e:r,n:i,x:n,y:s,crv:o};return a.set(e,l),l}async function o$(e){return a||(a=new WeakMap),a.get(e)||oP(e)}function oN(e,t,r){if("string"!=typeof e){if(r?.[a5])throw TypeError(`"as.mtls_endpoint_aliases.${t}" must be a string`);throw TypeError(`"as.${t}" must be a string`)}return new URL(e)}function oR(e,t,r){return r?.[a5]&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?oN(e.mtls_endpoint_aliases[t],t,r):oN(e[t],t)}function oI(e){return!("object"!=typeof e||Array.isArray(e))&&null!==e&&void 0!==e.error}let oj=/((?:,|, )?[0-9a-zA-Z!#$%&'*+-.^_`|~]+=)/,oL=/(?:^|, ?)([0-9a-zA-Z!#$%&'*+\-.^_`|~]+)(?=$|[ ,])/g;async function oD(e,t,r,i,n,s){if(!oh(e))throw TypeError('"accessToken" must be a non-empty string');if(!(r instanceof URL))throw TypeError('"url" must be an instance of URL');return i=ou(i),s?.DPoP===void 0?i.set("authorization",`Bearer ${e}`):(await oO(i,s.DPoP,r,"GET",ov({[a6]:s?.[a6]}),e),i.set("authorization",`DPoP ${e}`)),(s?.[a4]||fetch)(r.href,{body:n,headers:Object.fromEntries(i.entries()),method:t,redirect:"manual",signal:s?.signal?oc(s.signal):null}).then(oo)}async function oM(e,t,r,i){oS(e),ox(t);let n=oR(e,"userinfo_endpoint",i),s=ou(i?.headers);return t.userinfo_signed_response_alg?s.set("accept","application/jwt"):(s.set("accept","application/json"),s.append("accept","application/jwt")),oD(r,"GET",n,s,null,{...i,[a6]:ov(t)})}async function oU(e,t,r,i,n,s,a){return await oT(e,t,n,s,a?.clientPrivateKey),s.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),(a?.[a4]||fetch)(i.href,{body:n,headers:Object.fromEntries(s.entries()),method:r,redirect:"manual",signal:a?.signal?oc(a.signal):null}).then(oo)}async function oq(e,t,r,i,n){let s=oR(e,"token_endpoint",n);i.set("grant_type",r);let a=ou(n?.headers);return a.set("accept","application/json"),n?.DPoP!==void 0&&await oO(a,n.DPoP,s,"POST",ov(t)),oU(e,t,"POST",s,i,a,n)}Symbol();let oQ=new WeakMap;function oB(e){if(!e.id_token)return;let t=oQ.get(e);if(!t)throw TypeError('"ref" was already garbage collected or did not resolve from the proper sources');return t}async function oH(e,t,r,i=!1,n=!1){let s;if(oS(e),ox(t),!a1(r,Response))throw TypeError('"response" must be an instance of Response');if(200!==r.status){let e;if(e=await o1(r))return e;throw new oi('"response" is not a conform Token Endpoint response')}o0(r);try{s=await r.json()}catch(e){throw new oi('failed to parse "response" body as JSON',{cause:e})}if(!ol(s))throw new oi('"response" body must be a top level object');if(!oh(s.access_token))throw new oi('"response" body "access_token" property must be a non-empty string');if(!oh(s.token_type))throw new oi('"response" body "token_type" property must be a non-empty string');if(s.token_type=s.token_type.toLowerCase(),"dpop"!==s.token_type&&"bearer"!==s.token_type)throw new ot("unsupported `token_type` value");if(void 0!==s.expires_in&&("number"!=typeof s.expires_in||s.expires_in<=0))throw new oi('"response" body "expires_in" property must be a positive number');if(!n&&void 0!==s.refresh_token&&!oh(s.refresh_token))throw new oi('"response" body "refresh_token" property must be a non-empty string');if(void 0!==s.scope&&"string"!=typeof s.scope)throw new oi('"response" body "scope" property must be a string');if(!i){if(void 0!==s.id_token&&!oh(s.id_token))throw new oi('"response" body "id_token" property must be a non-empty string');if(s.id_token){let{claims:r}=await o5(s.id_token,o3.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported),o4,ov(t),ob(t)).then(oJ.bind(void 0,["aud","exp","iat","iss","sub"])).then(oF.bind(void 0,e.issuer)).then(oK.bind(void 0,t.client_id));if(Array.isArray(r.aud)&&1!==r.aud.length&&r.azp!==t.client_id)throw new oi('unexpected ID Token "azp" (authorized party) claim value');if(t.require_auth_time&&"number"!=typeof r.auth_time)throw new oi('unexpected ID Token "auth_time" (authentication time) claim value');oQ.set(s,r)}}return s}function oK(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw new oi('unexpected JWT "aud" (audience) claim value')}else if(t.claims.aud!==e)throw new oi('unexpected JWT "aud" (audience) claim value');return t}function oF(e,t){if(t.claims.iss!==e)throw new oi('unexpected JWT "iss" (issuer) claim value');return t}let oV=new WeakSet;async function oW(e,t,r,i,n,s){if(oS(e),ox(t),!oV.has(r))throw TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');if(!oh(i))throw TypeError('"redirectUri" must be a non-empty string');if(!oh(n))throw TypeError('"codeVerifier" must be a non-empty string');let a=o8(r,"code");if(!a)throw new oi('no authorization code in "callbackParameters"');let o=new URLSearchParams(s?.additionalParameters);return o.set("redirect_uri",i),o.set("code_verifier",n),o.set("code",a),oq(e,t,"authorization_code",o,s)}let oz={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation"};function oJ(e,t){for(let r of e)if(void 0===t.claims[r])throw new oi(`JWT "${r}" (${oz[r]}) claim missing`);return t}let oZ=Symbol(),oG=Symbol();async function oX(e,t,r,i,n){let s=await oH(e,t,r);if(oI(s))return s;if(!oh(s.id_token))throw new oi('"response" body "id_token" property must be a non-empty string');n??(n=t.default_max_age??oG);let a=oB(s);if((t.require_auth_time||n!==oG)&&void 0===a.auth_time)throw new oi('ID Token "auth_time" (authentication time) claim missing');if(n!==oG){if("number"!=typeof n||n<0)throw TypeError('"options.max_age" must be a non-negative number');let e=ow()+ov(t),r=ob(t);if(a.auth_time+n399&&e.status<500){o0(e);try{let t=await e.json();if(ol(t)&&"string"==typeof t.error&&t.error.length)return void 0!==t.error_description&&"string"!=typeof t.error_description&&delete t.error_description,void 0!==t.error_uri&&"string"!=typeof t.error_uri&&delete t.error_uri,void 0!==t.algs&&"string"!=typeof t.algs&&delete t.algs,void 0!==t.scope&&"string"!=typeof t.scope&&delete t.scope,t}catch{}}}function o6(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new oi(`${e.name} modulusLength must be at least 2048 bits`)}function o2(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:function(e){switch(e){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new ot}}(e.algorithm.namedCurve)};case"RSA-PSS":switch(o6(e.algorithm),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new ot}case"RSASSA-PKCS1-v1_5":return o6(e.algorithm),e.algorithm.name;case"Ed448":case"Ed25519":return e.algorithm.name}throw new ot}let o4=Symbol();async function o5(e,t,r,i,n){let s,a,o;let{0:l,1:u,2:c,length:d}=e.split(".");if(5===d)throw new ot("JWE structure JWTs are not supported");if(3!==d)throw new oi("Invalid JWT");try{s=JSON.parse(a9(a7(l)))}catch(e){throw new oi("failed to parse JWT Header body as base64url encoded JSON",{cause:e})}if(!ol(s))throw new oi("JWT Header must be a top level object");if(t(s),void 0!==s.crit)throw new oi('unexpected JWT "crit" header parameter');let h=a7(c);if(r!==o4){a=await r(s);let e=`${l}.${u}`;if(!await crypto.subtle.verify(o2(a),a,h,a9(e)))throw new oi("JWT signature verification failed")}try{o=JSON.parse(a9(a7(u)))}catch(e){throw new oi("failed to parse JWT Payload body as base64url encoded JSON",{cause:e})}if(!ol(o))throw new oi("JWT Payload must be a top level object");let p=ow()+i;if(void 0!==o.exp){if("number"!=typeof o.exp)throw new oi('unexpected JWT "exp" (expiration time) claim type');if(o.exp<=p-n)throw new oi('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()')}if(void 0!==o.iat&&"number"!=typeof o.iat)throw new oi('unexpected JWT "iat" (issued at) claim type');if(void 0!==o.iss&&"string"!=typeof o.iss)throw new oi('unexpected JWT "iss" (issuer) claim type');if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new oi('unexpected JWT "nbf" (not before) claim type');if(o.nbf>p+n)throw new oi('unexpected JWT "nbf" (not before) claim value, timestamp is > now()')}if(void 0!==o.aud&&"string"!=typeof o.aud&&!Array.isArray(o.aud))throw new oi('unexpected JWT "aud" (audience) claim type');return{header:s,claims:o,signature:h,key:a}}function o3(e,t,r){if(void 0!==e){if(r.alg!==e)throw new oi('unexpected JWT "alg" header parameter');return}if(Array.isArray(t)){if(!t.includes(r.alg))throw new oi('unexpected JWT "alg" header parameter');return}if("RS256"!==r.alg)throw new oi('unexpected JWT "alg" header parameter')}function o8(e,t){let{0:r,length:i}=e.getAll(t);if(i>1)throw new oi(`"${t}" parameter must be provided only once`);return r}let o9=Symbol(),o7=Symbol();async function le(e,t,r,i,n){let{cookies:s,logger:a}=i;a.debug(`CREATE_${e.toUpperCase()}`,{value:t,maxAge:r});let o=new Date;o.setTime(o.getTime()+1e3*r);let l={value:t};"state"===e&&n&&(l.data=n);let u=s[e].name;return{name:u,value:await sC({...i.jwt,maxAge:r,token:l,salt:u}),options:{...s[e].options,expires:o}}}let lt={async create(e){let t=of(),r=await om(t);return{cookie:await le("pkceCodeVerifier",t,900,e),value:r}},async use(e,t,r){let{provider:i}=r;if(!i?.checks?.includes("pkce"))return;let n=e?.[r.cookies.pkceCodeVerifier.name];if(!n)throw new ik("PKCE code_verifier cookie was missing.");let s=await sO({...r.jwt,token:n,salt:r.cookies.pkceCodeVerifier.name});if(!s?.value)throw new ik("PKCE code_verifier value could not be parsed.");return t.push({name:r.cookies.pkceCodeVerifier.name,value:"",options:{...r.cookies.pkceCodeVerifier.options,maxAge:0}}),s.value}};function lr(e){try{let t=new TextDecoder;return JSON.parse(t.decode(nc(e)))}catch{}}let li={async create(e,t){let{provider:r}=e;if(!r.checks.includes("state")){if(t)throw new ik("State data was provided but the provider is not configured to use state.");return}let i=nl(JSON.stringify({...t,random:of()}));return{cookie:await le("state",i,900,e,t),value:i}},async use(e,t,r,i){let{provider:n}=r;if(!n.checks.includes("state"))return;let s=e?.[r.cookies.state.name];if(!s)throw new ik("State cookie was missing.");let a=await sO({...r.jwt,token:s,salt:r.cookies.state.name});if(!a?.value)throw new ik("State (cookie) value could not be parsed.");let o=lr(a.value);if(!o)throw new ik("State (encoded) value could not be parsed.");if(o.random!==i)throw new ik(`Random state values did not match. Expected: ${o.random}. Got: ${i}`);return t.push({name:r.cookies.state.name,value:"",options:{...r.cookies.state.options,maxAge:0}}),a.value}},ln={async create(e){if(!e.provider.checks.includes("nonce"))return;let t=of();return{cookie:await le("nonce",t,900,e),value:t}},async use(e,t,r){let{provider:i}=r;if(!i?.checks?.includes("nonce"))return;let n=e?.[r.cookies.nonce.name];if(!n)throw new ik("Nonce cookie was missing.");let s=await sO({...r.jwt,token:n,salt:r.cookies.nonce.name});if(!s?.value)throw new ik("Nonce value could not be parsed.");return t.push({name:r.cookies.nonce.name,value:"",options:{...r.cookies.nonce.options,maxAge:0}}),s.value}},ls={create:async(e,t,r)=>({cookie:await le("webauthnChallenge",JSON.stringify({challenge:t,registerData:r}),900,e)}),async use(e,t,r){let i=t?.[e.cookies.webauthnChallenge.name];if(!i)throw new ik("Challenge cookie missing.");let n=await sO({...e.jwt,token:i,salt:e.cookies.webauthnChallenge.name});if(!n?.value)throw new ik("Challenge value could not be parsed.");let s={name:e.cookies.webauthnChallenge.name,value:"",options:{...e.cookies.webauthnChallenge.options,maxAge:0}};return r.push(s),JSON.parse(n.value)}};async function la(e,t,r,i){let n,s,a;let{logger:o,provider:l}=r,{token:u,userinfo:c}=l;if(u?.url&&"authjs.dev"!==u.url.host||c?.url&&"authjs.dev"!==c.url.host)n={issuer:l.issuer??"https://authjs.dev",token_endpoint:u?.url.toString(),userinfo_endpoint:c?.url.toString()};else{let e=new URL(l.issuer),t=await od(e),r=await op(e,t);if(!r.token_endpoint)throw TypeError("TODO: Authorization server did not provide a token endpoint.");if(!r.userinfo_endpoint)throw TypeError("TODO: Authorization server did not provide a userinfo endpoint.");n=r}let d={client_id:l.clientId,client_secret:l.clientSecret,...l.client},h=[],p=await li.use(t,h,r,i),f=function(e,t,r,i){var n;if(oS(e),ox(t),r instanceof URL&&(r=r.searchParams),!(r instanceof URLSearchParams))throw TypeError('"parameters" must be an instance of URLSearchParams, or URL');if(o8(r,"response"))throw new oi('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');let s=o8(r,"iss"),a=o8(r,"state");if(!s&&e.authorization_response_iss_parameter_supported)throw new oi('response parameter "iss" (issuer) missing');if(s&&s!==e.issuer)throw new oi('unexpected "iss" (issuer) response parameter value');switch(i){case void 0:case o7:if(void 0!==a)throw new oi('unexpected "state" response parameter encountered');break;case o9:break;default:if(!oh(i))throw new oi('"expectedState" must be a non-empty string');if(void 0===a)throw new oi('response parameter "state" missing');if(a!==i)throw new oi('unexpected "state" response parameter value')}let o=o8(r,"error");if(o)return{error:o,error_description:o8(r,"error_description"),error_uri:o8(r,"error_uri")};let l=o8(r,"id_token"),u=o8(r,"token");if(void 0!==l||void 0!==u)throw new ot("implicit and hybrid flows are not supported");return n=new URLSearchParams(r),oV.add(n),n}(n,d,new URLSearchParams(e),l.checks.includes("state")?p:o9);if(oI(f)){let e={providerId:l.id,...f};throw o.debug("OAuthCallbackError",e),new i$("OAuth Provider returned an error",e)}let m=await lt.use(t,h,r),g=l.callbackUrl;!r.isOnRedirectProxy&&l.redirectProxyUrl&&(g=l.redirectProxyUrl);let y=await oW(n,d,f,g,m??"auth");if(l.token?.conform&&(y=await l.token.conform(y.clone())??y),s=function(e){if(!a1(e,Response))throw TypeError('"response" must be an instance of Response');let t=e.headers.get("www-authenticate");if(null===t)return;let r=[];for(let{1:e,index:i}of t.matchAll(oL))r.push([e,i]);if(r.length)return r.map(([e,r],i,n)=>{let s=n[i+1];return function(e,t){let r=t.split(oj).slice(1);if(!r.length)return{scheme:e.toLowerCase(),parameters:{}};r[r.length-1]=r[r.length-1].replace(/,$/,"");let i={};for(let e=1;e=2&&'"'===n[0]&&'"'===n[n.length-1]?n.slice(1,-1):n}return{scheme:e.toLowerCase(),parameters:i}}(e,s?t.slice(r,s[1]):t.slice(r))})}(y)){for(let e of s)console.log("challenge",e);throw Error("TODO: Handle www-authenticate challenges as needed")}let v={};if("oidc"===l.type){let e=await ln.use(t,h,r),i=await oX(n,d,y,e??oZ);if(oI(i))throw console.log("error",i),Error("TODO: Handle OIDC response body error");v=oB(i),a=i}else{if(oI(a=await oY(n,d,y)))throw console.log("error",a),Error("TODO: Handle OAuth 2.0 response body error");if(c?.request){let e=await c.request({tokens:a,provider:l});e instanceof Object&&(v=e)}else if(c?.url){let e=await oM(n,d,a.access_token);v=await e.json()}else throw TypeError("No userinfo endpoint configured")}return a.expires_in&&(a.expires_at=Math.floor(Date.now()/1e3)+Number(a.expires_in)),{...await lo(v,l,a,o),profile:v,cookies:h}}async function lo(e,t,r,i){try{let i=await t.profile(e,r);return{user:{...i,id:crypto.randomUUID(),email:i.email?.toLowerCase()},account:{...r,provider:t.id,type:t.type,providerAccountId:i.id??crypto.randomUUID()}}}catch(r){i.debug("getProfile error details",e),i.error(new iN(r,{provider:t.id}))}}var ll=r(6195).Buffer;async function lu(e,t,r,i){let n=await lf(e,t,r),{cookie:s}=await ls.create(e,n.challenge,r);return{status:200,cookies:[...i??[],s],body:{action:"register",options:n},headers:{"Content-Type":"application/json"}}}async function lc(e,t,r,i){let n=await lp(e,t,r),{cookie:s}=await ls.create(e,n.challenge);return{status:200,cookies:[...i??[],s],body:{action:"authenticate",options:n},headers:{"Content-Type":"application/json"}}}async function ld(e,t,r){let i;let{adapter:n,provider:s}=e,a=t.body&&"string"==typeof t.body.data?JSON.parse(t.body.data):void 0;if(!a||"object"!=typeof a||!("id"in a)||"string"!=typeof a.id)throw new ip("Invalid WebAuthn Authentication response.");let o=ly(lg(a.id)),l=await n.getAuthenticator(o);if(!l)throw new ip(`WebAuthn authenticator not found in database: ${JSON.stringify({credentialID:o})}`);let{challenge:u}=await ls.use(e,t.cookies,r);try{let r=s.getRelayingParty(e,t);i=await s.simpleWebAuthn.verifyAuthenticationResponse({...s.verifyAuthenticationOptions,expectedChallenge:u,response:a,authenticator:{...l,credentialDeviceType:l.credentialDeviceType,transports:lv(l.transports),credentialID:lg(l.credentialID),credentialPublicKey:lg(l.credentialPublicKey)},expectedOrigin:r.origin,expectedRPID:r.id})}catch(e){throw new iF(e)}let{verified:c,authenticationInfo:d}=i;if(!c)throw new iF("WebAuthn authentication response could not be verified.");try{let{newCounter:e}=d;await n.updateAuthenticatorCounter(l.credentialID,e)}catch(e){throw new ig(`Failed to update authenticator counter. This may cause future authentication attempts to fail. ${JSON.stringify({credentialID:o,oldCounter:l.counter,newCounter:d.newCounter})}`,e)}let h=await n.getAccount(l.providerAccountId,s.id);if(!h)throw new ip(`WebAuthn account not found in database: ${JSON.stringify({credentialID:o,providerAccountId:l.providerAccountId})}`);let p=await n.getUser(h.userId);if(!p)throw new ip(`WebAuthn user not found in database: ${JSON.stringify({credentialID:o,providerAccountId:l.providerAccountId,userID:h.userId})}`);return{account:h,user:p}}async function lh(e,t,r){var i;let n;let{provider:s}=e,a=t.body&&"string"==typeof t.body.data?JSON.parse(t.body.data):void 0;if(!a||"object"!=typeof a||!("id"in a)||"string"!=typeof a.id)throw new ip("Invalid WebAuthn Registration response.");let{challenge:o,registerData:l}=await ls.use(e,t.cookies,r);if(!l)throw new ip("Missing user registration data in WebAuthn challenge cookie.");try{let r=s.getRelayingParty(e,t);n=await s.simpleWebAuthn.verifyRegistrationResponse({...s.verifyRegistrationOptions,expectedChallenge:o,response:a,expectedOrigin:r.origin,expectedRPID:r.id})}catch(e){throw new iF(e)}if(!n.verified||!n.registrationInfo)throw new iF("WebAuthn registration response could not be verified.");let u={providerAccountId:ly(n.registrationInfo.credentialID),provider:e.provider.id,type:s.type},c={providerAccountId:u.providerAccountId,counter:n.registrationInfo.counter,credentialID:ly(n.registrationInfo.credentialID),credentialPublicKey:ly(n.registrationInfo.credentialPublicKey),credentialBackedUp:n.registrationInfo.credentialBackedUp,credentialDeviceType:n.registrationInfo.credentialDeviceType,transports:(i=a.response.transports,i?.join(","))};return{user:l,account:u,authenticator:c}}async function lp(e,t,r){let{provider:i,adapter:n}=e,s=r&&r.id?await n.listAuthenticatorsByUserId(r.id):null,a=i.getRelayingParty(e,t);return await i.simpleWebAuthn.generateAuthenticationOptions({...i.authenticationOptions,rpID:a.id,allowCredentials:s?.map(e=>({id:lg(e.credentialID),type:"public-key",transports:lv(e.transports)}))})}async function lf(e,t,r){let{provider:i,adapter:n}=e,s=r.id?await n.listAuthenticatorsByUserId(r.id):null,a=sD(32),o=i.getRelayingParty(e,t);return await i.simpleWebAuthn.generateRegistrationOptions({...i.registrationOptions,userID:a,userName:r.email,userDisplayName:r.name??void 0,rpID:o.id,rpName:o.name,excludeCredentials:s?.map(e=>({id:lg(e.credentialID),type:"public-key",transports:lv(e.transports)}))})}function lm(e){let{provider:t,adapter:r}=e;if(!r)throw new iA("An adapter is required for the WebAuthn provider");if(!t||"webauthn"!==t.type)throw new iU("Provider must be WebAuthn");return{...e,provider:t,adapter:r}}function lg(e){return new Uint8Array(ll.from(e,"base64"))}function ly(e){return ll.from(e).toString("base64")}function lv(e){return e?e.split(","):void 0}async function lb(e,t,r,i){if(!t.provider)throw new iU("Callback route called without provider");let{query:n,body:s,method:a,headers:o}=e,{provider:l,adapter:u,url:c,callbackUrl:d,pages:h,jwt:p,events:f,callbacks:m,session:{strategy:g,maxAge:y},logger:v}=t,b="jwt"===g;try{if("oauth"===l.type||"oidc"===l.type){let s;let{proxyRedirect:a,randomState:o}=function(e,t,r){let i,n;if(t.redirectProxyUrl&&!e?.state)throw new ik("Missing state in query, but required for redirect proxy");let s=lr(e?.state);if(i=s?.random,r){if(!s?.origin)return{randomState:i};n=`${s.origin}?${new URLSearchParams(e)}`}return{randomState:i,proxyRedirect:n}}(n,l,t.isOnRedirectProxy);if(a)return v.debug("proxy redirect",{proxyRedirect:a,randomState:o}),{redirect:a};let g=await la(n,e.cookies,t,o);g.cookies.length&&i.push(...g.cookies),v.debug("authorization result",g);let{user:w,account:_,profile:S}=g;if(!w||!_||!S)return{redirect:`${c}/signin`,cookies:i};if(u){let{getUserByAccount:e}=u;s=await e({providerAccountId:_.providerAccountId,provider:l.id})}let x=await lw({user:s??w,account:_,profile:S},t);if(x)return{redirect:x,cookies:i};let{user:k,session:E,isNewUser:A}=await a0(r.value,w,_,t);if(b){let e={name:k.name,email:k.email,picture:k.image,sub:k.id?.toString()},n=await m.jwt({token:e,user:k,account:_,profile:S,isNewUser:A,trigger:A?"signUp":"signIn"});if(null===n)i.push(...r.clean());else{let e=t.cookies.sessionToken.name,s=await p.encode({...p,token:n,salt:e}),a=new Date;a.setTime(a.getTime()+1e3*y);let o=r.chunk(s,{expires:a});i.push(...o)}}else i.push({name:t.cookies.sessionToken.name,value:E.sessionToken,options:{...t.cookies.sessionToken.options,expires:E.expires}});if(await f.signIn?.({user:k,account:_,profile:S,isNewUser:A}),A&&h.newUser)return{redirect:`${h.newUser}${h.newUser.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:d})}`,cookies:i};return{redirect:d,cookies:i}}if("email"===l.type){let e=n?.token,s=n?.email;if(!e||!s){let t=TypeError("Missing token or email. The sign-in URL was manually opened without token/identifier or the link was not sent correctly in the email.",{cause:{hasToken:!!e,hasEmail:!!s}});throw t.name="Configuration",t}let a=l.secret??t.secret,o=await u.useVerificationToken({identifier:s,token:await sL(`${e}${a}`)}),c=!!o,g=o?o.expires.valueOf()c.searchParams.set(e,t));let u=await l.authorize(e,new Request(c,{headers:o,method:a,body:JSON.stringify(s)})),h=u&&{...u,id:u?.id?.toString()??crypto.randomUUID()};if(!h)throw new iS;let g={providerAccountId:h.id,type:"credentials",provider:l.id},v=await lw({user:h,account:g,credentials:e},t);if(v)return{redirect:v,cookies:i};let b={name:h.name,email:h.email,picture:h.image,sub:h.id},w=await m.jwt({token:b,user:h,account:g,isNewUser:!1,trigger:"signIn"});if(null===w)i.push(...r.clean());else{let e=t.cookies.sessionToken.name,n=await p.encode({...p,token:w,salt:e}),s=new Date;s.setTime(s.getTime()+1e3*y);let a=r.chunk(n,{expires:s});i.push(...a)}return await f.signIn?.({user:h,account:g}),{redirect:d,cookies:i}}if("webauthn"===l.type&&"POST"===a){let n,s,a;let o=e.body?.action;if("string"!=typeof o||"authenticate"!==o&&"register"!==o)throw new ip("Invalid action parameter");let l=lm(t);switch(o){case"authenticate":{let t=await ld(l,e,i);n=t.user,s=t.account;break}case"register":{let r=await lh(t,e,i);n=r.user,s=r.account,a=r.authenticator}}await lw({user:n,account:s},t);let{user:u,isNewUser:c,session:g,account:v}=await a0(r.value,n,s,t);if(!v)throw new ip("Error creating or finding account");if(a&&u.id&&await l.adapter.createAuthenticator({...a,userId:u.id}),b){let e={name:u.name,email:u.email,picture:u.image,sub:u.id?.toString()},n=await m.jwt({token:e,user:u,account:v,isNewUser:c,trigger:c?"signUp":"signIn"});if(null===n)i.push(...r.clean());else{let e=t.cookies.sessionToken.name,s=await p.encode({...p,token:n,salt:e}),a=new Date;a.setTime(a.getTime()+1e3*y);let o=r.chunk(s,{expires:a});i.push(...o)}}else i.push({name:t.cookies.sessionToken.name,value:g.sessionToken,options:{...t.cookies.sessionToken.options,expires:g.expires}});if(await f.signIn?.({user:u,account:v,isNewUser:c}),c&&h.newUser)return{redirect:`${h.newUser}${h.newUser.includes("?")?"&":"?"}${new URLSearchParams({callbackUrl:d})}`,cookies:i};return{redirect:d,cookies:i}}throw new iU(`Callback for provider type (${l.type}) is not supported`)}catch(t){if(t instanceof ip)throw t;let e=new iv(t,{provider:l.id});throw v.debug("callback route error details",{method:a,query:n,body:s}),e}}async function lw(e,t){let r;let{signIn:i,redirect:n}=t.callbacks;try{r=await i(e)}catch(e){if(e instanceof ip)throw e;throw new iy(e)}if(!r)throw new iy("AccessDenied");if("string"==typeof r)return await n({url:r,baseUrl:t.url.origin})}async function l_(e,t,r,i,n){let{adapter:s,jwt:a,events:o,callbacks:l,logger:u,session:{strategy:c,maxAge:d}}=e,h={body:null,headers:{"Content-Type":"application/json"},cookies:r},p=t.value;if(!p)return h;if("jwt"===c){try{let r=e.cookies.sessionToken.name,s=await a.decode({...a,token:p,salt:r});if(!s)throw Error("Invalid JWT");let u=await l.jwt({token:s,...i&&{trigger:"update"},session:n}),c=aY(d);if(null!==u){let e={user:{name:u.name,email:u.email,image:u.picture},expires:c.toISOString()},i=await l.session({session:e,token:u});h.body=i;let n=await a.encode({...a,token:u,salt:r}),s=t.chunk(n,{expires:c});h.cookies?.push(...s),await o.session?.({session:i,token:u})}else h.cookies?.push(...t.clean())}catch(e){u.error(new iE(e)),h.cookies?.push(...t.clean())}return h}try{let{getSessionAndUser:r,deleteSession:a,updateSession:u}=s,c=await r(p);if(c&&c.session.expires.valueOf(){}),e.error&&(sz.error=e.error),e.warn&&(sz.warn=e.warn),e.debug&&(sz.debug=e.debug)}(t.logger,t.debug);let i=await sI(e,t);if(i instanceof Error)return sz.error(i),Response.json(`Error: This action with HTTP ${e.method} is not supported.`,{status:400});let n=function(e,t){let{url:r}=e,i=[];if(!iz&&t.debug&&i.push("debug-enabled"),!t.trustHost)return new iq(`Host must be trusted. URL was: ${e.url}`);if(!t.secret)return new iO("Please define a `secret`.");let n=e.query?.callbackUrl;if(n&&!iJ(n,r.origin))return new i_(`Invalid callback URL. Received: ${n}`);let{callbackUrl:s}=id(t.useSecureCookies??"https:"===r.protocol),a=e.cookies?.[t.cookies?.callbackUrl?.name??s.name];if(a&&!iJ(a,r.origin))return new i_(`Invalid callback URL. Received: ${a}`);let o=!1;for(let e of t.providers){let t="function"==typeof e?e():e;if(("oauth"===t.type||"oidc"===t.type)&&!(t.issuer??t.options?.issuer)){let e;let{authorization:r,token:i,userinfo:n}=t;if("string"==typeof r||r?.url?"string"==typeof i||i?.url?"string"==typeof n||n?.url||(e="userinfo"):e="token":e="authorization",e)return new ix(`Provider "${t.id}" is missing both \`issuer\` and \`${e}\` endpoint config. At least one of them is required.`)}if("credentials"===t.type)iZ=!0;else if("email"===t.type)iG=!0;else if("webauthn"===t.type){var l;if(iX=!0,t.simpleWebAuthnBrowserVersion&&(l=t.simpleWebAuthnBrowserVersion,!/^v\d+(?:\.\d+){0,2}$/.test(l)))return new ip(`Invalid provider config for "${t.id}": simpleWebAuthnBrowserVersion "${t.simpleWebAuthnBrowserVersion}" must be a valid semver string.`);if(t.enableConditionalUI){if(o)return new iH("Multiple webauthn providers have 'enableConditionalUI' set to True. Only one provider can have this option enabled at a time.");if(o=!0,!Object.values(t.formFields).some(e=>e.autocomplete&&e.autocomplete.toString().indexOf("webauthn")>-1))return new iK(`Provider "${t.id}" has 'enableConditionalUI' set to True, but none of its formFields have 'webauthn' in their autocomplete param.`)}}}if(iZ){let e=t.session?.strategy==="database",r=!t.providers.some(e=>"credentials"!==("function"==typeof e?e():e).type);if(e&&r)return new iM("Signing in with credentials only supported if JWT strategy is enabled");if(t.providers.some(e=>{let t="function"==typeof e?e():e;return"credentials"===t.type&&!t.authorize}))return new iC("Must define an authorize() handler to use credentials authentication provider")}let{adapter:u,session:c}=t,d=[];if(iG||c?.strategy==="database"||!c?.strategy&&u){if(iG){if(!u)return new iA("Email login requires an adapter.");d.push(...iY)}else{if(!u)return new iA("Database session requires an adapter.");d.push(...i0)}}if(iX){if(!t.experimental?.enableWebAuthn)return new iW("WebAuthn is an experimental feature. To enable it, set `experimental.enableWebAuthn` to `true` in your config.");if(i.push("experimental-webauthn"),!u)return new iA("WebAuthn requires an adapter.");d.push(...i1)}if(u){let e=d.filter(e=>!(e in u));if(e.length)return new iT(`Required adapter methods were missing: ${e.join(", ")}`)}return iz||(iz=!0),i}(i,t);if(Array.isArray(n))n.forEach(sz.warn);else if(n instanceof Error){if(sz.error(n),!["signin","signout","error","verify-request"].includes(i.action)||"GET"!==i.method)return Response.json({message:"There was a problem with the server configuration. Check the server logs for more information."},{status:500});let{pages:e,theme:r}=t,s=e?.error&&i.url.searchParams.get("callbackUrl")?.startsWith(e.error);return!e?.error||s?(s&&sz.error(new ib(`The error page ${e?.error} should not require authentication`)),sj(aX({theme:r}).error("Configuration"))):Response.redirect(`${e.error}?error=Configuration`)}let s=e.headers?.has("X-Auth-Return-Redirect"),a=t.raw===lP;try{let e=await lC(i,t);if(a)return e;r=await sj(e)}catch(d){sz.error(d);let r=d instanceof ip;if(r&&a&&!s)throw d;if("POST"===e.method&&"session"===i.action)return Response.json(null,{status:400});let n=r?d.type:"Configuration",o=r&&d.kind||"error",l=new URLSearchParams({error:n}),u=t.pages?.[o]??`${t.basePath}/${o.toLowerCase()}`,c=`${i.url.origin}${u}?${l}`;if(s)return Response.json({url:c});return Response.redirect(c)}let o=r.headers.get("Location");return s&&o?Response.json({url:o},{headers:r.headers}):r}var lN=r(9858);function lR(e){let t=process.env.AUTH_URL??process.env.NEXTAUTH_URL;if(!t)return e;let{origin:r}=new URL(t),{href:i,origin:n}=e.nextUrl;return new lN.I(i.replace(n,r),e)}function lI(e){try{e.secret??(e.secret=process.env.AUTH_SECRET??process.env.NEXTAUTH_SECRET);let t=process.env.AUTH_URL??process.env.NEXTAUTH_URL;if(!t)return;let{pathname:r}=new URL(t);if("/"===r)return;e.basePath||(e.basePath=r)}catch{}finally{e.basePath||(e.basePath="/api/auth"),function(e,t){try{let r=e.AUTH_URL;r&&!t.basePath&&(t.basePath=new URL(r).pathname)}catch{}finally{t.basePath??(t.basePath="/auth")}if(!t.secret?.length){t.secret=[];let r=e.AUTH_SECRET;for(let i of(r&&t.secret.push(r),[1,2,3])){let r=e[`AUTH_SECRET_${i}`];r&&t.secret.unshift(r)}}t.redirectProxyUrl??(t.redirectProxyUrl=e.AUTH_REDIRECT_PROXY_URL),t.trustHost??(t.trustHost=!!(e.AUTH_URL??e.AUTH_TRUST_HOST??e.VERCEL??e.CF_PAGES??"production"!==e.NODE_ENV)),t.providers=t.providers.map(t=>{let r="function"==typeof t?t({}):t,i=r.id.toUpperCase();return"oauth"===r.type||"oidc"===r.type?(r.clientId??(r.clientId=e[`AUTH_${i}_ID`]),r.clientSecret??(r.clientSecret=e[`AUTH_${i}_SECRET`]),"oidc"===r.type&&(r.issuer??(r.issuer=e[`AUTH_${i}_ISSUER`]))):"email"===r.type&&(r.apiKey??(r.apiKey=e[`AUTH_${i}_KEY`])),r})}(process.env,e)}}var lj=r(4352),lL=r(5662);r(9475),r(4532);var lD=r(4421);let lM=(0,lD.D)(String.raw`/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/hooks-client-context.shared-runtime.js`),{__esModule:lU,$$typeof:lq}=lM;lM.default,(0,lD.D)(String.raw`/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/hooks-client-context.shared-runtime.js#SearchParamsContext`),(0,lD.D)(String.raw`/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/hooks-client-context.shared-runtime.js#PathnameContext`),(0,lD.D)(String.raw`/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/hooks-client-context.shared-runtime.js#PathParamsContext`);let lQ=(0,lD.D)(String.raw`/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/server-inserted-html.shared-runtime.js`),{__esModule:lB,$$typeof:lH}=lQ;lQ.default,(0,lD.D)(String.raw`/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/server-inserted-html.shared-runtime.js#ServerInsertedHTMLContext`),(0,lD.D)(String.raw`/Users/dhravyashah/Documents/code/anycontext/node_modules/next/dist/esm/shared/lib/server-inserted-html.shared-runtime.js#useServerInsertedHTML`);var lK=r(6674);Symbol("internal for urlsearchparams readonly");async function lF(e,t={},r,i){let n=new Headers((0,lj.A)()),{redirect:s=!0,redirectTo:a,...o}=t instanceof FormData?Object.fromEntries(t):t,l=a?.toString()??n.get("Referer")??"/",u=lz("signin",n,i.basePath);if(!e)return u.searchParams.append("callbackUrl",l),s&&(0,lK.uX)(u.toString()),u.toString();let c=`${u}/${e}?${new URLSearchParams(r)}`,d={};for(let t of i.providers){let{options:r,...i}="function"==typeof t?t():t,n=r?.id??i.id;if(n===e){d={id:n,type:r?.type??i.type};break}}if(!d.id){let e=`${u}?${new URLSearchParams({callbackUrl:l})}`;return s&&(0,lK.uX)(e),e}"credentials"===d.type&&(c=c.replace("signin","callback")),n.set("Content-Type","application/x-www-form-urlencoded");let h=new URLSearchParams({...o,callbackUrl:l}),p=new Request(c,{method:"POST",headers:n,body:h}),f=await l$(p,{...i,raw:lP,skipCSRFCheck:lO});for(let e of f?.cookies??[])(0,lj.Qk)().set(e.name,e.value,e.options);return s?(0,lK.uX)(f.redirect):f.redirect}async function lV(e,t){let r=new Headers((0,lj.A)());r.set("Content-Type","application/x-www-form-urlencoded");let i=lz("signout",r,t.basePath),n=e?.redirectTo??r.get("Referer")??"/",s=new URLSearchParams({callbackUrl:n}),a=new Request(i,{method:"POST",headers:r,body:s}),o=await l$(a,{...t,raw:lP,skipCSRFCheck:lO});for(let e of o?.cookies??[])(0,lj.Qk)().set(e.name,e.value,e.options);return e?.redirect??!0?(0,lK.uX)(o.redirect):o}async function lW(e,t){let r=new Headers((0,lj.A)());r.set("Content-Type","application/json");let i=lz("session",r,t.basePath),n=JSON.stringify({data:e}),s=new Request(i,{method:"POST",headers:r,body:n}),a=await l$(s,{...t,raw:lP,skipCSRFCheck:lO});for(let e of a?.cookies??[])(0,lj.Qk)().set(e.name,e.value,e.options);return a.body}function lz(e,t,r){let i=process.env.AUTH_URL??process.env.NEXTAUTH_URL;if(i){let{origin:t,pathname:r}=new URL(i),n=r.endsWith("/")?"":"/";return new URL(`${t}${r}${n}${e}`)}let n=t.get("x-forwarded-host")??t.get("host"),s="http"===t.get("x-forwarded-proto")?"http":"https",{origin:a,pathname:o}=new URL(r,`${s}://${n}`),l=o.endsWith("/")?"":"/";return new URL(`${a}${o}${l}${e}`)}async function lJ(e,t){let r=lz("session",e,t.basePath);return l$(new Request(r,{headers:{cookie:e.get("cookie")??""}}),{...t,callbacks:{...t.callbacks,async session(...e){let r=await t.callbacks?.session?.(...e)??{...e[0].session,expires:e[0].session.expires?.toISOString?.()??e[0].session.expires};return{user:e[0].user??e[0].token,...r}}}})}function lZ(e){return"function"==typeof e}function lG(e,t){return"function"==typeof e?(...r)=>{if(!r.length){let r=(0,lj.A)(),i=e(void 0);return t?.(i),lJ(r,i).then(e=>e.json())}if(r[0]instanceof Request){let i=r[0],n=r[1],s=e(i);return t?.(s),lX([i,n],s)}if(lZ(r[0])){let t=r[0];return async(...r)=>lX(r,e(r[0]),t)}let i="req"in r[0]?r[0].req:r[0],n="res"in r[0]?r[0].res:r[1],s=e(i);return t?.(s),lJ(new Headers(i.headers),s).then(async e=>{let t=await e.json();for(let t of e.headers.getSetCookie())n.headers.append("set-cookie",t);return t})}:(...t)=>{if(!t.length)return lJ((0,lj.A)(),e).then(e=>e.json());if(t[0]instanceof Request)return lX([t[0],t[1]],e);if(lZ(t[0])){let r=t[0];return async(...t)=>lX(t,e,r).then(e=>e)}let r="req"in t[0]?t[0].req:t[0],i="res"in t[0]?t[0].res:t[1];return lJ(new Headers(r.headers),e).then(async e=>{let t=await e.json();for(let t of e.headers.getSetCookie())i.headers.append("set-cookie",t);return t})}}async function lX(e,t,r){let i=lR(e[0]),n=await lJ(i.headers,t),s=await n.json(),a=!0;t.callbacks?.authorized&&(a=await t.callbacks.authorized({request:i,auth:s}));let o=lL.Z.next?.();if(a instanceof Response){o=a;let e=a.headers.get("Location"),{pathname:r}=i.nextUrl;e&&function(e,t,r){let i=t.replace(`${e}/`,""),n=Object.values(r.pages??{});return(lY.has(i)||n.includes(t))&&t===e}(r,new URL(e).pathname,t)&&(a=!0)}else if(r)i.auth=s,o=await r(i,e[1])??lL.Z.next();else if(!a){let e=t.pages?.signIn??`${t.basePath}/signin`;if(i.nextUrl.pathname!==e){let t=i.nextUrl.clone();t.pathname=e,t.searchParams.set("callbackUrl",i.nextUrl.href),o=lL.Z.redirect(t)}}let l=new Response(o?.body,o);for(let e of n.headers.getSetCookie())l.headers.append("set-cookie",e);return l}Symbol.iterator;let lY=new Set(["providers","session","csrf","signin","signout","callback","verify-request","error"]);var l0=r(8594),l1=r(4680);let{handlers:{GET:l6,POST:l2},auth:l4}=function(e){if("function"==typeof e){let t=t=>{let r=e(t);return lI(r),l$(lR(t),r)};return{handlers:{GET:t,POST:t},auth:lG(e,e=>lI(e)),signIn:(t,r,i)=>{let n=e(void 0);return lI(n),lF(t,r,i,n)},signOut:t=>{let r=e(void 0);return lI(r),lV(t,r)},unstable_update:t=>{let r=e(void 0);return lI(r),lW(t,r)}}}lI(e);let t=t=>l$(lR(t),e);return{handlers:{GET:t,POST:t},auth:lG(e),signIn:(t,r,i)=>lF(t,r,i,e),signOut:t=>lV(t,e),unstable_update:t=>lW(t,e)}}({secret:te.NEXTAUTH_SECRET,callbacks:{session:({session:e,token:t})=>({...e,user:{...e.user,id:t.id,token:t}})},adapter:function(e,t){if((0,tt.is)(e,tZ))return function(e,t=tg){let{users:r,accounts:i,sessions:n,verificationTokens:s}=function(e){let t=e("user",{id:rz("id",{length:255}).notNull().primaryKey(),name:rz("name",{length:255}),email:rz("email",{length:255}).notNull(),emailVerified:r1("emailVerified",{mode:"date",fsp:3}).defaultNow(),image:rz("image",{length:255})}),r=e("account",{userId:rz("userId",{length:255}).notNull().references(()=>t.id,{onDelete:"cascade"}),type:rz("type",{length:255}).$type().notNull(),provider:rz("provider",{length:255}).notNull(),providerAccountId:rz("providerAccountId",{length:255}).notNull(),refresh_token:rz("refresh_token",{length:255}),access_token:rz("access_token",{length:255}),expires_at:new r6("expires_at",void 0),token_type:rz("token_type",{length:255}),scope:rz("scope",{length:255}),id_token:rz("id_token",{length:255}),session_state:rz("session_state",{length:255})},e=>({compoundKey:r4(e.provider,e.providerAccountId)})),i=e("session",{sessionToken:rz("sessionToken",{length:255}).notNull().primaryKey(),userId:rz("userId",{length:255}).notNull().references(()=>t.id,{onDelete:"cascade"}),expires:r1("expires",{mode:"date"}).notNull()});return{users:t,accounts:r,sessions:i,verificationTokens:e("verificationToken",{identifier:rz("identifier",{length:255}).notNull(),token:rz("token",{length:255}).notNull(),expires:r1("expires",{mode:"date"}).notNull()},e=>({compoundKey:r4(e.identifier,e.token)}))}}(t);return{async createUser(t){let i=crypto.randomUUID();return await e.insert(r).values({...t,id:i}),await e.select().from(r).where((0,td.eq)(r.id,i)).then(e=>e[0])},getUser:async t=>await e.select().from(r).where((0,td.eq)(r.id,t)).then(e=>e[0])??null,getUserByEmail:async t=>await e.select().from(r).where((0,td.eq)(r.email,t)).then(e=>e[0])??null,createSession:async t=>(await e.insert(n).values(t),await e.select().from(n).where((0,td.eq)(n.sessionToken,t.sessionToken)).then(e=>e[0])),getSessionAndUser:async t=>await e.select({session:n,user:r}).from(n).where((0,td.eq)(n.sessionToken,t)).innerJoin(r,(0,td.eq)(r.id,n.userId)).then(e=>e[0])??null,async updateUser(t){if(!t.id)throw Error("No user id.");return await e.update(r).set(t).where((0,td.eq)(r.id,t.id)),await e.select().from(r).where((0,td.eq)(r.id,t.id)).then(e=>e[0])},updateSession:async t=>(await e.update(n).set(t).where((0,td.eq)(n.sessionToken,t.sessionToken)),await e.select().from(n).where((0,td.eq)(n.sessionToken,t.sessionToken)).then(e=>e[0])),async linkAccount(t){await e.insert(i).values(t)},async getUserByAccount(t){let n=await e.select().from(i).where((0,td.xD)((0,td.eq)(i.providerAccountId,t.providerAccountId),(0,td.eq)(i.provider,t.provider))).leftJoin(r,(0,td.eq)(i.userId,r.id)).then(e=>e[0])??null;return n?n.user:null},async deleteSession(t){let r=await e.select().from(n).where((0,td.eq)(n.sessionToken,t)).then(e=>e[0])??null;return await e.delete(n).where((0,td.eq)(n.sessionToken,t)),r},createVerificationToken:async t=>(await e.insert(s).values(t),await e.select().from(s).where((0,td.eq)(s.identifier,t.identifier)).then(e=>e[0])),async useVerificationToken(t){try{let r=await e.select().from(s).where((0,td.xD)((0,td.eq)(s.identifier,t.identifier),(0,td.eq)(s.token,t.token))).then(e=>e[0])??null;return await e.delete(s).where((0,td.xD)((0,td.eq)(s.identifier,t.identifier),(0,td.eq)(s.token,t.token))),r}catch(e){throw Error("No verification token found.")}},async deleteUser(t){let i=await e.select().from(r).where((0,td.eq)(r.id,t)).then(e=>e[0]??null);return await e.delete(r).where((0,td.eq)(r.id,t)),i},async unlinkAccount(t){await e.delete(i).where((0,td.xD)((0,td.eq)(i.providerAccountId,t.providerAccountId),(0,td.eq)(i.provider,t.provider)))}}}(e,t);if((0,tt.is)(e,rK))return function(e,t=tG.af){let{users:r,accounts:i,sessions:n,verificationTokens:s}=function(e){let t=e("user",{id:r7("id").notNull().primaryKey(),name:r7("name"),email:r7("email").notNull(),emailVerified:rp("emailVerified",{mode:"date"}),image:r7("image")}),r=e("account",{userId:r7("userId").notNull().references(()=>t.id,{onDelete:"cascade"}),type:r7("type").$type().notNull(),provider:r7("provider").notNull(),providerAccountId:r7("providerAccountId").notNull(),refresh_token:r7("refresh_token"),access_token:r7("access_token"),expires_at:new ie("expires_at"),token_type:r7("token_type"),scope:r7("scope"),id_token:r7("id_token"),session_state:r7("session_state")},e=>({compoundKey:(0,ir.CK)(e.provider,e.providerAccountId)})),i=e("session",{sessionToken:r7("sessionToken").notNull().primaryKey(),userId:r7("userId").notNull().references(()=>t.id,{onDelete:"cascade"}),expires:rp("expires",{mode:"date"}).notNull()});return{users:t,accounts:r,sessions:i,verificationTokens:e("verificationToken",{identifier:r7("identifier").notNull(),token:r7("token").notNull(),expires:rp("expires",{mode:"date"}).notNull()},e=>({compoundKey:(0,ir.CK)(e.identifier,e.token)}))}}(t);return{createUser:async t=>await e.insert(r).values({...t,id:crypto.randomUUID()}).returning().then(e=>e[0]??null),getUser:async t=>await e.select().from(r).where((0,td.eq)(r.id,t)).then(e=>e[0]??null),getUserByEmail:async t=>await e.select().from(r).where((0,td.eq)(r.email,t)).then(e=>e[0]??null),createSession:async t=>await e.insert(n).values(t).returning().then(e=>e[0]),getSessionAndUser:async t=>await e.select({session:n,user:r}).from(n).where((0,td.eq)(n.sessionToken,t)).innerJoin(r,(0,td.eq)(r.id,n.userId)).then(e=>e[0]??null),async updateUser(t){if(!t.id)throw Error("No user id.");return await e.update(r).set(t).where((0,td.eq)(r.id,t.id)).returning().then(e=>e[0])},updateSession:async t=>await e.update(n).set(t).where((0,td.eq)(n.sessionToken,t.sessionToken)).returning().then(e=>e[0]),linkAccount:async t=>ii(await e.insert(i).values(t).returning().then(e=>e[0])),async getUserByAccount(t){let n=await e.select().from(i).where((0,td.xD)((0,td.eq)(i.providerAccountId,t.providerAccountId),(0,td.eq)(i.provider,t.provider))).leftJoin(r,(0,td.eq)(i.userId,r.id)).then(e=>e[0])??null;return n?.user??null},deleteSession:async t=>await e.delete(n).where((0,td.eq)(n.sessionToken,t)).returning().then(e=>e[0]??null),createVerificationToken:async t=>await e.insert(s).values(t).returning().then(e=>e[0]),async useVerificationToken(t){try{return await e.delete(s).where((0,td.xD)((0,td.eq)(s.identifier,t.identifier),(0,td.eq)(s.token,t.token))).returning().then(e=>e[0]??null)}catch(e){throw Error("No verification token found.")}},async deleteUser(t){await e.delete(r).where((0,td.eq)(r.id,t)).returning().then(e=>e[0]??null)},async unlinkAccount(t){let{type:r,provider:n,providerAccountId:s,userId:a}=await e.delete(i).where((0,td.xD)((0,td.eq)(i.providerAccountId,t.providerAccountId),(0,td.eq)(i.provider,t.provider))).returning().then(e=>e[0]??null);return{provider:n,type:r,providerAccountId:s,userId:a}}}}(e,t);if((0,tt.is)(e,rF.z))return function(e,t=il.Px){let{users:r,accounts:i,sessions:n,verificationTokens:s}=function(e){let t=e("user",{id:(0,is.fL)("id").notNull().primaryKey(),name:(0,is.fL)("name"),email:(0,is.fL)("email").notNull(),emailVerified:(0,ia._L)("emailVerified",{mode:"timestamp_ms"}),image:(0,is.fL)("image")}),r=e("account",{userId:(0,is.fL)("userId").notNull().references(()=>t.id,{onDelete:"cascade"}),type:(0,is.fL)("type").$type().notNull(),provider:(0,is.fL)("provider").notNull(),providerAccountId:(0,is.fL)("providerAccountId").notNull(),refresh_token:(0,is.fL)("refresh_token"),access_token:(0,is.fL)("access_token"),expires_at:(0,ia._L)("expires_at"),token_type:(0,is.fL)("token_type"),scope:(0,is.fL)("scope"),id_token:(0,is.fL)("id_token"),session_state:(0,is.fL)("session_state")},e=>({compoundKey:(0,io.CK)(e.provider,e.providerAccountId)})),i=e("session",{sessionToken:(0,is.fL)("sessionToken").notNull().primaryKey(),userId:(0,is.fL)("userId").notNull().references(()=>t.id,{onDelete:"cascade"}),expires:(0,ia._L)("expires",{mode:"timestamp_ms"}).notNull()});return{users:t,accounts:r,sessions:i,verificationTokens:e("verificationToken",{identifier:(0,is.fL)("identifier").notNull(),token:(0,is.fL)("token").notNull(),expires:(0,ia._L)("expires",{mode:"timestamp_ms"}).notNull()},e=>({compoundKey:(0,io.CK)(e.identifier,e.token)}))}}(t);return{createUser:async t=>await e.insert(r).values({...t,id:crypto.randomUUID()}).returning().get(),getUser:async t=>await e.select().from(r).where((0,td.eq)(r.id,t)).get()??null,getUserByEmail:async t=>await e.select().from(r).where((0,td.eq)(r.email,t)).get()??null,createSession:t=>e.insert(n).values(t).returning().get(),getSessionAndUser:async t=>await e.select({session:n,user:r}).from(n).where((0,td.eq)(n.sessionToken,t)).innerJoin(r,(0,td.eq)(r.id,n.userId)).get()??null,async updateUser(t){if(!t.id)throw Error("No user id.");return await e.update(r).set(t).where((0,td.eq)(r.id,t.id)).returning().get()??null},updateSession:async t=>await e.update(n).set(t).where((0,td.eq)(n.sessionToken,t.sessionToken)).returning().get()??null,linkAccount:async t=>ii(await e.insert(i).values(t).returning().get()),async getUserByAccount(t){let n=await e.select().from(i).leftJoin(r,(0,td.eq)(r.id,i.userId)).where((0,td.xD)((0,td.eq)(i.provider,t.provider),(0,td.eq)(i.providerAccountId,t.providerAccountId))).get();return n?Promise.resolve(n).then(e=>e.user):null},deleteSession:async t=>await e.delete(n).where((0,td.eq)(n.sessionToken,t)).returning().get()??null,createVerificationToken:async t=>await e.insert(s).values(t).returning().get()??null,async useVerificationToken(t){try{return await e.delete(s).where((0,td.xD)((0,td.eq)(s.identifier,t.identifier),(0,td.eq)(s.token,t.token))).returning().get()??null}catch(e){throw Error("No verification token found.")}},deleteUser:async t=>await e.delete(r).where((0,td.eq)(r.id,t)).returning().get()??null,async unlinkAccount(t){await e.delete(i).where((0,td.xD)((0,td.eq)(i.providerAccountId,t.providerAccountId),(0,td.eq)(i.provider,t.provider))).run()}}}(e,t);throw Error(`Unsupported database type (${typeof e}) in Auth.js Drizzle adapter.`)}(l0.db,l1.createTable),providers:[{id:"google",name:"Google",type:"oidc",issuer:"https://accounts.google.com",style:{logo:"/google.svg",bg:"#fff",text:"#000"},options:{clientId:te.GOOGLE_CLIENT_ID,clientSecret:te.GOOGLE_CLIENT_SECRET,authorization:{params:{prompt:"consent",response_type:"code"}}}}]}),l5="edge",l3=new c.AppRouteRouteModule({definition:{kind:d.x.APP_ROUTE,page:"/api/auth/[...nextauth]/route",pathname:"/api/auth/[...nextauth]",filename:"route",bundlePath:"app/api/auth/[...nextauth]/route"},resolvedPagePath:"/Users/dhravyashah/Documents/code/anycontext/apps/web/src/app/api/auth/[...nextauth]/route.ts",nextConfigOutput:"",userland:o}),{requestAsyncStorage:l8,staticGenerationAsyncStorage:l9,serverHooks:l7,headerHooks:ue,staticGenerationBailout:ut}=l3,ur="/api/auth/[...nextauth]/route";function ui(){return(0,h.XH)({serverHooks:l7,staticGenerationAsyncStorage:l9})}let un=l,us=u.a.wrap(l3)},8594:(e,t,r)=>{"use strict";r.d(t,{db:()=>k});var i=r(2209);class n{static{this[i.Q]="ConsoleLogWriter"}write(e){console.log(e)}}class s{static{this[i.Q]="DefaultLogger"}constructor(e){this.writer=e?.writer??new n}logQuery(e,t){let r=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),i=r.length?` -- params: [${r.join(", ")}]`:"";this.writer.write(`Query: ${e}${i}`)}}class a{static{this[i.Q]="NoopLogger"}logQuery(){}}var o=r(2801),l=r(4078),u=r(2350),c=r(5469),d=r(2688),h=r(130);class p extends h.N{constructor(e){super(),this.resultCb=e}static{this[i.Q]="ExecuteResultSync"}async execute(){return this.resultCb()}sync(){return this.resultCb()}}class f{constructor(e,t,r){this.mode=e,this.executeMethod=t,this.query=r}static{this[i.Q]="PreparedQuery"}getQuery(){return this.query}mapRunResult(e,t){return e}mapAllResult(e,t){throw Error("Not implemented")}mapGetResult(e,t){throw Error("Not implemented")}execute(e){return"async"===this.mode?this[this.executeMethod](e):new p(()=>this[this.executeMethod](e))}mapResult(e,t){switch(this.executeMethod){case"run":return this.mapRunResult(e,t);case"all":return this.mapAllResult(e,t);case"get":return this.mapGetResult(e,t)}}}class m{constructor(e){this.dialect=e}static{this[i.Q]="SQLiteSession"}prepareOneTimeQuery(e,t,r){return this.prepareQuery(e,t,r)}run(e){let t=this.dialect.sqlToQuery(e);try{return this.prepareOneTimeQuery(t,void 0,"run").run()}catch(e){throw new d.k({cause:e,message:`Failed to run the query '${t.sql}'`})}}extractRawRunValueFromBatchResult(e){return e}all(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run").all()}extractRawAllValueFromBatchResult(e){throw Error("Not implemented")}get(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run").get()}extractRawGetValueFromBatchResult(e){throw Error("Not implemented")}values(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run").values()}extractRawValuesValueFromBatchResult(e){throw Error("Not implemented")}}class g extends l.z{constructor(e,t,r,i,n=0){super(e,t,r,i),this.schema=i,this.nestedIndex=n}static{this[i.Q]="SQLiteTransaction"}rollback(){throw new d.F}}var y=r(753);class v extends m{constructor(e,t,r,i={}){super(t),this.client=e,this.schema=r,this.options=i,this.logger=i.logger??new a}static{this[i.Q]="SQLiteD1Session"}prepareQuery(e,t,r,i){return new _(this.client.prepare(e.sql),e,this.logger,t,r,i)}async batch(e){let t=[],r=[];for(let i of e){let e=i._prepare(),n=e.getQuery();if(t.push(e),n.params.length>0)r.push(e.stmt.bind(...n.params));else{let t=e.getQuery();r.push(this.client.prepare(t.sql).bind(...t.params))}}return(await this.client.batch(r)).map((e,r)=>t[r].mapResult(e,!0))}extractRawAllValueFromBatchResult(e){return e.results}extractRawGetValueFromBatchResult(e){return e.results[0]}extractRawValuesValueFromBatchResult(e){return w(e.results)}async transaction(e,t){let r=new b("async",this.dialect,this,this.schema);await this.run(c.i6.raw(`begin${t?.behavior?" "+t.behavior:""}`));try{let t=await e(r);return await this.run(c.i6`commit`),t}catch(e){throw await this.run(c.i6`rollback`),e}}}class b extends g{static{this[i.Q]="D1Transaction"}async transaction(e){let t=`sp${this.nestedIndex}`,r=new b("async",this.dialect,this.session,this.schema,this.nestedIndex+1);await this.session.run(c.i6.raw(`savepoint ${t}`));try{let i=await e(r);return await this.session.run(c.i6.raw(`release savepoint ${t}`)),i}catch(e){throw await this.session.run(c.i6.raw(`rollback to savepoint ${t}`)),e}}}function w(e){let t=[];for(let r of e){let e=Object.keys(r).map(e=>r[e]);t.push(e)}return t}class _ extends f{constructor(e,t,r,i,n,s){super("async",n,t),this.logger=r,this.customResultMapper=s,this.fields=i,this.stmt=e}static{this[i.Q]="D1PreparedQuery"}run(e){let t=(0,c.Pr)(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),this.stmt.bind(...t).run()}async all(e){let{fields:t,query:r,logger:i,stmt:n,customResultMapper:s}=this;if(!t&&!s){let t=(0,c.Pr)(r.params,e??{});return i.logQuery(r.sql,t),n.bind(...t).all().then(({results:e})=>this.mapAllResult(e))}let a=await this.values(e);return this.mapAllResult(a)}mapAllResult(e,t){return(t&&(e=w(e.results)),this.fields||this.customResultMapper)?this.customResultMapper?this.customResultMapper(e):e.map(e=>(0,y.M4)(this.fields,e,this.joinsNotNullableMap)):e}async get(e){let{fields:t,joinsNotNullableMap:r,query:i,logger:n,stmt:s,customResultMapper:a}=this;if(!t&&!a){let t=(0,c.Pr)(i.params,e??{});return n.logQuery(i.sql,t),s.bind(...t).all().then(({results:e})=>e[0])}let o=await this.values(e);return o[0]?a?a(o):(0,y.M4)(t,o[0],r):void 0}mapGetResult(e,t){return(t&&(e=w(e.results)[0]),this.fields||this.customResultMapper)?this.customResultMapper?this.customResultMapper([e]):(0,y.M4)(this.fields,e,this.joinsNotNullableMap):e}values(e){let t=(0,c.Pr)(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),this.stmt.bind(...t).raw()}}class S extends l.z{static{this[i.Q]="LibSQLDatabase"}async batch(e){return this.session.batch(e)}}var x=r(4680);let k=function(e,t={}){let r,i;let n=new u.Oz;if(!0===t.logger?r=new s:!1!==t.logger&&(r=t.logger),t.schema){let e=(0,o.pb)(t.schema,o._J);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new v(e,n,i,{logger:r});return new S("async",n,a,i)}(process.env.D1Database,{schema:x})},4680:(e,t,r)=>{"use strict";r.r(t),r.d(t,{accounts:()=>v,accountsRelations:()=>b,createTable:()=>f,posts:()=>m,sessions:()=>w,sessionsRelations:()=>_,users:()=>g,usersRelations:()=>y,verificationTokens:()=>S});var i=r(5469),n=r(2801),s=r(5315),a=r(2404),o=r(1701),l=r(2209);class u{constructor(e,t){this.name=e,this.unique=t}static{this[l.Q]="SQLiteIndexBuilderOn"}on(...e){return new c(this.name,e,this.unique)}}class c{static{this[l.Q]="SQLiteIndexBuilder"}constructor(e,t,r){this.config={name:e,columns:t,unique:r,where:void 0}}where(e){return this.config.where=e,this}build(e){return new d(this.config,e)}}class d{static{this[l.Q]="SQLiteIndex"}constructor(e,t){this.config={...e,table:t}}}function h(e){return new u(e,!1)}var p=r(9352);let f=(0,s._9)(e=>`anycontext_${e}`),m=f("post",{id:(0,a.e$)("id",{mode:"number"}).primaryKey({autoIncrement:!0}),name:(0,o.fL)("name",{length:256}),createdById:(0,o.fL)("createdById",{length:255}).notNull().references(()=>g.id),createdAt:(0,a.e$)("created_at",{mode:"timestamp"}).default(i.i6`CURRENT_TIMESTAMP`).notNull(),updatedAt:(0,a.e$)("updatedAt",{mode:"timestamp"})},e=>({createdByIdIdx:h("createdById_idx").on(e.createdById),nameIndex:h("name_idx").on(e.name)})),g=f("user",{id:(0,o.fL)("id",{length:255}).notNull().primaryKey(),name:(0,o.fL)("name",{length:255}),email:(0,o.fL)("email",{length:255}).notNull(),emailVerified:(0,a.e$)("emailVerified",{mode:"timestamp"}).default(i.i6`CURRENT_TIMESTAMP`),image:(0,o.fL)("image",{length:255})}),y=(0,n.lE)(g,({many:e})=>({accounts:e(v)})),v=f("account",{userId:(0,o.fL)("userId",{length:255}).notNull().references(()=>g.id),type:(0,o.fL)("type",{length:255}).$type().notNull(),provider:(0,o.fL)("provider",{length:255}).notNull(),providerAccountId:(0,o.fL)("providerAccountId",{length:255}).notNull(),refresh_token:(0,o.fL)("refresh_token"),access_token:(0,o.fL)("access_token"),expires_at:(0,a.e$)("expires_at"),token_type:(0,o.fL)("token_type",{length:255}),scope:(0,o.fL)("scope",{length:255}),id_token:(0,o.fL)("id_token"),session_state:(0,o.fL)("session_state",{length:255})},e=>({compoundKey:(0,p.CK)({columns:[e.provider,e.providerAccountId]}),userIdIdx:h("account_userId_idx").on(e.userId)})),b=(0,n.lE)(v,({one:e})=>({user:e(g,{fields:[v.userId],references:[g.id]})})),w=f("session",{sessionToken:(0,o.fL)("sessionToken",{length:255}).notNull().primaryKey(),userId:(0,o.fL)("userId",{length:255}).notNull().references(()=>g.id),expires:(0,a.e$)("expires",{mode:"timestamp"}).notNull()},e=>({userIdIdx:h("session_userId_idx").on(e.userId)})),_=(0,n.lE)(w,({one:e})=>({user:e(g,{fields:[w.userId],references:[g.id]})})),S=f("verificationToken",{identifier:(0,o.fL)("identifier",{length:255}).notNull(),token:(0,o.fL)("token",{length:255}).notNull(),expires:(0,a.e$)("expires",{mode:"timestamp"}).notNull()},e=>({compoundKey:(0,p.CK)({columns:[e.identifier,e.token]})}))},6076:(e,t)=>{"use strict";/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
- */t.parse=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},i=(t||{}).decode||n,o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cryptoRuntime=t.base64url=t.generateSecret=t.generateKeyPair=t.errors=t.decodeJwt=t.decodeProtectedHeader=t.importJWK=t.importX509=t.importPKCS8=t.importSPKI=t.exportJWK=t.exportSPKI=t.exportPKCS8=t.UnsecuredJWT=t.createRemoteJWKSet=t.createLocalJWKSet=t.EmbeddedJWK=t.calculateJwkThumbprintUri=t.calculateJwkThumbprint=t.EncryptJWT=t.SignJWT=t.GeneralSign=t.FlattenedSign=t.CompactSign=t.FlattenedEncrypt=t.CompactEncrypt=t.jwtDecrypt=t.jwtVerify=t.generalVerify=t.flattenedVerify=t.compactVerify=t.GeneralEncrypt=t.generalDecrypt=t.flattenedDecrypt=t.compactDecrypt=void 0;var i=r(1222);Object.defineProperty(t,"compactDecrypt",{enumerable:!0,get:function(){return i.compactDecrypt}});var n=r(1531);Object.defineProperty(t,"flattenedDecrypt",{enumerable:!0,get:function(){return n.flattenedDecrypt}});var o=r(658);Object.defineProperty(t,"generalDecrypt",{enumerable:!0,get:function(){return o.generalDecrypt}});var s=r(4186);Object.defineProperty(t,"GeneralEncrypt",{enumerable:!0,get:function(){return s.GeneralEncrypt}});var a=r(9751);Object.defineProperty(t,"compactVerify",{enumerable:!0,get:function(){return a.compactVerify}});var l=r(1330);Object.defineProperty(t,"flattenedVerify",{enumerable:!0,get:function(){return l.flattenedVerify}});var c=r(2553);Object.defineProperty(t,"generalVerify",{enumerable:!0,get:function(){return c.generalVerify}});var u=r(913);Object.defineProperty(t,"jwtVerify",{enumerable:!0,get:function(){return u.jwtVerify}});var d=r(3621);Object.defineProperty(t,"jwtDecrypt",{enumerable:!0,get:function(){return d.jwtDecrypt}});var h=r(8369);Object.defineProperty(t,"CompactEncrypt",{enumerable:!0,get:function(){return h.CompactEncrypt}});var p=r(210);Object.defineProperty(t,"FlattenedEncrypt",{enumerable:!0,get:function(){return p.FlattenedEncrypt}});var f=r(524);Object.defineProperty(t,"CompactSign",{enumerable:!0,get:function(){return f.CompactSign}});var y=r(9988);Object.defineProperty(t,"FlattenedSign",{enumerable:!0,get:function(){return y.FlattenedSign}});var g=r(6755);Object.defineProperty(t,"GeneralSign",{enumerable:!0,get:function(){return g.GeneralSign}});var m=r(9252);Object.defineProperty(t,"SignJWT",{enumerable:!0,get:function(){return m.SignJWT}});var _=r(8255);Object.defineProperty(t,"EncryptJWT",{enumerable:!0,get:function(){return _.EncryptJWT}});var v=r(5811);Object.defineProperty(t,"calculateJwkThumbprint",{enumerable:!0,get:function(){return v.calculateJwkThumbprint}}),Object.defineProperty(t,"calculateJwkThumbprintUri",{enumerable:!0,get:function(){return v.calculateJwkThumbprintUri}});var w=r(4191);Object.defineProperty(t,"EmbeddedJWK",{enumerable:!0,get:function(){return w.EmbeddedJWK}});var b=r(8085);Object.defineProperty(t,"createLocalJWKSet",{enumerable:!0,get:function(){return b.createLocalJWKSet}});var S=r(6190);Object.defineProperty(t,"createRemoteJWKSet",{enumerable:!0,get:function(){return S.createRemoteJWKSet}});var k=r(9752);Object.defineProperty(t,"UnsecuredJWT",{enumerable:!0,get:function(){return k.UnsecuredJWT}});var E=r(510);Object.defineProperty(t,"exportPKCS8",{enumerable:!0,get:function(){return E.exportPKCS8}}),Object.defineProperty(t,"exportSPKI",{enumerable:!0,get:function(){return E.exportSPKI}}),Object.defineProperty(t,"exportJWK",{enumerable:!0,get:function(){return E.exportJWK}});var A=r(7989);Object.defineProperty(t,"importSPKI",{enumerable:!0,get:function(){return A.importSPKI}}),Object.defineProperty(t,"importPKCS8",{enumerable:!0,get:function(){return A.importPKCS8}}),Object.defineProperty(t,"importX509",{enumerable:!0,get:function(){return A.importX509}}),Object.defineProperty(t,"importJWK",{enumerable:!0,get:function(){return A.importJWK}});var x=r(9472);Object.defineProperty(t,"decodeProtectedHeader",{enumerable:!0,get:function(){return x.decodeProtectedHeader}});var O=r(9541);Object.defineProperty(t,"decodeJwt",{enumerable:!0,get:function(){return O.decodeJwt}}),t.errors=r(3885);var T=r(1399);Object.defineProperty(t,"generateKeyPair",{enumerable:!0,get:function(){return T.generateKeyPair}});var P=r(8259);Object.defineProperty(t,"generateSecret",{enumerable:!0,get:function(){return P.generateSecret}}),t.base64url=r(3225);var j=r(6537);Object.defineProperty(t,"cryptoRuntime",{enumerable:!0,get:function(){return j.default}})},1222:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactDecrypt=void 0;let i=r(1531),n=r(3885),o=r(3004);async function s(e,t,r){if(e instanceof Uint8Array&&(e=o.decoder.decode(e)),"string"!=typeof e)throw new n.JWEInvalid("Compact JWE must be a string or Uint8Array");let{0:s,1:a,2:l,3:c,4:u,length:d}=e.split(".");if(5!==d)throw new n.JWEInvalid("Invalid Compact JWE");let h=await (0,i.flattenedDecrypt)({ciphertext:c,iv:l||void 0,protected:s||void 0,tag:u||void 0,encrypted_key:a||void 0},t,r),p={plaintext:h.plaintext,protectedHeader:h.protectedHeader};return"function"==typeof t?{...p,key:h.key}:p}t.compactDecrypt=s},8369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompactEncrypt=void 0;let i=r(210);class n{constructor(e){this._flattened=new i.FlattenedEncrypt(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}t.CompactEncrypt=n},1531:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenedDecrypt=void 0;let i=r(5803),n=r(7287),o=r(4652),s=r(3885),a=r(7944),l=r(8906),c=r(3682),u=r(3004),d=r(2794),h=r(9277),p=r(2561);async function f(e,t,r){var f;let y,g,m,_,v,w,b;if(!(0,l.default)(e))throw new s.JWEInvalid("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new s.JWEInvalid("JOSE Header missing");if("string"!=typeof e.iv)throw new s.JWEInvalid("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new s.JWEInvalid("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new s.JWEInvalid("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new s.JWEInvalid("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new s.JWEInvalid("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new s.JWEInvalid("JWE AAD incorrect type");if(void 0!==e.header&&!(0,l.default)(e.header))throw new s.JWEInvalid("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!(0,l.default)(e.unprotected))throw new s.JWEInvalid("JWE Per-Recipient Unprotected Header incorrect type");if(e.protected)try{let t=(0,i.decode)(e.protected);y=JSON.parse(u.decoder.decode(t))}catch{throw new s.JWEInvalid("JWE Protected Header is invalid")}if(!(0,a.default)(y,e.header,e.unprotected))throw new s.JWEInvalid("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let S={...y,...e.header,...e.unprotected};if((0,h.default)(s.JWEInvalid,new Map,null==r?void 0:r.crit,y,S),void 0!==S.zip){if(!y||!y.zip)throw new s.JWEInvalid('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==S.zip)throw new s.JOSENotSupported('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}let{alg:k,enc:E}=S;if("string"!=typeof k||!k)throw new s.JWEInvalid("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof E||!E)throw new s.JWEInvalid("missing JWE Encryption Algorithm (enc) in JWE Header");let A=r&&(0,p.default)("keyManagementAlgorithms",r.keyManagementAlgorithms),x=r&&(0,p.default)("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(A&&!A.has(k))throw new s.JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter not allowed');if(x&&!x.has(E))throw new s.JOSEAlgNotAllowed('"enc" (Encryption Algorithm) Header Parameter not allowed');if(void 0!==e.encrypted_key)try{g=(0,i.decode)(e.encrypted_key)}catch{throw new s.JWEInvalid("Failed to base64url decode the encrypted_key")}let O=!1;"function"==typeof t&&(t=await t(y,e),O=!0);try{m=await (0,c.default)(k,t,g,S,r)}catch(e){if(e instanceof TypeError||e instanceof s.JWEInvalid||e instanceof s.JOSENotSupported)throw e;m=(0,d.default)(E)}try{_=(0,i.decode)(e.iv)}catch{throw new s.JWEInvalid("Failed to base64url decode the iv")}try{v=(0,i.decode)(e.tag)}catch{throw new s.JWEInvalid("Failed to base64url decode the tag")}let T=u.encoder.encode(null!==(f=e.protected)&&void 0!==f?f:"");w=void 0!==e.aad?(0,u.concat)(T,u.encoder.encode("."),u.encoder.encode(e.aad)):T;try{b=(0,i.decode)(e.ciphertext)}catch{throw new s.JWEInvalid("Failed to base64url decode the ciphertext")}let P=await (0,n.default)(E,m,b,_,v,w);"DEF"===S.zip&&(P=await ((null==r?void 0:r.inflateRaw)||o.inflate)(P));let j={plaintext:P};if(void 0!==e.protected&&(j.protectedHeader=y),void 0!==e.aad)try{j.additionalAuthenticatedData=(0,i.decode)(e.aad)}catch{throw new s.JWEInvalid("Failed to base64url decode the aad")}return(void 0!==e.unprotected&&(j.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(j.unprotectedHeader=e.header),O)?{...j,key:t}:j}t.flattenedDecrypt=f},210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlattenedEncrypt=t.unprotected=void 0;let i=r(5803),n=r(7359),o=r(4652),s=r(5183),a=r(5405),l=r(3885),c=r(7944),u=r(3004),d=r(9277);t.unprotected=Symbol();class h{constructor(e){if(!(e instanceof Uint8Array))throw TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,r){let h,p,f,y,g,m,_;if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new l.JWEInvalid("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!(0,c.default)(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new l.JWEInvalid("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let v={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if((0,d.default)(l.JWEInvalid,new Map,null==r?void 0:r.crit,this._protectedHeader,v),void 0!==v.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new l.JWEInvalid('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==v.zip)throw new l.JOSENotSupported('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}let{alg:w,enc:b}=v;if("string"!=typeof w||!w)throw new l.JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof b||!b)throw new l.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if("dir"===w){if(this._cek)throw TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===w&&this._cek)throw TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let i;({cek:p,encryptedKey:h,parameters:i}=await (0,a.default)(w,b,e,this._cek,this._keyManagementParameters)),i&&(r&&t.unprotected in r?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...i}:this.setUnprotectedHeader(i):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...i}:this.setProtectedHeader(i))}if(this._iv||(this._iv=(0,s.default)(b)),y=this._protectedHeader?u.encoder.encode((0,i.encode)(JSON.stringify(this._protectedHeader))):u.encoder.encode(""),this._aad?(g=(0,i.encode)(this._aad),f=(0,u.concat)(y,u.encoder.encode("."),u.encoder.encode(g))):f=y,"DEF"===v.zip){let e=await ((null==r?void 0:r.deflateRaw)||o.deflate)(this._plaintext);({ciphertext:m,tag:_}=await (0,n.default)(b,e,p,this._iv,f))}else({ciphertext:m,tag:_}=await (0,n.default)(b,this._plaintext,p,this._iv,f));let S={ciphertext:(0,i.encode)(m),iv:(0,i.encode)(this._iv),tag:(0,i.encode)(_)};return h&&(S.encrypted_key=(0,i.encode)(h)),g&&(S.aad=g),this._protectedHeader&&(S.protected=u.decoder.decode(y)),this._sharedUnprotectedHeader&&(S.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(S.header=this._unprotectedHeader),S}}t.FlattenedEncrypt=h},658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generalDecrypt=void 0;let i=r(1531),n=r(3885),o=r(8906);async function s(e,t,r){if(!(0,o.default)(e))throw new n.JWEInvalid("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(o.default))throw new n.JWEInvalid("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new n.JWEInvalid("JWE Recipients has no members");for(let n of e.recipients)try{return await (0,i.flattenedDecrypt)({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:n.encrypted_key,header:n.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,r)}catch{}throw new n.JWEDecryptionFailed}t.generalDecrypt=s},4186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralEncrypt=void 0;let i=r(210),n=r(3885),o=r(2794),s=r(7944),a=r(5405),l=r(5803),c=r(9277);class u{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}}class d{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){let r=new u(this,e,{crit:null==t?void 0:t.crit});return this._recipients.push(r),r}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(e){var t,r,u;let d;if(!this._recipients.length)throw new n.JWEInvalid("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){let[t]=this._recipients,r=await new i.FlattenedEncrypt(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e}),n={ciphertext:r.ciphertext,iv:r.iv,recipients:[{}],tag:r.tag};return r.aad&&(n.aad=r.aad),r.protected&&(n.protected=r.protected),r.unprotected&&(n.unprotected=r.unprotected),r.encrypted_key&&(n.recipients[0].encrypted_key=r.encrypted_key),r.header&&(n.recipients[0].header=r.header),n}for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmbeddedJWK=void 0;let i=r(7989),n=r(8906),o=r(3885);async function s(e,t){let r={...e,...null==t?void 0:t.header};if(!(0,n.default)(r.jwk))throw new o.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object');let s=await (0,i.importJWK)({...r.jwk,ext:!0},r.alg,!0);if(s instanceof Uint8Array||"public"!==s.type)throw new o.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a public key');return s}t.EmbeddedJWK=s},5811:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateJwkThumbprintUri=t.calculateJwkThumbprint=void 0;let i=r(3730),n=r(5803),o=r(3885),s=r(3004),a=r(8906),l=(e,t)=>{if("string"!=typeof e||!e)throw new o.JWKInvalid(`${t} missing or invalid`)};async function c(e,t){let r;if(!(0,a.default)(e))throw TypeError("JWK must be an object");if(null!=t||(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');switch(e.kty){case"EC":l(e.crv,'"crv" (Curve) Parameter'),l(e.x,'"x" (X Coordinate) Parameter'),l(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":l(e.crv,'"crv" (Subtype of Key Pair) Parameter'),l(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":l(e.e,'"e" (Exponent) Parameter'),l(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":l(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new o.JOSENotSupported('"kty" (Key Type) Parameter missing or unsupported')}let c=s.encoder.encode(JSON.stringify(r));return(0,n.encode)(await (0,i.default)(t,c))}async function u(e,t){null!=t||(t="sha256");let r=await c(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}t.calculateJwkThumbprint=c,t.calculateJwkThumbprintUri=u},8085:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLocalJWKSet=t.LocalJWKSet=t.isJWKSLike=void 0;let i=r(7989),n=r(3885),o=r(8906);function s(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(a)}function a(e){return(0,o.default)(e)}t.isJWKSLike=s;class l{constructor(e){if(this._cached=new WeakMap,!s(e))throw new n.JWKSInvalid("JSON Web Key Set malformed");this._jwks=function(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}(e)}async getKey(e,t){let{alg:r,kid:i}={...e,...null==t?void 0:t.header},o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new n.JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set')}}(r),s=this._jwks.keys.filter(e=>{let t=o===e.kty;if(t&&"string"==typeof i&&(t=i===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t}),{0:a,length:l}=s;if(0===l)throw new n.JWKSNoMatchingKey;if(1!==l){let e=new n.JWKSMultipleMatchingKeys,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(let e of s)try{yield await c(t,e,r)}catch{continue}},e}return c(this._cached,a,r)}}async function c(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(void 0===o[r]){let e=await (0,i.importJWK)({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new n.JWKSInvalid("JSON Web Key Set members must be public keys");o[r]=e}return o[r]}t.LocalJWKSet=l,t.createLocalJWKSet=function(e){let t=new l(e);return async function(e,r){return t.getKey(e,r)}}},6190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRemoteJWKSet=void 0;let i=r(1537),n=r(3885),o=r(8085);class s extends o.LocalJWKSet{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now(){if(!(0,o.isJWKSLike)(e))throw new n.JWKSInvalid("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e})),await this._pendingFetch}}t.createRemoteJWKSet=function(e,t){let r=new s(e,t);return async function(e,t){return r.getKey(e,t)}}},524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompactSign=void 0;let i=r(9988);class n{constructor(e){this._flattened=new i.FlattenedSign(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){let r=await this._flattened.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}t.CompactSign=n},9751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactVerify=void 0;let i=r(1330),n=r(3885),o=r(3004);async function s(e,t,r){if(e instanceof Uint8Array&&(e=o.decoder.decode(e)),"string"!=typeof e)throw new n.JWSInvalid("Compact JWS must be a string or Uint8Array");let{0:s,1:a,2:l,length:c}=e.split(".");if(3!==c)throw new n.JWSInvalid("Invalid Compact JWS");let u=await (0,i.flattenedVerify)({payload:a,protected:s,signature:l},t,r),d={payload:u.payload,protectedHeader:u.protectedHeader};return"function"==typeof t?{...d,key:u.key}:d}t.compactVerify=s},9988:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlattenedSign=void 0;let i=r(5803),n=r(7385),o=r(7944),s=r(3885),a=r(3004),l=r(8201),c=r(9277);class u{constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){let r;if(!this._protectedHeader&&!this._unprotectedHeader)throw new s.JWSInvalid("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!(0,o.default)(this._protectedHeader,this._unprotectedHeader))throw new s.JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let u={...this._protectedHeader,...this._unprotectedHeader},d=(0,c.default)(s.JWSInvalid,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,u),h=!0;if(d.has("b64")&&"boolean"!=typeof(h=this._protectedHeader.b64))throw new s.JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:p}=u;if("string"!=typeof p||!p)throw new s.JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');(0,l.default)(p,e,"sign");let f=this._payload;h&&(f=a.encoder.encode((0,i.encode)(f))),r=this._protectedHeader?a.encoder.encode((0,i.encode)(JSON.stringify(this._protectedHeader))):a.encoder.encode("");let y=(0,a.concat)(r,a.encoder.encode("."),f),g=await (0,n.default)(p,e,y),m={signature:(0,i.encode)(g),payload:""};return h&&(m.payload=a.decoder.decode(f)),this._unprotectedHeader&&(m.header=this._unprotectedHeader),this._protectedHeader&&(m.protected=a.decoder.decode(r)),m}}t.FlattenedSign=u},1330:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenedVerify=void 0;let i=r(5803),n=r(3458),o=r(3885),s=r(3004),a=r(7944),l=r(8906),c=r(8201),u=r(9277),d=r(2561);async function h(e,t,r){var h;let p,f;if(!(0,l.default)(e))throw new o.JWSInvalid("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new o.JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new o.JWSInvalid("JWS Protected Header incorrect type");if(void 0===e.payload)throw new o.JWSInvalid("JWS Payload missing");if("string"!=typeof e.signature)throw new o.JWSInvalid("JWS Signature missing or incorrect type");if(void 0!==e.header&&!(0,l.default)(e.header))throw new o.JWSInvalid("JWS Unprotected Header incorrect type");let y={};if(e.protected)try{let t=(0,i.decode)(e.protected);y=JSON.parse(s.decoder.decode(t))}catch{throw new o.JWSInvalid("JWS Protected Header is invalid")}if(!(0,a.default)(y,e.header))throw new o.JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let g={...y,...e.header},m=(0,u.default)(o.JWSInvalid,new Map([["b64",!0]]),null==r?void 0:r.crit,y,g),_=!0;if(m.has("b64")&&"boolean"!=typeof(_=y.b64))throw new o.JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:v}=g;if("string"!=typeof v||!v)throw new o.JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');let w=r&&(0,d.default)("algorithms",r.algorithms);if(w&&!w.has(v))throw new o.JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter not allowed');if(_){if("string"!=typeof e.payload)throw new o.JWSInvalid("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new o.JWSInvalid("JWS Payload must be a string or an Uint8Array instance");let b=!1;"function"==typeof t&&(t=await t(y,e),b=!0),(0,c.default)(v,t,"verify");let S=(0,s.concat)(s.encoder.encode(null!==(h=e.protected)&&void 0!==h?h:""),s.encoder.encode("."),"string"==typeof e.payload?s.encoder.encode(e.payload):e.payload);try{p=(0,i.decode)(e.signature)}catch{throw new o.JWSInvalid("Failed to base64url decode the signature")}if(!await (0,n.default)(v,t,p,S))throw new o.JWSSignatureVerificationFailed;if(_)try{f=(0,i.decode)(e.payload)}catch{throw new o.JWSInvalid("Failed to base64url decode the payload")}else f="string"==typeof e.payload?s.encoder.encode(e.payload):e.payload;let k={payload:f};return(void 0!==e.protected&&(k.protectedHeader=y),void 0!==e.header&&(k.unprotectedHeader=e.header),b)?{...k,key:t}:k}t.flattenedVerify=h},6755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralSign=void 0;let i=r(9988),n=r(3885);class o{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class s{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){let r=new o(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new n.JWSInvalid("at least one signature must be added");let e={signatures:[],payload:""};for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generalVerify=void 0;let i=r(1330),n=r(3885),o=r(8906);async function s(e,t,r){if(!(0,o.default)(e))throw new n.JWSInvalid("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(o.default))throw new n.JWSInvalid("JWS Signatures missing or incorrect type");for(let n of e.signatures)try{return await (0,i.flattenedVerify)({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch{}throw new n.JWSSignatureVerificationFailed}t.generalVerify=s},3621:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtDecrypt=void 0;let i=r(1222),n=r(6641),o=r(3885);async function s(e,t,r){let s=await (0,i.compactDecrypt)(e,t,r),a=(0,n.default)(s.protectedHeader,s.plaintext,r),{protectedHeader:l}=s;if(void 0!==l.iss&&l.iss!==a.iss)throw new o.JWTClaimValidationFailed('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==l.sub&&l.sub!==a.sub)throw new o.JWTClaimValidationFailed('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==l.aud&&JSON.stringify(l.aud)!==JSON.stringify(a.aud))throw new o.JWTClaimValidationFailed('replicated "aud" claim header parameter mismatch',"aud","mismatch");let c={payload:a,protectedHeader:l};return"function"==typeof t?{...c,key:s.key}:c}t.jwtDecrypt=s},8255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptJWT=void 0;let i=r(8369),n=r(3004),o=r(8417);class s extends o.ProduceJWT{setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){let r=new i.CompactEncrypt(n.encoder.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(e,t)}}t.EncryptJWT=s},8417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProduceJWT=void 0;let i=r(7977),n=r(8906),o=r(4505);class s{constructor(e){if(!(0,n.default)(e))throw TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return"number"==typeof e?this._payload={...this._payload,nbf:e}:this._payload={...this._payload,nbf:(0,i.default)(new Date)+(0,o.default)(e)},this}setExpirationTime(e){return"number"==typeof e?this._payload={...this._payload,exp:e}:this._payload={...this._payload,exp:(0,i.default)(new Date)+(0,o.default)(e)},this}setIssuedAt(e){return void 0===e?this._payload={...this._payload,iat:(0,i.default)(new Date)}:this._payload={...this._payload,iat:e},this}}t.ProduceJWT=s},9252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignJWT=void 0;let i=r(524),n=r(3885),o=r(3004),s=r(8417);class a extends s.ProduceJWT{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var r;let s=new i.CompactSign(o.encoder.encode(JSON.stringify(this._payload)));if(s.setProtectedHeader(this._protectedHeader),Array.isArray(null===(r=this._protectedHeader)||void 0===r?void 0:r.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new n.JWTInvalid("JWTs MUST NOT use unencoded payload");return s.sign(e,t)}}t.SignJWT=a},9752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsecuredJWT=void 0;let i=r(5803),n=r(3004),o=r(3885),s=r(6641),a=r(8417);class l extends a.ProduceJWT{encode(){let e=i.encode(JSON.stringify({alg:"none"})),t=i.encode(JSON.stringify(this._payload));return`${e}.${t}.`}static decode(e,t){let r;if("string"!=typeof e)throw new o.JWTInvalid("Unsecured JWT must be a string");let{0:a,1:l,2:c,length:u}=e.split(".");if(3!==u||""!==c)throw new o.JWTInvalid("Invalid Unsecured JWT");try{if(r=JSON.parse(n.decoder.decode(i.decode(a))),"none"!==r.alg)throw Error()}catch{throw new o.JWTInvalid("Invalid Unsecured JWT")}return{payload:(0,s.default)(r,i.decode(l),t),header:r}}}t.UnsecuredJWT=l},913:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtVerify=void 0;let i=r(9751),n=r(6641),o=r(3885);async function s(e,t,r){var s;let a=await (0,i.compactVerify)(e,t,r);if((null===(s=a.protectedHeader.crit)||void 0===s?void 0:s.includes("b64"))&&!1===a.protectedHeader.b64)throw new o.JWTInvalid("JWTs MUST NOT use unencoded payload");let l={payload:(0,n.default)(a.protectedHeader,a.payload,r),protectedHeader:a.protectedHeader};return"function"==typeof t?{...l,key:a.key}:l}t.jwtVerify=s},510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exportJWK=t.exportPKCS8=t.exportSPKI=void 0;let i=r(9645),n=r(9645),o=r(7);async function s(e){return(0,i.toSPKI)(e)}async function a(e){return(0,n.toPKCS8)(e)}async function l(e){return(0,o.default)(e)}t.exportSPKI=s,t.exportPKCS8=a,t.exportJWK=l},1399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateKeyPair=void 0;let i=r(8428);async function n(e,t){return(0,i.generateKeyPair)(e,t)}t.generateKeyPair=n},8259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateSecret=void 0;let i=r(8428);async function n(e,t){return(0,i.generateSecret)(e,t)}t.generateSecret=n},7989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.importJWK=t.importPKCS8=t.importX509=t.importSPKI=void 0;let i=r(5803),n=r(9645),o=r(9453),s=r(3885),a=r(8906);async function l(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw TypeError('"spki" must be SPKI formatted string');return(0,n.fromSPKI)(e,t,r)}async function c(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw TypeError('"x509" must be X.509 formatted string');return(0,n.fromX509)(e,t,r)}async function u(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return(0,n.fromPKCS8)(e,t,r)}async function d(e,t,r){var n;if(!(0,a.default)(e))throw TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');if(null!=r||(r=!0!==e.ext),r)return(0,o.default)({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n});return(0,i.decode)(e.k);case"RSA":if(void 0!==e.oth)throw new s.JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return(0,o.default)({...e,alg:t});default:throw new s.JOSENotSupported('Unsupported "kty" (Key Type) Parameter value')}}t.importSPKI=l,t.importX509=c,t.importPKCS8=u,t.importJWK=d},7414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrap=t.wrap=void 0;let i=r(7359),n=r(7287),o=r(5183),s=r(5803);async function a(e,t,r,n){let a=e.slice(0,7);n||(n=(0,o.default)(a));let{ciphertext:l,tag:c}=await (0,i.default)(a,r,t,n,new Uint8Array(0));return{encryptedKey:l,iv:(0,s.encode)(n),tag:(0,s.encode)(c)}}async function l(e,t,r,i,o){let s=e.slice(0,7);return(0,n.default)(s,t,r,i,o,new Uint8Array(0))}t.wrap=a,t.unwrap=l},3004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatKdf=t.lengthAndInput=t.uint32be=t.uint64be=t.p2s=t.concat=t.decoder=t.encoder=void 0;let i=r(3730);function n(...e){let t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t),i=0;return e.forEach(e=>{r.set(e,i),i+=e.length}),r}function o(e,t,r){if(t<0||t>=4294967296)throw RangeError(`value must be >= 0 and <= ${4294967296-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function s(e){let t=new Uint8Array(4);return o(t,e),t}async function a(e,t,r){let n=Math.ceil((t>>3)/32),o=new Uint8Array(32*n);for(let t=0;t>3)}t.encoder=new TextEncoder,t.decoder=new TextDecoder,t.concat=n,t.p2s=function(e,r){return n(t.encoder.encode(e),new Uint8Array([0]),r)},t.uint64be=function(e){let t=new Uint8Array(8);return o(t,Math.floor(e/4294967296),0),o(t,e%4294967296,4),t},t.uint32be=s,t.lengthAndInput=function(e){return n(s(e.length),e)},t.concatKdf=a},2794:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitLength=void 0;let i=r(3885),n=r(2088);function o(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new i.JOSENotSupported(`Unsupported JWE Algorithm: ${e}`)}}t.bitLength=o,t.default=e=>(0,n.default)(new Uint8Array(o(e)>>3))},3450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(3885),n=r(5183);t.default=(e,t)=>{if(t.length<<3!==(0,n.bitLength)(e))throw new i.JWEInvalid("Invalid Initialization Vector length")}},8201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(8289),n=r(2964),o=(e,t)=>{if(!(t instanceof Uint8Array)){if(!(0,n.default)(t))throw TypeError((0,i.withAlg)(e,t,...n.types,"Uint8Array"));if("secret"!==t.type)throw TypeError(`${n.types.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},s=(e,t,r)=>{if(!(0,n.default)(t))throw TypeError((0,i.withAlg)(e,t,...n.types));if("secret"===t.type)throw TypeError(`${n.types.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw TypeError(`${n.types.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw TypeError(`${n.types.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw TypeError(`${n.types.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw TypeError(`${n.types.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)};t.default=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?o(e,t):s(e,t,r)}},2617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(3885);t.default=function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new i.JWEInvalid("PBES2 Salt Input must be 8 or more octets")}},1347:(e,t)=>{"use strict";function r(e,t="algorithm.name"){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function i(e,t){return e.name===t}function n(e){return parseInt(e.name.slice(4),10)}function o(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){let r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.checkEncCryptoKey=t.checkSigCryptoKey=void 0,t.checkSigCryptoKey=function(e,t,...s){switch(t){case"HS256":case"HS384":case"HS512":{if(!i(e.algorithm,"HMAC"))throw r("HMAC");let o=parseInt(t.slice(2),10);if(n(e.algorithm.hash)!==o)throw r(`SHA-${o}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!i(e.algorithm,"RSASSA-PKCS1-v1_5"))throw r("RSASSA-PKCS1-v1_5");let o=parseInt(t.slice(2),10);if(n(e.algorithm.hash)!==o)throw r(`SHA-${o}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!i(e.algorithm,"RSA-PSS"))throw r("RSA-PSS");let o=parseInt(t.slice(2),10);if(n(e.algorithm.hash)!==o)throw r(`SHA-${o}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw r("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!i(e.algorithm,"ECDSA"))throw r("ECDSA");let n=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}(t);if(e.algorithm.namedCurve!==n)throw r(n,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}o(e,s)},t.checkEncCryptoKey=function(e,t,...s){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!i(e.algorithm,"AES-GCM"))throw r("AES-GCM");let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw r(n,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!i(e.algorithm,"AES-KW"))throw r("AES-KW");let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw r(n,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw r("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!i(e.algorithm,"PBKDF2"))throw r("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!i(e.algorithm,"RSA-OAEP"))throw r("RSA-OAEP");let o=parseInt(t.slice(9),10)||1;if(n(e.algorithm.hash)!==o)throw r(`SHA-${o}`,"algorithm.hash");break}default:throw TypeError("CryptoKey does not support this operation")}o(e,s)}},3682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(9647),n=r(806),o=r(4290),s=r(5730),a=r(5803),l=r(3885),c=r(2794),u=r(7989),d=r(8201),h=r(8906),p=r(7414);async function f(e,t,r,f,y){switch((0,d.default)(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new l.JWEInvalid("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new l.JWEInvalid("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let o,s;if(!(0,h.default)(f.epk))throw new l.JWEInvalid('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!n.ecdhAllowed(t))throw new l.JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");let d=await (0,u.importJWK)(f.epk,e);if(void 0!==f.apu){if("string"!=typeof f.apu)throw new l.JWEInvalid('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{o=(0,a.decode)(f.apu)}catch{throw new l.JWEInvalid("Failed to base64url decode the apu")}}if(void 0!==f.apv){if("string"!=typeof f.apv)throw new l.JWEInvalid('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{s=(0,a.decode)(f.apv)}catch{throw new l.JWEInvalid("Failed to base64url decode the apv")}}let p=await n.deriveKey(d,t,"ECDH-ES"===e?f.enc:e,"ECDH-ES"===e?(0,c.bitLength)(f.enc):parseInt(e.slice(-5,-2),10),o,s);if("ECDH-ES"===e)return p;if(void 0===r)throw new l.JWEInvalid("JWE Encrypted Key missing");return(0,i.unwrap)(e.slice(-6),p,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new l.JWEInvalid("JWE Encrypted Key missing");return(0,s.decrypt)(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{let i;if(void 0===r)throw new l.JWEInvalid("JWE Encrypted Key missing");if("number"!=typeof f.p2c)throw new l.JWEInvalid('JOSE Header "p2c" (PBES2 Count) missing or invalid');let n=(null==y?void 0:y.maxPBES2Count)||1e4;if(f.p2c>n)throw new l.JWEInvalid('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof f.p2s)throw new l.JWEInvalid('JOSE Header "p2s" (PBES2 Salt) missing or invalid');try{i=(0,a.decode)(f.p2s)}catch{throw new l.JWEInvalid("Failed to base64url decode the p2s")}return(0,o.decrypt)(e,t,r,f.p2c,i)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new l.JWEInvalid("JWE Encrypted Key missing");return(0,i.unwrap)(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{let i,n;if(void 0===r)throw new l.JWEInvalid("JWE Encrypted Key missing");if("string"!=typeof f.iv)throw new l.JWEInvalid('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof f.tag)throw new l.JWEInvalid('JOSE Header "tag" (Authentication Tag) missing or invalid');try{i=(0,a.decode)(f.iv)}catch{throw new l.JWEInvalid("Failed to base64url decode the iv")}try{n=(0,a.decode)(f.tag)}catch{throw new l.JWEInvalid("Failed to base64url decode the tag")}return(0,p.unwrap)(e,t,r,i,n)}default:throw new l.JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}}t.default=f},5405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(9647),n=r(806),o=r(4290),s=r(5730),a=r(5803),l=r(2794),c=r(3885),u=r(510),d=r(8201),h=r(7414);async function p(e,t,r,p,f={}){let y,g,m;switch((0,d.default)(e,r,"encrypt"),e){case"dir":m=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!n.ecdhAllowed(r))throw new c.JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:o,apv:s}=f,{epk:d}=f;d||(d=(await n.generateEpk(r)).privateKey);let{x:h,y:_,crv:v,kty:w}=await (0,u.exportJWK)(d),b=await n.deriveKey(r,d,"ECDH-ES"===e?t:e,"ECDH-ES"===e?(0,l.bitLength)(t):parseInt(e.slice(-5,-2),10),o,s);if(g={epk:{x:h,crv:v,kty:w}},"EC"===w&&(g.epk.y=_),o&&(g.apu=(0,a.encode)(o)),s&&(g.apv=(0,a.encode)(s)),"ECDH-ES"===e){m=b;break}m=p||(0,l.default)(t);let S=e.slice(-6);y=await (0,i.wrap)(S,b,m);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":m=p||(0,l.default)(t),y=await (0,s.encrypt)(e,r,m);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{m=p||(0,l.default)(t);let{p2c:i,p2s:n}=f;({encryptedKey:y,...g}=await (0,o.encrypt)(e,r,m,i,n));break}case"A128KW":case"A192KW":case"A256KW":m=p||(0,l.default)(t),y=await (0,i.wrap)(e,r,m);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{m=p||(0,l.default)(t);let{iv:i}=f;({encryptedKey:y,...g}=await (0,h.wrap)(e,r,m,i));break}default:throw new c.JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:m,encryptedKey:y,parameters:g}}t.default=p},7977:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>Math.floor(e.getTime()/1e3)},8289:(e,t)=>{"use strict";function r(e,t,...i){if(i.length>2){let t=i.pop();e+=`one of type ${i.join(", ")}, or ${t}.`}else 2===i.length?e+=`one of type ${i[0]} or ${i[1]}.`:e+=`of type ${i[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}Object.defineProperty(t,"__esModule",{value:!0}),t.withAlg=void 0,t.default=(e,...t)=>r("Key must be ",e,...t),t.withAlg=function(e,t,...i){return r(`Key for the ${e} algorithm must be `,t,...i)}},7944:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(...e)=>{let t;let r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0}},8906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("object"==typeof e&&null!==e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}},5183:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitLength=void 0;let i=r(3885),n=r(2088);function o(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new i.JOSENotSupported(`Unsupported JWE Algorithm: ${e}`)}}t.bitLength=o,t.default=e=>(0,n.default)(new Uint8Array(o(e)>>3))},6641:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(3885),n=r(3004),o=r(7977),s=r(4505),a=r(8906),l=e=>e.toLowerCase().replace(/^application\//,""),c=(e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e)));t.default=(e,t,r={})=>{let u,d;let{typ:h}=r;if(h&&("string"!=typeof e.typ||l(e.typ)!==l(h)))throw new i.JWTClaimValidationFailed('unexpected "typ" JWT header value',"typ","check_failed");try{u=JSON.parse(n.decoder.decode(t))}catch{}if(!(0,a.default)(u))throw new i.JWTInvalid("JWT Claims Set must be a top-level JSON object");let{requiredClaims:p=[],issuer:f,subject:y,audience:g,maxTokenAge:m}=r;for(let e of(void 0!==m&&p.push("iat"),void 0!==g&&p.push("aud"),void 0!==y&&p.push("sub"),void 0!==f&&p.push("iss"),new Set(p.reverse())))if(!(e in u))throw new i.JWTClaimValidationFailed(`missing required "${e}" claim`,e,"missing");if(f&&!(Array.isArray(f)?f:[f]).includes(u.iss))throw new i.JWTClaimValidationFailed('unexpected "iss" claim value',"iss","check_failed");if(y&&u.sub!==y)throw new i.JWTClaimValidationFailed('unexpected "sub" claim value',"sub","check_failed");if(g&&!c(u.aud,"string"==typeof g?[g]:g))throw new i.JWTClaimValidationFailed('unexpected "aud" claim value',"aud","check_failed");switch(typeof r.clockTolerance){case"string":d=(0,s.default)(r.clockTolerance);break;case"number":d=r.clockTolerance;break;case"undefined":d=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:_}=r,v=(0,o.default)(_||new Date);if((void 0!==u.iat||m)&&"number"!=typeof u.iat)throw new i.JWTClaimValidationFailed('"iat" claim must be a number',"iat","invalid");if(void 0!==u.nbf){if("number"!=typeof u.nbf)throw new i.JWTClaimValidationFailed('"nbf" claim must be a number',"nbf","invalid");if(u.nbf>v+d)throw new i.JWTClaimValidationFailed('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==u.exp){if("number"!=typeof u.exp)throw new i.JWTClaimValidationFailed('"exp" claim must be a number',"exp","invalid");if(u.exp<=v-d)throw new i.JWTExpired('"exp" claim timestamp check failed',"exp","check_failed")}if(m){let e=v-u.iat;if(e-d>("number"==typeof m?m:(0,s.default)(m)))throw new i.JWTExpired('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-d)throw new i.JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return u}},4505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;t.default=e=>{let t=r.exec(e);if(!t)throw TypeError("Invalid time period format");let i=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(i);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*i);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*i);case"day":case"days":case"d":return Math.round(86400*i);case"week":case"weeks":case"w":return Math.round(604800*i);default:return Math.round(31557600*i)}}},2561:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}},9277:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(3885);t.default=function(e,t,r,n,o){let s;if(void 0!==o.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let a of(s=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,n.crit)){if(!s.has(a))throw new i.JOSENotSupported(`Extension Header Parameter "${a}" is not recognized`);if(void 0===o[a])throw new e(`Extension Header Parameter "${a}" is missing`);if(s.get(a)&&void 0===n[a])throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(n.crit)}},9647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrap=t.wrap=void 0;let i=r(4300),n=r(6113),o=r(3885),s=r(3004),a=r(6261),l=r(1347),c=r(4841),u=r(8289),d=r(3755),h=r(2964);function p(e,t){if(e.symmetricKeySize<<3!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function f(e,t,r){if((0,c.default)(e))return e;if(e instanceof Uint8Array)return(0,n.createSecretKey)(e);if((0,a.isCryptoKey)(e))return(0,l.checkEncCryptoKey)(e,t,r),n.KeyObject.from(e);throw TypeError((0,u.default)(e,...h.types,"Uint8Array"))}t.wrap=(e,t,r)=>{let a=parseInt(e.slice(1,4),10),l=`aes${a}-wrap`;if(!(0,d.default)(l))throw new o.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`);let c=f(t,e,"wrapKey");p(c,e);let u=(0,n.createCipheriv)(l,c,i.Buffer.alloc(8,166));return(0,s.concat)(u.update(r),u.final())},t.unwrap=(e,t,r)=>{let a=parseInt(e.slice(1,4),10),l=`aes${a}-wrap`;if(!(0,d.default)(l))throw new o.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`);let c=f(t,e,"unwrapKey");p(c,e);let u=(0,n.createDecipheriv)(l,c,i.Buffer.alloc(8,166));return(0,s.concat)(u.update(r),u.final())}},9645:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromX509=t.fromSPKI=t.fromPKCS8=t.toPKCS8=t.toSPKI=void 0;let i=r(6113),n=r(4300),o=r(6261),s=r(4841),a=r(8289),l=r(2964),c=(e,t,r)=>{let n;if((0,o.isCryptoKey)(r)){if(!r.extractable)throw TypeError("CryptoKey is not extractable");n=i.KeyObject.from(r)}else if((0,s.default)(r))n=r;else throw TypeError((0,a.default)(r,...l.types));if(n.type!==e)throw TypeError(`key is not a ${e} key`);return n.export({format:"pem",type:t})};t.toSPKI=e=>c("public","spki",e),t.toPKCS8=e=>c("private","pkcs8",e),t.fromPKCS8=e=>(0,i.createPrivateKey)({key:n.Buffer.from(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,""),"base64"),type:"pkcs8",format:"der"}),t.fromSPKI=e=>(0,i.createPublicKey)({key:n.Buffer.from(e.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,""),"base64"),type:"spki",format:"der"}),t.fromX509=e=>(0,i.createPublicKey)({key:e,type:"spki",format:"pem"})},8367:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e){if(48!==e[0]||(this.buffer=e,this.offset=1,this.decodeLength()!==e.length-this.offset))throw TypeError()}decodeLength(){let e=this.buffer[this.offset++];if(128&e){let t=-129&e;e=0;for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(4300),n=r(3885),o=i.Buffer.from([0]),s=i.Buffer.from([2]),a=i.Buffer.from([3]),l=i.Buffer.from([48]),c=i.Buffer.from([4]),u=e=>{if(e<128)return i.Buffer.from([e]);let t=i.Buffer.alloc(5);t.writeUInt32BE(e,1);let r=1;for(;0===t[r];)r++;return t[r-1]=128|5-r,t.slice(r-1)},d=new Map([["P-256",i.Buffer.from("06 08 2A 86 48 CE 3D 03 01 07".replace(/ /g,""),"hex")],["secp256k1",i.Buffer.from("06 05 2B 81 04 00 0A".replace(/ /g,""),"hex")],["P-384",i.Buffer.from("06 05 2B 81 04 00 22".replace(/ /g,""),"hex")],["P-521",i.Buffer.from("06 05 2B 81 04 00 23".replace(/ /g,""),"hex")],["ecPublicKey",i.Buffer.from("06 07 2A 86 48 CE 3D 02 01".replace(/ /g,""),"hex")],["X25519",i.Buffer.from("06 03 2B 65 6E".replace(/ /g,""),"hex")],["X448",i.Buffer.from("06 03 2B 65 6F".replace(/ /g,""),"hex")],["Ed25519",i.Buffer.from("06 03 2B 65 70".replace(/ /g,""),"hex")],["Ed448",i.Buffer.from("06 03 2B 65 71".replace(/ /g,""),"hex")]]);class h{constructor(){this.length=0,this.elements=[]}oidFor(e){let t=d.get(e);if(!t)throw new n.JOSENotSupported("Invalid or unsupported OID");this.elements.push(t),this.length+=t.length}zero(){this.elements.push(s,i.Buffer.from([1]),o),this.length+=3}one(){this.elements.push(s,i.Buffer.from([1]),i.Buffer.from([1])),this.length+=3}unsignedInteger(e){if(128&e[0]){let t=u(e.length+1);this.elements.push(s,t,o,e),this.length+=2+t.length+e.length}else{let t=0;for(;0===e[t]&&(128&e[t+1])==0;)t++;let r=u(e.length-t);this.elements.push(s,u(e.length-t),e.slice(t)),this.length+=1+r.length+e.length-t}}octStr(e){let t=u(e.length);this.elements.push(c,u(e.length),e),this.length+=1+t.length+e.length}bitStr(e){let t=u(e.length+1);this.elements.push(a,u(e.length+1),o,e),this.length+=1+t.length+e.length+1}add(e){this.elements.push(e),this.length+=e.length}end(e=l){let t=u(this.length);return i.Buffer.concat([e,t,...this.elements],1+t.length+this.length)}}t.default=h},5803:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=t.encodeBase64=t.decodeBase64=void 0;let i=r(4300),n=r(3004);i.Buffer.isEncoding("base64url")?t.encode=e=>i.Buffer.from(e).toString("base64url"):t.encode=e=>i.Buffer.from(e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),t.decodeBase64=e=>i.Buffer.from(e,"base64"),t.encodeBase64=e=>i.Buffer.from(e).toString("base64"),t.decode=e=>i.Buffer.from(function(e){let t=e;return t instanceof Uint8Array&&(t=n.decoder.decode(t)),t}(e),"base64")},692:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113),n=r(3004);t.default=function(e,t,r,o,s,a){let l=(0,n.concat)(e,t,r,(0,n.uint64be)(e.length<<3)),c=(0,i.createHmac)(`sha${o}`,s);return c.update(l),c.digest().slice(0,a>>3)}},9888:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(3885),n=r(4841);t.default=(e,t)=>{let r;switch(e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":r=parseInt(e.slice(-3),10);break;case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.slice(1,4),10);break;default:throw new i.JOSENotSupported(`Content Encryption Algorithm ${e} is not supported either by JOSE or your javascript runtime`)}if(t instanceof Uint8Array){let e=t.byteLength<<3;if(e!==r)throw new i.JWEInvalid(`Invalid Content Encryption Key length. Expected ${r} bits, got ${e} bits`);return}if((0,n.default)(t)&&"secret"===t.type){let e=t.symmetricKeySize<<3;if(e!==r)throw new i.JWEInvalid(`Invalid Content Encryption Key length. Expected ${r} bits, got ${e} bits`);return}throw TypeError("Invalid Content Encryption Key type")}},6459:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModulusLength=t.weakMap=void 0,t.weakMap=new WeakMap;let r=(e,t)=>{let i=e.readUInt8(1);if((128&i)==0)return 0===t?i:r(e.subarray(2+i),t-1);let n=127&i;i=0;for(let t=0;t{let i=e.readUInt8(1);return(128&i)==0?r(e.subarray(2),t):r(e.subarray(2+(127&i)),t)},n=e=>{var r,n;if(t.weakMap.has(e))return t.weakMap.get(e);let o=null!==(n=null===(r=e.asymmetricKeyDetails)||void 0===r?void 0:r.modulusLength)&&void 0!==n?n:i(e.export({format:"der",type:"pkcs1"}),"private"===e.type?1:0)-1<<3;return t.weakMap.set(e,o),o};t.setModulusLength=(e,r)=>{t.weakMap.set(e,r)},t.default=(e,t)=>{if(2048>n(e))throw TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}},3755:(e,t,r)=>{"use strict";let i;Object.defineProperty(t,"__esModule",{value:!0});let n=r(6113);t.default=e=>(i||(i=new Set((0,n.getCiphers)())),i.has(e))},7287:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113),n=r(3450),o=r(9888),s=r(3004),a=r(3885),l=r(7292),c=r(692),u=r(6261),d=r(1347),h=r(4841),p=r(8289),f=r(3755),y=r(2964);t.default=(e,t,r,g,m,_)=>{let v;if((0,u.isCryptoKey)(t))(0,d.checkEncCryptoKey)(t,e,"decrypt"),v=i.KeyObject.from(t);else if(t instanceof Uint8Array||(0,h.default)(t))v=t;else throw TypeError((0,p.default)(t,...y.types,"Uint8Array"));switch((0,o.default)(e,v),(0,n.default)(e,g),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return function(e,t,r,n,o,u){let d,p;let y=parseInt(e.slice(1,4),10);(0,h.default)(t)&&(t=t.export());let g=t.subarray(y>>3),m=t.subarray(0,y>>3),_=parseInt(e.slice(-3),10),v=`aes-${y}-cbc`;if(!(0,f.default)(v))throw new a.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);let w=(0,c.default)(u,n,r,_,m,y);try{d=(0,l.default)(o,w)}catch{}if(!d)throw new a.JWEDecryptionFailed;try{let e=(0,i.createDecipheriv)(v,g,n);p=(0,s.concat)(e.update(r),e.final())}catch{}if(!p)throw new a.JWEDecryptionFailed;return p}(e,v,r,g,m,_);case"A128GCM":case"A192GCM":case"A256GCM":return function(e,t,r,n,o,s){let l=parseInt(e.slice(1,4),10),c=`aes-${l}-gcm`;if(!(0,f.default)(c))throw new a.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);try{let e=(0,i.createDecipheriv)(c,t,n,{authTagLength:16});e.setAuthTag(o),s.byteLength&&e.setAAD(s,{plaintextLength:r.length});let a=e.update(r);return e.final(),a}catch{throw new a.JWEDecryptionFailed}}(e,v,r,g,m,_);default:throw new a.JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}}},3730:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113);t.default=(e,t)=>(0,i.createHash)(e).update(t).digest()},9583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(3885);t.default=function(e){switch(e){case"PS256":case"RS256":case"ES256":case"ES256K":return"sha256";case"PS384":case"RS384":case"ES384":return"sha384";case"PS512":case"RS512":case"ES512":return"sha512";case"EdDSA":return;default:throw new i.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},806:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecdhAllowed=t.generateEpk=t.deriveKey=void 0;let i=r(6113),n=r(3849),o=r(5922),s=r(3004),a=r(3885),l=r(6261),c=r(1347),u=r(4841),d=r(8289),h=r(2964),p=(0,n.promisify)(i.generateKeyPair);async function f(e,t,r,n,o=new Uint8Array(0),a=new Uint8Array(0)){let p,f;if((0,l.isCryptoKey)(e))(0,c.checkEncCryptoKey)(e,"ECDH"),p=i.KeyObject.from(e);else if((0,u.default)(e))p=e;else throw TypeError((0,d.default)(e,...h.types));if((0,l.isCryptoKey)(t))(0,c.checkEncCryptoKey)(t,"ECDH","deriveBits"),f=i.KeyObject.from(t);else if((0,u.default)(t))f=t;else throw TypeError((0,d.default)(t,...h.types));let y=(0,s.concat)((0,s.lengthAndInput)(s.encoder.encode(r)),(0,s.lengthAndInput)(o),(0,s.lengthAndInput)(a),(0,s.uint32be)(n)),g=(0,i.diffieHellman)({privateKey:f,publicKey:p});return(0,s.concatKdf)(g,n,y)}async function y(e){let t;if((0,l.isCryptoKey)(e))t=i.KeyObject.from(e);else if((0,u.default)(e))t=e;else throw TypeError((0,d.default)(e,...h.types));switch(t.asymmetricKeyType){case"x25519":return p("x25519");case"x448":return p("x448");case"ec":return p("ec",{namedCurve:(0,o.default)(t)});default:throw new a.JOSENotSupported("Invalid or unsupported EPK")}}t.deriveKey=f,t.generateEpk=y,t.ecdhAllowed=e=>["P-256","P-384","P-521","X25519","X448"].includes((0,o.default)(e))},7359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113),n=r(3450),o=r(9888),s=r(3004),a=r(692),l=r(6261),c=r(1347),u=r(4841),d=r(8289),h=r(3885),p=r(3755),f=r(2964);t.default=(e,t,r,y,g)=>{let m;if((0,l.isCryptoKey)(r))(0,c.checkEncCryptoKey)(r,e,"encrypt"),m=i.KeyObject.from(r);else if(r instanceof Uint8Array||(0,u.default)(r))m=r;else throw TypeError((0,d.default)(r,...f.types,"Uint8Array"));switch((0,o.default)(e,m),(0,n.default)(e,y),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return function(e,t,r,n,o){let l=parseInt(e.slice(1,4),10);(0,u.default)(r)&&(r=r.export());let c=r.subarray(l>>3),d=r.subarray(0,l>>3),f=`aes-${l}-cbc`;if(!(0,p.default)(f))throw new h.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);let y=(0,i.createCipheriv)(f,c,n),g=(0,s.concat)(y.update(t),y.final()),m=parseInt(e.slice(-3),10),_=(0,a.default)(o,n,g,m,d,l);return{ciphertext:g,tag:_}}(e,t,m,y,g);case"A128GCM":case"A192GCM":case"A256GCM":return function(e,t,r,n,o){let s=parseInt(e.slice(1,4),10),a=`aes-${s}-gcm`;if(!(0,p.default)(a))throw new h.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);let l=(0,i.createCipheriv)(a,r,n,{authTagLength:16});o.byteLength&&l.setAAD(o,{plaintextLength:t.length});let c=l.update(t);return l.final(),{ciphertext:c,tag:l.getAuthTag()}}(e,t,m,y,g);default:throw new h.JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}}},1537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(3685),n=r(5687),o=r(2361),s=r(3885),a=r(3004),l=async(e,t,r)=>{let l;switch(e.protocol){case"https:":l=n.get;break;case"http:":l=i.get;break;default:throw TypeError("Unsupported URL protocol.")}let{agent:c,headers:u}=r,d=l(e.href,{agent:c,timeout:t,headers:u}),[h]=await Promise.race([(0,o.once)(d,"response"),(0,o.once)(d,"timeout")]);if(!h)throw d.destroy(),new s.JWKSTimeout;if(200!==h.statusCode)throw new s.JOSEError("Expected 200 OK from the JSON Web Key Set HTTP response");let p=[];for await(let e of h)p.push(e);try{return JSON.parse(a.decoder.decode((0,a.concat)(...p)))}catch{throw new s.JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON")}};t.default=l},7572:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwkImport=t.jwkExport=t.rsaPssParams=t.oneShotCallback=void 0;let[r,i]=process.versions.node.split(".").map(e=>parseInt(e,10));t.oneShotCallback=r>=16||15===r&&i>=13,t.rsaPssParams=!("electron"in process.versions)&&(r>=17||16===r&&i>=9),t.jwkExport=r>=16||15===r&&i>=9,t.jwkImport=r>=16||15===r&&i>=12},8428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateKeyPair=t.generateSecret=void 0;let i=r(6113),n=r(3849),o=r(2088),s=r(6459),a=r(3885),l=(0,n.promisify)(i.generateKeyPair);async function c(e,t){let r;switch(e){case"HS256":case"HS384":case"HS512":case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":r=parseInt(e.slice(-3),10);break;case"A128KW":case"A192KW":case"A256KW":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.slice(1,4),10);break;default:throw new a.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return(0,i.createSecretKey)((0,o.default)(new Uint8Array(r>>3)))}async function u(e,t){var r,i;switch(e){case"RS256":case"RS384":case"RS512":case"PS256":case"PS384":case"PS512":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":case"RSA1_5":{let e=null!==(r=null==t?void 0:t.modulusLength)&&void 0!==r?r:2048;if("number"!=typeof e||e<2048)throw new a.JOSENotSupported("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");let i=await l("rsa",{modulusLength:e,publicExponent:65537});return(0,s.setModulusLength)(i.privateKey,e),(0,s.setModulusLength)(i.publicKey,e),i}case"ES256":return l("ec",{namedCurve:"P-256"});case"ES256K":return l("ec",{namedCurve:"secp256k1"});case"ES384":return l("ec",{namedCurve:"P-384"});case"ES512":return l("ec",{namedCurve:"P-521"});case"EdDSA":switch(null==t?void 0:t.crv){case void 0:case"Ed25519":return l("ed25519");case"Ed448":return l("ed448");default:throw new a.JOSENotSupported("Invalid or unsupported crv option provided, supported values are Ed25519 and Ed448")}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":let n=null!==(i=null==t?void 0:t.crv)&&void 0!==i?i:"P-256";switch(n){case void 0:case"P-256":case"P-384":case"P-521":return l("ec",{namedCurve:n});case"X25519":return l("x25519");case"X448":return l("x448");default:throw new a.JOSENotSupported("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}default:throw new a.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}}t.generateSecret=c,t.generateKeyPair=u},5922:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCurve=t.weakMap=void 0;let i=r(4300),n=r(6113),o=r(3885),s=r(6261),a=r(4841),l=r(8289),c=r(2964),u=i.Buffer.from([42,134,72,206,61,3,1,7]),d=i.Buffer.from([43,129,4,0,34]),h=i.Buffer.from([43,129,4,0,35]),p=i.Buffer.from([43,129,4,0,10]);t.weakMap=new WeakMap;let f=e=>{switch(e){case"prime256v1":return"P-256";case"secp384r1":return"P-384";case"secp521r1":return"P-521";case"secp256k1":return"secp256k1";default:throw new o.JOSENotSupported("Unsupported key curve for this operation")}},y=(e,r)=>{var i;let g;if((0,s.isCryptoKey)(e))g=n.KeyObject.from(e);else if((0,a.default)(e))g=e;else throw TypeError((0,l.default)(e,...c.types));if("secret"===g.type)throw TypeError('only "private" or "public" type keys can be used for this operation');switch(g.asymmetricKeyType){case"ed25519":case"ed448":return`Ed${g.asymmetricKeyType.slice(2)}`;case"x25519":case"x448":return`X${g.asymmetricKeyType.slice(1)}`;case"ec":{if(t.weakMap.has(g))return t.weakMap.get(g);let e=null===(i=g.asymmetricKeyDetails)||void 0===i?void 0:i.namedCurve;if(e||"private"!==g.type){if(!e){let t=g.export({format:"der",type:"spki"}),r=t[1]<128?14:15,i=t[r],n=t.slice(r+1,r+1+i);if(n.equals(u))e="prime256v1";else if(n.equals(d))e="secp384r1";else if(n.equals(h))e="secp521r1";else if(n.equals(p))e="secp256k1";else throw new o.JOSENotSupported("Unsupported key curve for this operation")}}else e=y((0,n.createPublicKey)(g),!0);if(r)return e;let s=f(e);return t.weakMap.set(g,s),s}default:throw TypeError("Invalid asymmetric key type for this operation")}};t.setCurve=function(e,r){t.weakMap.set(e,r)},t.default=y},8069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113),n=r(6261),o=r(1347),s=r(8289),a=r(2964);t.default=function(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError((0,s.default)(t,...a.types));return(0,i.createSecretKey)(t)}if(t instanceof i.KeyObject)return t;if((0,n.isCryptoKey)(t))return(0,o.checkSigCryptoKey)(t,e,r),i.KeyObject.from(t);throw TypeError((0,s.default)(t,...a.types,"Uint8Array"))}},2614:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(3885);t.default=function(e){switch(e){case"HS256":return"sha256";case"HS384":return"sha384";case"HS512":return"sha512";default:throw new i.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},2964:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.types=void 0;let i=r(6261),n=r(4841);t.default=e=>(0,n.default)(e)||(0,i.isCryptoKey)(e);let o=["KeyObject"];t.types=o,(globalThis.CryptoKey||(null===i.default||void 0===i.default?void 0:i.default.CryptoKey))&&o.push("CryptoKey")},4841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113),n=r(3849);t.default=n.types.isKeyObject?e=>n.types.isKeyObject(e):e=>null!=e&&e instanceof i.KeyObject},9453:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(4300),n=r(6113),o=r(5803),s=r(3885),a=r(5922),l=r(6459),c=r(6217),u=r(7572);t.default=e=>{if(u.jwkImport&&"oct"!==e.kty)return e.d?(0,n.createPrivateKey)({format:"jwk",key:e}):(0,n.createPublicKey)({format:"jwk",key:e});switch(e.kty){case"oct":return(0,n.createSecretKey)((0,o.decode)(e.k));case"RSA":{let t=new c.default,r=void 0!==e.d,o=i.Buffer.from(e.n,"base64"),s=i.Buffer.from(e.e,"base64");r?(t.zero(),t.unsignedInteger(o),t.unsignedInteger(s),t.unsignedInteger(i.Buffer.from(e.d,"base64")),t.unsignedInteger(i.Buffer.from(e.p,"base64")),t.unsignedInteger(i.Buffer.from(e.q,"base64")),t.unsignedInteger(i.Buffer.from(e.dp,"base64")),t.unsignedInteger(i.Buffer.from(e.dq,"base64")),t.unsignedInteger(i.Buffer.from(e.qi,"base64"))):(t.unsignedInteger(o),t.unsignedInteger(s));let a={key:t.end(),format:"der",type:"pkcs1"},u=r?(0,n.createPrivateKey)(a):(0,n.createPublicKey)(a);return(0,l.setModulusLength)(u,o.length<<3),u}case"EC":{let t=new c.default,r=void 0!==e.d,o=i.Buffer.concat([i.Buffer.alloc(1,4),i.Buffer.from(e.x,"base64"),i.Buffer.from(e.y,"base64")]);if(r){t.zero();let r=new c.default;r.oidFor("ecPublicKey"),r.oidFor(e.crv),t.add(r.end());let s=new c.default;s.one(),s.octStr(i.Buffer.from(e.d,"base64"));let l=new c.default;l.bitStr(o);let u=l.end(i.Buffer.from([161]));s.add(u);let d=s.end(),h=new c.default;h.add(d);let p=h.end(i.Buffer.from([4]));t.add(p);let f=t.end(),y=(0,n.createPrivateKey)({key:f,format:"der",type:"pkcs8"});return(0,a.setCurve)(y,e.crv),y}let s=new c.default;s.oidFor("ecPublicKey"),s.oidFor(e.crv),t.add(s.end()),t.bitStr(o);let l=t.end(),u=(0,n.createPublicKey)({key:l,format:"der",type:"spki"});return(0,a.setCurve)(u,e.crv),u}case"OKP":{let t=new c.default;if(void 0!==e.d){t.zero();let r=new c.default;r.oidFor(e.crv),t.add(r.end());let o=new c.default;o.octStr(i.Buffer.from(e.d,"base64"));let s=o.end(i.Buffer.from([4]));t.add(s);let a=t.end();return(0,n.createPrivateKey)({key:a,format:"der",type:"pkcs8"})}let r=new c.default;r.oidFor(e.crv),t.add(r.end()),t.bitStr(i.Buffer.from(e.x,"base64"));let o=t.end();return(0,n.createPublicKey)({key:o,format:"der",type:"spki"})}default:throw new s.JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}}},7:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113),n=r(5803),o=r(8367),s=r(3885),a=r(5922),l=r(6261),c=r(4841),u=r(8289),d=r(2964),h=r(7572),p=e=>{let t;if((0,l.isCryptoKey)(e)){if(!e.extractable)throw TypeError("CryptoKey is not extractable");t=i.KeyObject.from(e)}else if((0,c.default)(e))t=e;else if(e instanceof Uint8Array)return{kty:"oct",k:(0,n.encode)(e)};else throw TypeError((0,u.default)(e,...d.types,"Uint8Array"));if(h.jwkExport){if("secret"!==t.type&&!["rsa","ec","ed25519","x25519","ed448","x448"].includes(t.asymmetricKeyType))throw new s.JOSENotSupported("Unsupported key asymmetricKeyType");return t.export({format:"jwk"})}switch(t.type){case"secret":return{kty:"oct",k:(0,n.encode)(t.export())};case"private":case"public":switch(t.asymmetricKeyType){case"rsa":{let e;let r=t.export({format:"der",type:"pkcs1"}),i=new o.default(r);"private"===t.type&&i.unsignedInteger();let s=(0,n.encode)(i.unsignedInteger()),a=(0,n.encode)(i.unsignedInteger());return"private"===t.type&&(e={d:(0,n.encode)(i.unsignedInteger()),p:(0,n.encode)(i.unsignedInteger()),q:(0,n.encode)(i.unsignedInteger()),dp:(0,n.encode)(i.unsignedInteger()),dq:(0,n.encode)(i.unsignedInteger()),qi:(0,n.encode)(i.unsignedInteger())}),i.end(),{kty:"RSA",n:s,e:a,...e}}case"ec":{let e,r,o;let l=(0,a.default)(t);switch(l){case"secp256k1":e=64,r=33,o=-1;break;case"P-256":e=64,r=36,o=-1;break;case"P-384":e=96,r=35,o=-3;break;case"P-521":e=132,r=35,o=-3;break;default:throw new s.JOSENotSupported("Unsupported curve")}if("public"===t.type){let r=t.export({type:"spki",format:"der"});return{kty:"EC",crv:l,x:(0,n.encode)(r.subarray(-e,-e/2)),y:(0,n.encode)(r.subarray(-e/2))}}let c=t.export({type:"pkcs8",format:"der"});return c.length<100&&(r+=o),{...p((0,i.createPublicKey)(t)),d:(0,n.encode)(c.subarray(r,r+e/2))}}case"ed25519":case"x25519":{let e=(0,a.default)(t);if("public"===t.type){let r=t.export({type:"spki",format:"der"});return{kty:"OKP",crv:e,x:(0,n.encode)(r.subarray(-32))}}let r=t.export({type:"pkcs8",format:"der"});return{...p((0,i.createPublicKey)(t)),d:(0,n.encode)(r.subarray(-32))}}case"ed448":case"x448":{let e=(0,a.default)(t);if("public"===t.type){let r=t.export({type:"spki",format:"der"});return{kty:"OKP",crv:e,x:(0,n.encode)(r.subarray("Ed448"===e?-57:-56))}}let r=t.export({type:"pkcs8",format:"der"});return{...p((0,i.createPublicKey)(t)),d:(0,n.encode)(r.subarray("Ed448"===e?-57:-56))}}default:throw new s.JOSENotSupported("Unsupported key asymmetricKeyType")}default:throw new s.JOSENotSupported("Unsupported key type")}};t.default=p},3583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113),n=r(5922),o=r(3885),s=r(6459),a=r(7572),l={padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},c=new Map([["ES256","P-256"],["ES256K","secp256k1"],["ES384","P-384"],["ES512","P-521"]]);t.default=function(e,t){switch(e){case"EdDSA":if(!["ed25519","ed448"].includes(t.asymmetricKeyType))throw TypeError("Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448");return t;case"RS256":case"RS384":case"RS512":if("rsa"!==t.asymmetricKeyType)throw TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");return(0,s.default)(t,e),t;case a.rsaPssParams&&"PS256":case a.rsaPssParams&&"PS384":case a.rsaPssParams&&"PS512":if("rsa-pss"===t.asymmetricKeyType){let{hashAlgorithm:r,mgf1HashAlgorithm:i,saltLength:n}=t.asymmetricKeyDetails,o=parseInt(e.slice(-3),10);if(void 0!==r&&(r!==`sha${o}`||i!==r))throw TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}`);if(void 0!==n&&n>o>>3)throw TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}`)}else if("rsa"!==t.asymmetricKeyType)throw TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss");return(0,s.default)(t,e),{key:t,...l};case!a.rsaPssParams&&"PS256":case!a.rsaPssParams&&"PS384":case!a.rsaPssParams&&"PS512":if("rsa"!==t.asymmetricKeyType)throw TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");return(0,s.default)(t,e),{key:t,...l};case"ES256":case"ES256K":case"ES384":case"ES512":{if("ec"!==t.asymmetricKeyType)throw TypeError("Invalid key for this operation, its asymmetricKeyType must be ec");let r=(0,n.default)(t),i=c.get(e);if(r!==i)throw TypeError(`Invalid key curve for the algorithm, its curve must be ${i}, got ${r}`);return{dsaEncoding:"ieee-p1363",key:t}}default:throw new o.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},4290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;let i=r(3849),n=r(6113),o=r(2088),s=r(3004),a=r(5803),l=r(9647),c=r(2617),u=r(6261),d=r(1347),h=r(4841),p=r(8289),f=r(2964),y=(0,i.promisify)(n.pbkdf2);function g(e,t){if((0,h.default)(e))return e.export();if(e instanceof Uint8Array)return e;if((0,u.isCryptoKey)(e))return(0,d.checkEncCryptoKey)(e,t,"deriveBits","deriveKey"),n.KeyObject.from(e).export();throw TypeError((0,p.default)(e,...f.types,"Uint8Array"))}let m=async(e,t,r,i=2048,n=(0,o.default)(new Uint8Array(16)))=>{(0,c.default)(n);let u=(0,s.p2s)(e,n),d=parseInt(e.slice(13,16),10)>>3,h=g(t,e),p=await y(h,u,i,d,`sha${e.slice(8,11)}`);return{encryptedKey:await (0,l.wrap)(e.slice(-6),p,r),p2c:i,p2s:(0,a.encode)(n)}};t.encrypt=m;let _=async(e,t,r,i,n)=>{(0,c.default)(n);let o=(0,s.p2s)(e,n),a=parseInt(e.slice(13,16),10)>>3,u=g(t,e),d=await y(u,o,i,a,`sha${e.slice(8,11)}`);return(0,l.unwrap)(e.slice(-6),d,r)};t.decrypt=_},2088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(6113);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.randomFillSync}})},5730:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;let i=r(6113),n=r(6459),o=r(6261),s=r(1347),a=r(4841),l=r(8289),c=r(2964),u=(e,t)=>{if("rsa"!==e.asymmetricKeyType)throw TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");(0,n.default)(e,t)},d=e=>{switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return i.constants.RSA_PKCS1_OAEP_PADDING;case"RSA1_5":return i.constants.RSA_PKCS1_PADDING;default:return}},h=e=>{switch(e){case"RSA-OAEP":return"sha1";case"RSA-OAEP-256":return"sha256";case"RSA-OAEP-384":return"sha384";case"RSA-OAEP-512":return"sha512";default:return}};function p(e,t,...r){if((0,a.default)(e))return e;if((0,o.isCryptoKey)(e))return(0,s.checkEncCryptoKey)(e,t,...r),i.KeyObject.from(e);throw TypeError((0,l.default)(e,...c.types))}t.encrypt=(e,t,r)=>{let n=d(e),o=h(e),s=p(t,e,"wrapKey","encrypt");return u(s,e),(0,i.publicEncrypt)({key:s,oaepHash:o,padding:n},r)},t.decrypt=(e,t,r)=>{let n=d(e),o=h(e),s=p(t,e,"unwrapKey","decrypt");return u(s,e),(0,i.privateDecrypt)({key:s,oaepHash:o,padding:n},r)}},9822:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="node:crypto"},7385:(e,t,r)=>{"use strict";let i;Object.defineProperty(t,"__esModule",{value:!0});let n=r(6113),o=r(3849),s=r(9583),a=r(2614),l=r(3583),c=r(8069);i=n.sign.length>3?(0,o.promisify)(n.sign):n.sign;let u=async(e,t,r)=>{let o=(0,c.default)(e,t,"sign");if(e.startsWith("HS")){let t=n.createHmac((0,a.default)(e),o);return t.update(r),t.digest()}return i((0,s.default)(e),r,(0,l.default)(e,o))};t.default=u},7292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(6113).timingSafeEqual;t.default=i},3458:(e,t,r)=>{"use strict";let i;Object.defineProperty(t,"__esModule",{value:!0});let n=r(6113),o=r(3849),s=r(9583),a=r(3583),l=r(7385),c=r(8069),u=r(7572);i=n.verify.length>4&&u.oneShotCallback?(0,o.promisify)(n.verify):n.verify;let d=async(e,t,r,o)=>{let u=(0,c.default)(e,t,"verify");if(e.startsWith("HS")){let t=await (0,l.default)(e,u,o);try{return n.timingSafeEqual(r,t)}catch{return!1}}let d=(0,s.default)(e),h=(0,a.default)(e,u);try{return await i(d,o,h,r)}catch{return!1}};t.default=d},6261:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCryptoKey=void 0;let i=r(6113),n=r(3849),o=i.webcrypto;t.default=o,t.isCryptoKey=n.types.isCryptoKey?e=>n.types.isCryptoKey(e):e=>!1},4652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deflate=t.inflate=void 0;let i=r(3849),n=r(9796),o=(0,i.promisify)(n.inflateRaw),s=(0,i.promisify)(n.deflateRaw);t.inflate=e=>o(e),t.deflate=e=>s(e)},3225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;let i=r(5803);t.encode=i.encode,t.decode=i.decode},9541:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeJwt=void 0;let i=r(3225),n=r(3004),o=r(8906),s=r(3885);t.decodeJwt=function(e){let t,r;if("string"!=typeof e)throw new s.JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");let{1:a,length:l}=e.split(".");if(5===l)throw new s.JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");if(3!==l)throw new s.JWTInvalid("Invalid JWT");if(!a)throw new s.JWTInvalid("JWTs must contain a payload");try{t=(0,i.decode)(a)}catch{throw new s.JWTInvalid("Failed to base64url decode the payload")}try{r=JSON.parse(n.decoder.decode(t))}catch{throw new s.JWTInvalid("Failed to parse the decoded payload as JSON")}if(!(0,o.default)(r))throw new s.JWTInvalid("Invalid JWT Claims Set");return r}},9472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeProtectedHeader=void 0;let i=r(3225),n=r(3004),o=r(8906);t.decodeProtectedHeader=function(e){let t;if("string"==typeof e){let r=e.split(".");(3===r.length||5===r.length)&&([t]=r)}else if("object"==typeof e&&e){if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header")}try{if("string"!=typeof t||!t)throw Error();let e=JSON.parse(n.decoder.decode((0,i.decode)(t)));if(!(0,o.default)(e))throw Error();return e}catch{throw TypeError("Invalid Token or Protected Header formatting")}}},3885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JWSSignatureVerificationFailed=t.JWKSTimeout=t.JWKSMultipleMatchingKeys=t.JWKSNoMatchingKey=t.JWKSInvalid=t.JWKInvalid=t.JWTInvalid=t.JWSInvalid=t.JWEInvalid=t.JWEDecryptionFailed=t.JOSENotSupported=t.JOSEAlgNotAllowed=t.JWTExpired=t.JWTClaimValidationFailed=t.JOSEError=void 0;class r extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}t.JOSEError=r;class i extends r{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}t.JWTClaimValidationFailed=i;class n extends r{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}t.JWTExpired=n;class o extends r{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}t.JOSEAlgNotAllowed=o;class s extends r{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}t.JOSENotSupported=s;class a extends r{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}t.JWEDecryptionFailed=a;class l extends r{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}t.JWEInvalid=l;class c extends r{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}t.JWSInvalid=c;class u extends r{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}t.JWTInvalid=u;class d extends r{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}t.JWKInvalid=d;class h extends r{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}t.JWKSInvalid=h;class p extends r{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}t.JWKSNoMatchingKey=p;class f extends r{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}t.JWKSMultipleMatchingKeys=f,Symbol.asyncIterator;class y extends r{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}t.JWKSTimeout=y;class g extends r{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}t.JWSSignatureVerificationFailed=g},6537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(9822);t.default=i.default},8852:(e,t,r)=>{"use strict";let i=r(4634),n=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1;class y{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw TypeError("max must be a non-negative number");this[n]=e.max||1/0;let t=e.length||f;if(this[s]="function"!=typeof t?f:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=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[n]=e||1/0,_(this)}get max(){return this[n]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw TypeError("maxAge must be a non-negative number");this[l]=e,_(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[s]&&(this[s]=e,this[o]=0,this[d].forEach(e=>{e.length=this[s](e.value,e.key),this[o]+=e.length})),_(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;null!==r;){let i=r.prev;b(this,e,r,t),r=i}}forEach(e,t){t=t||this;for(let r=this[d].head;null!==r;){let i=r.next;b(this,e,r,t),r=i}}keys(){return this[d].toArray().map(e=>e.key)}values(){return this[d].toArray().map(e=>e.value)}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach(e=>this[c](e.key,e.value)),this[h]=new Map,this[d]=new i,this[o]=0}dump(){return this[d].map(e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[d]}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,a=this[s](t,e);if(this[h].has(e)){if(a>this[n])return v(this,this[h].get(e)),!1;let s=this[h].get(e).value;return this[c]&&!this[u]&&this[c](e,s.value),s.now=i,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),_(this),!0}let p=new w(e,t,a,i,r);return p.length>this[n]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[d].unshift(p),this[h].set(e,this[d].head),_(this),!0)}has(e){return!!this[h].has(e)&&!m(this,this[h].get(e).value)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){let e=this[d].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[h].get(e))}load(e){this.reset();let t=Date.now();for(let r=e.length-1;r>=0;r--){let i=e[r],n=i.e||0;if(0===n)this.set(i.k,i.v);else{let e=n-t;e>0&&this.set(i.k,i.v,e)}}}prune(){this[h].forEach((e,t)=>g(this,t,!1))}}let g=(e,t,r)=>{let i=e[h].get(t);if(i){let t=i.value;if(m(e,t)){if(v(e,i),!e[a])return}else r&&(e[p]&&(i.value.now=Date.now()),e[d].unshiftNode(i));return t.value}},m=(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]},_=e=>{if(e[o]>e[n])for(let t=e[d].tail;e[o]>e[n]&&null!==t;){let r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){let r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[h].delete(r.key),e[d].removeNode(t)}};class w{constructor(e,t,r,i,n){this.key=e,this.value=t,this.length=r,this.now=i,this.maxAge=n||0}}let b=(e,t,r,i)=>{let n=r.value;m(e,n)&&(v(e,r),e[a]||(n=void 0)),n&&t.call(i,n.value,n.key,e)};e.exports=y},2394:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedStrategy=t.UnknownError=t.OAuthCallbackError=t.MissingSecret=t.MissingAuthorize=t.MissingAdapterMethods=t.MissingAdapter=t.MissingAPIRoute=t.InvalidCallbackUrl=t.AccountNotLinkedError=void 0,t.adapterErrorHandler=function(e,t){if(e)return Object.keys(e).reduce(function(r,i){return r[i]=(0,o.default)(n.default.mark(function r(){var o,s,a,l,c,u=arguments;return n.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:for(r.prev=0,s=Array(o=u.length),a=0;a{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.AuthHandler=g;var n=p(r(5387)),o=r(7885),s=p(r(8024)),a=i(r(5858)),l=r(3833),c=r(4538),u=r(2486),d=r(7162);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}async function f(e){try{return await e.json()}catch(e){}}async function y(e){var t,r,i,n;if(e instanceof Request){let t=new URL(e.url),s=t.pathname.split("/").slice(3),a=Object.fromEntries(e.headers),l=Object.fromEntries(t.searchParams);return l.nextauth=s,{action:s[0],method:e.method,headers:a,body:await f(e),cookies:(0,d.parse)(null!==(r=e.headers.get("cookie"))&&void 0!==r?r:""),providerId:s[1],error:null!==(i=t.searchParams.get("error"))&&void 0!==i?i:s[1],origin:(0,o.detectOrigin)(null!==(n=a["x-forwarded-host"])&&void 0!==n?n:a.host,a["x-forwarded-proto"]),query:l}}let{headers:s}=e,a=null!==(t=null==s?void 0:s["x-forwarded-host"])&&void 0!==t?t:null==s?void 0:s.host;return e.origin=(0,o.detectOrigin)(a,null==s?void 0:s["x-forwarded-proto"]),e}async function g(e){var t,r,i,o,d,h,p,f;let{options:g,req:m}=e,_=await y(m);(0,n.setLogger)(g.logger,g.debug);let v=(0,c.assertConfig)({options:g,req:_});if(Array.isArray(v))v.forEach(n.default.warn);else if(v instanceof Error){if(n.default.error(v.code,v),!["signin","signout","error","verify-request"].includes(_.action)||"GET"!==_.method)return{status:500,headers:[{key:"Content-Type",value:"application/json"}],body:{message:"There is a problem with the server configuration. Check the server logs for more information."}};let{pages:e,theme:t}=g,r=(null==e?void 0:e.error)&&(null===(d=_.query)||void 0===d?void 0:null===(h=d.callbackUrl)||void 0===h?void 0:h.startsWith(e.error));return!(null!=e&&e.error)||r?(r&&n.default.error("AUTH_ON_ERROR_PAGE_ERROR",Error(`The error page ${null==e?void 0:e.error} should not require authentication`)),(0,a.default)({theme:t}).error({error:"configuration"})):{redirect:`${e.error}?error=Configuration`}}let{action:w,providerId:b,error:S,method:k="GET"}=_,{options:E,cookies:A}=await (0,l.init)({authOptions:g,action:w,providerId:b,origin:_.origin,callbackUrl:null!==(t=null===(r=_.body)||void 0===r?void 0:r.callbackUrl)&&void 0!==t?t:null===(i=_.query)||void 0===i?void 0:i.callbackUrl,csrfToken:null===(o=_.body)||void 0===o?void 0:o.csrfToken,cookies:_.cookies,isPost:"POST"===k}),x=new u.SessionStore(E.cookies.sessionToken,_,E.logger);if("GET"===k){let e=(0,a.default)({...E,query:_.query,cookies:A}),{pages:t}=E;switch(w){case"providers":return await s.providers(E.providers);case"session":{let e=await s.session({options:E,sessionStore:x});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}case"csrf":return{headers:[{key:"Content-Type",value:"application/json"}],body:{csrfToken:E.csrfToken},cookies:A};case"signin":if(t.signIn){let e=`${t.signIn}${t.signIn.includes("?")?"&":"?"}callbackUrl=${encodeURIComponent(E.callbackUrl)}`;return S&&(e=`${e}&error=${encodeURIComponent(S)}`),{redirect:e,cookies:A}}return e.signin();case"signout":if(t.signOut)return{redirect:t.signOut,cookies:A};return e.signout();case"callback":if(E.provider){let e=await s.callback({body:_.body,query:_.query,headers:_.headers,cookies:_.cookies,method:k,options:E,sessionStore:x});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}break;case"verify-request":if(t.verifyRequest)return{redirect:t.verifyRequest,cookies:A};return e.verifyRequest();case"error":if(["Signin","OAuthSignin","OAuthCallback","OAuthCreateAccount","EmailCreateAccount","Callback","OAuthAccountNotLinked","EmailSignin","CredentialsSignin","SessionRequired"].includes(S))return{redirect:`${E.url}/signin?error=${S}`,cookies:A};if(t.error)return{redirect:`${t.error}${t.error.includes("?")?"&":"?"}error=${S}`,cookies:A};return e.error({error:S})}}else if("POST"===k)switch(w){case"signin":if(E.csrfTokenVerified&&E.provider){let e=await s.signin({query:_.query,body:_.body,options:E});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}return{redirect:`${E.url}/signin?csrf=true`,cookies:A};case"signout":if(E.csrfTokenVerified){let e=await s.signout({options:E,sessionStore:x});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}return{redirect:`${E.url}/signout?csrf=true`,cookies:A};case"callback":if(E.provider){if("credentials"===E.provider.type&&!E.csrfTokenVerified)return{redirect:`${E.url}/signin?csrf=true`,cookies:A};let e=await s.callback({body:_.body,query:_.query,headers:_.headers,cookies:_.cookies,method:k,options:E,sessionStore:x});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}break;case"_log":if(g.logger)try{let{code:e,level:t,...r}=null!==(p=_.body)&&void 0!==p?p:{};n.default[t](e,r)}catch(e){n.default.error("LOGGER_ERROR",e)}return{};case"session":if(E.csrfTokenVerified){let e=await s.session({options:E,sessionStore:x,newSession:null===(f=_.body)||void 0===f?void 0:f.data,isUpdate:!0});return e.cookies&&A.push(...e.cookies),{...e,cookies:A}}return{status:400,body:{},cookies:A}}return{status:400,body:`Error: This action with HTTP ${k} is not supported by NextAuth.js`}}},3833:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.init=m;var n=r(6113),o=i(r(5387)),s=r(2394),a=i(r(412)),l=r(9001),c=g(r(2486)),u=g(r(1609)),d=r(6599),h=r(3378),p=r(3266),f=i(r(550));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}async function m({authOptions:e,providerId:t,action:r,origin:i,cookies:y,callbackUrl:g,csrfToken:m,isPost:_}){var v,w;let b=(0,f.default)(i),S=(0,l.createSecret)({authOptions:e,url:b}),{providers:k,provider:E}=(0,a.default)({providers:e.providers,url:b,providerId:t}),A={debug:!1,pages:{},theme:{colorScheme:"auto",logo:"",brandColor:"",buttonText:""},...e,url:b,action:r,provider:E,cookies:{...c.defaultCookies(null!==(v=e.useSecureCookies)&&void 0!==v?v:b.base.startsWith("https://")),...e.cookies},secret:S,providers:k,session:{strategy:e.adapter?"database":"jwt",maxAge:2592e3,updateAge:86400,generateSessionToken:()=>{var e;return null!==(e=null===n.randomUUID||void 0===n.randomUUID?void 0:(0,n.randomUUID)())&&void 0!==e?e:(0,n.randomBytes)(32).toString("hex")},...e.session},jwt:{secret:S,maxAge:2592e3,encode:u.encode,decode:u.decode,...e.jwt},events:(0,s.eventsErrorHandler)(null!==(w=e.events)&&void 0!==w?w:{},o.default),adapter:(0,s.adapterErrorHandler)(e.adapter,o.default),callbacks:{...d.defaultCallbacks,...e.callbacks},logger:o.default,callbackUrl:b.origin},x=[],{csrfToken:O,cookie:T,csrfTokenVerified:P}=(0,h.createCSRFToken)({options:A,cookieValue:null==y?void 0:y[A.cookies.csrfToken.name],isPost:_,bodyValue:m});A.csrfToken=O,A.csrfTokenVerified=P,T&&x.push({name:A.cookies.csrfToken.name,value:T,options:A.cookies.csrfToken.options});let{callbackUrl:j,callbackUrlCookie:C}=await (0,p.createCallbackUrl)({options:A,cookieValue:null==y?void 0:y[A.cookies.callbackUrl.name],paramValue:g});return A.callbackUrl=j,C&&x.push({name:A.cookies.callbackUrl.name,value:C,options:A.cookies.callbackUrl.options}),{options:A,cookies:x}}},4538:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.assertConfig=function(e){var t,r,i,c,u,d,h,p;let f,y,g;let{options:m,req:_}=e,v=[];if(!a&&(_.origin||v.push("NEXTAUTH_URL"),m.secret,m.debug&&v.push("DEBUG_ENABLED")),!m.secret)return new n.MissingSecret("Please define a `secret` in production.");if(!(null!==(t=_.query)&&void 0!==t&&t.nextauth)&&!_.action)return new n.MissingAPIRoute("Cannot find [...nextauth].{js,ts} in `/pages/api/auth`. Make sure the filename is written correctly.");let w=null===(r=_.query)||void 0===r?void 0:r.callbackUrl,b=(0,o.default)(_.origin);if(w&&!l(w,b.base))return new n.InvalidCallbackUrl(`Invalid callback URL. Received: ${w}`);let{callbackUrl:S}=(0,s.defaultCookies)(null!==(i=m.useSecureCookies)&&void 0!==i?i:b.base.startsWith("https://")),k=null===(c=_.cookies)||void 0===c?void 0:c[null!==(u=null===(d=m.cookies)||void 0===d?void 0:null===(h=d.callbackUrl)||void 0===h?void 0:h.name)&&void 0!==u?u:S.name];if(k&&!l(k,b.base))return new n.InvalidCallbackUrl(`Invalid callback URL. Received: ${k}`);for(let e of m.providers)"credentials"===e.type?f=!0:"email"===e.type?y=!0:"twitter"===e.id&&"2.0"===e.version&&(g=!0);if(f){let e=(null===(p=m.session)||void 0===p?void 0:p.strategy)==="database",t=!m.providers.some(e=>"credentials"!==e.type);if(e&&t)return new n.UnsupportedStrategy("Signin in with credentials only supported if JWT strategy is enabled");if(m.providers.some(e=>"credentials"===e.type&&!e.authorize))return new n.MissingAuthorize("Must define an authorize() handler to use credentials authentication provider")}if(y){let{adapter:e}=m;if(!e)return new n.MissingAdapter("E-mail login requires an adapter.");let t=["createVerificationToken","useVerificationToken","getUserByEmail"].filter(t=>!e[t]);if(t.length)return new n.MissingAdapterMethods(`Required adapter methods were missing: ${t.join(", ")}`)}return a||(g&&v.push("TWITTER_OAUTH_2_BETA"),a=!0),v};var n=r(2394),o=i(r(550)),s=r(2486);let a=!1;function l(e,t){try{return/^https?:/.test(new URL(e,e.startsWith("/")?t:void 0).protocol)}catch(e){return!1}}},1553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(2394),n=r(9001);async function o(e){var t,r,o,s,a,l;let{sessionToken:c,profile:u,account:d,options:h}=e;if(!(null!=d&&d.providerAccountId)||!d.type)throw Error("Missing or invalid provider account");if(!["email","oauth"].includes(d.type))throw Error("Provider not supported");let{adapter:p,jwt:f,events:y,session:{strategy:g,generateSessionToken:m}}=h;if(!p)return{user:u,account:d};let{createUser:_,updateUser:v,getUser:w,getUserByAccount:b,getUserByEmail:S,linkAccount:k,createSession:E,getSessionAndUser:A,deleteSession:x}=p,O=null,T=null,P=!1,j="jwt"===g;if(c){if(j)try{(O=await f.decode({...f,token:c}))&&"sub"in O&&O.sub&&(T=await w(O.sub))}catch(e){}else{let e=await A(c);e&&(O=e.session,T=e.user)}}if("email"===d.type){let e=await S(u.email);if(e)(null===(t=T)||void 0===t?void 0:t.id)!==e.id&&!j&&c&&await x(c),T=await v({id:e.id,emailVerified:new Date}),await (null===(r=y.updateUser)||void 0===r?void 0:r.call(y,{user:T}));else{let{id:e,...t}={...u,emailVerified:new Date};T=await _(t),await (null===(o=y.createUser)||void 0===o?void 0:o.call(y,{user:T})),P=!0}return{session:O=j?{}:await E({sessionToken:await m(),userId:T.id,expires:(0,n.fromDate)(h.session.maxAge)}),user:T,isNewUser:P}}if("oauth"===d.type){let e=await b({providerAccountId:d.providerAccountId,provider:d.provider});if(e){if(T){if(e.id===T.id)return{session:O,user:T,isNewUser:P};throw new i.AccountNotLinkedError("The account is already associated with another user")}return{session:O=j?{}:await E({sessionToken:await m(),userId:e.id,expires:(0,n.fromDate)(h.session.maxAge)}),user:e,isNewUser:P}}{if(T)return await k({...d,userId:T.id}),await (null===(l=y.linkAccount)||void 0===l?void 0:l.call(y,{user:T,account:d,profile:u})),{session:O,user:T,isNewUser:P};let e=u.email?await S(u.email):null;if(e){let t=h.provider;if(null!=t&&t.allowDangerousEmailAccountLinking)T=e;else throw new i.AccountNotLinkedError("Another account already exists with the same e-mail address")}else{let{id:e,...t}={...u,emailVerified:null};T=await _(t)}return await (null===(s=y.createUser)||void 0===s?void 0:s.call(y,{user:T})),await k({...d,userId:T.id}),await (null===(a=y.linkAccount)||void 0===a?void 0:a.call(y,{user:T,account:d,profile:u})),{session:O=j?{}:await E({sessionToken:await m(),userId:T.id,expires:(0,n.fromDate)(h.session.maxAge)}),user:T,isNewUser:!0}}}throw Error("Unsupported account type")}},3266:(e,t)=>{"use strict";async function r({options:e,paramValue:t,cookieValue:r}){let{url:i,callbacks:n}=e,o=i.origin;return t?o=await n.redirect({url:t,baseUrl:i.origin}):r&&(o=await n.redirect({url:r,baseUrl:i.origin})),{callbackUrl:o,callbackUrlCookie:o!==r?o:void 0}}Object.defineProperty(t,"__esModule",{value:!0}),t.createCallbackUrl=r},2486:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.SessionStore=void 0,t.defaultCookies=function(e){let t=e?"__Secure-":"";return{sessionToken:{name:`${t}next-auth.session-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},callbackUrl:{name:`${t}next-auth.callback-url`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},csrfToken:{name:`${e?"__Host-":""}next-auth.csrf-token`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}},pkceCodeVerifier:{name:`${t}next-auth.pkce.code_verifier`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},state:{name:`${t}next-auth.state`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e,maxAge:900}},nonce:{name:`${t}next-auth.nonce`,options:{httpOnly:!0,sameSite:"lax",path:"/",secure:e}}}};var n=i(r(7972)),o=i(r(3203));function s(e,t){l(e,t),t.add(e)}function a(e,t,r){l(e,t),t.set(e,r)}function l(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function c(e,t,r){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return r}var u=new WeakMap,d=new WeakMap,h=new WeakMap,p=new WeakSet,f=new WeakSet;class y{constructor(e,t,r){s(this,f),s(this,p),a(this,u,{writable:!0,value:{}}),a(this,d,{writable:!0,value:void 0}),a(this,h,{writable:!0,value:void 0}),(0,o.default)(this,h,r),(0,o.default)(this,d,e);let{cookies:i}=t,{name:l}=e;if("function"==typeof(null==i?void 0:i.getAll))for(let{name:e,value:t}of i.getAll())e.startsWith(l)&&((0,n.default)(this,u)[e]=t);else if(i instanceof Map)for(let e of i.keys())e.startsWith(l)&&((0,n.default)(this,u)[e]=i.get(e));else for(let e in i)e.startsWith(l)&&((0,n.default)(this,u)[e]=i[e])}get value(){return Object.keys((0,n.default)(this,u)).sort((e,t)=>{var r,i;return parseInt(null!==(r=e.split(".").pop())&&void 0!==r?r:"0")-parseInt(null!==(i=t.split(".").pop())&&void 0!==i?i:"0")}).map(e=>(0,n.default)(this,u)[e]).join("")}chunk(e,t){let r=c(this,f,m).call(this);for(let i of c(this,p,g).call(this,{name:(0,n.default)(this,d).name,value:e,options:{...(0,n.default)(this,d).options,...t}}))r[i.name]=i;return Object.values(r)}clean(){return Object.values(c(this,f,m).call(this))}}function g(e){let t=Math.ceil(e.value.length/3933);if(1===t)return(0,n.default)(this,u)[e.name]=e.value,[e];let r=[];for(let i=0;ie.value.length+163)}),r}function m(){let e={};for(let r in(0,n.default)(this,u)){var t;null===(t=(0,n.default)(this,u))||void 0===t||delete t[r],e[r]={name:r,value:"",options:{...(0,n.default)(this,d).options,maxAge:0}}}return e}t.SessionStore=y},3378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCSRFToken=function({options:e,cookieValue:t,isPost:r,bodyValue:n}){if(t){let[o,s]=t.split("|");if(s===(0,i.createHash)("sha256").update(`${o}${e.secret}`).digest("hex"))return{csrfTokenVerified:r&&o===n,csrfToken:o}}let o=(0,i.randomBytes)(32).toString("hex"),s=(0,i.createHash)("sha256").update(`${o}${e.secret}`).digest("hex");return{cookie:`${o}|${s}`,csrfToken:o}};var i=r(6113)},6599:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultCallbacks=void 0,t.defaultCallbacks={signIn:()=>!0,redirect:({url:e,baseUrl:t})=>e.startsWith("/")?`${t}${e}`:new URL(e).origin===t?e:t,session:({session:e})=>e,jwt:({token:e})=>e}},8832:(e,t)=>{"use strict";async function r({email:e,adapter:t}){let{getUserByEmail:r}=t;return(e?await r(e):null)||{id:e,email:e,emailVerified:null}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},9278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=r(6113),n=r(9001);async function o(e,t){var r,o,s,a;let{url:l,adapter:c,provider:u,callbackUrl:d,theme:h}=t,p=null!==(r=await (null===(o=u.generateVerificationToken)||void 0===o?void 0:o.call(u)))&&void 0!==r?r:(0,i.randomBytes)(32).toString("hex"),f=new Date(Date.now()+(null!==(s=u.maxAge)&&void 0!==s?s:86400)*1e3),y=new URLSearchParams({callbackUrl:d,token:p,email:e}),g=`${l}/callback/${u.id}?${y}`;return await Promise.all([u.sendVerificationRequest({identifier:e,token:p,expires:f,url:g,provider:u,theme:h}),null===(a=c.createVerificationToken)||void 0===a?void 0:a.call(c,{identifier:e,token:(0,n.hashToken)(p,t),expires:f})]),`${l}/verify-request?${new URLSearchParams({provider:u.id,type:u.type})}`}},9581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=r(1934),n=r(7801),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(r(7681));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}async function a({options:e,query:t}){var r,s,a;let{logger:l,provider:c}=e,u={};if("string"==typeof c.authorization){let e=Object.fromEntries(new URL(c.authorization).searchParams);u={...u,...e}}else u={...u,...null===(s=c.authorization)||void 0===s?void 0:s.params};if(u={...u,...t},null!==(r=c.version)&&void 0!==r&&r.startsWith("1.")){let t=(0,n.oAuth1Client)(e),r=await t.getOAuthRequestToken(u),i=`${null===(a=c.authorization)||void 0===a?void 0:a.url}?${new URLSearchParams({oauth_token:r.oauth_token,oauth_token_secret:r.oauth_token_secret,...r.params})}`;return n.oAuth1TokenStore.set(r.oauth_token,r.oauth_token_secret),l.debug("GET_AUTHORIZATION_URL",{url:i,provider:c}),{redirect:i}}let d=await (0,i.openidClient)(e),h=u,p=[];await o.state.create(e,p,h),await o.pkce.create(e,p,h),await o.nonce.create(e,p,h);let f=d.authorizationUrl(h);return l.debug("GET_AUTHORIZATION_URL",{url:f,cookies:p,provider:c}),{redirect:f,cookies:p}}},9656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var i=r(5684),n=r(1934),o=r(7801),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(r(7681)),a=r(2394);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}async function c(e){var t,r,l,c,d,h;let{options:p,query:f,body:y,method:g,cookies:m}=e,{logger:_,provider:v}=p,w=null!==(t=null==y?void 0:y.error)&&void 0!==t?t:null==f?void 0:f.error;if(w){let e=Error(w);throw _.error("OAUTH_CALLBACK_HANDLER_ERROR",{error:e,error_description:null==f?void 0:f.error_description,providerId:v.id}),_.debug("OAUTH_CALLBACK_HANDLER_ERROR",{body:y}),e}if(null!==(r=v.version)&&void 0!==r&&r.startsWith("1."))try{let e=await (0,o.oAuth1Client)(p),{oauth_token:t,oauth_verifier:r}=null!=f?f:{},i=await e.getOAuthAccessToken(t,o.oAuth1TokenStore.get(t),r),n=await e.get(v.profileUrl,i.oauth_token,i.oauth_token_secret);return"string"==typeof n&&(n=JSON.parse(n)),{...await u({profile:n,tokens:i,provider:v,logger:_}),cookies:[]}}catch(e){throw _.error("OAUTH_V1_GET_ACCESS_TOKEN_ERROR",e),e}null!=f&&f.oauth_token&&o.oAuth1TokenStore.delete(f.oauth_token);try{let e,t;let r=await (0,n.openidClient)(p),o={},a=[];await s.state.use(m,a,p,o),await s.pkce.use(m,a,p,o),await s.nonce.use(m,a,p,o);let w={...r.callbackParams({url:`http://n?${new URLSearchParams(f)}`,body:y,method:g}),...null===(l=v.token)||void 0===l?void 0:l.params};if(null!==(c=v.token)&&void 0!==c&&c.request){let t=await v.token.request({provider:v,params:w,checks:o,client:r});e=new i.TokenSet(t.tokens)}else e=v.idToken?await r.callback(v.callbackUrl,w,o):await r.oauthCallback(v.callbackUrl,w,o);return Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),t=null!==(d=v.userinfo)&&void 0!==d&&d.request?await v.userinfo.request({provider:v,tokens:e,client:r}):v.idToken?e.claims():await r.userinfo(e,{params:null===(h=v.userinfo)||void 0===h?void 0:h.params}),{...await u({profile:t,provider:v,tokens:e,logger:_}),cookies:a}}catch(e){throw new a.OAuthCallbackError(e)}}async function u({profile:e,tokens:t,provider:r,logger:i}){try{var n;i.debug("PROFILE_DATA",{OAuthProfile:e});let o=await r.profile(e,t);if(o.email=null===(n=o.email)||void 0===n?void 0:n.toLowerCase(),!o.id)throw TypeError(`Profile id is missing in ${r.name} OAuth profile response`);return{profile:o,account:{provider:r.id,type:r.type,providerAccountId:o.id.toString(),...t},OAuthProfile:e}}catch(t){i.error("OAUTH_PARSE_PROFILE_ERROR",{error:t,OAuthProfile:e})}}},7681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pkce=t.nonce=t.PKCE_CODE_CHALLENGE_METHOD=void 0,t.signCookie=s,t.state=void 0;var i=r(5684),n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(1609));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}async function s(e,t,r,i){let{cookies:o,logger:s}=i;s.debug(`CREATE_${e.toUpperCase()}`,{value:t,maxAge:r});let{name:a}=o[e],l=new Date;return l.setTime(l.getTime()+1e3*r),{name:a,value:await n.encode({...i.jwt,maxAge:r,token:{value:t},salt:a}),options:{...o[e].options,expires:l}}}let a="S256";t.PKCE_CODE_CHALLENGE_METHOD=a,t.pkce={async create(e,t,r){var n,o,l;if(!(null!==(n=e.provider)&&void 0!==n&&null!==(o=n.checks)&&void 0!==o&&o.includes("pkce")))return;let c=i.generators.codeVerifier(),u=i.generators.codeChallenge(c);r.code_challenge=u,r.code_challenge_method=a;let d=null!==(l=e.cookies.pkceCodeVerifier.options.maxAge)&&void 0!==l?l:900;t.push(await s("pkceCodeVerifier",c,d,e))},async use(e,t,r,i){var o,s;if(!(null!==(o=r.provider)&&void 0!==o&&null!==(s=o.checks)&&void 0!==s&&s.includes("pkce")))return;let a=null==e?void 0:e[r.cookies.pkceCodeVerifier.name];if(!a)throw TypeError("PKCE code_verifier cookie was missing.");let{name:l}=r.cookies.pkceCodeVerifier,c=await n.decode({...r.jwt,token:a,salt:l});if(!(null!=c&&c.value))throw TypeError("PKCE code_verifier value could not be parsed.");t.push({name:l,value:"",options:{...r.cookies.pkceCodeVerifier.options,maxAge:0}}),i.code_verifier=c.value}},t.state={async create(e,t,r){var n,o;if(!(null!==(n=e.provider.checks)&&void 0!==n&&n.includes("state")))return;let a=i.generators.state();r.state=a;let l=null!==(o=e.cookies.state.options.maxAge)&&void 0!==o?o:900;t.push(await s("state",a,l,e))},async use(e,t,r,i){var o;if(!(null!==(o=r.provider.checks)&&void 0!==o&&o.includes("state")))return;let s=null==e?void 0:e[r.cookies.state.name];if(!s)throw TypeError("State cookie was missing.");let{name:a}=r.cookies.state,l=await n.decode({...r.jwt,token:s,salt:a});if(!(null!=l&&l.value))throw TypeError("State value could not be parsed.");t.push({name:a,value:"",options:{...r.cookies.state.options,maxAge:0}}),i.state=l.value}},t.nonce={async create(e,t,r){var n,o;if(!(null!==(n=e.provider.checks)&&void 0!==n&&n.includes("nonce")))return;let a=i.generators.nonce();r.nonce=a;let l=null!==(o=e.cookies.nonce.options.maxAge)&&void 0!==o?o:900;t.push(await s("nonce",a,l,e))},async use(e,t,r,i){var o,s;if(!(null!==(o=r.provider)&&void 0!==o&&null!==(s=o.checks)&&void 0!==s&&s.includes("nonce")))return;let a=null==e?void 0:e[r.cookies.nonce.name];if(!a)throw TypeError("Nonce cookie was missing.");let{name:l}=r.cookies.nonce,c=await n.decode({...r.jwt,token:a,salt:l});if(!(null!=c&&c.value))throw TypeError("Nonce value could not be parsed.");t.push({name:l,value:"",options:{...r.cookies.nonce.options,maxAge:0}}),i.nonce=c.value}}},7801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.oAuth1Client=function(e){var t,r;let n=e.provider,o=new i.OAuth(n.requestTokenUrl,n.accessTokenUrl,n.clientId,n.clientSecret,null!==(t=n.version)&&void 0!==t?t:"1.0",n.callbackUrl,null!==(r=n.encoding)&&void 0!==r?r:"HMAC-SHA1"),s=o.get.bind(o);o.get=async(...e)=>await new Promise((t,r)=>{s(...e,(e,i)=>{if(e)return r(e);t(i)})});let a=o.getOAuthAccessToken.bind(o);o.getOAuthAccessToken=async(...e)=>await new Promise((t,r)=>{a(...e,(e,i,n)=>{if(e)return r(e);t({oauth_token:i,oauth_token_secret:n})})});let l=o.getOAuthRequestToken.bind(o);return o.getOAuthRequestToken=async(e={})=>await new Promise((t,r)=>{l(e,(e,i,n,o)=>{if(e)return r(e);t({oauth_token:i,oauth_token_secret:n,params:o})})}),o},t.oAuth1TokenStore=void 0;var i=r(3990);let n=new Map;t.oAuth1TokenStore=n},1934:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openidClient=n;var i=r(5684);async function n(e){let t;let r=e.provider;if(r.httpOptions&&i.custom.setHttpOptionsDefaults(r.httpOptions),r.wellKnown)t=await i.Issuer.discover(r.wellKnown);else{var n,o,s;t=new i.Issuer({issuer:r.issuer,authorization_endpoint:null===(n=r.authorization)||void 0===n?void 0:n.url,token_endpoint:null===(o=r.token)||void 0===o?void 0:o.url,userinfo_endpoint:null===(s=r.userinfo)||void 0===s?void 0:s.url,jwks_uri:r.jwks_endpoint})}let a=new t.Client({client_id:r.clientId,client_secret:r.clientSecret,redirect_uris:[r.callbackUrl],...r.client},r.jwks);return a[i.custom.clock_tolerance]=10,a}},412:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{url:t,providerId:r}=e,o=e.providers.map(({options:e,...r})=>{var o,s;if("oauth"===r.type){let o=n(r),a=n(e,!0),l=null!==(s=null==a?void 0:a.id)&&void 0!==s?s:r.id;return(0,i.merge)(o,{...a,signinUrl:`${t}/signin/${l}`,callbackUrl:`${t}/callback/${l}`})}let a=null!==(o=null==e?void 0:e.id)&&void 0!==o?o:r.id;return(0,i.merge)(r,{...e,signinUrl:`${t}/signin/${a}`,callbackUrl:`${t}/callback/${a}`})});return{providers:o,provider:o.find(({id:e})=>e===r)}};var i=r(7838);function n(e,t=!1){var r,i,n,o,s,a,l;if(!e)return;let c=Object.entries(e).reduce((e,[t,r])=>{if(["authorization","token","userinfo"].includes(t)&&"string"==typeof r){var i;let n=new URL(r);e[t]={url:`${n.origin}${n.pathname}`,params:Object.fromEntries(null!==(i=n.searchParams)&&void 0!==i?i:[])}}else e[t]=r;return e},{});return t||null!==(r=c.version)&&void 0!==r&&r.startsWith("1.")||(c.idToken=!!(null!==(i=null!==(n=c.idToken)&&void 0!==n?n:null===(o=c.wellKnown)||void 0===o?void 0:o.includes("openid-configuration"))&&void 0!==i?i:null===(s=c.authorization)||void 0===s?void 0:null===(a=s.params)||void 0===a?void 0:null===(l=a.scope)||void 0===l?void 0:l.includes("openid")),c.checks||(c.checks=["state"])),c}},9001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSecret=function(e){var t;let{authOptions:r,url:n}=e;return null!==(t=r.secret)&&void 0!==t?t:(0,i.createHash)("sha256").update(JSON.stringify({...n,...r})).digest("hex")},t.fromDate=function(e,t=Date.now()){return new Date(t+1e3*e)},t.hashToken=function(e,t){var r;let{provider:n,secret:o}=t;return(0,i.createHash)("sha256").update(`${e}${null!==(r=n.secret)&&void 0!==r?r:o}`).digest("hex")};var i=r(6113)},1329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;let{url:r,error:n="default",theme:o}=e,s=`${r}/signin`,a={default:{status:200,heading:"Error",message:(0,i.h)("p",null,(0,i.h)("a",{className:"site",href:null==r?void 0:r.origin},null==r?void 0:r.host))},configuration:{status:500,heading:"Server error",message:(0,i.h)("div",null,(0,i.h)("p",null,"There is a problem with the server configuration."),(0,i.h)("p",null,"Check the server logs for more information."))},accessdenied:{status:403,heading:"Access Denied",message:(0,i.h)("div",null,(0,i.h)("p",null,"You do not have permission to sign in."),(0,i.h)("p",null,(0,i.h)("a",{className:"button",href:s},"Sign in")))},verification:{status:403,heading:"Unable to sign in",message:(0,i.h)("div",null,(0,i.h)("p",null,"The sign in link is no longer valid."),(0,i.h)("p",null,"It may have been used already or it may have expired.")),signin:(0,i.h)("a",{className:"button",href:s},"Sign in")}},{status:l,heading:c,message:u,signin:d}=null!==(t=a[n.toLowerCase()])&&void 0!==t?t:a.default;return{status:l,html:(0,i.h)("div",{className:"error"},(null==o?void 0:o.brandColor)&&(0,i.h)("style",{dangerouslySetInnerHTML:{__html:`
- :root {
- --brand-color: ${null==o?void 0:o.brandColor}
- }
- `}}),(0,i.h)("div",{className:"card"},(null==o?void 0:o.logo)&&(0,i.h)("img",{src:o.logo,alt:"Logo",className:"logo"}),(0,i.h)("h1",null,c),(0,i.h)("div",{className:"message"},u),d))}};var i=r(2806)},5858:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{url:t,theme:r,query:i,cookies:u}=e;function d({html:e,title:t,status:i}){var o;return{cookies:u,status:i,headers:[{key:"Content-Type",value:"text/html"}],body:`${t}
${(0,n.default)(e)}
`}}return{signin:t=>d({html:(0,o.default)({csrfToken:e.csrfToken,providers:e.providers,callbackUrl:e.callbackUrl,theme:r,...i,...t}),title:"Sign In"}),signout:i=>d({html:(0,s.default)({csrfToken:e.csrfToken,url:t,theme:r,...i}),title:"Sign Out"}),verifyRequest:e=>d({html:(0,a.default)({url:t,theme:r,...e}),title:"Verify Request"}),error:e=>d({...(0,l.default)({url:t,theme:r,...e}),title:"Error"})}};var n=i(r(2824)),o=i(r(337)),s=i(r(9241)),a=i(r(9776)),l=i(r(1329)),c=i(r(8053))},337:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;let{csrfToken:r,providers:i,callbackUrl:a,theme:l,email:c,error:u}=e,d=i.filter(e=>"oauth"===e.type||"email"===e.type||"credentials"===e.type&&!!e.credentials);"undefined"!=typeof document&&l.buttonText&&document.documentElement.style.setProperty("--button-text-color",l.buttonText),"undefined"!=typeof document&&l.brandColor&&document.documentElement.style.setProperty("--brand-color",l.brandColor);let h={Signin:"Try signing in with a different account.",OAuthSignin:"Try signing in with a different account.",OAuthCallback:"Try signing in with a different account.",OAuthCreateAccount:"Try signing in with a different account.",EmailCreateAccount:"Try signing in with a different account.",Callback:"Try signing in with a different account.",OAuthAccountNotLinked:"To confirm your identity, sign in with the same account you used originally.",EmailSignin:"The e-mail could not be sent.",CredentialsSignin:"Sign in failed. Check the details you provided are correct.",SessionRequired:"Please sign in to access this page.",default:"Unable to sign in."},p=u&&(null!==(t=h[u])&&void 0!==t?t:h.default),f="https://authjs.dev/img/providers";return(0,n.h)("div",{className:"signin"},l.brandColor&&(0,n.h)("style",{dangerouslySetInnerHTML:{__html:`
- :root {
- --brand-color: ${l.brandColor}
- }
- `}}),l.buttonText&&(0,n.h)("style",{dangerouslySetInnerHTML:{__html:`
- :root {
- --button-text-color: ${l.buttonText}
- }
- `}}),(0,n.h)("div",{className:"card"},l.logo&&(0,n.h)("img",{src:l.logo,alt:"Logo",className:"logo"}),p&&(0,n.h)("div",{className:"error"},(0,n.h)("p",null,p)),d.map((e,t)=>{let i,l,u,h,p,y;if("oauth"===e.type){var g;({bg:i="",text:l="",logo:u="",bgDark:p=i,textDark:y=l,logoDark:h=""}=null!==(g=e.style)&&void 0!==g?g:{}),u=u.startsWith("/")?`${f}${u}`:u,(h=h.startsWith("/")?`${f}${h}`:h||u)||(h=u)}return(0,n.h)("div",{key:e.id,className:"provider"},"oauth"===e.type&&(0,n.h)("form",{action:e.signinUrl,method:"POST"},(0,n.h)("input",{type:"hidden",name:"csrfToken",value:r}),a&&(0,n.h)("input",{type:"hidden",name:"callbackUrl",value:a}),(0,n.h)("button",{type:"submit",className:"button",style:{"--provider-bg":i,"--provider-dark-bg":p,"--provider-color":l,"--provider-dark-color":y,"--provider-bg-hover":s(i,.8),"--provider-dark-bg-hover":s(p,.8)}},u&&(0,n.h)("img",{loading:"lazy",height:24,width:24,id:"provider-logo",src:`${u.startsWith("/")?f:""}${u}`}),h&&(0,n.h)("img",{loading:"lazy",height:24,width:24,id:"provider-logo-dark",src:`${u.startsWith("/")?f:""}${h}`}),(0,n.h)("span",null,"Sign in with ",e.name))),("email"===e.type||"credentials"===e.type)&&t>0&&"email"!==d[t-1].type&&"credentials"!==d[t-1].type&&(0,n.h)("hr",null),"email"===e.type&&(0,n.h)("form",{action:e.signinUrl,method:"POST"},(0,n.h)("input",{type:"hidden",name:"csrfToken",value:r}),(0,n.h)("label",{className:"section-header",htmlFor:`input-email-for-${e.id}-provider`},"Email"),(0,n.h)("input",{id:`input-email-for-${e.id}-provider`,autoFocus:!0,type:"email",name:"email",value:c,placeholder:"email@example.com",required:!0}),(0,n.h)("button",{id:"submitButton",type:"submit"},"Sign in with ",e.name)),"credentials"===e.type&&(0,n.h)("form",{action:e.callbackUrl,method:"POST"},(0,n.h)("input",{type:"hidden",name:"csrfToken",value:r}),Object.keys(e.credentials).map(t=>{var r,i,s;return(0,n.h)("div",{key:`input-group-${e.id}`},(0,n.h)("label",{className:"section-header",htmlFor:`input-${t}-for-${e.id}-provider`},null!==(r=e.credentials[t].label)&&void 0!==r?r:t),(0,n.h)("input",(0,o.default)({name:t,id:`input-${t}-for-${e.id}-provider`,type:null!==(i=e.credentials[t].type)&&void 0!==i?i:"text",placeholder:null!==(s=e.credentials[t].placeholder)&&void 0!==s?s:""},e.credentials[t])))}),(0,n.h)("button",{type:"submit"},"Sign in with ",e.name)),("email"===e.type||"credentials"===e.type)&&t+1>16&255}, ${r>>8&255}, ${255&r}, ${t})`}},9241:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{url:t,csrfToken:r,theme:n}=e;return(0,i.h)("div",{className:"signout"},n.brandColor&&(0,i.h)("style",{dangerouslySetInnerHTML:{__html:`
- :root {
- --brand-color: ${n.brandColor}
- }
- `}}),n.buttonText&&(0,i.h)("style",{dangerouslySetInnerHTML:{__html:`
- :root {
- --button-text-color: ${n.buttonText}
- }
- `}}),(0,i.h)("div",{className:"card"},n.logo&&(0,i.h)("img",{src:n.logo,alt:"Logo",className:"logo"}),(0,i.h)("h1",null,"Signout"),(0,i.h)("p",null,"Are you sure you want to sign out?"),(0,i.h)("form",{action:`${t}/signout`,method:"POST"},(0,i.h)("input",{type:"hidden",name:"csrfToken",value:r}),(0,i.h)("button",{id:"submitButton",type:"submit"},"Sign out"))))};var i=r(2806)},9776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{url:t,theme:r}=e;return(0,i.h)("div",{className:"verify-request"},r.brandColor&&(0,i.h)("style",{dangerouslySetInnerHTML:{__html:`
- :root {
- --brand-color: ${r.brandColor}
- }
- `}}),(0,i.h)("div",{className:"card"},r.logo&&(0,i.h)("img",{src:r.logo,alt:"Logo",className:"logo"}),(0,i.h)("h1",null,"Check your email"),(0,i.h)("p",null,"A sign in link has been sent to your email address."),(0,i.h)("p",null,(0,i.h)("a",{className:"site",href:t.origin},t.host))))};var i=r(2806)},8538:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=i(r(9656)),o=i(r(1553)),s=r(9001),a=i(r(8832));async function l(e){var t,r,i,l,c,u;let{options:d,query:h,body:p,method:f,headers:y,sessionStore:g}=e,{provider:m,adapter:_,url:v,callbackUrl:w,pages:b,jwt:S,events:k,callbacks:E,session:{strategy:A,maxAge:x},logger:O}=d,T=[],P="jwt"===A;if("oauth"===m.type)try{let{profile:i,account:s,OAuthProfile:a,cookies:l}=await (0,n.default)({query:h,body:p,method:f,options:d,cookies:e.cookies});l.length&&T.push(...l);try{if(O.debug("OAUTH_CALLBACK_RESPONSE",{profile:i,account:s,OAuthProfile:a}),!i||!s||!a)return{redirect:`${v}/signin`,cookies:T};let e=i;if(_){let{getUserByAccount:t}=_,r=await t({providerAccountId:s.providerAccountId,provider:m.id});r&&(e=r)}try{let t=await E.signIn({user:e,account:s,profile:a});if(!t)return{redirect:`${v}/error?error=AccessDenied`,cookies:T};if("string"==typeof t)return{redirect:t,cookies:T}}catch(e){return{redirect:`${v}/error?error=${encodeURIComponent(e.message)}`,cookies:T}}let{user:n,session:l,isNewUser:c}=await (0,o.default)({sessionToken:g.value,profile:i,account:s,options:d});if(P){let e={name:n.name,email:n.email,picture:n.image,sub:null===(r=n.id)||void 0===r?void 0:r.toString()},t=await E.jwt({token:e,user:n,account:s,profile:a,isNewUser:c,trigger:c?"signUp":"signIn"}),i=await S.encode({...S,token:t}),o=new Date;o.setTime(o.getTime()+1e3*x);let l=g.chunk(i,{expires:o});T.push(...l)}else T.push({name:d.cookies.sessionToken.name,value:l.sessionToken,options:{...d.cookies.sessionToken.options,expires:l.expires}});if(await (null===(t=k.signIn)||void 0===t?void 0:t.call(k,{user:n,account:s,profile:i,isNewUser:c})),c&&b.newUser)return{redirect:`${b.newUser}${b.newUser.includes("?")?"&":"?"}callbackUrl=${encodeURIComponent(w)}`,cookies:T};return{redirect:w,cookies:T}}catch(e){if("AccountNotLinkedError"===e.name)return{redirect:`${v}/error?error=OAuthAccountNotLinked`,cookies:T};if("CreateUserError"===e.name)return{redirect:`${v}/error?error=OAuthCreateAccount`,cookies:T};return O.error("OAUTH_CALLBACK_HANDLER_ERROR",e),{redirect:`${v}/error?error=Callback`,cookies:T}}}catch(e){if("OAuthCallbackError"===e.name)return O.error("OAUTH_CALLBACK_ERROR",{error:e,providerId:m.id}),{redirect:`${v}/error?error=OAuthCallback`,cookies:T};return O.error("OAUTH_CALLBACK_ERROR",e),{redirect:`${v}/error?error=Callback`,cookies:T}}else if("email"===m.type)try{let e=null==h?void 0:h.token,t=null==h?void 0:h.email;if(!e||!t)return{redirect:`${v}/error?error=configuration`,cookies:T};let r=await _.useVerificationToken({identifier:t,token:(0,s.hashToken)(e,d)});if(!r||r.expires.valueOf(){"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callback",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"providers",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"session",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"signin",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"signout",{enumerable:!0,get:function(){return s.default}});var n=i(r(8538)),o=i(r(4125)),s=i(r(4611)),a=i(r(7181)),l=i(r(9344))},9344:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{headers:[{key:"Content-Type",value:"application/json"}],body:e.reduce((e,{id:t,name:r,type:i,signinUrl:n,callbackUrl:o})=>(e[t]={id:t,name:r,type:i,signinUrl:n,callbackUrl:o},e),{})}}},7181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i=r(9001);async function n(e){var t,r,n,o,s,a;let{options:l,sessionStore:c,newSession:u,isUpdate:d}=e,{adapter:h,jwt:p,events:f,callbacks:y,logger:g,session:{strategy:m,maxAge:_}}=l,v={body:{},headers:[{key:"Content-Type",value:"application/json"}],cookies:[]},w=c.value;if(!w)return v;if("jwt"===m)try{let e=await p.decode({...p,token:w});if(!e)throw Error("JWT invalid");let n=await y.jwt({token:e,...d&&{trigger:"update"},session:u}),o=(0,i.fromDate)(_),s=await y.session({session:{user:{name:null==e?void 0:e.name,email:null==e?void 0:e.email,image:null==e?void 0:e.picture},expires:o.toISOString()},token:n});v.body=s;let a=await p.encode({...p,token:n,maxAge:l.session.maxAge}),h=c.chunk(a,{expires:o});null===(t=v.cookies)||void 0===t||t.push(...h),await (null===(r=f.session)||void 0===r?void 0:r.call(f,{session:s,token:n}))}catch(e){g.error("JWT_SESSION_ERROR",e),null===(n=v.cookies)||void 0===n||n.push(...c.clean())}else try{let{getSessionAndUser:e,deleteSession:t,updateSession:r}=h,n=await e(w);if(n&&n.session.expires.valueOf(){"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(r(9581)),o=i(r(9278)),s=i(r(8832));async function a(e){let{options:t,query:r,body:i}=e,{url:a,callbacks:l,logger:c,provider:u}=t;if(!u.type)return{status:500,text:`Error: Type not specified for ${u.name}`};if("oauth"===u.type)try{return await (0,n.default)({options:t,query:r})}catch(e){return c.error("SIGNIN_OAUTH_ERROR",{error:e,providerId:u.id}),{redirect:`${a}/error?error=OAuthSignin`}}else if("email"===u.type){var d;let e=null==i?void 0:i.email;if(!e)return{redirect:`${a}/error?error=EmailSignin`};let r=null!==(d=u.normalizeIdentifier)&&void 0!==d?d:e=>{let[t,r]=e.toLowerCase().trim().split("@");return r=r.split(",")[0],`${t}@${r}`};try{e=r(null==i?void 0:i.email)}catch(e){return c.error("SIGNIN_EMAIL_ERROR",{error:e,providerId:u.id}),{redirect:`${a}/error?error=EmailSignin`}}let n=await (0,s.default)({email:e,adapter:t.adapter}),h={providerAccountId:e,userId:e,type:"email",provider:u.id};try{let e=await l.signIn({user:n,account:h,email:{verificationRequest:!0}});if(!e)return{redirect:`${a}/error?error=AccessDenied`};if("string"==typeof e)return{redirect:e}}catch(e){return{redirect:`${a}/error?${new URLSearchParams({error:e})}`}}try{return{redirect:await (0,o.default)(e,t)}}catch(e){return c.error("SIGNIN_EMAIL_ERROR",{error:e,providerId:u.id}),{redirect:`${a}/error?error=EmailSignin`}}}return{redirect:`${a}/signin`}}},4611:(e,t)=>{"use strict";async function r(e){var t,r;let{options:i,sessionStore:n}=e,{adapter:o,events:s,jwt:a,callbackUrl:l,logger:c,session:u}=i,d=null==n?void 0:n.value;if(!d)return{redirect:l};if("jwt"===u.strategy)try{let e=await a.decode({...a,token:d});await (null===(t=s.signOut)||void 0===t?void 0:t.call(s,{token:e}))}catch(e){c.error("SIGNOUT_ERROR",e)}else try{let e=await o.deleteSession(d);await (null===(r=s.signOut)||void 0===r?void 0:r.call(s,{session:e}))}catch(e){c.error("SIGNOUT_ERROR",e)}return{redirect:l,cookies:n.clean()}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},4395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8053:e=>{"use strict";e.exports=function(){return':root{--border-width:1px;--border-radius:0.5rem;--color-error:#c94b4b;--color-info:#157efb;--color-info-hover:#0f6ddb;--color-info-text:#fff}.__next-auth-theme-auto,.__next-auth-theme-light{--color-background:#ececec;--color-background-hover:hsla(0,0%,93%,.8);--color-background-card:#fff;--color-text:#000;--color-primary:#444;--color-control-border:#bbb;--color-button-active-background:#f9f9f9;--color-button-active-border:#aaa;--color-separator:#ccc}.__next-auth-theme-dark{--color-background:#161b22;--color-background-hover:rgba(22,27,34,.8);--color-background-card:#0d1117;--color-text:#fff;--color-primary:#ccc;--color-control-border:#555;--color-button-active-background:#060606;--color-button-active-border:#666;--color-separator:#444}@media (prefers-color-scheme:dark){.__next-auth-theme-auto{--color-background:#161b22;--color-background-hover:rgba(22,27,34,.8);--color-background-card:#0d1117;--color-text:#fff;--color-primary:#ccc;--color-control-border:#555;--color-button-active-background:#060606;--color-button-active-border:#666;--color-separator:#444}a.button,button{background-color:var(--provider-dark-bg,var(--color-background));color:var(--provider-dark-color,var(--color-primary))}a.button:hover,button:hover{background-color:var(--provider-dark-bg-hover,var(--color-background-hover))!important}#provider-logo{display:none!important}#provider-logo-dark{display:block!important;width:25px}}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit;margin:0;padding:0}body{background-color:var(--color-background);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;margin:0;padding:0}h1{font-weight:400}h1,p{color:var(--color-text);margin-bottom:1.5rem;padding:0 1rem}form{margin:0;padding:0}label{font-weight:500;margin-bottom:.25rem;text-align:left}input[type],label{color:var(--color-text);display:block}input[type]{background:var(--color-background-card);border:var(--border-width) solid var(--color-control-border);border-radius:var(--border-radius);box-sizing:border-box;font-size:1rem;padding:.5rem 1rem;width:100%}input[type]:focus{box-shadow:none}p{font-size:1.1rem;line-height:2rem}a.button{line-height:1rem;text-decoration:none}a.button:link,a.button:visited{background-color:var(--color-background);color:var(--color-primary)}button span{flex-grow:1}a.button,button{align-items:center;background-color:var(--provider-bg);border-color:rgba(0,0,0,.1);border-radius:var(--border-radius);color:var(--provider-color,var(--color-primary));display:flex;font-size:1.1rem;font-weight:500;justify-content:center;min-height:62px;padding:.75rem 1rem;position:relative;transition:all .1s ease-in-out}a.button:hover,button:hover{background-color:var(--provider-bg-hover,var(--color-background-hover));cursor:pointer}a.button:active,button:active{cursor:pointer}a.button #provider-logo,button #provider-logo{display:block;width:25px}a.button #provider-logo-dark,button #provider-logo-dark{display:none}#submitButton{background-color:var(--brand-color,var(--color-info));color:var(--button-text-color,var(--color-info-text));width:100%}#submitButton:hover{background-color:var(--button-hover-bg,var(--color-info-hover))!important}a.site{color:var(--color-primary);font-size:1rem;line-height:2rem;text-decoration:none}a.site:hover{text-decoration:underline}.page{box-sizing:border-box;display:grid;height:100%;margin:0;padding:0;place-items:center;position:absolute;width:100%}.page>div{text-align:center}.error a.button{margin-top:.5rem;padding-left:2rem;padding-right:2rem}.error .message{margin-bottom:1.5rem}.signin input[type=text]{display:block;margin-left:auto;margin-right:auto}.signin hr{border:0;border-top:1px solid var(--color-separator);display:block;margin:2rem auto 1rem;overflow:visible}.signin hr:before{background:var(--color-background-card);color:#888;content:"or";padding:0 .4rem;position:relative;top:-.7rem}.signin .error{background:#f5f5f5;background:var(--color-error);border-radius:.3rem;font-weight:500}.signin .error p{color:var(--color-info-text);font-size:.9rem;line-height:1.2rem;padding:.5rem 1rem;text-align:left}.signin form,.signin>div{display:block}.signin form input[type],.signin>div input[type]{margin-bottom:.5rem}.signin form button,.signin>div button{width:100%}.signin .provider+.provider{margin-top:1rem}.logo{display:inline-block;margin:1.25rem 0;max-height:70px;max-width:150px}.card{background-color:var(--color-background-card);border-radius:2rem;padding:1.25rem 2rem}.card .header{color:var(--color-primary)}.section-header{color:var(--color-text)}@media screen and (min-width:450px){.card{margin:2rem 0;width:368px}}@media screen and (max-width:450px){.card{margin:1rem 0;width:343px}}'}},7345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={};Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}});var n=r(4395);Object.keys(n).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(i,e))&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))});var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(r(6590));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}Object.keys(o).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(i,e))&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))})},1609:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0});var n={encode:!0,decode:!0,getToken:!0};t.decode=h,t.encode=d,t.getToken=p;var o=r(5100),s=i(r(217)),a=r(2295),l=r(2486),c=r(266);Object.keys(c).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(n,e))&&(e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))});let u=()=>Date.now()/1e3|0;async function d(e){let{token:t={},secret:r,maxAge:i=2592e3,salt:n=""}=e,s=await f(r,n);return await new o.EncryptJWT(t).setProtectedHeader({alg:"dir",enc:"A256GCM"}).setIssuedAt().setExpirationTime(u()+i).setJti((0,a.v4)()).encrypt(s)}async function h(e){let{token:t,secret:r,salt:i=""}=e;if(!t)return null;let n=await f(r,i),{payload:s}=await (0,o.jwtDecrypt)(t,n,{clockTolerance:15});return s}async function p(e){var t,r,i;let{req:n,secureCookie:o=null!==(t=null===(r=process.env.NEXTAUTH_URL)||void 0===r?void 0:r.startsWith("https://"))&&void 0!==t?t:!!process.env.VERCEL,cookieName:s=o?"__Secure-next-auth.session-token":"next-auth.session-token",raw:a,decode:c=h,logger:u=console,secret:d=process.env.NEXTAUTH_SECRET}=e;if(!n)throw Error("Must pass `req` to JWT getToken()");let p=new l.SessionStore({name:s,options:{secure:o}},{cookies:n.cookies,headers:n.headers},u).value,f=n.headers instanceof Headers?n.headers.get("authorization"):null===(i=n.headers)||void 0===i?void 0:i.authorization;if(p||(null==f?void 0:f.split(" ")[0])!=="Bearer"||(p=decodeURIComponent(f.split(" ")[1])),!p)return null;if(a)return p;try{return await c({token:p,secret:d})}catch(e){return null}}async function f(e,t){return await (0,s.default)("sha256",e,t,`NextAuth.js Generated Encryption Key${t?` (${t})`:""}`,32)}},266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.getServerSession=a,t.unstable_getServerSession=l;var i=r(7919),n=r(8017);async function o(e,t,r){var o,s,a,l,c,u,d,h;let{nextauth:p,...f}=e.query;null!==(o=r.secret)&&void 0!==o||(r.secret=null!==(s=null===(a=r.jwt)||void 0===a?void 0:a.secret)&&void 0!==s?s:process.env.NEXTAUTH_SECRET);let y=await (0,i.AuthHandler)({req:{body:e.body,query:f,cookies:e.cookies,headers:e.headers,method:e.method,action:null==p?void 0:p[0],providerId:null==p?void 0:p[1],error:null!==(l=e.query.error)&&void 0!==l?l:null==p?void 0:p[1]},options:r});if(t.status(null!==(c=y.status)&&void 0!==c?c:200),null===(u=y.cookies)||void 0===u||u.forEach(e=>(0,n.setCookie)(t,e)),null===(d=y.headers)||void 0===d||d.forEach(e=>t.setHeader(e.key,e.value)),y.redirect){if((null===(h=e.body)||void 0===h?void 0:h.json)!=="true"){t.status(302).setHeader("Location",y.redirect),t.end();return}return t.json({url:y.redirect})}return t.send(y.body)}async function s(e,t,o){var s,a,l;null!==(s=o.secret)&&void 0!==s||(o.secret=process.env.NEXTAUTH_SECRET);let{headers:c,cookies:u}=r(7167),d=null===(a=t.params)||void 0===a?void 0:a.nextauth,h=Object.fromEntries(e.nextUrl.searchParams),p=await (0,n.getBody)(e),f=await (0,i.AuthHandler)({req:{body:p,query:h,cookies:Object.fromEntries(u().getAll().map(e=>[e.name,e.value])),headers:Object.fromEntries(c()),method:e.method,action:null==d?void 0:d[0],providerId:null==d?void 0:d[1],error:null!==(l=h.error)&&void 0!==l?l:null==d?void 0:d[1]},options:o}),y=(0,n.toResponse)(f),g=y.headers.get("Location");return(null==p?void 0:p.json)==="true"&&g?(y.headers.delete("Location"),y.headers.set("Content-Type","application/json"),new Response(JSON.stringify({url:g}),{status:f.status,headers:y.headers})):y}async function a(...e){var t,o;let s,l,c;let u=0===e.length||1===e.length;if(u){c=Object.assign({},e[0],{providers:[]});let{headers:t,cookies:i}=r(7167);s={headers:Object.fromEntries(t()),cookies:Object.fromEntries(i().getAll().map(e=>[e.name,e.value]))},l={getHeader(){},setCookie(){},setHeader(){}}}else s=e[0],l=e[1],c=Object.assign({},e[2],{providers:[]});null!==(o=(t=c).secret)&&void 0!==o||(t.secret=process.env.NEXTAUTH_SECRET);let{body:d,cookies:h,status:p=200}=await (0,i.AuthHandler)({options:c,req:{action:"session",method:"GET",cookies:s.cookies,headers:s.headers}});if(null==h||h.forEach(e=>(0,n.setCookie)(l,e)),d&&"string"!=typeof d&&Object.keys(d).length){if(200===p)return u&&delete d.expires,d;throw Error(d.message)}return null}async function l(...e){return await a(...e)}t.default=function(...e){var t;return 1===e.length?async(t,r)=>null!=r&&r.params?await s(t,r,e[0]):await o(t,r,e[0]):null!==(t=e[1])&&void 0!==t&&t.params?s(...e):o(...e)}},8017:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBody=n,t.setCookie=function(e,t){var r;let n=null!==(r=e.getHeader("Set-Cookie"))&&void 0!==r?r:[];Array.isArray(n)||(n=[n]);let{name:o,value:s,options:a}=t,l=(0,i.serialize)(o,s,a);n.push(l),e.setHeader("Set-Cookie",n)},t.toResponse=function(e){var t,r,n;let o=new Headers(null===(t=e.headers)||void 0===t?void 0:t.reduce((e,{key:t,value:r})=>(e[t]=r,e),{}));null===(r=e.cookies)||void 0===r||r.forEach(e=>{let{name:t,value:r,options:n}=e,s=(0,i.serialize)(t,r,n);o.has("Set-Cookie")?o.append("Set-Cookie",s):o.set("Set-Cookie",s)});let s=e.body;"application/json"===o.get("content-type")?s=JSON.stringify(e.body):"application/x-www-form-urlencoded"===o.get("content-type")&&(s=new URLSearchParams(e.body).toString());let a=e.redirect?302:null!==(n=e.status)&&void 0!==n?n:200,l=new Response(s,{headers:o,status:a});return e.redirect&&l.headers.set("Location",e.redirect),l};var i=r(7162);async function n(e){if(!("body"in e)||!e.body||"POST"!==e.method)return;let t=e.headers.get("content-type");return null!=t&&t.includes("application/json")?await e.json():null!=t&&t.includes("application/x-www-form-urlencoded")?Object.fromEntries(new URLSearchParams(await e.text())):void 0}},4569:(e,t)=>{"use strict";t.Z=function(e){return{id:"google",name:"Google",type:"oauth",wellKnown:"https://accounts.google.com/.well-known/openid-configuration",authorization:{params:{scope:"openid email profile"}},idToken:!0,checks:["pkce","state"],profile:e=>({id:e.sub,name:e.name,email:e.email,image:e.picture}),style:{logo:"/google.svg",bg:"#fff",text:"#000"},options:e}}},7885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.detectOrigin=function(e,t){var r;return(null!==(r=process.env.VERCEL)&&void 0!==r?r:process.env.AUTH_TRUST_HOST)?`${"http"===t?"http":"https"}://${e}`:process.env.NEXTAUTH_URL}},5387:(e,t,r)=>{"use strict";var i=r(6718);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.proxyLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;arguments.length>1&&arguments[1];try{return e}catch(e){return o}},t.setLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t||(o.debug=function(){}),e.error&&(o.error=e.error),e.warn&&(o.warn=e.warn),e.debug&&(o.debug=e.debug)},i(r(2485));var n=r(2394),o={error:function(e,t){t=function e(t){var r;return t instanceof Error&&!(t instanceof n.UnknownError)?{message:t.message,stack:t.stack,name:t.name}:(null!=t&&t.error&&(t.error=e(t.error),t.message=null!==(r=t.message)&&void 0!==r?r:t.error.message),t)}(t),console.error("[next-auth][error][".concat(e,"]"),"\nhttps://next-auth.js.org/errors#".concat(e.toLowerCase()),t.message,t)},warn:function(e){console.warn("[next-auth][warn][".concat(e,"]"),"\nhttps://next-auth.js.org/warnings#".concat(e.toLowerCase()))},debug:function(e,t){console.log("[next-auth][debug][".concat(e,"]"),t)}};t.default=o},7838:(e,t)=>{"use strict";function r(e){return e&&"object"==typeof e&&!Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.merge=function e(t,...i){if(!i.length)return t;let n=i.shift();if(r(t)&&r(n))for(let i in n)r(n[i])?(t[i]||Object.assign(t,{[i]:{}}),e(t[i],n[i])):Object.assign(t,{[i]:n[i]});return e(t,...i)}},550:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;let r=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e=`https://${e}`);let i=new URL(null!==(t=e)&&void 0!==t?t:r),n=("/"===i.pathname?r.pathname:i.pathname).replace(/\/$/,""),o=`${i.origin}${n}`;return{origin:i.origin,host:i.host,path:n,base:o,toString:()=>o}}},7167:(e,t,r)=>{"use strict";r.r(t);var i=r(9767),n={};for(let e in i)"default"!==e&&(n[e]=()=>i[e]);r.d(t,n)},1847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraftMode",{enumerable:!0,get:function(){return n}});let i=r(2936);class n{get isEnabled(){return this._provider.isEnabled}enable(){if(!(0,i.staticGenerationBailout)("draftMode().enable()"))return this._provider.enable()}disable(){if(!(0,i.staticGenerationBailout)("draftMode().disable()"))return this._provider.disable()}constructor(e){this._provider=e}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9767:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{headers:function(){return u},cookies:function(){return d},draftMode:function(){return h}});let i=r(9839),n=r(270),o=r(8005),s=r(4580),a=r(2934),l=r(2936),c=r(1847);function u(){if((0,l.staticGenerationBailout)("headers",{link:"https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering"}))return n.HeadersAdapter.seal(new Headers({}));let e=s.requestAsyncStorage.getStore();if(!e)throw Error("Invariant: headers() expects to have requestAsyncStorage, none available.");return e.headers}function d(){if((0,l.staticGenerationBailout)("cookies",{link:"https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering"}))return i.RequestCookiesAdapter.seal(new o.RequestCookies(new Headers({})));let e=s.requestAsyncStorage.getStore();if(!e)throw Error("Invariant: cookies() expects to have requestAsyncStorage, none available.");let t=a.actionAsyncStorage.getStore();return t&&(t.isAction||t.isAppRoute)?e.mutableCookies:e.cookies}function h(){let e=s.requestAsyncStorage.getStore();if(!e)throw Error("Invariant: draftMode() expects to have requestAsyncStorage, none available.");return new c.DraftMode(e.draftMode)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DynamicServerError:function(){return i},isDynamicServerError:function(){return n}});let r="DYNAMIC_SERVER_USAGE";class i extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=r}}function n(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isStaticGenBailoutError:function(){return a},staticGenerationBailout:function(){return c}});let i=r(9625),n=r(5869),o="NEXT_STATIC_GEN_BAILOUT";class s extends Error{constructor(...e){super(...e),this.code=o}}function a(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===o}function l(e,t){let{dynamic:r,link:i}=t||{};return"Page"+(r?' with `dynamic = "'+r+'"`':"")+" couldn't be rendered statically because it used `"+e+"`."+(i?" See more info here: "+i:"")}let c=(e,t)=>{let{dynamic:r,link:o}=void 0===t?{}:t,a=n.staticGenerationAsyncStorage.getStore();if(!a)return!1;if(a.forceStatic)return!0;if(a.dynamicShouldError)throw new s(l(e,{link:o,dynamic:null!=r?r:"error"}));let c=l(e,{dynamic:r,link:"https://nextjs.org/docs/messages/dynamic-server-error"});if(null==a.postpone||a.postpone.call(a,e),a.revalidate=0,a.isStaticGeneration){let t=new i.DynamicServerError(c);throw a.dynamicUsageDescription=e,a.dynamicUsageStack=t.stack,t}return!1};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyHeadersError:function(){return n},HeadersAdapter:function(){return o}});let i=r(5444);class n extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new n}}class o extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,n){if("symbol"==typeof r)return i.ReflectAdapter.get(t,r,n);let o=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===o);if(void 0!==s)return i.ReflectAdapter.get(t,s,n)},set(t,r,n,o){if("symbol"==typeof r)return i.ReflectAdapter.set(t,r,n,o);let s=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===s);return i.ReflectAdapter.set(t,a??r,n,o)},has(t,r){if("symbol"==typeof r)return i.ReflectAdapter.has(t,r);let n=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0!==o&&i.ReflectAdapter.has(t,o)},deleteProperty(t,r){if("symbol"==typeof r)return i.ReflectAdapter.deleteProperty(t,r);let n=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0===o||i.ReflectAdapter.deleteProperty(t,o)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return n.callable;default:return i.ReflectAdapter.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,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()}}},5444:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return r}});class r{static get(e,t,r){let 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)}}},9839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyRequestCookiesError:function(){return o},RequestCookiesAdapter:function(){return s},getModifiedCookieValues:function(){return l},appendMutableCookies:function(){return c},MutableRequestCookiesAdapter:function(){return u}});let i=r(8005),n=r(5444);class o extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options")}static callable(){throw new o}}class s{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return o.callable;default:return n.ReflectAdapter.get(e,t,r)}}})}}let a=Symbol.for("next.mutated.cookies");function l(e){let t=e[a];return t&&Array.isArray(t)&&0!==t.length?t:[]}function c(e,t){let r=l(t);if(0===r.length)return!1;let n=new i.ResponseCookies(e),o=n.getAll();for(let e of r)n.set(e);for(let e of o)n.set(e);return!0}class u{static wrap(e,t){let r=new i.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let o=[],s=new Set,l=()=>{var e;let n=null==fetch.__nextGetStaticStore?void 0:null==(e=fetch.__nextGetStaticStore.call(fetch))?void 0:e.getStore();if(n&&(n.pathWasRevalidated=!0),o=r.getAll().filter(e=>s.has(e.name)),t){let e=[];for(let t of o){let r=new i.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}};return new Proxy(r,{get(e,t,r){switch(t){case a:return o;case"delete":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{e.delete(...t)}finally{l()}};case"set":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t)}finally{l()}};default:return n.ReflectAdapter.get(e,t,r)}}})}}},3990:(e,t,r)=>{t.OAuth=r(3899).OAuth,t.OAuthEcho=r(3899).OAuthEcho,t.OAuth2=r(5689).OAuth2},5022:e=>{"use strict";e.exports.isAnEarlyCloseHost=function(e){return e&&e.match(".*google(apis)?.com$")}},3899:(e,t,r)=>{var i=r(6113),n=r(1442),o=r(3685),s=r(5687),a=r(7310),l=r(3477),c=r(5022);t.OAuth=function(e,t,r,i,n,o,s,a,l){if(this._isEcho=!1,this._requestUrl=e,this._accessUrl=t,this._consumerKey=r,this._consumerSecret=this._encodeData(i),"RSA-SHA1"==s&&(this._privateKey=i),this._version=n,void 0===o?this._authorize_callback="oob":this._authorize_callback=o,"PLAINTEXT"!=s&&"HMAC-SHA1"!=s&&"RSA-SHA1"!=s)throw Error("Un-supported signature method: "+s);this._signatureMethod=s,this._nonceSize=a||32,this._headers=l||{Accept:"*/*",Connection:"close","User-Agent":"Node authentication"},this._clientOptions=this._defaultClientOptions={requestTokenHttpMethod:"POST",accessTokenHttpMethod:"POST",followRedirects:!0},this._oauthParameterSeperator=","},t.OAuthEcho=function(e,t,r,i,n,o,s,a){if(this._isEcho=!0,this._realm=e,this._verifyCredentials=t,this._consumerKey=r,this._consumerSecret=this._encodeData(i),"RSA-SHA1"==o&&(this._privateKey=i),this._version=n,"PLAINTEXT"!=o&&"HMAC-SHA1"!=o&&"RSA-SHA1"!=o)throw Error("Un-supported signature method: "+o);this._signatureMethod=o,this._nonceSize=s||32,this._headers=a||{Accept:"*/*",Connection:"close","User-Agent":"Node authentication"},this._oauthParameterSeperator=","},t.OAuthEcho.prototype=t.OAuth.prototype,t.OAuth.prototype._getTimestamp=function(){return Math.floor(new Date().getTime()/1e3)},t.OAuth.prototype._encodeData=function(e){return null==e||""==e?"":encodeURIComponent(e).replace(/\!/g,"%21").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")},t.OAuth.prototype._decodeData=function(e){return null!=e&&(e=e.replace(/\+/g," ")),decodeURIComponent(e)},t.OAuth.prototype._getSignature=function(e,t,r,i){var n=this._createSignatureBase(e,t,r);return this._createSignature(n,i)},t.OAuth.prototype._normalizeUrl=function(e){var t=a.parse(e,!0),r="";return t.port&&("http:"==t.protocol&&"80"!=t.port||"https:"==t.protocol&&"443"!=t.port)&&(r=":"+t.port),t.pathname&&""!=t.pathname||(t.pathname="/"),t.protocol+"//"+t.hostname+r+t.pathname},t.OAuth.prototype._isParameterNameAnOAuthParameter=function(e){var t=e.match("^oauth_");return!!t&&"oauth_"===t[0]},t.OAuth.prototype._buildAuthorizationHeaders=function(e){var t="OAuth ";this._isEcho&&(t+='realm="'+this._realm+'",');for(var r=0;r=200&&i.statusCode<=299?u(null,v,i):(301==i.statusCode||302==i.statusCode)&&_.followRedirects&&i.headers&&i.headers.location?w._performSecureRequest(e,t,r,i.headers.location,n,o,s,u):u({statusCode:i.statusCode,data:v},v,i))};h.on("response",function(e){e.setEncoding("utf8"),e.on("data",function(e){v+=e}),e.on("end",function(){k(e)}),e.on("close",function(){b&&k(e)})}),h.on("error",function(e){S||(S=!0,u(e))}),("POST"==r||"PUT"==r)&&null!=o&&""!=o&&h.write(o),h.end()},t.OAuth.prototype.setClientOptions=function(e){var t,r={},i=Object.prototype.hasOwnProperty;for(t in this._defaultClientOptions)i.call(e,t)?r[t]=e[t]:r[t]=this._defaultClientOptions[t];this._clientOptions=r},t.OAuth.prototype.getOAuthAccessToken=function(e,t,r,i){var n={};"function"==typeof r?i=r:n.oauth_verifier=r,this._performSecureRequest(e,t,this._clientOptions.accessTokenHttpMethod,this._accessUrl,n,null,null,function(e,t,r){if(e)i(e);else{var n=l.parse(t),o=n.oauth_token;delete n.oauth_token;var s=n.oauth_token_secret;delete n.oauth_token_secret,i(null,o,s,n)}})},t.OAuth.prototype.getProtectedResource=function(e,t,r,i,n){this._performSecureRequest(r,i,t,e,null,"",null,n)},t.OAuth.prototype.delete=function(e,t,r,i){return this._performSecureRequest(t,r,"DELETE",e,null,"",null,i)},t.OAuth.prototype.get=function(e,t,r,i){return this._performSecureRequest(t,r,"GET",e,null,"",null,i)},t.OAuth.prototype._putOrPost=function(e,t,r,i,n,o,s){var a=null;return"function"==typeof o&&(s=o,o=null),"string"==typeof n||Buffer.isBuffer(n)||(o="application/x-www-form-urlencoded",a=n,n=null),this._performSecureRequest(r,i,e,t,a,n,o,s)},t.OAuth.prototype.put=function(e,t,r,i,n,o){return this._putOrPost("PUT",e,t,r,i,n,o)},t.OAuth.prototype.post=function(e,t,r,i,n,o){return this._putOrPost("POST",e,t,r,i,n,o)},t.OAuth.prototype.getOAuthRequestToken=function(e,t){"function"==typeof e&&(t=e,e={}),this._authorize_callback&&(e.oauth_callback=this._authorize_callback),this._performSecureRequest(null,null,this._clientOptions.requestTokenHttpMethod,this._requestUrl,e,null,null,function(e,r,i){if(e)t(e);else{var n=l.parse(r),o=n.oauth_token,s=n.oauth_token_secret;delete n.oauth_token,delete n.oauth_token_secret,t(null,o,s,n)}})},t.OAuth.prototype.signUrl=function(e,t,r,i){if(void 0===i)var i="GET";for(var n=this._prepareParameters(t,r,i,e,{}),o=a.parse(e,!1),s="",l=0;l{var i=r(3477),n=(r(6113),r(5687)),o=r(3685),s=r(7310),a=r(5022);t.OAuth2=function(e,t,r,i,n,o){this._clientId=e,this._clientSecret=t,this._baseSite=r,this._authorizeUrl=i||"/oauth/authorize",this._accessTokenUrl=n||"/oauth/access_token",this._accessTokenName="access_token",this._authMethod="Bearer",this._customHeaders=o||{},this._useAuthorizationHeaderForGET=!1,this._agent=void 0},t.OAuth2.prototype.setAgent=function(e){this._agent=e},t.OAuth2.prototype.setAccessTokenName=function(e){this._accessTokenName=e},t.OAuth2.prototype.setAuthMethod=function(e){this._authMethod=e},t.OAuth2.prototype.useAuthorizationHeaderforGET=function(e){this._useAuthorizationHeaderForGET=e},t.OAuth2.prototype._getAccessTokenUrl=function(){return this._baseSite+this._accessTokenUrl},t.OAuth2.prototype.buildAuthHeader=function(e){return this._authMethod+" "+e},t.OAuth2.prototype._chooseHttpLibrary=function(e){var t=n;return"https:"!=e.protocol&&(t=o),t},t.OAuth2.prototype._request=function(e,t,r,n,o,a){var l=s.parse(t,!0);"https:"!=l.protocol||l.port||(l.port=443);var c=this._chooseHttpLibrary(l),u={};for(var d in this._customHeaders)u[d]=this._customHeaders[d];if(r)for(var d in r)u[d]=r[d];u.Host=l.host,u["User-Agent"]||(u["User-Agent"]="Node-oauth"),n?Buffer.isBuffer(n)?u["Content-Length"]=n.length:u["Content-Length"]=Buffer.byteLength(n):u["Content-length"]=0,!o||"Authorization"in u||(l.query||(l.query={}),l.query[this._accessTokenName]=o);var h=i.stringify(l.query);h&&(h="?"+h);var p={host:l.hostname,port:l.port,path:l.pathname+h,method:e,headers:u};this._executeRequest(c,p,n,a)},t.OAuth2.prototype._executeRequest=function(e,t,r,i){var n=a.isAnEarlyCloseHost(t.host),o=!1;function s(e,t){o||(o=!0,e.statusCode>=200&&e.statusCode<=299||301==e.statusCode||302==e.statusCode?i(null,t,e):i({statusCode:e.statusCode,data:t}))}var l="";this._agent&&(t.agent=this._agent);var c=e.request(t);c.on("response",function(e){e.on("data",function(e){l+=e}),e.on("close",function(t){n&&s(e,l)}),e.addListener("end",function(){s(e,l)})}),c.on("error",function(e){o=!0,i(e)}),("POST"==t.method||"PUT"==t.method)&&r&&c.write(r),c.end()},t.OAuth2.prototype.getAuthorizeUrl=function(e){var e=e||{};return e.client_id=this._clientId,this._baseSite+this._authorizeUrl+"?"+i.stringify(e)},t.OAuth2.prototype.getOAuthAccessToken=function(e,t,r){var t=t||{};t.client_id=this._clientId,t.client_secret=this._clientSecret;var n="refresh_token"===t.grant_type?"refresh_token":"code";t[n]=e;var o=i.stringify(t);this._request("POST",this._getAccessTokenUrl(),{"Content-Type":"application/x-www-form-urlencoded"},o,null,function(e,t,n){if(e)r(e);else{try{o=JSON.parse(t)}catch(e){o=i.parse(t)}var o,s=o.access_token,a=o.refresh_token;delete o.refresh_token,r(null,s,a,o)}})},t.OAuth2.prototype.getProtectedResource=function(e,t,r){this._request("GET",e,{},"",t,r)},t.OAuth2.prototype.get=function(e,t,r){if(this._useAuthorizationHeaderForGET){var i={Authorization:this.buildAuthHeader(t)};t=null}else i={};this._request("GET",e,i,"",t,r)}},1442:(e,t)=>{function r(e){for(var t,r,i="",n=-1;++n>>6&31,128|63&t):t<=65535?i+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(i+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return i}function i(e){for(var t=Array(e.length>>2),r=0;r>5]|=(255&e.charCodeAt(r/8))<<24-r%32;return t}function n(e,t){e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var r=Array(80),i=1732584193,n=-271733879,a=-1732584194,l=271733878,c=-1009589776,u=0;u>16)+(t>>16)+(r>>16)<<16|65535&r}function s(e,t){return e<>>32-t}t.HMACSHA1=function(e,t){return function(e){for(var t="",r=e.length,i=0;i8*e.length?t+="=":t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>>6*(3-o)&63);return t}(function(e,t){var r=i(e);r.length>16&&(r=n(r,8*e.length));for(var o=Array(16),s=Array(16),a=0;a<16;a++)o[a]=909522486^r[a],s[a]=1549556828^r[a];var l=n(o.concat(i(t)),512+8*t.length);return function(e){for(var t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}(n(s.concat(l),672))}(r(e),r(t)))}},4481:(e,t,r)=>{"use strict";let i;let{strict:n}=r(9491),{createHash:o}=r(6113),{format:s}=r(3849),a=r(4986);if(Buffer.isEncoding("base64url"))i=e=>e.toString("base64url");else{let e=e=>e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");i=t=>e(t.toString("base64"))}function l(e,t,r){let n=(function(e,t){switch(e){case"HS256":case"RS256":case"PS256":case"ES256":case"ES256K":return o("sha256");case"HS384":case"RS384":case"PS384":case"ES384":return o("sha384");case"HS512":case"RS512":case"PS512":case"ES512":return o("sha512");case"EdDSA":switch(t){case"Ed25519":return o("sha512");case"Ed448":if(!a)throw TypeError("Ed448 *_hash calculation is not supported in your Node.js runtime version");return o("shake256",{outputLength:114});default:throw TypeError("unrecognized or invalid EdDSA curve provided")}default:throw TypeError("unrecognized or invalid JWS algorithm provided")}})(t,r).update(e).digest();return i(n.slice(0,n.length/2))}e.exports={validate:function(e,t,r,i,o){let a,c;if("string"!=typeof e.claim||!e.claim)throw TypeError("names.claim must be a non-empty string");if("string"!=typeof e.source||!e.source)throw TypeError("names.source must be a non-empty string");n("string"==typeof t&&t,`${e.claim} must be a non-empty string`),n("string"==typeof r&&r,`${e.source} must be a non-empty string`);try{a=l(r,i,o)}catch(t){c=s("%s could not be validated (%s)",e.claim,t.message)}c=c||s("%s mismatch, expected %s, got: %s",e.claim,a,t),n.equal(a,t,c)},generate:l}},4986:(e,t,r)=>{"use strict";let i=r(6113),[n,o]=process.version.substring(1).split(".").map(e=>parseInt(e,10)),s=(n>12||12===n&&o>=8)&&i.getHashes().includes("shake256");e.exports=s},8576:(e,t,r)=>{"use strict";let i;let{inspect:n}=r(3849),o=r(3685),s=r(6113),{strict:a}=r(9491),l=r(3477),c=r(7310),{URL:u,URLSearchParams:d}=r(7310),h=r(5100),p=r(4481),f=r(596),y=r(1773),g=r(5825),m=r(498),_=r(6208),{assertSigningAlgValuesSupport:v,assertIssuerConfiguration:w}=r(905),b=r(6849),S=r(8363),k=r(9527),E=r(2939),{OPError:A,RPError:x}=r(9628),O=r(5976),{random:T}=r(1914),P=r(1065),{CLOCK_TOLERANCE:j}=r(1491),{keystores:C}=r(6207),I=r(2874),$=r(7004),{authenticatedPost:J,resolveResponseType:M,resolveRedirectUri:N}=r(7684),{queryKeyStore:R}=r(4332),W=r(1642),[K,U]=process.version.slice(1).split(".").map(e=>parseInt(e,10)),H=K>=17||16===K&&U>=9,D=Symbol(),q=Symbol(),L=Symbol();function B(e){return b(e,"access_token","code","error_description","error_uri","error","expires_in","id_token","iss","response","session_state","state","token_type")}function Q(e,t="Bearer"){return`${t} ${e}`}function z(e){let t=c.parse(e);return t.search?l.parse(t.search.substring(1)):{}}function F(e,t,r){if(void 0===e[r])throw new x({message:`missing required JWT property ${r}`,jwt:t})}function V(e){let t={client_id:this.client_id,scope:"openid",response_type:M.call(this),redirect_uri:N.call(this),...e};return Object.entries(t).forEach(([e,r])=>{null==r?delete t[e]:"claims"===e&&"object"==typeof r?t[e]=JSON.stringify(r):"resource"===e&&Array.isArray(r)?t[e]=r:"string"!=typeof r&&(t[e]=String(r))}),t}function G(e){if(!S(e)||!Array.isArray(e.keys)||e.keys.some(e=>!S(e)||!("kty"in e)))throw TypeError("jwks must be a JSON Web Key Set formatted object");return I.fromJWKS(e,{onlyPrivate:!0})}class X{#e;#t;#r;#i;constructor(e,t,r={},i,n){if(this.#e=new Map,this.#t=e,this.#r=t,"string"!=typeof r.client_id||!r.client_id)throw TypeError("client_id is required");let o={grant_types:["authorization_code"],id_token_signed_response_alg:"RS256",authorization_signed_response_alg:"RS256",response_types:["code"],token_endpoint_auth_method:"client_secret_basic",...this.fapi()?{grant_types:["authorization_code","implicit"],id_token_signed_response_alg:"PS256",authorization_signed_response_alg:"PS256",response_types:["code id_token"],tls_client_certificate_bound_access_tokens:!0,token_endpoint_auth_method:void 0}:void 0,...r};if(this.fapi())switch(o.token_endpoint_auth_method){case"self_signed_tls_client_auth":case"tls_client_auth":break;case"private_key_jwt":if(!i)throw TypeError("jwks is required");break;case void 0:throw TypeError("token_endpoint_auth_method is required");default:throw TypeError("invalid or unsupported token_endpoint_auth_method")}if(function(e,t,r){if(t.token_endpoint_auth_method||function(e,t){try{let r=e.issuer.token_endpoint_auth_methods_supported;!r.includes(t.token_endpoint_auth_method)&&r.includes("client_secret_post")&&(t.token_endpoint_auth_method="client_secret_post")}catch(e){}}(e,r),t.redirect_uri){if(t.redirect_uris)throw TypeError("provide a redirect_uri or redirect_uris, not both");r.redirect_uris=[t.redirect_uri],delete r.redirect_uri}if(t.response_type){if(t.response_types)throw TypeError("provide a response_type or response_types, not both");r.response_types=[t.response_type],delete r.response_type}}(this,r,o),v("token",this.issuer,o),["introspection","revocation"].forEach(e=>{(function(e,t,r){if(!t[`${e}_endpoint`])return;let i=r.token_endpoint_auth_method,n=r.token_endpoint_auth_signing_alg,o=`${e}_endpoint_auth_method`,s=`${e}_endpoint_auth_signing_alg`;void 0===r[o]&&void 0===r[s]&&(void 0!==i&&(r[o]=i),void 0!==n&&(r[s]=n))})(e,this.issuer,o),v(e,this.issuer,o)}),Object.entries(o).forEach(([e,t])=>{this.#e.set(e,t),this[e]||Object.defineProperty(this,e,{get(){return this.#e.get(e)},enumerable:!0})}),void 0!==i){let e=G.call(this,i);C.set(this,e)}null!=n&&n.additionalAuthorizedParties&&(this.#i=$(n.additionalAuthorizedParties)),this[j]=0}authorizationUrl(e={}){if(!S(e))throw TypeError("params must be a plain object");w(this.issuer,"authorization_endpoint");let t=new u(this.issuer.authorization_endpoint);for(let[r,i]of Object.entries(V.call(this,e)))if(Array.isArray(i))for(let e of(t.searchParams.delete(r),i))t.searchParams.append(r,e);else t.searchParams.set(r,i);return t.href.replace(/\+/g,"%20")}authorizationPost(e={}){if(!S(e))throw TypeError("params must be a plain object");let t=V.call(this,e),r=Object.keys(t).map(e=>``).join("\n");return`
-
-Requesting Authorization
-
-
-
-
-