diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..7329dddd --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,11 @@ +FROM oven/bun:debian + +# Config Bun +ENV PATH="~/.bun/bin:${PATH}" +RUN ln -s /usr/local/bin/bun /usr/local/bin/node + +# Update packages +RUN apt-get update + +# Install Git +RUN apt-get update && apt-get install -y git diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..5fcba8aa --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,56 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/marcosgomesneto/bun-devcontainers/tree/main/src/bun-postgresql +{ + "name": "MUNify Dev Container", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {}, + "ghcr.io/devcontainers-contrib/features/starship:1": {} + }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // This can be used to network with other containers or with the host. + "forwardPorts": [ + 3000, + 3001, + 5432, + 3777, + 5968, + 6379 + ], + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash /workspaces/munify/.devcontainer/setup.sh", + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "editor.formatOnSave": true, + "files.insertFinalNewline": true + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "biomejs.biome", + "rioukkevin.vscode-git-commit", + "prisma.prisma", + "zainchen.json", + "yoavbls.pretty-ts-errors", + "msjsdiag.vscode-react-native", + "bradlc.vscode-tailwindcss", + "austenc.tailwind-docs", + "stivo.tailwind-fold", + "gruntfuggly.todo-tree", + "ms-vsliveshare.vsliveshare", + "eamodio.gitlens", + "exceedsystem.vscode-macros" + + ] + } + }, + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 00000000..67418221 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,54 @@ +version: "3.8" + +services: + app: + build: + context: . + dockerfile: Dockerfile + + volumes: + - ../..:/workspaces:cached + + # Overrides default command so things don't shut down after the process ends. + command: sleep infinity + + # Runs app on the host network, so that every port is already available from the host. + network_mode: "host" + + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + + postgres: + image: postgres + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + ports: + - "5432:5432" + volumes: + - postgres-data:/var/lib/postgresql/data + network_mode: "host" + + redis: + image: redis + ports: + - '6379:6379' + volumes: + - redis-data:/data + network_mode: "host" + + smtp4dev: + image: rnwood/smtp4dev + ports: + - '3777:80' + - '5968:25' + volumes: + - smtp4dev:/smtp4dev + environment: + - RelayOptions__Login=dev + - RelayOptions__Password=dev + +volumes: + postgres-data: + redis-data: + smtp4dev: \ No newline at end of file diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 00000000..5657d7d5 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,22 @@ +echo "Setting Up Devcontainer" +echo "=======================" + +echo "" +echo "Installing Starship" +echo "-------------------" + +mkdir -p ~/.config/fish +touch ~/.config/fish/config.fish +echo "starship init fish | source" > ~/.config/fish/config.fish +echo 'echo "starship init fish | source" > ~/.config/fish/config.fish' + + +echo "" +echo "Setting up Prisma Database" +echo "--------------------------" + +sleep 1 +cd /workspaces/munify/chase/backend +bun i +bunx prisma migrate reset --force +bunx prisma migrate dev -n initial_dev_migration diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..079b73bc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +node_modules +.next +**/*.pnp +**/*.pnp.js +coverage +out +build +.DS_Store +**/*.pem +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.env*.local +.vercel +*.tsbuildinfo +next-env.d.ts +.postgres-data +.redis-data + +chase/backend/prisma/generated +fontawesome-pro-6.4.2/ +.env +certificates +.smtp4dev \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4cf86428..84d0a24f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,9 +17,10 @@ jobs: env: FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} - - name: Generate prisma types + # typecheck the backend since it is required for the frontend + - name: Typecheck backend working-directory: ./chase/backend - run: bunx prisma generate + run: bun run typecheck - name: Run build run: bun run build @@ -39,18 +40,10 @@ jobs: env: FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} - - name: Generate prisma types + - name: Typecheck working-directory: ./chase/backend - run: bunx prisma generate + run: bun run typecheck - name: Run build working-directory: ./chase/backend - run: bun run build - - # test if the server starts without errors - - name: Run the server - id: run - env: - CI: "true" - run: | - timeout 20s bun run ./build/main.js || true \ No newline at end of file + run: bun run build \ No newline at end of file diff --git a/.github/workflows/build_publish_container_images.yml b/.github/workflows/build_publish_container_images.yml new file mode 100644 index 00000000..50fa9147 --- /dev/null +++ b/.github/workflows/build_publish_container_images.yml @@ -0,0 +1,56 @@ +name: Build and publish container images +on: + release: + types: [created] + +jobs: + # chase-build-frontend: + # runs-on: ubuntu-latest + # steps: + # - name: Checkout code + # uses: actions/checkout@v2 + + # - name: Setup Bun.js + # uses: oven-sh/setup-bun@v1 + + # - name: Install all dependencies + # run: bun i + # env: + # FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} + + # # typecheck the backend since it is required for the frontend + # - name: Typecheck backend + # working-directory: ./chase/backend + # run: bun run typecheck + + # - name: Run build + # run: bun run build + # working-directory: ./chase/frontend + + + chase-backend: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: m1212e/chase-backend + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile.backend + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index 41f8caab..079b73bc 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,10 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts .postgres-data -.redis-data \ No newline at end of file +.redis-data + +chase/backend/prisma/generated +fontawesome-pro-6.4.2/ +.env +certificates +.smtp4dev \ No newline at end of file diff --git a/.vscode/macros.ts b/.vscode/macros.ts new file mode 100644 index 00000000..0aa54c0b --- /dev/null +++ b/.vscode/macros.ts @@ -0,0 +1,26 @@ +const vscode = require("vscode"); + +module.exports.macroCommands = { + OpenI18n: { + no: 1, + func: async () => { + openI18nFile("/workspaces/munify/chase/frontend/i18n/en/index.ts"); + setTimeout(async () => { + await vscode.commands.executeCommand( + "workbench.action.moveEditorToNextGroup", + ); + }, 500); + setTimeout(() => { + openI18nFile("/workspaces/munify/chase/frontend/i18n/de/index.ts"); + }, 500); + }, + }, +}; + +async function openI18nFile(filename) { + const document = await vscode.workspace.openTextDocument(filename); + const editor = await vscode.window.showTextDocument(document); + const save = await vscode.commands.executeCommand( + "workbench.action.files.save", + ); +} diff --git a/.vscode/react.code-snippets b/.vscode/react.code-snippets new file mode 100644 index 00000000..2a21327d --- /dev/null +++ b/.vscode/react.code-snippets @@ -0,0 +1,33 @@ +{ + "React Component Setup": { + "prefix": ["page", "component", "new"], + "body": [ + "${1|\"use client\";, |}", + "import React, { useState, useEffect } from \"react\";", + "import { useI18nContext } from \"@/i18n/i18n-react\";", + "import { backend } from \"@/services/backend\";", + "", + "export default function ${2:COMPONENT_TITLE}() {", + " const { LL, locale } = useI18nContext();", + " ", + " return (", + " <>", + " ${3}", + " ", + " );", + "}" + ], + "description": "Create a new React page" + }, + "Generic Error Toast": { + "prefix": ["toast", "error-toast"], + "body": [ + "toast.current?.show({" + " severity: \"error\"," + " summary: LL.admin.onboarding.error.title()," + " detail: LL.admin.onboarding.error.generic()," + "});" + ], + "description": "Create a new generic error toast" + }, +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 810905ca..2f203c79 100755 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,19 +4,18 @@ "{prefix} ({scope}): {message}", "branch: {branch}" ], - "[javascript]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "editor.codeActionsOnSave": { - "quickfix.biome": true, - "source.organizeImports.biome": true - }, + "[javascript]": {}, + "editor.codeActionsOnSave": {}, "vscodeGitCommit.variables": { "prefix": [ { "label": "✨ feat", "detail": "A new feature" }, + { + "label": "⬆️ improvement", + "detail": "An improvement of an existing feature" + }, { "label": "🐞 fix", "detail": "A bugfix" @@ -73,25 +72,14 @@ "label": "🔀 merge", "detail": "Use when merging branches" } - ], - "scope": [ - { - "label": "CHASE Frontend", - "detail": "Changes to the Chase Frontend" - }, - { - "label": "CHASE Backend", - "detail": "Changes to the Chase Backend" - }, - { - "label": "AUTH", - "detail": "Changes to the auth system" - }, - { - "label": "MUNify", - "detail": "Changes to MUNify in general" - } - ], - "branch": "branch" - } + ] + }, + "typescript.tsdk": "node_modules/typescript/lib", + "editor.tabSize": 2, + "vscodemacros.userMacroCommands": [ + { + "path": "/workspaces/munify/.vscode/macros.ts", + "name": "OpenI18n" + } + ] } diff --git a/Dockerfile.backend b/Dockerfile.backend new file mode 100644 index 00000000..e3b7406a --- /dev/null +++ b/Dockerfile.backend @@ -0,0 +1,35 @@ +# Builds an image to run the api in prod mode + +# install dependencies into temp directory +# this will cache them and speed up future builds +FROM oven/bun:latest AS install +RUN mkdir -p /temp/dev +COPY package.json bun.lockb bunfig.toml /temp/dev/ +COPY chase/backend/package.json /temp/dev/chase/backend/package.json +COPY chase/frontend/package.json /temp/dev/chase/frontend/package.json +RUN cd /temp/dev && bun install --frozen-lockfile + +# since we bundle we dont really need the dependencies in the prod version +# install with --production (exclude devDependencies) +# RUN mkdir -p /temp/prod +# COPY package.json bun.lockb /temp/prod/ +# RUN cd /temp/prod && bun install --frozen-lockfile --production + +# we need to use node and bun for generating prisma files, see https://github.com/prisma/prisma/issues/21241 +FROM imbios/bun-node AS prerelease +WORKDIR /app/staging +COPY --from=install /temp/dev/node_modules node_modules +# generates types and runs a typecheck +RUN cd chase/backend && bun run typecheck +RUN cd chase/backend && bun run build + +FROM oven/bun:alpine AS release +WORKDIR /app/prod +# dependencies +COPY --from=prerelease /app/staging/chase/backend/out ./out/ +ENV NODE_ENV=production +ENV PORT=3001 +# run the app +USER bun +EXPOSE 3001/tcp +ENTRYPOINT [ "bun", "run", "out/main.js" ] diff --git a/authentication/README.md b/authentication/README.md deleted file mode 100644 index 7f152dca..00000000 --- a/authentication/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# authentication -This is a library project, it only exports modules but is not runnable or intended to run as a standalone application. It can/should be used by other projects to manage authentication and permissions. - -## ZITADEL -[ZITADEL](https://zitadel.com/) is the OpenID Connect issuer used in munify. This works the same way as "Login with Google" or Microsoft, Github etc. does. Except we selfhost the issuer, instead of relying on a company to do this for us. -If you are new to OpenID, have a look [here](https://openid.net/developers/how-connect-works/). For development this project contains a compose file which starts an instance on http://localhost:7788. It will be started automatically on running the root dev script. See https://zitadel.com/docs/self-hosting/deploy/compose for docs on Docker hosting and the default credentials. - -## src -The src dir contains various modules for interacting with the OpenID connect standard and ZITADEL. The index re-exports various types to be available externally for library users. - -## permissions class -The permissions class inside [scr/types/permissions.ts](./src/types/permissions.ts) contains business logic for granting user permissions based on their ZITADEL metadata. It should be used to manage how permissions are set/checked in the application. - -## Running ZITADEL -The `package.json` provides some helpful scripts for running ZITADEL in dev mode. You will likely not use this while developing, instead consider mocking the authentication. diff --git a/authentication/bun.lockb b/authentication/bun.lockb deleted file mode 100644 index 492c55ac..00000000 Binary files a/authentication/bun.lockb and /dev/null differ diff --git a/authentication/docker-compose.yml b/authentication/docker-compose.yml deleted file mode 100644 index cedd6dec..00000000 --- a/authentication/docker-compose.yml +++ /dev/null @@ -1,33 +0,0 @@ -services: - zitadel: - networks: - - 'zitadel' - image: 'ghcr.io/zitadel/zitadel:latest' - command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --tlsMode disabled' - environment: - - 'ZITADEL_DATABASE_COCKROACH_HOST=crdb' - - 'ZITADEL_EXTERNALSECURE=false' - - 'ZITADEL_EXTERNALPORT=7788' - depends_on: - crdb: - condition: 'service_healthy' - ports: - - '7788:8080' - - crdb: - networks: - - 'zitadel' - image: 'cockroachdb/cockroach:v22.2.2' - command: 'start-single-node --insecure' - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"] - interval: '10s' - timeout: '30s' - retries: 5 - start_period: '20s' - ports: - - '9090:8080' - - '26257:26257' - -networks: - zitadel: \ No newline at end of file diff --git a/authentication/package.json b/authentication/package.json deleted file mode 100644 index 89ea17ba..00000000 --- a/authentication/package.json +++ /dev/null @@ -1,10 +0,0 @@ - -{ - "name": "authentication", - "main": "src/index.ts", - "type": "module", - "scripts": { - "dev": "bun run dev:docker", - "dev:docker": "docker compose up --remove-orphans" - } -} \ No newline at end of file diff --git a/authentication/src/index.ts b/authentication/src/index.ts deleted file mode 100644 index 5cc0ecda..00000000 --- a/authentication/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { introspect } from "./services/openid/introspect"; -export { Permissions } from "./types/permissions"; -export type { Metadata } from "./services/zitadel/parseMetadata"; -export * from "./types/metadata"; diff --git a/authentication/src/services/openid/introspect.ts b/authentication/src/services/openid/introspect.ts deleted file mode 100644 index b8a2c30b..00000000 --- a/authentication/src/services/openid/introspect.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { User } from "../../types/metadata"; -import { Permissions } from "../../types/permissions"; -import { requireEnvWhenAuthNotMocked } from "helpers"; -import { - ZITADEL_METADATA_CLAIM, - parseMetadata, -} from "../zitadel/parseMetadata"; -import { setUserMetadata } from "../zitadel/editUserMetadata"; - -const OPENID_URL = requireEnvWhenAuthNotMocked("OPENID_URL"); -const ZITADEL_USERNAME = requireEnvWhenAuthNotMocked("ZITADEL_USERNAME"); -const ZITADEL_PASSWORD = requireEnvWhenAuthNotMocked("ZITADEL_PASSWORD"); - -interface WellKnownData { - introspection_endpoint: string; -} - -let failCounter = 0; - -async function fetchWellKnownData(): Promise { - try { - const res = await fetch(`${OPENID_URL}/.well-known/openid-configuration`); - - if (!res.status.toString().startsWith("2")) { - throw new Error(`Well known data request errored: ${await res.text()}`); - } - // biome-ignore lint/suspicious/noExplicitAny: complex type, we dont care - const data = (await res.json()) as any; - console.info("Well known data fetched successfully"); - return data; - } catch (error) { - if (failCounter > 3) { - console.error( - "Failed to fetch well known data, retrying... (This is ok at process startup, or if running in dev mode)", - error - ); - } - failCounter++; - return undefined; - } -} - -let wellKnownData = await fetchWellKnownData(); - -/** - * Returns the parsed user data or undefined if the user is not authorized - */ -export async function introspect( - token: string -): Promise<{ user: User; permissions: Permissions } | undefined> { - const params = new URLSearchParams(); - params.append("token", token); - - const authorizationHeaderContent = Buffer.from( - `${ZITADEL_USERNAME}:${ZITADEL_PASSWORD}` - ).toString("base64"); - - // retry fetch if we havent succeeded yet - if (!wellKnownData) { - wellKnownData = await fetchWellKnownData(); - if (!wellKnownData) { - throw new Error("Could not fetch well known data"); - } - } - const req = await fetch(wellKnownData.introspection_endpoint, { - method: "POST", - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Authorization: `Basic ${authorizationHeaderContent}`, - }, - body: params, - }); - - if (!req.status.toString().startsWith("2")) { - throw new Error(`Introspection request errored: ${await req.text()}`); - } - - //TODO - // biome-ignore lint/suspicious/noExplicitAny: - const parsedIntrospectionData = (await req.json()) as any; - - if (!parsedIntrospectionData.active) { - return undefined; - } - - const parsedMetadata = parseMetadata( - parsedIntrospectionData[ZITADEL_METADATA_CLAIM] - ); - - const userId = parsedIntrospectionData.sub; - - return { - user: { - email: parsedIntrospectionData.email, - email_verified: parsedIntrospectionData.email_verified, - family_name: parsedIntrospectionData.family_name, - given_name: parsedIntrospectionData.given_name, - id: userId, - locale: parsedIntrospectionData.locale, - pronouns: parsedMetadata.pronouns, - }, - permissions: new Permissions(userId, parsedMetadata, setUserMetadata), - }; -} diff --git a/authentication/src/services/zitadel/editUserMetadata.ts b/authentication/src/services/zitadel/editUserMetadata.ts deleted file mode 100644 index 0a22a14d..00000000 --- a/authentication/src/services/zitadel/editUserMetadata.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { requireEnvWhenAuthNotMocked } from "helpers/src/envloader"; -import { Metadata } from "./parseMetadata"; - -//TODO spend some precious time to find out if roles might be the better way to tackle this - -const OPENID_URL = requireEnvWhenAuthNotMocked("OPENID_URL"); -const ZITADEL_SERVICE_USER_PERSONAL_ACCESS_TOKEN = requireEnvWhenAuthNotMocked( - "ZITADEL_SERVICE_USER_PERSONAL_ACCESS_TOKEN" -); - -export type MetadataSetter = ( - userId: string, - metadata: Partial -) => Promise; - -// ATTENTION: This procedure assumes that there is only every one instance writing the metadata at the issuer at the same time -// if two instances write at the same time, the last one will overwrite the first one -export async function setUserMetadata( - userId: string, - metadata: Partial -) { - return Promise.all( - Object.entries(metadata).map(async ([key, data]) => { - const res = await fetch( - `${OPENID_URL}/management/v1/users/${userId}/metadata/${key}`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Accept: "application/json", - Authorization: `Bearer ${ZITADEL_SERVICE_USER_PERSONAL_ACCESS_TOKEN}`, - }, - body: JSON.stringify({ - value: Buffer.from(JSON.stringify(data)).toString("base64"), - }), - } - ); - - if (!res.status.toString().startsWith("2")) { - throw new Error(`Failed to set user metadata: ${await res.text()}`); - } - - return res; - }) - ); -} diff --git a/authentication/src/services/zitadel/parseMetadata.ts b/authentication/src/services/zitadel/parseMetadata.ts deleted file mode 100644 index 59e6b62c..00000000 --- a/authentication/src/services/zitadel/parseMetadata.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { - Chair, - ConferenceAdmin, - Delegate, - NonStateActor, - SecretaryMember, - Visitor, -} from "../../types/metadata"; - -export const ZITADEL_METADATA_CLAIM = "urn:zitadel:iam:user:metadata"; - -export interface Metadata { - nonStateActorPermissions: NonStateActor[]; - representativePermissions: Delegate[]; - secretaryMemberPermissions: SecretaryMember[]; - chairPermissions: Chair[]; - conferenceAdminPermissions: ConferenceAdmin[]; - visitorPermissions: Visitor[]; - pronouns: string; -} - -export type MetadataKeys = - | "nonStateActorPermissions" - | "representativePermissions" - | "secretaryMemberPermissions" - | "chairPermissions" - | "pronouns" - | "conferenceAdminPermissions" - | "visitorPermissions"; - -export type RawMetadata = { - [key in MetadataKeys]: string; -}; - -export function parseMetadata(rawMetadata?: RawMetadata): Metadata { - return { - pronouns: rawMetadata?.pronouns ?? "", - nonStateActorPermissions: - decodeFromBase64JSON(rawMetadata?.nonStateActorPermissions) ?? [], - representativePermissions: - decodeFromBase64JSON(rawMetadata?.representativePermissions) ?? [], - secretaryMemberPermissions: - decodeFromBase64JSON(rawMetadata?.secretaryMemberPermissions) ?? [], - chairPermissions: decodeFromBase64JSON(rawMetadata?.chairPermissions) ?? [], - conferenceAdminPermissions: - decodeFromBase64JSON(rawMetadata?.conferenceAdminPermissions) ?? [], - visitorPermissions: - decodeFromBase64JSON(rawMetadata?.visitorPermissions) ?? [], - }; -} - -function decodeFromBase64JSON(value?: string) { - if (!value) return undefined; - return JSON.parse(Buffer.from(value, "base64").toString("utf-8")); -} diff --git a/authentication/src/types/metadata.ts b/authentication/src/types/metadata.ts deleted file mode 100644 index ffa05c2e..00000000 --- a/authentication/src/types/metadata.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Auth related user data - */ -export interface User { - id: string; - email: string; - email_verified: boolean; - family_name: string; - given_name: string; - locale: string; - pronouns: string; -} - -/** - * How the auth system references conferences - */ -export type ConferenceId = string; -/** - * How the auth system references countries - */ -export type CountryId = string; /** - * How the auth system references organizations (like greenpeace etc.) - */ -export type OrganizationId = string; - -/** - * A commitee how it is referenced by the authentication system - */ -export type Commitee = { - id: string; - conference: ConferenceId; -}; - -/** - * A nsa how it is referenced by the authentication system - */ -export interface NonStateActor { - conference: ConferenceId; - organization: OrganizationId; -} - -/** - * A delegate how it is referenced by the authentication system - */ -export interface Delegate { - conference: ConferenceId; - commitee: Commitee; - country: CountryId; -} - -/** - * A secretary member how it is referenced by the authentication system - */ -export interface SecretaryMember { - conference: ConferenceId; -} - -/** - * A committee chair how it is referenced by the authentication system - */ -export interface Chair { - commitee: Commitee; -} - -/** - * A conference admin how it is referenced by the authentication system - */ -export interface ConferenceAdmin { - conference: ConferenceId; -} - -/** - * A conference visitor how it is referenced by the authentication system - */ -export interface Visitor { - conference: ConferenceId; -} diff --git a/authentication/src/types/permissions.ts b/authentication/src/types/permissions.ts deleted file mode 100644 index ff8719c5..00000000 --- a/authentication/src/types/permissions.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Commitee, ConferenceId } from "./metadata"; -import { Metadata } from "../services/zitadel/parseMetadata"; -import { type MetadataSetter } from "../services/zitadel/editUserMetadata"; - -/** - * This class is a wrapper around the user metadata and abstracts the actual business logic for the permissions in the system. - * It maps the question "Can a user do, edit, see XY" to a function which checks the claims in the metadata - * Also it provides helpers to update user permissions - */ -export class Permissions { - constructor( - private readonly userId: string, - private readonly metadata: Metadata, - private readonly metadataSetter: MetadataSetter, // make this exchangeable for dev mocking - ) {} - - setConferenceAdmin(conferenceId: ConferenceId) { - this.metadata.conferenceAdminPermissions.push({ - conference: conferenceId, - }); - - return this.metadataSetter(this.userId, { - conferenceAdminPermissions: this.metadata.conferenceAdminPermissions, - }); - } - - isConferenceAdmin(conference: ConferenceId) { - return ( - this.metadata.conferenceAdminPermissions.find( - (c) => c.conference === conference, - ) !== undefined - ); - } - - revokeConferenceAdmin(conference: ConferenceId) { - this.metadata.conferenceAdminPermissions = - this.metadata.conferenceAdminPermissions.filter( - (c) => c.conference !== conference, - ); - - return this.metadataSetter(this.userId, { - conferenceAdminPermissions: this.metadata.conferenceAdminPermissions, - }); - } - - canReadCommitee(commitee: Commitee): boolean { - return ( - this.metadata.visitorPermissions.some( - (v) => v.conference === commitee.conference, - ) || - this.metadata.secretaryMemberPermissions.some( - (v) => v.conference === commitee.conference, - ) || - this.metadata.conferenceAdminPermissions.some( - (v) => v.conference === commitee.conference, - ) || - this.metadata.nonStateActorPermissions.some( - (v) => v.conference === commitee.conference, - ) || - this.metadata.chairPermissions.some( - (v) => v.commitee.conference === commitee.conference, // even though chairs are assigned to commitees, its nice for them to be able to read other commitees - ) || - this.metadata.representativePermissions.some( - (v) => v.commitee.id === commitee.id, // these are the only folks who are not allowed to read other commitees except their own - ) - ); - } - - canManageCommitee(commitee: Commitee): boolean { - return ( - this.metadata.conferenceAdminPermissions.some( - (v) => v.conference === commitee.conference, - ) || - this.metadata.chairPermissions.some((v) => v.commitee.id === commitee.id) - ); - } -} diff --git a/authentication/tsconfig.json b/authentication/tsconfig.json deleted file mode 100644 index f1d52141..00000000 --- a/authentication/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "@tsconfig/node16/tsconfig.json", - "compilerOptions": { - "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - "module": "ESNext" /* Specify what module code is generated. */, - "moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */, - "baseUrl": "./" /* Specify the base directory to resolve non-relative module names. */, - "types": [ - "bun-types" - ] /* Specify type package names to be included without being referenced in a source file. */, - "resolveJsonModule": true /* Enable importing .json files. */, - - "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, - "strict": true /* Enable all strict type-checking options. */, - "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */, - "strictNullChecks": true /* When type checking, take into account 'null' and 'undefined'. */, - "strictFunctionTypes": true /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */, - "noUnusedLocals": true /* Enable error reporting when local variables aren't read. */, - "noUnusedParameters": true /* Raise an error when a function parameter isn't read. */, - "noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */, - "skipDefaultLibCheck": true /* Skip type checking .d.ts files that are included with TypeScript. */, - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -} diff --git a/biome.json b/biome.json index 6eeec18f..77b8ab65 100755 --- a/biome.json +++ b/biome.json @@ -8,7 +8,8 @@ "rules": { "recommended": true, "correctness": { - "noUnusedVariables": "warn" + "noUnusedVariables": "warn", + "useExhaustiveDependencies": "off" }, "suspicious": { "noConsoleLog": "warn" @@ -27,7 +28,7 @@ "ignore": [ "chase/frontend/i18n/*.ts", "chase/frontend/i18n/*.tsx", - "chase/frontend/backend-client" + ".devcontainer" ] } } diff --git a/bun.lockb b/bun.lockb index 0480abf2..b48f9b7b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/chase/README.md b/chase/README.md index 4ce9569e..bd2f628c 100644 --- a/chase/README.md +++ b/chase/README.md @@ -1,2 +1,2 @@ # chase -Chase is the part of munify which is used directly on the conferences. It contains frontend and backend for the on conference application and allows to do things like managing speakerlists, voting or writing papers. See the respective folders for more details on the implementation. \ No newline at end of file +Chase is the part of munify which is used directly on the conferences. It contains frontend and backend for the on conference application and allows to do things like managing speakerlists, voting or writing papers. See the respective folders for more details on the implementation. diff --git a/chase/backend/.env b/chase/backend/.env index e094c953..94990f05 100644 --- a/chase/backend/.env +++ b/chase/backend/.env @@ -1,6 +1 @@ -# TODO find some way to make set these per user without overwriting vcs version every time -PORT=3001 -ORIGIN=http://localhost:3000 -ALLOWED_CORS_ORIGINS=* DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres -MOCK_AUTH=true diff --git a/chase/backend/.gitignore b/chase/backend/.gitignore index 583186ed..8b853a6c 100644 --- a/chase/backend/.gitignore +++ b/chase/backend/.gitignore @@ -41,4 +41,6 @@ yarn-error.log* package-lock.json **/*.bun -src/plugins/mockedAuth.json \ No newline at end of file +src/plugins/mockedAuth.json +.smtp4dev +certificates \ No newline at end of file diff --git a/chase/backend/README.md b/chase/backend/README.md index e5061a29..a4c2de51 100644 --- a/chase/backend/README.md +++ b/chase/backend/README.md @@ -8,5 +8,15 @@ bun run dev Open http://localhost:3001/ with your browser to see the result. -## Authentication -For development purposes you can modify the permissions in [src/plugins/auth.ts](./src/plugins/auth.ts) to your needs. They are disabled in prod, where ZITADEL (see the [auth](/auth) component) is used. +## Seeding the database +With the backend running, you can use a prisma script to seed the database with some preset dummy data: + +`Optional`: If your dev database does contain any data, you can reset it with: +```bash +bunx prisma db push --force-reset +``` + +Seed the database with: +```bash +bunx prisma db seed +``` \ No newline at end of file diff --git a/chase/backend/build.ts b/chase/backend/build.ts index 9e1a715c..6d12637f 100644 --- a/chase/backend/build.ts +++ b/chase/backend/build.ts @@ -1,18 +1,28 @@ +import { exists, rm } from "node:fs/promises"; +import { join } from "node:path"; + console.info("Building..."); +const clientDir = import.meta.dir; +const outDir = join(clientDir, "out"); +const srcDir = join(clientDir, "src"); + +if (await exists(outDir)) { + console.info(`Removing old build dir ${outDir}`); + await rm(outDir, { recursive: true }); +} + const output = await Bun.build({ - entrypoints: ["./src/main.ts"], - outdir: "./out", - target: "bun", - format: "esm", - splitting: true, - sourcemap: "external", - minify: true, + entrypoints: [join(srcDir, "main.ts")], + outdir: "./out", + target: "bun", + format: "esm", + splitting: true, + sourcemap: "external", + minify: true, }); if (!output.success) { - console.error(output.logs); + console.error(output.logs); } else { - console.info("Done!"); + console.info("Done!"); } - -export { } \ No newline at end of file diff --git a/chase/backend/bun.lockb b/chase/backend/bun.lockb index 966f5104..e69de29b 100644 Binary files a/chase/backend/bun.lockb and b/chase/backend/bun.lockb differ diff --git a/chase/backend/docker-compose.yml b/chase/backend/docker-compose.yml index 8497ad69..2e355d54 100755 --- a/chase/backend/docker-compose.yml +++ b/chase/backend/docker-compose.yml @@ -1,5 +1,3 @@ -# TODO document docker requirement for setup - services: postgres: image: postgres @@ -9,4 +7,20 @@ services: ports: - "5432:5432" volumes: - - ./.postgres-data:/var/lib/postgresql/data \ No newline at end of file + - ./.postgres-data:/var/lib/postgresql/data + redis: + image: redis + ports: + - '6379:6379' + volumes: + - ./.redis-data:/data + smtp4dev: + image: rnwood/smtp4dev + ports: + - '3777:80' + - '5968:25' + volumes: + - ./.smtp4dev:/smtp4dev + environment: + - RelayOptions__Login=dev + - RelayOptions__Password=dev \ No newline at end of file diff --git a/chase/backend/package.json b/chase/backend/package.json index f16cf319..92c161ab 100644 --- a/chase/backend/package.json +++ b/chase/backend/package.json @@ -2,10 +2,42 @@ "version": "1.0.44", "name": "chase-backend", "main": "src/main.ts", + "private": "true", "scripts": { - "dev": "bun run concurrently \"bun run dev:server\" \"bun run dev:docker\"", + "dev": "bun run concurrently \"bun run dev:server\" \"bun run dev:docker\" \"bun run dev:prisma-studio\"", + "dev:container": "bun run concurrently \"bun run dev:server\" \"bun run dev:prisma-studio\"", "dev:server": "bun run --watch --hot src/main.ts", "dev:docker": "docker compose up --remove-orphans", - "build": "tsc --noEmit && bun build.ts" + "dev:prisma-studio": "bunx prisma studio --browser none", + "build": "bun build.ts", + "typecheck": "bunx prisma generate && tsc --noEmit", + "database:reset": "bunx prisma db push --force-reset & bunx prisma db seed" + }, + "devDependencies": { + "@types/mjml": "^4.7.4", + "@types/nodemailer": "^6.4.14", + "bun-types": "latest", + "concurrently": "^8.2.2", + "prisma": "^5.9.1", + "prisma-typebox-generator": "^2.1.0", + "@faker-js/faker": "^8.4.0" + }, + "dependencies": { + "@elysiajs/bearer": "^0.8.0", + "@elysiajs/cors": "^0.8.0", + "@elysiajs/eden": "^0.8.1", + "@elysiajs/swagger": "^0.8.3", + "@prisma/client": "^5.9.1", + "@simplewebauthn/server": "^9.0.0", + "@sinclair/typebox": "^0.32.12", + "elysia": "^0.8.16", + "mjml": "^4.14.1", + "nanoid": "^5.0.4", + "nodemailer": "^6.9.8", + "redis": "^4.6.12", + "typescript": "5.3.3" + }, + "prisma": { + "seed": "bun run prisma/seed.ts" } -} \ No newline at end of file +} diff --git a/chase/backend/prisma/custom_seeds/seed_mun-sh2024.ts b/chase/backend/prisma/custom_seeds/seed_mun-sh2024.ts new file mode 100644 index 00000000..6e89d0f8 --- /dev/null +++ b/chase/backend/prisma/custom_seeds/seed_mun-sh2024.ts @@ -0,0 +1,397 @@ +// import { faker } from "@faker-js/faker"; +import { $Enums, PrismaClient } from "../generated/client"; +const prisma = new PrismaClient(); + +try { + /* + * -------------------- + * MUN-SH 2024 Data + * -------------------- + */ + const conference = await prisma.conference.upsert({ + where: { + name: "MUN-SH 2024", + }, + update: {}, + create: { + name: "MUN-SH 2024", + start: new Date("2024-03-07"), + end: new Date("2024-03-11"), + }, + }); + console.info("\n----------------\n"); + console.info(`Created a MUN-SH 2024 Conference with the ID ${conference.id}`); + + // Committees + + const committees = {} as { + GV: Awaited> | undefined; + HA1: Awaited> | undefined; + WiSo: Awaited> | undefined; + SR: Awaited> | undefined; + MRR: Awaited> | undefined; + WHO: Awaited> | undefined; + IAEO: Awaited> | undefined; + }; + + committees.GV = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "GV", + name: "Generalversammlung", + category: "COMMITTEE", + }, + }); + + committees.HA1 = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "HA1", + name: "Hauptausschuss 1", + category: "COMMITTEE", + parentId: committees.GV?.id, + }, + }); + + committees.WiSo = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "WiSo", + name: "Wirtschaft- und Sozialrat", + category: "COMMITTEE", + }, + }); + + committees.SR = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "SR", + name: "Sicherheitsrat", + category: "COMMITTEE", + }, + }); + + committees.MRR = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "MRR", + name: "Menschenrechtsrat", + category: "COMMITTEE", + }, + }); + + committees.WHO = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "WHO", + name: "Weltgesundheitsversammlung", + category: "COMMITTEE", + }, + }); + + committees.IAEO = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "IAEO", + name: "Generalkonferenz der Internationalen Atomenergieorganisation", + category: "COMMITTEE", + }, + }); + + console.info("\nCreated Committees:"); + console.info( + ` - Created ${committees.GV.abbreviation} with ID ${committees.GV.id}`, + ); + console.info( + ` - Created ${committees.HA1.abbreviation} with ID ${committees.HA1.id}`, + ); + console.info( + ` - Created ${committees.WiSo.abbreviation} with ID ${committees.WiSo.id}`, + ); + console.info( + ` - Created ${committees.SR.abbreviation} with ID ${committees.SR.id}`, + ); + console.info( + ` - Created ${committees.MRR.abbreviation} with ID ${committees.MRR.id}`, + ); + console.info( + ` - Created ${committees.WHO.abbreviation} with ID ${committees.WHO.id}`, + ); + console.info( + ` - Created ${committees.IAEO.abbreviation} with ID ${committees.IAEO.id}`, + ); + + // Team seeding + + await prisma.conferenceMember.create({ + data: { + conferenceId: conference.id, + role: "ADMIN", + }, + }); + + for (let i = 0; i < 21; i++) { + await prisma.conferenceMember.create({ + data: { + conferenceId: conference.id, + role: "CHAIR", + }, + }); + } + + for (let i = 0; i < 7; i++) { + await prisma.conferenceMember.create({ + data: { + conferenceId: conference.id, + role: "COMMITTEE_ADVISOR", + }, + }); + } + + console.info("\nCreated Team Pool"); + + // Committee seeding + + const agendaItems = [ + "Nachhaltige wirtschaftliche Entwicklung in den am wenigsten entwickelten Ländern", + "Umgang mit klimatischen Kipppunkten", + "Globales Erinnern an Kolonialismus", + + "Situation in der Ukraine", + "Bekämpfung illegaler Waffenlieferungen an nichtstaatliche Akteure", + "Planetare Verteidigung", + + "Förderung von Kreislaufwirtschaft", + "Umgang mit klimawandelbedingter Migration", + "Rolle von künstlicher Intelligenz für die nachhaltige Entwicklung", + + "Aktuelles", + "Situation in Haiti", + "Bedeutung natürlicher Ressourcen für bewaffnete Konflikte", + + "Verantwortung von Unternehmen für Menschenrechte entlang globaler Lieferketten", + "Umsetzung des Rechts auf eine saubere Umwelt", + "Menschenrechtslage in der Demokratischen Republik Kongo", + + "Verbesserung der psychischen Gesundheitsversorgung", + "Bekämpfung der Folgeerkranungen von Fehl- und Mangelernährung", + "Sicherung des Zugangs zu Verhütungsmitteln", + + "Sicherheit kerntechnischer Anlagen in Konfliktgebieten", + "Auswirkungen von Uranabbau, -nutzung und -lagerung auf indigene Bevölkerungen", + "Rolle der Kernenergie für die Umsetzung von SDG 7", + ]; + + let i = 0; + for (const committee of Object.values(committees)) { + if (committee) { + for (let j = 0; j < 3; j++) { + const agendaItem = await prisma.agendaItem.create({ + data: { + committeeId: committee.id, + title: agendaItems[i] || "Dummy Agenda Item", + }, + }); + await prisma.speakersList.createMany({ + data: [ + { + type: "SPEAKERS_LIST", + agendaItemId: agendaItem.id, + speakingTime: 180, + timeLeft: 180, + }, + { + type: "COMMENT_LIST", + agendaItemId: agendaItem.id, + speakingTime: 30, + timeLeft: 30, + }, + ], + }); + i++; + } + } + } + + console.info("\nCreated Agenda Items"); + + // Delegations + console.info("\nCreated Delegations:"); + + const delegations: () => string[] = () => { + const selectedCountries: string[] = []; + while (selectedCountries.length < 20) { + for (const countryRaw of allCountries) { + if ( + ["deu", "usa", "fra", "gbr", "rus", "chn"].includes( + countryRaw.alpha3Code, + ) || + Math.random() > 0.97 + ) { + if ( + !selectedCountries.includes(countryRaw.alpha3Code) && + countryRaw.variant !== $Enums.NationVariant.SPECIAL_PERSON && + countryRaw.variant !== $Enums.NationVariant.NON_STATE_ACTOR + ) { + selectedCountries.push(countryRaw.alpha3Code); + } + } + } + } + selectedCountries.sort(); + return selectedCountries; + }; + + for (const alpha3Code of delegations()) { + const delegation = await prisma.delegation.create({ + data: { + conference: { connect: { id: conference.id } }, + nation: { connect: { alpha3Code } }, + }, + }); + console.info( + ` - Created Delegation for ${alpha3Code} with ID ${delegation.id}`, + ); + + await prisma.committeeMember.create({ + data: { + committeeId: committees.GV?.id, + delegationId: delegation.id, + }, + }); + + if (Math.random() > 0.5) { + await prisma.committeeMember.create({ + data: { + committeeId: committees.HA1?.id, + delegationId: delegation.id, + }, + }); + } + + if (Math.random() > 0.7) { + await prisma.committeeMember.create({ + data: { + committeeId: committees.SR?.id, + delegationId: delegation.id, + }, + }); + } + } + + // Non-State Actors + console.info("\nCreated Non-State Actor CommitteeMemberships:"); + + const nonStateActors = await prisma.nation.findMany({ + where: { + variant: $Enums.NationVariant.NON_STATE_ACTOR, + }, + }); + + for (const nonStateActor of nonStateActors) { + const delegation = await prisma.delegation.create({ + data: { + conference: { connect: { id: conference.id } }, + nation: { connect: { alpha3Code: nonStateActor.alpha3Code } }, + }, + }); + + for (const committee of Object.values(committees)) { + if (committee) { + await prisma.committeeMember.create({ + data: { + committeeId: committee.id, + delegationId: delegation.id, + }, + }); + console.info( + ` - Created CommitteeMembership for ${nonStateActor.alpha3Code} in ${committee.abbreviation}`, + ); + } + } + } + + // Special Persons + console.info("\nCreated Special Persons CommitteeMemberships:"); + + const specialPersons = await prisma.nation.findMany({ + where: { + variant: $Enums.NationVariant.SPECIAL_PERSON, + }, + }); + + for (const specialPerson of specialPersons) { + const delegation = await prisma.delegation.create({ + data: { + conference: { connect: { id: conference.id } }, + nation: { connect: { alpha3Code: specialPerson.alpha3Code } }, + }, + }); + + for (const committee of Object.values(committees)) { + if (committee) { + await prisma.committeeMember.create({ + data: { + committeeId: committee.id, + delegationId: delegation.id, + }, + }); + console.info( + ` - Created CommitteeMembership for ${specialPerson.alpha3Code} in ${committee.abbreviation}`, + ); + } + } + } + + /* + * --------------- + * SimSim Data + * --------------- + */ + + const simSimConference = await prisma.conference.upsert({ + where: { + name: "SimSim", + }, + update: {}, + create: { + name: "SimSim", + }, + }); + + const simSimCommittees = {} as { + SimSim1: Awaited> | undefined; + SimSim2: Awaited> | undefined; + }; + + simSimCommittees.SimSim1 = await prisma.committee.create({ + data: { + conferenceId: simSimConference.id, + abbreviation: "S1", + name: "SimSim 1", + category: "COMMITTEE", + }, + }); + + simSimCommittees.SimSim2 = await prisma.committee.create({ + data: { + conferenceId: simSimConference.id, + abbreviation: "S2", + name: "SimSim 2", + category: "COMMITTEE", + }, + }); + + await prisma.conferenceMember.create({ + data: { + conferenceId: simSimConference.id, + role: "ADMIN", + }, + }); + + await prisma.$disconnect(); +} catch (e) { + console.error(e); + await prisma.$disconnect(); + process.exit(1); +} diff --git a/chase/backend/prisma/custom_seeds/seed_simsim.ts b/chase/backend/prisma/custom_seeds/seed_simsim.ts new file mode 100644 index 00000000..aae3f2aa --- /dev/null +++ b/chase/backend/prisma/custom_seeds/seed_simsim.ts @@ -0,0 +1,365 @@ +import { faker } from "@faker-js/faker"; +import Papa from "papaparse"; +import fs from "fs"; +import { $Enums, PrismaClient } from "../generated/client"; +const prisma = new PrismaClient(); + +try { + // Conference for a SimSim + const conferenceName = `${faker.color.human()} ${faker.animal.type()} SimSim Konferenz`; + const conference = await prisma.conference.upsert({ + where: { + name: conferenceName, + }, + update: {}, + create: { + name: conferenceName, + }, + }); + + // Two SimSim committees + const committees = {} as { + Sim1: Awaited> | undefined; + Sim2: Awaited> | undefined; + }; + + committees.Sim1 = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "Sim1", + name: `${faker.science.chemicalElement().name} SimSim`, + category: "COMMITTEE", + }, + }); + + committees.Sim2 = await prisma.committee.create({ + data: { + conferenceId: conference.id, + abbreviation: "Sim2", + name: `${faker.science.chemicalElement().name} SimSim`, + category: "COMMITTEE", + }, + }); + + // Conference members + + for (let i = 0; i < 3; i++) { + await prisma.conferenceMember.create({ + data: { + conferenceId: conference.id, + role: "ADMIN", + }, + }); + } + + for (let i = 0; i < 21; i++) { + await prisma.conferenceMember.create({ + data: { + conferenceId: conference.id, + role: "CHAIR", + }, + }); + } + + const agendaItems = [ + "Nachhaltige wirtschaftliche Entwicklung in den am wenigsten entwickelten Ländern", + "Umgang mit klimatischen Kipppunkten", + "Globales Erinnern an Kolonialismus", + + "Situation in der Ukraine", + "Bekämpfung illegaler Waffenlieferungen an nichtstaatliche Akteure", + "Planetare Verteidigung", + ]; + + let i = 0; + for (const committee of Object.values(committees)) { + if (committee) { + for (let j = 0; j < 3; j++) { + const agendaItem = await prisma.agendaItem.create({ + data: { + committeeId: committee.id, + title: agendaItems[i] || "Dummy Agenda Item", + }, + }); + await prisma.speakersList.createMany({ + data: [ + { + type: "SPEAKERS_LIST", + agendaItemId: agendaItem.id, + speakingTime: 180, + timeLeft: 180, + }, + { + type: "COMMENT_LIST", + agendaItemId: agendaItem.id, + speakingTime: 30, + timeLeft: 30, + }, + ], + }); + i++; + } + } + } + + const allCountries = [ + { alpha3Code: "atg" }, + { alpha3Code: "aut" }, + { alpha3Code: "brb" }, + { alpha3Code: "blr" }, + { alpha3Code: "bel" }, + { alpha3Code: "bol" }, + { alpha3Code: "bra" }, + { alpha3Code: "cmr" }, + { alpha3Code: "can" }, + { alpha3Code: "chl" }, + { alpha3Code: "chn" }, + { alpha3Code: "cub" }, + { alpha3Code: "cze" }, + { alpha3Code: "egy" }, + { alpha3Code: "fra" }, + { alpha3Code: "deu" }, + { alpha3Code: "isl" }, + { alpha3Code: "ita" }, + { alpha3Code: "jam" }, + { alpha3Code: "jpn" }, + { alpha3Code: "lie" }, + { alpha3Code: "mex" }, + { alpha3Code: "pol" }, + { alpha3Code: "rus" }, + { alpha3Code: "esp" }, + { alpha3Code: "uga" }, + { alpha3Code: "ukr" }, + { alpha3Code: "gbr" }, + { alpha3Code: "usa" }, + { alpha3Code: "zwe" }, + + { alpha3Code: "unm", variant: $Enums.NationVariant.SPECIAL_PERSON }, // Male General Secretary + { alpha3Code: "unw", variant: $Enums.NationVariant.SPECIAL_PERSON }, // Female General Secretary + { alpha3Code: "gsm", variant: $Enums.NationVariant.SPECIAL_PERSON }, // Male Guest Speaker + { alpha3Code: "gsw", variant: $Enums.NationVariant.SPECIAL_PERSON }, // Female Guest Speaker + { alpha3Code: "uno", variant: $Enums.NationVariant.SPECIAL_PERSON }, // MISC UN Official + + { alpha3Code: "nsa_amn", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Amnesty International + { alpha3Code: "nsa_gnwp", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Global Network of Women Peacekeepers + { alpha3Code: "nsa_gp", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Greenpeace + { alpha3Code: "nsa_hrw", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Human Rights Watch + ]; + + for (const country of allCountries) { + if (country.variant) continue; + const delegation = await prisma.delegation.create({ + data: { + conference: { connect: { id: conference.id } }, + nation: { connect: { alpha3Code: country.alpha3Code } }, + }, + }); + + await prisma.committeeMember.createMany({ + data: [ + { + committeeId: committees.Sim1?.id, + delegationId: delegation.id, + }, + { + committeeId: committees.Sim2?.id, + delegationId: delegation.id, + }, + ], + }); + } + + const nonStateActors = await prisma.nation.findMany({ + where: { + variant: $Enums.NationVariant.NON_STATE_ACTOR, + }, + }); + + for (const nonStateActor of nonStateActors) { + const delegation = await prisma.delegation.create({ + data: { + conference: { connect: { id: conference.id } }, + nation: { connect: { alpha3Code: nonStateActor.alpha3Code } }, + }, + }); + + for (const committee of Object.values(committees)) { + if (committee) { + await prisma.committeeMember.create({ + data: { + committeeId: committee.id, + delegationId: delegation.id, + }, + }); + } + } + } + + // Special Persons + + const specialPersons = await prisma.nation.findMany({ + where: { + variant: $Enums.NationVariant.SPECIAL_PERSON, + }, + }); + + for (const specialPerson of specialPersons) { + const delegation = await prisma.delegation.create({ + data: { + conference: { connect: { id: conference.id } }, + nation: { connect: { alpha3Code: specialPerson.alpha3Code } }, + }, + }); + + for (const committee of Object.values(committees)) { + if (committee) { + await prisma.committeeMember.create({ + data: { + committeeId: committee.id, + delegationId: delegation.id, + }, + }); + } + } + } + + // Create dummy users for all conference- and committee-members + // biome-ignore lint/suspicious/noExplicitAny: This is only a seeding file and therefore not part of the application + const users: any = []; + + const allConferenceMembers = await prisma.conferenceMember.findMany({ + where: { + conferenceId: conference.id, + }, + }); + + for (const member of allConferenceMembers) { + const data = { + email: faker.internet.email(), + password: faker.music.songName().replace(/ /g, "-"), + role: member.role, + }; + + const user = await prisma.user.create({ + data: { + name: data.email, + emails: { + create: { + email: data.email, + validated: true, + }, + }, + passwords: { + create: { + passwordHash: await Bun.password.hash(data.password), + }, + }, + }, + }); + + await prisma.conferenceMember.update({ + where: { + id: member.id, + }, + data: { + userId: user.id, + }, + }); + + users.push(data); + } + + const allSim1Members = await prisma.committeeMember.findMany({ + where: { + committeeId: committees.Sim1?.id, + }, + }); + + for (const member of allSim1Members) { + const data = { + email: faker.internet.email(), + password: faker.music.songName().replace(/ /g, "-"), + role: "SimSim 1 Delegate", + }; + + const user = await prisma.user.create({ + data: { + name: data.email, + emails: { + create: { + email: data.email, + validated: true, + }, + }, + passwords: { + create: { + passwordHash: await Bun.password.hash(data.password), + }, + }, + }, + }); + + await prisma.committeeMember.update({ + where: { + id: member.id, + }, + data: { + userId: user.id, + }, + }); + + users.push(data); + } + + const allSim2Members = await prisma.committeeMember.findMany({ + where: { + committeeId: committees.Sim2?.id, + }, + }); + + for (const member of allSim2Members) { + const data = { + email: faker.internet.email(), + password: faker.music.songName().replace(/ /g, "-"), + role: "SimSim 2 Delegate", + }; + + const user = await prisma.user.create({ + data: { + name: data.email, + emails: { + create: { + email: data.email, + validated: true, + }, + }, + passwords: { + create: { + passwordHash: await Bun.password.hash(data.password), + }, + }, + }, + }); + + await prisma.committeeMember.update({ + where: { + id: member.id, + }, + data: { + userId: user.id, + }, + }); + + users.push(data); + } + + const csv = Papa.unparse(users); + + fs.writeFileSync("users.csv", csv); + + await prisma.$disconnect(); +} catch (e) { + console.error(e); + await prisma.$disconnect(); + process.exit(1); +} diff --git a/chase/backend/prisma/db.ts b/chase/backend/prisma/db.ts index a8429a32..127053d2 100644 --- a/chase/backend/prisma/db.ts +++ b/chase/backend/prisma/db.ts @@ -1,3 +1,37 @@ +import { appConfiguration } from "../src/util/config"; import { PrismaClient } from "./generated/client"; +import { createClient } from "redis"; -export const db = new PrismaClient(); +export const db = new PrismaClient({ + datasourceUrl: appConfiguration.db.postgresUrl, +}); + +export const redis = createClient({ + url: appConfiguration.db.redisUrl, +}); +redis.on("error", (err) => console.error("Redis Client Error", err)); +await redis.connect(); + +// maintanance +setInterval( + async () => { + await db.pendingCredentialCreateTask.deleteMany({ + where: { + token: { + expiresAt: { + lte: new Date(), + }, + }, + }, + }); + + await db.token.deleteMany({ + where: { + expiresAt: { + lte: new Date(), + }, + }, + }); + }, + 1000 * 60 * 11, +); diff --git a/chase/backend/prisma/generated/client/edge.d.ts b/chase/backend/prisma/generated/client/edge.d.ts deleted file mode 100644 index 34c61610..00000000 --- a/chase/backend/prisma/generated/client/edge.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './index' \ No newline at end of file diff --git a/chase/backend/prisma/generated/client/edge.js b/chase/backend/prisma/generated/client/edge.js deleted file mode 100644 index 2679ff89..00000000 --- a/chase/backend/prisma/generated/client/edge.js +++ /dev/null @@ -1,198 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, -} = require('./runtime/edge') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.3.1 - * Query Engine version: e95e739751f42d8ca026f6b910f5a2dc5adeaeee - */ -Prisma.prismaVersion = { - client: "5.3.1", - engine: "e95e739751f42d8ca026f6b910f5a2dc5adeaeee" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = Extensions.getExtensionContext -Prisma.defineExtension = Extensions.defineExtension - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - -/** - * Enums - */ -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.ConferenceScalarFieldEnum = { - id: 'id', - name: 'name', - start: 'start', - end: 'end' -}; - -exports.Prisma.ConferenceCreateTokenScalarFieldEnum = { - token: 'token' -}; - -exports.Prisma.CommitteeScalarFieldEnum = { - id: 'id', - name: 'name', - abbreviation: 'abbreviation', - conferenceId: 'conferenceId' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - Conference: 'Conference', - ConferenceCreateToken: 'ConferenceCreateToken', - Committee: 'Committee' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/mnt/codingssd/Coding/munify/chase/backend/prisma/generated/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "debian-openssl-3.0.x", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": "../../../.env", - "schemaEnvPath": "../../../.env" - }, - "relativePath": "../..", - "clientVersion": "5.3.1", - "engineVersion": "e95e739751f42d8ca026f6b910f5a2dc5adeaeee", - "datasourceNames": [ - "db" - ], - "activeProvider": "postgresql", - "postinstall": false, - "inlineDatasources": { - "db": { - "url": { - "fromEnvVar": "DATABASE_URL", - "value": null - } - } - }, - "inlineSchema": "Ly8gVGhpcyBpcyB5b3VyIFByaXNtYSBzY2hlbWEgZmlsZSwKLy8gbGVhcm4gbW9yZSBhYm91dCBpdCBpbiB0aGUgZG9jczogaHR0cHM6Ly9wcmlzLmx5L2QvcHJpc21hLXNjaGVtYQoKZ2VuZXJhdG9yIGNsaWVudCB7CiAgcHJvdmlkZXIgPSAicHJpc21hLWNsaWVudC1qcyIKICBvdXRwdXQgICA9ICIuL2dlbmVyYXRlZC9jbGllbnQiCn0KCmRhdGFzb3VyY2UgZGIgewogIHByb3ZpZGVyID0gInBvc3RncmVzcWwiCiAgdXJsICAgICAgPSBlbnYoIkRBVEFCQVNFX1VSTCIpCn0KCi8vLyBBIGNvbmZlcmVuY2UgZW50aXR5Cm1vZGVsIENvbmZlcmVuY2UgewogIGlkICAgICAgICAgU3RyaW5nICAgICAgQGlkIEBkZWZhdWx0KHV1aWQoKSkKICBuYW1lICAgICAgIFN0cmluZyAgICAgIEB1bmlxdWUKICBjb21taXR0ZWVzIENvbW1pdHRlZVtdCiAgc3RhcnQgICAgICBEYXRlVGltZT8KICBlbmQgICAgICAgIERhdGVUaW1lPwp9CgovLy8gQ29uc3VtZWFibGUgdG9rZW4gd2hpY2ggZ3JhbnRzIHRoZSBjcmVhdGlvbiBvZiBhIGNvbmZlcmVuY2UKbW9kZWwgQ29uZmVyZW5jZUNyZWF0ZVRva2VuIHsKICB0b2tlbiBTdHJpbmcgQGlkCn0KCm1vZGVsIENvbW1pdHRlZSB7CiAgaWQgICAgICAgICAgIFN0cmluZyAgICAgQGlkIEBkZWZhdWx0KHV1aWQoKSkKICBuYW1lICAgICAgICAgU3RyaW5nCiAgYWJicmV2aWF0aW9uIFN0cmluZwogIGNvbmZlcmVuY2UgICBDb25mZXJlbmNlIEByZWxhdGlvbihmaWVsZHM6IFtjb25mZXJlbmNlSWRdLCByZWZlcmVuY2VzOiBbaWRdKQogIGNvbmZlcmVuY2VJZCBTdHJpbmcKCiAgQEB1bmlxdWUoW25hbWUsIGNvbmZlcmVuY2VJZF0pCn0K", - "inlineSchemaHash": "d3d752eb8bc3530f0330c71725def9dd9c1271234985edb90fc6b9b709f0314e", - "noEngine": false -} -config.dirname = '/' - -config.runtimeDataModel = JSON.parse("{\"models\":{\"Conference\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"committees\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Committee\",\"relationName\":\"CommitteeToConference\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"start\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"end\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"A conference entity\"},\"ConferenceCreateToken\":{\"dbName\":null,\"fields\":[{\"name\":\"token\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Consumeable token which grants the creation of a conference\"},\"Committee\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"abbreviation\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"conference\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Conference\",\"relationName\":\"CommitteeToConference\",\"relationFromFields\":[\"conferenceId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"conferenceId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"name\",\"conferenceId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"name\",\"conferenceId\"]}],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") -defineDmmfProperty(exports.Prisma, config.runtimeDataModel) - - -config.injectableEdgeEnv = () => ({ - parsed: { - DATABASE_URL: typeof globalThis !== 'undefined' && globalThis['DATABASE_URL'] || typeof process !== 'undefined' && process.env && process.env.DATABASE_URL || undefined - } -}) - -if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) { - Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) -} - -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma) - diff --git a/chase/backend/prisma/generated/client/index-browser.js b/chase/backend/prisma/generated/client/index-browser.js deleted file mode 100644 index 42ba8e54..00000000 --- a/chase/backend/prisma/generated/client/index-browser.js +++ /dev/null @@ -1,183 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - Decimal, - objectEnumValues, - makeStrictEnum, - Public, - detectRuntime, -} = require('./runtime/index-browser') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.3.1 - * Query Engine version: e95e739751f42d8ca026f6b910f5a2dc5adeaeee - */ -Prisma.prismaVersion = { - client: "5.3.1", - engine: "e95e739751f42d8ca026f6b910f5a2dc5adeaeee" -} - -Prisma.PrismaClientKnownRequestError = () => { - throw new Error(`PrismaClientKnownRequestError is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)}; -Prisma.PrismaClientUnknownRequestError = () => { - throw new Error(`PrismaClientUnknownRequestError is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.PrismaClientRustPanicError = () => { - throw new Error(`PrismaClientRustPanicError is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.PrismaClientInitializationError = () => { - throw new Error(`PrismaClientInitializationError is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.PrismaClientValidationError = () => { - throw new Error(`PrismaClientValidationError is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.NotFoundError = () => { - throw new Error(`NotFoundError is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = () => { - throw new Error(`sqltag is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.empty = () => { - throw new Error(`empty is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.join = () => { - throw new Error(`join is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.raw = () => { - throw new Error(`raw is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = () => { - throw new Error(`Extensions.getExtensionContext is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} -Prisma.defineExtension = () => { - throw new Error(`Extensions.defineExtension is unable to be run ${runtimeDescription}. -In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, -)} - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -/** - * Enums - */ - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.ConferenceScalarFieldEnum = { - id: 'id', - name: 'name', - start: 'start', - end: 'end' -}; - -exports.Prisma.ConferenceCreateTokenScalarFieldEnum = { - token: 'token' -}; - -exports.Prisma.CommitteeScalarFieldEnum = { - id: 'id', - name: 'name', - abbreviation: 'abbreviation', - conferenceId: 'conferenceId' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - Conference: 'Conference', - ConferenceCreateToken: 'ConferenceCreateToken', - Committee: 'Committee' -}; - -/** - * This is a stub Prisma Client that will error at runtime if called. - */ -class PrismaClient { - constructor() { - return new Proxy(this, { - get(target, prop) { - const runtime = detectRuntime() - const edgeRuntimeName = { - 'workerd': 'Cloudflare Workers', - 'deno': 'Deno and Deno Deploy', - 'netlify': 'Netlify Edge Functions', - 'edge-light': 'Vercel Edge Functions', - }[runtime] - - let message = 'PrismaClient is unable to run in ' - if (edgeRuntimeName !== undefined) { - message += edgeRuntimeName + '. As an alternative, try Accelerate: https://pris.ly/d/accelerate.' - } else { - message += 'this browser environment, or has been bundled for the browser (running in `' + runtime + '`).' - } - - message += ` -If this is unexpected, please open an issue: https://github.com/prisma/prisma/issues` - - throw new Error(message) - } - }) - } -} - -exports.PrismaClient = PrismaClient - -Object.assign(exports, Prisma) diff --git a/chase/backend/prisma/generated/client/index.d.ts b/chase/backend/prisma/generated/client/index.d.ts deleted file mode 100644 index 2c5b08af..00000000 --- a/chase/backend/prisma/generated/client/index.d.ts +++ /dev/null @@ -1,4529 +0,0 @@ - -/** - * Client -**/ - -import * as runtime from './runtime/library'; -import $Types = runtime.Types // general types -import $Public = runtime.Types.Public -import $Utils = runtime.Types.Utils -import $Extensions = runtime.Types.Extensions -import $Result = runtime.Types.Result - -export type PrismaPromise = $Public.PrismaPromise - - -/** - * Model Conference - * A conference entity - */ -export type Conference = $Result.DefaultSelection -/** - * Model ConferenceCreateToken - * Consumeable token which grants the creation of a conference - */ -export type ConferenceCreateToken = $Result.DefaultSelection -/** - * Model Committee - * - */ -export type Committee = $Result.DefaultSelection - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Conferences - * const conferences = await prisma.conference.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ -export class PrismaClient< - T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, - U = 'log' extends keyof T ? T['log'] extends Array ? Prisma.GetEvents : never : never, - ExtArgs extends $Extensions.Args = $Extensions.DefaultArgs -> { - [K: symbol]: { types: Prisma.TypeMap['other'] } - - /** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Conferences - * const conferences = await prisma.conference.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ - - constructor(optionsArg ?: Prisma.Subset); - $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): void; - - /** - * Connect with the database - */ - $connect(): $Utils.JsPromise; - - /** - * Disconnect from the database - */ - $disconnect(): $Utils.JsPromise; - - /** - * Add a middleware - * @deprecated since 4.16.0. For new code, prefer client extensions instead. - * @see https://pris.ly/d/extensions - */ - $use(cb: Prisma.Middleware): void - -/** - * Executes a prepared raw query and returns the number of affected rows. - * @example - * ``` - * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Executes a raw query and returns the number of affected rows. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a prepared raw query and returns the `SELECT` data. - * @example - * ``` - * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a raw query and returns the `SELECT` data. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. - * @example - * ``` - * const [george, bob, alice] = await prisma.$transaction([ - * prisma.user.create({ data: { name: 'George' } }), - * prisma.user.create({ data: { name: 'Bob' } }), - * prisma.user.create({ data: { name: 'Alice' } }), - * ]) - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). - */ - $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise> - - $transaction(fn: (prisma: Omit) => $Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise - - - $extends: $Extensions.ExtendsHook<'extends', Prisma.TypeMapCb, ExtArgs> - - /** - * `prisma.conference`: Exposes CRUD operations for the **Conference** model. - * Example usage: - * ```ts - * // Fetch zero or more Conferences - * const conferences = await prisma.conference.findMany() - * ``` - */ - get conference(): Prisma.ConferenceDelegate; - - /** - * `prisma.conferenceCreateToken`: Exposes CRUD operations for the **ConferenceCreateToken** model. - * Example usage: - * ```ts - * // Fetch zero or more ConferenceCreateTokens - * const conferenceCreateTokens = await prisma.conferenceCreateToken.findMany() - * ``` - */ - get conferenceCreateToken(): Prisma.ConferenceCreateTokenDelegate; - - /** - * `prisma.committee`: Exposes CRUD operations for the **Committee** model. - * Example usage: - * ```ts - * // Fetch zero or more Committees - * const committees = await prisma.committee.findMany() - * ``` - */ - get committee(): Prisma.CommitteeDelegate; -} - -export namespace Prisma { - export import DMMF = runtime.DMMF - - export type PrismaPromise = $Public.PrismaPromise - - /** - * Validator - */ - export import validator = runtime.Public.validator - - /** - * Prisma Errors - */ - export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError - export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError - export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError - export import PrismaClientInitializationError = runtime.PrismaClientInitializationError - export import PrismaClientValidationError = runtime.PrismaClientValidationError - export import NotFoundError = runtime.NotFoundError - - /** - * Re-export of sql-template-tag - */ - export import sql = runtime.sqltag - export import empty = runtime.empty - export import join = runtime.join - export import raw = runtime.raw - export import Sql = runtime.Sql - - /** - * Decimal.js - */ - export import Decimal = runtime.Decimal - - export type DecimalJsLike = runtime.DecimalJsLike - - /** - * Metrics - */ - export type Metrics = runtime.Metrics - export type Metric = runtime.Metric - export type MetricHistogram = runtime.MetricHistogram - export type MetricHistogramBucket = runtime.MetricHistogramBucket - - /** - * Extensions - */ - export import Extension = $Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = $Public.Args - export import Payload = $Public.Payload - export import Result = $Public.Result - export import Exact = $Public.Exact - - /** - * Prisma Client JS version: 5.3.1 - * Query Engine version: e95e739751f42d8ca026f6b910f5a2dc5adeaeee - */ - export type PrismaVersion = { - client: string - } - - export const prismaVersion: PrismaVersion - - /** - * Utility Types - */ - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON object. - * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. - */ - export type JsonObject = {[Key in string]?: JsonValue} - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON array. - */ - export interface JsonArray extends Array {} - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches any valid JSON value. - */ - export type JsonValue = string | number | boolean | JsonObject | JsonArray | null - - /** - * Matches a JSON object. - * Unlike `JsonObject`, this type allows undefined and read-only properties. - */ - export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null} - - /** - * Matches a JSON array. - * Unlike `JsonArray`, readonly arrays are assignable to this type. - */ - export interface InputJsonArray extends ReadonlyArray {} - - /** - * Matches any valid value that can be used as an input for operations like - * create and update as the value of a JSON field. Unlike `JsonValue`, this - * type allows read-only arrays and read-only object properties and disallows - * `null` at the top level. - * - * `null` cannot be used as the value of a JSON field because its meaning - * would be ambiguous. Use `Prisma.JsonNull` to store the JSON null value or - * `Prisma.DbNull` to clear the JSON value and set the field to the database - * NULL value instead. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values - */ - export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { toJSON(): unknown } - - /** - * Types of the values used to represent different kinds of `null` values when working with JSON fields. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - namespace NullTypes { - /** - * Type of `Prisma.DbNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.DbNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class DbNull { - private DbNull: never - private constructor() - } - - /** - * Type of `Prisma.JsonNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.JsonNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class JsonNull { - private JsonNull: never - private constructor() - } - - /** - * Type of `Prisma.AnyNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.AnyNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class AnyNull { - private AnyNull: never - private constructor() - } - } - - /** - * Helper for filtering JSON entries that have `null` on the database (empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const DbNull: NullTypes.DbNull - - /** - * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const JsonNull: NullTypes.JsonNull - - /** - * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const AnyNull: NullTypes.AnyNull - - type SelectAndInclude = { - select: any - include: any - } - - /** - * Get the type of the value, that the Promise holds. - */ - export type PromiseType> = T extends PromiseLike ? U : T; - - /** - * Get the return type of a function which returns a Promise. - */ - export type PromiseReturnType $Utils.JsPromise> = PromiseType> - - /** - * From T, pick a set of properties whose keys are in the union K - */ - type Prisma__Pick = { - [P in K]: T[P]; - }; - - - export type Enumerable = T | Array; - - export type RequiredKeys = { - [K in keyof T]-?: {} extends Prisma__Pick ? never : K - }[keyof T] - - export type TruthyKeys = keyof { - [K in keyof T as T[K] extends false | undefined | null ? never : K]: K - } - - export type TrueKeys = TruthyKeys>> - - /** - * Subset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection - */ - export type Subset = { - [key in keyof T]: key extends keyof U ? T[key] : never; - }; - - /** - * SelectSubset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. - * Additionally, it validates, if both select and include are present. If the case, it errors. - */ - export type SelectSubset = { - [key in keyof T]: key extends keyof U ? T[key] : never - } & - (T extends SelectAndInclude - ? 'Please either choose `select` or `include`.' - : {}) - - /** - * Subset + Intersection - * @desc From `T` pick properties that exist in `U` and intersect `K` - */ - export type SubsetIntersection = { - [key in keyof T]: key extends keyof U ? T[key] : never - } & - K - - type Without = { [P in Exclude]?: never }; - - /** - * XOR is needed to have a real mutually exclusive union type - * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types - */ - type XOR = - T extends object ? - U extends object ? - (Without & U) | (Without & T) - : U : T - - - /** - * Is T a Record? - */ - type IsObject = T extends Array - ? False - : T extends Date - ? False - : T extends Uint8Array - ? False - : T extends BigInt - ? False - : T extends object - ? True - : False - - - /** - * If it's T[], return T - */ - export type UnEnumerate = T extends Array ? U : T - - /** - * From ts-toolbelt - */ - - type __Either = Omit & - { - // Merge all but K - [P in K]: Prisma__Pick // With K possibilities - }[K] - - type EitherStrict = Strict<__Either> - - type EitherLoose = ComputeRaw<__Either> - - type _Either< - O extends object, - K extends Key, - strict extends Boolean - > = { - 1: EitherStrict - 0: EitherLoose - }[strict] - - type Either< - O extends object, - K extends Key, - strict extends Boolean = 1 - > = O extends unknown ? _Either : never - - export type Union = any - - type PatchUndefined = { - [K in keyof O]: O[K] extends undefined ? At : O[K] - } & {} - - /** Helper Types for "Merge" **/ - export type IntersectOf = ( - U extends unknown ? (k: U) => void : never - ) extends (k: infer I) => void - ? I - : never - - export type Overwrite = { - [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; - } & {}; - - type _Merge = IntersectOf; - }>>; - - type Key = string | number | symbol; - type AtBasic = K extends keyof O ? O[K] : never; - type AtStrict = O[K & keyof O]; - type AtLoose = O extends unknown ? AtStrict : never; - export type At = { - 1: AtStrict; - 0: AtLoose; - }[strict]; - - export type ComputeRaw = A extends Function ? A : { - [K in keyof A]: A[K]; - } & {}; - - export type OptionalFlat = { - [K in keyof O]?: O[K]; - } & {}; - - type _Record = { - [P in K]: T; - }; - - // cause typescript not to expand types and preserve names - type NoExpand = T extends unknown ? T : never; - - // this type assumes the passed object is entirely optional - type AtLeast = NoExpand< - O extends unknown - ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O - : never>; - - type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; - - export type Strict = ComputeRaw<_Strict>; - /** End Helper Types for "Merge" **/ - - export type Merge = ComputeRaw<_Merge>>; - - /** - A [[Boolean]] - */ - export type Boolean = True | False - - // /** - // 1 - // */ - export type True = 1 - - /** - 0 - */ - export type False = 0 - - export type Not = { - 0: 1 - 1: 0 - }[B] - - export type Extends = [A1] extends [never] - ? 0 // anything `never` is false - : A1 extends A2 - ? 1 - : 0 - - export type Has = Not< - Extends, U1> - > - - export type Or = { - 0: { - 0: 0 - 1: 1 - } - 1: { - 0: 1 - 1: 1 - } - }[B1][B2] - - export type Keys = U extends unknown ? keyof U : never - - type Cast = A extends B ? A : B; - - export const type: unique symbol; - - - - /** - * Used by group by - */ - - export type GetScalarType = O extends object ? { - [P in keyof T]: P extends keyof O - ? O[P] - : never - } : never - - type FieldPaths< - T, - U = Omit - > = IsObject extends True ? U : T - - type GetHavingFields = { - [K in keyof T]: Or< - Or, Extends<'AND', K>>, - Extends<'NOT', K> - > extends True - ? // infer is only needed to not hit TS limit - // based on the brilliant idea of Pierre-Antoine Mills - // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 - T[K] extends infer TK - ? GetHavingFields extends object ? Merge> : never> - : never - : {} extends FieldPaths - ? never - : K - }[keyof T] - - /** - * Convert tuple to union - */ - type _TupleToUnion = T extends (infer E)[] ? E : never - type TupleToUnion = _TupleToUnion - type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T - - /** - * Like `Pick`, but additionally can also accept an array of keys - */ - type PickEnumerable | keyof T> = Prisma__Pick> - - /** - * Exclude all keys with underscores - */ - type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T - - - export type FieldRef = runtime.FieldRef - - type FieldRefInputType = Model extends never ? never : FieldRef - - - export const ModelName: { - Conference: 'Conference', - ConferenceCreateToken: 'ConferenceCreateToken', - Committee: 'Committee' - }; - - export type ModelName = (typeof ModelName)[keyof typeof ModelName] - - - export type Datasources = { - db?: Datasource - } - - - interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.Args}, $Utils.Record> { - returns: Prisma.TypeMap - } - - export type TypeMap = { - meta: { - modelProps: 'conference' | 'conferenceCreateToken' | 'committee' - txIsolationLevel: Prisma.TransactionIsolationLevel - }, - model: { - Conference: { - payload: Prisma.$ConferencePayload - fields: Prisma.ConferenceFieldRefs - operations: { - findUnique: { - args: Prisma.ConferenceFindUniqueArgs, - result: $Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.ConferenceFindUniqueOrThrowArgs, - result: $Utils.PayloadToResult - } - findFirst: { - args: Prisma.ConferenceFindFirstArgs, - result: $Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.ConferenceFindFirstOrThrowArgs, - result: $Utils.PayloadToResult - } - findMany: { - args: Prisma.ConferenceFindManyArgs, - result: $Utils.PayloadToResult[] - } - create: { - args: Prisma.ConferenceCreateArgs, - result: $Utils.PayloadToResult - } - createMany: { - args: Prisma.ConferenceCreateManyArgs, - result: Prisma.BatchPayload - } - delete: { - args: Prisma.ConferenceDeleteArgs, - result: $Utils.PayloadToResult - } - update: { - args: Prisma.ConferenceUpdateArgs, - result: $Utils.PayloadToResult - } - deleteMany: { - args: Prisma.ConferenceDeleteManyArgs, - result: Prisma.BatchPayload - } - updateMany: { - args: Prisma.ConferenceUpdateManyArgs, - result: Prisma.BatchPayload - } - upsert: { - args: Prisma.ConferenceUpsertArgs, - result: $Utils.PayloadToResult - } - aggregate: { - args: Prisma.ConferenceAggregateArgs, - result: $Utils.Optional - } - groupBy: { - args: Prisma.ConferenceGroupByArgs, - result: $Utils.Optional[] - } - count: { - args: Prisma.ConferenceCountArgs, - result: $Utils.Optional | number - } - } - } - ConferenceCreateToken: { - payload: Prisma.$ConferenceCreateTokenPayload - fields: Prisma.ConferenceCreateTokenFieldRefs - operations: { - findUnique: { - args: Prisma.ConferenceCreateTokenFindUniqueArgs, - result: $Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.ConferenceCreateTokenFindUniqueOrThrowArgs, - result: $Utils.PayloadToResult - } - findFirst: { - args: Prisma.ConferenceCreateTokenFindFirstArgs, - result: $Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.ConferenceCreateTokenFindFirstOrThrowArgs, - result: $Utils.PayloadToResult - } - findMany: { - args: Prisma.ConferenceCreateTokenFindManyArgs, - result: $Utils.PayloadToResult[] - } - create: { - args: Prisma.ConferenceCreateTokenCreateArgs, - result: $Utils.PayloadToResult - } - createMany: { - args: Prisma.ConferenceCreateTokenCreateManyArgs, - result: Prisma.BatchPayload - } - delete: { - args: Prisma.ConferenceCreateTokenDeleteArgs, - result: $Utils.PayloadToResult - } - update: { - args: Prisma.ConferenceCreateTokenUpdateArgs, - result: $Utils.PayloadToResult - } - deleteMany: { - args: Prisma.ConferenceCreateTokenDeleteManyArgs, - result: Prisma.BatchPayload - } - updateMany: { - args: Prisma.ConferenceCreateTokenUpdateManyArgs, - result: Prisma.BatchPayload - } - upsert: { - args: Prisma.ConferenceCreateTokenUpsertArgs, - result: $Utils.PayloadToResult - } - aggregate: { - args: Prisma.ConferenceCreateTokenAggregateArgs, - result: $Utils.Optional - } - groupBy: { - args: Prisma.ConferenceCreateTokenGroupByArgs, - result: $Utils.Optional[] - } - count: { - args: Prisma.ConferenceCreateTokenCountArgs, - result: $Utils.Optional | number - } - } - } - Committee: { - payload: Prisma.$CommitteePayload - fields: Prisma.CommitteeFieldRefs - operations: { - findUnique: { - args: Prisma.CommitteeFindUniqueArgs, - result: $Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.CommitteeFindUniqueOrThrowArgs, - result: $Utils.PayloadToResult - } - findFirst: { - args: Prisma.CommitteeFindFirstArgs, - result: $Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.CommitteeFindFirstOrThrowArgs, - result: $Utils.PayloadToResult - } - findMany: { - args: Prisma.CommitteeFindManyArgs, - result: $Utils.PayloadToResult[] - } - create: { - args: Prisma.CommitteeCreateArgs, - result: $Utils.PayloadToResult - } - createMany: { - args: Prisma.CommitteeCreateManyArgs, - result: Prisma.BatchPayload - } - delete: { - args: Prisma.CommitteeDeleteArgs, - result: $Utils.PayloadToResult - } - update: { - args: Prisma.CommitteeUpdateArgs, - result: $Utils.PayloadToResult - } - deleteMany: { - args: Prisma.CommitteeDeleteManyArgs, - result: Prisma.BatchPayload - } - updateMany: { - args: Prisma.CommitteeUpdateManyArgs, - result: Prisma.BatchPayload - } - upsert: { - args: Prisma.CommitteeUpsertArgs, - result: $Utils.PayloadToResult - } - aggregate: { - args: Prisma.CommitteeAggregateArgs, - result: $Utils.Optional - } - groupBy: { - args: Prisma.CommitteeGroupByArgs, - result: $Utils.Optional[] - } - count: { - args: Prisma.CommitteeCountArgs, - result: $Utils.Optional | number - } - } - } - } - } & { - other: { - payload: any - operations: { - $executeRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $executeRaw: { - args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], - result: any - } - $queryRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $queryRaw: { - args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], - result: any - } - } - } - } - export const defineExtension: $Extensions.ExtendsHook<'define', Prisma.TypeMapCb, $Extensions.DefaultArgs> - export type DefaultPrismaClient = PrismaClient - export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' - - export interface PrismaClientOptions { - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources - - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasourceUrl?: string - - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat - - /** - * @example - * ``` - * // Defaults to stdout - * log: ['query', 'info', 'warn', 'error'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * { emit: 'stdout', level: 'error' } - * ] - * ``` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: Array - } - - /* Types for Logging */ - export type LogLevel = 'info' | 'query' | 'warn' | 'error' - export type LogDefinition = { - level: LogLevel - emit: 'stdout' | 'event' - } - - export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never - export type GetEvents = T extends Array ? - GetLogType | GetLogType | GetLogType | GetLogType - : never - - export type QueryEvent = { - timestamp: Date - query: string - params: string - duration: number - target: string - } - - export type LogEvent = { - timestamp: Date - message: string - target: string - } - /* End Types for Logging */ - - - export type PrismaAction = - | 'findUnique' - | 'findUniqueOrThrow' - | 'findMany' - | 'findFirst' - | 'findFirstOrThrow' - | 'create' - | 'createMany' - | 'update' - | 'updateMany' - | 'upsert' - | 'delete' - | 'deleteMany' - | 'executeRaw' - | 'queryRaw' - | 'aggregate' - | 'count' - | 'runCommandRaw' - | 'findRaw' - | 'groupBy' - - /** - * These options are being passed into the middleware as "params" - */ - export type MiddlewareParams = { - model?: ModelName - action: PrismaAction - args: any - dataPath: string[] - runInTransaction: boolean - } - - /** - * The `T` type makes sure, that the `return proceed` is not forgotten in the middleware implementation - */ - export type Middleware = ( - params: MiddlewareParams, - next: (params: MiddlewareParams) => $Utils.JsPromise, - ) => $Utils.JsPromise - - // tested in getLogLevel.test.ts - export function getLogLevel(log: Array): LogLevel | undefined; - - /** - * `PrismaClient` proxy available in interactive transactions. - */ - export type TransactionClient = Omit - - export type Datasource = { - url?: string - } - - /** - * Count Types - */ - - - /** - * Count Type ConferenceCountOutputType - */ - - export type ConferenceCountOutputType = { - committees: number - } - - export type ConferenceCountOutputTypeSelect = { - committees?: boolean | ConferenceCountOutputTypeCountCommitteesArgs - } - - // Custom InputTypes - - /** - * ConferenceCountOutputType without action - */ - export type ConferenceCountOutputTypeDefaultArgs = { - /** - * Select specific fields to fetch from the ConferenceCountOutputType - */ - select?: ConferenceCountOutputTypeSelect | null - } - - - /** - * ConferenceCountOutputType without action - */ - export type ConferenceCountOutputTypeCountCommitteesArgs = { - where?: CommitteeWhereInput - } - - - - /** - * Models - */ - - /** - * Model Conference - */ - - export type AggregateConference = { - _count: ConferenceCountAggregateOutputType | null - _min: ConferenceMinAggregateOutputType | null - _max: ConferenceMaxAggregateOutputType | null - } - - export type ConferenceMinAggregateOutputType = { - id: string | null - name: string | null - start: Date | null - end: Date | null - } - - export type ConferenceMaxAggregateOutputType = { - id: string | null - name: string | null - start: Date | null - end: Date | null - } - - export type ConferenceCountAggregateOutputType = { - id: number - name: number - start: number - end: number - _all: number - } - - - export type ConferenceMinAggregateInputType = { - id?: true - name?: true - start?: true - end?: true - } - - export type ConferenceMaxAggregateInputType = { - id?: true - name?: true - start?: true - end?: true - } - - export type ConferenceCountAggregateInputType = { - id?: true - name?: true - start?: true - end?: true - _all?: true - } - - export type ConferenceAggregateArgs = { - /** - * Filter which Conference to aggregate. - */ - where?: ConferenceWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Conferences to fetch. - */ - orderBy?: ConferenceOrderByWithRelationInput | ConferenceOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: ConferenceWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Conferences from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Conferences. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Conferences - **/ - _count?: true | ConferenceCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: ConferenceMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: ConferenceMaxAggregateInputType - } - - export type GetConferenceAggregateType = { - [P in keyof T & keyof AggregateConference]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : GetScalarType - : GetScalarType - } - - - - - export type ConferenceGroupByArgs = { - where?: ConferenceWhereInput - orderBy?: ConferenceOrderByWithAggregationInput | ConferenceOrderByWithAggregationInput[] - by: ConferenceScalarFieldEnum[] | ConferenceScalarFieldEnum - having?: ConferenceScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: ConferenceCountAggregateInputType | true - _min?: ConferenceMinAggregateInputType - _max?: ConferenceMaxAggregateInputType - } - - export type ConferenceGroupByOutputType = { - id: string - name: string - start: Date | null - end: Date | null - _count: ConferenceCountAggregateOutputType | null - _min: ConferenceMinAggregateOutputType | null - _max: ConferenceMaxAggregateOutputType | null - } - - type GetConferenceGroupByPayload = Prisma.PrismaPromise< - Array< - PickEnumerable & - { - [P in ((keyof T) & (keyof ConferenceGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : GetScalarType - : GetScalarType - } - > - > - - - export type ConferenceSelect = $Extensions.GetSelect<{ - id?: boolean - name?: boolean - start?: boolean - end?: boolean - committees?: boolean | Conference$committeesArgs - _count?: boolean | ConferenceCountOutputTypeDefaultArgs - }, ExtArgs["result"]["conference"]> - - export type ConferenceSelectScalar = { - id?: boolean - name?: boolean - start?: boolean - end?: boolean - } - - export type ConferenceInclude = { - committees?: boolean | Conference$committeesArgs - _count?: boolean | ConferenceCountOutputTypeDefaultArgs - } - - - export type $ConferencePayload = { - name: "Conference" - objects: { - committees: Prisma.$CommitteePayload[] - } - scalars: $Extensions.GetResult<{ - id: string - name: string - start: Date | null - end: Date | null - }, ExtArgs["result"]["conference"]> - composites: {} - } - - - type ConferenceGetPayload = $Result.GetResult - - type ConferenceCountArgs = - Omit & { - select?: ConferenceCountAggregateInputType | true - } - - export interface ConferenceDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['Conference'], meta: { name: 'Conference' } } - /** - * Find zero or one Conference that matches the filter. - * @param {ConferenceFindUniqueArgs} args - Arguments to find a Conference - * @example - * // Get one Conference - * const conference = await prisma.conference.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUnique>( - args: SelectSubset> - ): Prisma__ConferenceClient<$Result.GetResult, T, 'findUnique'> | null, null, ExtArgs> - - /** - * Find one Conference that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {ConferenceFindUniqueOrThrowArgs} args - Arguments to find a Conference - * @example - * // Get one Conference - * const conference = await prisma.conference.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUniqueOrThrow>( - args?: SelectSubset> - ): Prisma__ConferenceClient<$Result.GetResult, T, 'findUniqueOrThrow'>, never, ExtArgs> - - /** - * Find the first Conference that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceFindFirstArgs} args - Arguments to find a Conference - * @example - * // Get one Conference - * const conference = await prisma.conference.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirst>( - args?: SelectSubset> - ): Prisma__ConferenceClient<$Result.GetResult, T, 'findFirst'> | null, null, ExtArgs> - - /** - * Find the first Conference that matches the filter or - * throw `PrismaKnownClientError` with `P2025` code if no matches were found. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceFindFirstOrThrowArgs} args - Arguments to find a Conference - * @example - * // Get one Conference - * const conference = await prisma.conference.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirstOrThrow>( - args?: SelectSubset> - ): Prisma__ConferenceClient<$Result.GetResult, T, 'findFirstOrThrow'>, never, ExtArgs> - - /** - * Find zero or more Conferences that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceFindManyArgs=} args - Arguments to filter and select certain fields only. - * @example - * // Get all Conferences - * const conferences = await prisma.conference.findMany() - * - * // Get first 10 Conferences - * const conferences = await prisma.conference.findMany({ take: 10 }) - * - * // Only select the `id` - * const conferenceWithIdOnly = await prisma.conference.findMany({ select: { id: true } }) - * - **/ - findMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise<$Result.GetResult, T, 'findMany'>> - - /** - * Create a Conference. - * @param {ConferenceCreateArgs} args - Arguments to create a Conference. - * @example - * // Create one Conference - * const Conference = await prisma.conference.create({ - * data: { - * // ... data to create a Conference - * } - * }) - * - **/ - create>( - args: SelectSubset> - ): Prisma__ConferenceClient<$Result.GetResult, T, 'create'>, never, ExtArgs> - - /** - * Create many Conferences. - * @param {ConferenceCreateManyArgs} args - Arguments to create many Conferences. - * @example - * // Create many Conferences - * const conference = await prisma.conference.createMany({ - * data: { - * // ... provide data here - * } - * }) - * - **/ - createMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Delete a Conference. - * @param {ConferenceDeleteArgs} args - Arguments to delete one Conference. - * @example - * // Delete one Conference - * const Conference = await prisma.conference.delete({ - * where: { - * // ... filter to delete one Conference - * } - * }) - * - **/ - delete>( - args: SelectSubset> - ): Prisma__ConferenceClient<$Result.GetResult, T, 'delete'>, never, ExtArgs> - - /** - * Update one Conference. - * @param {ConferenceUpdateArgs} args - Arguments to update one Conference. - * @example - * // Update one Conference - * const conference = await prisma.conference.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - update>( - args: SelectSubset> - ): Prisma__ConferenceClient<$Result.GetResult, T, 'update'>, never, ExtArgs> - - /** - * Delete zero or more Conferences. - * @param {ConferenceDeleteManyArgs} args - Arguments to filter Conferences to delete. - * @example - * // Delete a few Conferences - * const { count } = await prisma.conference.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - **/ - deleteMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Update zero or more Conferences. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Conferences - * const conference = await prisma.conference.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - updateMany>( - args: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Create or update one Conference. - * @param {ConferenceUpsertArgs} args - Arguments to update or create a Conference. - * @example - * // Update or create a Conference - * const conference = await prisma.conference.upsert({ - * create: { - * // ... data to create a Conference - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the Conference we want to update - * } - * }) - **/ - upsert>( - args: SelectSubset> - ): Prisma__ConferenceClient<$Result.GetResult, T, 'upsert'>, never, ExtArgs> - - /** - * Count the number of Conferences. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceCountArgs} args - Arguments to filter Conferences to count. - * @example - * // Count the number of Conferences - * const count = await prisma.conference.count({ - * where: { - * // ... the filter for the Conferences we want to count - * } - * }) - **/ - count( - args?: Subset, - ): Prisma.PrismaPromise< - T extends $Utils.Record<'select', any> - ? T['select'] extends true - ? number - : GetScalarType - : number - > - - /** - * Allows you to perform aggregations operations on a Conference. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceAggregateArgs} args - Select which aggregations you would like to apply and on what fields. - * @example - * // Ordered by age ascending - * // Where email contains prisma.io - * // Limited to the 10 users - * const aggregations = await prisma.user.aggregate({ - * _avg: { - * age: true, - * }, - * where: { - * email: { - * contains: "prisma.io", - * }, - * }, - * orderBy: { - * age: "asc", - * }, - * take: 10, - * }) - **/ - aggregate(args: Subset): Prisma.PrismaPromise> - - /** - * Group by Conference. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceGroupByArgs} args - Group by arguments. - * @example - * // Group by city, order by createdAt, get count - * const result = await prisma.user.groupBy({ - * by: ['city', 'createdAt'], - * orderBy: { - * createdAt: true - * }, - * _count: { - * _all: true - * }, - * }) - * - **/ - groupBy< - T extends ConferenceGroupByArgs, - HasSelectOrTake extends Or< - Extends<'skip', Keys>, - Extends<'take', Keys> - >, - OrderByArg extends True extends HasSelectOrTake - ? { orderBy: ConferenceGroupByArgs['orderBy'] } - : { orderBy?: ConferenceGroupByArgs['orderBy'] }, - OrderFields extends ExcludeUnderscoreKeys>>, - ByFields extends MaybeTupleToUnion, - ByValid extends Has, - HavingFields extends GetHavingFields, - HavingValid extends Has, - ByEmpty extends T['by'] extends never[] ? True : False, - InputErrors extends ByEmpty extends True - ? `Error: "by" must not be empty.` - : HavingValid extends False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? `Error: Field "${P}" used in "having" needs to be provided in "by".` - : [ - Error, - 'Field ', - P, - ` in "having" needs to be provided in "by"`, - ] - }[HavingFields] - : 'take' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetConferenceGroupByPayload : Prisma.PrismaPromise - /** - * Fields of the Conference model - */ - readonly fields: ConferenceFieldRefs; - } - - /** - * The delegate class that acts as a "Promise-like" for Conference. - * Why is this prefixed with `Prisma__`? - * Because we want to prevent naming conflicts as mentioned in - * https://github.com/prisma/prisma-client-js/issues/707 - */ - export interface Prisma__ConferenceClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: 'PrismaPromise'; - - committees = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, 'findMany'> | Null>; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise; - } - - - - /** - * Fields of the Conference model - */ - interface ConferenceFieldRefs { - readonly id: FieldRef<"Conference", 'String'> - readonly name: FieldRef<"Conference", 'String'> - readonly start: FieldRef<"Conference", 'DateTime'> - readonly end: FieldRef<"Conference", 'DateTime'> - } - - - // Custom InputTypes - - /** - * Conference findUnique - */ - export type ConferenceFindUniqueArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * Filter, which Conference to fetch. - */ - where: ConferenceWhereUniqueInput - } - - - /** - * Conference findUniqueOrThrow - */ - export type ConferenceFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * Filter, which Conference to fetch. - */ - where: ConferenceWhereUniqueInput - } - - - /** - * Conference findFirst - */ - export type ConferenceFindFirstArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * Filter, which Conference to fetch. - */ - where?: ConferenceWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Conferences to fetch. - */ - orderBy?: ConferenceOrderByWithRelationInput | ConferenceOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Conferences. - */ - cursor?: ConferenceWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Conferences from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Conferences. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Conferences. - */ - distinct?: ConferenceScalarFieldEnum | ConferenceScalarFieldEnum[] - } - - - /** - * Conference findFirstOrThrow - */ - export type ConferenceFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * Filter, which Conference to fetch. - */ - where?: ConferenceWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Conferences to fetch. - */ - orderBy?: ConferenceOrderByWithRelationInput | ConferenceOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Conferences. - */ - cursor?: ConferenceWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Conferences from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Conferences. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Conferences. - */ - distinct?: ConferenceScalarFieldEnum | ConferenceScalarFieldEnum[] - } - - - /** - * Conference findMany - */ - export type ConferenceFindManyArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * Filter, which Conferences to fetch. - */ - where?: ConferenceWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Conferences to fetch. - */ - orderBy?: ConferenceOrderByWithRelationInput | ConferenceOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Conferences. - */ - cursor?: ConferenceWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Conferences from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Conferences. - */ - skip?: number - distinct?: ConferenceScalarFieldEnum | ConferenceScalarFieldEnum[] - } - - - /** - * Conference create - */ - export type ConferenceCreateArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * The data needed to create a Conference. - */ - data: XOR - } - - - /** - * Conference createMany - */ - export type ConferenceCreateManyArgs = { - /** - * The data used to create many Conferences. - */ - data: ConferenceCreateManyInput | ConferenceCreateManyInput[] - skipDuplicates?: boolean - } - - - /** - * Conference update - */ - export type ConferenceUpdateArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * The data needed to update a Conference. - */ - data: XOR - /** - * Choose, which Conference to update. - */ - where: ConferenceWhereUniqueInput - } - - - /** - * Conference updateMany - */ - export type ConferenceUpdateManyArgs = { - /** - * The data used to update Conferences. - */ - data: XOR - /** - * Filter which Conferences to update - */ - where?: ConferenceWhereInput - } - - - /** - * Conference upsert - */ - export type ConferenceUpsertArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * The filter to search for the Conference to update in case it exists. - */ - where: ConferenceWhereUniqueInput - /** - * In case the Conference found by the `where` argument doesn't exist, create a new Conference with this data. - */ - create: XOR - /** - * In case the Conference was found with the provided `where` argument, update it with this data. - */ - update: XOR - } - - - /** - * Conference delete - */ - export type ConferenceDeleteArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - /** - * Filter which Conference to delete. - */ - where: ConferenceWhereUniqueInput - } - - - /** - * Conference deleteMany - */ - export type ConferenceDeleteManyArgs = { - /** - * Filter which Conferences to delete - */ - where?: ConferenceWhereInput - } - - - /** - * Conference.committees - */ - export type Conference$committeesArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - where?: CommitteeWhereInput - orderBy?: CommitteeOrderByWithRelationInput | CommitteeOrderByWithRelationInput[] - cursor?: CommitteeWhereUniqueInput - take?: number - skip?: number - distinct?: CommitteeScalarFieldEnum | CommitteeScalarFieldEnum[] - } - - - /** - * Conference without action - */ - export type ConferenceDefaultArgs = { - /** - * Select specific fields to fetch from the Conference - */ - select?: ConferenceSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: ConferenceInclude | null - } - - - - /** - * Model ConferenceCreateToken - */ - - export type AggregateConferenceCreateToken = { - _count: ConferenceCreateTokenCountAggregateOutputType | null - _min: ConferenceCreateTokenMinAggregateOutputType | null - _max: ConferenceCreateTokenMaxAggregateOutputType | null - } - - export type ConferenceCreateTokenMinAggregateOutputType = { - token: string | null - } - - export type ConferenceCreateTokenMaxAggregateOutputType = { - token: string | null - } - - export type ConferenceCreateTokenCountAggregateOutputType = { - token: number - _all: number - } - - - export type ConferenceCreateTokenMinAggregateInputType = { - token?: true - } - - export type ConferenceCreateTokenMaxAggregateInputType = { - token?: true - } - - export type ConferenceCreateTokenCountAggregateInputType = { - token?: true - _all?: true - } - - export type ConferenceCreateTokenAggregateArgs = { - /** - * Filter which ConferenceCreateToken to aggregate. - */ - where?: ConferenceCreateTokenWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of ConferenceCreateTokens to fetch. - */ - orderBy?: ConferenceCreateTokenOrderByWithRelationInput | ConferenceCreateTokenOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: ConferenceCreateTokenWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` ConferenceCreateTokens from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` ConferenceCreateTokens. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned ConferenceCreateTokens - **/ - _count?: true | ConferenceCreateTokenCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: ConferenceCreateTokenMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: ConferenceCreateTokenMaxAggregateInputType - } - - export type GetConferenceCreateTokenAggregateType = { - [P in keyof T & keyof AggregateConferenceCreateToken]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : GetScalarType - : GetScalarType - } - - - - - export type ConferenceCreateTokenGroupByArgs = { - where?: ConferenceCreateTokenWhereInput - orderBy?: ConferenceCreateTokenOrderByWithAggregationInput | ConferenceCreateTokenOrderByWithAggregationInput[] - by: ConferenceCreateTokenScalarFieldEnum[] | ConferenceCreateTokenScalarFieldEnum - having?: ConferenceCreateTokenScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: ConferenceCreateTokenCountAggregateInputType | true - _min?: ConferenceCreateTokenMinAggregateInputType - _max?: ConferenceCreateTokenMaxAggregateInputType - } - - export type ConferenceCreateTokenGroupByOutputType = { - token: string - _count: ConferenceCreateTokenCountAggregateOutputType | null - _min: ConferenceCreateTokenMinAggregateOutputType | null - _max: ConferenceCreateTokenMaxAggregateOutputType | null - } - - type GetConferenceCreateTokenGroupByPayload = Prisma.PrismaPromise< - Array< - PickEnumerable & - { - [P in ((keyof T) & (keyof ConferenceCreateTokenGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : GetScalarType - : GetScalarType - } - > - > - - - export type ConferenceCreateTokenSelect = $Extensions.GetSelect<{ - token?: boolean - }, ExtArgs["result"]["conferenceCreateToken"]> - - export type ConferenceCreateTokenSelectScalar = { - token?: boolean - } - - - export type $ConferenceCreateTokenPayload = { - name: "ConferenceCreateToken" - objects: {} - scalars: $Extensions.GetResult<{ - token: string - }, ExtArgs["result"]["conferenceCreateToken"]> - composites: {} - } - - - type ConferenceCreateTokenGetPayload = $Result.GetResult - - type ConferenceCreateTokenCountArgs = - Omit & { - select?: ConferenceCreateTokenCountAggregateInputType | true - } - - export interface ConferenceCreateTokenDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['ConferenceCreateToken'], meta: { name: 'ConferenceCreateToken' } } - /** - * Find zero or one ConferenceCreateToken that matches the filter. - * @param {ConferenceCreateTokenFindUniqueArgs} args - Arguments to find a ConferenceCreateToken - * @example - * // Get one ConferenceCreateToken - * const conferenceCreateToken = await prisma.conferenceCreateToken.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUnique>( - args: SelectSubset> - ): Prisma__ConferenceCreateTokenClient<$Result.GetResult, T, 'findUnique'> | null, null, ExtArgs> - - /** - * Find one ConferenceCreateToken that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {ConferenceCreateTokenFindUniqueOrThrowArgs} args - Arguments to find a ConferenceCreateToken - * @example - * // Get one ConferenceCreateToken - * const conferenceCreateToken = await prisma.conferenceCreateToken.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUniqueOrThrow>( - args?: SelectSubset> - ): Prisma__ConferenceCreateTokenClient<$Result.GetResult, T, 'findUniqueOrThrow'>, never, ExtArgs> - - /** - * Find the first ConferenceCreateToken that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceCreateTokenFindFirstArgs} args - Arguments to find a ConferenceCreateToken - * @example - * // Get one ConferenceCreateToken - * const conferenceCreateToken = await prisma.conferenceCreateToken.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirst>( - args?: SelectSubset> - ): Prisma__ConferenceCreateTokenClient<$Result.GetResult, T, 'findFirst'> | null, null, ExtArgs> - - /** - * Find the first ConferenceCreateToken that matches the filter or - * throw `PrismaKnownClientError` with `P2025` code if no matches were found. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceCreateTokenFindFirstOrThrowArgs} args - Arguments to find a ConferenceCreateToken - * @example - * // Get one ConferenceCreateToken - * const conferenceCreateToken = await prisma.conferenceCreateToken.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirstOrThrow>( - args?: SelectSubset> - ): Prisma__ConferenceCreateTokenClient<$Result.GetResult, T, 'findFirstOrThrow'>, never, ExtArgs> - - /** - * Find zero or more ConferenceCreateTokens that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceCreateTokenFindManyArgs=} args - Arguments to filter and select certain fields only. - * @example - * // Get all ConferenceCreateTokens - * const conferenceCreateTokens = await prisma.conferenceCreateToken.findMany() - * - * // Get first 10 ConferenceCreateTokens - * const conferenceCreateTokens = await prisma.conferenceCreateToken.findMany({ take: 10 }) - * - * // Only select the `token` - * const conferenceCreateTokenWithTokenOnly = await prisma.conferenceCreateToken.findMany({ select: { token: true } }) - * - **/ - findMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise<$Result.GetResult, T, 'findMany'>> - - /** - * Create a ConferenceCreateToken. - * @param {ConferenceCreateTokenCreateArgs} args - Arguments to create a ConferenceCreateToken. - * @example - * // Create one ConferenceCreateToken - * const ConferenceCreateToken = await prisma.conferenceCreateToken.create({ - * data: { - * // ... data to create a ConferenceCreateToken - * } - * }) - * - **/ - create>( - args: SelectSubset> - ): Prisma__ConferenceCreateTokenClient<$Result.GetResult, T, 'create'>, never, ExtArgs> - - /** - * Create many ConferenceCreateTokens. - * @param {ConferenceCreateTokenCreateManyArgs} args - Arguments to create many ConferenceCreateTokens. - * @example - * // Create many ConferenceCreateTokens - * const conferenceCreateToken = await prisma.conferenceCreateToken.createMany({ - * data: { - * // ... provide data here - * } - * }) - * - **/ - createMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Delete a ConferenceCreateToken. - * @param {ConferenceCreateTokenDeleteArgs} args - Arguments to delete one ConferenceCreateToken. - * @example - * // Delete one ConferenceCreateToken - * const ConferenceCreateToken = await prisma.conferenceCreateToken.delete({ - * where: { - * // ... filter to delete one ConferenceCreateToken - * } - * }) - * - **/ - delete>( - args: SelectSubset> - ): Prisma__ConferenceCreateTokenClient<$Result.GetResult, T, 'delete'>, never, ExtArgs> - - /** - * Update one ConferenceCreateToken. - * @param {ConferenceCreateTokenUpdateArgs} args - Arguments to update one ConferenceCreateToken. - * @example - * // Update one ConferenceCreateToken - * const conferenceCreateToken = await prisma.conferenceCreateToken.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - update>( - args: SelectSubset> - ): Prisma__ConferenceCreateTokenClient<$Result.GetResult, T, 'update'>, never, ExtArgs> - - /** - * Delete zero or more ConferenceCreateTokens. - * @param {ConferenceCreateTokenDeleteManyArgs} args - Arguments to filter ConferenceCreateTokens to delete. - * @example - * // Delete a few ConferenceCreateTokens - * const { count } = await prisma.conferenceCreateToken.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - **/ - deleteMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Update zero or more ConferenceCreateTokens. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceCreateTokenUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many ConferenceCreateTokens - * const conferenceCreateToken = await prisma.conferenceCreateToken.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - updateMany>( - args: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Create or update one ConferenceCreateToken. - * @param {ConferenceCreateTokenUpsertArgs} args - Arguments to update or create a ConferenceCreateToken. - * @example - * // Update or create a ConferenceCreateToken - * const conferenceCreateToken = await prisma.conferenceCreateToken.upsert({ - * create: { - * // ... data to create a ConferenceCreateToken - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the ConferenceCreateToken we want to update - * } - * }) - **/ - upsert>( - args: SelectSubset> - ): Prisma__ConferenceCreateTokenClient<$Result.GetResult, T, 'upsert'>, never, ExtArgs> - - /** - * Count the number of ConferenceCreateTokens. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceCreateTokenCountArgs} args - Arguments to filter ConferenceCreateTokens to count. - * @example - * // Count the number of ConferenceCreateTokens - * const count = await prisma.conferenceCreateToken.count({ - * where: { - * // ... the filter for the ConferenceCreateTokens we want to count - * } - * }) - **/ - count( - args?: Subset, - ): Prisma.PrismaPromise< - T extends $Utils.Record<'select', any> - ? T['select'] extends true - ? number - : GetScalarType - : number - > - - /** - * Allows you to perform aggregations operations on a ConferenceCreateToken. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceCreateTokenAggregateArgs} args - Select which aggregations you would like to apply and on what fields. - * @example - * // Ordered by age ascending - * // Where email contains prisma.io - * // Limited to the 10 users - * const aggregations = await prisma.user.aggregate({ - * _avg: { - * age: true, - * }, - * where: { - * email: { - * contains: "prisma.io", - * }, - * }, - * orderBy: { - * age: "asc", - * }, - * take: 10, - * }) - **/ - aggregate(args: Subset): Prisma.PrismaPromise> - - /** - * Group by ConferenceCreateToken. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {ConferenceCreateTokenGroupByArgs} args - Group by arguments. - * @example - * // Group by city, order by createdAt, get count - * const result = await prisma.user.groupBy({ - * by: ['city', 'createdAt'], - * orderBy: { - * createdAt: true - * }, - * _count: { - * _all: true - * }, - * }) - * - **/ - groupBy< - T extends ConferenceCreateTokenGroupByArgs, - HasSelectOrTake extends Or< - Extends<'skip', Keys>, - Extends<'take', Keys> - >, - OrderByArg extends True extends HasSelectOrTake - ? { orderBy: ConferenceCreateTokenGroupByArgs['orderBy'] } - : { orderBy?: ConferenceCreateTokenGroupByArgs['orderBy'] }, - OrderFields extends ExcludeUnderscoreKeys>>, - ByFields extends MaybeTupleToUnion, - ByValid extends Has, - HavingFields extends GetHavingFields, - HavingValid extends Has, - ByEmpty extends T['by'] extends never[] ? True : False, - InputErrors extends ByEmpty extends True - ? `Error: "by" must not be empty.` - : HavingValid extends False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? `Error: Field "${P}" used in "having" needs to be provided in "by".` - : [ - Error, - 'Field ', - P, - ` in "having" needs to be provided in "by"`, - ] - }[HavingFields] - : 'take' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetConferenceCreateTokenGroupByPayload : Prisma.PrismaPromise - /** - * Fields of the ConferenceCreateToken model - */ - readonly fields: ConferenceCreateTokenFieldRefs; - } - - /** - * The delegate class that acts as a "Promise-like" for ConferenceCreateToken. - * Why is this prefixed with `Prisma__`? - * Because we want to prevent naming conflicts as mentioned in - * https://github.com/prisma/prisma-client-js/issues/707 - */ - export interface Prisma__ConferenceCreateTokenClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: 'PrismaPromise'; - - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise; - } - - - - /** - * Fields of the ConferenceCreateToken model - */ - interface ConferenceCreateTokenFieldRefs { - readonly token: FieldRef<"ConferenceCreateToken", 'String'> - } - - - // Custom InputTypes - - /** - * ConferenceCreateToken findUnique - */ - export type ConferenceCreateTokenFindUniqueArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * Filter, which ConferenceCreateToken to fetch. - */ - where: ConferenceCreateTokenWhereUniqueInput - } - - - /** - * ConferenceCreateToken findUniqueOrThrow - */ - export type ConferenceCreateTokenFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * Filter, which ConferenceCreateToken to fetch. - */ - where: ConferenceCreateTokenWhereUniqueInput - } - - - /** - * ConferenceCreateToken findFirst - */ - export type ConferenceCreateTokenFindFirstArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * Filter, which ConferenceCreateToken to fetch. - */ - where?: ConferenceCreateTokenWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of ConferenceCreateTokens to fetch. - */ - orderBy?: ConferenceCreateTokenOrderByWithRelationInput | ConferenceCreateTokenOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for ConferenceCreateTokens. - */ - cursor?: ConferenceCreateTokenWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` ConferenceCreateTokens from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` ConferenceCreateTokens. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of ConferenceCreateTokens. - */ - distinct?: ConferenceCreateTokenScalarFieldEnum | ConferenceCreateTokenScalarFieldEnum[] - } - - - /** - * ConferenceCreateToken findFirstOrThrow - */ - export type ConferenceCreateTokenFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * Filter, which ConferenceCreateToken to fetch. - */ - where?: ConferenceCreateTokenWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of ConferenceCreateTokens to fetch. - */ - orderBy?: ConferenceCreateTokenOrderByWithRelationInput | ConferenceCreateTokenOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for ConferenceCreateTokens. - */ - cursor?: ConferenceCreateTokenWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` ConferenceCreateTokens from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` ConferenceCreateTokens. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of ConferenceCreateTokens. - */ - distinct?: ConferenceCreateTokenScalarFieldEnum | ConferenceCreateTokenScalarFieldEnum[] - } - - - /** - * ConferenceCreateToken findMany - */ - export type ConferenceCreateTokenFindManyArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * Filter, which ConferenceCreateTokens to fetch. - */ - where?: ConferenceCreateTokenWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of ConferenceCreateTokens to fetch. - */ - orderBy?: ConferenceCreateTokenOrderByWithRelationInput | ConferenceCreateTokenOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing ConferenceCreateTokens. - */ - cursor?: ConferenceCreateTokenWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` ConferenceCreateTokens from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` ConferenceCreateTokens. - */ - skip?: number - distinct?: ConferenceCreateTokenScalarFieldEnum | ConferenceCreateTokenScalarFieldEnum[] - } - - - /** - * ConferenceCreateToken create - */ - export type ConferenceCreateTokenCreateArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * The data needed to create a ConferenceCreateToken. - */ - data: XOR - } - - - /** - * ConferenceCreateToken createMany - */ - export type ConferenceCreateTokenCreateManyArgs = { - /** - * The data used to create many ConferenceCreateTokens. - */ - data: ConferenceCreateTokenCreateManyInput | ConferenceCreateTokenCreateManyInput[] - skipDuplicates?: boolean - } - - - /** - * ConferenceCreateToken update - */ - export type ConferenceCreateTokenUpdateArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * The data needed to update a ConferenceCreateToken. - */ - data: XOR - /** - * Choose, which ConferenceCreateToken to update. - */ - where: ConferenceCreateTokenWhereUniqueInput - } - - - /** - * ConferenceCreateToken updateMany - */ - export type ConferenceCreateTokenUpdateManyArgs = { - /** - * The data used to update ConferenceCreateTokens. - */ - data: XOR - /** - * Filter which ConferenceCreateTokens to update - */ - where?: ConferenceCreateTokenWhereInput - } - - - /** - * ConferenceCreateToken upsert - */ - export type ConferenceCreateTokenUpsertArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * The filter to search for the ConferenceCreateToken to update in case it exists. - */ - where: ConferenceCreateTokenWhereUniqueInput - /** - * In case the ConferenceCreateToken found by the `where` argument doesn't exist, create a new ConferenceCreateToken with this data. - */ - create: XOR - /** - * In case the ConferenceCreateToken was found with the provided `where` argument, update it with this data. - */ - update: XOR - } - - - /** - * ConferenceCreateToken delete - */ - export type ConferenceCreateTokenDeleteArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - /** - * Filter which ConferenceCreateToken to delete. - */ - where: ConferenceCreateTokenWhereUniqueInput - } - - - /** - * ConferenceCreateToken deleteMany - */ - export type ConferenceCreateTokenDeleteManyArgs = { - /** - * Filter which ConferenceCreateTokens to delete - */ - where?: ConferenceCreateTokenWhereInput - } - - - /** - * ConferenceCreateToken without action - */ - export type ConferenceCreateTokenDefaultArgs = { - /** - * Select specific fields to fetch from the ConferenceCreateToken - */ - select?: ConferenceCreateTokenSelect | null - } - - - - /** - * Model Committee - */ - - export type AggregateCommittee = { - _count: CommitteeCountAggregateOutputType | null - _min: CommitteeMinAggregateOutputType | null - _max: CommitteeMaxAggregateOutputType | null - } - - export type CommitteeMinAggregateOutputType = { - id: string | null - name: string | null - abbreviation: string | null - conferenceId: string | null - } - - export type CommitteeMaxAggregateOutputType = { - id: string | null - name: string | null - abbreviation: string | null - conferenceId: string | null - } - - export type CommitteeCountAggregateOutputType = { - id: number - name: number - abbreviation: number - conferenceId: number - _all: number - } - - - export type CommitteeMinAggregateInputType = { - id?: true - name?: true - abbreviation?: true - conferenceId?: true - } - - export type CommitteeMaxAggregateInputType = { - id?: true - name?: true - abbreviation?: true - conferenceId?: true - } - - export type CommitteeCountAggregateInputType = { - id?: true - name?: true - abbreviation?: true - conferenceId?: true - _all?: true - } - - export type CommitteeAggregateArgs = { - /** - * Filter which Committee to aggregate. - */ - where?: CommitteeWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Committees to fetch. - */ - orderBy?: CommitteeOrderByWithRelationInput | CommitteeOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: CommitteeWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Committees from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Committees. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Committees - **/ - _count?: true | CommitteeCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: CommitteeMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: CommitteeMaxAggregateInputType - } - - export type GetCommitteeAggregateType = { - [P in keyof T & keyof AggregateCommittee]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : GetScalarType - : GetScalarType - } - - - - - export type CommitteeGroupByArgs = { - where?: CommitteeWhereInput - orderBy?: CommitteeOrderByWithAggregationInput | CommitteeOrderByWithAggregationInput[] - by: CommitteeScalarFieldEnum[] | CommitteeScalarFieldEnum - having?: CommitteeScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: CommitteeCountAggregateInputType | true - _min?: CommitteeMinAggregateInputType - _max?: CommitteeMaxAggregateInputType - } - - export type CommitteeGroupByOutputType = { - id: string - name: string - abbreviation: string - conferenceId: string - _count: CommitteeCountAggregateOutputType | null - _min: CommitteeMinAggregateOutputType | null - _max: CommitteeMaxAggregateOutputType | null - } - - type GetCommitteeGroupByPayload = Prisma.PrismaPromise< - Array< - PickEnumerable & - { - [P in ((keyof T) & (keyof CommitteeGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : GetScalarType - : GetScalarType - } - > - > - - - export type CommitteeSelect = $Extensions.GetSelect<{ - id?: boolean - name?: boolean - abbreviation?: boolean - conferenceId?: boolean - conference?: boolean | ConferenceDefaultArgs - }, ExtArgs["result"]["committee"]> - - export type CommitteeSelectScalar = { - id?: boolean - name?: boolean - abbreviation?: boolean - conferenceId?: boolean - } - - export type CommitteeInclude = { - conference?: boolean | ConferenceDefaultArgs - } - - - export type $CommitteePayload = { - name: "Committee" - objects: { - conference: Prisma.$ConferencePayload - } - scalars: $Extensions.GetResult<{ - id: string - name: string - abbreviation: string - conferenceId: string - }, ExtArgs["result"]["committee"]> - composites: {} - } - - - type CommitteeGetPayload = $Result.GetResult - - type CommitteeCountArgs = - Omit & { - select?: CommitteeCountAggregateInputType | true - } - - export interface CommitteeDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['Committee'], meta: { name: 'Committee' } } - /** - * Find zero or one Committee that matches the filter. - * @param {CommitteeFindUniqueArgs} args - Arguments to find a Committee - * @example - * // Get one Committee - * const committee = await prisma.committee.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUnique>( - args: SelectSubset> - ): Prisma__CommitteeClient<$Result.GetResult, T, 'findUnique'> | null, null, ExtArgs> - - /** - * Find one Committee that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {CommitteeFindUniqueOrThrowArgs} args - Arguments to find a Committee - * @example - * // Get one Committee - * const committee = await prisma.committee.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUniqueOrThrow>( - args?: SelectSubset> - ): Prisma__CommitteeClient<$Result.GetResult, T, 'findUniqueOrThrow'>, never, ExtArgs> - - /** - * Find the first Committee that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {CommitteeFindFirstArgs} args - Arguments to find a Committee - * @example - * // Get one Committee - * const committee = await prisma.committee.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirst>( - args?: SelectSubset> - ): Prisma__CommitteeClient<$Result.GetResult, T, 'findFirst'> | null, null, ExtArgs> - - /** - * Find the first Committee that matches the filter or - * throw `PrismaKnownClientError` with `P2025` code if no matches were found. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {CommitteeFindFirstOrThrowArgs} args - Arguments to find a Committee - * @example - * // Get one Committee - * const committee = await prisma.committee.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirstOrThrow>( - args?: SelectSubset> - ): Prisma__CommitteeClient<$Result.GetResult, T, 'findFirstOrThrow'>, never, ExtArgs> - - /** - * Find zero or more Committees that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {CommitteeFindManyArgs=} args - Arguments to filter and select certain fields only. - * @example - * // Get all Committees - * const committees = await prisma.committee.findMany() - * - * // Get first 10 Committees - * const committees = await prisma.committee.findMany({ take: 10 }) - * - * // Only select the `id` - * const committeeWithIdOnly = await prisma.committee.findMany({ select: { id: true } }) - * - **/ - findMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise<$Result.GetResult, T, 'findMany'>> - - /** - * Create a Committee. - * @param {CommitteeCreateArgs} args - Arguments to create a Committee. - * @example - * // Create one Committee - * const Committee = await prisma.committee.create({ - * data: { - * // ... data to create a Committee - * } - * }) - * - **/ - create>( - args: SelectSubset> - ): Prisma__CommitteeClient<$Result.GetResult, T, 'create'>, never, ExtArgs> - - /** - * Create many Committees. - * @param {CommitteeCreateManyArgs} args - Arguments to create many Committees. - * @example - * // Create many Committees - * const committee = await prisma.committee.createMany({ - * data: { - * // ... provide data here - * } - * }) - * - **/ - createMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Delete a Committee. - * @param {CommitteeDeleteArgs} args - Arguments to delete one Committee. - * @example - * // Delete one Committee - * const Committee = await prisma.committee.delete({ - * where: { - * // ... filter to delete one Committee - * } - * }) - * - **/ - delete>( - args: SelectSubset> - ): Prisma__CommitteeClient<$Result.GetResult, T, 'delete'>, never, ExtArgs> - - /** - * Update one Committee. - * @param {CommitteeUpdateArgs} args - Arguments to update one Committee. - * @example - * // Update one Committee - * const committee = await prisma.committee.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - update>( - args: SelectSubset> - ): Prisma__CommitteeClient<$Result.GetResult, T, 'update'>, never, ExtArgs> - - /** - * Delete zero or more Committees. - * @param {CommitteeDeleteManyArgs} args - Arguments to filter Committees to delete. - * @example - * // Delete a few Committees - * const { count } = await prisma.committee.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - **/ - deleteMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Update zero or more Committees. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {CommitteeUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Committees - * const committee = await prisma.committee.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - updateMany>( - args: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Create or update one Committee. - * @param {CommitteeUpsertArgs} args - Arguments to update or create a Committee. - * @example - * // Update or create a Committee - * const committee = await prisma.committee.upsert({ - * create: { - * // ... data to create a Committee - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the Committee we want to update - * } - * }) - **/ - upsert>( - args: SelectSubset> - ): Prisma__CommitteeClient<$Result.GetResult, T, 'upsert'>, never, ExtArgs> - - /** - * Count the number of Committees. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {CommitteeCountArgs} args - Arguments to filter Committees to count. - * @example - * // Count the number of Committees - * const count = await prisma.committee.count({ - * where: { - * // ... the filter for the Committees we want to count - * } - * }) - **/ - count( - args?: Subset, - ): Prisma.PrismaPromise< - T extends $Utils.Record<'select', any> - ? T['select'] extends true - ? number - : GetScalarType - : number - > - - /** - * Allows you to perform aggregations operations on a Committee. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {CommitteeAggregateArgs} args - Select which aggregations you would like to apply and on what fields. - * @example - * // Ordered by age ascending - * // Where email contains prisma.io - * // Limited to the 10 users - * const aggregations = await prisma.user.aggregate({ - * _avg: { - * age: true, - * }, - * where: { - * email: { - * contains: "prisma.io", - * }, - * }, - * orderBy: { - * age: "asc", - * }, - * take: 10, - * }) - **/ - aggregate(args: Subset): Prisma.PrismaPromise> - - /** - * Group by Committee. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {CommitteeGroupByArgs} args - Group by arguments. - * @example - * // Group by city, order by createdAt, get count - * const result = await prisma.user.groupBy({ - * by: ['city', 'createdAt'], - * orderBy: { - * createdAt: true - * }, - * _count: { - * _all: true - * }, - * }) - * - **/ - groupBy< - T extends CommitteeGroupByArgs, - HasSelectOrTake extends Or< - Extends<'skip', Keys>, - Extends<'take', Keys> - >, - OrderByArg extends True extends HasSelectOrTake - ? { orderBy: CommitteeGroupByArgs['orderBy'] } - : { orderBy?: CommitteeGroupByArgs['orderBy'] }, - OrderFields extends ExcludeUnderscoreKeys>>, - ByFields extends MaybeTupleToUnion, - ByValid extends Has, - HavingFields extends GetHavingFields, - HavingValid extends Has, - ByEmpty extends T['by'] extends never[] ? True : False, - InputErrors extends ByEmpty extends True - ? `Error: "by" must not be empty.` - : HavingValid extends False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? `Error: Field "${P}" used in "having" needs to be provided in "by".` - : [ - Error, - 'Field ', - P, - ` in "having" needs to be provided in "by"`, - ] - }[HavingFields] - : 'take' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetCommitteeGroupByPayload : Prisma.PrismaPromise - /** - * Fields of the Committee model - */ - readonly fields: CommitteeFieldRefs; - } - - /** - * The delegate class that acts as a "Promise-like" for Committee. - * Why is this prefixed with `Prisma__`? - * Because we want to prevent naming conflicts as mentioned in - * https://github.com/prisma/prisma-client-js/issues/707 - */ - export interface Prisma__CommitteeClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: 'PrismaPromise'; - - conference = {}>(args?: Subset>): Prisma__ConferenceClient<$Result.GetResult, T, 'findUniqueOrThrow'> | Null, Null, ExtArgs>; - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise; - } - - - - /** - * Fields of the Committee model - */ - interface CommitteeFieldRefs { - readonly id: FieldRef<"Committee", 'String'> - readonly name: FieldRef<"Committee", 'String'> - readonly abbreviation: FieldRef<"Committee", 'String'> - readonly conferenceId: FieldRef<"Committee", 'String'> - } - - - // Custom InputTypes - - /** - * Committee findUnique - */ - export type CommitteeFindUniqueArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * Filter, which Committee to fetch. - */ - where: CommitteeWhereUniqueInput - } - - - /** - * Committee findUniqueOrThrow - */ - export type CommitteeFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * Filter, which Committee to fetch. - */ - where: CommitteeWhereUniqueInput - } - - - /** - * Committee findFirst - */ - export type CommitteeFindFirstArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * Filter, which Committee to fetch. - */ - where?: CommitteeWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Committees to fetch. - */ - orderBy?: CommitteeOrderByWithRelationInput | CommitteeOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Committees. - */ - cursor?: CommitteeWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Committees from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Committees. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Committees. - */ - distinct?: CommitteeScalarFieldEnum | CommitteeScalarFieldEnum[] - } - - - /** - * Committee findFirstOrThrow - */ - export type CommitteeFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * Filter, which Committee to fetch. - */ - where?: CommitteeWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Committees to fetch. - */ - orderBy?: CommitteeOrderByWithRelationInput | CommitteeOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Committees. - */ - cursor?: CommitteeWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Committees from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Committees. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Committees. - */ - distinct?: CommitteeScalarFieldEnum | CommitteeScalarFieldEnum[] - } - - - /** - * Committee findMany - */ - export type CommitteeFindManyArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * Filter, which Committees to fetch. - */ - where?: CommitteeWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Committees to fetch. - */ - orderBy?: CommitteeOrderByWithRelationInput | CommitteeOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Committees. - */ - cursor?: CommitteeWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Committees from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Committees. - */ - skip?: number - distinct?: CommitteeScalarFieldEnum | CommitteeScalarFieldEnum[] - } - - - /** - * Committee create - */ - export type CommitteeCreateArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * The data needed to create a Committee. - */ - data: XOR - } - - - /** - * Committee createMany - */ - export type CommitteeCreateManyArgs = { - /** - * The data used to create many Committees. - */ - data: CommitteeCreateManyInput | CommitteeCreateManyInput[] - skipDuplicates?: boolean - } - - - /** - * Committee update - */ - export type CommitteeUpdateArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * The data needed to update a Committee. - */ - data: XOR - /** - * Choose, which Committee to update. - */ - where: CommitteeWhereUniqueInput - } - - - /** - * Committee updateMany - */ - export type CommitteeUpdateManyArgs = { - /** - * The data used to update Committees. - */ - data: XOR - /** - * Filter which Committees to update - */ - where?: CommitteeWhereInput - } - - - /** - * Committee upsert - */ - export type CommitteeUpsertArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * The filter to search for the Committee to update in case it exists. - */ - where: CommitteeWhereUniqueInput - /** - * In case the Committee found by the `where` argument doesn't exist, create a new Committee with this data. - */ - create: XOR - /** - * In case the Committee was found with the provided `where` argument, update it with this data. - */ - update: XOR - } - - - /** - * Committee delete - */ - export type CommitteeDeleteArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - /** - * Filter which Committee to delete. - */ - where: CommitteeWhereUniqueInput - } - - - /** - * Committee deleteMany - */ - export type CommitteeDeleteManyArgs = { - /** - * Filter which Committees to delete - */ - where?: CommitteeWhereInput - } - - - /** - * Committee without action - */ - export type CommitteeDefaultArgs = { - /** - * Select specific fields to fetch from the Committee - */ - select?: CommitteeSelect | null - /** - * Choose, which related nodes to fetch as well. - */ - include?: CommitteeInclude | null - } - - - - /** - * Enums - */ - - export const TransactionIsolationLevel: { - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' - }; - - export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] - - - export const ConferenceScalarFieldEnum: { - id: 'id', - name: 'name', - start: 'start', - end: 'end' - }; - - export type ConferenceScalarFieldEnum = (typeof ConferenceScalarFieldEnum)[keyof typeof ConferenceScalarFieldEnum] - - - export const ConferenceCreateTokenScalarFieldEnum: { - token: 'token' - }; - - export type ConferenceCreateTokenScalarFieldEnum = (typeof ConferenceCreateTokenScalarFieldEnum)[keyof typeof ConferenceCreateTokenScalarFieldEnum] - - - export const CommitteeScalarFieldEnum: { - id: 'id', - name: 'name', - abbreviation: 'abbreviation', - conferenceId: 'conferenceId' - }; - - export type CommitteeScalarFieldEnum = (typeof CommitteeScalarFieldEnum)[keyof typeof CommitteeScalarFieldEnum] - - - export const SortOrder: { - asc: 'asc', - desc: 'desc' - }; - - export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] - - - export const QueryMode: { - default: 'default', - insensitive: 'insensitive' - }; - - export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] - - - export const NullsOrder: { - first: 'first', - last: 'last' - }; - - export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] - - - /** - * Field references - */ - - - /** - * Reference to a field of type 'String' - */ - export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> - - - - /** - * Reference to a field of type 'String[]' - */ - export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> - - - - /** - * Reference to a field of type 'DateTime' - */ - export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> - - - - /** - * Reference to a field of type 'DateTime[]' - */ - export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'> - - - - /** - * Reference to a field of type 'Int' - */ - export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> - - - - /** - * Reference to a field of type 'Int[]' - */ - export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> - - /** - * Deep Input Types - */ - - - export type ConferenceWhereInput = { - AND?: ConferenceWhereInput | ConferenceWhereInput[] - OR?: ConferenceWhereInput[] - NOT?: ConferenceWhereInput | ConferenceWhereInput[] - id?: StringFilter<"Conference"> | string - name?: StringFilter<"Conference"> | string - start?: DateTimeNullableFilter<"Conference"> | Date | string | null - end?: DateTimeNullableFilter<"Conference"> | Date | string | null - committees?: CommitteeListRelationFilter - } - - export type ConferenceOrderByWithRelationInput = { - id?: SortOrder - name?: SortOrder - start?: SortOrderInput | SortOrder - end?: SortOrderInput | SortOrder - committees?: CommitteeOrderByRelationAggregateInput - } - - export type ConferenceWhereUniqueInput = Prisma.AtLeast<{ - id?: string - name?: string - AND?: ConferenceWhereInput | ConferenceWhereInput[] - OR?: ConferenceWhereInput[] - NOT?: ConferenceWhereInput | ConferenceWhereInput[] - start?: DateTimeNullableFilter<"Conference"> | Date | string | null - end?: DateTimeNullableFilter<"Conference"> | Date | string | null - committees?: CommitteeListRelationFilter - }, "id" | "name"> - - export type ConferenceOrderByWithAggregationInput = { - id?: SortOrder - name?: SortOrder - start?: SortOrderInput | SortOrder - end?: SortOrderInput | SortOrder - _count?: ConferenceCountOrderByAggregateInput - _max?: ConferenceMaxOrderByAggregateInput - _min?: ConferenceMinOrderByAggregateInput - } - - export type ConferenceScalarWhereWithAggregatesInput = { - AND?: ConferenceScalarWhereWithAggregatesInput | ConferenceScalarWhereWithAggregatesInput[] - OR?: ConferenceScalarWhereWithAggregatesInput[] - NOT?: ConferenceScalarWhereWithAggregatesInput | ConferenceScalarWhereWithAggregatesInput[] - id?: StringWithAggregatesFilter<"Conference"> | string - name?: StringWithAggregatesFilter<"Conference"> | string - start?: DateTimeNullableWithAggregatesFilter<"Conference"> | Date | string | null - end?: DateTimeNullableWithAggregatesFilter<"Conference"> | Date | string | null - } - - export type ConferenceCreateTokenWhereInput = { - AND?: ConferenceCreateTokenWhereInput | ConferenceCreateTokenWhereInput[] - OR?: ConferenceCreateTokenWhereInput[] - NOT?: ConferenceCreateTokenWhereInput | ConferenceCreateTokenWhereInput[] - token?: StringFilter<"ConferenceCreateToken"> | string - } - - export type ConferenceCreateTokenOrderByWithRelationInput = { - token?: SortOrder - } - - export type ConferenceCreateTokenWhereUniqueInput = Prisma.AtLeast<{ - token?: string - AND?: ConferenceCreateTokenWhereInput | ConferenceCreateTokenWhereInput[] - OR?: ConferenceCreateTokenWhereInput[] - NOT?: ConferenceCreateTokenWhereInput | ConferenceCreateTokenWhereInput[] - }, "token"> - - export type ConferenceCreateTokenOrderByWithAggregationInput = { - token?: SortOrder - _count?: ConferenceCreateTokenCountOrderByAggregateInput - _max?: ConferenceCreateTokenMaxOrderByAggregateInput - _min?: ConferenceCreateTokenMinOrderByAggregateInput - } - - export type ConferenceCreateTokenScalarWhereWithAggregatesInput = { - AND?: ConferenceCreateTokenScalarWhereWithAggregatesInput | ConferenceCreateTokenScalarWhereWithAggregatesInput[] - OR?: ConferenceCreateTokenScalarWhereWithAggregatesInput[] - NOT?: ConferenceCreateTokenScalarWhereWithAggregatesInput | ConferenceCreateTokenScalarWhereWithAggregatesInput[] - token?: StringWithAggregatesFilter<"ConferenceCreateToken"> | string - } - - export type CommitteeWhereInput = { - AND?: CommitteeWhereInput | CommitteeWhereInput[] - OR?: CommitteeWhereInput[] - NOT?: CommitteeWhereInput | CommitteeWhereInput[] - id?: StringFilter<"Committee"> | string - name?: StringFilter<"Committee"> | string - abbreviation?: StringFilter<"Committee"> | string - conferenceId?: StringFilter<"Committee"> | string - conference?: XOR - } - - export type CommitteeOrderByWithRelationInput = { - id?: SortOrder - name?: SortOrder - abbreviation?: SortOrder - conferenceId?: SortOrder - conference?: ConferenceOrderByWithRelationInput - } - - export type CommitteeWhereUniqueInput = Prisma.AtLeast<{ - id?: string - name_conferenceId?: CommitteeNameConferenceIdCompoundUniqueInput - AND?: CommitteeWhereInput | CommitteeWhereInput[] - OR?: CommitteeWhereInput[] - NOT?: CommitteeWhereInput | CommitteeWhereInput[] - name?: StringFilter<"Committee"> | string - abbreviation?: StringFilter<"Committee"> | string - conferenceId?: StringFilter<"Committee"> | string - conference?: XOR - }, "id" | "name_conferenceId"> - - export type CommitteeOrderByWithAggregationInput = { - id?: SortOrder - name?: SortOrder - abbreviation?: SortOrder - conferenceId?: SortOrder - _count?: CommitteeCountOrderByAggregateInput - _max?: CommitteeMaxOrderByAggregateInput - _min?: CommitteeMinOrderByAggregateInput - } - - export type CommitteeScalarWhereWithAggregatesInput = { - AND?: CommitteeScalarWhereWithAggregatesInput | CommitteeScalarWhereWithAggregatesInput[] - OR?: CommitteeScalarWhereWithAggregatesInput[] - NOT?: CommitteeScalarWhereWithAggregatesInput | CommitteeScalarWhereWithAggregatesInput[] - id?: StringWithAggregatesFilter<"Committee"> | string - name?: StringWithAggregatesFilter<"Committee"> | string - abbreviation?: StringWithAggregatesFilter<"Committee"> | string - conferenceId?: StringWithAggregatesFilter<"Committee"> | string - } - - export type ConferenceCreateInput = { - id?: string - name: string - start?: Date | string | null - end?: Date | string | null - committees?: CommitteeCreateNestedManyWithoutConferenceInput - } - - export type ConferenceUncheckedCreateInput = { - id?: string - name: string - start?: Date | string | null - end?: Date | string | null - committees?: CommitteeUncheckedCreateNestedManyWithoutConferenceInput - } - - export type ConferenceUpdateInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - start?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - end?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - committees?: CommitteeUpdateManyWithoutConferenceNestedInput - } - - export type ConferenceUncheckedUpdateInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - start?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - end?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - committees?: CommitteeUncheckedUpdateManyWithoutConferenceNestedInput - } - - export type ConferenceCreateManyInput = { - id?: string - name: string - start?: Date | string | null - end?: Date | string | null - } - - export type ConferenceUpdateManyMutationInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - start?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - end?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - } - - export type ConferenceUncheckedUpdateManyInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - start?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - end?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - } - - export type ConferenceCreateTokenCreateInput = { - token: string - } - - export type ConferenceCreateTokenUncheckedCreateInput = { - token: string - } - - export type ConferenceCreateTokenUpdateInput = { - token?: StringFieldUpdateOperationsInput | string - } - - export type ConferenceCreateTokenUncheckedUpdateInput = { - token?: StringFieldUpdateOperationsInput | string - } - - export type ConferenceCreateTokenCreateManyInput = { - token: string - } - - export type ConferenceCreateTokenUpdateManyMutationInput = { - token?: StringFieldUpdateOperationsInput | string - } - - export type ConferenceCreateTokenUncheckedUpdateManyInput = { - token?: StringFieldUpdateOperationsInput | string - } - - export type CommitteeCreateInput = { - id?: string - name: string - abbreviation: string - conference: ConferenceCreateNestedOneWithoutCommitteesInput - } - - export type CommitteeUncheckedCreateInput = { - id?: string - name: string - abbreviation: string - conferenceId: string - } - - export type CommitteeUpdateInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - abbreviation?: StringFieldUpdateOperationsInput | string - conference?: ConferenceUpdateOneRequiredWithoutCommitteesNestedInput - } - - export type CommitteeUncheckedUpdateInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - abbreviation?: StringFieldUpdateOperationsInput | string - conferenceId?: StringFieldUpdateOperationsInput | string - } - - export type CommitteeCreateManyInput = { - id?: string - name: string - abbreviation: string - conferenceId: string - } - - export type CommitteeUpdateManyMutationInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - abbreviation?: StringFieldUpdateOperationsInput | string - } - - export type CommitteeUncheckedUpdateManyInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - abbreviation?: StringFieldUpdateOperationsInput | string - conferenceId?: StringFieldUpdateOperationsInput | string - } - - export type StringFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] | ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - mode?: QueryMode - not?: NestedStringFilter<$PrismaModel> | string - } - - export type DateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - not?: NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null - } - - export type CommitteeListRelationFilter = { - every?: CommitteeWhereInput - some?: CommitteeWhereInput - none?: CommitteeWhereInput - } - - export type SortOrderInput = { - sort: SortOrder - nulls?: NullsOrder - } - - export type CommitteeOrderByRelationAggregateInput = { - _count?: SortOrder - } - - export type ConferenceCountOrderByAggregateInput = { - id?: SortOrder - name?: SortOrder - start?: SortOrder - end?: SortOrder - } - - export type ConferenceMaxOrderByAggregateInput = { - id?: SortOrder - name?: SortOrder - start?: SortOrder - end?: SortOrder - } - - export type ConferenceMinOrderByAggregateInput = { - id?: SortOrder - name?: SortOrder - start?: SortOrder - end?: SortOrder - } - - export type StringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] | ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - mode?: QueryMode - not?: NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedStringFilter<$PrismaModel> - _max?: NestedStringFilter<$PrismaModel> - } - - export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - not?: NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null - _count?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedDateTimeNullableFilter<$PrismaModel> - _max?: NestedDateTimeNullableFilter<$PrismaModel> - } - - export type ConferenceCreateTokenCountOrderByAggregateInput = { - token?: SortOrder - } - - export type ConferenceCreateTokenMaxOrderByAggregateInput = { - token?: SortOrder - } - - export type ConferenceCreateTokenMinOrderByAggregateInput = { - token?: SortOrder - } - - export type ConferenceRelationFilter = { - is?: ConferenceWhereInput - isNot?: ConferenceWhereInput - } - - export type CommitteeNameConferenceIdCompoundUniqueInput = { - name: string - conferenceId: string - } - - export type CommitteeCountOrderByAggregateInput = { - id?: SortOrder - name?: SortOrder - abbreviation?: SortOrder - conferenceId?: SortOrder - } - - export type CommitteeMaxOrderByAggregateInput = { - id?: SortOrder - name?: SortOrder - abbreviation?: SortOrder - conferenceId?: SortOrder - } - - export type CommitteeMinOrderByAggregateInput = { - id?: SortOrder - name?: SortOrder - abbreviation?: SortOrder - conferenceId?: SortOrder - } - - export type CommitteeCreateNestedManyWithoutConferenceInput = { - create?: XOR | CommitteeCreateWithoutConferenceInput[] | CommitteeUncheckedCreateWithoutConferenceInput[] - connectOrCreate?: CommitteeCreateOrConnectWithoutConferenceInput | CommitteeCreateOrConnectWithoutConferenceInput[] - createMany?: CommitteeCreateManyConferenceInputEnvelope - connect?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - } - - export type CommitteeUncheckedCreateNestedManyWithoutConferenceInput = { - create?: XOR | CommitteeCreateWithoutConferenceInput[] | CommitteeUncheckedCreateWithoutConferenceInput[] - connectOrCreate?: CommitteeCreateOrConnectWithoutConferenceInput | CommitteeCreateOrConnectWithoutConferenceInput[] - createMany?: CommitteeCreateManyConferenceInputEnvelope - connect?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - } - - export type StringFieldUpdateOperationsInput = { - set?: string - } - - export type NullableDateTimeFieldUpdateOperationsInput = { - set?: Date | string | null - } - - export type CommitteeUpdateManyWithoutConferenceNestedInput = { - create?: XOR | CommitteeCreateWithoutConferenceInput[] | CommitteeUncheckedCreateWithoutConferenceInput[] - connectOrCreate?: CommitteeCreateOrConnectWithoutConferenceInput | CommitteeCreateOrConnectWithoutConferenceInput[] - upsert?: CommitteeUpsertWithWhereUniqueWithoutConferenceInput | CommitteeUpsertWithWhereUniqueWithoutConferenceInput[] - createMany?: CommitteeCreateManyConferenceInputEnvelope - set?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - disconnect?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - delete?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - connect?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - update?: CommitteeUpdateWithWhereUniqueWithoutConferenceInput | CommitteeUpdateWithWhereUniqueWithoutConferenceInput[] - updateMany?: CommitteeUpdateManyWithWhereWithoutConferenceInput | CommitteeUpdateManyWithWhereWithoutConferenceInput[] - deleteMany?: CommitteeScalarWhereInput | CommitteeScalarWhereInput[] - } - - export type CommitteeUncheckedUpdateManyWithoutConferenceNestedInput = { - create?: XOR | CommitteeCreateWithoutConferenceInput[] | CommitteeUncheckedCreateWithoutConferenceInput[] - connectOrCreate?: CommitteeCreateOrConnectWithoutConferenceInput | CommitteeCreateOrConnectWithoutConferenceInput[] - upsert?: CommitteeUpsertWithWhereUniqueWithoutConferenceInput | CommitteeUpsertWithWhereUniqueWithoutConferenceInput[] - createMany?: CommitteeCreateManyConferenceInputEnvelope - set?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - disconnect?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - delete?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - connect?: CommitteeWhereUniqueInput | CommitteeWhereUniqueInput[] - update?: CommitteeUpdateWithWhereUniqueWithoutConferenceInput | CommitteeUpdateWithWhereUniqueWithoutConferenceInput[] - updateMany?: CommitteeUpdateManyWithWhereWithoutConferenceInput | CommitteeUpdateManyWithWhereWithoutConferenceInput[] - deleteMany?: CommitteeScalarWhereInput | CommitteeScalarWhereInput[] - } - - export type ConferenceCreateNestedOneWithoutCommitteesInput = { - create?: XOR - connectOrCreate?: ConferenceCreateOrConnectWithoutCommitteesInput - connect?: ConferenceWhereUniqueInput - } - - export type ConferenceUpdateOneRequiredWithoutCommitteesNestedInput = { - create?: XOR - connectOrCreate?: ConferenceCreateOrConnectWithoutCommitteesInput - upsert?: ConferenceUpsertWithoutCommitteesInput - connect?: ConferenceWhereUniqueInput - update?: XOR, ConferenceUncheckedUpdateWithoutCommitteesInput> - } - - export type NestedStringFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] | ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringFilter<$PrismaModel> | string - } - - export type NestedDateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - not?: NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null - } - - export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] | ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedStringFilter<$PrismaModel> - _max?: NestedStringFilter<$PrismaModel> - } - - export type NestedIntFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] | ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntFilter<$PrismaModel> | number - } - - export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - not?: NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null - _count?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedDateTimeNullableFilter<$PrismaModel> - _max?: NestedDateTimeNullableFilter<$PrismaModel> - } - - export type NestedIntNullableFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> | null - in?: number[] | ListIntFieldRefInput<$PrismaModel> | null - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntNullableFilter<$PrismaModel> | number | null - } - - export type CommitteeCreateWithoutConferenceInput = { - id?: string - name: string - abbreviation: string - } - - export type CommitteeUncheckedCreateWithoutConferenceInput = { - id?: string - name: string - abbreviation: string - } - - export type CommitteeCreateOrConnectWithoutConferenceInput = { - where: CommitteeWhereUniqueInput - create: XOR - } - - export type CommitteeCreateManyConferenceInputEnvelope = { - data: CommitteeCreateManyConferenceInput | CommitteeCreateManyConferenceInput[] - skipDuplicates?: boolean - } - - export type CommitteeUpsertWithWhereUniqueWithoutConferenceInput = { - where: CommitteeWhereUniqueInput - update: XOR - create: XOR - } - - export type CommitteeUpdateWithWhereUniqueWithoutConferenceInput = { - where: CommitteeWhereUniqueInput - data: XOR - } - - export type CommitteeUpdateManyWithWhereWithoutConferenceInput = { - where: CommitteeScalarWhereInput - data: XOR - } - - export type CommitteeScalarWhereInput = { - AND?: CommitteeScalarWhereInput | CommitteeScalarWhereInput[] - OR?: CommitteeScalarWhereInput[] - NOT?: CommitteeScalarWhereInput | CommitteeScalarWhereInput[] - id?: StringFilter<"Committee"> | string - name?: StringFilter<"Committee"> | string - abbreviation?: StringFilter<"Committee"> | string - conferenceId?: StringFilter<"Committee"> | string - } - - export type ConferenceCreateWithoutCommitteesInput = { - id?: string - name: string - start?: Date | string | null - end?: Date | string | null - } - - export type ConferenceUncheckedCreateWithoutCommitteesInput = { - id?: string - name: string - start?: Date | string | null - end?: Date | string | null - } - - export type ConferenceCreateOrConnectWithoutCommitteesInput = { - where: ConferenceWhereUniqueInput - create: XOR - } - - export type ConferenceUpsertWithoutCommitteesInput = { - update: XOR - create: XOR - where?: ConferenceWhereInput - } - - export type ConferenceUpdateToOneWithWhereWithoutCommitteesInput = { - where?: ConferenceWhereInput - data: XOR - } - - export type ConferenceUpdateWithoutCommitteesInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - start?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - end?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - } - - export type ConferenceUncheckedUpdateWithoutCommitteesInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - start?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - end?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - } - - export type CommitteeCreateManyConferenceInput = { - id?: string - name: string - abbreviation: string - } - - export type CommitteeUpdateWithoutConferenceInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - abbreviation?: StringFieldUpdateOperationsInput | string - } - - export type CommitteeUncheckedUpdateWithoutConferenceInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - abbreviation?: StringFieldUpdateOperationsInput | string - } - - export type CommitteeUncheckedUpdateManyWithoutConferenceInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - abbreviation?: StringFieldUpdateOperationsInput | string - } - - - - /** - * Aliases for legacy arg types - */ - /** - * @deprecated Use ConferenceCountOutputTypeDefaultArgs instead - */ - export type ConferenceCountOutputTypeArgs = ConferenceCountOutputTypeDefaultArgs - /** - * @deprecated Use ConferenceDefaultArgs instead - */ - export type ConferenceArgs = ConferenceDefaultArgs - /** - * @deprecated Use ConferenceCreateTokenDefaultArgs instead - */ - export type ConferenceCreateTokenArgs = ConferenceCreateTokenDefaultArgs - /** - * @deprecated Use CommitteeDefaultArgs instead - */ - export type CommitteeArgs = CommitteeDefaultArgs - - /** - * Batch Payload for updateMany & deleteMany & createMany - */ - - export type BatchPayload = { - count: number - } - - /** - * DMMF - */ - export const dmmf: runtime.BaseDMMF -} \ No newline at end of file diff --git a/chase/backend/prisma/generated/client/index.js b/chase/backend/prisma/generated/client/index.js deleted file mode 100644 index 3d5c95b9..00000000 --- a/chase/backend/prisma/generated/client/index.js +++ /dev/null @@ -1,219 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, -} = require('./runtime/library') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.3.1 - * Query Engine version: e95e739751f42d8ca026f6b910f5a2dc5adeaeee - */ -Prisma.prismaVersion = { - client: "5.3.1", - engine: "e95e739751f42d8ca026f6b910f5a2dc5adeaeee" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = Extensions.getExtensionContext -Prisma.defineExtension = Extensions.defineExtension - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - const path = require('path') - -/** - * Enums - */ -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.ConferenceScalarFieldEnum = { - id: 'id', - name: 'name', - start: 'start', - end: 'end' -}; - -exports.Prisma.ConferenceCreateTokenScalarFieldEnum = { - token: 'token' -}; - -exports.Prisma.CommitteeScalarFieldEnum = { - id: 'id', - name: 'name', - abbreviation: 'abbreviation', - conferenceId: 'conferenceId' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - Conference: 'Conference', - ConferenceCreateToken: 'ConferenceCreateToken', - Committee: 'Committee' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/mnt/codingssd/Coding/munify/chase/backend/prisma/generated/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "debian-openssl-3.0.x", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": "../../../.env", - "schemaEnvPath": "../../../.env" - }, - "relativePath": "../..", - "clientVersion": "5.3.1", - "engineVersion": "e95e739751f42d8ca026f6b910f5a2dc5adeaeee", - "datasourceNames": [ - "db" - ], - "activeProvider": "postgresql", - "postinstall": false, - "inlineDatasources": { - "db": { - "url": { - "fromEnvVar": "DATABASE_URL", - "value": null - } - } - }, - "inlineSchema": "Ly8gVGhpcyBpcyB5b3VyIFByaXNtYSBzY2hlbWEgZmlsZSwKLy8gbGVhcm4gbW9yZSBhYm91dCBpdCBpbiB0aGUgZG9jczogaHR0cHM6Ly9wcmlzLmx5L2QvcHJpc21hLXNjaGVtYQoKZ2VuZXJhdG9yIGNsaWVudCB7CiAgcHJvdmlkZXIgPSAicHJpc21hLWNsaWVudC1qcyIKICBvdXRwdXQgICA9ICIuL2dlbmVyYXRlZC9jbGllbnQiCn0KCmRhdGFzb3VyY2UgZGIgewogIHByb3ZpZGVyID0gInBvc3RncmVzcWwiCiAgdXJsICAgICAgPSBlbnYoIkRBVEFCQVNFX1VSTCIpCn0KCi8vLyBBIGNvbmZlcmVuY2UgZW50aXR5Cm1vZGVsIENvbmZlcmVuY2UgewogIGlkICAgICAgICAgU3RyaW5nICAgICAgQGlkIEBkZWZhdWx0KHV1aWQoKSkKICBuYW1lICAgICAgIFN0cmluZyAgICAgIEB1bmlxdWUKICBjb21taXR0ZWVzIENvbW1pdHRlZVtdCiAgc3RhcnQgICAgICBEYXRlVGltZT8KICBlbmQgICAgICAgIERhdGVUaW1lPwp9CgovLy8gQ29uc3VtZWFibGUgdG9rZW4gd2hpY2ggZ3JhbnRzIHRoZSBjcmVhdGlvbiBvZiBhIGNvbmZlcmVuY2UKbW9kZWwgQ29uZmVyZW5jZUNyZWF0ZVRva2VuIHsKICB0b2tlbiBTdHJpbmcgQGlkCn0KCm1vZGVsIENvbW1pdHRlZSB7CiAgaWQgICAgICAgICAgIFN0cmluZyAgICAgQGlkIEBkZWZhdWx0KHV1aWQoKSkKICBuYW1lICAgICAgICAgU3RyaW5nCiAgYWJicmV2aWF0aW9uIFN0cmluZwogIGNvbmZlcmVuY2UgICBDb25mZXJlbmNlIEByZWxhdGlvbihmaWVsZHM6IFtjb25mZXJlbmNlSWRdLCByZWZlcmVuY2VzOiBbaWRdKQogIGNvbmZlcmVuY2VJZCBTdHJpbmcKCiAgQEB1bmlxdWUoW25hbWUsIGNvbmZlcmVuY2VJZF0pCn0K", - "inlineSchemaHash": "d3d752eb8bc3530f0330c71725def9dd9c1271234985edb90fc6b9b709f0314e", - "noEngine": false -} - -const fs = require('fs') - -config.dirname = __dirname -if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { - const alternativePaths = [ - "prisma/generated/client", - "generated/client", - ] - - const alternativePath = alternativePaths.find((altPath) => { - return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma')) - }) ?? alternativePaths[0] - - config.dirname = path.join(process.cwd(), alternativePath) - config.isBundled = true -} - -config.runtimeDataModel = JSON.parse("{\"models\":{\"Conference\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"committees\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Committee\",\"relationName\":\"CommitteeToConference\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"start\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"end\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"A conference entity\"},\"ConferenceCreateToken\":{\"dbName\":null,\"fields\":[{\"name\":\"token\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Consumeable token which grants the creation of a conference\"},\"Committee\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"abbreviation\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"conference\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Conference\",\"relationName\":\"CommitteeToConference\",\"relationFromFields\":[\"conferenceId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"conferenceId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"name\",\"conferenceId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"name\",\"conferenceId\"]}],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") -defineDmmfProperty(exports.Prisma, config.runtimeDataModel) - - - -const { warnEnvConflicts } = require('./runtime/library') - -warnEnvConflicts({ - rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath), - schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath) -}) - -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma) - -// file annotations for bundling tools to include these files -path.join(__dirname, "libquery_engine-debian-openssl-3.0.x.so.node"); -path.join(process.cwd(), "prisma/generated/client/libquery_engine-debian-openssl-3.0.x.so.node") -// file annotations for bundling tools to include these files -path.join(__dirname, "schema.prisma"); -path.join(process.cwd(), "prisma/generated/client/schema.prisma") diff --git a/chase/backend/prisma/generated/client/libquery_engine-debian-openssl-3.0.x.so.node b/chase/backend/prisma/generated/client/libquery_engine-debian-openssl-3.0.x.so.node deleted file mode 100644 index ad985f52..00000000 Binary files a/chase/backend/prisma/generated/client/libquery_engine-debian-openssl-3.0.x.so.node and /dev/null differ diff --git a/chase/backend/prisma/generated/client/package.json b/chase/backend/prisma/generated/client/package.json deleted file mode 100644 index da6bb21c..00000000 --- a/chase/backend/prisma/generated/client/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": ".prisma/client", - "main": "index.js", - "types": "index.d.ts", - "browser": "index-browser.js", - "sideEffects": false -} \ No newline at end of file diff --git a/chase/backend/prisma/generated/client/runtime/edge-esm.js b/chase/backend/prisma/generated/client/runtime/edge-esm.js deleted file mode 100644 index cc02a6ee..00000000 --- a/chase/backend/prisma/generated/client/runtime/edge-esm.js +++ /dev/null @@ -1,43 +0,0 @@ -var Wu=Object.create;var Vn=Object.defineProperty;var Hu=Object.getOwnPropertyDescriptor;var zu=Object.getOwnPropertyNames;var Zu=Object.getPrototypeOf,Yu=Object.prototype.hasOwnProperty;var Kn=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Dr=(e,t)=>()=>(e&&(t=e(e=0)),t);var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_r=(e,t)=>{for(var r in t)Vn(e,r,{get:t[r],enumerable:!0})},Xu=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zu(t))!Yu.call(e,o)&&o!==r&&Vn(e,o,{get:()=>t[o],enumerable:!(n=Hu(t,o))||n.enumerable});return e};var Te=(e,t,r)=>(r=e!=null?Wu(Zu(e)):{},Xu(t||!e||!e.__esModule?Vn(r,"default",{value:e,enumerable:!0}):r,e));function L(e){return()=>e}function Ie(){return y}var y,p=Dr(()=>{"use strict";y={abort:L(void 0),addListener:L(Ie()),allowedNodeEnvironmentFlags:new Set,arch:"x64",argv:["/bin/node"],argv0:"node",chdir:L(void 0),config:{target_defaults:{cflags:[],default_configuration:"",defines:[],include_dirs:[],libraries:[]},variables:{clang:0,host_arch:"x64",node_install_npm:!1,node_install_waf:!1,node_prefix:"",node_shared_openssl:!1,node_shared_v8:!1,node_shared_zlib:!1,node_use_dtrace:!1,node_use_etw:!1,node_use_openssl:!1,target_arch:"x64",v8_no_strict_aliasing:0,v8_use_snapshot:!1,visibility:""}},connected:!1,cpuUsage:()=>({user:0,system:0}),cwd:()=>"/",debugPort:0,disconnect:L(void 0),constrainedMemory:()=>{},emit:L(Ie()),emitWarning:L(void 0),env:{},eventNames:()=>[],execArgv:[],execPath:"/",exit:L(void 0),features:{inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1},getMaxListeners:L(0),getegid:L(0),geteuid:L(0),getgid:L(0),getgroups:L([]),getuid:L(0),hasUncaughtExceptionCaptureCallback:L(!1),hrtime:L([0,0]),platform:"linux",kill:L(!0),listenerCount:L(0),listeners:L([]),memoryUsage:L({arrayBuffers:0,external:0,heapTotal:0,heapUsed:0,rss:0}),nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},off:L(Ie()),on:L(Ie()),once:L(Ie()),openStdin:L({}),pid:0,ppid:0,prependListener:L(Ie()),prependOnceListener:L(Ie()),rawListeners:L([]),release:{name:"node"},removeAllListeners:L(Ie()),removeListener:L(Ie()),resourceUsage:L({fsRead:0,fsWrite:0,involuntaryContextSwitches:0,ipcReceived:0,ipcSent:0,majorPageFault:0,maxRSS:0,minorPageFault:0,sharedMemorySize:0,signalsCount:0,swappedOut:0,systemCPUTime:0,unsharedDataSize:0,unsharedStackSize:0,userCPUTime:0,voluntaryContextSwitches:0}),setMaxListeners:L(Ie()),setUncaughtExceptionCaptureCallback:L(void 0),setegid:L(void 0),seteuid:L(void 0),setgid:L(void 0),setgroups:L(void 0),setuid:L(void 0),stderr:{fd:2},stdin:{fd:0},stdout:{fd:1},title:"node",traceDeprecation:!1,umask:L(0),uptime:L(0),version:"",versions:{http_parser:"",node:"",v8:"",ares:"",uv:"",zlib:"",modules:"",openssl:""}}});var h,f=Dr(()=>{"use strict";h=()=>{};h.prototype=h});var Fi=z(St=>{"use strict";d();p();f();var hi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),el=hi(e=>{"use strict";e.byteLength=u,e.toByteArray=c,e.fromByteArray=w;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(i=0,s=o.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var T=E.indexOf("=");T===-1&&(T=x);var R=T===x?0:4-T%4;return[T,R]}function u(E){var x=a(E),T=x[0],R=x[1];return(T+R)*3/4-R}function l(E,x,T){return(x+T)*3/4-T}function c(E){var x,T=a(E),R=T[0],S=T[1],C=new n(l(E,R,S)),M=0,N=S>0?R-4:R,B;for(B=0;B>16&255,C[M++]=x>>8&255,C[M++]=x&255;return S===2&&(x=r[E.charCodeAt(B)]<<2|r[E.charCodeAt(B+1)]>>4,C[M++]=x&255),S===1&&(x=r[E.charCodeAt(B)]<<10|r[E.charCodeAt(B+1)]<<4|r[E.charCodeAt(B+2)]>>2,C[M++]=x>>8&255,C[M++]=x&255),C}function m(E){return t[E>>18&63]+t[E>>12&63]+t[E>>6&63]+t[E&63]}function g(E,x,T){for(var R,S=[],C=x;CN?N:M+C));return R===1?(x=E[T-1],S.push(t[x>>2]+t[x<<4&63]+"==")):R===2&&(x=(E[T-2]<<8)+E[T-1],S.push(t[x>>10]+t[x>>4&63]+t[x<<2&63]+"=")),S.join("")}}),tl=hi(e=>{e.read=function(t,r,n,o,i){var s,a,u=i*8-o-1,l=(1<>1,m=-7,g=n?i-1:0,w=n?-1:1,E=t[r+g];for(g+=w,s=E&(1<<-m)-1,E>>=-m,m+=u;m>0;s=s*256+t[r+g],g+=w,m-=8);for(a=s&(1<<-m)-1,s>>=-m,m+=o;m>0;a=a*256+t[r+g],g+=w,m-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(E?-1:1)*(1/0);a=a+Math.pow(2,o),s=s-c}return(E?-1:1)*a*Math.pow(2,s-o)},e.write=function(t,r,n,o,i,s){var a,u,l,c=s*8-i-1,m=(1<>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=o?0:s-1,x=o?1:-1,T=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=m):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+g>=1?r+=w/l:r+=w*Math.pow(2,1-g),r*l>=2&&(a++,l/=2),a+g>=m?(u=0,a=m):a+g>=1?(u=(r*l-1)*Math.pow(2,i),a=a+g):(u=r*Math.pow(2,g-1)*Math.pow(2,i),a=0));i>=8;t[n+E]=u&255,E+=x,u/=256,i-=8);for(a=a<0;t[n+E]=a&255,E+=x,a/=256,c-=8);t[n+E-x]|=T*128}}),Jn=el(),Mt=tl(),di=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;St.Buffer=P;St.SlowBuffer=al;St.INSPECT_MAX_BYTES=50;var Nr=2147483647;St.kMaxLength=Nr;P.TYPED_ARRAY_SUPPORT=rl();!P.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function rl(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(P.prototype,"parent",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.buffer}});Object.defineProperty(P.prototype,"offset",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.byteOffset}});function $e(e){if(e>Nr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,P.prototype),t}function P(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Wn(e)}return xi(e,t,r)}P.poolSize=8192;function xi(e,t,r){if(typeof e=="string")return ol(e,t);if(ArrayBuffer.isView(e))return il(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ke(e,ArrayBuffer)||e&&ke(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(e,SharedArrayBuffer)||e&&ke(e.buffer,SharedArrayBuffer)))return wi(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return P.from(n,t,r);let o=sl(e);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return P.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}P.from=function(e,t,r){return xi(e,t,r)};Object.setPrototypeOf(P.prototype,Uint8Array.prototype);Object.setPrototypeOf(P,Uint8Array);function bi(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function nl(e,t,r){return bi(e),e<=0?$e(e):t!==void 0?typeof r=="string"?$e(e).fill(t,r):$e(e).fill(t):$e(e)}P.alloc=function(e,t,r){return nl(e,t,r)};function Wn(e){return bi(e),$e(e<0?0:Hn(e)|0)}P.allocUnsafe=function(e){return Wn(e)};P.allocUnsafeSlow=function(e){return Wn(e)};function ol(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!P.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=Ei(e,t)|0,n=$e(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}function Qn(e){let t=e.length<0?0:Hn(e.length)|0,r=$e(t);for(let n=0;n=Nr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Nr.toString(16)+" bytes");return e|0}function al(e){return+e!=e&&(e=0),P.alloc(+e)}P.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==P.prototype};P.compare=function(e,t){if(ke(e,Uint8Array)&&(e=P.from(e,e.offset,e.byteLength)),ke(t,Uint8Array)&&(t=P.from(t,t.offset,t.byteLength)),!P.isBuffer(e)||!P.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);on.length?(P.isBuffer(i)||(i=P.from(i)),i.copy(n,o)):Uint8Array.prototype.set.call(n,i,o);else if(P.isBuffer(i))i.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=i.length}return n};function Ei(e,t){if(P.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ke(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Gn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Oi(e).length;default:if(o)return n?-1:Gn(e).length;t=(""+t).toLowerCase(),o=!0}}P.byteLength=Ei;function ul(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return xl(this,t,r);case"utf8":case"utf-8":return vi(this,t,r);case"ascii":return yl(this,t,r);case"latin1":case"binary":return hl(this,t,r);case"base64":return ml(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bl(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}P.prototype._isBuffer=!0;function dt(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}P.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};di&&(P.prototype[di]=P.prototype.inspect);P.prototype.compare=function(e,t,r,n,o){if(ke(e,Uint8Array)&&(e=P.from(e,e.offset,e.byteLength)),!P.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let i=o-n,s=r-t,a=Math.min(i,s),u=this.slice(n,o),l=e.slice(t,r);for(let c=0;c2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Zn(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof t=="string"&&(t=P.from(t,n)),P.isBuffer(t))return t.length===0?-1:mi(e,t,r,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):mi(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function mi(e,t,r,n,o){let i=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;i=2,s/=2,a/=2,r/=2}function u(c,m){return i===1?c[m]:c.readUInt16BE(m*i)}let l;if(o){let c=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let c=!0;for(let m=0;mo&&(n=o)):n=o;let i=t.length;n>i/2&&(n=i/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return ll(this,e,t,r);case"utf8":case"utf-8":return cl(this,e,t,r);case"ascii":case"latin1":case"binary":return pl(this,e,t,r);case"base64":return fl(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dl(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}};P.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ml(e,t,r){return t===0&&r===e.length?Jn.fromByteArray(e):Jn.fromByteArray(e.slice(t,r))}function vi(e,t,r){r=Math.min(e.length,r);let n=[],o=t;for(;o239?4:i>223?3:i>191?2:1;if(o+a<=r){let u,l,c,m;switch(a){case 1:i<128&&(s=i);break;case 2:u=e[o+1],(u&192)===128&&(m=(i&31)<<6|u&63,m>127&&(s=m));break;case 3:u=e[o+1],l=e[o+2],(u&192)===128&&(l&192)===128&&(m=(i&15)<<12|(u&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:u=e[o+1],l=e[o+2],c=e[o+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(m=(i&15)<<18|(u&63)<<12|(l&63)<<6|c&63,m>65535&&m<1114112&&(s=m))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),o+=a}return gl(n)}var gi=4096;function gl(e){let t=e.length;if(t<=gi)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let o="";for(let i=t;ir&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}P.prototype.readUintLE=P.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||ee(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>0,t=t>>>0,r||ee(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n};P.prototype.readUint8=P.prototype.readUInt8=function(e,t){return e=e>>>0,t||ee(e,1,this.length),this[e]};P.prototype.readUint16LE=P.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||ee(e,2,this.length),this[e]|this[e+1]<<8};P.prototype.readUint16BE=P.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||ee(e,2,this.length),this[e]<<8|this[e+1]};P.prototype.readUint32LE=P.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};P.prototype.readUint32BE=P.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};P.prototype.readBigUInt64LE=He(function(e){e=e>>>0,Rt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Xt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<>>0,Rt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Xt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||ee(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n};P.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||ee(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};P.prototype.readInt8=function(e,t){return e=e>>>0,t||ee(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};P.prototype.readInt16LE=function(e,t){e=e>>>0,t||ee(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};P.prototype.readInt16BE=function(e,t){e=e>>>0,t||ee(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};P.prototype.readInt32LE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};P.prototype.readInt32BE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};P.prototype.readBigInt64LE=He(function(e){e=e>>>0,Rt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Xt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,Rt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Xt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||ee(e,4,this.length),Mt.read(this,e,!0,23,4)};P.prototype.readFloatBE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),Mt.read(this,e,!1,23,4)};P.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||ee(e,8,this.length),Mt.read(this,e,!0,52,8)};P.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||ee(e,8,this.length),Mt.read(this,e,!1,52,8)};function he(e,t,r,n,o,i){if(!P.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}P.prototype.writeUintLE=P.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;he(this,e,t,r,s,0)}let o=1,i=0;for(this[t]=e&255;++i>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;he(this,e,t,r,s,0)}let o=r-1,i=1;for(this[t+o]=e&255;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r};P.prototype.writeUint8=P.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,1,255,0),this[t]=e&255,t+1};P.prototype.writeUint16LE=P.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};P.prototype.writeUint16BE=P.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};P.prototype.writeUint32LE=P.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};P.prototype.writeUint32BE=P.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Ai(e,t,r,n,o){Si(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function Ti(e,t,r,n,o){Si(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i=i>>8,e[r+6]=i,i=i>>8,e[r+5]=i,i=i>>8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}P.prototype.writeBigUInt64LE=He(function(e,t=0){return Ai(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});P.prototype.writeBigUInt64BE=He(function(e,t=0){return Ti(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});P.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);he(this,e,t,r,a-1,-a)}let o=0,i=1,s=0;for(this[t]=e&255;++o>0)-s&255;return t+r};P.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);he(this,e,t,r,a-1,-a)}let o=r-1,i=1,s=0;for(this[t+o]=e&255;--o>=0&&(i*=256);)e<0&&s===0&&this[t+o+1]!==0&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r};P.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};P.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};P.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};P.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};P.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};P.prototype.writeBigInt64LE=He(function(e,t=0){return Ai(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});P.prototype.writeBigInt64BE=He(function(e,t=0){return Ti(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ci(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Mi(e,t,r,n,o){return t=+t,r=r>>>0,o||Ci(e,t,r,4,34028234663852886e22,-34028234663852886e22),Mt.write(e,t,r,n,23,4),r+4}P.prototype.writeFloatLE=function(e,t,r){return Mi(this,e,t,!0,r)};P.prototype.writeFloatBE=function(e,t,r){return Mi(this,e,t,!1,r)};function Ri(e,t,r,n,o){return t=+t,r=r>>>0,o||Ci(e,t,r,8,17976931348623157e292,-17976931348623157e292),Mt.write(e,t,r,n,52,8),r+8}P.prototype.writeDoubleLE=function(e,t,r){return Ri(this,e,t,!0,r)};P.prototype.writeDoubleBE=function(e,t,r){return Ri(this,e,t,!1,r)};P.prototype.copy=function(e,t,r,n){if(!P.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o2**32?o=yi(String(r)):typeof r=="bigint"&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=yi(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function yi(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function wl(e,t,r){Rt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Xt(t,e.length-(r+1))}function Si(e,t,r,n,o,i){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(i+1)*8}${s}`:a=`>= -(2${s} ** ${(i+1)*8-1}${s}) and < 2 ** ${(i+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Ct.ERR_OUT_OF_RANGE("value",a,e)}wl(n,o,i)}function Rt(e,t){if(typeof e!="number")throw new Ct.ERR_INVALID_ARG_TYPE(t,"number",e)}function Xt(e,t,r){throw Math.floor(e)!==e?(Rt(e,r),new Ct.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Ct.ERR_BUFFER_OUT_OF_BOUNDS:new Ct.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var El=/[^+/0-9A-Za-z-_]/g;function Pl(e){if(e=e.split("=")[0],e=e.trim().replace(El,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Gn(e,t){t=t||1/0;let r,n=e.length,o=null,i=[];for(let s=0;s55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function vl(e){let t=[];for(let r=0;r>8,o=r%256,i.push(o),i.push(n);return i}function Oi(e){return Jn.toByteArray(Pl(e))}function Br(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function ke(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Zn(e){return e!==e}var Tl=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function He(e){return typeof BigInt>"u"?Cl:e}function Cl(){throw new Error("BigInt not supported")}});var b,d=Dr(()=>{"use strict";b=Te(Fi())});var uo=z(j=>{"use strict";d();p();f();var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vi=G((e,t)=>{"use strict";t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},n=Symbol("test"),o=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var i=42;r[n]=i;for(n in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var s=Object.getOwnPropertySymbols(r);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(r,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(r,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}}),Vr=G((e,t)=>{"use strict";var r=Vi();t.exports=function(){return r()&&!!Symbol.toStringTag}}),Ml=G((e,t)=>{"use strict";var r=typeof Symbol<"u"&&Symbol,n=Vi();t.exports=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()}}),Rl=G((e,t)=>{"use strict";var r={foo:{}},n=Object;t.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof n)}}),Sl=G((e,t)=>{"use strict";var r="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,o=Object.prototype.toString,i="[object Function]";t.exports=function(s){var a=this;if(typeof a!="function"||o.call(a)!==i)throw new TypeError(r+a);for(var u=n.call(arguments,1),l,c=function(){if(this instanceof l){var x=a.apply(this,u.concat(n.call(arguments)));return Object(x)===x?x:this}else return a.apply(s,u.concat(n.call(arguments)))},m=Math.max(0,a.length-u.length),g=[],w=0;w{"use strict";var r=Sl();t.exports=h.prototype.bind||r}),Ol=G((e,t)=>{"use strict";var r=no();t.exports=r.call(h.call,Object.prototype.hasOwnProperty)}),oo=G((e,t)=>{"use strict";var r,n=SyntaxError,o=h,i=TypeError,s=function($){try{return o('"use strict"; return ('+$+").constructor;")()}catch(U){}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch($){a=null}var u=function(){throw new i},l=a?function(){try{return arguments.callee,u}catch($){try{return a(arguments,"callee").get}catch(U){return u}}}():u,c=Ml()(),m=Rl()(),g=Object.getPrototypeOf||(m?function($){return $.__proto__}:null),w={},E=typeof Uint8Array>"u"||!g?r:g(Uint8Array),x={"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":c&&g?g([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":void 0,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c&&g?g(g([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!c||!g?r:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!c||!g?r:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c&&g?g(""[Symbol.iterator]()):r,"%Symbol%":c?Symbol:r,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":E,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet};if(g)try{null.error}catch($){T=g(g($)),x["%Error.prototype%"]=T}var T,R=function $(U){var O;if(U==="%AsyncFunction%")O=s("async function () {}");else if(U==="%GeneratorFunction%")O=s("function* () {}");else if(U==="%AsyncGeneratorFunction%")O=s("async function* () {}");else if(U==="%AsyncGenerator%"){var oe=$("%AsyncGeneratorFunction%");oe&&(O=oe.prototype)}else if(U==="%AsyncIteratorPrototype%"){var ie=$("%AsyncGenerator%");ie&&g&&(O=g(ie.prototype))}return x[U]=O,O},S={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},C=no(),M=Ol(),N=C.call(h.call,Array.prototype.concat),B=C.call(h.apply,Array.prototype.splice),pe=C.call(h.call,String.prototype.replace),V=C.call(h.call,String.prototype.slice),W=C.call(h.call,RegExp.prototype.exec),Ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,Pe=function($){var U=V($,0,1),O=V($,-1);if(U==="%"&&O!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");if(O==="%"&&U!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var oe=[];return pe($,Ee,function(ie,Ge,Y,ct){oe[oe.length]=Y?pe(ct,H,"$1"):Ge||ie}),oe},Qe=function($,U){var O=$,oe;if(M(S,O)&&(oe=S[O],O="%"+oe[0]+"%"),M(x,O)){var ie=x[O];if(ie===w&&(ie=R(O)),typeof ie>"u"&&!U)throw new i("intrinsic "+$+" exists, but is not available. Please file an issue!");return{alias:oe,name:O,value:ie}}throw new n("intrinsic "+$+" does not exist!")};t.exports=function($,U){if(typeof $!="string"||$.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof U!="boolean")throw new i('"allowMissing" argument must be a boolean');if(W(/^%?[^%]*%?$/,$)===null)throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var O=Pe($),oe=O.length>0?O[0]:"",ie=Qe("%"+oe+"%",U),Ge=ie.name,Y=ie.value,ct=!1,We=ie.alias;We&&(oe=We[0],B(O,N([0,1],We)));for(var pt=1,Ue=!0;pt=O.length){var Tt=a(Y,fe);Ue=!!Tt,Ue&&"get"in Tt&&!("originalValue"in Tt.get)?Y=Tt.get:Y=Y[fe]}else Ue=M(Y,fe),Y=Y[fe];Ue&&!ct&&(x[Ge]=Y)}}return Y}}),Fl=G((e,t)=>{"use strict";var r=no(),n=oo(),o=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||r.call(i,o),a=n("%Object.getOwnPropertyDescriptor%",!0),u=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(u)try{u({},"a",{value:1})}catch(m){u=null}t.exports=function(m){var g=s(r,i,arguments);if(a&&u){var w=a(g,"length");w.configurable&&u(g,"length",{value:1+l(0,m.length-(arguments.length-1))})}return g};var c=function(){return s(r,o,arguments)};u?u(t.exports,"apply",{value:c}):t.exports.apply=c}),io=G((e,t)=>{"use strict";var r=oo(),n=Fl(),o=n(r("String.prototype.indexOf"));t.exports=function(i,s){var a=r(i,!!s);return typeof a=="function"&&o(i,".prototype.")>-1?n(a):a}}),Il=G((e,t)=>{"use strict";var r=Vr()(),n=io(),o=n("Object.prototype.toString"),i=function(u){return r&&u&&typeof u=="object"&&Symbol.toStringTag in u?!1:o(u)==="[object Arguments]"},s=function(u){return i(u)?!0:u!==null&&typeof u=="object"&&typeof u.length=="number"&&u.length>=0&&o(u)!=="[object Array]"&&o(u.callee)==="[object Function]"},a=function(){return i(arguments)}();i.isLegacyArguments=s,t.exports=a?i:s}),kl=G((e,t)=>{"use strict";var r=Object.prototype.toString,n=h.prototype.toString,o=/^\s*(?:function)?\*/,i=Vr()(),s=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return h("return function*() {}")()}catch(l){}},u;t.exports=function(l){if(typeof l!="function")return!1;if(o.test(n.call(l)))return!0;if(!i){var c=r.call(l);return c==="[object GeneratorFunction]"}if(!s)return!1;if(typeof u>"u"){var m=a();u=m?s(m):!1}return s(l)===u}}),Dl=G((e,t)=>{"use strict";var r=h.prototype.toString,n=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,o,i;if(typeof n=="function"&&typeof Object.defineProperty=="function")try{o=Object.defineProperty({},"length",{get:function(){throw i}}),i={},n(function(){throw 42},null,o)}catch(M){M!==i&&(n=null)}else n=null;var s=/^\s*class\b/,a=function(M){try{var N=r.call(M);return s.test(N)}catch(B){return!1}},u=function(M){try{return a(M)?!1:(r.call(M),!0)}catch(N){return!1}},l=Object.prototype.toString,c="[object Object]",m="[object Function]",g="[object GeneratorFunction]",w="[object HTMLAllCollection]",E="[object HTML document.all class]",x="[object HTMLCollection]",T=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),S=function(){return!1};typeof document=="object"&&(C=document.all,l.call(C)===l.call(document.all)&&(S=function(M){if((R||!M)&&(typeof M>"u"||typeof M=="object"))try{var N=l.call(M);return(N===w||N===E||N===x||N===c)&&M("")==null}catch(B){}return!1}));var C;t.exports=n?function(M){if(S(M))return!0;if(!M||typeof M!="function"&&typeof M!="object")return!1;try{n(M,null,o)}catch(N){if(N!==i)return!1}return!a(M)&&u(M)}:function(M){if(S(M))return!0;if(!M||typeof M!="function"&&typeof M!="object")return!1;if(T)return u(M);if(a(M))return!1;var N=l.call(M);return N!==m&&N!==g&&!/^\[object HTML/.test(N)?!1:u(M)}}),Ki=G((e,t)=>{"use strict";var r=Dl(),n=Object.prototype.toString,o=Object.prototype.hasOwnProperty,i=function(l,c,m){for(var g=0,w=l.length;g=3&&(g=m),n.call(l)==="[object Array]"?i(l,c,g):typeof l=="string"?s(l,c,g):a(l,c,g)};t.exports=u}),Ji=G((e,t)=>{"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n=typeof globalThis>"u"?global:globalThis;t.exports=function(){for(var o=[],i=0;i{"use strict";var r=oo(),n=r("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(o){n=null}t.exports=n}),Gi=G((e,t)=>{"use strict";var r=Ki(),n=Ji(),o=io(),i=o("Object.prototype.toString"),s=Vr()(),a=Qi(),u=typeof globalThis>"u"?global:globalThis,l=n(),c=o("Array.prototype.indexOf",!0)||function(x,T){for(var R=0;R-1}return a?E(x):!1}}),_l=G((e,t)=>{"use strict";var r=Ki(),n=Ji(),o=io(),i=Qi(),s=o("Object.prototype.toString"),a=Vr()(),u=typeof globalThis>"u"?global:globalThis,l=n(),c=o("String.prototype.slice"),m={},g=Object.getPrototypeOf;a&&i&&g&&r(l,function(x){if(typeof u[x]=="function"){var T=new u[x];if(Symbol.toStringTag in T){var R=g(T),S=i(R,Symbol.toStringTag);if(!S){var C=g(R);S=i(C,Symbol.toStringTag)}m[x]=S.get}}});var w=function(x){var T=!1;return r(m,function(R,S){if(!T)try{var C=R.call(x);C===S&&(T=C)}catch(M){}}),T},E=Gi();t.exports=function(x){return E(x)?!a||!(Symbol.toStringTag in x)?c(s(x),8,-1):w(x):!1}}),Nl=G(e=>{"use strict";var t=Il(),r=kl(),n=_l(),o=Gi();function i(A){return A.call.bind(A)}var s=typeof BigInt<"u",a=typeof Symbol<"u",u=i(Object.prototype.toString),l=i(Number.prototype.valueOf),c=i(String.prototype.valueOf),m=i(Boolean.prototype.valueOf);s&&(g=i(BigInt.prototype.valueOf));var g;a&&(w=i(Symbol.prototype.valueOf));var w;function E(A,Gu){if(typeof A!="object")return!1;try{return Gu(A),!0}catch(Bd){return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function x(A){return typeof Promise<"u"&&A instanceof Promise||A!==null&&typeof A=="object"&&typeof A.then=="function"&&typeof A.catch=="function"}e.isPromise=x;function T(A){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(A):o(A)||pt(A)}e.isArrayBufferView=T;function R(A){return n(A)==="Uint8Array"}e.isUint8Array=R;function S(A){return n(A)==="Uint8ClampedArray"}e.isUint8ClampedArray=S;function C(A){return n(A)==="Uint16Array"}e.isUint16Array=C;function M(A){return n(A)==="Uint32Array"}e.isUint32Array=M;function N(A){return n(A)==="Int8Array"}e.isInt8Array=N;function B(A){return n(A)==="Int16Array"}e.isInt16Array=B;function pe(A){return n(A)==="Int32Array"}e.isInt32Array=pe;function V(A){return n(A)==="Float32Array"}e.isFloat32Array=V;function W(A){return n(A)==="Float64Array"}e.isFloat64Array=W;function Ee(A){return n(A)==="BigInt64Array"}e.isBigInt64Array=Ee;function H(A){return n(A)==="BigUint64Array"}e.isBigUint64Array=H;function Pe(A){return u(A)==="[object Map]"}Pe.working=typeof Map<"u"&&Pe(new Map);function Qe(A){return typeof Map>"u"?!1:Pe.working?Pe(A):A instanceof Map}e.isMap=Qe;function $(A){return u(A)==="[object Set]"}$.working=typeof Set<"u"&&$(new Set);function U(A){return typeof Set>"u"?!1:$.working?$(A):A instanceof Set}e.isSet=U;function O(A){return u(A)==="[object WeakMap]"}O.working=typeof WeakMap<"u"&&O(new WeakMap);function oe(A){return typeof WeakMap>"u"?!1:O.working?O(A):A instanceof WeakMap}e.isWeakMap=oe;function ie(A){return u(A)==="[object WeakSet]"}ie.working=typeof WeakSet<"u"&&ie(new WeakSet);function Ge(A){return ie(A)}e.isWeakSet=Ge;function Y(A){return u(A)==="[object ArrayBuffer]"}Y.working=typeof ArrayBuffer<"u"&&Y(new ArrayBuffer);function ct(A){return typeof ArrayBuffer>"u"?!1:Y.working?Y(A):A instanceof ArrayBuffer}e.isArrayBuffer=ct;function We(A){return u(A)==="[object DataView]"}We.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&We(new DataView(new ArrayBuffer(1),0,1));function pt(A){return typeof DataView>"u"?!1:We.working?We(A):A instanceof DataView}e.isDataView=pt;var Ue=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function fe(A){return u(A)==="[object SharedArrayBuffer]"}function ft(A){return typeof Ue>"u"?!1:(typeof fe.working>"u"&&(fe.working=fe(new Ue)),fe.working?fe(A):A instanceof Ue)}e.isSharedArrayBuffer=ft;function At(A){return u(A)==="[object AsyncFunction]"}e.isAsyncFunction=At;function Tt(A){return u(A)==="[object Map Iterator]"}e.isMapIterator=Tt;function qu(A){return u(A)==="[object Set Iterator]"}e.isSetIterator=qu;function Vu(A){return u(A)==="[object Generator]"}e.isGeneratorObject=Vu;function Ku(A){return u(A)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=Ku;function ui(A){return E(A,l)}e.isNumberObject=ui;function li(A){return E(A,c)}e.isStringObject=li;function ci(A){return E(A,m)}e.isBooleanObject=ci;function pi(A){return s&&E(A,g)}e.isBigIntObject=pi;function fi(A){return a&&E(A,w)}e.isSymbolObject=fi;function Ju(A){return ui(A)||li(A)||ci(A)||pi(A)||fi(A)}e.isBoxedPrimitive=Ju;function Qu(A){return typeof Uint8Array<"u"&&(ct(A)||ft(A))}e.isAnyArrayBuffer=Qu,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(A){Object.defineProperty(e,A,{enumerable:!1,value:function(){throw new Error(A+" is not supported in userland")}})})}),Bl=G((e,t)=>{t.exports=function(r){return r instanceof b.Buffer}}),Ll=G((e,t)=>{typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var o=function(){};o.prototype=n.prototype,r.prototype=new o,r.prototype.constructor=r}}}),Wi=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=o)return u;switch(u){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(l){return"[Circular]"}default:return u}}),s=n[r];r"u")return function(){return j.deprecate(e,t).apply(this,arguments)};var r=!1;function n(){if(!r){if(y.throwDeprecation)throw new Error(t);y.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}return n};var Lr={},Hi=/^$/;y.env.NODE_DEBUG&&(jr=y.env.NODE_DEBUG,jr=jr.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Hi=new RegExp("^"+jr+"$","i"));var jr;j.debuglog=function(e){if(e=e.toUpperCase(),!Lr[e])if(Hi.test(e)){var t=y.pid;Lr[e]=function(){var r=j.format.apply(j,arguments);console.error("%s %d: %s",e,t,r)}}else Lr[e]=function(){};return Lr[e]};function Ze(e,t){var r={seen:[],stylize:$l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),so(t)?r.showHidden=t:t&&j._extend(r,t),gt(r.showHidden)&&(r.showHidden=!1),gt(r.depth)&&(r.depth=2),gt(r.colors)&&(r.colors=!1),gt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ul),$r(r,e,r.depth)}j.inspect=Ze;Ze.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Ze.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ul(e,t){var r=Ze.styles[t];return r?"\x1B["+Ze.colors[r][0]+"m"+e+"\x1B["+Ze.colors[r][1]+"m":e}function $l(e,t){return e}function ql(e){var t={};return e.forEach(function(r,n){t[r]=!0}),t}function $r(e,t,r){if(e.customInspect&&t&&Ur(t.inspect)&&t.inspect!==j.inspect&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(r,e);return Jr(n)||(n=$r(e,n,r)),n}var o=Vl(e,t);if(o)return o;var i=Object.keys(t),s=ql(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),tr(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return eo(t);if(i.length===0){if(Ur(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(er(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(qr(t))return e.stylize(Date.prototype.toString.call(t),"date");if(tr(t))return eo(t)}var u="",l=!1,c=["{","}"];if(zi(t)&&(l=!0,c=["[","]"]),Ur(t)){var m=t.name?": "+t.name:"";u=" [Function"+m+"]"}if(er(t)&&(u=" "+RegExp.prototype.toString.call(t)),qr(t)&&(u=" "+Date.prototype.toUTCString.call(t)),tr(t)&&(u=" "+eo(t)),i.length===0&&(!l||t.length==0))return c[0]+u+c[1];if(r<0)return er(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var g;return l?g=Kl(e,t,r,s,i):g=i.map(function(w){return ro(e,t,r,s,w,l)}),e.seen.pop(),Jl(g,u,c)}function Vl(e,t){if(gt(t))return e.stylize("undefined","undefined");if(Jr(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(Zi(t))return e.stylize(""+t,"number");if(so(t))return e.stylize(""+t,"boolean");if(Kr(t))return e.stylize("null","null")}function eo(e){return"["+Error.prototype.toString.call(e)+"]"}function Kl(e,t,r,n,o){for(var i=[],s=0,a=t.length;s-1&&(i?a=a.split(` -`).map(function(l){return" "+l}).join(` -`).slice(2):a=` -`+a.split(` -`).map(function(l){return" "+l}).join(` -`))):a=e.stylize("[Circular]","special")),gt(s)){if(i&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function Jl(e,t,r){var n=0,o=e.reduce(function(i,s){return n++,s.indexOf(` -`)>=0&&n++,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(t===""?"":t+` - `)+" "+e.join(`, - `)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}j.types=Nl();function zi(e){return Array.isArray(e)}j.isArray=zi;function so(e){return typeof e=="boolean"}j.isBoolean=so;function Kr(e){return e===null}j.isNull=Kr;function Ql(e){return e==null}j.isNullOrUndefined=Ql;function Zi(e){return typeof e=="number"}j.isNumber=Zi;function Jr(e){return typeof e=="string"}j.isString=Jr;function Gl(e){return typeof e=="symbol"}j.isSymbol=Gl;function gt(e){return e===void 0}j.isUndefined=gt;function er(e){return Ot(e)&&ao(e)==="[object RegExp]"}j.isRegExp=er;j.types.isRegExp=er;function Ot(e){return typeof e=="object"&&e!==null}j.isObject=Ot;function qr(e){return Ot(e)&&ao(e)==="[object Date]"}j.isDate=qr;j.types.isDate=qr;function tr(e){return Ot(e)&&(ao(e)==="[object Error]"||e instanceof Error)}j.isError=tr;j.types.isNativeError=tr;function Ur(e){return typeof e=="function"}j.isFunction=Ur;function Wl(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}j.isPrimitive=Wl;j.isBuffer=Bl();function ao(e){return Object.prototype.toString.call(e)}function to(e){return e<10?"0"+e.toString(10):e.toString(10)}var Hl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function zl(){var e=new Date,t=[to(e.getHours()),to(e.getMinutes()),to(e.getSeconds())].join(":");return[e.getDate(),Hl[e.getMonth()],t].join(" ")}j.log=function(){console.log("%s - %s",zl(),j.format.apply(j,arguments))};j.inherits=Ll();j._extend=function(e,t){if(!t||!Ot(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};function Yi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var mt=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;j.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(mt&&e[mt]){var t=e[mt];if(typeof t!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,mt,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var r,n,o=new Promise(function(a,u){r=a,n=u}),i=[],s=0;s{"use strict";d();p();f();var Ft=1e3,It=Ft*60,kt=It*60,yt=kt*24,Xl=yt*7,ec=yt*365.25;Xi.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return tc(e);if(r==="number"&&isFinite(e))return t.long?nc(e):rc(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function tc(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*ec;case"weeks":case"week":case"w":return r*Xl;case"days":case"day":case"d":return r*yt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*kt;case"minutes":case"minute":case"mins":case"min":case"m":return r*It;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ft;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function rc(e){var t=Math.abs(e);return t>=yt?Math.round(e/yt)+"d":t>=kt?Math.round(e/kt)+"h":t>=It?Math.round(e/It)+"m":t>=Ft?Math.round(e/Ft)+"s":e+"ms"}function nc(e){var t=Math.abs(e);return t>=yt?Qr(e,t,yt,"day"):t>=kt?Qr(e,t,kt,"hour"):t>=It?Qr(e,t,It,"minute"):t>=Ft?Qr(e,t,Ft,"second"):e+" ms"}function Qr(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var lo=z((zm,ts)=>{"use strict";d();p();f();function oc(e){r.debug=r,r.default=r,r.coerce=u,r.disable=i,r.enable=o,r.enabled=s,r.humanize=es(),r.destroy=l,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let m=0;for(let g=0;g{if(B==="%%")return"%";M++;let V=r.formatters[pe];if(typeof V=="function"){let W=T[M];B=V.call(R,W),T.splice(M,1),M--}return B}),r.formatArgs.call(R,T),(R.log||r.log).apply(R,T)}return x.namespace=c,x.useColors=r.useColors(),x.color=r.selectColor(c),x.extend=n,x.destroy=r.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(w!==r.namespaces&&(w=r.namespaces,E=r.enabled(c)),E),set:T=>{g=T}}),typeof r.init=="function"&&r.init(x),x}function n(c,m){let g=r(this.namespace+(typeof m=="undefined"?":":m)+c);return g.log=this.log,g}function o(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let m,g=(typeof c=="string"?c:"").split(/[\s,]+/),w=g.length;for(m=0;m"-"+m)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let m,g;for(m=0,g=r.skips.length;m{"use strict";d();p();f();ve.formatArgs=sc;ve.save=ac;ve.load=uc;ve.useColors=ic;ve.storage=lc();ve.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ve.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ic(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function sc(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Gr.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),e.splice(n,0,t)}ve.log=console.debug||console.log||(()=>{});function ac(e){try{e?ve.storage.setItem("debug",e):ve.storage.removeItem("debug")}catch(t){}}function uc(){let e;try{e=ve.storage.getItem("debug")}catch(t){}return!e&&typeof y!="undefined"&&"env"in y&&(e=y.env.DEBUG),e}function lc(){try{return localStorage}catch(e){}}Gr.exports=lo()(ve);var{formatters:cc}=Gr.exports;cc.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var co=z(Wr=>{"use strict";d();p();f();Wr.isatty=function(){return!1};function pc(){throw new Error("tty.ReadStream is not implemented")}Wr.ReadStream=pc;function fc(){throw new Error("tty.WriteStream is not implemented")}Wr.WriteStream=fc});var ns=z(()=>{"use strict";d();p();f()});var is=z((fg,os)=>{"use strict";d();p();f();os.exports=(e,t=y.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n{"use strict";d();p();f();var dc=ns(),ss=co(),Ce=is(),{env:te}=y,Ye;Ce("no-color")||Ce("no-colors")||Ce("color=false")||Ce("color=never")?Ye=0:(Ce("color")||Ce("colors")||Ce("color=true")||Ce("color=always"))&&(Ye=1);"FORCE_COLOR"in te&&(te.FORCE_COLOR==="true"?Ye=1:te.FORCE_COLOR==="false"?Ye=0:Ye=te.FORCE_COLOR.length===0?1:Math.min(parseInt(te.FORCE_COLOR,10),3));function po(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function fo(e,t){if(Ye===0)return 0;if(Ce("color=16m")||Ce("color=full")||Ce("color=truecolor"))return 3;if(Ce("color=256"))return 2;if(e&&!t&&Ye===void 0)return 0;let r=Ye||0;if(te.TERM==="dumb")return r;if(y.platform==="win32"){let n=dc.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in te)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in te)||te.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(te.TEAMCITY_VERSION)?1:0;if(te.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in te){let n=parseInt((te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(te.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(te.TERM)||"COLORTERM"in te?1:r}function mc(e){let t=fo(e,e&&e.isTTY);return po(t)}as.exports={supportsColor:mc,stdout:po(fo(!0,ss.isatty(1))),stderr:po(fo(!0,ss.isatty(2)))}});var cs=z((se,zr)=>{"use strict";d();p();f();var gc=co(),Hr=uo();se.init=Pc;se.log=bc;se.formatArgs=hc;se.save=wc;se.load=Ec;se.useColors=yc;se.destroy=Hr.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");se.colors=[6,2,3,4,5,1];try{let e=us();e&&(e.stderr||e).level>=2&&(se.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}se.inspectOpts=Object.keys(y.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),n=y.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function yc(){return"colors"in se.inspectOpts?!!se.inspectOpts.colors:gc.isatty(y.stderr.fd)}function hc(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(` -`).join(` -`+i),e.push(o+"m+"+zr.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=xc()+t+" "+e[0]}function xc(){return se.inspectOpts.hideDate?"":new Date().toISOString()+" "}function bc(...e){return y.stderr.write(Hr.format(...e)+` -`)}function wc(e){e?y.env.DEBUG=e:delete y.env.DEBUG}function Ec(){return y.env.DEBUG}function Pc(e){e.inspectOpts={};let t=Object.keys(se.inspectOpts);for(let r=0;rt.trim()).join(" ")};ls.O=function(e){return this.inspectOpts.colors=this.useColors,Hr.inspect(e,this.inspectOpts)}});var ps=z((vg,mo)=>{"use strict";d();p();f();typeof y=="undefined"||y.type==="renderer"||y.browser===!0||y.__nwjs?mo.exports=rs():mo.exports=cs()});function Cc(){return!1}var Mc,Rc,nn,yo=Dr(()=>{"use strict";d();p();f();Mc={},Rc={existsSync:Cc,promises:Mc},nn=Rc});var ho=z((cy,Ps)=>{"use strict";d();p();f();function De(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function Es(e,t){for(var r="",n=0,o=-1,i=0,s,a=0;a<=e.length;++a){if(a2){var u=r.lastIndexOf("/");if(u!==r.length-1){u===-1?(r="",n=0):(r=r.slice(0,u),n=r.length-1-r.lastIndexOf("/")),o=a,i=0;continue}}else if(r.length===2||r.length===1){r="",n=0,o=a,i=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),n=a-o-1;o=a,i=0}else s===46&&i!==-1?++i:i=-1}return r}function Sc(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}var Nt={resolve:function(){for(var e="",t=!1,r,n=arguments.length-1;n>=-1&&!t;n--){var o;n>=0?o=arguments[n]:(r===void 0&&(r=y.cwd()),o=r),De(o),o.length!==0&&(e=o+"/"+e,t=o.charCodeAt(0)===47)}return e=Es(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(De(e),e.length===0)return".";var t=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;return e=Es(e,!t),e.length===0&&!t&&(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return De(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t0&&(e===void 0?e=r:e+="/"+r)}return e===void 0?".":Nt.normalize(e)},relative:function(e,t){if(De(e),De(t),e===t||(e=Nt.resolve(e),t=Nt.resolve(t),e===t))return"";for(var r=1;ru){if(t.charCodeAt(i+c)===47)return t.slice(i+c+1);if(c===0)return t.slice(i+c)}else o>u&&(e.charCodeAt(r+c)===47?l=c:c===0&&(l=0));break}var m=e.charCodeAt(r+c),g=t.charCodeAt(i+c);if(m!==g)break;m===47&&(l=c)}var w="";for(c=r+l+1;c<=n;++c)(c===n||e.charCodeAt(c)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+t.slice(i+l):(i+=l,t.charCodeAt(i)===47&&++i,t.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(De(e),e.length===0)return".";for(var t=e.charCodeAt(0),r=t===47,n=-1,o=!0,i=e.length-1;i>=1;--i)if(t=e.charCodeAt(i),t===47){if(!o){n=i;break}}else o=!1;return n===-1?r?"/":".":r&&n===1?"//":e.slice(0,n)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');De(e);var r=0,n=-1,o=!0,i;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){var u=e.charCodeAt(i);if(u===47){if(!o){r=i+1;break}}else a===-1&&(o=!1,a=i+1),s>=0&&(u===t.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return r===n?n=a:n===-1&&(n=e.length),e.slice(r,n)}else{for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===47){if(!o){r=i+1;break}}else n===-1&&(o=!1,n=i+1);return n===-1?"":e.slice(r,n)}},extname:function(e){De(e);for(var t=-1,r=0,n=-1,o=!0,i=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(a===47){if(!o){r=s+1;break}continue}n===-1&&(o=!1,n=s+1),a===46?t===-1?t=s:i!==1&&(i=1):t!==-1&&(i=-1)}return t===-1||n===-1||i===0||i===1&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return Sc("/",e)},parse:function(e){De(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var r=e.charCodeAt(0),n=r===47,o;n?(t.root="/",o=1):o=0;for(var i=-1,s=0,a=-1,u=!0,l=e.length-1,c=0;l>=o;--l){if(r=e.charCodeAt(l),r===47){if(!u){s=l+1;break}continue}a===-1&&(u=!1,a=l+1),r===46?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||a===-1||c===0||c===1&&i===a-1&&i===s+1?a!==-1&&(s===0&&n?t.base=t.name=e.slice(1,a):t.base=t.name=e.slice(s,a)):(s===0&&n?(t.name=e.slice(1,i),t.base=e.slice(1,a)):(t.name=e.slice(s,i),t.base=e.slice(s,a)),t.ext=e.slice(i,a)),s>0?t.dir=e.slice(0,s-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Nt.posix=Nt;Ps.exports=Nt});var Ts=z((xy,As)=>{"use strict";d();p();f();As.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Ms=z((Py,Cs)=>{"use strict";d();p();f();var Fc=Ts();Cs.exports=e=>{let t=Fc(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Ss=z((Oy,wo)=>{"use strict";d();p();f();var Ic=Object.prototype.hasOwnProperty,de="~";function nr(){}Object.create&&(nr.prototype=Object.create(null),new nr().__proto__||(de=!1));function kc(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function Rs(e,t,r,n,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new kc(r,n||e,o),s=de?de+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],i]:e._events[s].push(i):(e._events[s]=i,e._eventsCount++),e}function on(e,t){--e._eventsCount===0?e._events=new nr:delete e._events[t]}function le(){this._events=new nr,this._eventsCount=0}le.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)Ic.call(t,r)&&e.push(de?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};le.prototype.listeners=function(e){var t=de?de+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,i=new Array(o);n{"use strict";d();p();f();Os.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Ds=z((qy,ks)=>{"use strict";d();p();f();ks.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Ns=z((Qy,_s)=>{"use strict";d();p();f();var Lc=Ds();_s.exports=e=>typeof e=="string"?e.replace(Lc(),""):e});var js=z(()=>{"use strict";d();p();f()});var Xo=z((nM,Xa)=>{"use strict";d();p();f();Xa.exports=function(){function e(t,r,n,o,i){return tn?n+1:t+1:o===i?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var o=t.length,i=r.length;o>0&&t.charCodeAt(o-1)===r.charCodeAt(i-1);)o--,i--;for(var s=0;sIi,getExtensionContext:()=>ki});d();p();f();d();p();f();function Ii(e){return typeof e=="function"?e:t=>t.$extends(e)}d();p();f();function ki(e){return e}var Ni={};_r(Ni,{validator:()=>_i});d();p();f();d();p();f();function _i(...e){return t=>t}var $i={};_r($i,{Extensions:()=>Bi,Public:()=>Li,Result:()=>ji,Utils:()=>Ui});d();p();f();var Bi={};d();p();f();var Li={};d();p();f();var ji={};d();p();f();var Ui={};d();p();f();d();p();f();d();p();f();var ze=(e,t)=>{let r={};for(let n of e){let o=n[t];r[o]=n}return r};function qi(e){return e.substring(0,1).toLowerCase()+e.substring(1)}var Xn=class{constructor(t){this.document=t;this.compositeNames=new Set(this.datamodel.types.map(r=>r.name)),this.typeAndModelMap=this.buildTypeModelMap(),this.mappingsMap=this.buildMappingsMap(),this.outputTypeMap=this.buildMergedOutputTypeMap(),this.rootFieldMap=this.buildRootFieldMap(),this.inputTypesByName=this.buildInputTypesMap()}get datamodel(){return this.document.datamodel}get mappings(){return this.document.mappings}get schema(){return this.document.schema}get inputObjectTypes(){return this.schema.inputObjectTypes}get outputObjectTypes(){return this.schema.outputObjectTypes}isComposite(t){return this.compositeNames.has(t)}getOtherOperationNames(){return[Object.values(this.mappings.otherOperations.write),Object.values(this.mappings.otherOperations.read)].flat()}hasEnumInNamespace(t,r){var n;return((n=this.schema.enumTypes[r])==null?void 0:n.find(o=>o.name===t))!==void 0}resolveInputObjectType(t){return this.inputTypesByName.get(Yn(t.type,t.namespace))}resolveOutputObjectType(t){var r;if(t.location==="outputObjectTypes")return this.outputObjectTypes[(r=t.namespace)!=null?r:"prisma"].find(n=>n.name===t.type)}buildModelMap(){return ze(this.datamodel.models,"name")}buildTypeMap(){return ze(this.datamodel.types,"name")}buildTypeModelMap(){return{...this.buildTypeMap(),...this.buildModelMap()}}buildMappingsMap(){return ze(this.mappings.modelOperations,"model")}buildMergedOutputTypeMap(){return{model:ze(this.schema.outputObjectTypes.model,"name"),prisma:ze(this.schema.outputObjectTypes.prisma,"name")}}buildRootFieldMap(){return{...ze(this.outputTypeMap.prisma.Query.fields,"name"),...ze(this.outputTypeMap.prisma.Mutation.fields,"name")}}buildInputTypesMap(){let t=new Map;for(let r of this.inputObjectTypes.prisma)t.set(Yn(r.name,"prisma"),r);if(!this.inputObjectTypes.model)return t;for(let r of this.inputObjectTypes.model)t.set(Yn(r.name,"model"),r);return t}};function Yn(e,t){return t?`${t}.${e}`:e}d();p();f();d();p();f();var Me;(t=>{let e;(C=>(C.findUnique="findUnique",C.findUniqueOrThrow="findUniqueOrThrow",C.findFirst="findFirst",C.findFirstOrThrow="findFirstOrThrow",C.findMany="findMany",C.create="create",C.createMany="createMany",C.update="update",C.updateMany="updateMany",C.upsert="upsert",C.delete="delete",C.deleteMany="deleteMany",C.groupBy="groupBy",C.count="count",C.aggregate="aggregate",C.findRaw="findRaw",C.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(Me||(Me={}));d();p();f();var Yr=Te(ps()),vc=100,Zr=[],fs,ds;typeof y!="undefined"&&typeof((fs=y.stderr)==null?void 0:fs.write)!="function"&&(Yr.default.log=(ds=console.debug)!=null?ds:console.log);function Ac(e){let t=(0,Yr.default)(e),r=Object.assign((...n)=>(t.log=r.log,n.length!==0&&Zr.push([e,...n]),Zr.length>vc&&Zr.shift(),t("",...n)),t);return r}var ms=Object.assign(Ac,Yr.default);function gs(){Zr.length=0}var xe=ms;d();p();f();var go,ys,hs,xs,bs=!0;typeof y!="undefined"&&({FORCE_COLOR:go,NODE_DISABLE_COLORS:ys,NO_COLOR:hs,TERM:xs}=y.env||{},bs=y.stdout&&y.stdout.isTTY);var Tc={enabled:!ys&&hs==null&&xs!=="dumb"&&(go!=null&&go!=="0"||bs)};function J(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,o=`\x1B[${t}m`;return function(i){return!Tc.enabled||i==null?i:n+(~(""+i).indexOf(o)?i.replace(r,o+n):i)+o}}var Fg=J(0,0),Xe=J(1,22),Xr=J(2,22),Ig=J(3,23),ws=J(4,24),kg=J(7,27),Dg=J(8,28),_g=J(9,29),Ng=J(30,39),Dt=J(31,39),en=J(32,39),tn=J(33,39),_t=J(34,39),Bg=J(35,39),et=J(36,39),Lg=J(37,39),rn=J(90,39),jg=J(90,39),Ug=J(40,49),$g=J(41,49),qg=J(42,49),Vg=J(43,49),Kg=J(44,49),Jg=J(45,49),Qg=J(46,49),Gg=J(47,49);d();p();f();d();p();f();d();p();f();d();p();f();var vs="library";function xo(e){let t=Oc();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":vs)}function Oc(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}d();p();f();var rr=Te(ho());function bo(e){return rr.default.sep===rr.default.posix.sep?e:e.split(rr.default.sep).join(rr.default.posix.sep)}var Bt={};_r(Bt,{error:()=>Nc,info:()=>_c,log:()=>Dc,query:()=>Bc,should:()=>Is,tags:()=>or,warn:()=>Eo});d();p();f();var or={error:Dt("prisma:error"),warn:tn("prisma:warn"),info:et("prisma:info"),query:_t("prisma:query")},Is={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function Dc(...e){console.log(...e)}function Eo(e,...t){Is.warn()&&console.warn(`${or.warn} ${e}`,...t)}function _c(e,...t){console.info(`${or.info} ${e}`,...t)}function Nc(e,...t){console.error(`${or.error} ${e}`,...t)}function Bc(e,...t){console.log(`${or.query} ${e}`,...t)}d();p();f();function ht(e,t){throw new Error(t)}d();p();f();function Po(e,t){return Object.prototype.hasOwnProperty.call(e,t)}d();p();f();var vo=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});d();p();f();function Lt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}d();p();f();function Ao(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{Bs.has(e)||(Bs.add(e),Eo(t,...r))};d();p();f();var me=class extends Error{constructor(r,{code:n,clientVersion:o,meta:i,batchRequestIdx:s}){super(r);this.name="PrismaClientKnownRequestError",this.code=n,this.clientVersion=o,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:s,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};k(me,"PrismaClientKnownRequestError");var tt=class extends me{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};k(tt,"NotFoundError");d();p();f();var ae=class e extends Error{constructor(r,n,o){super(r);this.name="PrismaClientInitializationError",this.clientVersion=n,this.errorCode=o,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};k(ae,"PrismaClientInitializationError");d();p();f();var rt=class extends Error{constructor(r,n){super(r);this.name="PrismaClientRustPanicError",this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};k(rt,"PrismaClientRustPanicError");d();p();f();var Re=class extends Error{constructor(r,{clientVersion:n,batchRequestIdx:o}){super(r);this.name="PrismaClientUnknownRequestError",this.clientVersion=n,Object.defineProperty(this,"batchRequestIdx",{value:o,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};k(Re,"PrismaClientUnknownRequestError");d();p();f();var ge=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};k(ge,"PrismaClientValidationError");d();p();f();var ir=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};d();p();f();d();p();f();function sr(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function jc(e,t){let r=sr(()=>Uc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Uc(e){return{datamodel:{models:To(e.models),enums:To(e.enums),types:To(e.types)}}}function To(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}d();p();f();var a2=Te(js()),$u=Te(Ss());yo();var kr=Te(ho());d();p();f();var Ae=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let o=0,i=0;for(;oe.getPropertyValue(r))},getPropertyDescriptor(r){var n;return(n=e.getPropertyDescriptor)==null?void 0:n.call(e,r)}}}d();p();f();var Ks=Te(uo());d();p();f();var an={enumerable:!0,configurable:!0,writable:!0};function un(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>an,has:(r,n)=>t.has(n),set:(r,n,o)=>t.add(n)&&Reflect.set(r,n,o),ownKeys:()=>[...t]}}var qs=Symbol.for("nodejs.util.inspect.custom");function Ne(e,t){let r=Vc(t),n=new Set,o=new Proxy(e,{get(i,s){if(n.has(s))return i[s];let a=r.get(s);return a?a.getPropertyValue(s):i[s]},has(i,s){var u,l;if(n.has(s))return!0;let a=r.get(s);return a?(l=(u=a.has)==null?void 0:u.call(a,s))!=null?l:!0:Reflect.has(i,s)},ownKeys(i){let s=Vs(Reflect.ownKeys(i),r),a=Vs(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(i,s,a){var l,c;let u=r.get(s);return((c=(l=u==null?void 0:u.getPropertyDescriptor)==null?void 0:l.call(u,s))==null?void 0:c.writable)===!1?!1:(n.add(s),Reflect.set(i,s,a))},getOwnPropertyDescriptor(i,s){let a=Reflect.getOwnPropertyDescriptor(i,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...an,...u==null?void 0:u.getPropertyDescriptor(s)}:an:a},defineProperty(i,s,a){return n.add(s),Reflect.defineProperty(i,s,a)}});return o[qs]=function(i,s,a=Ks.inspect){let u={...this};return delete u[qs],a(u,s)},o}function Vc(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let o of n)t.set(o,r)}return t}function Vs(e,t){return e.filter(r=>{var o,i;let n=t.get(r);return(i=(o=n==null?void 0:n.has)==null?void 0:o.call(n,r))!=null?i:!0})}d();p();f();function ur(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}d();p();f();d();p();f();var jt=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};d();p();f();d();p();f();var ln=Symbol(),Co=new WeakMap,qe=class{constructor(t){t===ln?Co.set(this,`Prisma.${this._getName()}`):Co.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Co.get(this)}},lr=class extends qe{_getNamespace(){return"NullTypes"}},cr=class extends lr{};Ro(cr,"DbNull");var pr=class extends lr{};Ro(pr,"JsonNull");var fr=class extends lr{};Ro(fr,"AnyNull");var Mo={classes:{DbNull:cr,JsonNull:pr,AnyNull:fr},instances:{DbNull:new cr(ln),JsonNull:new pr(ln),AnyNull:new fr(ln)}};function Ro(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}d();p();f();function Ut(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function cn(e){return e.toString()!=="Invalid Date"}d();p();f();d();p();f();var $t=9e15,st=1e9,So="0123456789abcdef",fn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",dn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Oo={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-$t,maxE:$t,crypto:!1},Ws,Ve,D=!0,gn="[DecimalError] ",it=gn+"Invalid argument: ",Hs=gn+"Precision limit exceeded",zs=gn+"crypto unavailable",Zs="[object Decimal]",ce=Math.floor,X=Math.pow,Kc=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Jc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Qc=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ys=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Oe=1e7,I=7,Gc=9007199254740991,Wc=fn.length-1,Fo=dn.length-1,v={toStringTag:Zs};v.absoluteValue=v.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),F(e)};v.ceil=function(){return F(new this.constructor(this),this.e+1,2)};v.clampedTo=v.clamp=function(e,t){var r,n=this,o=n.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(it+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new o(n)};v.comparedTo=v.cmp=function(e){var t,r,n,o,i=this,s=i.d,a=(e=new i.constructor(e)).d,u=i.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(i.e!==e.e)return i.e>e.e^u<0?1:-1;for(n=s.length,o=a.length,t=0,r=na[t]^u<0?1:-1;return n===o?0:n>o^u<0?1:-1};v.cosine=v.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+I,n.rounding=1,r=Hc(n,na(n,r)),n.precision=e,n.rounding=t,F(Ve==2||Ve==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};v.cubeRoot=v.cbrt=function(){var e,t,r,n,o,i,s,a,u,l,c=this,m=c.constructor;if(!c.isFinite()||c.isZero())return new m(c);for(D=!1,i=c.s*X(c.s*c,1/3),!i||Math.abs(i)==1/0?(r=ue(c.d),e=c.e,(i=(e-r.length+1)%3)&&(r+=i==1||i==-2?"0":"00"),i=X(r,1/3),e=ce((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?r="5e"+e:(r=i.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new m(r),n.s=c.s):n=new m(i.toString()),s=(e=m.precision)+3;;)if(a=n,u=a.times(a).times(a),l=u.plus(c),n=K(l.plus(c).times(a),l.plus(u),s+2,1),ue(a.d).slice(0,s)===(r=ue(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!o&&r=="4999"){if(!o&&(F(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,o=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(F(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return D=!0,F(n,e,m.rounding,t)};v.decimalPlaces=v.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ce(this.e/I))*I,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};v.dividedBy=v.div=function(e){return K(this,new this.constructor(e))};v.dividedToIntegerBy=v.divToInt=function(e){var t=this,r=t.constructor;return F(K(t,new r(e),0,1,1),r.precision,r.rounding)};v.equals=v.eq=function(e){return this.cmp(e)===0};v.floor=function(){return F(new this.constructor(this),this.e+1,3)};v.greaterThan=v.gt=function(e){return this.cmp(e)>0};v.greaterThanOrEqualTo=v.gte=function(e){var t=this.cmp(e);return t==1||t===0};v.hyperbolicCosine=v.cosh=function(){var e,t,r,n,o,i=this,s=i.constructor,a=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(i.e,i.sd())+4,s.rounding=1,o=i.d.length,o<32?(e=Math.ceil(o/3),t=(1/hn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),i=qt(s,1,i.times(t),new s(1),!0);for(var u,l=e,c=new s(8);l--;)u=i.times(i),i=a.minus(u.times(c.minus(u.times(c))));return F(i,s.precision=r,s.rounding=n,!0)};v.hyperbolicSine=v.sinh=function(){var e,t,r,n,o=this,i=o.constructor;if(!o.isFinite()||o.isZero())return new i(o);if(t=i.precision,r=i.rounding,i.precision=t+Math.max(o.e,o.sd())+4,i.rounding=1,n=o.d.length,n<3)o=qt(i,2,o,o,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,o=o.times(1/hn(5,e)),o=qt(i,2,o,o,!0);for(var s,a=new i(5),u=new i(16),l=new i(20);e--;)s=o.times(o),o=o.times(a.plus(s.times(u.times(s).plus(l))))}return i.precision=t,i.rounding=r,F(o,t,r,!0)};v.hyperbolicTangent=v.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,K(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};v.inverseCosine=v.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),o=r.precision,i=r.rounding;return n!==-1?n===0?t.isNeg()?Se(r,o,i):new r(0):new r(NaN):t.isZero()?Se(r,o+4,i).times(.5):(r.precision=o+6,r.rounding=1,t=t.asin(),e=Se(r,o+4,i).times(.5),r.precision=o,r.rounding=i,e.minus(t))};v.inverseHyperbolicCosine=v.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,D=!1,r=r.times(r).minus(1).sqrt().plus(r),D=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};v.inverseHyperbolicSine=v.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,D=!1,r=r.times(r).plus(1).sqrt().plus(r),D=!0,n.precision=e,n.rounding=t,r.ln())};v.inverseHyperbolicTangent=v.atanh=function(){var e,t,r,n,o=this,i=o.constructor;return o.isFinite()?o.e>=0?new i(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=i.precision,t=i.rounding,n=o.sd(),Math.max(n,e)<2*-o.e-1?F(new i(o),e,t,!0):(i.precision=r=n-o.e,o=K(o.plus(1),new i(1).minus(o),r+e,1),i.precision=e+4,i.rounding=1,o=o.ln(),i.precision=e,i.rounding=t,o.times(.5))):new i(NaN)};v.inverseSine=v.asin=function(){var e,t,r,n,o=this,i=o.constructor;return o.isZero()?new i(o):(t=o.abs().cmp(1),r=i.precision,n=i.rounding,t!==-1?t===0?(e=Se(i,r+4,n).times(.5),e.s=o.s,e):new i(NaN):(i.precision=r+6,i.rounding=1,o=o.div(new i(1).minus(o.times(o)).sqrt().plus(1)).atan(),i.precision=r,i.rounding=n,o.times(2)))};v.inverseTangent=v.atan=function(){var e,t,r,n,o,i,s,a,u,l=this,c=l.constructor,m=c.precision,g=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&m+4<=Fo)return s=Se(c,m+4,g).times(.25),s.s=l.s,s}else{if(!l.s)return new c(NaN);if(m+4<=Fo)return s=Se(c,m+4,g).times(.5),s.s=l.s,s}for(c.precision=a=m+10,c.rounding=1,r=Math.min(28,a/I+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(D=!1,t=Math.ceil(a/I),n=1,u=l.times(l),s=new c(l),o=l;e!==-1;)if(o=o.times(u),i=s.minus(o.div(n+=2)),o=o.times(u),s=i.plus(o.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===i.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};v.isNaN=function(){return!this.s};v.isNegative=v.isNeg=function(){return this.s<0};v.isPositive=v.isPos=function(){return this.s>0};v.isZero=function(){return!!this.d&&this.d[0]===0};v.lessThan=v.lt=function(e){return this.cmp(e)<0};v.lessThanOrEqualTo=v.lte=function(e){return this.cmp(e)<1};v.logarithm=v.log=function(e){var t,r,n,o,i,s,a,u,l=this,c=l.constructor,m=c.precision,g=c.rounding,w=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new c(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)i=!0;else{for(o=r[0];o%10===0;)o/=10;i=o!==1}if(D=!1,a=m+w,s=ot(l,a),n=t?mn(c,a+10):ot(e,a),u=K(s,n,a,1),dr(u.d,o=m,g))do if(a+=10,s=ot(l,a),n=t?mn(c,a+10):ot(e,a),u=K(s,n,a,1),!i){+ue(u.d).slice(o+1,o+15)+1==1e14&&(u=F(u,m+1,0));break}while(dr(u.d,o+=10,g));return D=!0,F(u,m,g)};v.minus=v.sub=function(e){var t,r,n,o,i,s,a,u,l,c,m,g,w=this,E=w.constructor;if(e=new E(e),!w.d||!e.d)return!w.s||!e.s?e=new E(NaN):w.d?e.s=-e.s:e=new E(e.d||w.s!==e.s?w:NaN),e;if(w.s!=e.s)return e.s=-e.s,w.plus(e);if(l=w.d,g=e.d,a=E.precision,u=E.rounding,!l[0]||!g[0]){if(g[0])e.s=-e.s;else if(l[0])e=new E(w);else return new E(u===3?-0:0);return D?F(e,a,u):e}if(r=ce(e.e/I),c=ce(w.e/I),l=l.slice(),i=c-r,i){for(m=i<0,m?(t=l,i=-i,s=g.length):(t=g,r=c,s=l.length),n=Math.max(Math.ceil(a/I),s)+2,i>n&&(i=n,t.length=1),t.reverse(),n=i;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=g.length,m=n0;--n)l[s++]=0;for(n=g.length;n>i;){if(l[--n]s?i+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),t=0;o;)t=(l[--o]=l[o]+c[o]+t)/Oe|0,l[o]%=Oe;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=yn(l,n),D?F(e,a,u):e};v.precision=v.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(it+e);return r.d?(t=Xs(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};v.round=function(){var e=this,t=e.constructor;return F(new t(e),e.e+1,t.rounding)};v.sine=v.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+I,n.rounding=1,r=Zc(n,na(n,r)),n.precision=e,n.rounding=t,F(Ve>2?r.neg():r,e,t,!0)):new n(NaN)};v.squareRoot=v.sqrt=function(){var e,t,r,n,o,i,s=this,a=s.d,u=s.e,l=s.s,c=s.constructor;if(l!==1||!a||!a[0])return new c(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(D=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=ue(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=ce((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new c(t)):n=new c(l.toString()),r=(u=c.precision)+3;;)if(i=n,n=i.plus(K(s,i,r+2,1)).times(.5),ue(i.d).slice(0,r)===(t=ue(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!o&&t=="4999"){if(!o&&(F(i,u+1,0),i.times(i).eq(s))){n=i;break}r+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(F(n,u+1,1),e=!n.times(n).eq(s));break}return D=!0,F(n,u,c.rounding,e)};v.tangent=v.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=K(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,F(Ve==2||Ve==4?r.neg():r,e,t,!0)):new n(NaN)};v.times=v.mul=function(e){var t,r,n,o,i,s,a,u,l,c=this,m=c.constructor,g=c.d,w=(e=new m(e)).d;if(e.s*=c.s,!g||!g[0]||!w||!w[0])return new m(!e.s||g&&!g[0]&&!w||w&&!w[0]&&!g?NaN:!g||!w?e.s/0:e.s*0);for(r=ce(c.e/I)+ce(e.e/I),u=g.length,l=w.length,u=0;){for(t=0,o=u+n;o>n;)a=i[o]+w[n]*g[o-n-1]+t,i[o--]=a%Oe|0,t=a/Oe|0;i[o]=(i[o]+t)%Oe|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=yn(i,r),D?F(e,m.precision,m.rounding):e};v.toBinary=function(e,t){return Do(this,2,e,t)};v.toDecimalPlaces=v.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(be(e,0,st),t===void 0?t=n.rounding:be(t,0,8),F(r,e+r.e+1,t))};v.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Be(n,!0):(be(e,0,st),t===void 0?t=o.rounding:be(t,0,8),n=F(new o(n),e+1,t),r=Be(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};v.toFixed=function(e,t){var r,n,o=this,i=o.constructor;return e===void 0?r=Be(o):(be(e,0,st),t===void 0?t=i.rounding:be(t,0,8),n=F(new i(o),e+o.e+1,t),r=Be(n,!1,e+n.e+1)),o.isNeg()&&!o.isZero()?"-"+r:r};v.toFraction=function(e){var t,r,n,o,i,s,a,u,l,c,m,g,w=this,E=w.d,x=w.constructor;if(!E)return new x(w);if(l=r=new x(1),n=u=new x(0),t=new x(n),i=t.e=Xs(E)-w.e-1,s=i%I,t.d[0]=X(10,s<0?I+s:s),e==null)e=i>0?t:l;else{if(a=new x(e),!a.isInt()||a.lt(l))throw Error(it+a);e=a.gt(t)?i>0?t:l:a}for(D=!1,a=new x(ue(E)),c=x.precision,x.precision=i=E.length*I*2;m=K(a,t,0,1,1),o=r.plus(m.times(n)),o.cmp(e)!=1;)r=n,n=o,o=l,l=u.plus(m.times(o)),u=o,o=t,t=a.minus(m.times(o)),a=o;return o=K(e.minus(r),n,0,1,1),u=u.plus(o.times(l)),r=r.plus(o.times(n)),u.s=l.s=w.s,g=K(l,n,i,1).minus(w).abs().cmp(K(u,r,i,1).minus(w).abs())<1?[l,n]:[u,r],x.precision=c,D=!0,g};v.toHexadecimal=v.toHex=function(e,t){return Do(this,16,e,t)};v.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:be(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(D=!1,r=K(r,e,0,t,1).times(e),D=!0,F(r)):(e.s=r.s,r=e),r};v.toNumber=function(){return+this};v.toOctal=function(e,t){return Do(this,8,e,t)};v.toPower=v.pow=function(e){var t,r,n,o,i,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(X(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,i=u.rounding,e.eq(1))return F(a,n,i);if(t=ce(e.e/I),t>=e.d.length-1&&(r=l<0?-l:l)<=Gc)return o=ea(u,a,r,n),e.s<0?new u(1).div(o):F(o,n,i);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(D=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),o=Io(e.times(ot(a,n+r)),n),o.d&&(o=F(o,n+5,1),dr(o.d,n,i)&&(t=n+10,o=F(Io(e.times(ot(a,t+r)),t),t+5,1),+ue(o.d).slice(n+1,n+15)+1==1e14&&(o=F(o,n+1,0)))),o.s=s,D=!0,u.rounding=i,F(o,n,i))};v.toPrecision=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Be(n,n.e<=o.toExpNeg||n.e>=o.toExpPos):(be(e,1,st),t===void 0?t=o.rounding:be(t,0,8),n=F(new o(n),e,t),r=Be(n,e<=n.e||n.e<=o.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};v.toSignificantDigits=v.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(be(e,1,st),t===void 0?t=n.rounding:be(t,0,8)),F(new n(r),e,t)};v.toString=function(){var e=this,t=e.constructor,r=Be(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};v.truncated=v.trunc=function(){return F(new this.constructor(this),this.e+1,1)};v.valueOf=v.toJSON=function(){var e=this,t=e.constructor,r=Be(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function ue(e){var t,r,n,o=e.length-1,i="",s=e[0];if(o>0){for(i+=s,t=1;tr)throw Error(it+e)}function dr(e,t,r,n){var o,i,s,a;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=I,o=0):(o=Math.ceil((t+1)/I),t%=I),i=X(10,I-t),a=e[o]%i|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==i||r>3&&a+1==i/2)&&(e[o+1]/i/100|0)==X(10,t-2)-1||(a==i/2||a==0)&&(e[o+1]/i/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==i||!n&&r>3&&a+1==i/2)&&(e[o+1]/i/1e3|0)==X(10,t-3)-1,s}function pn(e,t,r){for(var n,o=[0],i,s=0,a=e.length;sr-1&&(o[n+1]===void 0&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function Hc(e,t){var r,n,o;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),o=(1/hn(4,r)).toString()):(r=16,o="2.3283064365386962890625e-10"),e.precision+=r,t=qt(e,1,t.times(o),new e(1));for(var i=r;i--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var K=function(){function e(n,o,i){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*o+a,n[u]=s%i|0,a=s/i|0;return a&&n.unshift(a),n}function t(n,o,i,s){var a,u;if(i!=s)u=i>s?1:-1;else for(a=u=0;ao[a]?1:-1;break}return u}function r(n,o,i,s){for(var a=0;i--;)n[i]-=a,a=n[i]1;)n.shift()}return function(n,o,i,s,a,u){var l,c,m,g,w,E,x,T,R,S,C,M,N,B,pe,V,W,Ee,H,Pe,Qe=n.constructor,$=n.s==o.s?1:-1,U=n.d,O=o.d;if(!U||!U[0]||!O||!O[0])return new Qe(!n.s||!o.s||(U?O&&U[0]==O[0]:!O)?NaN:U&&U[0]==0||!O?$*0:$/0);for(u?(w=1,c=n.e-o.e):(u=Oe,w=I,c=ce(n.e/w)-ce(o.e/w)),H=O.length,W=U.length,R=new Qe($),S=R.d=[],m=0;O[m]==(U[m]||0);m++);if(O[m]>(U[m]||0)&&c--,i==null?(B=i=Qe.precision,s=Qe.rounding):a?B=i+(n.e-o.e)+1:B=i,B<0)S.push(1),E=!0;else{if(B=B/w+2|0,m=0,H==1){for(g=0,O=O[0],B++;(m1&&(O=e(O,g,u),U=e(U,g,u),H=O.length,W=U.length),V=H,C=U.slice(0,H),M=C.length;M=u/2&&++Ee;do g=0,l=t(O,C,H,M),l<0?(N=C[0],H!=M&&(N=N*u+(C[1]||0)),g=N/Ee|0,g>1?(g>=u&&(g=u-1),x=e(O,g,u),T=x.length,M=C.length,l=t(x,C,T,M),l==1&&(g--,r(x,H=10;g/=10)m++;R.e=m+c*w-1,F(R,a?i+R.e+1:i,s,E)}return R}}();function F(e,t,r,n){var o,i,s,a,u,l,c,m,g,w=e.constructor;e:if(t!=null){if(m=e.d,!m)return e;for(o=1,a=m[0];a>=10;a/=10)o++;if(i=t-o,i<0)i+=I,s=t,c=m[g=0],u=c/X(10,o-s-1)%10|0;else if(g=Math.ceil((i+1)/I),a=m.length,g>=a)if(n){for(;a++<=g;)m.push(0);c=u=0,o=1,i%=I,s=i-I+1}else break e;else{for(c=a=m[g],o=1;a>=10;a/=10)o++;i%=I,s=i-I+o,u=s<0?0:c/X(10,o-s-1)%10|0}if(n=n||t<0||m[g+1]!==void 0||(s<0?c:c%X(10,o-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(i>0?s>0?c/X(10,o-s):0:m[g-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,l?(t-=e.e+1,m[0]=X(10,(I-t%I)%I),e.e=-t||0):m[0]=e.e=0,e;if(i==0?(m.length=g,a=1,g--):(m.length=g+1,a=X(10,I-i),m[g]=s>0?(c/X(10,o-s)%X(10,s)|0)*a:0),l)for(;;)if(g==0){for(i=1,s=m[0];s>=10;s/=10)i++;for(s=m[0]+=a,a=1;s>=10;s/=10)a++;i!=a&&(e.e++,m[0]==Oe&&(m[0]=1));break}else{if(m[g]+=a,m[g]!=Oe)break;m[g--]=0,a=1}for(i=m.length;m[--i]===0;)m.pop()}return D&&(e.e>w.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+nt(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):o<0?(i="0."+nt(-o-1)+i,r&&(n=r-s)>0&&(i+=nt(n))):o>=s?(i+=nt(o+1-s),r&&(n=r-o-1)>0&&(i=i+"."+nt(n))):((n=o+1)0&&(o+1===s&&(i+="."),i+=nt(n))),i}function yn(e,t){var r=e[0];for(t*=I;r>=10;r/=10)t++;return t}function mn(e,t,r){if(t>Wc)throw D=!0,r&&(e.precision=r),Error(Hs);return F(new e(fn),t,1,!0)}function Se(e,t,r){if(t>Fo)throw Error(Hs);return F(new e(dn),t,r,!0)}function Xs(e){var t=e.length-1,r=t*I+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function nt(e){for(var t="";e--;)t+="0";return t}function ea(e,t,r,n){var o,i=new e(1),s=Math.ceil(n/I+4);for(D=!1;;){if(r%2&&(i=i.times(t),Qs(i.d,s)&&(o=!0)),r=ce(r/2),r===0){r=i.d.length-1,o&&i.d[r]===0&&++i.d[r];break}t=t.times(t),Qs(t.d,s)}return D=!0,i}function Js(e){return e.d[e.d.length-1]&1}function ta(e,t,r){for(var n,o=new e(t[0]),i=0;++i17)return new g(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(D=!1,u=E):u=t,a=new g(.03125);e.e>-2;)e=e.times(a),m+=5;for(n=Math.log(X(2,m))/Math.LN10*2+5|0,u+=n,r=i=s=new g(1),g.precision=u;;){if(i=F(i.times(e),u,1),r=r.times(++c),a=s.plus(K(i,r,u,1)),ue(a.d).slice(0,u)===ue(s.d).slice(0,u)){for(o=m;o--;)s=F(s.times(s),u,1);if(t==null)if(l<3&&dr(s.d,u-n,w,l))g.precision=u+=10,r=i=a=new g(1),c=0,l++;else return F(s,g.precision=E,w,D=!0);else return g.precision=E,s}s=a}}function ot(e,t){var r,n,o,i,s,a,u,l,c,m,g,w=1,E=10,x=e,T=x.d,R=x.constructor,S=R.rounding,C=R.precision;if(x.s<0||!T||!T[0]||!x.e&&T[0]==1&&T.length==1)return new R(T&&!T[0]?-1/0:x.s!=1?NaN:T?0:x);if(t==null?(D=!1,c=C):c=t,R.precision=c+=E,r=ue(T),n=r.charAt(0),Math.abs(i=x.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)x=x.times(e),r=ue(x.d),n=r.charAt(0),w++;i=x.e,n>1?(x=new R("0."+r),i++):x=new R(n+"."+r.slice(1))}else return l=mn(R,c+2,C).times(i+""),x=ot(new R(n+"."+r.slice(1)),c-E).plus(l),R.precision=C,t==null?F(x,C,S,D=!0):x;for(m=x,u=s=x=K(x.minus(1),x.plus(1),c,1),g=F(x.times(x),c,1),o=3;;){if(s=F(s.times(g),c,1),l=u.plus(K(s,new R(o),c,1)),ue(l.d).slice(0,c)===ue(u.d).slice(0,c))if(u=u.times(2),i!==0&&(u=u.plus(mn(R,c+2,C).times(i+""))),u=K(u,new R(w),c,1),t==null)if(dr(u.d,c-E,S,a))R.precision=c+=E,l=s=x=K(m.minus(1),m.plus(1),c,1),g=F(x.times(x),c,1),o=a=1;else return F(u,R.precision=C,S,D=!0);else return R.precision=C,u;u=l,o+=2}}function ra(e){return String(e.s*e.s/0)}function ko(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(n,o),t){if(o-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%I,r<0&&(n+=I),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Ys.test(t))return ko(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Jc.test(t))r=16,t=t.toLowerCase();else if(Kc.test(t))r=2;else if(Qc.test(t))r=8;else throw Error(it+t);for(i=t.search(/p/i),i>0?(u=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),i=t.indexOf("."),s=i>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,i=a-i,o=ea(n,new n(r),i,i*2)),l=pn(t,r,Oe),c=l.length-1,i=c;l[i]===0;--i)l.pop();return i<0?new n(e.s*0):(e.e=yn(l,c),e.d=l,D=!1,s&&(e=K(e,o,a*4)),u&&(e=e.times(Math.abs(u)<54?X(2,u):bt.pow(2,u))),D=!0,e)}function Zc(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:qt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/hn(5,r)),t=qt(e,2,t,t);for(var o,i=new e(5),s=new e(16),a=new e(20);r--;)o=t.times(t),t=t.times(i.plus(o.times(s.times(o).minus(a))));return t}function qt(e,t,r,n,o){var i,s,a,u,l=1,c=e.precision,m=Math.ceil(c/I);for(D=!1,u=r.times(r),a=new e(n);;){if(s=K(a.times(u),new e(t++*t++),c,1),a=o?n.plus(s):n.minus(s),n=K(s.times(u),new e(t++*t++),c,1),s=a.plus(n),s.d[m]!==void 0){for(i=m;s.d[i]===a.d[i]&&i--;);if(i==-1)break}i=a,a=n,n=s,s=i,l++}return D=!0,s.d.length=m+1,s}function hn(e,t){for(var r=e;--t;)r*=e;return r}function na(e,t){var r,n=t.s<0,o=Se(e,e.precision,1),i=o.times(.5);if(t=t.abs(),t.lte(i))return Ve=n?4:1,t;if(r=t.divToInt(o),r.isZero())Ve=n?3:2;else{if(t=t.minus(r.times(o)),t.lte(i))return Ve=Js(r)?n?2:3:n?4:1,t;Ve=Js(r)?n?1:4:n?3:2}return t.minus(o).abs()}function Do(e,t,r,n){var o,i,s,a,u,l,c,m,g,w=e.constructor,E=r!==void 0;if(E?(be(r,1,st),n===void 0?n=w.rounding:be(n,0,8)):(r=w.precision,n=w.rounding),!e.isFinite())c=ra(e);else{for(c=Be(e),s=c.indexOf("."),E?(o=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):o=t,s>=0&&(c=c.replace(".",""),g=new w(1),g.e=c.length-s,g.d=pn(Be(g),10,o),g.e=g.d.length),m=pn(c,10,o),i=u=m.length;m[--u]==0;)m.pop();if(!m[0])c=E?"0p+0":"0";else{if(s<0?i--:(e=new w(e),e.d=m,e.e=i,e=K(e,g,r,n,0,o),m=e.d,i=e.e,l=Ws),s=m[r],a=o/2,l=l||m[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&m[r-1]&1||n===(e.s<0?8:7)),m.length=r,l)for(;++m[--r]>o-1;)m[r]=0,r||(++i,m.unshift(1));for(u=m.length;!m[u-1];--u);for(s=0,c="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)c+="0";for(m=pn(c,o,t),u=m.length;!m[u-1];--u);for(s=1,c="1.";su)for(i-=u;i--;)c+="0";else it)return e.length=t,!0}function Yc(e){return new this(e).abs()}function Xc(e){return new this(e).acos()}function ep(e){return new this(e).acosh()}function tp(e,t){return new this(e).plus(t)}function rp(e){return new this(e).asin()}function np(e){return new this(e).asinh()}function op(e){return new this(e).atan()}function ip(e){return new this(e).atanh()}function sp(e,t){e=new this(e),t=new this(t);var r,n=this.precision,o=this.rounding,i=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Se(this,i,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Se(this,n,o):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Se(this,i,1).times(.5),r.s=e.s):t.s<0?(this.precision=i,this.rounding=1,r=this.atan(K(e,t,i,1)),t=Se(this,i,1),this.precision=n,this.rounding=o,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(K(e,t,i,1)),r}function ap(e){return new this(e).cbrt()}function up(e){return F(e=new this(e),e.e+1,2)}function lp(e,t,r){return new this(e).clamp(t,r)}function cp(e){if(!e||typeof e!="object")throw Error(gn+"Object expected");var t,r,n,o=e.defaults===!0,i=["precision",1,st,"rounding",0,8,"toExpNeg",-$t,0,"toExpPos",0,$t,"maxE",0,$t,"minE",-$t,0,"modulo",0,9];for(t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(it+r+": "+n);if(r="crypto",o&&(this[r]=Oo[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(zs);else this[r]=!1;else throw Error(it+r+": "+n);return this}function pp(e){return new this(e).cos()}function fp(e){return new this(e).cosh()}function oa(e){var t,r,n;function o(i){var s,a,u,l=this;if(!(l instanceof o))return new o(i);if(l.constructor=o,Gs(i)){l.s=i.s,D?!i.d||i.e>o.maxE?(l.e=NaN,l.d=null):i.e=10;a/=10)s++;D?s>o.maxE?(l.e=NaN,l.d=null):s=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:a[i++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);i=214e7?crypto.randomBytes(4).copy(t,i):(a.push(o%1e7),i+=4);i=n/4}else throw Error(zs);else for(;i=10;o/=10)n++;n`}};function Kt(e){return e instanceof mr}d();p();f();d();p();f();var xn=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};d();p();f();var bn=e=>e,wn={bold:bn,red:bn,green:bn,dim:bn},ia={bold:Xe,red:Dt,green:en,dim:Xr},Jt={write(e){e.writeLine(",")}};d();p();f();var Le=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};d();p();f();var at=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var Qt=class extends at{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new xn(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Le("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Jt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}};d();p();f();var sa=": ",En=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+sa.length}write(t){let r=new Le(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(sa).write(this.value)}};d();p();f();var re=class e extends at{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...o]=r,i=this.getField(n);if(!i)return;let s=i;for(let a of o){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof Qt&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){var n;return r.length===0?this:(n=this.getDeepField(r))==null?void 0:n.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){var n;return(n=this.getField(r))==null?void 0:n.value}getDeepSubSelectionValue(r){let n=this;for(let o of r){if(!(n instanceof e))return;let i=n.getSubSelectionValue(o);if(!i)return;n=i}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let o=n;for(let i of r){let s=o.value.getFieldValue(i);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;o=a}return o}getSelectionParent(){let r=this.getField("select");if((r==null?void 0:r.value)instanceof e)return{kind:"select",value:r.value};let n=this.getField("include");if((n==null?void 0:n.value)instanceof e)return{kind:"include",value:n.value}}getSubSelectionValue(r){var n;return(n=this.getSelectionParent())==null?void 0:n.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(o=>o.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}writeEmpty(r){let n=new Le("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(Jt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};d();p();f();var ne=class extends at{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Le(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}};var _o=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Pn(e){return new _o(aa(e))}function aa(e){let t=new re;for(let[r,n]of Object.entries(e)){let o=new En(r,ua(n));t.addField(o)}return t}function ua(e){if(typeof e=="string")return new ne(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new ne(String(e));if(typeof e=="bigint")return new ne(`${e}n`);if(e===null)return new ne("null");if(e===void 0)return new ne("undefined");if(Vt(e))return new ne(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return b.Buffer.isBuffer(e)?new ne(`Buffer.alloc(${e.byteLength})`):new ne(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=cn(e)?e.toISOString():"Invalid Date";return new ne(`new Date("${t}")`)}return e instanceof qe?new ne(`Prisma.${e._getName()}`):Kt(e)?new ne(`prisma.${qi(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Lp(e):typeof e=="object"?aa(e):new ne(Object.prototype.toString.call(e))}function Lp(e){let t=new Qt;for(let r of e)t.addItem(ua(r));return t}function la(e){if(e===void 0)return"";let t=Pn(e);return new jt(0,{colors:wn}).write(t).toString()}d();p();f();d();p();f();d();p();f();d();p();f();d();p();f();var gr="";function ca(e){var t=e.split(` -`);return t.reduce(function(r,n){var o=$p(n)||Vp(n)||Qp(n)||zp(n)||Wp(n);return o&&r.push(o),r},[])}var jp=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Up=/\((\S*)(?::(\d+))(?::(\d+))\)/;function $p(e){var t=jp.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,o=Up.exec(t[2]);return n&&o!=null&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]),{file:r?null:t[2],methodName:t[1]||gr,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var qp=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Vp(e){var t=qp.exec(e);return t?{file:t[2],methodName:t[1]||gr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Kp=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Jp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Qp(e){var t=Kp.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Jp.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||gr,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Gp=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Wp(e){var t=Gp.exec(e);return t?{file:t[3],methodName:t[1]||gr,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Hp=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function zp(e){var t=Hp.exec(e);return t?{file:t[2],methodName:t[1]||gr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var No=class{getLocation(){return null}},Bo=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=ca(t).find(o=>{if(!o.file)return!1;let i=bo(o.file);return i!==""&&!i.includes("@prisma")&&!i.includes("/packages/client/src/runtime/")&&!i.endsWith("/runtime/binary.js")&&!i.endsWith("/runtime/library.js")&&!i.endsWith("/runtime/edge.js")&&!i.endsWith("/runtime/edge-esm.js")&&!i.startsWith("internal/")&&!o.methodName.includes("new ")&&!o.methodName.includes("getCallSite")&&!o.methodName.includes("Proxy.")&&o.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function ut(e){return e==="minimal"?new No:new Bo}d();p();f();d();p();f();d();p();f();var pa={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Gt(e={}){let t=Yp(e);return Object.entries(t).reduce((n,[o,i])=>(pa[o]!==void 0?n.select[o]={select:i}:n[o]=i,n),{select:{}})}function Yp(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function vn(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function fa(e,t){let r=vn(e);return t({action:"aggregate",unpacker:r,argsMapper:Gt})(e)}d();p();f();function Xp(e={}){let{select:t,...r}=e;return typeof t=="object"?Gt({...r,_count:t}):Gt({...r,_count:{_all:!0}})}function ef(e={}){return typeof e.select=="object"?t=>vn(e)(t)._count:t=>vn(e)(t)._count._all}function da(e,t){return t({action:"count",unpacker:ef(e),argsMapper:Xp})(e)}d();p();f();function tf(e={}){let t=Gt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function rf(e={}){return t=>(typeof(e==null?void 0:e._count)=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ma(e,t){return t({action:"groupBy",unpacker:rf(e),argsMapper:tf})(e)}function ga(e,t,r){if(t==="aggregate")return n=>fa(n,r);if(t==="count")return n=>da(n,r);if(t==="groupBy")return n=>ma(n,r)}d();p();f();function ya(e,t){let r=t.fields.filter(o=>!o.relationName),n=vo(r,o=>o.name);return new Proxy({},{get(o,i){if(i in o||typeof i=="symbol")return o[i];let s=n[i];if(s)return new mr(e,i,s.type,s.isList,s.kind==="enum")},...un(Object.keys(n))})}d();p();f();d();p();f();var ha=e=>Array.isArray(e)?e:e.split("."),Lo=(e,t)=>ha(t).reduce((r,n)=>r&&r[n],e),xa=(e,t,r)=>ha(t).reduceRight((n,o,i,s)=>Object.assign({},Lo(e,s.slice(0,i)),{[o]:n}),r);function nf(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function of(e,t,r){return t===void 0?e!=null?e:{}:xa(t,r,e||!0)}function jo(e,t,r,n,o,i){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=ut(e._errorFormat),c=nf(n,o),m=of(u,i,c),g=r({dataPath:c,callsite:l})(m),w=sf(e,t);return new Proxy(g,{get(E,x){if(!w.includes(x))return E[x];let R=[a[x].type,r,x],S=[c,m];return jo(e,...R,...S)},...un([...w,...Object.getOwnPropertyNames(g)])})}}function sf(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}d();p();f();d();p();f();var va=Te(Fs());d();p();f();yo();d();p();f();d();p();f();d();p();f();var ba={keyword:et,entity:et,value:e=>Xe(_t(e)),punctuation:_t,directive:et,function:et,variable:e=>Xe(_t(e)),string:e=>Xe(en(e)),boolean:tn,number:et,comment:rn};var af=e=>e,An={},uf=0,_={manual:An.Prism&&An.Prism.manual,disableWorkerMessageHandler:An.Prism&&An.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof Fe){let t=e;return new Fe(t.type,_.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(_.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ee instanceof Fe)continue;if(N&&V!=t.length-1){S.lastIndex=W;var m=S.exec(e);if(!m)break;var c=m.index+(M?m[1].length:0),g=m.index+m[0].length,a=V,u=W;for(let O=t.length;a=u&&(++V,W=u);if(t[V]instanceof Fe)continue;l=a-V,Ee=e.slice(W,u),m.index-=W}else{S.lastIndex=0;var m=S.exec(Ee),l=1}if(!m){if(i)break;continue}M&&(B=m[1]?m[1].length:0);var c=m.index+B,m=m[0].slice(B),g=c+m.length,w=Ee.slice(0,c),E=Ee.slice(g);let H=[V,l];w&&(++V,W+=w.length,H.push(w));let Pe=new Fe(x,C?_.tokenize(m,C):m,pe,m,N);if(H.push(Pe),E&&H.push(E),Array.prototype.splice.apply(t,H),l!=1&&_.matchGrammar(e,t,r,V,W,!0,x),i)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let o in n)t[o]=n[o];delete t.rest}return _.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=_.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=_.hooks.all[e];if(!(!r||!r.length))for(var n=0,o;o=r[n++];)o(t)}},Token:Fe};_.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};_.languages.javascript=_.languages.extend("clike",{"class-name":[_.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});_.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;_.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:_.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:_.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:_.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:_.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});_.languages.markup&&_.languages.markup.tag.addInlined("script","javascript");_.languages.js=_.languages.javascript;_.languages.typescript=_.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});_.languages.ts=_.languages.typescript;function Fe(e,t,r,n,o){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!o}Fe.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return Fe.stringify(r,t)}).join(""):lf(e.type)(e.content)};function lf(e){return ba[e]||af}function wa(e){return cf(e,_.languages.javascript)}function cf(e,t){return _.tokenize(e,t).map(n=>Fe.stringify(n)).join("")}d();p();f();var Ea=Te(Ms());function Pa(e){return(0,Ea.default)(e)}var Tn=class e{static read(t){let r;try{r=nn.readFileSync(t,"utf-8")}catch(n){return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,o=[...this.lines];return o[n]=r(o[n]),new e(this.firstLineNumber,o)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,o)=>o===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` -`);return new e(t,Pa(n).split(` -`))}highlight(){let t=wa(this.toString());return new e(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var pf={red:Dt,gray:rn,dim:Xr,bold:Xe,underline:ws,highlightSource:e=>e.highlight()},ff={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function df({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:o},i){var m;let s={functionName:`prisma.${r}()`,message:t,isPanic:n!=null?n:!1,callArguments:o};if(!e||typeof window!="undefined"||y.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let u=Math.max(1,a.lineNumber-3),l=(m=Tn.read(a.fileName))==null?void 0:m.slice(u,a.lineNumber),c=l==null?void 0:l.lineAt(a.lineNumber);if(l&&c){let g=gf(c),w=mf(c);if(!w)return s;s.functionName=`${w.code})`,s.location=a,n||(l=l.mapLineAt(a.lineNumber,x=>x.slice(0,w.openingBraceIndex))),l=i.highlightSource(l);let E=String(l.lastLineNumber).length;if(s.contextLines=l.mapLines((x,T)=>i.gray(String(T).padStart(E))+" "+x).mapLines(x=>i.dim(x)).prependSymbolAt(a.lineNumber,i.bold(i.red("\u2192"))),o){let x=g+E+1;x+=2,s.callArguments=(0,va.default)(o,x).slice(x)}}return s}function mf(e){let t=Object.keys(Me.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let o=n.index+n[0].length,i=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(i,o),openingBraceIndex:o}}return null}function gf(e){let t=0;for(let r=0;r{if("rejectOnNotFound"in n.args){let i=Wt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new ge(i,{clientVersion:t})}return await r(n).catch(i=>{throw i instanceof me&&i.code==="P2025"?new tt(`No ${e} found`,t):i})}}d();p();f();function je(e){return e.replace(/^./,t=>t.toLowerCase())}var bf=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],wf=["aggregate","count","groupBy"];function Uo(e,t){var o;let r=(o=e._extensions.getAllModelExtensions(t))!=null?o:{},n=[Ef(e,t),vf(e,t),ar(r),ye("name",()=>t),ye("$name",()=>t),ye("$parent",()=>e._appliedParent)];return Ne({},n)}function Ef(e,t){let r=je(t),n=Object.keys(Me.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(o){let i=o,s=u=>e._request(u);s=Aa(i,t,e._clientVersion,s);let a=u=>l=>{let c=ut(e._errorFormat);return e._createPrismaPromise(m=>{let g={args:l,dataPath:[],action:i,model:t,clientMethod:`${r}.${o}`,jsModelName:r,transaction:m,callsite:c};return s({...g,...u})})};return bf.includes(i)?jo(e,t,a):Pf(o)?ga(e,o,a):a({})}}}function Pf(e){return wf.includes(e)}function vf(e,t){return xt(ye("fields",()=>{let r=e._runtimeDataModel.models[t];return ya(t,r)}))}d();p();f();function Ta(e){return e.replace(/^./,t=>t.toUpperCase())}var $o=Symbol();function yr(e){let t=[Af(e),ye($o,()=>e),ye("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(ar(r)),Ne(e,t)}function Af(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(je),n=[...new Set(t.concat(r))];return xt({getKeys(){return n},getPropertyValue(o){let i=Ta(o);if(e._runtimeDataModel.models[i]!==void 0)return Uo(e,i);if(e._runtimeDataModel.models[o]!==void 0)return Uo(e,o)},getPropertyDescriptor(o){if(!r.includes(o))return{enumerable:!1}}})}function Cn(e){return e[$o]?e[$o]:e}function Ca(e){if(typeof e=="function")return e(this);let t=Cn(this),r=Object.create(t,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return yr(r)}d();p();f();d();p();f();function Ma({result:e,modelName:t,select:r,extensions:n}){let o=n.getAllComputedFields(t);if(!o)return e;let i=[],s=[];for(let a of Object.values(o)){if(r){if(!r[a.name])continue;let u=a.needs.filter(l=>!r[l]);u.length>0&&s.push(ur(u))}Tf(e,a.needs)&&i.push(Cf(a,Ne(e,i)))}return i.length>0||s.length>0?Ne(e,[...i,...s]):e}function Tf(e,t){return t.every(r=>Po(e,r))}function Cf(e,t){return xt(ye(e.name,()=>e.compute(t)))}d();p();f();function Mn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:o}){var s;if(Array.isArray(t)){for(let a=0;ac.name===i);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[i]=Mn({visitor:o,result:t[i],args:l,modelName:u.type,runtimeDataModel:n})}}function Sa({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:o}){return n.isEmpty()||e==null||typeof e!="object"||!o.models[t]?e:Mn({result:e,args:r!=null?r:{},modelName:t,runtimeDataModel:o,visitor:(s,a,u)=>Ma({result:s,modelName:je(a),select:u.select,extensions:n})})}d();p();f();d();p();f();function Oa(e){if(e instanceof Ae)return Mf(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{var s,a;let i=t.customDataProxyFetch;return"transaction"in t&&o!==void 0&&(((s=t.transaction)==null?void 0:s.kind)==="batch"&&t.transaction.lock.then(),t.transaction=o),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Oa((a=t.args)!=null?a:{}),__internalParams:t,query:(u,l=t)=>{let c=l.customDataProxyFetch;return l.customDataProxyFetch=Na(i,c),l.args=u,Ia(e,l,r,n+1)}})})}function ka(e,t){let{jsModelName:r,action:n,clientMethod:o}=t,i=r?n:o;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r!=null?r:"$none",i);return Ia(e,t,s)}function Da(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?_a(r,n,0,e):e(r)}}function _a(e,t,r,n){if(r===t.length)return n(e);let o=e.customDataProxyFetch,i=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:i?{isolationLevel:i.kind==="batch"?i.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=Na(o,u),_a(a,t,r+1,n)}})}var Fa=e=>e;function Na(e=Fa,t=Fa){return r=>e(t(r))}d();p();f();d();p();f();function La(e,t,r){let n=je(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Rf({...e,...Ba(t.name,e,t.result.$allModels),...Ba(t.name,e,t.result[n])})}function Rf(e){let t=new _e,r=(n,o)=>t.getOrCreate(n,()=>o.has(n)?[n]:(o.add(n),e[n]?e[n].needs.flatMap(i=>r(i,o)):[n]));return Lt(e,n=>({...n,needs:r(n.name,new Set)}))}function Ba(e,t,r){return r?Lt(r,({needs:n,compute:o},i)=>({name:i,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Sf(t,i,o)})):{}}function Sf(e,t,r){var o;let n=(o=e==null?void 0:e[t])==null?void 0:o.compute;return n?i=>r({...i,[t]:n(i)}):r}function ja(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let o of n.needs)r[o]=!0;return r}var Rn=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new _e;this.modelExtensionsCache=new _e;this.queryCallbacksCache=new _e;this.clientExtensions=sr(()=>{var t,r;return this.extension.client?{...(r=this.previous)==null?void 0:r.getAllClientExtensions(),...this.extension.client}:(t=this.previous)==null?void 0:t.getAllClientExtensions()});this.batchCallbacks=sr(()=>{var n,o,i;let t=(o=(n=this.previous)==null?void 0:n.getAllBatchQueryCallbacks())!=null?o:[],r=(i=this.extension.query)==null?void 0:i.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>{var r;return La((r=this.previous)==null?void 0:r.getAllComputedFields(t),this.extension,t)})}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{var n,o;let r=je(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?(n=this.previous)==null?void 0:n.getAllModelExtensions(t):{...(o=this.previous)==null?void 0:o.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{var s,a;let n=(a=(s=this.previous)==null?void 0:s.getAllQueryCallbacks(t,r))!=null?a:[],o=[],i=this.extension.query;return!i||!(i[t]||i.$allModels||i[r]||i.$allOperations)?n:(i[t]!==void 0&&(i[t][r]!==void 0&&o.push(i[t][r]),i[t].$allOperations!==void 0&&o.push(i[t].$allOperations)),t!=="$none"&&i.$allModels!==void 0&&(i.$allModels[r]!==void 0&&o.push(i.$allModels[r]),i.$allModels.$allOperations!==void 0&&o.push(i.$allModels.$allOperations)),i[r]!==void 0&&o.push(i[r]),i.$allOperations!==void 0&&o.push(i.$allOperations),n.concat(o))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Sn=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Rn(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Rn(t,this.head))}getAllComputedFields(t){var r;return(r=this.head)==null?void 0:r.getAllComputedFields(t)}getAllClientExtensions(){var t;return(t=this.head)==null?void 0:t.getAllClientExtensions()}getAllModelExtensions(t){var r;return(r=this.head)==null?void 0:r.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){var n,o;return(o=(n=this.head)==null?void 0:n.getAllQueryCallbacks(t,r))!=null?o:[]}getAllBatchQueryCallbacks(){var t,r;return(r=(t=this.head)==null?void 0:t.getAllBatchQueryCallbacks())!=null?r:[]}};d();p();f();var Ua=xe("prisma:client"),$a={Vercel:"vercel","Netlify CI":"netlify"};function qa({postinstall:e,ciName:t,clientVersion:r}){if(Ua("checkPlatformCaching:postinstall",e),Ua("checkPlatformCaching:ciName",t),e===!0&&t&&t in $a){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${$a[t]}-build`;throw console.error(n),new ae(n,r)}}d();p();f();function Va(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}d();p();f();d();p();f();d();p();f();function qo({error:e,user_facing_error:t},r){return t.error_code?new me(t.message,{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new Re(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}d();p();f();var On=class{};d();p();f();function Ka(e,t){return{batch:e,transaction:(t==null?void 0:t.kind)==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}d();p();f();d();p();f();d();p();f();var Of="Cloudflare-Workers",Ff="node";function Ja(){var e,t,r;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Of?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((r=(t=globalThis.process)==null?void 0:t.release)==null?void 0:r.name)===Ff?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}function Fn({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){var u,l;let o,i=Object.keys(e)[0],s=(u=e[i])==null?void 0:u.url,a=(l=t[i])==null?void 0:l.url;if(i===void 0?o=void 0:a?o=a:s!=null&&s.value?o=s.value:s!=null&&s.fromEnvVar&&(o=r[s.fromEnvVar]),(s==null?void 0:s.fromEnvVar)!==void 0&&o===void 0)throw Ja()==="workerd"?new ae(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new ae(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(o===void 0)throw new ae("error: Missing URL environment variable, value, or override.",n);return o}d();p();f();d();p();f();var In=class extends Error{constructor(r,n){super(r);this.clientVersion=n.clientVersion,this.cause=n.cause}get[Symbol.toStringTag](){return this.name}};var we=class extends In{constructor(r,n){var o;super(r,n);this.isRetryable=(o=n.isRetryable)!=null?o:!0}};d();p();f();d();p();f();function q(e,t){return{...e,isRetryable:t}}var Ht=class extends we{constructor(r){super("This request must be retried",q(r,!0));this.name="ForcedRetryError";this.code="P5001"}};k(Ht,"ForcedRetryError");d();p();f();var wt=class extends we{constructor(r,n){super(r,q(n,!1));this.name="InvalidDatasourceError";this.code="P5002"}};k(wt,"InvalidDatasourceError");d();p();f();var Et=class extends we{constructor(r,n){super(r,q(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};k(Et,"NotImplementedYetError");d();p();f();d();p();f();var Q=class extends we{constructor(r,n){super(r,n);this.response=n.response;let o=this.response.headers.get("prisma-request-id");if(o){let i=`(The request id was: ${o})`;this.message=this.message+" "+i}}};var Pt=class extends Q{constructor(r){super("Schema needs to be uploaded",q(r,!0));this.name="SchemaMissingError";this.code="P5005"}};k(Pt,"SchemaMissingError");d();p();f();d();p();f();var Vo="This request could not be understood by the server",xr=class extends Q{constructor(r,n,o){super(n||Vo,q(r,!1));this.name="BadRequestError";this.code="P5000";o&&(this.code=o)}};k(xr,"BadRequestError");d();p();f();var br=class extends Q{constructor(r,n){super("Engine not started: healthcheck timeout",q(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};k(br,"HealthcheckTimeoutError");d();p();f();var wr=class extends Q{constructor(r,n,o){super(n,q(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=o}};k(wr,"EngineStartupError");d();p();f();var Er=class extends Q{constructor(r){super("Engine version is not supported",q(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};k(Er,"EngineVersionNotSupportedError");d();p();f();var Ko="Request timed out",Pr=class extends Q{constructor(r,n=Ko){super(n,q(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};k(Pr,"GatewayTimeoutError");d();p();f();var If="Interactive transaction error",vr=class extends Q{constructor(r,n=If){super(n,q(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};k(vr,"InteractiveTransactionError");d();p();f();var kf="Request parameters are invalid",Ar=class extends Q{constructor(r,n=kf){super(n,q(r,!1));this.name="InvalidRequestError";this.code="P5011"}};k(Ar,"InvalidRequestError");d();p();f();var Jo="Requested resource does not exist",Tr=class extends Q{constructor(r,n=Jo){super(n,q(r,!1));this.name="NotFoundError";this.code="P5003"}};k(Tr,"NotFoundError");d();p();f();var Qo="Unknown server error",zt=class extends Q{constructor(r,n,o){super(n||Qo,q(r,!0));this.name="ServerError";this.code="P5006";this.logs=o}};k(zt,"ServerError");d();p();f();var Go="Unauthorized, check your connection string",Cr=class extends Q{constructor(r,n=Go){super(n,q(r,!1));this.name="UnauthorizedError";this.code="P5007"}};k(Cr,"UnauthorizedError");d();p();f();var Wo="Usage exceeded, retry again later",Mr=class extends Q{constructor(r,n=Wo){super(n,q(r,!0));this.name="UsageExceededError";this.code="P5008"}};k(Mr,"UsageExceededError");async function Df(e){let t;try{t=await e.text()}catch(r){return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch(r){return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Rr(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Df(e);if(n.type==="QueryEngineError")throw new me(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new zt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Pt(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Er(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:o,logs:i}=n.body.EngineNotStarted.reason.EngineStartupError;throw new wr(r,o,i)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:o,error_code:i}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new ae(o,t,i)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:o}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new br(r,o)}}if("InteractiveTransactionMisrouted"in n.body){let o={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new vr(r,o[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ar(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Cr(r,Zt(Go,n));if(e.status===404)return new Tr(r,Zt(Jo,n));if(e.status===429)throw new Mr(r,Zt(Wo,n));if(e.status===504)throw new Pr(r,Zt(Ko,n));if(e.status>=500)throw new zt(r,Zt(Qo,n));if(e.status>=400)throw new xr(r,Zt(Vo,n))}function Zt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}d();p();f();function Qa(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(o=>setTimeout(()=>o(n),n))}d();p();f();function Ga(e){var r;if(!!((r=e.generator)!=null&&r.previewFeatures.some(n=>n.toLowerCase().includes("metrics"))))throw new ae("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}d();p();f();var Wa={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*","@swc/core":"1.3.75","@swc/jest":"0.2.29","@types/jest":"29.5.4","@types/node":"18.17.12",execa:"5.1.1",jest:"29.6.4",typescript:"5.2.2"};d();p();f();d();p();f();var Sr=class extends we{constructor(r,n){super(`Cannot fetch data from service: -${r}`,q(n,!0));this.name="RequestError";this.code="P5010"}};k(Sr,"RequestError");async function vt(e,t,r=n=>n){var o;let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(Ho)(e,t)}catch(i){console.log(e);let s=(o=i.message)!=null?o:"Unknown error";throw new Sr(s,{clientVersion:n})}}function Nf(e){return{...e.headers,"Content-Type":"application/json"}}function Bf(e){return{method:e.method,headers:Nf(e)}}function Lf(e,t){return{text:()=>Promise.resolve(b.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(b.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new zo(t.headers)}}async function Ho(e,t={}){let r=jf("https"),n=Bf(t),o=[],{origin:i}=new URL(e);return new Promise((s,a)=>{var l;let u=r.request(e,n,c=>{let{statusCode:m,headers:{location:g}}=c;m>=301&&m<=399&&g&&(g.startsWith("http")===!1?s(Ho(`${i}${g}`,t)):s(Ho(g,t))),c.on("data",w=>o.push(w)),c.on("end",()=>s(Lf(o,c))),c.on("error",a)});u.on("error",a),u.end((l=t.body)!=null?l:"")})}var jf=typeof Kn!="undefined"?Kn:()=>{},zo=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let o of n)this.headers.set(r,o)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){var r;return(r=this.headers.get(t))!=null?r:null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,o]of this.headers)t.call(r,o,n,this)}};var Uf=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Ha=xe("prisma:client:dataproxyEngine");async function $f(e,t){var s,a,u;let r=Wa["@prisma/engines-version"],n=(s=t.clientVersion)!=null?s:"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[o,i]=(a=n==null?void 0:n.split("-"))!=null?a:[];if(i===void 0&&Uf.test(o))return o;if(i!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[l]=(u=r.split("-"))!=null?u:[],[c,m,g]=l.split("."),w=qf(`<=${c}.${m}.${g}`),E=await vt(w,{clientVersion:n});if(!E.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${E.status} ${E.statusText}, response body: ${await E.text()||""}`);let x=await E.text();Ha("length of body fetched from unpkg.com",x.length);let T;try{T=JSON.parse(x)}catch(R){throw console.error("JSON.parse error: body fetched from unpkg.com: ",x),R}return T.version}throw new Et("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function za(e,t){let r=await $f(e,t);return Ha("version",r),r}function qf(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Za=3,Zo=xe("prisma:client:dataproxyEngine"),Yo=class{constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`};this.tracingHelper.isEnabled()&&(n.traceparent=t!=null?t:this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let o=this.buildCaptureSettings();return o.length>0&&(n["X-capture-telemetry"]=o.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},Or=class extends On{constructor(r){var n,o,i,s;super();Ga(r),this.config=r,this.env={...this.config.env,...y.env},this.inlineSchema=(n=r.inlineSchema)!=null?n:"",this.inlineDatasources=(o=r.inlineDatasources)!=null?o:{},this.inlineSchemaHash=(i=r.inlineSchemaHash)!=null?i:"",this.clientVersion=(s=r.clientVersion)!=null?s:"unknown",this.logEmitter=r.logEmitter,this.tracingHelper=this.config.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return"unknown"}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[r,n]=this.extractHostAndApiKey();this.host=r,this.headerBuilder=new Yo({apiKey:n,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries}),this.remoteClientVersion=await za(r,this.config),Zo("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){var n,o;(n=r==null?void 0:r.logs)!=null&&n.length&&r.logs.forEach(i=>{switch(i.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let s=typeof i.attributes.query=="string"?i.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[a]=s.split("/* traceparent");s=a}this.logEmitter.emit("query",{query:s,timestamp:i.timestamp,duration:i.attributes.duration_ms,params:i.attributes.params,target:i.attributes.target})}}}),(o=r==null?void 0:r.traces)!=null&&o.length&&this.tracingHelper.createEngineSpan({span:!0,spans:r.traces})}on(r,n){if(r==="beforeExit")throw new Error('"beforeExit" hook is not applicable to the remote query engine');this.logEmitter.on(r,n)}async url(r){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async uploadSchema(){let r={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(r,async()=>{let n=await vt(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});n.ok||Zo("schema response status",n.status);let o=await Rr(n,this.clientVersion);if(o)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${o.message}`}),o;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`})})}request(r,{traceparent:n,interactiveTransaction:o,customDataProxyFetch:i}){return this.requestInternal({body:r,traceparent:n,interactiveTransaction:o,customDataProxyFetch:i})}async requestBatch(r,{traceparent:n,transaction:o,customDataProxyFetch:i}){let s=(o==null?void 0:o.kind)==="itx"?o.options:void 0,a=Ka(r,o),{batchResult:u,elapsed:l}=await this.requestInternal({body:a,customDataProxyFetch:i,interactiveTransaction:s,traceparent:n});return u.map(c=>"errors"in c&&c.errors.length>0?qo(c.errors[0],this.clientVersion):{data:c,elapsed:l})}requestInternal({body:r,traceparent:n,customDataProxyFetch:o,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:s})=>{let a=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");s(a);let u=await vt(a,{method:"POST",headers:this.headerBuilder.build({traceparent:n,interactiveTransaction:i}),body:JSON.stringify(r),clientVersion:this.clientVersion},o);u.ok||Zo("graphql response status",u.status),await this.handleError(await Rr(u,this.clientVersion));let l=await u.json(),c=l.extensions;if(c&&this.propagateResponseExtensions(c),l.errors)throw l.errors.length===1?qo(l.errors[0],this.config.clientVersion):new Re(l.errors,{clientVersion:this.config.clientVersion});return l}})}async transaction(r,n,o){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[r]} transaction`,callback:async({logHttpCall:s})=>{var a,u;if(r==="start"){let l=JSON.stringify({max_wait:(a=o==null?void 0:o.maxWait)!=null?a:2e3,timeout:(u=o==null?void 0:o.timeout)!=null?u:5e3,isolation_level:o==null?void 0:o.isolationLevel}),c=await this.url("transaction/start");s(c);let m=await vt(c,{method:"POST",headers:this.headerBuilder.build({traceparent:n.traceparent}),body:l,clientVersion:this.clientVersion});await this.handleError(await Rr(m,this.clientVersion));let g=await m.json(),w=g.extensions;w&&this.propagateResponseExtensions(w);let E=g.id,x=g["data-proxy"].endpoint;return{id:E,payload:{endpoint:x}}}else{let l=`${o.payload.endpoint}/${r}`;s(l);let c=await vt(l,{method:"POST",headers:this.headerBuilder.build({traceparent:n.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Rr(c,this.clientVersion));let g=(await c.json()).extensions;g&&this.propagateResponseExtensions(g);return}}})}extractHostAndApiKey(){let r={clientVersion:this.clientVersion},n=Object.keys(this.inlineDatasources)[0],o=Fn({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(o)}catch(c){throw new wt(`Error validating datasource \`${n}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:s,host:a,searchParams:u}=i;if(s!=="prisma:")throw new wt(`Error validating datasource \`${n}\`: the URL must start with the protocol \`prisma://\``,r);let l=u.get("api_key");if(l===null||l.length<1)throw new wt(`Error validating datasource \`${n}\`: the URL must contain a valid API key`,r);return[a,l]}metrics(){throw new Et("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){var n;for(let o=0;;o++){let i=s=>{this.logEmitter.emit("info",{message:`Calling ${s} (n=${o})`})};try{return await r.callback({logHttpCall:i})}catch(s){if(!(s instanceof we)||!s.isRetryable)throw s;if(o>=Za)throw s instanceof Ht?s.cause:s;this.logEmitter.emit("warn",{message:`Attempt ${o+1}/${Za} failed for ${r.actionGerund}: ${(n=s.message)!=null?n:"(unknown)"}`});let a=await Qa(o);this.logEmitter.emit("warn",{message:`Retrying after ${a}ms`})}}}async handleError(r){if(r instanceof Pt)throw await this.uploadSchema(),new Ht({clientVersion:this.clientVersion,cause:r});if(r)throw r}};function Ya(e,t){let r;try{r=Fn({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch(o){}e.noEngine!==!0&&(r!=null&&r.startsWith("prisma://"))&&sn("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=xo(t.generator);return r!=null&&r.startsWith("prisma://")||e.noEngine,new Or(t);throw new ge("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}d();p();f();d();p();f();d();p();f();var ou=Te(Xo());d();p();f();function ru(e,t){let r=nu(e),n=Vf(r),o=Jf(n);o?kn(o,t):t.addErrorMessage(()=>"Unknown error")}function nu(e){return e.errors.flatMap(t=>t.kind==="Union"?nu(t):[t])}function Vf(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let o=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,i=t.get(o);i?t.set(o,{...n,argument:{...n.argument,typeNames:Kf(i.argument.typeNames,n.argument.typeNames)}}):t.set(o,n)}return r.push(...t.values()),r}function Kf(e,t){return[...new Set(e.concat(t))]}function Jf(e){return Ao(e,(t,r)=>{let n=eu(t),o=eu(r);return n!==o?n-o:tu(t)-tu(r)})}function eu(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function tu(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}d();p();f();var Je=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};d();p();f();var Dn=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:o,dim:i}=n.context.colors;n.write(o(i(`${t}: ${r}`))).addMarginSymbol(o(i("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(Jt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function kn(e,t){switch(e.kind){case"IncludeAndSelect":Qf(e,t);break;case"IncludeOnScalar":Gf(e,t);break;case"EmptySelection":Wf(e,t);break;case"UnknownSelectionField":Hf(e,t);break;case"UnknownArgument":zf(e,t);break;case"UnknownInputField":Zf(e,t);break;case"RequiredArgumentMissing":Yf(e,t);break;case"InvalidArgumentType":Xf(e,t);break;case"InvalidArgumentValue":ed(e,t);break;case"ValueTooLarge":td(e,t);break;case"SomeFieldsMissing":rd(e,t);break;case"TooManyFieldsGiven":nd(e,t);break;case"Union":ru(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function Qf(e,t){var n,o;let r=t.arguments.getDeepSubSelectionValue(e.selectionPath);r&&r instanceof re&&((n=r.getField("include"))==null||n.markAsError(),(o=r.getField("select"))==null||o.markAsError()),t.addErrorMessage(i=>`Please ${i.bold("either")} use ${i.green("`include`")} or ${i.green("`select`")}, but ${i.red("not both")} at the same time.`)}function Gf(e,t){var s,a;let[r,n]=_n(e.selectionPath),o=e.outputType,i=(s=t.arguments.getDeepSelectionParent(r))==null?void 0:s.value;if(i&&((a=i.getField(n))==null||a.markAsError(),o))for(let u of o.fields)u.isRelation&&i.addSuggestion(new Je(u.name,"true"));t.addErrorMessage(u=>{let l=`Invalid scalar field ${u.red(`\`${n}\``)} for ${u.bold("include")} statement`;return o?l+=` on model ${u.bold(o.name)}. ${Fr(u)}`:l+=".",l+=` -Note that ${u.bold("include")} statements only accept relation fields.`,l})}function Wf(e,t){var i,s;let r=e.outputType,n=(i=t.arguments.getDeepSelectionParent(e.selectionPath))==null?void 0:i.value,o=(s=n==null?void 0:n.isEmpty())!=null?s:!1;n&&(n.removeAllFields(),au(n,r)),t.addErrorMessage(a=>o?`The ${a.red("`select`")} statement for type ${a.bold(r.name)} must not be empty. ${Fr(a)}`:`The ${a.red("`select`")} statement for type ${a.bold(r.name)} needs ${a.bold("at least one truthy value")}.`)}function Hf(e,t){var i;let[r,n]=_n(e.selectionPath),o=t.arguments.getDeepSelectionParent(r);o&&((i=o.value.getField(n))==null||i.markAsError(),au(o.value,e.outputType)),t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o.kind)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(Fr(s)),a.join(" ")})}function zf(e,t){var o;let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof re&&((o=n.getField(r))==null||o.markAsError(),od(n,e.arguments)),t.addErrorMessage(i=>iu(i,r,e.arguments.map(s=>s.name)))}function Zf(e,t){var i;let[r,n]=_n(e.argumentPath),o=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(o instanceof re){(i=o.getDeepField(e.argumentPath))==null||i.markAsError();let s=o.getDeepFieldValue(r);s instanceof re&&uu(s,e.inputType)}t.addErrorMessage(s=>iu(s,n,e.inputType.fields.map(a=>a.name)))}function iu(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],o=sd(t,r);return o&&n.push(`Did you mean \`${e.green(o)}\`?`),r.length>0&&n.push(Fr(e)),n.join(" ")}function Yf(e,t){let r;t.addErrorMessage(u=>(r==null?void 0:r.value)instanceof ne&&r.value.text==="null"?`Argument \`${u.green(i)}\` must not be ${u.red("null")}.`:`Argument \`${u.green(i)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(!(n instanceof re))return;let[o,i]=_n(e.argumentPath),s=new Dn,a=n.getDeepFieldValue(o);if(a instanceof re)if(r=a.getField(i),r&&a.removeField(i),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let u of e.inputTypes[0].fields)s.addField(u.name,u.typeNames.join(" | "));a.addSuggestion(new Je(i,s).makeRequired())}else{let u=e.inputTypes.map(su).join(" | ");a.addSuggestion(new Je(i,u).makeRequired())}}function su(e){return e.kind==="list"?`${su(e.elementType)}[]`:e.name}function Xf(e,t){var o;let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof re&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(i=>{let s=Nn("or",e.argument.typeNames.map(a=>i.green(a)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${s}, provided ${i.red(e.inferredType)}.`})}function ed(e,t){var o;let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof re&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(i=>{let s=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&s.push(`: ${e.underlyingError}`),s.push("."),e.argument.typeNames.length>0){let a=Nn("or",e.argument.typeNames.map(u=>i.green(u)));s.push(` Expected ${a}.`)}return s.join("")})}function td(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath),o;if(n instanceof re){let i=n.getDeepField(e.argumentPath),s=i==null?void 0:i.value;s==null||s.markAsError(),s instanceof ne&&(o=s.text)}t.addErrorMessage(i=>{let s=["Unable to fit value"];return o&&s.push(i.red(o)),s.push(`into a 64-bit signed integer for field \`${i.bold(r)}\``),s.join(" ")})}function rd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(n instanceof re){let o=n.getDeepFieldValue(e.argumentPath);o instanceof re&&uu(o,e.inputType)}t.addErrorMessage(o=>{let i=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?i.push(`${o.green("at least one of")} ${Nn("or",e.constraints.requiredFields.map(s=>`\`${o.bold(s)}\``))} arguments.`):i.push(`${o.green("at least one")} argument.`):i.push(`${o.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),i.push(Fr(o)),i.join(" ")})}function nd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath),o=[];if(n instanceof re){let i=n.getDeepFieldValue(e.argumentPath);i instanceof re&&(i.markAsError(),o=Object.keys(i.getFields()))}t.addErrorMessage(i=>{let s=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${i.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${i.green("at most one")} argument,`):s.push(`${i.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Nn("and",o.map(a=>i.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function au(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Je(r.name,"true"))}function od(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new Je(r.name,r.typeNames.join(" | ")))}function uu(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Je(r.name,r.typeNames.join(" | ")))}function _n(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function Fr({green:e}){return`Available options are listed in ${e("green")}.`}function Nn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var id=3;function sd(e,t){let r=1/0,n;for(let o of t){let i=(0,ou.default)(e,o);i>id||i({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){var r;return(r=this.model)==null?void 0:r.fields.find(n=>n.name===t)}nestSelection(t){let r=this.findField(t),n=(r==null?void 0:r.kind)==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};d();p();f();var fu=e=>({command:e});d();p();f();d();p();f();var du=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);d();p();f();function Ir(e){try{return mu(e,"fast")}catch(t){return mu(e,"slow")}}function mu(e,t){return JSON.stringify(e.map(r=>gd(r,t)))}function gd(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:Ut(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Ke.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:b.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:yd(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:b.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?yu(e):e}function yd(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function yu(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(gu);let t={};for(let r of Object.keys(e))t[r]=gu(e[r]);return t}function gu(e){return typeof e=="bigint"?e.toString():yu(e)}var hd=/^(\s*alter\s)/i,hu=xe("prisma:client");function ri(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&hd.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var ni=(e,t)=>r=>{let n="",o;if(Array.isArray(r)){let[i,...s]=r;n=i,o={values:Ir(s||[]),__prismaRawParameters__:!0}}else switch(e){case"sqlite":case"mysql":{n=r.sql,o={values:Ir(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":{n=r.text,o={values:Ir(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=du(r),o={values:Ir(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${e} provider does not support ${t}`)}return o!=null&&o.values?hu(`prisma.${t}(${n}, ${o.values})`):hu(`prisma.${t}(${n})`),{query:n,parameters:o}},xu={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new Ae(t,r)}},bu={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};d();p();f();function oi(e){return function(r){let n,o=(i=e)=>{try{return i===void 0||(i==null?void 0:i.kind)==="itx"?n!=null?n:n=wu(r(i)):wu(r(i))}catch(s){return Promise.reject(s)}};return{then(i,s){return o().then(i,s)},catch(i){return o().catch(i)},finally(i){return o().finally(i)},requestTransaction(i){let s=o(i);return s.requestTransaction?s.requestTransaction(i):s},[Symbol.toStringTag]:"PrismaPromise"}}}function wu(e){return typeof e.then=="function"?e:Promise.resolve(e)}d();p();f();var Eu={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},ii=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){var t,r;return(r=(t=globalThis.PRISMA_INSTRUMENTATION)==null?void 0:t.helper)!=null?r:Eu}};function Pu(e){return e.includes("tracing")?new ii:Eu}d();p();f();function vu(e,t=()=>{}){let r,n=new Promise(o=>r=o);return{then(o){return--e===0&&r(t()),o==null?void 0:o(n)}}}d();p();f();function Au(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}d();p();f();var xd=["$connect","$disconnect","$on","$transaction","$use","$extends"],Tu=xd;d();p();f();var Ln=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};d();p();f();var Mu=Te(Ns());d();p();f();function jn(e){return typeof e.batchRequestIdx=="number"}d();p();f();function Un(e){return e===null?e:Array.isArray(e)?e.map(Un):typeof e=="object"?bd(e)?wd(e):Lt(e,Un):e}function bd(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function wd({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return b.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new Ke(t);case"Json":return JSON.parse(t);default:ht(t,"Unknown tagged value")}}d();p();f();function Cu(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(si(e.query.arguments)),t.push(si(e.query.selection)),t.join("")}function si(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${si(n)})`:r}).join(" ")})`}d();p();f();var Ed={aggregate:!1,aggregateRaw:!1,createMany:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function ai(e){return Ed[e]}d();p();f();var $n=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,o)=>{this.batches[r].push({request:t,resolve:n,reject:o})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,o)=>this.options.batchOrder(n.request,o.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let o=0;o{for(let o=0;o{let{transaction:i,otelParentCtx:s}=n[0],a=n.map(m=>m.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),l=n.some(m=>ai(m.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:vd(i),containsWrite:l,customDataProxyFetch:o})).map((m,g)=>{if(m instanceof Error)return m;try{return this.mapQueryEngineResult(n[g],m)}catch(w){return w}})}),singleLoader:async n=>{var s;let o=((s=n.transaction)==null?void 0:s.kind)==="itx"?Ru(n.transaction):void 0,i=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:o,isWrite:ai(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,i)},batchBy:n=>{var o;return(o=n.transaction)!=null&&o.id?`transaction-${n.transaction.id}`:Cu(n.protocolQuery)},batchOrder(n,o){var i,s;return((i=n.transaction)==null?void 0:i.kind)==="batch"&&((s=o.transaction)==null?void 0:s.kind)==="batch"?n.transaction.index-o.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:o,transaction:i,args:s}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:o,transaction:i,args:s})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let o=n==null?void 0:n.data,i=n==null?void 0:n.elapsed,s=this.unpack(o,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:i}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:o,args:i}){if(Pd(t),Ad(t,o)||t instanceof tt)throw t;if(t instanceof me&&Td(t)){let a=Su(t.meta);Bn({args:i,errors:[a],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let s=t.message;throw n&&(s=Wt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:s})),s=this.sanitizeMessage(s),t.code?new me(s,{code:t.code,clientVersion:this.client._clientVersion,meta:t.meta,batchRequestIdx:t.batchRequestIdx}):t.isPanic?new rt(s,this.client._clientVersion):t instanceof Re?new Re(s,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx}):t instanceof ae?new ae(s,this.client._clientVersion):t instanceof rt?new rt(s,this.client._clientVersion):(t.clientVersion=this.client._clientVersion,t)}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Mu.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let o=Object.values(t)[0],i=r.filter(a=>a!=="select"&&a!=="include"),s=Un(Lo(o,i));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function vd(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ru(e)};ht(e,"Unknown transaction kind")}}function Ru(e){return{id:e.id,payload:e.payload}}function Ad(e,t){return jn(e)&&(t==null?void 0:t.kind)==="batch"&&e.batchRequestIdx!==t.index}function Td(e){return e.code==="P2009"||e.code==="P2012"}function Su(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Su)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}d();p();f();var Ou="5.3.1";var Fu=Ou;d();p();f();function Iu(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=ku(t[n]);return r})}function ku({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return b.Buffer.from(t,"base64");case"decimal":return new Ke(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(ku);default:return t}}d();p();f();var Bu=Te(Xo());d();p();f();var Z=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};k(Z,"PrismaClientConstructorValidationError");var Du=["datasources","datasourceUrl","errorFormat","log","__internal"],_u=["pretty","colorless","minimal"],Nu=["info","query","warn","error"],Md={datasources:(e,t)=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new Z(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let o=Yt(r,t)||` Available datasources: ${t.join(", ")}`;throw new Z(`Unknown datasource ${r} provided to PrismaClient constructor.${o}`)}if(typeof n!="object"||Array.isArray(n))throw new Z(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[o,i]of Object.entries(n)){if(o!=="url")throw new Z(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof i!="string")throw new Z(`Invalid value ${JSON.stringify(i)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},datasourceUrl:e=>{if(typeof e!="undefined"&&typeof e!="string")throw new Z(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new Z(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!_u.includes(e)){let t=Yt(e,_u);throw new Z(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new Z(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Nu.includes(r)){let n=Yt(r,Nu);throw new Z(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:o=>{let i=["stdout","event"];if(!i.includes(o)){let s=Yt(o,i);throw new Z(`Invalid value ${JSON.stringify(o)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[o,i]of Object.entries(r))if(n[o])n[o](i);else throw new Z(`Invalid property ${o} for "log" provided to PrismaClient constructor`)}},__internal:e=>{if(!e)return;let t=["debug","hooks","engine","measurePerformance"];if(typeof e!="object")throw new Z(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Yt(r,t);throw new Z(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Lu(e,t){for(let[r,n]of Object.entries(e)){if(!Du.includes(r)){let o=Yt(r,Du);throw new Z(`Unknown property ${r} provided to PrismaClient constructor.${o}`)}Md[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new Z('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Yt(e,t){if(t.length===0||typeof e!="string")return"";let r=Rd(e,t);return r?` Did you mean "${r}"?`:""}function Rd(e,t){if(t.length===0)return null;let r=t.map(o=>({value:o,distance:(0,Bu.default)(e,o)}));r.sort((o,i)=>o.distance{let n=new Array(e.length),o=null,i=!1,s=0,a=()=>{i||(s++,s===e.length&&(i=!0,o?r(o):t(n)))},u=l=>{i||(i=!0,r(l))};for(let l=0;l{n[l]=c,a()},c=>{if(!jn(c)){u(c);return}c.batchRequestIdx===l?u(c):(o||(o=c),a())})})}var lt=xe("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Sd={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Od=Symbol.for("prisma.client.transaction.id"),Fd={id:0,nextId(){return++this.id}};function Id(e){class t{constructor(n){this._middlewares=new Ln;this._createPrismaPromise=oi();this.$extends=Ca;var a,u,l,c,m,g,w,E;qa(e),n&&Lu(n,e.datasourceNames);let o=new $u.EventEmitter().on("error",()=>{});this._extensions=Sn.empty(),this._previewFeatures=(u=(a=e.generator)==null?void 0:a.previewFeatures)!=null?u:[],this._clientVersion=(l=e.clientVersion)!=null?l:Fu,this._activeProvider=e.activeProvider,this._tracingHelper=Pu(this._previewFeatures);let i={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&kr.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&kr.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s=(c=e.injectableEdgeEnv)==null?void 0:c.call(e);try{let x=n!=null?n:{},T=(m=x.__internal)!=null?m:{},R=T.debug===!0;R&&xe.enable("prisma:client");let S=kr.default.resolve(e.dirname,e.relativePath);nn.existsSync(S)||(S=e.dirname),lt("dirname",e.dirname),lt("relativePath",e.relativePath),lt("cwd",S);let C=T.engine||{};if(x.errorFormat?this._errorFormat=x.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:S,dirname:e.dirname,enableDebugLogs:R,allowTriggerPanic:C.allowTriggerPanic,datamodelPath:kr.default.join(e.dirname,(g=e.filename)!=null?g:"schema.prisma"),prismaPath:(w=C.binaryPath)!=null?w:void 0,engineEndpoint:C.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:x.log&&Au(x.log),logQueries:x.log&&!!(typeof x.log=="string"?x.log==="query":x.log.find(M=>typeof M=="string"?M==="query":M.level==="query")),env:(E=s==null?void 0:s.parsed)!=null?E:{},flags:[],clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Va(x,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,logEmitter:o,isBundled:e.isBundled},lt("clientVersion",e.clientVersion),this._engine=Ya(e,this._engineConfig),this._requestHandler=new qn(this,o),x.log)for(let M of x.log){let N=typeof M=="string"?M:M.emit==="stdout"?M.level:null;N&&this.$on(N,B=>{var pe;Bt.log(`${(pe=Bt.tags[N])!=null?pe:""}`,B.message||B.query)})}this._metrics=new ir(this._engine)}catch(x){throw x.clientVersion=this._clientVersion,x}return this._appliedParent=yr(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,o){n==="beforeExit"?this._engine.on("beforeExit",o):this._engine.on(n,i=>{var a,u,l,c;let s=i.fields;return o(n==="query"?{timestamp:i.timestamp,query:(a=s==null?void 0:s.query)!=null?a:i.query,params:(u=s==null?void 0:s.params)!=null?u:i.params,duration:(l=s==null?void 0:s.duration_ms)!=null?l:i.duration,target:i.target}:{timestamp:i.timestamp,message:(c=s==null?void 0:s.message)!=null?c:i.message,target:i.target})})}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{gs()}}$executeRawInternal(n,o,i,s){return this._request({action:"executeRaw",args:i,transaction:n,clientMethod:o,argsMapper:ni(this._activeProvider,o),callsite:ut(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...o){return this._createPrismaPromise(i=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Uu(n,o);return ri(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(i,"$executeRaw",s,a)}throw new ge("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...o){return this._createPrismaPromise(i=>(ri(this._activeProvider,n,o,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(i,"$executeRawUnsafe",[n,...o])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new ge(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(o=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:fu,callsite:ut(this._errorFormat),transaction:o}))}async $queryRawInternal(n,o,i,s){return this._request({action:"queryRaw",args:i,transaction:n,clientMethod:o,argsMapper:ni(this._activeProvider,o),callsite:ut(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(Iu)}$queryRaw(n,...o){return this._createPrismaPromise(i=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(i,"$queryRaw",...Uu(n,o));throw new ge("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...o){return this._createPrismaPromise(i=>this.$queryRawInternal(i,"$queryRawUnsafe",[n,...o]))}_transactionWithArray({promises:n,options:o}){let i=Fd.nextId(),s=vu(n.length),a=n.map((u,l)=>{var g,w;if((u==null?void 0:u[Symbol.toStringTag])!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=o==null?void 0:o.isolationLevel,m={kind:"batch",id:i,index:l,isolationLevel:c,lock:s};return(w=(g=u.requestTransaction)==null?void 0:g.call(u,m))!=null?w:u});return ju(a)}async _transactionWithCallback({callback:n,options:o}){let i={traceparent:this._tracingHelper.getTraceParent()},s=await this._engine.transaction("start",i,o),a;try{let u={kind:"itx",...s};a=await n(this._createItxClient(u)),await this._engine.transaction("commit",i,s)}catch(u){throw await this._engine.transaction("rollback",i,s).catch(()=>{}),u}return a}_createItxClient(n){return yr(Ne(Cn(this),[ye("_appliedParent",()=>this._appliedParent._createItxClient(n)),ye("_createPrismaPromise",()=>oi(n)),ye(Od,()=>n.id),ur(Tu)]))}$transaction(n,o){let i;typeof n=="function"?i=()=>this._transactionWithCallback({callback:n,options:o}):i=()=>this._transactionWithArray({promises:n,options:o});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,i)}_request(n){var l;n.otelParentCtx=this._tracingHelper.getActiveContext();let o=(l=n.middlewareArgsMapper)!=null?l:Sd,i={args:o.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:i.action,model:i.model,name:i.model?`${i.model}.${i.action}`:i.action}}},a=-1,u=async c=>{let m=this._middlewares.get(++a);if(m)return this._tracingHelper.runInChildSpan(s.middleware,R=>m(c,S=>(R==null||R.end(),u(S))));let{runInTransaction:g,args:w,...E}=c,x={...n,...E};w&&(x.args=o.middlewareArgsToRequestArgs(w)),n.transaction!==void 0&&g===!1&&delete x.transaction;let T=await ka(this,x);return x.model?Sa({result:T,modelName:x.model,args:x.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):T};return this._tracingHelper.runInChildSpan(s.operation,()=>u(i))}async _executeRequest({args:n,clientMethod:o,dataPath:i,callsite:s,action:a,model:u,argsMapper:l,transaction:c,unpacker:m,otelParentCtx:g,customDataProxyFetch:w}){try{n=l?l(n):n;let E={name:"serialize"},x=this._tracingHelper.runInChildSpan(E,()=>lu({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:o,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion}));return xe.enabled("prisma:client")&&(lt("Prisma Client call:"),lt(`prisma.${o}(${la(n)})`),lt("Generated request:"),lt(JSON.stringify(x,null,2)+` -`)),(c==null?void 0:c.kind)==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:x,modelName:u,action:a,clientMethod:o,dataPath:i,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:m,otelParentCtx:g,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:w})}catch(E){throw E.clientVersion=this._clientVersion,E}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new ge("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){var o;return!!((o=this._engineConfig.previewFeatures)!=null&&o.includes(n))}}return t}function Uu(e,t){return kd(e)?[new Ae(e,t),xu]:[e,bu]}function kd(e){return Array.isArray(e)&&Array.isArray(e.raw)}d();p();f();var Dd=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function _d(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Dd.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}d();p();f();var export_warnEnvConflicts=void 0;export{Me as DMMF,Xn as DMMFClass,ms as Debug,Ke as Decimal,Di as Extensions,ir as MetricsClient,tt as NotFoundError,ae as PrismaClientInitializationError,me as PrismaClientKnownRequestError,rt as PrismaClientRustPanicError,Re as PrismaClientUnknownRequestError,ge as PrismaClientValidationError,Ni as Public,Ae as Sql,$i as Types,jc as defineDmmfProperty,qc as empty,Id as getPrismaClient,$c as join,_d as makeStrictEnum,Mo as objectEnumValues,Us as raw,$s as sqltag,export_warnEnvConflicts as warnEnvConflicts,sn as warnOnce}; -//# sourceMappingURL=edge-esm.js.map diff --git a/chase/backend/prisma/generated/client/runtime/edge.js b/chase/backend/prisma/generated/client/runtime/edge.js deleted file mode 100644 index 20658da6..00000000 --- a/chase/backend/prisma/generated/client/runtime/edge.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict";var el=Object.create;var Nr=Object.defineProperty;var tl=Object.getOwnPropertyDescriptor;var rl=Object.getOwnPropertyNames;var nl=Object.getPrototypeOf,ol=Object.prototype.hasOwnProperty;var Br=(e,t)=>()=>(e&&(t=e(e=0)),t);var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),er=(e,t)=>{for(var r in t)Nr(e,r,{get:t[r],enumerable:!0})},xi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rl(t))!ol.call(e,o)&&o!==r&&Nr(e,o,{get:()=>t[o],enumerable:!(n=tl(t,o))||n.enumerable});return e};var Te=(e,t,r)=>(r=e!=null?el(nl(e)):{},xi(t||!e||!e.__esModule?Nr(r,"default",{value:e,enumerable:!0}):r,e)),il=e=>xi(Nr({},"__esModule",{value:!0}),e);function L(e){return()=>e}function Ie(){return y}var y,p=Br(()=>{"use strict";y={abort:L(void 0),addListener:L(Ie()),allowedNodeEnvironmentFlags:new Set,arch:"x64",argv:["/bin/node"],argv0:"node",chdir:L(void 0),config:{target_defaults:{cflags:[],default_configuration:"",defines:[],include_dirs:[],libraries:[]},variables:{clang:0,host_arch:"x64",node_install_npm:!1,node_install_waf:!1,node_prefix:"",node_shared_openssl:!1,node_shared_v8:!1,node_shared_zlib:!1,node_use_dtrace:!1,node_use_etw:!1,node_use_openssl:!1,target_arch:"x64",v8_no_strict_aliasing:0,v8_use_snapshot:!1,visibility:""}},connected:!1,cpuUsage:()=>({user:0,system:0}),cwd:()=>"/",debugPort:0,disconnect:L(void 0),constrainedMemory:()=>{},emit:L(Ie()),emitWarning:L(void 0),env:{},eventNames:()=>[],execArgv:[],execPath:"/",exit:L(void 0),features:{inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1},getMaxListeners:L(0),getegid:L(0),geteuid:L(0),getgid:L(0),getgroups:L([]),getuid:L(0),hasUncaughtExceptionCaptureCallback:L(!1),hrtime:L([0,0]),platform:"linux",kill:L(!0),listenerCount:L(0),listeners:L([]),memoryUsage:L({arrayBuffers:0,external:0,heapTotal:0,heapUsed:0,rss:0}),nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},off:L(Ie()),on:L(Ie()),once:L(Ie()),openStdin:L({}),pid:0,ppid:0,prependListener:L(Ie()),prependOnceListener:L(Ie()),rawListeners:L([]),release:{name:"node"},removeAllListeners:L(Ie()),removeListener:L(Ie()),resourceUsage:L({fsRead:0,fsWrite:0,involuntaryContextSwitches:0,ipcReceived:0,ipcSent:0,majorPageFault:0,maxRSS:0,minorPageFault:0,sharedMemorySize:0,signalsCount:0,swappedOut:0,systemCPUTime:0,unsharedDataSize:0,unsharedStackSize:0,userCPUTime:0,voluntaryContextSwitches:0}),setMaxListeners:L(Ie()),setUncaughtExceptionCaptureCallback:L(void 0),setegid:L(void 0),seteuid:L(void 0),setgid:L(void 0),setgroups:L(void 0),setuid:L(void 0),stderr:{fd:2},stdin:{fd:0},stdout:{fd:1},title:"node",traceDeprecation:!1,umask:L(0),uptime:L(0),version:"",versions:{http_parser:"",node:"",v8:"",ares:"",uv:"",zlib:"",modules:"",openssl:""}}});var h,f=Br(()=>{"use strict";h=()=>{};h.prototype=h});var Bi=z(St=>{"use strict";d();p();f();var vi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sl=vi(e=>{"use strict";e.byteLength=u,e.toByteArray=c,e.fromByteArray=w;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(i=0,s=o.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var T=E.indexOf("=");T===-1&&(T=x);var R=T===x?0:4-T%4;return[T,R]}function u(E){var x=a(E),T=x[0],R=x[1];return(T+R)*3/4-R}function l(E,x,T){return(x+T)*3/4-T}function c(E){var x,T=a(E),R=T[0],S=T[1],C=new n(l(E,R,S)),M=0,N=S>0?R-4:R,B;for(B=0;B>16&255,C[M++]=x>>8&255,C[M++]=x&255;return S===2&&(x=r[E.charCodeAt(B)]<<2|r[E.charCodeAt(B+1)]>>4,C[M++]=x&255),S===1&&(x=r[E.charCodeAt(B)]<<10|r[E.charCodeAt(B+1)]<<4|r[E.charCodeAt(B+2)]>>2,C[M++]=x>>8&255,C[M++]=x&255),C}function m(E){return t[E>>18&63]+t[E>>12&63]+t[E>>6&63]+t[E&63]}function g(E,x,T){for(var R,S=[],C=x;CN?N:M+C));return R===1?(x=E[T-1],S.push(t[x>>2]+t[x<<4&63]+"==")):R===2&&(x=(E[T-2]<<8)+E[T-1],S.push(t[x>>10]+t[x>>4&63]+t[x<<2&63]+"=")),S.join("")}}),al=vi(e=>{e.read=function(t,r,n,o,i){var s,a,u=i*8-o-1,l=(1<>1,m=-7,g=n?i-1:0,w=n?-1:1,E=t[r+g];for(g+=w,s=E&(1<<-m)-1,E>>=-m,m+=u;m>0;s=s*256+t[r+g],g+=w,m-=8);for(a=s&(1<<-m)-1,s>>=-m,m+=o;m>0;a=a*256+t[r+g],g+=w,m-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(E?-1:1)*(1/0);a=a+Math.pow(2,o),s=s-c}return(E?-1:1)*a*Math.pow(2,s-o)},e.write=function(t,r,n,o,i,s){var a,u,l,c=s*8-i-1,m=(1<>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=o?0:s-1,x=o?1:-1,T=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=m):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+g>=1?r+=w/l:r+=w*Math.pow(2,1-g),r*l>=2&&(a++,l/=2),a+g>=m?(u=0,a=m):a+g>=1?(u=(r*l-1)*Math.pow(2,i),a=a+g):(u=r*Math.pow(2,g-1)*Math.pow(2,i),a=0));i>=8;t[n+E]=u&255,E+=x,u/=256,i-=8);for(a=a<0;t[n+E]=a&255,E+=x,a/=256,c-=8);t[n+E-x]|=T*128}}),Qn=sl(),Mt=al(),bi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;St.Buffer=P;St.SlowBuffer=dl;St.INSPECT_MAX_BYTES=50;var Lr=2147483647;St.kMaxLength=Lr;P.TYPED_ARRAY_SUPPORT=ul();!P.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ul(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(P.prototype,"parent",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.buffer}});Object.defineProperty(P.prototype,"offset",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.byteOffset}});function qe(e){if(e>Lr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,P.prototype),t}function P(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Hn(e)}return Ai(e,t,r)}P.poolSize=8192;function Ai(e,t,r){if(typeof e=="string")return cl(e,t);if(ArrayBuffer.isView(e))return pl(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ke(e,ArrayBuffer)||e&&ke(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(e,SharedArrayBuffer)||e&&ke(e.buffer,SharedArrayBuffer)))return Ci(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return P.from(n,t,r);let o=fl(e);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return P.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}P.from=function(e,t,r){return Ai(e,t,r)};Object.setPrototypeOf(P.prototype,Uint8Array.prototype);Object.setPrototypeOf(P,Uint8Array);function Ti(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function ll(e,t,r){return Ti(e),e<=0?qe(e):t!==void 0?typeof r=="string"?qe(e).fill(t,r):qe(e).fill(t):qe(e)}P.alloc=function(e,t,r){return ll(e,t,r)};function Hn(e){return Ti(e),qe(e<0?0:zn(e)|0)}P.allocUnsafe=function(e){return Hn(e)};P.allocUnsafeSlow=function(e){return Hn(e)};function cl(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!P.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=Mi(e,t)|0,n=qe(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}function Gn(e){let t=e.length<0?0:zn(e.length)|0,r=qe(t);for(let n=0;n=Lr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Lr.toString(16)+" bytes");return e|0}function dl(e){return+e!=e&&(e=0),P.alloc(+e)}P.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==P.prototype};P.compare=function(e,t){if(ke(e,Uint8Array)&&(e=P.from(e,e.offset,e.byteLength)),ke(t,Uint8Array)&&(t=P.from(t,t.offset,t.byteLength)),!P.isBuffer(e)||!P.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);on.length?(P.isBuffer(i)||(i=P.from(i)),i.copy(n,o)):Uint8Array.prototype.set.call(n,i,o);else if(P.isBuffer(i))i.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=i.length}return n};function Mi(e,t){if(P.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ke(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Wn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Ni(e).length;default:if(o)return n?-1:Wn(e).length;t=(""+t).toLowerCase(),o=!0}}P.byteLength=Mi;function ml(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Al(this,t,r);case"utf8":case"utf-8":return Si(this,t,r);case"ascii":return Pl(this,t,r);case"latin1":case"binary":return vl(this,t,r);case"base64":return wl(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tl(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}P.prototype._isBuffer=!0;function dt(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}P.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};bi&&(P.prototype[bi]=P.prototype.inspect);P.prototype.compare=function(e,t,r,n,o){if(ke(e,Uint8Array)&&(e=P.from(e,e.offset,e.byteLength)),!P.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let i=o-n,s=r-t,a=Math.min(i,s),u=this.slice(n,o),l=e.slice(t,r);for(let c=0;c2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Yn(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof t=="string"&&(t=P.from(t,n)),P.isBuffer(t))return t.length===0?-1:wi(e,t,r,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):wi(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function wi(e,t,r,n,o){let i=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;i=2,s/=2,a/=2,r/=2}function u(c,m){return i===1?c[m]:c.readUInt16BE(m*i)}let l;if(o){let c=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let c=!0;for(let m=0;mo&&(n=o)):n=o;let i=t.length;n>i/2&&(n=i/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return gl(this,e,t,r);case"utf8":case"utf-8":return yl(this,e,t,r);case"ascii":case"latin1":case"binary":return hl(this,e,t,r);case"base64":return xl(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bl(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}};P.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wl(e,t,r){return t===0&&r===e.length?Qn.fromByteArray(e):Qn.fromByteArray(e.slice(t,r))}function Si(e,t,r){r=Math.min(e.length,r);let n=[],o=t;for(;o239?4:i>223?3:i>191?2:1;if(o+a<=r){let u,l,c,m;switch(a){case 1:i<128&&(s=i);break;case 2:u=e[o+1],(u&192)===128&&(m=(i&31)<<6|u&63,m>127&&(s=m));break;case 3:u=e[o+1],l=e[o+2],(u&192)===128&&(l&192)===128&&(m=(i&15)<<12|(u&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:u=e[o+1],l=e[o+2],c=e[o+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(m=(i&15)<<18|(u&63)<<12|(l&63)<<6|c&63,m>65535&&m<1114112&&(s=m))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),o+=a}return El(n)}var Ei=4096;function El(e){let t=e.length;if(t<=Ei)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let o="";for(let i=t;ir&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}P.prototype.readUintLE=P.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||ee(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>0,t=t>>>0,r||ee(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n};P.prototype.readUint8=P.prototype.readUInt8=function(e,t){return e=e>>>0,t||ee(e,1,this.length),this[e]};P.prototype.readUint16LE=P.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||ee(e,2,this.length),this[e]|this[e+1]<<8};P.prototype.readUint16BE=P.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||ee(e,2,this.length),this[e]<<8|this[e+1]};P.prototype.readUint32LE=P.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};P.prototype.readUint32BE=P.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};P.prototype.readBigUInt64LE=Ze(function(e){e=e>>>0,Rt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&tr(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<>>0,Rt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&tr(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||ee(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n};P.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||ee(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};P.prototype.readInt8=function(e,t){return e=e>>>0,t||ee(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};P.prototype.readInt16LE=function(e,t){e=e>>>0,t||ee(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};P.prototype.readInt16BE=function(e,t){e=e>>>0,t||ee(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};P.prototype.readInt32LE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};P.prototype.readInt32BE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};P.prototype.readBigInt64LE=Ze(function(e){e=e>>>0,Rt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&tr(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,Rt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&tr(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||ee(e,4,this.length),Mt.read(this,e,!0,23,4)};P.prototype.readFloatBE=function(e,t){return e=e>>>0,t||ee(e,4,this.length),Mt.read(this,e,!1,23,4)};P.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||ee(e,8,this.length),Mt.read(this,e,!0,52,8)};P.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||ee(e,8,this.length),Mt.read(this,e,!1,52,8)};function he(e,t,r,n,o,i){if(!P.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}P.prototype.writeUintLE=P.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;he(this,e,t,r,s,0)}let o=1,i=0;for(this[t]=e&255;++i>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;he(this,e,t,r,s,0)}let o=r-1,i=1;for(this[t+o]=e&255;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r};P.prototype.writeUint8=P.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,1,255,0),this[t]=e&255,t+1};P.prototype.writeUint16LE=P.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};P.prototype.writeUint16BE=P.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};P.prototype.writeUint32LE=P.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};P.prototype.writeUint32BE=P.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Oi(e,t,r,n,o){_i(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function Fi(e,t,r,n,o){_i(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i=i>>8,e[r+6]=i,i=i>>8,e[r+5]=i,i=i>>8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}P.prototype.writeBigUInt64LE=Ze(function(e,t=0){return Oi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});P.prototype.writeBigUInt64BE=Ze(function(e,t=0){return Fi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});P.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);he(this,e,t,r,a-1,-a)}let o=0,i=1,s=0;for(this[t]=e&255;++o>0)-s&255;return t+r};P.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);he(this,e,t,r,a-1,-a)}let o=r-1,i=1,s=0;for(this[t+o]=e&255;--o>=0&&(i*=256);)e<0&&s===0&&this[t+o+1]!==0&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r};P.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};P.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};P.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};P.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};P.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||he(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};P.prototype.writeBigInt64LE=Ze(function(e,t=0){return Oi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});P.prototype.writeBigInt64BE=Ze(function(e,t=0){return Fi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ii(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ki(e,t,r,n,o){return t=+t,r=r>>>0,o||Ii(e,t,r,4,34028234663852886e22,-34028234663852886e22),Mt.write(e,t,r,n,23,4),r+4}P.prototype.writeFloatLE=function(e,t,r){return ki(this,e,t,!0,r)};P.prototype.writeFloatBE=function(e,t,r){return ki(this,e,t,!1,r)};function Di(e,t,r,n,o){return t=+t,r=r>>>0,o||Ii(e,t,r,8,17976931348623157e292,-17976931348623157e292),Mt.write(e,t,r,n,52,8),r+8}P.prototype.writeDoubleLE=function(e,t,r){return Di(this,e,t,!0,r)};P.prototype.writeDoubleBE=function(e,t,r){return Di(this,e,t,!1,r)};P.prototype.copy=function(e,t,r,n){if(!P.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o2**32?o=Pi(String(r)):typeof r=="bigint"&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=Pi(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function Pi(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Cl(e,t,r){Rt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&tr(t,e.length-(r+1))}function _i(e,t,r,n,o,i){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(i+1)*8}${s}`:a=`>= -(2${s} ** ${(i+1)*8-1}${s}) and < 2 ** ${(i+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Ct.ERR_OUT_OF_RANGE("value",a,e)}Cl(n,o,i)}function Rt(e,t){if(typeof e!="number")throw new Ct.ERR_INVALID_ARG_TYPE(t,"number",e)}function tr(e,t,r){throw Math.floor(e)!==e?(Rt(e,r),new Ct.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Ct.ERR_BUFFER_OUT_OF_BOUNDS:new Ct.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Ml=/[^+/0-9A-Za-z-_]/g;function Rl(e){if(e=e.split("=")[0],e=e.trim().replace(Ml,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Wn(e,t){t=t||1/0;let r,n=e.length,o=null,i=[];for(let s=0;s55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function Sl(e){let t=[];for(let r=0;r>8,o=r%256,i.push(o),i.push(n);return i}function Ni(e){return Qn.toByteArray(Rl(e))}function jr(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function ke(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Yn(e){return e!==e}var Fl=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Ze(e){return typeof BigInt>"u"?Il:e}function Il(){throw new Error("BigInt not supported")}});var b,d=Br(()=>{"use strict";b=Te(Bi())});var po=z(j=>{"use strict";d();p();f();var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qi=G((e,t)=>{"use strict";t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},n=Symbol("test"),o=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var i=42;r[n]=i;for(n in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var s=Object.getOwnPropertySymbols(r);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(r,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(r,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}}),Qr=G((e,t)=>{"use strict";var r=Qi();t.exports=function(){return r()&&!!Symbol.toStringTag}}),kl=G((e,t)=>{"use strict";var r=typeof Symbol<"u"&&Symbol,n=Qi();t.exports=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()}}),Dl=G((e,t)=>{"use strict";var r={foo:{}},n=Object;t.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof n)}}),_l=G((e,t)=>{"use strict";var r="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,o=Object.prototype.toString,i="[object Function]";t.exports=function(s){var a=this;if(typeof a!="function"||o.call(a)!==i)throw new TypeError(r+a);for(var u=n.call(arguments,1),l,c=function(){if(this instanceof l){var x=a.apply(this,u.concat(n.call(arguments)));return Object(x)===x?x:this}else return a.apply(s,u.concat(n.call(arguments)))},m=Math.max(0,a.length-u.length),g=[],w=0;w{"use strict";var r=_l();t.exports=h.prototype.bind||r}),Nl=G((e,t)=>{"use strict";var r=so();t.exports=r.call(h.call,Object.prototype.hasOwnProperty)}),ao=G((e,t)=>{"use strict";var r,n=SyntaxError,o=h,i=TypeError,s=function($){try{return o('"use strict"; return ('+$+").constructor;")()}catch(U){}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch($){a=null}var u=function(){throw new i},l=a?function(){try{return arguments.callee,u}catch($){try{return a(arguments,"callee").get}catch(U){return u}}}():u,c=kl()(),m=Dl()(),g=Object.getPrototypeOf||(m?function($){return $.__proto__}:null),w={},E=typeof Uint8Array>"u"||!g?r:g(Uint8Array),x={"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":c&&g?g([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":void 0,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c&&g?g(g([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!c||!g?r:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!c||!g?r:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c&&g?g(""[Symbol.iterator]()):r,"%Symbol%":c?Symbol:r,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":E,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet};if(g)try{null.error}catch($){T=g(g($)),x["%Error.prototype%"]=T}var T,R=function $(U){var O;if(U==="%AsyncFunction%")O=s("async function () {}");else if(U==="%GeneratorFunction%")O=s("function* () {}");else if(U==="%AsyncGeneratorFunction%")O=s("async function* () {}");else if(U==="%AsyncGenerator%"){var ie=$("%AsyncGeneratorFunction%");ie&&(O=ie.prototype)}else if(U==="%AsyncIteratorPrototype%"){var se=$("%AsyncGenerator%");se&&g&&(O=g(se.prototype))}return x[U]=O,O},S={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},C=so(),M=Nl(),N=C.call(h.call,Array.prototype.concat),B=C.call(h.apply,Array.prototype.splice),de=C.call(h.call,String.prototype.replace),V=C.call(h.call,String.prototype.slice),W=C.call(h.call,RegExp.prototype.exec),Pe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,ve=function($){var U=V($,0,1),O=V($,-1);if(U==="%"&&O!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");if(O==="%"&&U!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var ie=[];return de($,Pe,function(se,He,Y,ct){ie[ie.length]=Y?de(ct,H,"$1"):He||se}),ie},We=function($,U){var O=$,ie;if(M(S,O)&&(ie=S[O],O="%"+ie[0]+"%"),M(x,O)){var se=x[O];if(se===w&&(se=R(O)),typeof se>"u"&&!U)throw new i("intrinsic "+$+" exists, but is not available. Please file an issue!");return{alias:ie,name:O,value:se}}throw new n("intrinsic "+$+" does not exist!")};t.exports=function($,U){if(typeof $!="string"||$.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof U!="boolean")throw new i('"allowMissing" argument must be a boolean');if(W(/^%?[^%]*%?$/,$)===null)throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var O=ve($),ie=O.length>0?O[0]:"",se=We("%"+ie+"%",U),He=se.name,Y=se.value,ct=!1,ze=se.alias;ze&&(ie=ze[0],B(O,N([0,1],ze)));for(var pt=1,$e=!0;pt=O.length){var Tt=a(Y,me);$e=!!Tt,$e&&"get"in Tt&&!("originalValue"in Tt.get)?Y=Tt.get:Y=Y[me]}else $e=M(Y,me),Y=Y[me];$e&&!ct&&(x[He]=Y)}}return Y}}),Bl=G((e,t)=>{"use strict";var r=so(),n=ao(),o=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||r.call(i,o),a=n("%Object.getOwnPropertyDescriptor%",!0),u=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(u)try{u({},"a",{value:1})}catch(m){u=null}t.exports=function(m){var g=s(r,i,arguments);if(a&&u){var w=a(g,"length");w.configurable&&u(g,"length",{value:1+l(0,m.length-(arguments.length-1))})}return g};var c=function(){return s(r,o,arguments)};u?u(t.exports,"apply",{value:c}):t.exports.apply=c}),uo=G((e,t)=>{"use strict";var r=ao(),n=Bl(),o=n(r("String.prototype.indexOf"));t.exports=function(i,s){var a=r(i,!!s);return typeof a=="function"&&o(i,".prototype.")>-1?n(a):a}}),Ll=G((e,t)=>{"use strict";var r=Qr()(),n=uo(),o=n("Object.prototype.toString"),i=function(u){return r&&u&&typeof u=="object"&&Symbol.toStringTag in u?!1:o(u)==="[object Arguments]"},s=function(u){return i(u)?!0:u!==null&&typeof u=="object"&&typeof u.length=="number"&&u.length>=0&&o(u)!=="[object Array]"&&o(u.callee)==="[object Function]"},a=function(){return i(arguments)}();i.isLegacyArguments=s,t.exports=a?i:s}),jl=G((e,t)=>{"use strict";var r=Object.prototype.toString,n=h.prototype.toString,o=/^\s*(?:function)?\*/,i=Qr()(),s=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return h("return function*() {}")()}catch(l){}},u;t.exports=function(l){if(typeof l!="function")return!1;if(o.test(n.call(l)))return!0;if(!i){var c=r.call(l);return c==="[object GeneratorFunction]"}if(!s)return!1;if(typeof u>"u"){var m=a();u=m?s(m):!1}return s(l)===u}}),Ul=G((e,t)=>{"use strict";var r=h.prototype.toString,n=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,o,i;if(typeof n=="function"&&typeof Object.defineProperty=="function")try{o=Object.defineProperty({},"length",{get:function(){throw i}}),i={},n(function(){throw 42},null,o)}catch(M){M!==i&&(n=null)}else n=null;var s=/^\s*class\b/,a=function(M){try{var N=r.call(M);return s.test(N)}catch(B){return!1}},u=function(M){try{return a(M)?!1:(r.call(M),!0)}catch(N){return!1}},l=Object.prototype.toString,c="[object Object]",m="[object Function]",g="[object GeneratorFunction]",w="[object HTMLAllCollection]",E="[object HTML document.all class]",x="[object HTMLCollection]",T=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),S=function(){return!1};typeof document=="object"&&(C=document.all,l.call(C)===l.call(document.all)&&(S=function(M){if((R||!M)&&(typeof M>"u"||typeof M=="object"))try{var N=l.call(M);return(N===w||N===E||N===x||N===c)&&M("")==null}catch(B){}return!1}));var C;t.exports=n?function(M){if(S(M))return!0;if(!M||typeof M!="function"&&typeof M!="object")return!1;try{n(M,null,o)}catch(N){if(N!==i)return!1}return!a(M)&&u(M)}:function(M){if(S(M))return!0;if(!M||typeof M!="function"&&typeof M!="object")return!1;if(T)return u(M);if(a(M))return!1;var N=l.call(M);return N!==m&&N!==g&&!/^\[object HTML/.test(N)?!1:u(M)}}),Gi=G((e,t)=>{"use strict";var r=Ul(),n=Object.prototype.toString,o=Object.prototype.hasOwnProperty,i=function(l,c,m){for(var g=0,w=l.length;g=3&&(g=m),n.call(l)==="[object Array]"?i(l,c,g):typeof l=="string"?s(l,c,g):a(l,c,g)};t.exports=u}),Wi=G((e,t)=>{"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n=typeof globalThis>"u"?global:globalThis;t.exports=function(){for(var o=[],i=0;i{"use strict";var r=ao(),n=r("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(o){n=null}t.exports=n}),zi=G((e,t)=>{"use strict";var r=Gi(),n=Wi(),o=uo(),i=o("Object.prototype.toString"),s=Qr()(),a=Hi(),u=typeof globalThis>"u"?global:globalThis,l=n(),c=o("Array.prototype.indexOf",!0)||function(x,T){for(var R=0;R-1}return a?E(x):!1}}),$l=G((e,t)=>{"use strict";var r=Gi(),n=Wi(),o=uo(),i=Hi(),s=o("Object.prototype.toString"),a=Qr()(),u=typeof globalThis>"u"?global:globalThis,l=n(),c=o("String.prototype.slice"),m={},g=Object.getPrototypeOf;a&&i&&g&&r(l,function(x){if(typeof u[x]=="function"){var T=new u[x];if(Symbol.toStringTag in T){var R=g(T),S=i(R,Symbol.toStringTag);if(!S){var C=g(R);S=i(C,Symbol.toStringTag)}m[x]=S.get}}});var w=function(x){var T=!1;return r(m,function(R,S){if(!T)try{var C=R.call(x);C===S&&(T=C)}catch(M){}}),T},E=zi();t.exports=function(x){return E(x)?!a||!(Symbol.toStringTag in x)?c(s(x),8,-1):w(x):!1}}),ql=G(e=>{"use strict";var t=Ll(),r=jl(),n=$l(),o=zi();function i(A){return A.call.bind(A)}var s=typeof BigInt<"u",a=typeof Symbol<"u",u=i(Object.prototype.toString),l=i(Number.prototype.valueOf),c=i(String.prototype.valueOf),m=i(Boolean.prototype.valueOf);s&&(g=i(BigInt.prototype.valueOf));var g;a&&(w=i(Symbol.prototype.valueOf));var w;function E(A,Xu){if(typeof A!="object")return!1;try{return Xu(A),!0}catch(Ld){return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function x(A){return typeof Promise<"u"&&A instanceof Promise||A!==null&&typeof A=="object"&&typeof A.then=="function"&&typeof A.catch=="function"}e.isPromise=x;function T(A){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(A):o(A)||pt(A)}e.isArrayBufferView=T;function R(A){return n(A)==="Uint8Array"}e.isUint8Array=R;function S(A){return n(A)==="Uint8ClampedArray"}e.isUint8ClampedArray=S;function C(A){return n(A)==="Uint16Array"}e.isUint16Array=C;function M(A){return n(A)==="Uint32Array"}e.isUint32Array=M;function N(A){return n(A)==="Int8Array"}e.isInt8Array=N;function B(A){return n(A)==="Int16Array"}e.isInt16Array=B;function de(A){return n(A)==="Int32Array"}e.isInt32Array=de;function V(A){return n(A)==="Float32Array"}e.isFloat32Array=V;function W(A){return n(A)==="Float64Array"}e.isFloat64Array=W;function Pe(A){return n(A)==="BigInt64Array"}e.isBigInt64Array=Pe;function H(A){return n(A)==="BigUint64Array"}e.isBigUint64Array=H;function ve(A){return u(A)==="[object Map]"}ve.working=typeof Map<"u"&&ve(new Map);function We(A){return typeof Map>"u"?!1:ve.working?ve(A):A instanceof Map}e.isMap=We;function $(A){return u(A)==="[object Set]"}$.working=typeof Set<"u"&&$(new Set);function U(A){return typeof Set>"u"?!1:$.working?$(A):A instanceof Set}e.isSet=U;function O(A){return u(A)==="[object WeakMap]"}O.working=typeof WeakMap<"u"&&O(new WeakMap);function ie(A){return typeof WeakMap>"u"?!1:O.working?O(A):A instanceof WeakMap}e.isWeakMap=ie;function se(A){return u(A)==="[object WeakSet]"}se.working=typeof WeakSet<"u"&&se(new WeakSet);function He(A){return se(A)}e.isWeakSet=He;function Y(A){return u(A)==="[object ArrayBuffer]"}Y.working=typeof ArrayBuffer<"u"&&Y(new ArrayBuffer);function ct(A){return typeof ArrayBuffer>"u"?!1:Y.working?Y(A):A instanceof ArrayBuffer}e.isArrayBuffer=ct;function ze(A){return u(A)==="[object DataView]"}ze.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ze(new DataView(new ArrayBuffer(1),0,1));function pt(A){return typeof DataView>"u"?!1:ze.working?ze(A):A instanceof DataView}e.isDataView=pt;var $e=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function me(A){return u(A)==="[object SharedArrayBuffer]"}function ft(A){return typeof $e>"u"?!1:(typeof me.working>"u"&&(me.working=me(new $e)),me.working?me(A):A instanceof $e)}e.isSharedArrayBuffer=ft;function At(A){return u(A)==="[object AsyncFunction]"}e.isAsyncFunction=At;function Tt(A){return u(A)==="[object Map Iterator]"}e.isMapIterator=Tt;function Wu(A){return u(A)==="[object Set Iterator]"}e.isSetIterator=Wu;function Hu(A){return u(A)==="[object Generator]"}e.isGeneratorObject=Hu;function zu(A){return u(A)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=zu;function di(A){return E(A,l)}e.isNumberObject=di;function mi(A){return E(A,c)}e.isStringObject=mi;function gi(A){return E(A,m)}e.isBooleanObject=gi;function yi(A){return s&&E(A,g)}e.isBigIntObject=yi;function hi(A){return a&&E(A,w)}e.isSymbolObject=hi;function Zu(A){return di(A)||mi(A)||gi(A)||yi(A)||hi(A)}e.isBoxedPrimitive=Zu;function Yu(A){return typeof Uint8Array<"u"&&(ct(A)||ft(A))}e.isAnyArrayBuffer=Yu,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(A){Object.defineProperty(e,A,{enumerable:!1,value:function(){throw new Error(A+" is not supported in userland")}})})}),Vl=G((e,t)=>{t.exports=function(r){return r instanceof b.Buffer}}),Kl=G((e,t)=>{typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var o=function(){};o.prototype=n.prototype,r.prototype=new o,r.prototype.constructor=r}}}),Zi=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=o)return u;switch(u){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(l){return"[Circular]"}default:return u}}),s=n[r];r"u")return function(){return j.deprecate(e,t).apply(this,arguments)};var r=!1;function n(){if(!r){if(y.throwDeprecation)throw new Error(t);y.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}return n};var $r={},Yi=/^$/;y.env.NODE_DEBUG&&(qr=y.env.NODE_DEBUG,qr=qr.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Yi=new RegExp("^"+qr+"$","i"));var qr;j.debuglog=function(e){if(e=e.toUpperCase(),!$r[e])if(Yi.test(e)){var t=y.pid;$r[e]=function(){var r=j.format.apply(j,arguments);console.error("%s %d: %s",e,t,r)}}else $r[e]=function(){};return $r[e]};function Xe(e,t){var r={seen:[],stylize:Gl};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),lo(t)?r.showHidden=t:t&&j._extend(r,t),gt(r.showHidden)&&(r.showHidden=!1),gt(r.depth)&&(r.depth=2),gt(r.colors)&&(r.colors=!1),gt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ql),Kr(r,e,r.depth)}j.inspect=Xe;Xe.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Xe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ql(e,t){var r=Xe.styles[t];return r?"\x1B["+Xe.colors[r][0]+"m"+e+"\x1B["+Xe.colors[r][1]+"m":e}function Gl(e,t){return e}function Wl(e){var t={};return e.forEach(function(r,n){t[r]=!0}),t}function Kr(e,t,r){if(e.customInspect&&t&&Vr(t.inspect)&&t.inspect!==j.inspect&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(r,e);return Wr(n)||(n=Kr(e,n,r)),n}var o=Hl(e,t);if(o)return o;var i=Object.keys(t),s=Wl(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),nr(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return no(t);if(i.length===0){if(Vr(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(rr(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Jr(t))return e.stylize(Date.prototype.toString.call(t),"date");if(nr(t))return no(t)}var u="",l=!1,c=["{","}"];if(Xi(t)&&(l=!0,c=["[","]"]),Vr(t)){var m=t.name?": "+t.name:"";u=" [Function"+m+"]"}if(rr(t)&&(u=" "+RegExp.prototype.toString.call(t)),Jr(t)&&(u=" "+Date.prototype.toUTCString.call(t)),nr(t)&&(u=" "+no(t)),i.length===0&&(!l||t.length==0))return c[0]+u+c[1];if(r<0)return rr(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var g;return l?g=zl(e,t,r,s,i):g=i.map(function(w){return io(e,t,r,s,w,l)}),e.seen.pop(),Zl(g,u,c)}function Hl(e,t){if(gt(t))return e.stylize("undefined","undefined");if(Wr(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(es(t))return e.stylize(""+t,"number");if(lo(t))return e.stylize(""+t,"boolean");if(Gr(t))return e.stylize("null","null")}function no(e){return"["+Error.prototype.toString.call(e)+"]"}function zl(e,t,r,n,o){for(var i=[],s=0,a=t.length;s-1&&(i?a=a.split(` -`).map(function(l){return" "+l}).join(` -`).slice(2):a=` -`+a.split(` -`).map(function(l){return" "+l}).join(` -`))):a=e.stylize("[Circular]","special")),gt(s)){if(i&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function Zl(e,t,r){var n=0,o=e.reduce(function(i,s){return n++,s.indexOf(` -`)>=0&&n++,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(t===""?"":t+` - `)+" "+e.join(`, - `)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}j.types=ql();function Xi(e){return Array.isArray(e)}j.isArray=Xi;function lo(e){return typeof e=="boolean"}j.isBoolean=lo;function Gr(e){return e===null}j.isNull=Gr;function Yl(e){return e==null}j.isNullOrUndefined=Yl;function es(e){return typeof e=="number"}j.isNumber=es;function Wr(e){return typeof e=="string"}j.isString=Wr;function Xl(e){return typeof e=="symbol"}j.isSymbol=Xl;function gt(e){return e===void 0}j.isUndefined=gt;function rr(e){return Ot(e)&&co(e)==="[object RegExp]"}j.isRegExp=rr;j.types.isRegExp=rr;function Ot(e){return typeof e=="object"&&e!==null}j.isObject=Ot;function Jr(e){return Ot(e)&&co(e)==="[object Date]"}j.isDate=Jr;j.types.isDate=Jr;function nr(e){return Ot(e)&&(co(e)==="[object Error]"||e instanceof Error)}j.isError=nr;j.types.isNativeError=nr;function Vr(e){return typeof e=="function"}j.isFunction=Vr;function ec(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}j.isPrimitive=ec;j.isBuffer=Vl();function co(e){return Object.prototype.toString.call(e)}function oo(e){return e<10?"0"+e.toString(10):e.toString(10)}var tc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function rc(){var e=new Date,t=[oo(e.getHours()),oo(e.getMinutes()),oo(e.getSeconds())].join(":");return[e.getDate(),tc[e.getMonth()],t].join(" ")}j.log=function(){console.log("%s - %s",rc(),j.format.apply(j,arguments))};j.inherits=Kl();j._extend=function(e,t){if(!t||!Ot(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};function ts(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var mt=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;j.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(mt&&e[mt]){var t=e[mt];if(typeof t!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,mt,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var r,n,o=new Promise(function(a,u){r=a,n=u}),i=[],s=0;s{"use strict";d();p();f();var Ft=1e3,It=Ft*60,kt=It*60,yt=kt*24,ic=yt*7,sc=yt*365.25;rs.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return ac(e);if(r==="number"&&isFinite(e))return t.long?lc(e):uc(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ac(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*sc;case"weeks":case"week":case"w":return r*ic;case"days":case"day":case"d":return r*yt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*kt;case"minutes":case"minute":case"mins":case"min":case"m":return r*It;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ft;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function uc(e){var t=Math.abs(e);return t>=yt?Math.round(e/yt)+"d":t>=kt?Math.round(e/kt)+"h":t>=It?Math.round(e/It)+"m":t>=Ft?Math.round(e/Ft)+"s":e+"ms"}function lc(e){var t=Math.abs(e);return t>=yt?Hr(e,t,yt,"day"):t>=kt?Hr(e,t,kt,"hour"):t>=It?Hr(e,t,It,"minute"):t>=Ft?Hr(e,t,Ft,"second"):e+" ms"}function Hr(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var fo=z((Zm,os)=>{"use strict";d();p();f();function cc(e){r.debug=r,r.default=r,r.coerce=u,r.disable=i,r.enable=o,r.enabled=s,r.humanize=ns(),r.destroy=l,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let m=0;for(let g=0;g{if(B==="%%")return"%";M++;let V=r.formatters[de];if(typeof V=="function"){let W=T[M];B=V.call(R,W),T.splice(M,1),M--}return B}),r.formatArgs.call(R,T),(R.log||r.log).apply(R,T)}return x.namespace=c,x.useColors=r.useColors(),x.color=r.selectColor(c),x.extend=n,x.destroy=r.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(w!==r.namespaces&&(w=r.namespaces,E=r.enabled(c)),E),set:T=>{g=T}}),typeof r.init=="function"&&r.init(x),x}function n(c,m){let g=r(this.namespace+(typeof m=="undefined"?":":m)+c);return g.log=this.log,g}function o(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let m,g=(typeof c=="string"?c:"").split(/[\s,]+/),w=g.length;for(m=0;m"-"+m)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let m,g;for(m=0,g=r.skips.length;m{"use strict";d();p();f();Ae.formatArgs=fc;Ae.save=dc;Ae.load=mc;Ae.useColors=pc;Ae.storage=gc();Ae.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ae.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function pc(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function fc(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+zr.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),e.splice(n,0,t)}Ae.log=console.debug||console.log||(()=>{});function dc(e){try{e?Ae.storage.setItem("debug",e):Ae.storage.removeItem("debug")}catch(t){}}function mc(){let e;try{e=Ae.storage.getItem("debug")}catch(t){}return!e&&typeof y!="undefined"&&"env"in y&&(e=y.env.DEBUG),e}function gc(){try{return localStorage}catch(e){}}zr.exports=fo()(Ae);var{formatters:yc}=zr.exports;yc.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var mo=z(Zr=>{"use strict";d();p();f();Zr.isatty=function(){return!1};function hc(){throw new Error("tty.ReadStream is not implemented")}Zr.ReadStream=hc;function xc(){throw new Error("tty.WriteStream is not implemented")}Zr.WriteStream=xc});var ss=z(()=>{"use strict";d();p();f()});var us=z((dg,as)=>{"use strict";d();p();f();as.exports=(e,t=y.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n{"use strict";d();p();f();var bc=ss(),ls=mo(),Me=us(),{env:te}=y,et;Me("no-color")||Me("no-colors")||Me("color=false")||Me("color=never")?et=0:(Me("color")||Me("colors")||Me("color=true")||Me("color=always"))&&(et=1);"FORCE_COLOR"in te&&(te.FORCE_COLOR==="true"?et=1:te.FORCE_COLOR==="false"?et=0:et=te.FORCE_COLOR.length===0?1:Math.min(parseInt(te.FORCE_COLOR,10),3));function go(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function yo(e,t){if(et===0)return 0;if(Me("color=16m")||Me("color=full")||Me("color=truecolor"))return 3;if(Me("color=256"))return 2;if(e&&!t&&et===void 0)return 0;let r=et||0;if(te.TERM==="dumb")return r;if(y.platform==="win32"){let n=bc.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in te)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in te)||te.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(te.TEAMCITY_VERSION)?1:0;if(te.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in te){let n=parseInt((te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(te.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(te.TERM)||"COLORTERM"in te?1:r}function wc(e){let t=yo(e,e&&e.isTTY);return go(t)}cs.exports={supportsColor:wc,stdout:go(yo(!0,ls.isatty(1))),stderr:go(yo(!0,ls.isatty(2)))}});var ds=z((ae,Xr)=>{"use strict";d();p();f();var Ec=mo(),Yr=po();ae.init=Rc;ae.log=Tc;ae.formatArgs=vc;ae.save=Cc;ae.load=Mc;ae.useColors=Pc;ae.destroy=Yr.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ae.colors=[6,2,3,4,5,1];try{let e=ps();e&&(e.stderr||e).level>=2&&(ae.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}ae.inspectOpts=Object.keys(y.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),n=y.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function Pc(){return"colors"in ae.inspectOpts?!!ae.inspectOpts.colors:Ec.isatty(y.stderr.fd)}function vc(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(` -`).join(` -`+i),e.push(o+"m+"+Xr.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Ac()+t+" "+e[0]}function Ac(){return ae.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Tc(...e){return y.stderr.write(Yr.format(...e)+` -`)}function Cc(e){e?y.env.DEBUG=e:delete y.env.DEBUG}function Mc(){return y.env.DEBUG}function Rc(e){e.inspectOpts={};let t=Object.keys(ae.inspectOpts);for(let r=0;rt.trim()).join(" ")};fs.O=function(e){return this.inspectOpts.colors=this.useColors,Yr.inspect(e,this.inspectOpts)}});var ms=z((Ag,ho)=>{"use strict";d();p();f();typeof y=="undefined"||y.type==="renderer"||y.browser===!0||y.__nwjs?ho.exports=is():ho.exports=ds()});function Ic(){return!1}var kc,Dc,an,wo=Br(()=>{"use strict";d();p();f();kc={},Dc={existsSync:Ic,promises:kc},an=Dc});var Eo=z((py,As)=>{"use strict";d();p();f();function De(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function vs(e,t){for(var r="",n=0,o=-1,i=0,s,a=0;a<=e.length;++a){if(a2){var u=r.lastIndexOf("/");if(u!==r.length-1){u===-1?(r="",n=0):(r=r.slice(0,u),n=r.length-1-r.lastIndexOf("/")),o=a,i=0;continue}}else if(r.length===2||r.length===1){r="",n=0,o=a,i=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),n=a-o-1;o=a,i=0}else s===46&&i!==-1?++i:i=-1}return r}function _c(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}var Nt={resolve:function(){for(var e="",t=!1,r,n=arguments.length-1;n>=-1&&!t;n--){var o;n>=0?o=arguments[n]:(r===void 0&&(r=y.cwd()),o=r),De(o),o.length!==0&&(e=o+"/"+e,t=o.charCodeAt(0)===47)}return e=vs(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(De(e),e.length===0)return".";var t=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;return e=vs(e,!t),e.length===0&&!t&&(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return De(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t0&&(e===void 0?e=r:e+="/"+r)}return e===void 0?".":Nt.normalize(e)},relative:function(e,t){if(De(e),De(t),e===t||(e=Nt.resolve(e),t=Nt.resolve(t),e===t))return"";for(var r=1;ru){if(t.charCodeAt(i+c)===47)return t.slice(i+c+1);if(c===0)return t.slice(i+c)}else o>u&&(e.charCodeAt(r+c)===47?l=c:c===0&&(l=0));break}var m=e.charCodeAt(r+c),g=t.charCodeAt(i+c);if(m!==g)break;m===47&&(l=c)}var w="";for(c=r+l+1;c<=n;++c)(c===n||e.charCodeAt(c)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+t.slice(i+l):(i+=l,t.charCodeAt(i)===47&&++i,t.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(De(e),e.length===0)return".";for(var t=e.charCodeAt(0),r=t===47,n=-1,o=!0,i=e.length-1;i>=1;--i)if(t=e.charCodeAt(i),t===47){if(!o){n=i;break}}else o=!1;return n===-1?r?"/":".":r&&n===1?"//":e.slice(0,n)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');De(e);var r=0,n=-1,o=!0,i;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){var u=e.charCodeAt(i);if(u===47){if(!o){r=i+1;break}}else a===-1&&(o=!1,a=i+1),s>=0&&(u===t.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return r===n?n=a:n===-1&&(n=e.length),e.slice(r,n)}else{for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===47){if(!o){r=i+1;break}}else n===-1&&(o=!1,n=i+1);return n===-1?"":e.slice(r,n)}},extname:function(e){De(e);for(var t=-1,r=0,n=-1,o=!0,i=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(a===47){if(!o){r=s+1;break}continue}n===-1&&(o=!1,n=s+1),a===46?t===-1?t=s:i!==1&&(i=1):t!==-1&&(i=-1)}return t===-1||n===-1||i===0||i===1&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return _c("/",e)},parse:function(e){De(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var r=e.charCodeAt(0),n=r===47,o;n?(t.root="/",o=1):o=0;for(var i=-1,s=0,a=-1,u=!0,l=e.length-1,c=0;l>=o;--l){if(r=e.charCodeAt(l),r===47){if(!u){s=l+1;break}continue}a===-1&&(u=!1,a=l+1),r===46?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||a===-1||c===0||c===1&&i===a-1&&i===s+1?a!==-1&&(s===0&&n?t.base=t.name=e.slice(1,a):t.base=t.name=e.slice(s,a)):(s===0&&n?(t.name=e.slice(1,i),t.base=e.slice(1,a)):(t.name=e.slice(s,i),t.base=e.slice(s,a)),t.ext=e.slice(i,a)),s>0?t.dir=e.slice(0,s-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Nt.posix=Nt;As.exports=Nt});var Ms=z((by,Cs)=>{"use strict";d();p();f();Cs.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Ss=z((vy,Rs)=>{"use strict";d();p();f();var Bc=Ms();Rs.exports=e=>{let t=Bc(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Fs=z((Fy,Ao)=>{"use strict";d();p();f();var Lc=Object.prototype.hasOwnProperty,ge="~";function ir(){}Object.create&&(ir.prototype=Object.create(null),new ir().__proto__||(ge=!1));function jc(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function Os(e,t,r,n,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new jc(r,n||e,o),s=ge?ge+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],i]:e._events[s].push(i):(e._events[s]=i,e._eventsCount++),e}function un(e,t){--e._eventsCount===0?e._events=new ir:delete e._events[t]}function le(){this._events=new ir,this._eventsCount=0}le.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)Lc.call(t,r)&&e.push(ge?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};le.prototype.listeners=function(e){var t=ge?ge+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,i=new Array(o);n{"use strict";d();p();f();Is.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Ns=z((Vy,_s)=>{"use strict";d();p();f();_s.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Ls=z((Gy,Bs)=>{"use strict";d();p();f();var Kc=Ns();Bs.exports=e=>typeof e=="string"?e.replace(Kc(),""):e});var qs=z(()=>{"use strict";d();p();f()});var oi=z((nM,ru)=>{"use strict";d();p();f();ru.exports=function(){function e(t,r,n,o,i){return tn?n+1:t+1:o===i?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var o=t.length,i=r.length;o>0&&t.charCodeAt(o-1)===r.charCodeAt(i-1);)o--,i--;for(var s=0;sCe,DMMFClass:()=>Ur,Debug:()=>xo,Decimal:()=>Le,Extensions:()=>Xn,MetricsClient:()=>jt,NotFoundError:()=>Ve,PrismaClientInitializationError:()=>re,PrismaClientKnownRequestError:()=>ce,PrismaClientRustPanicError:()=>Ke,PrismaClientUnknownRequestError:()=>Re,PrismaClientValidationError:()=>pe,Public:()=>eo,Sql:()=>be,Types:()=>to,defineDmmfProperty:()=>$s,empty:()=>Ks,getPrismaClient:()=>Ju,join:()=>Vs,makeStrictEnum:()=>Qu,objectEnumValues:()=>fn,raw:()=>Oo,sqltag:()=>Fo,warnEnvConflicts:()=>void 0,warnOnce:()=>ar});module.exports=il(Bd);d();p();f();var Xn={};er(Xn,{defineExtension:()=>Li,getExtensionContext:()=>ji});d();p();f();d();p();f();function Li(e){return typeof e=="function"?e:t=>t.$extends(e)}d();p();f();function ji(e){return e}var eo={};er(eo,{validator:()=>Ui});d();p();f();d();p();f();function Ui(...e){return t=>t}var to={};er(to,{Extensions:()=>$i,Public:()=>qi,Result:()=>Vi,Utils:()=>Ki});d();p();f();var $i={};d();p();f();var qi={};d();p();f();var Vi={};d();p();f();var Ki={};d();p();f();d();p();f();d();p();f();var Ye=(e,t)=>{let r={};for(let n of e){let o=n[t];r[o]=n}return r};function Ji(e){return e.substring(0,1).toLowerCase()+e.substring(1)}var Ur=class{constructor(t){this.document=t;this.compositeNames=new Set(this.datamodel.types.map(r=>r.name)),this.typeAndModelMap=this.buildTypeModelMap(),this.mappingsMap=this.buildMappingsMap(),this.outputTypeMap=this.buildMergedOutputTypeMap(),this.rootFieldMap=this.buildRootFieldMap(),this.inputTypesByName=this.buildInputTypesMap()}get datamodel(){return this.document.datamodel}get mappings(){return this.document.mappings}get schema(){return this.document.schema}get inputObjectTypes(){return this.schema.inputObjectTypes}get outputObjectTypes(){return this.schema.outputObjectTypes}isComposite(t){return this.compositeNames.has(t)}getOtherOperationNames(){return[Object.values(this.mappings.otherOperations.write),Object.values(this.mappings.otherOperations.read)].flat()}hasEnumInNamespace(t,r){var n;return((n=this.schema.enumTypes[r])==null?void 0:n.find(o=>o.name===t))!==void 0}resolveInputObjectType(t){return this.inputTypesByName.get(ro(t.type,t.namespace))}resolveOutputObjectType(t){var r;if(t.location==="outputObjectTypes")return this.outputObjectTypes[(r=t.namespace)!=null?r:"prisma"].find(n=>n.name===t.type)}buildModelMap(){return Ye(this.datamodel.models,"name")}buildTypeMap(){return Ye(this.datamodel.types,"name")}buildTypeModelMap(){return{...this.buildTypeMap(),...this.buildModelMap()}}buildMappingsMap(){return Ye(this.mappings.modelOperations,"model")}buildMergedOutputTypeMap(){return{model:Ye(this.schema.outputObjectTypes.model,"name"),prisma:Ye(this.schema.outputObjectTypes.prisma,"name")}}buildRootFieldMap(){return{...Ye(this.outputTypeMap.prisma.Query.fields,"name"),...Ye(this.outputTypeMap.prisma.Mutation.fields,"name")}}buildInputTypesMap(){let t=new Map;for(let r of this.inputObjectTypes.prisma)t.set(ro(r.name,"prisma"),r);if(!this.inputObjectTypes.model)return t;for(let r of this.inputObjectTypes.model)t.set(ro(r.name,"model"),r);return t}};function ro(e,t){return t?`${t}.${e}`:e}d();p();f();d();p();f();var Ce;(t=>{let e;(C=>(C.findUnique="findUnique",C.findUniqueOrThrow="findUniqueOrThrow",C.findFirst="findFirst",C.findFirstOrThrow="findFirstOrThrow",C.findMany="findMany",C.create="create",C.createMany="createMany",C.update="update",C.updateMany="updateMany",C.upsert="upsert",C.delete="delete",C.deleteMany="deleteMany",C.groupBy="groupBy",C.count="count",C.aggregate="aggregate",C.findRaw="findRaw",C.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(Ce||(Ce={}));d();p();f();var tn=Te(ms()),Sc=100,en=[],gs,ys;typeof y!="undefined"&&typeof((gs=y.stderr)==null?void 0:gs.write)!="function"&&(tn.default.log=(ys=console.debug)!=null?ys:console.log);function Oc(e){let t=(0,tn.default)(e),r=Object.assign((...n)=>(t.log=r.log,n.length!==0&&en.push([e,...n]),en.length>Sc&&en.shift(),t("",...n)),t);return r}var xo=Object.assign(Oc,tn.default);function hs(){en.length=0}var xe=xo;d();p();f();var bo,xs,bs,ws,Es=!0;typeof y!="undefined"&&({FORCE_COLOR:bo,NODE_DISABLE_COLORS:xs,NO_COLOR:bs,TERM:ws}=y.env||{},Es=y.stdout&&y.stdout.isTTY);var Fc={enabled:!xs&&bs==null&&ws!=="dumb"&&(bo!=null&&bo!=="0"||Es)};function J(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,o=`\x1B[${t}m`;return function(i){return!Fc.enabled||i==null?i:n+(~(""+i).indexOf(o)?i.replace(r,o+n):i)+o}}var Ig=J(0,0),tt=J(1,22),rn=J(2,22),kg=J(3,23),Ps=J(4,24),Dg=J(7,27),_g=J(8,28),Ng=J(9,29),Bg=J(30,39),Dt=J(31,39),nn=J(32,39),on=J(33,39),_t=J(34,39),Lg=J(35,39),rt=J(36,39),jg=J(37,39),sn=J(90,39),Ug=J(90,39),$g=J(40,49),qg=J(41,49),Vg=J(42,49),Kg=J(43,49),Jg=J(44,49),Qg=J(45,49),Gg=J(46,49),Wg=J(47,49);d();p();f();d();p();f();d();p();f();d();p();f();var Ts="library";function Po(e){let t=Nc();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":Ts)}function Nc(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}d();p();f();var or=Te(Eo());function vo(e){return or.default.sep===or.default.posix.sep?e:e.split(or.default.sep).join(or.default.posix.sep)}var Bt={};er(Bt,{error:()=>qc,info:()=>$c,log:()=>Uc,query:()=>Vc,should:()=>Ds,tags:()=>sr,warn:()=>To});d();p();f();var sr={error:Dt("prisma:error"),warn:on("prisma:warn"),info:rt("prisma:info"),query:_t("prisma:query")},Ds={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function Uc(...e){console.log(...e)}function To(e,...t){Ds.warn()&&console.warn(`${sr.warn} ${e}`,...t)}function $c(e,...t){console.info(`${sr.info} ${e}`,...t)}function qc(e,...t){console.error(`${sr.error} ${e}`,...t)}function Vc(e,...t){console.log(`${sr.query} ${e}`,...t)}d();p();f();function ht(e,t){throw new Error(t)}d();p();f();function Co(e,t){return Object.prototype.hasOwnProperty.call(e,t)}d();p();f();var Mo=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});d();p();f();function Lt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}d();p();f();function Ro(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{js.has(e)||(js.add(e),To(t,...r))};d();p();f();var ce=class extends Error{constructor(r,{code:n,clientVersion:o,meta:i,batchRequestIdx:s}){super(r);this.name="PrismaClientKnownRequestError",this.code=n,this.clientVersion=o,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:s,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};k(ce,"PrismaClientKnownRequestError");var Ve=class extends ce{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};k(Ve,"NotFoundError");d();p();f();var re=class e extends Error{constructor(r,n,o){super(r);this.name="PrismaClientInitializationError",this.clientVersion=n,this.errorCode=o,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};k(re,"PrismaClientInitializationError");d();p();f();var Ke=class extends Error{constructor(r,n){super(r);this.name="PrismaClientRustPanicError",this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};k(Ke,"PrismaClientRustPanicError");d();p();f();var Re=class extends Error{constructor(r,{clientVersion:n,batchRequestIdx:o}){super(r);this.name="PrismaClientUnknownRequestError",this.clientVersion=n,Object.defineProperty(this,"batchRequestIdx",{value:o,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};k(Re,"PrismaClientUnknownRequestError");d();p();f();var pe=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};k(pe,"PrismaClientValidationError");d();p();f();var jt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};d();p();f();d();p();f();function ur(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function $s(e,t){let r=ur(()=>Jc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Jc(e){return{datamodel:{models:So(e.models),enums:So(e.enums),types:So(e.types)}}}function So(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}d();p();f();var a2=Te(qs()),Ku=Te(Fs());wo();var _r=Te(Eo());d();p();f();var be=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let o=0,i=0;for(;oe.getPropertyValue(r))},getPropertyDescriptor(r){var n;return(n=e.getPropertyDescriptor)==null?void 0:n.call(e,r)}}}d();p();f();var Gs=Te(po());d();p();f();var ln={enumerable:!0,configurable:!0,writable:!0};function cn(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>ln,has:(r,n)=>t.has(n),set:(r,n,o)=>t.add(n)&&Reflect.set(r,n,o),ownKeys:()=>[...t]}}var Js=Symbol.for("nodejs.util.inspect.custom");function Ne(e,t){let r=Qc(t),n=new Set,o=new Proxy(e,{get(i,s){if(n.has(s))return i[s];let a=r.get(s);return a?a.getPropertyValue(s):i[s]},has(i,s){var u,l;if(n.has(s))return!0;let a=r.get(s);return a?(l=(u=a.has)==null?void 0:u.call(a,s))!=null?l:!0:Reflect.has(i,s)},ownKeys(i){let s=Qs(Reflect.ownKeys(i),r),a=Qs(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(i,s,a){var l,c;let u=r.get(s);return((c=(l=u==null?void 0:u.getPropertyDescriptor)==null?void 0:l.call(u,s))==null?void 0:c.writable)===!1?!1:(n.add(s),Reflect.set(i,s,a))},getOwnPropertyDescriptor(i,s){let a=Reflect.getOwnPropertyDescriptor(i,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...ln,...u==null?void 0:u.getPropertyDescriptor(s)}:ln:a},defineProperty(i,s,a){return n.add(s),Reflect.defineProperty(i,s,a)}});return o[Js]=function(i,s,a=Gs.inspect){let u={...this};return delete u[Js],a(u,s)},o}function Qc(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let o of n)t.set(o,r)}return t}function Qs(e,t){return e.filter(r=>{var o,i;let n=t.get(r);return(i=(o=n==null?void 0:n.has)==null?void 0:o.call(n,r))!=null?i:!0})}d();p();f();function cr(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}d();p();f();d();p();f();var Ut=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};d();p();f();d();p();f();var pn=Symbol(),Io=new WeakMap,Je=class{constructor(t){t===pn?Io.set(this,`Prisma.${this._getName()}`):Io.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Io.get(this)}},pr=class extends Je{_getNamespace(){return"NullTypes"}},fr=class extends pr{};ko(fr,"DbNull");var dr=class extends pr{};ko(dr,"JsonNull");var mr=class extends pr{};ko(mr,"AnyNull");var fn={classes:{DbNull:fr,JsonNull:dr,AnyNull:mr},instances:{DbNull:new fr(pn),JsonNull:new dr(pn),AnyNull:new mr(pn)}};function ko(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}d();p();f();function $t(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function dn(e){return e.toString()!=="Invalid Date"}d();p();f();d();p();f();var qt=9e15,st=1e9,Do="0123456789abcdef",gn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",yn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",_o={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-qt,maxE:qt,crypto:!1},Zs,Qe,D=!0,xn="[DecimalError] ",it=xn+"Invalid argument: ",Ys=xn+"Precision limit exceeded",Xs=xn+"crypto unavailable",ea="[object Decimal]",fe=Math.floor,X=Math.pow,Gc=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Wc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Hc=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ta=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Oe=1e7,I=7,zc=9007199254740991,Zc=gn.length-1,No=yn.length-1,v={toStringTag:ea};v.absoluteValue=v.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),F(e)};v.ceil=function(){return F(new this.constructor(this),this.e+1,2)};v.clampedTo=v.clamp=function(e,t){var r,n=this,o=n.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(it+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new o(n)};v.comparedTo=v.cmp=function(e){var t,r,n,o,i=this,s=i.d,a=(e=new i.constructor(e)).d,u=i.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(i.e!==e.e)return i.e>e.e^u<0?1:-1;for(n=s.length,o=a.length,t=0,r=na[t]^u<0?1:-1;return n===o?0:n>o^u<0?1:-1};v.cosine=v.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+I,n.rounding=1,r=Yc(n,sa(n,r)),n.precision=e,n.rounding=t,F(Qe==2||Qe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};v.cubeRoot=v.cbrt=function(){var e,t,r,n,o,i,s,a,u,l,c=this,m=c.constructor;if(!c.isFinite()||c.isZero())return new m(c);for(D=!1,i=c.s*X(c.s*c,1/3),!i||Math.abs(i)==1/0?(r=ue(c.d),e=c.e,(i=(e-r.length+1)%3)&&(r+=i==1||i==-2?"0":"00"),i=X(r,1/3),e=fe((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?r="5e"+e:(r=i.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new m(r),n.s=c.s):n=new m(i.toString()),s=(e=m.precision)+3;;)if(a=n,u=a.times(a).times(a),l=u.plus(c),n=K(l.plus(c).times(a),l.plus(u),s+2,1),ue(a.d).slice(0,s)===(r=ue(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!o&&r=="4999"){if(!o&&(F(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,o=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(F(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return D=!0,F(n,e,m.rounding,t)};v.decimalPlaces=v.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-fe(this.e/I))*I,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};v.dividedBy=v.div=function(e){return K(this,new this.constructor(e))};v.dividedToIntegerBy=v.divToInt=function(e){var t=this,r=t.constructor;return F(K(t,new r(e),0,1,1),r.precision,r.rounding)};v.equals=v.eq=function(e){return this.cmp(e)===0};v.floor=function(){return F(new this.constructor(this),this.e+1,3)};v.greaterThan=v.gt=function(e){return this.cmp(e)>0};v.greaterThanOrEqualTo=v.gte=function(e){var t=this.cmp(e);return t==1||t===0};v.hyperbolicCosine=v.cosh=function(){var e,t,r,n,o,i=this,s=i.constructor,a=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(i.e,i.sd())+4,s.rounding=1,o=i.d.length,o<32?(e=Math.ceil(o/3),t=(1/wn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),i=Vt(s,1,i.times(t),new s(1),!0);for(var u,l=e,c=new s(8);l--;)u=i.times(i),i=a.minus(u.times(c.minus(u.times(c))));return F(i,s.precision=r,s.rounding=n,!0)};v.hyperbolicSine=v.sinh=function(){var e,t,r,n,o=this,i=o.constructor;if(!o.isFinite()||o.isZero())return new i(o);if(t=i.precision,r=i.rounding,i.precision=t+Math.max(o.e,o.sd())+4,i.rounding=1,n=o.d.length,n<3)o=Vt(i,2,o,o,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,o=o.times(1/wn(5,e)),o=Vt(i,2,o,o,!0);for(var s,a=new i(5),u=new i(16),l=new i(20);e--;)s=o.times(o),o=o.times(a.plus(s.times(u.times(s).plus(l))))}return i.precision=t,i.rounding=r,F(o,t,r,!0)};v.hyperbolicTangent=v.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,K(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};v.inverseCosine=v.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),o=r.precision,i=r.rounding;return n!==-1?n===0?t.isNeg()?Se(r,o,i):new r(0):new r(NaN):t.isZero()?Se(r,o+4,i).times(.5):(r.precision=o+6,r.rounding=1,t=t.asin(),e=Se(r,o+4,i).times(.5),r.precision=o,r.rounding=i,e.minus(t))};v.inverseHyperbolicCosine=v.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,D=!1,r=r.times(r).minus(1).sqrt().plus(r),D=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};v.inverseHyperbolicSine=v.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,D=!1,r=r.times(r).plus(1).sqrt().plus(r),D=!0,n.precision=e,n.rounding=t,r.ln())};v.inverseHyperbolicTangent=v.atanh=function(){var e,t,r,n,o=this,i=o.constructor;return o.isFinite()?o.e>=0?new i(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=i.precision,t=i.rounding,n=o.sd(),Math.max(n,e)<2*-o.e-1?F(new i(o),e,t,!0):(i.precision=r=n-o.e,o=K(o.plus(1),new i(1).minus(o),r+e,1),i.precision=e+4,i.rounding=1,o=o.ln(),i.precision=e,i.rounding=t,o.times(.5))):new i(NaN)};v.inverseSine=v.asin=function(){var e,t,r,n,o=this,i=o.constructor;return o.isZero()?new i(o):(t=o.abs().cmp(1),r=i.precision,n=i.rounding,t!==-1?t===0?(e=Se(i,r+4,n).times(.5),e.s=o.s,e):new i(NaN):(i.precision=r+6,i.rounding=1,o=o.div(new i(1).minus(o.times(o)).sqrt().plus(1)).atan(),i.precision=r,i.rounding=n,o.times(2)))};v.inverseTangent=v.atan=function(){var e,t,r,n,o,i,s,a,u,l=this,c=l.constructor,m=c.precision,g=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&m+4<=No)return s=Se(c,m+4,g).times(.25),s.s=l.s,s}else{if(!l.s)return new c(NaN);if(m+4<=No)return s=Se(c,m+4,g).times(.5),s.s=l.s,s}for(c.precision=a=m+10,c.rounding=1,r=Math.min(28,a/I+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(D=!1,t=Math.ceil(a/I),n=1,u=l.times(l),s=new c(l),o=l;e!==-1;)if(o=o.times(u),i=s.minus(o.div(n+=2)),o=o.times(u),s=i.plus(o.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===i.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};v.isNaN=function(){return!this.s};v.isNegative=v.isNeg=function(){return this.s<0};v.isPositive=v.isPos=function(){return this.s>0};v.isZero=function(){return!!this.d&&this.d[0]===0};v.lessThan=v.lt=function(e){return this.cmp(e)<0};v.lessThanOrEqualTo=v.lte=function(e){return this.cmp(e)<1};v.logarithm=v.log=function(e){var t,r,n,o,i,s,a,u,l=this,c=l.constructor,m=c.precision,g=c.rounding,w=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new c(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)i=!0;else{for(o=r[0];o%10===0;)o/=10;i=o!==1}if(D=!1,a=m+w,s=ot(l,a),n=t?hn(c,a+10):ot(e,a),u=K(s,n,a,1),gr(u.d,o=m,g))do if(a+=10,s=ot(l,a),n=t?hn(c,a+10):ot(e,a),u=K(s,n,a,1),!i){+ue(u.d).slice(o+1,o+15)+1==1e14&&(u=F(u,m+1,0));break}while(gr(u.d,o+=10,g));return D=!0,F(u,m,g)};v.minus=v.sub=function(e){var t,r,n,o,i,s,a,u,l,c,m,g,w=this,E=w.constructor;if(e=new E(e),!w.d||!e.d)return!w.s||!e.s?e=new E(NaN):w.d?e.s=-e.s:e=new E(e.d||w.s!==e.s?w:NaN),e;if(w.s!=e.s)return e.s=-e.s,w.plus(e);if(l=w.d,g=e.d,a=E.precision,u=E.rounding,!l[0]||!g[0]){if(g[0])e.s=-e.s;else if(l[0])e=new E(w);else return new E(u===3?-0:0);return D?F(e,a,u):e}if(r=fe(e.e/I),c=fe(w.e/I),l=l.slice(),i=c-r,i){for(m=i<0,m?(t=l,i=-i,s=g.length):(t=g,r=c,s=l.length),n=Math.max(Math.ceil(a/I),s)+2,i>n&&(i=n,t.length=1),t.reverse(),n=i;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=g.length,m=n0;--n)l[s++]=0;for(n=g.length;n>i;){if(l[--n]s?i+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),t=0;o;)t=(l[--o]=l[o]+c[o]+t)/Oe|0,l[o]%=Oe;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=bn(l,n),D?F(e,a,u):e};v.precision=v.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(it+e);return r.d?(t=ra(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};v.round=function(){var e=this,t=e.constructor;return F(new t(e),e.e+1,t.rounding)};v.sine=v.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+I,n.rounding=1,r=ep(n,sa(n,r)),n.precision=e,n.rounding=t,F(Qe>2?r.neg():r,e,t,!0)):new n(NaN)};v.squareRoot=v.sqrt=function(){var e,t,r,n,o,i,s=this,a=s.d,u=s.e,l=s.s,c=s.constructor;if(l!==1||!a||!a[0])return new c(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(D=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=ue(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=fe((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new c(t)):n=new c(l.toString()),r=(u=c.precision)+3;;)if(i=n,n=i.plus(K(s,i,r+2,1)).times(.5),ue(i.d).slice(0,r)===(t=ue(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!o&&t=="4999"){if(!o&&(F(i,u+1,0),i.times(i).eq(s))){n=i;break}r+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(F(n,u+1,1),e=!n.times(n).eq(s));break}return D=!0,F(n,u,c.rounding,e)};v.tangent=v.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=K(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,F(Qe==2||Qe==4?r.neg():r,e,t,!0)):new n(NaN)};v.times=v.mul=function(e){var t,r,n,o,i,s,a,u,l,c=this,m=c.constructor,g=c.d,w=(e=new m(e)).d;if(e.s*=c.s,!g||!g[0]||!w||!w[0])return new m(!e.s||g&&!g[0]&&!w||w&&!w[0]&&!g?NaN:!g||!w?e.s/0:e.s*0);for(r=fe(c.e/I)+fe(e.e/I),u=g.length,l=w.length,u=0;){for(t=0,o=u+n;o>n;)a=i[o]+w[n]*g[o-n-1]+t,i[o--]=a%Oe|0,t=a/Oe|0;i[o]=(i[o]+t)%Oe|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=bn(i,r),D?F(e,m.precision,m.rounding):e};v.toBinary=function(e,t){return jo(this,2,e,t)};v.toDecimalPlaces=v.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(we(e,0,st),t===void 0?t=n.rounding:we(t,0,8),F(r,e+r.e+1,t))};v.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Be(n,!0):(we(e,0,st),t===void 0?t=o.rounding:we(t,0,8),n=F(new o(n),e+1,t),r=Be(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};v.toFixed=function(e,t){var r,n,o=this,i=o.constructor;return e===void 0?r=Be(o):(we(e,0,st),t===void 0?t=i.rounding:we(t,0,8),n=F(new i(o),e+o.e+1,t),r=Be(n,!1,e+n.e+1)),o.isNeg()&&!o.isZero()?"-"+r:r};v.toFraction=function(e){var t,r,n,o,i,s,a,u,l,c,m,g,w=this,E=w.d,x=w.constructor;if(!E)return new x(w);if(l=r=new x(1),n=u=new x(0),t=new x(n),i=t.e=ra(E)-w.e-1,s=i%I,t.d[0]=X(10,s<0?I+s:s),e==null)e=i>0?t:l;else{if(a=new x(e),!a.isInt()||a.lt(l))throw Error(it+a);e=a.gt(t)?i>0?t:l:a}for(D=!1,a=new x(ue(E)),c=x.precision,x.precision=i=E.length*I*2;m=K(a,t,0,1,1),o=r.plus(m.times(n)),o.cmp(e)!=1;)r=n,n=o,o=l,l=u.plus(m.times(o)),u=o,o=t,t=a.minus(m.times(o)),a=o;return o=K(e.minus(r),n,0,1,1),u=u.plus(o.times(l)),r=r.plus(o.times(n)),u.s=l.s=w.s,g=K(l,n,i,1).minus(w).abs().cmp(K(u,r,i,1).minus(w).abs())<1?[l,n]:[u,r],x.precision=c,D=!0,g};v.toHexadecimal=v.toHex=function(e,t){return jo(this,16,e,t)};v.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:we(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(D=!1,r=K(r,e,0,t,1).times(e),D=!0,F(r)):(e.s=r.s,r=e),r};v.toNumber=function(){return+this};v.toOctal=function(e,t){return jo(this,8,e,t)};v.toPower=v.pow=function(e){var t,r,n,o,i,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(X(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,i=u.rounding,e.eq(1))return F(a,n,i);if(t=fe(e.e/I),t>=e.d.length-1&&(r=l<0?-l:l)<=zc)return o=na(u,a,r,n),e.s<0?new u(1).div(o):F(o,n,i);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(D=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),o=Bo(e.times(ot(a,n+r)),n),o.d&&(o=F(o,n+5,1),gr(o.d,n,i)&&(t=n+10,o=F(Bo(e.times(ot(a,t+r)),t),t+5,1),+ue(o.d).slice(n+1,n+15)+1==1e14&&(o=F(o,n+1,0)))),o.s=s,D=!0,u.rounding=i,F(o,n,i))};v.toPrecision=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Be(n,n.e<=o.toExpNeg||n.e>=o.toExpPos):(we(e,1,st),t===void 0?t=o.rounding:we(t,0,8),n=F(new o(n),e,t),r=Be(n,e<=n.e||n.e<=o.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};v.toSignificantDigits=v.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(we(e,1,st),t===void 0?t=n.rounding:we(t,0,8)),F(new n(r),e,t)};v.toString=function(){var e=this,t=e.constructor,r=Be(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};v.truncated=v.trunc=function(){return F(new this.constructor(this),this.e+1,1)};v.valueOf=v.toJSON=function(){var e=this,t=e.constructor,r=Be(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function ue(e){var t,r,n,o=e.length-1,i="",s=e[0];if(o>0){for(i+=s,t=1;tr)throw Error(it+e)}function gr(e,t,r,n){var o,i,s,a;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=I,o=0):(o=Math.ceil((t+1)/I),t%=I),i=X(10,I-t),a=e[o]%i|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==i||r>3&&a+1==i/2)&&(e[o+1]/i/100|0)==X(10,t-2)-1||(a==i/2||a==0)&&(e[o+1]/i/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==i||!n&&r>3&&a+1==i/2)&&(e[o+1]/i/1e3|0)==X(10,t-3)-1,s}function mn(e,t,r){for(var n,o=[0],i,s=0,a=e.length;sr-1&&(o[n+1]===void 0&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function Yc(e,t){var r,n,o;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),o=(1/wn(4,r)).toString()):(r=16,o="2.3283064365386962890625e-10"),e.precision+=r,t=Vt(e,1,t.times(o),new e(1));for(var i=r;i--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var K=function(){function e(n,o,i){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*o+a,n[u]=s%i|0,a=s/i|0;return a&&n.unshift(a),n}function t(n,o,i,s){var a,u;if(i!=s)u=i>s?1:-1;else for(a=u=0;ao[a]?1:-1;break}return u}function r(n,o,i,s){for(var a=0;i--;)n[i]-=a,a=n[i]1;)n.shift()}return function(n,o,i,s,a,u){var l,c,m,g,w,E,x,T,R,S,C,M,N,B,de,V,W,Pe,H,ve,We=n.constructor,$=n.s==o.s?1:-1,U=n.d,O=o.d;if(!U||!U[0]||!O||!O[0])return new We(!n.s||!o.s||(U?O&&U[0]==O[0]:!O)?NaN:U&&U[0]==0||!O?$*0:$/0);for(u?(w=1,c=n.e-o.e):(u=Oe,w=I,c=fe(n.e/w)-fe(o.e/w)),H=O.length,W=U.length,R=new We($),S=R.d=[],m=0;O[m]==(U[m]||0);m++);if(O[m]>(U[m]||0)&&c--,i==null?(B=i=We.precision,s=We.rounding):a?B=i+(n.e-o.e)+1:B=i,B<0)S.push(1),E=!0;else{if(B=B/w+2|0,m=0,H==1){for(g=0,O=O[0],B++;(m1&&(O=e(O,g,u),U=e(U,g,u),H=O.length,W=U.length),V=H,C=U.slice(0,H),M=C.length;M=u/2&&++Pe;do g=0,l=t(O,C,H,M),l<0?(N=C[0],H!=M&&(N=N*u+(C[1]||0)),g=N/Pe|0,g>1?(g>=u&&(g=u-1),x=e(O,g,u),T=x.length,M=C.length,l=t(x,C,T,M),l==1&&(g--,r(x,H=10;g/=10)m++;R.e=m+c*w-1,F(R,a?i+R.e+1:i,s,E)}return R}}();function F(e,t,r,n){var o,i,s,a,u,l,c,m,g,w=e.constructor;e:if(t!=null){if(m=e.d,!m)return e;for(o=1,a=m[0];a>=10;a/=10)o++;if(i=t-o,i<0)i+=I,s=t,c=m[g=0],u=c/X(10,o-s-1)%10|0;else if(g=Math.ceil((i+1)/I),a=m.length,g>=a)if(n){for(;a++<=g;)m.push(0);c=u=0,o=1,i%=I,s=i-I+1}else break e;else{for(c=a=m[g],o=1;a>=10;a/=10)o++;i%=I,s=i-I+o,u=s<0?0:c/X(10,o-s-1)%10|0}if(n=n||t<0||m[g+1]!==void 0||(s<0?c:c%X(10,o-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(i>0?s>0?c/X(10,o-s):0:m[g-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,l?(t-=e.e+1,m[0]=X(10,(I-t%I)%I),e.e=-t||0):m[0]=e.e=0,e;if(i==0?(m.length=g,a=1,g--):(m.length=g+1,a=X(10,I-i),m[g]=s>0?(c/X(10,o-s)%X(10,s)|0)*a:0),l)for(;;)if(g==0){for(i=1,s=m[0];s>=10;s/=10)i++;for(s=m[0]+=a,a=1;s>=10;s/=10)a++;i!=a&&(e.e++,m[0]==Oe&&(m[0]=1));break}else{if(m[g]+=a,m[g]!=Oe)break;m[g--]=0,a=1}for(i=m.length;m[--i]===0;)m.pop()}return D&&(e.e>w.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+nt(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):o<0?(i="0."+nt(-o-1)+i,r&&(n=r-s)>0&&(i+=nt(n))):o>=s?(i+=nt(o+1-s),r&&(n=r-o-1)>0&&(i=i+"."+nt(n))):((n=o+1)0&&(o+1===s&&(i+="."),i+=nt(n))),i}function bn(e,t){var r=e[0];for(t*=I;r>=10;r/=10)t++;return t}function hn(e,t,r){if(t>Zc)throw D=!0,r&&(e.precision=r),Error(Ys);return F(new e(gn),t,1,!0)}function Se(e,t,r){if(t>No)throw Error(Ys);return F(new e(yn),t,r,!0)}function ra(e){var t=e.length-1,r=t*I+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function nt(e){for(var t="";e--;)t+="0";return t}function na(e,t,r,n){var o,i=new e(1),s=Math.ceil(n/I+4);for(D=!1;;){if(r%2&&(i=i.times(t),Hs(i.d,s)&&(o=!0)),r=fe(r/2),r===0){r=i.d.length-1,o&&i.d[r]===0&&++i.d[r];break}t=t.times(t),Hs(t.d,s)}return D=!0,i}function Ws(e){return e.d[e.d.length-1]&1}function oa(e,t,r){for(var n,o=new e(t[0]),i=0;++i17)return new g(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(D=!1,u=E):u=t,a=new g(.03125);e.e>-2;)e=e.times(a),m+=5;for(n=Math.log(X(2,m))/Math.LN10*2+5|0,u+=n,r=i=s=new g(1),g.precision=u;;){if(i=F(i.times(e),u,1),r=r.times(++c),a=s.plus(K(i,r,u,1)),ue(a.d).slice(0,u)===ue(s.d).slice(0,u)){for(o=m;o--;)s=F(s.times(s),u,1);if(t==null)if(l<3&&gr(s.d,u-n,w,l))g.precision=u+=10,r=i=a=new g(1),c=0,l++;else return F(s,g.precision=E,w,D=!0);else return g.precision=E,s}s=a}}function ot(e,t){var r,n,o,i,s,a,u,l,c,m,g,w=1,E=10,x=e,T=x.d,R=x.constructor,S=R.rounding,C=R.precision;if(x.s<0||!T||!T[0]||!x.e&&T[0]==1&&T.length==1)return new R(T&&!T[0]?-1/0:x.s!=1?NaN:T?0:x);if(t==null?(D=!1,c=C):c=t,R.precision=c+=E,r=ue(T),n=r.charAt(0),Math.abs(i=x.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)x=x.times(e),r=ue(x.d),n=r.charAt(0),w++;i=x.e,n>1?(x=new R("0."+r),i++):x=new R(n+"."+r.slice(1))}else return l=hn(R,c+2,C).times(i+""),x=ot(new R(n+"."+r.slice(1)),c-E).plus(l),R.precision=C,t==null?F(x,C,S,D=!0):x;for(m=x,u=s=x=K(x.minus(1),x.plus(1),c,1),g=F(x.times(x),c,1),o=3;;){if(s=F(s.times(g),c,1),l=u.plus(K(s,new R(o),c,1)),ue(l.d).slice(0,c)===ue(u.d).slice(0,c))if(u=u.times(2),i!==0&&(u=u.plus(hn(R,c+2,C).times(i+""))),u=K(u,new R(w),c,1),t==null)if(gr(u.d,c-E,S,a))R.precision=c+=E,l=s=x=K(m.minus(1),m.plus(1),c,1),g=F(x.times(x),c,1),o=a=1;else return F(u,R.precision=C,S,D=!0);else return R.precision=C,u;u=l,o+=2}}function ia(e){return String(e.s*e.s/0)}function Lo(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(n,o),t){if(o-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%I,r<0&&(n+=I),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ta.test(t))return Lo(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Wc.test(t))r=16,t=t.toLowerCase();else if(Gc.test(t))r=2;else if(Hc.test(t))r=8;else throw Error(it+t);for(i=t.search(/p/i),i>0?(u=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),i=t.indexOf("."),s=i>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,i=a-i,o=na(n,new n(r),i,i*2)),l=mn(t,r,Oe),c=l.length-1,i=c;l[i]===0;--i)l.pop();return i<0?new n(e.s*0):(e.e=bn(l,c),e.d=l,D=!1,s&&(e=K(e,o,a*4)),u&&(e=e.times(Math.abs(u)<54?X(2,u):bt.pow(2,u))),D=!0,e)}function ep(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Vt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/wn(5,r)),t=Vt(e,2,t,t);for(var o,i=new e(5),s=new e(16),a=new e(20);r--;)o=t.times(t),t=t.times(i.plus(o.times(s.times(o).minus(a))));return t}function Vt(e,t,r,n,o){var i,s,a,u,l=1,c=e.precision,m=Math.ceil(c/I);for(D=!1,u=r.times(r),a=new e(n);;){if(s=K(a.times(u),new e(t++*t++),c,1),a=o?n.plus(s):n.minus(s),n=K(s.times(u),new e(t++*t++),c,1),s=a.plus(n),s.d[m]!==void 0){for(i=m;s.d[i]===a.d[i]&&i--;);if(i==-1)break}i=a,a=n,n=s,s=i,l++}return D=!0,s.d.length=m+1,s}function wn(e,t){for(var r=e;--t;)r*=e;return r}function sa(e,t){var r,n=t.s<0,o=Se(e,e.precision,1),i=o.times(.5);if(t=t.abs(),t.lte(i))return Qe=n?4:1,t;if(r=t.divToInt(o),r.isZero())Qe=n?3:2;else{if(t=t.minus(r.times(o)),t.lte(i))return Qe=Ws(r)?n?2:3:n?4:1,t;Qe=Ws(r)?n?1:4:n?3:2}return t.minus(o).abs()}function jo(e,t,r,n){var o,i,s,a,u,l,c,m,g,w=e.constructor,E=r!==void 0;if(E?(we(r,1,st),n===void 0?n=w.rounding:we(n,0,8)):(r=w.precision,n=w.rounding),!e.isFinite())c=ia(e);else{for(c=Be(e),s=c.indexOf("."),E?(o=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):o=t,s>=0&&(c=c.replace(".",""),g=new w(1),g.e=c.length-s,g.d=mn(Be(g),10,o),g.e=g.d.length),m=mn(c,10,o),i=u=m.length;m[--u]==0;)m.pop();if(!m[0])c=E?"0p+0":"0";else{if(s<0?i--:(e=new w(e),e.d=m,e.e=i,e=K(e,g,r,n,0,o),m=e.d,i=e.e,l=Zs),s=m[r],a=o/2,l=l||m[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&m[r-1]&1||n===(e.s<0?8:7)),m.length=r,l)for(;++m[--r]>o-1;)m[r]=0,r||(++i,m.unshift(1));for(u=m.length;!m[u-1];--u);for(s=0,c="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)c+="0";for(m=mn(c,o,t),u=m.length;!m[u-1];--u);for(s=1,c="1.";su)for(i-=u;i--;)c+="0";else it)return e.length=t,!0}function tp(e){return new this(e).abs()}function rp(e){return new this(e).acos()}function np(e){return new this(e).acosh()}function op(e,t){return new this(e).plus(t)}function ip(e){return new this(e).asin()}function sp(e){return new this(e).asinh()}function ap(e){return new this(e).atan()}function up(e){return new this(e).atanh()}function lp(e,t){e=new this(e),t=new this(t);var r,n=this.precision,o=this.rounding,i=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Se(this,i,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Se(this,n,o):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Se(this,i,1).times(.5),r.s=e.s):t.s<0?(this.precision=i,this.rounding=1,r=this.atan(K(e,t,i,1)),t=Se(this,i,1),this.precision=n,this.rounding=o,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(K(e,t,i,1)),r}function cp(e){return new this(e).cbrt()}function pp(e){return F(e=new this(e),e.e+1,2)}function fp(e,t,r){return new this(e).clamp(t,r)}function dp(e){if(!e||typeof e!="object")throw Error(xn+"Object expected");var t,r,n,o=e.defaults===!0,i=["precision",1,st,"rounding",0,8,"toExpNeg",-qt,0,"toExpPos",0,qt,"maxE",0,qt,"minE",-qt,0,"modulo",0,9];for(t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(it+r+": "+n);if(r="crypto",o&&(this[r]=_o[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Xs);else this[r]=!1;else throw Error(it+r+": "+n);return this}function mp(e){return new this(e).cos()}function gp(e){return new this(e).cosh()}function aa(e){var t,r,n;function o(i){var s,a,u,l=this;if(!(l instanceof o))return new o(i);if(l.constructor=o,zs(i)){l.s=i.s,D?!i.d||i.e>o.maxE?(l.e=NaN,l.d=null):i.e=10;a/=10)s++;D?s>o.maxE?(l.e=NaN,l.d=null):s=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:a[i++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);i=214e7?crypto.randomBytes(4).copy(t,i):(a.push(o%1e7),i+=4);i=n/4}else throw Error(Xs);else for(;i=10;o/=10)n++;n`}};function Jt(e){return e instanceof yr}d();p();f();d();p();f();var En=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};d();p();f();var Pn=e=>e,vn={bold:Pn,red:Pn,green:Pn,dim:Pn},ua={bold:tt,red:Dt,green:nn,dim:rn},Qt={write(e){e.writeLine(",")}};d();p();f();var je=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};d();p();f();var at=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var Gt=class extends at{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new En(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new je("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Qt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}};d();p();f();var la=": ",An=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+la.length}write(t){let r=new je(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(la).write(this.value)}};d();p();f();var ne=class e extends at{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...o]=r,i=this.getField(n);if(!i)return;let s=i;for(let a of o){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof Gt&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){var n;return r.length===0?this:(n=this.getDeepField(r))==null?void 0:n.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){var n;return(n=this.getField(r))==null?void 0:n.value}getDeepSubSelectionValue(r){let n=this;for(let o of r){if(!(n instanceof e))return;let i=n.getSubSelectionValue(o);if(!i)return;n=i}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let o=n;for(let i of r){let s=o.value.getFieldValue(i);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;o=a}return o}getSelectionParent(){let r=this.getField("select");if((r==null?void 0:r.value)instanceof e)return{kind:"select",value:r.value};let n=this.getField("include");if((n==null?void 0:n.value)instanceof e)return{kind:"include",value:n.value}}getSubSelectionValue(r){var n;return(n=this.getSelectionParent())==null?void 0:n.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(o=>o.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}writeEmpty(r){let n=new je("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(Qt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};d();p();f();var oe=class extends at{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new je(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}};var Uo=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Tn(e){return new Uo(ca(e))}function ca(e){let t=new ne;for(let[r,n]of Object.entries(e)){let o=new An(r,pa(n));t.addField(o)}return t}function pa(e){if(typeof e=="string")return new oe(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new oe(String(e));if(typeof e=="bigint")return new oe(`${e}n`);if(e===null)return new oe("null");if(e===void 0)return new oe("undefined");if(Kt(e))return new oe(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return b.Buffer.isBuffer(e)?new oe(`Buffer.alloc(${e.byteLength})`):new oe(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=dn(e)?e.toISOString():"Invalid Date";return new oe(`new Date("${t}")`)}return e instanceof Je?new oe(`Prisma.${e._getName()}`):Jt(e)?new oe(`prisma.${Ji(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?$p(e):typeof e=="object"?ca(e):new oe(Object.prototype.toString.call(e))}function $p(e){let t=new Gt;for(let r of e)t.addItem(pa(r));return t}function fa(e){if(e===void 0)return"";let t=Tn(e);return new Ut(0,{colors:vn}).write(t).toString()}d();p();f();d();p();f();d();p();f();d();p();f();d();p();f();var hr="";function da(e){var t=e.split(` -`);return t.reduce(function(r,n){var o=Kp(n)||Qp(n)||Hp(n)||Xp(n)||Zp(n);return o&&r.push(o),r},[])}var qp=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Vp=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Kp(e){var t=qp.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,o=Vp.exec(t[2]);return n&&o!=null&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]),{file:r?null:t[2],methodName:t[1]||hr,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Jp=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Qp(e){var t=Jp.exec(e);return t?{file:t[2],methodName:t[1]||hr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Gp=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Wp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Hp(e){var t=Gp.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Wp.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||hr,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var zp=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Zp(e){var t=zp.exec(e);return t?{file:t[3],methodName:t[1]||hr,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Yp=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Xp(e){var t=Yp.exec(e);return t?{file:t[2],methodName:t[1]||hr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var $o=class{getLocation(){return null}},qo=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=da(t).find(o=>{if(!o.file)return!1;let i=vo(o.file);return i!==""&&!i.includes("@prisma")&&!i.includes("/packages/client/src/runtime/")&&!i.endsWith("/runtime/binary.js")&&!i.endsWith("/runtime/library.js")&&!i.endsWith("/runtime/edge.js")&&!i.endsWith("/runtime/edge-esm.js")&&!i.startsWith("internal/")&&!o.methodName.includes("new ")&&!o.methodName.includes("getCallSite")&&!o.methodName.includes("Proxy.")&&o.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function ut(e){return e==="minimal"?new $o:new qo}d();p();f();d();p();f();d();p();f();var ma={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Wt(e={}){let t=tf(e);return Object.entries(t).reduce((n,[o,i])=>(ma[o]!==void 0?n.select[o]={select:i}:n[o]=i,n),{select:{}})}function tf(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Cn(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ga(e,t){let r=Cn(e);return t({action:"aggregate",unpacker:r,argsMapper:Wt})(e)}d();p();f();function rf(e={}){let{select:t,...r}=e;return typeof t=="object"?Wt({...r,_count:t}):Wt({...r,_count:{_all:!0}})}function nf(e={}){return typeof e.select=="object"?t=>Cn(e)(t)._count:t=>Cn(e)(t)._count._all}function ya(e,t){return t({action:"count",unpacker:nf(e),argsMapper:rf})(e)}d();p();f();function of(e={}){let t=Wt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function sf(e={}){return t=>(typeof(e==null?void 0:e._count)=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ha(e,t){return t({action:"groupBy",unpacker:sf(e),argsMapper:of})(e)}function xa(e,t,r){if(t==="aggregate")return n=>ga(n,r);if(t==="count")return n=>ya(n,r);if(t==="groupBy")return n=>ha(n,r)}d();p();f();function ba(e,t){let r=t.fields.filter(o=>!o.relationName),n=Mo(r,o=>o.name);return new Proxy({},{get(o,i){if(i in o||typeof i=="symbol")return o[i];let s=n[i];if(s)return new yr(e,i,s.type,s.isList,s.kind==="enum")},...cn(Object.keys(n))})}d();p();f();d();p();f();var wa=e=>Array.isArray(e)?e:e.split("."),Vo=(e,t)=>wa(t).reduce((r,n)=>r&&r[n],e),Ea=(e,t,r)=>wa(t).reduceRight((n,o,i,s)=>Object.assign({},Vo(e,s.slice(0,i)),{[o]:n}),r);function af(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function uf(e,t,r){return t===void 0?e!=null?e:{}:Ea(t,r,e||!0)}function Ko(e,t,r,n,o,i){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=ut(e._errorFormat),c=af(n,o),m=uf(u,i,c),g=r({dataPath:c,callsite:l})(m),w=lf(e,t);return new Proxy(g,{get(E,x){if(!w.includes(x))return E[x];let R=[a[x].type,r,x],S=[c,m];return Ko(e,...R,...S)},...cn([...w,...Object.getOwnPropertyNames(g)])})}}function lf(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}d();p();f();d();p();f();var Ca=Te(ks());d();p();f();wo();d();p();f();d();p();f();d();p();f();var Pa={keyword:rt,entity:rt,value:e=>tt(_t(e)),punctuation:_t,directive:rt,function:rt,variable:e=>tt(_t(e)),string:e=>tt(nn(e)),boolean:on,number:rt,comment:sn};var cf=e=>e,Mn={},pf=0,_={manual:Mn.Prism&&Mn.Prism.manual,disableWorkerMessageHandler:Mn.Prism&&Mn.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof Fe){let t=e;return new Fe(t.type,_.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(_.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Pe instanceof Fe)continue;if(N&&V!=t.length-1){S.lastIndex=W;var m=S.exec(e);if(!m)break;var c=m.index+(M?m[1].length:0),g=m.index+m[0].length,a=V,u=W;for(let O=t.length;a=u&&(++V,W=u);if(t[V]instanceof Fe)continue;l=a-V,Pe=e.slice(W,u),m.index-=W}else{S.lastIndex=0;var m=S.exec(Pe),l=1}if(!m){if(i)break;continue}M&&(B=m[1]?m[1].length:0);var c=m.index+B,m=m[0].slice(B),g=c+m.length,w=Pe.slice(0,c),E=Pe.slice(g);let H=[V,l];w&&(++V,W+=w.length,H.push(w));let ve=new Fe(x,C?_.tokenize(m,C):m,de,m,N);if(H.push(ve),E&&H.push(E),Array.prototype.splice.apply(t,H),l!=1&&_.matchGrammar(e,t,r,V,W,!0,x),i)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let o in n)t[o]=n[o];delete t.rest}return _.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=_.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=_.hooks.all[e];if(!(!r||!r.length))for(var n=0,o;o=r[n++];)o(t)}},Token:Fe};_.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};_.languages.javascript=_.languages.extend("clike",{"class-name":[_.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});_.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;_.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:_.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:_.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:_.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:_.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});_.languages.markup&&_.languages.markup.tag.addInlined("script","javascript");_.languages.js=_.languages.javascript;_.languages.typescript=_.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});_.languages.ts=_.languages.typescript;function Fe(e,t,r,n,o){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!o}Fe.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return Fe.stringify(r,t)}).join(""):ff(e.type)(e.content)};function ff(e){return Pa[e]||cf}function va(e){return df(e,_.languages.javascript)}function df(e,t){return _.tokenize(e,t).map(n=>Fe.stringify(n)).join("")}d();p();f();var Aa=Te(Ss());function Ta(e){return(0,Aa.default)(e)}var Rn=class e{static read(t){let r;try{r=an.readFileSync(t,"utf-8")}catch(n){return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,o=[...this.lines];return o[n]=r(o[n]),new e(this.firstLineNumber,o)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,o)=>o===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` -`);return new e(t,Ta(n).split(` -`))}highlight(){let t=va(this.toString());return new e(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var mf={red:Dt,gray:sn,dim:rn,bold:tt,underline:Ps,highlightSource:e=>e.highlight()},gf={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function yf({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:o},i){var m;let s={functionName:`prisma.${r}()`,message:t,isPanic:n!=null?n:!1,callArguments:o};if(!e||typeof window!="undefined"||y.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let u=Math.max(1,a.lineNumber-3),l=(m=Rn.read(a.fileName))==null?void 0:m.slice(u,a.lineNumber),c=l==null?void 0:l.lineAt(a.lineNumber);if(l&&c){let g=xf(c),w=hf(c);if(!w)return s;s.functionName=`${w.code})`,s.location=a,n||(l=l.mapLineAt(a.lineNumber,x=>x.slice(0,w.openingBraceIndex))),l=i.highlightSource(l);let E=String(l.lastLineNumber).length;if(s.contextLines=l.mapLines((x,T)=>i.gray(String(T).padStart(E))+" "+x).mapLines(x=>i.dim(x)).prependSymbolAt(a.lineNumber,i.bold(i.red("\u2192"))),o){let x=g+E+1;x+=2,s.callArguments=(0,Ca.default)(o,x).slice(x)}}return s}function hf(e){let t=Object.keys(Ce.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let o=n.index+n[0].length,i=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(i,o),openingBraceIndex:o}}return null}function xf(e){let t=0;for(let r=0;r{if("rejectOnNotFound"in n.args){let i=Ht({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new pe(i,{clientVersion:t})}return await r(n).catch(i=>{throw i instanceof ce&&i.code==="P2025"?new Ve(`No ${e} found`,t):i})}}d();p();f();function Ue(e){return e.replace(/^./,t=>t.toLowerCase())}var Pf=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],vf=["aggregate","count","groupBy"];function Jo(e,t){var o;let r=(o=e._extensions.getAllModelExtensions(t))!=null?o:{},n=[Af(e,t),Cf(e,t),lr(r),ye("name",()=>t),ye("$name",()=>t),ye("$parent",()=>e._appliedParent)];return Ne({},n)}function Af(e,t){let r=Ue(t),n=Object.keys(Ce.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(o){let i=o,s=u=>e._request(u);s=Ma(i,t,e._clientVersion,s);let a=u=>l=>{let c=ut(e._errorFormat);return e._createPrismaPromise(m=>{let g={args:l,dataPath:[],action:i,model:t,clientMethod:`${r}.${o}`,jsModelName:r,transaction:m,callsite:c};return s({...g,...u})})};return Pf.includes(i)?Ko(e,t,a):Tf(o)?xa(e,o,a):a({})}}}function Tf(e){return vf.includes(e)}function Cf(e,t){return xt(ye("fields",()=>{let r=e._runtimeDataModel.models[t];return ba(t,r)}))}d();p();f();function Ra(e){return e.replace(/^./,t=>t.toUpperCase())}var Qo=Symbol();function xr(e){let t=[Mf(e),ye(Qo,()=>e),ye("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(lr(r)),Ne(e,t)}function Mf(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Ue),n=[...new Set(t.concat(r))];return xt({getKeys(){return n},getPropertyValue(o){let i=Ra(o);if(e._runtimeDataModel.models[i]!==void 0)return Jo(e,i);if(e._runtimeDataModel.models[o]!==void 0)return Jo(e,o)},getPropertyDescriptor(o){if(!r.includes(o))return{enumerable:!1}}})}function Sn(e){return e[Qo]?e[Qo]:e}function Sa(e){if(typeof e=="function")return e(this);let t=Sn(this),r=Object.create(t,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return xr(r)}d();p();f();d();p();f();function Oa({result:e,modelName:t,select:r,extensions:n}){let o=n.getAllComputedFields(t);if(!o)return e;let i=[],s=[];for(let a of Object.values(o)){if(r){if(!r[a.name])continue;let u=a.needs.filter(l=>!r[l]);u.length>0&&s.push(cr(u))}Rf(e,a.needs)&&i.push(Sf(a,Ne(e,i)))}return i.length>0||s.length>0?Ne(e,[...i,...s]):e}function Rf(e,t){return t.every(r=>Co(e,r))}function Sf(e,t){return xt(ye(e.name,()=>e.compute(t)))}d();p();f();function On({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:o}){var s;if(Array.isArray(t)){for(let a=0;ac.name===i);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[i]=On({visitor:o,result:t[i],args:l,modelName:u.type,runtimeDataModel:n})}}function Ia({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:o}){return n.isEmpty()||e==null||typeof e!="object"||!o.models[t]?e:On({result:e,args:r!=null?r:{},modelName:t,runtimeDataModel:o,visitor:(s,a,u)=>Oa({result:s,modelName:Ue(a),select:u.select,extensions:n})})}d();p();f();d();p();f();function ka(e){if(e instanceof be)return Of(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{var s,a;let i=t.customDataProxyFetch;return"transaction"in t&&o!==void 0&&(((s=t.transaction)==null?void 0:s.kind)==="batch"&&t.transaction.lock.then(),t.transaction=o),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:ka((a=t.args)!=null?a:{}),__internalParams:t,query:(u,l=t)=>{let c=l.customDataProxyFetch;return l.customDataProxyFetch=ja(i,c),l.args=u,_a(e,l,r,n+1)}})})}function Na(e,t){let{jsModelName:r,action:n,clientMethod:o}=t,i=r?n:o;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r!=null?r:"$none",i);return _a(e,t,s)}function Ba(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?La(r,n,0,e):e(r)}}function La(e,t,r,n){if(r===t.length)return n(e);let o=e.customDataProxyFetch,i=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:i?{isolationLevel:i.kind==="batch"?i.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=ja(o,u),La(a,t,r+1,n)}})}var Da=e=>e;function ja(e=Da,t=Da){return r=>e(t(r))}d();p();f();d();p();f();function $a(e,t,r){let n=Ue(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ff({...e,...Ua(t.name,e,t.result.$allModels),...Ua(t.name,e,t.result[n])})}function Ff(e){let t=new _e,r=(n,o)=>t.getOrCreate(n,()=>o.has(n)?[n]:(o.add(n),e[n]?e[n].needs.flatMap(i=>r(i,o)):[n]));return Lt(e,n=>({...n,needs:r(n.name,new Set)}))}function Ua(e,t,r){return r?Lt(r,({needs:n,compute:o},i)=>({name:i,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:If(t,i,o)})):{}}function If(e,t,r){var o;let n=(o=e==null?void 0:e[t])==null?void 0:o.compute;return n?i=>r({...i,[t]:n(i)}):r}function qa(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let o of n.needs)r[o]=!0;return r}var Fn=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new _e;this.modelExtensionsCache=new _e;this.queryCallbacksCache=new _e;this.clientExtensions=ur(()=>{var t,r;return this.extension.client?{...(r=this.previous)==null?void 0:r.getAllClientExtensions(),...this.extension.client}:(t=this.previous)==null?void 0:t.getAllClientExtensions()});this.batchCallbacks=ur(()=>{var n,o,i;let t=(o=(n=this.previous)==null?void 0:n.getAllBatchQueryCallbacks())!=null?o:[],r=(i=this.extension.query)==null?void 0:i.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>{var r;return $a((r=this.previous)==null?void 0:r.getAllComputedFields(t),this.extension,t)})}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{var n,o;let r=Ue(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?(n=this.previous)==null?void 0:n.getAllModelExtensions(t):{...(o=this.previous)==null?void 0:o.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{var s,a;let n=(a=(s=this.previous)==null?void 0:s.getAllQueryCallbacks(t,r))!=null?a:[],o=[],i=this.extension.query;return!i||!(i[t]||i.$allModels||i[r]||i.$allOperations)?n:(i[t]!==void 0&&(i[t][r]!==void 0&&o.push(i[t][r]),i[t].$allOperations!==void 0&&o.push(i[t].$allOperations)),t!=="$none"&&i.$allModels!==void 0&&(i.$allModels[r]!==void 0&&o.push(i.$allModels[r]),i.$allModels.$allOperations!==void 0&&o.push(i.$allModels.$allOperations)),i[r]!==void 0&&o.push(i[r]),i.$allOperations!==void 0&&o.push(i.$allOperations),n.concat(o))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},In=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Fn(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Fn(t,this.head))}getAllComputedFields(t){var r;return(r=this.head)==null?void 0:r.getAllComputedFields(t)}getAllClientExtensions(){var t;return(t=this.head)==null?void 0:t.getAllClientExtensions()}getAllModelExtensions(t){var r;return(r=this.head)==null?void 0:r.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){var n,o;return(o=(n=this.head)==null?void 0:n.getAllQueryCallbacks(t,r))!=null?o:[]}getAllBatchQueryCallbacks(){var t,r;return(r=(t=this.head)==null?void 0:t.getAllBatchQueryCallbacks())!=null?r:[]}};d();p();f();var Va=xe("prisma:client"),Ka={Vercel:"vercel","Netlify CI":"netlify"};function Ja({postinstall:e,ciName:t,clientVersion:r}){if(Va("checkPlatformCaching:postinstall",e),Va("checkPlatformCaching:ciName",t),e===!0&&t&&t in Ka){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Ka[t]}-build`;throw console.error(n),new re(n,r)}}d();p();f();function Qa(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}d();p();f();d();p();f();d();p();f();function Go({error:e,user_facing_error:t},r){return t.error_code?new ce(t.message,{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new Re(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}d();p();f();var kn=class{};d();p();f();function Ga(e,t){return{batch:e,transaction:(t==null?void 0:t.kind)==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}d();p();f();d();p();f();d();p();f();var kf="Cloudflare-Workers",Df="node";function Wa(){var e,t,r;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===kf?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((r=(t=globalThis.process)==null?void 0:t.release)==null?void 0:r.name)===Df?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}function Dn({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){var u,l;let o,i=Object.keys(e)[0],s=(u=e[i])==null?void 0:u.url,a=(l=t[i])==null?void 0:l.url;if(i===void 0?o=void 0:a?o=a:s!=null&&s.value?o=s.value:s!=null&&s.fromEnvVar&&(o=r[s.fromEnvVar]),(s==null?void 0:s.fromEnvVar)!==void 0&&o===void 0)throw Wa()==="workerd"?new re(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new re(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(o===void 0)throw new re("error: Missing URL environment variable, value, or override.",n);return o}d();p();f();d();p();f();var _n=class extends Error{constructor(r,n){super(r);this.clientVersion=n.clientVersion,this.cause=n.cause}get[Symbol.toStringTag](){return this.name}};var Ee=class extends _n{constructor(r,n){var o;super(r,n);this.isRetryable=(o=n.isRetryable)!=null?o:!0}};d();p();f();d();p();f();function q(e,t){return{...e,isRetryable:t}}var zt=class extends Ee{constructor(r){super("This request must be retried",q(r,!0));this.name="ForcedRetryError";this.code="P5001"}};k(zt,"ForcedRetryError");d();p();f();var wt=class extends Ee{constructor(r,n){super(r,q(n,!1));this.name="InvalidDatasourceError";this.code="P5002"}};k(wt,"InvalidDatasourceError");d();p();f();var Et=class extends Ee{constructor(r,n){super(r,q(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};k(Et,"NotImplementedYetError");d();p();f();d();p();f();var Q=class extends Ee{constructor(r,n){super(r,n);this.response=n.response;let o=this.response.headers.get("prisma-request-id");if(o){let i=`(The request id was: ${o})`;this.message=this.message+" "+i}}};var Pt=class extends Q{constructor(r){super("Schema needs to be uploaded",q(r,!0));this.name="SchemaMissingError";this.code="P5005"}};k(Pt,"SchemaMissingError");d();p();f();d();p();f();var Wo="This request could not be understood by the server",wr=class extends Q{constructor(r,n,o){super(n||Wo,q(r,!1));this.name="BadRequestError";this.code="P5000";o&&(this.code=o)}};k(wr,"BadRequestError");d();p();f();var Er=class extends Q{constructor(r,n){super("Engine not started: healthcheck timeout",q(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};k(Er,"HealthcheckTimeoutError");d();p();f();var Pr=class extends Q{constructor(r,n,o){super(n,q(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=o}};k(Pr,"EngineStartupError");d();p();f();var vr=class extends Q{constructor(r){super("Engine version is not supported",q(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};k(vr,"EngineVersionNotSupportedError");d();p();f();var Ho="Request timed out",Ar=class extends Q{constructor(r,n=Ho){super(n,q(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};k(Ar,"GatewayTimeoutError");d();p();f();var _f="Interactive transaction error",Tr=class extends Q{constructor(r,n=_f){super(n,q(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};k(Tr,"InteractiveTransactionError");d();p();f();var Nf="Request parameters are invalid",Cr=class extends Q{constructor(r,n=Nf){super(n,q(r,!1));this.name="InvalidRequestError";this.code="P5011"}};k(Cr,"InvalidRequestError");d();p();f();var zo="Requested resource does not exist",Mr=class extends Q{constructor(r,n=zo){super(n,q(r,!1));this.name="NotFoundError";this.code="P5003"}};k(Mr,"NotFoundError");d();p();f();var Zo="Unknown server error",Zt=class extends Q{constructor(r,n,o){super(n||Zo,q(r,!0));this.name="ServerError";this.code="P5006";this.logs=o}};k(Zt,"ServerError");d();p();f();var Yo="Unauthorized, check your connection string",Rr=class extends Q{constructor(r,n=Yo){super(n,q(r,!1));this.name="UnauthorizedError";this.code="P5007"}};k(Rr,"UnauthorizedError");d();p();f();var Xo="Usage exceeded, retry again later",Sr=class extends Q{constructor(r,n=Xo){super(n,q(r,!0));this.name="UsageExceededError";this.code="P5008"}};k(Sr,"UsageExceededError");async function Bf(e){let t;try{t=await e.text()}catch(r){return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch(r){return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Or(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Bf(e);if(n.type==="QueryEngineError")throw new ce(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Zt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Pt(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new vr(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:o,logs:i}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Pr(r,o,i)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:o,error_code:i}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new re(o,t,i)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:o}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Er(r,o)}}if("InteractiveTransactionMisrouted"in n.body){let o={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Tr(r,o[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Cr(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Rr(r,Yt(Yo,n));if(e.status===404)return new Mr(r,Yt(zo,n));if(e.status===429)throw new Sr(r,Yt(Xo,n));if(e.status===504)throw new Ar(r,Yt(Ho,n));if(e.status>=500)throw new Zt(r,Yt(Zo,n));if(e.status>=400)throw new wr(r,Yt(Wo,n))}function Yt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}d();p();f();function Ha(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(o=>setTimeout(()=>o(n),n))}d();p();f();function za(e){var r;if(!!((r=e.generator)!=null&&r.previewFeatures.some(n=>n.toLowerCase().includes("metrics"))))throw new re("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}d();p();f();var Za={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*","@swc/core":"1.3.75","@swc/jest":"0.2.29","@types/jest":"29.5.4","@types/node":"18.17.12",execa:"5.1.1",jest:"29.6.4",typescript:"5.2.2"};d();p();f();d();p();f();var Fr=class extends Ee{constructor(r,n){super(`Cannot fetch data from service: -${r}`,q(n,!0));this.name="RequestError";this.code="P5010"}};k(Fr,"RequestError");async function vt(e,t,r=n=>n){var o;let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(ei)(e,t)}catch(i){console.log(e);let s=(o=i.message)!=null?o:"Unknown error";throw new Fr(s,{clientVersion:n})}}function jf(e){return{...e.headers,"Content-Type":"application/json"}}function Uf(e){return{method:e.method,headers:jf(e)}}function $f(e,t){return{text:()=>Promise.resolve(b.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(b.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new ti(t.headers)}}async function ei(e,t={}){let r=qf("https"),n=Uf(t),o=[],{origin:i}=new URL(e);return new Promise((s,a)=>{var l;let u=r.request(e,n,c=>{let{statusCode:m,headers:{location:g}}=c;m>=301&&m<=399&&g&&(g.startsWith("http")===!1?s(ei(`${i}${g}`,t)):s(ei(g,t))),c.on("data",w=>o.push(w)),c.on("end",()=>s($f(o,c))),c.on("error",a)});u.on("error",a),u.end((l=t.body)!=null?l:"")})}var qf=typeof require!="undefined"?require:()=>{},ti=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let o of n)this.headers.set(r,o)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){var r;return(r=this.headers.get(t))!=null?r:null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,o]of this.headers)t.call(r,o,n,this)}};var Vf=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Ya=xe("prisma:client:dataproxyEngine");async function Kf(e,t){var s,a,u;let r=Za["@prisma/engines-version"],n=(s=t.clientVersion)!=null?s:"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[o,i]=(a=n==null?void 0:n.split("-"))!=null?a:[];if(i===void 0&&Vf.test(o))return o;if(i!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[l]=(u=r.split("-"))!=null?u:[],[c,m,g]=l.split("."),w=Jf(`<=${c}.${m}.${g}`),E=await vt(w,{clientVersion:n});if(!E.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${E.status} ${E.statusText}, response body: ${await E.text()||""}`);let x=await E.text();Ya("length of body fetched from unpkg.com",x.length);let T;try{T=JSON.parse(x)}catch(R){throw console.error("JSON.parse error: body fetched from unpkg.com: ",x),R}return T.version}throw new Et("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Xa(e,t){let r=await Kf(e,t);return Ya("version",r),r}function Jf(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var eu=3,ri=xe("prisma:client:dataproxyEngine"),ni=class{constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`};this.tracingHelper.isEnabled()&&(n.traceparent=t!=null?t:this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let o=this.buildCaptureSettings();return o.length>0&&(n["X-capture-telemetry"]=o.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},Ir=class extends kn{constructor(r){var n,o,i,s;super();za(r),this.config=r,this.env={...this.config.env,...y.env},this.inlineSchema=(n=r.inlineSchema)!=null?n:"",this.inlineDatasources=(o=r.inlineDatasources)!=null?o:{},this.inlineSchemaHash=(i=r.inlineSchemaHash)!=null?i:"",this.clientVersion=(s=r.clientVersion)!=null?s:"unknown",this.logEmitter=r.logEmitter,this.tracingHelper=this.config.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return"unknown"}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[r,n]=this.extractHostAndApiKey();this.host=r,this.headerBuilder=new ni({apiKey:n,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries}),this.remoteClientVersion=await Xa(r,this.config),ri("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){var n,o;(n=r==null?void 0:r.logs)!=null&&n.length&&r.logs.forEach(i=>{switch(i.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let s=typeof i.attributes.query=="string"?i.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[a]=s.split("/* traceparent");s=a}this.logEmitter.emit("query",{query:s,timestamp:i.timestamp,duration:i.attributes.duration_ms,params:i.attributes.params,target:i.attributes.target})}}}),(o=r==null?void 0:r.traces)!=null&&o.length&&this.tracingHelper.createEngineSpan({span:!0,spans:r.traces})}on(r,n){if(r==="beforeExit")throw new Error('"beforeExit" hook is not applicable to the remote query engine');this.logEmitter.on(r,n)}async url(r){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async uploadSchema(){let r={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(r,async()=>{let n=await vt(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});n.ok||ri("schema response status",n.status);let o=await Or(n,this.clientVersion);if(o)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${o.message}`}),o;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`})})}request(r,{traceparent:n,interactiveTransaction:o,customDataProxyFetch:i}){return this.requestInternal({body:r,traceparent:n,interactiveTransaction:o,customDataProxyFetch:i})}async requestBatch(r,{traceparent:n,transaction:o,customDataProxyFetch:i}){let s=(o==null?void 0:o.kind)==="itx"?o.options:void 0,a=Ga(r,o),{batchResult:u,elapsed:l}=await this.requestInternal({body:a,customDataProxyFetch:i,interactiveTransaction:s,traceparent:n});return u.map(c=>"errors"in c&&c.errors.length>0?Go(c.errors[0],this.clientVersion):{data:c,elapsed:l})}requestInternal({body:r,traceparent:n,customDataProxyFetch:o,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:s})=>{let a=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");s(a);let u=await vt(a,{method:"POST",headers:this.headerBuilder.build({traceparent:n,interactiveTransaction:i}),body:JSON.stringify(r),clientVersion:this.clientVersion},o);u.ok||ri("graphql response status",u.status),await this.handleError(await Or(u,this.clientVersion));let l=await u.json(),c=l.extensions;if(c&&this.propagateResponseExtensions(c),l.errors)throw l.errors.length===1?Go(l.errors[0],this.config.clientVersion):new Re(l.errors,{clientVersion:this.config.clientVersion});return l}})}async transaction(r,n,o){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[r]} transaction`,callback:async({logHttpCall:s})=>{var a,u;if(r==="start"){let l=JSON.stringify({max_wait:(a=o==null?void 0:o.maxWait)!=null?a:2e3,timeout:(u=o==null?void 0:o.timeout)!=null?u:5e3,isolation_level:o==null?void 0:o.isolationLevel}),c=await this.url("transaction/start");s(c);let m=await vt(c,{method:"POST",headers:this.headerBuilder.build({traceparent:n.traceparent}),body:l,clientVersion:this.clientVersion});await this.handleError(await Or(m,this.clientVersion));let g=await m.json(),w=g.extensions;w&&this.propagateResponseExtensions(w);let E=g.id,x=g["data-proxy"].endpoint;return{id:E,payload:{endpoint:x}}}else{let l=`${o.payload.endpoint}/${r}`;s(l);let c=await vt(l,{method:"POST",headers:this.headerBuilder.build({traceparent:n.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Or(c,this.clientVersion));let g=(await c.json()).extensions;g&&this.propagateResponseExtensions(g);return}}})}extractHostAndApiKey(){let r={clientVersion:this.clientVersion},n=Object.keys(this.inlineDatasources)[0],o=Dn({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(o)}catch(c){throw new wt(`Error validating datasource \`${n}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:s,host:a,searchParams:u}=i;if(s!=="prisma:")throw new wt(`Error validating datasource \`${n}\`: the URL must start with the protocol \`prisma://\``,r);let l=u.get("api_key");if(l===null||l.length<1)throw new wt(`Error validating datasource \`${n}\`: the URL must contain a valid API key`,r);return[a,l]}metrics(){throw new Et("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){var n;for(let o=0;;o++){let i=s=>{this.logEmitter.emit("info",{message:`Calling ${s} (n=${o})`})};try{return await r.callback({logHttpCall:i})}catch(s){if(!(s instanceof Ee)||!s.isRetryable)throw s;if(o>=eu)throw s instanceof zt?s.cause:s;this.logEmitter.emit("warn",{message:`Attempt ${o+1}/${eu} failed for ${r.actionGerund}: ${(n=s.message)!=null?n:"(unknown)"}`});let a=await Ha(o);this.logEmitter.emit("warn",{message:`Retrying after ${a}ms`})}}}async handleError(r){if(r instanceof Pt)throw await this.uploadSchema(),new zt({clientVersion:this.clientVersion,cause:r});if(r)throw r}};function tu(e,t){let r;try{r=Dn({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch(o){}e.noEngine!==!0&&(r!=null&&r.startsWith("prisma://"))&&ar("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Po(t.generator);return r!=null&&r.startsWith("prisma://")||e.noEngine,new Ir(t);throw new pe("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}d();p();f();d();p();f();d();p();f();var au=Te(oi());d();p();f();function iu(e,t){let r=su(e),n=Qf(r),o=Wf(n);o?Nn(o,t):t.addErrorMessage(()=>"Unknown error")}function su(e){return e.errors.flatMap(t=>t.kind==="Union"?su(t):[t])}function Qf(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let o=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,i=t.get(o);i?t.set(o,{...n,argument:{...n.argument,typeNames:Gf(i.argument.typeNames,n.argument.typeNames)}}):t.set(o,n)}return r.push(...t.values()),r}function Gf(e,t){return[...new Set(e.concat(t))]}function Wf(e){return Ro(e,(t,r)=>{let n=nu(t),o=nu(r);return n!==o?n-o:ou(t)-ou(r)})}function nu(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ou(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}d();p();f();var Ge=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};d();p();f();var Bn=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:o,dim:i}=n.context.colors;n.write(o(i(`${t}: ${r}`))).addMarginSymbol(o(i("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(Qt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Nn(e,t){switch(e.kind){case"IncludeAndSelect":Hf(e,t);break;case"IncludeOnScalar":zf(e,t);break;case"EmptySelection":Zf(e,t);break;case"UnknownSelectionField":Yf(e,t);break;case"UnknownArgument":Xf(e,t);break;case"UnknownInputField":ed(e,t);break;case"RequiredArgumentMissing":td(e,t);break;case"InvalidArgumentType":rd(e,t);break;case"InvalidArgumentValue":nd(e,t);break;case"ValueTooLarge":od(e,t);break;case"SomeFieldsMissing":id(e,t);break;case"TooManyFieldsGiven":sd(e,t);break;case"Union":iu(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function Hf(e,t){var n,o;let r=t.arguments.getDeepSubSelectionValue(e.selectionPath);r&&r instanceof ne&&((n=r.getField("include"))==null||n.markAsError(),(o=r.getField("select"))==null||o.markAsError()),t.addErrorMessage(i=>`Please ${i.bold("either")} use ${i.green("`include`")} or ${i.green("`select`")}, but ${i.red("not both")} at the same time.`)}function zf(e,t){var s,a;let[r,n]=Ln(e.selectionPath),o=e.outputType,i=(s=t.arguments.getDeepSelectionParent(r))==null?void 0:s.value;if(i&&((a=i.getField(n))==null||a.markAsError(),o))for(let u of o.fields)u.isRelation&&i.addSuggestion(new Ge(u.name,"true"));t.addErrorMessage(u=>{let l=`Invalid scalar field ${u.red(`\`${n}\``)} for ${u.bold("include")} statement`;return o?l+=` on model ${u.bold(o.name)}. ${kr(u)}`:l+=".",l+=` -Note that ${u.bold("include")} statements only accept relation fields.`,l})}function Zf(e,t){var i,s;let r=e.outputType,n=(i=t.arguments.getDeepSelectionParent(e.selectionPath))==null?void 0:i.value,o=(s=n==null?void 0:n.isEmpty())!=null?s:!1;n&&(n.removeAllFields(),cu(n,r)),t.addErrorMessage(a=>o?`The ${a.red("`select`")} statement for type ${a.bold(r.name)} must not be empty. ${kr(a)}`:`The ${a.red("`select`")} statement for type ${a.bold(r.name)} needs ${a.bold("at least one truthy value")}.`)}function Yf(e,t){var i;let[r,n]=Ln(e.selectionPath),o=t.arguments.getDeepSelectionParent(r);o&&((i=o.value.getField(n))==null||i.markAsError(),cu(o.value,e.outputType)),t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o.kind)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(kr(s)),a.join(" ")})}function Xf(e,t){var o;let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof ne&&((o=n.getField(r))==null||o.markAsError(),ad(n,e.arguments)),t.addErrorMessage(i=>uu(i,r,e.arguments.map(s=>s.name)))}function ed(e,t){var i;let[r,n]=Ln(e.argumentPath),o=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(o instanceof ne){(i=o.getDeepField(e.argumentPath))==null||i.markAsError();let s=o.getDeepFieldValue(r);s instanceof ne&&pu(s,e.inputType)}t.addErrorMessage(s=>uu(s,n,e.inputType.fields.map(a=>a.name)))}function uu(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],o=ld(t,r);return o&&n.push(`Did you mean \`${e.green(o)}\`?`),r.length>0&&n.push(kr(e)),n.join(" ")}function td(e,t){let r;t.addErrorMessage(u=>(r==null?void 0:r.value)instanceof oe&&r.value.text==="null"?`Argument \`${u.green(i)}\` must not be ${u.red("null")}.`:`Argument \`${u.green(i)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(!(n instanceof ne))return;let[o,i]=Ln(e.argumentPath),s=new Bn,a=n.getDeepFieldValue(o);if(a instanceof ne)if(r=a.getField(i),r&&a.removeField(i),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let u of e.inputTypes[0].fields)s.addField(u.name,u.typeNames.join(" | "));a.addSuggestion(new Ge(i,s).makeRequired())}else{let u=e.inputTypes.map(lu).join(" | ");a.addSuggestion(new Ge(i,u).makeRequired())}}function lu(e){return e.kind==="list"?`${lu(e.elementType)}[]`:e.name}function rd(e,t){var o;let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof ne&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(i=>{let s=jn("or",e.argument.typeNames.map(a=>i.green(a)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${s}, provided ${i.red(e.inferredType)}.`})}function nd(e,t){var o;let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof ne&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(i=>{let s=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&s.push(`: ${e.underlyingError}`),s.push("."),e.argument.typeNames.length>0){let a=jn("or",e.argument.typeNames.map(u=>i.green(u)));s.push(` Expected ${a}.`)}return s.join("")})}function od(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath),o;if(n instanceof ne){let i=n.getDeepField(e.argumentPath),s=i==null?void 0:i.value;s==null||s.markAsError(),s instanceof oe&&(o=s.text)}t.addErrorMessage(i=>{let s=["Unable to fit value"];return o&&s.push(i.red(o)),s.push(`into a 64-bit signed integer for field \`${i.bold(r)}\``),s.join(" ")})}function id(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(n instanceof ne){let o=n.getDeepFieldValue(e.argumentPath);o instanceof ne&&pu(o,e.inputType)}t.addErrorMessage(o=>{let i=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?i.push(`${o.green("at least one of")} ${jn("or",e.constraints.requiredFields.map(s=>`\`${o.bold(s)}\``))} arguments.`):i.push(`${o.green("at least one")} argument.`):i.push(`${o.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),i.push(kr(o)),i.join(" ")})}function sd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath),o=[];if(n instanceof ne){let i=n.getDeepFieldValue(e.argumentPath);i instanceof ne&&(i.markAsError(),o=Object.keys(i.getFields()))}t.addErrorMessage(i=>{let s=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${i.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${i.green("at most one")} argument,`):s.push(`${i.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${jn("and",o.map(a=>i.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function cu(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Ge(r.name,"true"))}function ad(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new Ge(r.name,r.typeNames.join(" | ")))}function pu(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Ge(r.name,r.typeNames.join(" | ")))}function Ln(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function kr({green:e}){return`Available options are listed in ${e("green")}.`}function jn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var ud=3;function ld(e,t){let r=1/0,n;for(let o of t){let i=(0,au.default)(e,o);i>ud||i({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){var r;return(r=this.model)==null?void 0:r.fields.find(n=>n.name===t)}nestSelection(t){let r=this.findField(t),n=(r==null?void 0:r.kind)==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};d();p();f();var gu=e=>({command:e});d();p();f();d();p();f();var yu=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);d();p();f();function Dr(e){try{return hu(e,"fast")}catch(t){return hu(e,"slow")}}function hu(e,t){return JSON.stringify(e.map(r=>xd(r,t)))}function xd(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:$t(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Le.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:b.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:bd(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:b.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?bu(e):e}function bd(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function bu(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(xu);let t={};for(let r of Object.keys(e))t[r]=xu(e[r]);return t}function xu(e){return typeof e=="bigint"?e.toString():bu(e)}var wd=/^(\s*alter\s)/i,wu=xe("prisma:client");function ai(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&wd.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var ui=(e,t)=>r=>{let n="",o;if(Array.isArray(r)){let[i,...s]=r;n=i,o={values:Dr(s||[]),__prismaRawParameters__:!0}}else switch(e){case"sqlite":case"mysql":{n=r.sql,o={values:Dr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":{n=r.text,o={values:Dr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=yu(r),o={values:Dr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${e} provider does not support ${t}`)}return o!=null&&o.values?wu(`prisma.${t}(${n}, ${o.values})`):wu(`prisma.${t}(${n})`),{query:n,parameters:o}},Eu={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new be(t,r)}},Pu={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};d();p();f();function li(e){return function(r){let n,o=(i=e)=>{try{return i===void 0||(i==null?void 0:i.kind)==="itx"?n!=null?n:n=vu(r(i)):vu(r(i))}catch(s){return Promise.reject(s)}};return{then(i,s){return o().then(i,s)},catch(i){return o().catch(i)},finally(i){return o().finally(i)},requestTransaction(i){let s=o(i);return s.requestTransaction?s.requestTransaction(i):s},[Symbol.toStringTag]:"PrismaPromise"}}}function vu(e){return typeof e.then=="function"?e:Promise.resolve(e)}d();p();f();var Au={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},ci=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){var t,r;return(r=(t=globalThis.PRISMA_INSTRUMENTATION)==null?void 0:t.helper)!=null?r:Au}};function Tu(e){return e.includes("tracing")?new ci:Au}d();p();f();function Cu(e,t=()=>{}){let r,n=new Promise(o=>r=o);return{then(o){return--e===0&&r(t()),o==null?void 0:o(n)}}}d();p();f();function Mu(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}d();p();f();var Ed=["$connect","$disconnect","$on","$transaction","$use","$extends"],Ru=Ed;d();p();f();var $n=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};d();p();f();var Ou=Te(Ls());d();p();f();function qn(e){return typeof e.batchRequestIdx=="number"}d();p();f();function Vn(e){return e===null?e:Array.isArray(e)?e.map(Vn):typeof e=="object"?Pd(e)?vd(e):Lt(e,Vn):e}function Pd(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function vd({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return b.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new Le(t);case"Json":return JSON.parse(t);default:ht(t,"Unknown tagged value")}}d();p();f();function Su(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(pi(e.query.arguments)),t.push(pi(e.query.selection)),t.join("")}function pi(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${pi(n)})`:r}).join(" ")})`}d();p();f();var Ad={aggregate:!1,aggregateRaw:!1,createMany:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function fi(e){return Ad[e]}d();p();f();var Kn=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,o)=>{this.batches[r].push({request:t,resolve:n,reject:o})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,o)=>this.options.batchOrder(n.request,o.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let o=0;o{for(let o=0;o{let{transaction:i,otelParentCtx:s}=n[0],a=n.map(m=>m.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),l=n.some(m=>fi(m.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:Cd(i),containsWrite:l,customDataProxyFetch:o})).map((m,g)=>{if(m instanceof Error)return m;try{return this.mapQueryEngineResult(n[g],m)}catch(w){return w}})}),singleLoader:async n=>{var s;let o=((s=n.transaction)==null?void 0:s.kind)==="itx"?Fu(n.transaction):void 0,i=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:o,isWrite:fi(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,i)},batchBy:n=>{var o;return(o=n.transaction)!=null&&o.id?`transaction-${n.transaction.id}`:Su(n.protocolQuery)},batchOrder(n,o){var i,s;return((i=n.transaction)==null?void 0:i.kind)==="batch"&&((s=o.transaction)==null?void 0:s.kind)==="batch"?n.transaction.index-o.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:o,transaction:i,args:s}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:o,transaction:i,args:s})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let o=n==null?void 0:n.data,i=n==null?void 0:n.elapsed,s=this.unpack(o,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:i}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:o,args:i}){if(Td(t),Md(t,o)||t instanceof Ve)throw t;if(t instanceof ce&&Rd(t)){let a=Iu(t.meta);Un({args:i,errors:[a],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let s=t.message;throw n&&(s=Ht({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:s})),s=this.sanitizeMessage(s),t.code?new ce(s,{code:t.code,clientVersion:this.client._clientVersion,meta:t.meta,batchRequestIdx:t.batchRequestIdx}):t.isPanic?new Ke(s,this.client._clientVersion):t instanceof Re?new Re(s,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx}):t instanceof re?new re(s,this.client._clientVersion):t instanceof Ke?new Ke(s,this.client._clientVersion):(t.clientVersion=this.client._clientVersion,t)}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Ou.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let o=Object.values(t)[0],i=r.filter(a=>a!=="select"&&a!=="include"),s=Vn(Vo(o,i));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function Cd(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Fu(e)};ht(e,"Unknown transaction kind")}}function Fu(e){return{id:e.id,payload:e.payload}}function Md(e,t){return qn(e)&&(t==null?void 0:t.kind)==="batch"&&e.batchRequestIdx!==t.index}function Rd(e){return e.code==="P2009"||e.code==="P2012"}function Iu(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Iu)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}d();p();f();var ku="5.3.1";var Du=ku;d();p();f();function _u(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Nu(t[n]);return r})}function Nu({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return b.Buffer.from(t,"base64");case"decimal":return new Le(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Nu);default:return t}}d();p();f();var Uu=Te(oi());d();p();f();var Z=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};k(Z,"PrismaClientConstructorValidationError");var Bu=["datasources","datasourceUrl","errorFormat","log","__internal"],Lu=["pretty","colorless","minimal"],ju=["info","query","warn","error"],Od={datasources:(e,t)=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new Z(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let o=Xt(r,t)||` Available datasources: ${t.join(", ")}`;throw new Z(`Unknown datasource ${r} provided to PrismaClient constructor.${o}`)}if(typeof n!="object"||Array.isArray(n))throw new Z(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[o,i]of Object.entries(n)){if(o!=="url")throw new Z(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof i!="string")throw new Z(`Invalid value ${JSON.stringify(i)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},datasourceUrl:e=>{if(typeof e!="undefined"&&typeof e!="string")throw new Z(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new Z(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Lu.includes(e)){let t=Xt(e,Lu);throw new Z(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new Z(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!ju.includes(r)){let n=Xt(r,ju);throw new Z(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:o=>{let i=["stdout","event"];if(!i.includes(o)){let s=Xt(o,i);throw new Z(`Invalid value ${JSON.stringify(o)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[o,i]of Object.entries(r))if(n[o])n[o](i);else throw new Z(`Invalid property ${o} for "log" provided to PrismaClient constructor`)}},__internal:e=>{if(!e)return;let t=["debug","hooks","engine","measurePerformance"];if(typeof e!="object")throw new Z(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Xt(r,t);throw new Z(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function $u(e,t){for(let[r,n]of Object.entries(e)){if(!Bu.includes(r)){let o=Xt(r,Bu);throw new Z(`Unknown property ${r} provided to PrismaClient constructor.${o}`)}Od[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new Z('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Xt(e,t){if(t.length===0||typeof e!="string")return"";let r=Fd(e,t);return r?` Did you mean "${r}"?`:""}function Fd(e,t){if(t.length===0)return null;let r=t.map(o=>({value:o,distance:(0,Uu.default)(e,o)}));r.sort((o,i)=>o.distance{let n=new Array(e.length),o=null,i=!1,s=0,a=()=>{i||(s++,s===e.length&&(i=!0,o?r(o):t(n)))},u=l=>{i||(i=!0,r(l))};for(let l=0;l{n[l]=c,a()},c=>{if(!qn(c)){u(c);return}c.batchRequestIdx===l?u(c):(o||(o=c),a())})})}var lt=xe("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Id={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},kd=Symbol.for("prisma.client.transaction.id"),Dd={id:0,nextId(){return++this.id}};function Ju(e){class t{constructor(n){this._middlewares=new $n;this._createPrismaPromise=li();this.$extends=Sa;var a,u,l,c,m,g,w,E;Ja(e),n&&$u(n,e.datasourceNames);let o=new Ku.EventEmitter().on("error",()=>{});this._extensions=In.empty(),this._previewFeatures=(u=(a=e.generator)==null?void 0:a.previewFeatures)!=null?u:[],this._clientVersion=(l=e.clientVersion)!=null?l:Du,this._activeProvider=e.activeProvider,this._tracingHelper=Tu(this._previewFeatures);let i={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&_r.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&_r.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s=(c=e.injectableEdgeEnv)==null?void 0:c.call(e);try{let x=n!=null?n:{},T=(m=x.__internal)!=null?m:{},R=T.debug===!0;R&&xe.enable("prisma:client");let S=_r.default.resolve(e.dirname,e.relativePath);an.existsSync(S)||(S=e.dirname),lt("dirname",e.dirname),lt("relativePath",e.relativePath),lt("cwd",S);let C=T.engine||{};if(x.errorFormat?this._errorFormat=x.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:S,dirname:e.dirname,enableDebugLogs:R,allowTriggerPanic:C.allowTriggerPanic,datamodelPath:_r.default.join(e.dirname,(g=e.filename)!=null?g:"schema.prisma"),prismaPath:(w=C.binaryPath)!=null?w:void 0,engineEndpoint:C.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:x.log&&Mu(x.log),logQueries:x.log&&!!(typeof x.log=="string"?x.log==="query":x.log.find(M=>typeof M=="string"?M==="query":M.level==="query")),env:(E=s==null?void 0:s.parsed)!=null?E:{},flags:[],clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Qa(x,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,logEmitter:o,isBundled:e.isBundled},lt("clientVersion",e.clientVersion),this._engine=tu(e,this._engineConfig),this._requestHandler=new Jn(this,o),x.log)for(let M of x.log){let N=typeof M=="string"?M:M.emit==="stdout"?M.level:null;N&&this.$on(N,B=>{var de;Bt.log(`${(de=Bt.tags[N])!=null?de:""}`,B.message||B.query)})}this._metrics=new jt(this._engine)}catch(x){throw x.clientVersion=this._clientVersion,x}return this._appliedParent=xr(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,o){n==="beforeExit"?this._engine.on("beforeExit",o):this._engine.on(n,i=>{var a,u,l,c;let s=i.fields;return o(n==="query"?{timestamp:i.timestamp,query:(a=s==null?void 0:s.query)!=null?a:i.query,params:(u=s==null?void 0:s.params)!=null?u:i.params,duration:(l=s==null?void 0:s.duration_ms)!=null?l:i.duration,target:i.target}:{timestamp:i.timestamp,message:(c=s==null?void 0:s.message)!=null?c:i.message,target:i.target})})}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{hs()}}$executeRawInternal(n,o,i,s){return this._request({action:"executeRaw",args:i,transaction:n,clientMethod:o,argsMapper:ui(this._activeProvider,o),callsite:ut(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...o){return this._createPrismaPromise(i=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Vu(n,o);return ai(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(i,"$executeRaw",s,a)}throw new pe("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...o){return this._createPrismaPromise(i=>(ai(this._activeProvider,n,o,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(i,"$executeRawUnsafe",[n,...o])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new pe(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(o=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:gu,callsite:ut(this._errorFormat),transaction:o}))}async $queryRawInternal(n,o,i,s){return this._request({action:"queryRaw",args:i,transaction:n,clientMethod:o,argsMapper:ui(this._activeProvider,o),callsite:ut(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(_u)}$queryRaw(n,...o){return this._createPrismaPromise(i=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(i,"$queryRaw",...Vu(n,o));throw new pe("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...o){return this._createPrismaPromise(i=>this.$queryRawInternal(i,"$queryRawUnsafe",[n,...o]))}_transactionWithArray({promises:n,options:o}){let i=Dd.nextId(),s=Cu(n.length),a=n.map((u,l)=>{var g,w;if((u==null?void 0:u[Symbol.toStringTag])!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=o==null?void 0:o.isolationLevel,m={kind:"batch",id:i,index:l,isolationLevel:c,lock:s};return(w=(g=u.requestTransaction)==null?void 0:g.call(u,m))!=null?w:u});return qu(a)}async _transactionWithCallback({callback:n,options:o}){let i={traceparent:this._tracingHelper.getTraceParent()},s=await this._engine.transaction("start",i,o),a;try{let u={kind:"itx",...s};a=await n(this._createItxClient(u)),await this._engine.transaction("commit",i,s)}catch(u){throw await this._engine.transaction("rollback",i,s).catch(()=>{}),u}return a}_createItxClient(n){return xr(Ne(Sn(this),[ye("_appliedParent",()=>this._appliedParent._createItxClient(n)),ye("_createPrismaPromise",()=>li(n)),ye(kd,()=>n.id),cr(Ru)]))}$transaction(n,o){let i;typeof n=="function"?i=()=>this._transactionWithCallback({callback:n,options:o}):i=()=>this._transactionWithArray({promises:n,options:o});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,i)}_request(n){var l;n.otelParentCtx=this._tracingHelper.getActiveContext();let o=(l=n.middlewareArgsMapper)!=null?l:Id,i={args:o.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:i.action,model:i.model,name:i.model?`${i.model}.${i.action}`:i.action}}},a=-1,u=async c=>{let m=this._middlewares.get(++a);if(m)return this._tracingHelper.runInChildSpan(s.middleware,R=>m(c,S=>(R==null||R.end(),u(S))));let{runInTransaction:g,args:w,...E}=c,x={...n,...E};w&&(x.args=o.middlewareArgsToRequestArgs(w)),n.transaction!==void 0&&g===!1&&delete x.transaction;let T=await Na(this,x);return x.model?Ia({result:T,modelName:x.model,args:x.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):T};return this._tracingHelper.runInChildSpan(s.operation,()=>u(i))}async _executeRequest({args:n,clientMethod:o,dataPath:i,callsite:s,action:a,model:u,argsMapper:l,transaction:c,unpacker:m,otelParentCtx:g,customDataProxyFetch:w}){try{n=l?l(n):n;let E={name:"serialize"},x=this._tracingHelper.runInChildSpan(E,()=>fu({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:o,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion}));return xe.enabled("prisma:client")&&(lt("Prisma Client call:"),lt(`prisma.${o}(${fa(n)})`),lt("Generated request:"),lt(JSON.stringify(x,null,2)+` -`)),(c==null?void 0:c.kind)==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:x,modelName:u,action:a,clientMethod:o,dataPath:i,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:m,otelParentCtx:g,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:w})}catch(E){throw E.clientVersion=this._clientVersion,E}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new pe("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){var o;return!!((o=this._engineConfig.previewFeatures)!=null&&o.includes(n))}}return t}function Vu(e,t){return _d(e)?[new be(e,t),Eu]:[e,Pu]}function _d(e){return Array.isArray(e)&&Array.isArray(e.raw)}d();p();f();var Nd=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Qu(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Nd.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}d();p();f();0&&(module.exports={DMMF,DMMFClass,Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,Types,defineDmmfProperty,empty,getPrismaClient,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=edge.js.map diff --git a/chase/backend/prisma/generated/client/runtime/index-browser.d.ts b/chase/backend/prisma/generated/client/runtime/index-browser.d.ts deleted file mode 100644 index 215a0ca6..00000000 --- a/chase/backend/prisma/generated/client/runtime/index-browser.d.ts +++ /dev/null @@ -1,378 +0,0 @@ -declare class AnyNull extends NullTypesEnumValue { -} - -export declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : never; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -/** - * Detect the current JavaScript runtime following - * the WinterCG Runtime Keys proposal: - * - * - `edge-routine` Alibaba Cloud Edge Routine - * - `workerd` Cloudflare Workers - * - `deno` Deno and Deno Deploy - * - `lagon` Lagon - * - `react-native` React Native - * - `netlify` Netlify Edge Functions - * - `electron` Electron - * - `node` Node.js - * - `bun` Bun - * - `edge-light` Vercel Edge Functions - * - `fastly` Fastly Compute@Edge - * - * @see https://runtime-keys.proposal.wintercg.org/ - * @returns {Runtime} - */ -export declare function detectRuntime(): Runtime; - -export declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof W]: K extends keyof A ? Exact : never; -} : W) : never) | (A extends Narrowable ? A : never); - -declare class JsonNull extends NullTypesEnumValue { -} - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -export declare type Narrowable = string | number | bigint | boolean | []; - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * Base class for unique values of object-valued enums. - */ -declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -declare namespace Public { - export { - validator - } -} -export { Public } - -export declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -export { } diff --git a/chase/backend/prisma/generated/client/runtime/index-browser.js b/chase/backend/prisma/generated/client/runtime/index-browser.js deleted file mode 100644 index 94566e22..00000000 --- a/chase/backend/prisma/generated/client/runtime/index-browser.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict";var he=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var Ce=(e,n)=>{for(var i in n)he(e,i,{get:n[i],enumerable:!0})},Ge=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of We(n))!je.call(e,t)&&t!==i&&he(e,t,{get:()=>n[t],enumerable:!(r=Je(n,t))||r.enumerable});return e};var Xe=e=>Ge(he({},"__esModule",{value:!0}),e);var jn={};Ce(jn,{Decimal:()=>Ve,Public:()=>de,detectRuntime:()=>He,makeStrictEnum:()=>Pe,objectEnumValues:()=>Oe});module.exports=Xe(jn);var de={};Ce(de,{validator:()=>Me});function Me(...e){return n=>n}var ne=Symbol(),pe=new WeakMap,ge=class{constructor(n){n===ne?pe.set(this,"Prisma.".concat(this._getName())):pe.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return pe.get(this)}},j=class extends ge{_getNamespace(){return"NullTypes"}},G=class extends j{};me(G,"DbNull");var X=class extends j{};me(X,"JsonNull");var K=class extends j{};me(K,"AnyNull");var Oe={classes:{DbNull:G,JsonNull:X,AnyNull:K},instances:{DbNull:new G(ne),JsonNull:new X(ne),AnyNull:new K(ne)}};function me(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0})}var Ke=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Pe(e){return new Proxy(e,{get(n,i){if(i in n)return n[i];if(!Ke.has(i))throw new TypeError("Invalid enum value: ".concat(String(i)))}})}var H=9e15,V=1e9,we="0123456789abcdef",re="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",te="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ne={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-H,maxE:H,crypto:!1},qe,Z,w=!0,oe="[DecimalError] ",$=oe+"Invalid argument: ",Te=oe+"Precision limit exceeded",Le=oe+"crypto unavailable",Re="[object Decimal]",A=Math.floor,M=Math.pow,Qe=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ye=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,xe=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Fe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,F=1e7,m=7,ze=9007199254740991,ye=re.length-1,ve=te.length-1,d={toStringTag:Re};d.absoluteValue=d.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),p(e)};d.ceil=function(){return p(new this.constructor(this),this.e+1,2)};d.clampedTo=d.clamp=function(e,n){var i,r=this,t=r.constructor;if(e=new t(e),n=new t(n),!e.s||!n.s)return new t(NaN);if(e.gt(n))throw Error($+n);return i=r.cmp(e),i<0?e:r.cmp(n)>0?n:new t(r)};d.comparedTo=d.cmp=function(e){var n,i,r,t,s=this,o=s.d,u=(e=new s.constructor(e)).d,l=s.s,f=e.s;if(!o||!u)return!l||!f?NaN:l!==f?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-f:0;if(l!==f)return l;if(s.e!==e.e)return s.e>e.e^l<0?1:-1;for(r=o.length,t=u.length,n=0,i=ru[n]^l<0?1:-1;return r===t?0:r>t^l<0?1:-1};d.cosine=d.cos=function(){var e,n,i=this,r=i.constructor;return i.d?i.d[0]?(e=r.precision,n=r.rounding,r.precision=e+Math.max(i.e,i.sd())+m,r.rounding=1,i=en(r,Be(r,i)),r.precision=e,r.rounding=n,p(Z==2||Z==3?i.neg():i,e,n,!0)):new r(1):new r(NaN)};d.cubeRoot=d.cbrt=function(){var e,n,i,r,t,s,o,u,l,f,c=this,a=c.constructor;if(!c.isFinite()||c.isZero())return new a(c);for(w=!1,s=c.s*M(c.s*c,1/3),!s||Math.abs(s)==1/0?(i=O(c.d),e=c.e,(s=(e-i.length+1)%3)&&(i+=s==1||s==-2?"0":"00"),s=M(i,1/3),e=A((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?i="5e"+e:(i=s.toExponential(),i=i.slice(0,i.indexOf("e")+1)+e),r=new a(i),r.s=c.s):r=new a(s.toString()),o=(e=a.precision)+3;;)if(u=r,l=u.times(u).times(u),f=l.plus(c),r=S(f.plus(c).times(u),f.plus(l),o+2,1),O(u.d).slice(0,o)===(i=O(r.d)).slice(0,o))if(i=i.slice(o-3,o+1),i=="9999"||!t&&i=="4999"){if(!t&&(p(u,e+1,0),u.times(u).times(u).eq(c))){r=u;break}o+=4,t=1}else{(!+i||!+i.slice(1)&&i.charAt(0)=="5")&&(p(r,e+1,1),n=!r.times(r).times(r).eq(c));break}return w=!0,p(r,e,a.rounding,n)};d.decimalPlaces=d.dp=function(){var e,n=this.d,i=NaN;if(n){if(e=n.length-1,i=(e-A(this.e/m))*m,e=n[e],e)for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i};d.dividedBy=d.div=function(e){return S(this,new this.constructor(e))};d.dividedToIntegerBy=d.divToInt=function(e){var n=this,i=n.constructor;return p(S(n,new i(e),0,1,1),i.precision,i.rounding)};d.equals=d.eq=function(e){return this.cmp(e)===0};d.floor=function(){return p(new this.constructor(this),this.e+1,3)};d.greaterThan=d.gt=function(e){return this.cmp(e)>0};d.greaterThanOrEqualTo=d.gte=function(e){var n=this.cmp(e);return n==1||n===0};d.hyperbolicCosine=d.cosh=function(){var e,n,i,r,t,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;i=o.precision,r=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,t=s.d.length,t<32?(e=Math.ceil(t/3),n=(1/fe(4,e)).toString()):(e=16,n="2.3283064365386962890625e-10"),s=J(o,1,s.times(n),new o(1),!0);for(var l,f=e,c=new o(8);f--;)l=s.times(s),s=u.minus(l.times(c.minus(l.times(c))));return p(s,o.precision=i,o.rounding=r,!0)};d.hyperbolicSine=d.sinh=function(){var e,n,i,r,t=this,s=t.constructor;if(!t.isFinite()||t.isZero())return new s(t);if(n=s.precision,i=s.rounding,s.precision=n+Math.max(t.e,t.sd())+4,s.rounding=1,r=t.d.length,r<3)t=J(s,2,t,t,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,t=t.times(1/fe(5,e)),t=J(s,2,t,t,!0);for(var o,u=new s(5),l=new s(16),f=new s(20);e--;)o=t.times(t),t=t.times(u.plus(o.times(l.times(o).plus(f))))}return s.precision=n,s.rounding=i,p(t,n,i,!0)};d.hyperbolicTangent=d.tanh=function(){var e,n,i=this,r=i.constructor;return i.isFinite()?i.isZero()?new r(i):(e=r.precision,n=r.rounding,r.precision=e+7,r.rounding=1,S(i.sinh(),i.cosh(),r.precision=e,r.rounding=n)):new r(i.s)};d.inverseCosine=d.acos=function(){var e,n=this,i=n.constructor,r=n.abs().cmp(1),t=i.precision,s=i.rounding;return r!==-1?r===0?n.isNeg()?R(i,t,s):new i(0):new i(NaN):n.isZero()?R(i,t+4,s).times(.5):(i.precision=t+6,i.rounding=1,n=n.asin(),e=R(i,t+4,s).times(.5),i.precision=t,i.rounding=s,e.minus(n))};d.inverseHyperbolicCosine=d.acosh=function(){var e,n,i=this,r=i.constructor;return i.lte(1)?new r(i.eq(1)?0:NaN):i.isFinite()?(e=r.precision,n=r.rounding,r.precision=e+Math.max(Math.abs(i.e),i.sd())+4,r.rounding=1,w=!1,i=i.times(i).minus(1).sqrt().plus(i),w=!0,r.precision=e,r.rounding=n,i.ln()):new r(i)};d.inverseHyperbolicSine=d.asinh=function(){var e,n,i=this,r=i.constructor;return!i.isFinite()||i.isZero()?new r(i):(e=r.precision,n=r.rounding,r.precision=e+2*Math.max(Math.abs(i.e),i.sd())+6,r.rounding=1,w=!1,i=i.times(i).plus(1).sqrt().plus(i),w=!0,r.precision=e,r.rounding=n,i.ln())};d.inverseHyperbolicTangent=d.atanh=function(){var e,n,i,r,t=this,s=t.constructor;return t.isFinite()?t.e>=0?new s(t.abs().eq(1)?t.s/0:t.isZero()?t:NaN):(e=s.precision,n=s.rounding,r=t.sd(),Math.max(r,e)<2*-t.e-1?p(new s(t),e,n,!0):(s.precision=i=r-t.e,t=S(t.plus(1),new s(1).minus(t),i+e,1),s.precision=e+4,s.rounding=1,t=t.ln(),s.precision=e,s.rounding=n,t.times(.5))):new s(NaN)};d.inverseSine=d.asin=function(){var e,n,i,r,t=this,s=t.constructor;return t.isZero()?new s(t):(n=t.abs().cmp(1),i=s.precision,r=s.rounding,n!==-1?n===0?(e=R(s,i+4,r).times(.5),e.s=t.s,e):new s(NaN):(s.precision=i+6,s.rounding=1,t=t.div(new s(1).minus(t.times(t)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=r,t.times(2)))};d.inverseTangent=d.atan=function(){var e,n,i,r,t,s,o,u,l,f=this,c=f.constructor,a=c.precision,h=c.rounding;if(f.isFinite()){if(f.isZero())return new c(f);if(f.abs().eq(1)&&a+4<=ve)return o=R(c,a+4,h).times(.25),o.s=f.s,o}else{if(!f.s)return new c(NaN);if(a+4<=ve)return o=R(c,a+4,h).times(.5),o.s=f.s,o}for(c.precision=u=a+10,c.rounding=1,i=Math.min(28,u/m+2|0),e=i;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(w=!1,n=Math.ceil(u/m),r=1,l=f.times(f),o=new c(f),t=f;e!==-1;)if(t=t.times(l),s=o.minus(t.div(r+=2)),t=t.times(l),o=s.plus(t.div(r+=2)),o.d[n]!==void 0)for(e=n;o.d[e]===s.d[e]&&e--;);return i&&(o=o.times(2<this.d.length-2};d.isNaN=function(){return!this.s};d.isNegative=d.isNeg=function(){return this.s<0};d.isPositive=d.isPos=function(){return this.s>0};d.isZero=function(){return!!this.d&&this.d[0]===0};d.lessThan=d.lt=function(e){return this.cmp(e)<0};d.lessThanOrEqualTo=d.lte=function(e){return this.cmp(e)<1};d.logarithm=d.log=function(e){var n,i,r,t,s,o,u,l,f=this,c=f.constructor,a=c.precision,h=c.rounding,g=5;if(e==null)e=new c(10),n=!0;else{if(e=new c(e),i=e.d,e.s<0||!i||!i[0]||e.eq(1))return new c(NaN);n=e.eq(10)}if(i=f.d,f.s<0||!i||!i[0]||f.eq(1))return new c(i&&!i[0]?-1/0:f.s!=1?NaN:i?0:1/0);if(n)if(i.length>1)s=!0;else{for(t=i[0];t%10===0;)t/=10;s=t!==1}if(w=!1,u=a+g,o=B(f,u),r=n?se(c,u+10):B(e,u),l=S(o,r,u,1),Q(l.d,t=a,h))do if(u+=10,o=B(f,u),r=n?se(c,u+10):B(e,u),l=S(o,r,u,1),!s){+O(l.d).slice(t+1,t+15)+1==1e14&&(l=p(l,a+1,0));break}while(Q(l.d,t+=10,h));return w=!0,p(l,a,h)};d.minus=d.sub=function(e){var n,i,r,t,s,o,u,l,f,c,a,h,g=this,v=g.constructor;if(e=new v(e),!g.d||!e.d)return!g.s||!e.s?e=new v(NaN):g.d?e.s=-e.s:e=new v(e.d||g.s!==e.s?g:NaN),e;if(g.s!=e.s)return e.s=-e.s,g.plus(e);if(f=g.d,h=e.d,u=v.precision,l=v.rounding,!f[0]||!h[0]){if(h[0])e.s=-e.s;else if(f[0])e=new v(g);else return new v(l===3?-0:0);return w?p(e,u,l):e}if(i=A(e.e/m),c=A(g.e/m),f=f.slice(),s=c-i,s){for(a=s<0,a?(n=f,s=-s,o=h.length):(n=h,i=c,o=f.length),r=Math.max(Math.ceil(u/m),o)+2,s>r&&(s=r,n.length=1),n.reverse(),r=s;r--;)n.push(0);n.reverse()}else{for(r=f.length,o=h.length,a=r0;--r)f[o++]=0;for(r=h.length;r>s;){if(f[--r]o?s+1:o+1,t>o&&(t=o,i.length=1),i.reverse();t--;)i.push(0);i.reverse()}for(o=f.length,t=c.length,o-t<0&&(t=o,i=c,c=f,f=i),n=0;t;)n=(f[--t]=f[t]+c[t]+n)/F|0,f[t]%=F;for(n&&(f.unshift(n),++r),o=f.length;f[--o]==0;)f.pop();return e.d=f,e.e=ue(f,r),w?p(e,u,l):e};d.precision=d.sd=function(e){var n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error($+e);return i.d?(n=Ie(i.d),e&&i.e+1>n&&(n=i.e+1)):n=NaN,n};d.round=function(){var e=this,n=e.constructor;return p(new n(e),e.e+1,n.rounding)};d.sine=d.sin=function(){var e,n,i=this,r=i.constructor;return i.isFinite()?i.isZero()?new r(i):(e=r.precision,n=r.rounding,r.precision=e+Math.max(i.e,i.sd())+m,r.rounding=1,i=rn(r,Be(r,i)),r.precision=e,r.rounding=n,p(Z>2?i.neg():i,e,n,!0)):new r(NaN)};d.squareRoot=d.sqrt=function(){var e,n,i,r,t,s,o=this,u=o.d,l=o.e,f=o.s,c=o.constructor;if(f!==1||!u||!u[0])return new c(!f||f<0&&(!u||u[0])?NaN:u?o:1/0);for(w=!1,f=Math.sqrt(+o),f==0||f==1/0?(n=O(u),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=A((l+1)/2)-(l<0||l%2),f==1/0?n="5e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),r=new c(n)):r=new c(f.toString()),i=(l=c.precision)+3;;)if(s=r,r=s.plus(S(o,s,i+2,1)).times(.5),O(s.d).slice(0,i)===(n=O(r.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!t&&n=="4999"){if(!t&&(p(s,l+1,0),s.times(s).eq(o))){r=s;break}i+=4,t=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(p(r,l+1,1),e=!r.times(r).eq(o));break}return w=!0,p(r,l,c.rounding,e)};d.tangent=d.tan=function(){var e,n,i=this,r=i.constructor;return i.isFinite()?i.isZero()?new r(i):(e=r.precision,n=r.rounding,r.precision=e+10,r.rounding=1,i=i.sin(),i.s=1,i=S(i,new r(1).minus(i.times(i)).sqrt(),e+10,0),r.precision=e,r.rounding=n,p(Z==2||Z==4?i.neg():i,e,n,!0)):new r(NaN)};d.times=d.mul=function(e){var n,i,r,t,s,o,u,l,f,c=this,a=c.constructor,h=c.d,g=(e=new a(e)).d;if(e.s*=c.s,!h||!h[0]||!g||!g[0])return new a(!e.s||h&&!h[0]&&!g||g&&!g[0]&&!h?NaN:!h||!g?e.s/0:e.s*0);for(i=A(c.e/m)+A(e.e/m),l=h.length,f=g.length,l=0;){for(n=0,t=l+r;t>r;)u=s[t]+g[r]*h[t-r-1]+n,s[t--]=u%F|0,n=u/F|0;s[t]=(s[t]+n)%F|0}for(;!s[--o];)s.pop();return n?++i:s.shift(),e.d=s,e.e=ue(s,i),w?p(e,a.precision,a.rounding):e};d.toBinary=function(e,n){return ke(this,2,e,n)};d.toDecimalPlaces=d.toDP=function(e,n){var i=this,r=i.constructor;return i=new r(i),e===void 0?i:(q(e,0,V),n===void 0?n=r.rounding:q(n,0,8),p(i,e+i.e+1,n))};d.toExponential=function(e,n){var i,r=this,t=r.constructor;return e===void 0?i=I(r,!0):(q(e,0,V),n===void 0?n=t.rounding:q(n,0,8),r=p(new t(r),e+1,n),i=I(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+i:i};d.toFixed=function(e,n){var i,r,t=this,s=t.constructor;return e===void 0?i=I(t):(q(e,0,V),n===void 0?n=s.rounding:q(n,0,8),r=p(new s(t),e+t.e+1,n),i=I(r,!1,e+r.e+1)),t.isNeg()&&!t.isZero()?"-"+i:i};d.toFraction=function(e){var n,i,r,t,s,o,u,l,f,c,a,h,g=this,v=g.d,N=g.constructor;if(!v)return new N(g);if(f=i=new N(1),r=l=new N(0),n=new N(r),s=n.e=Ie(v)-g.e-1,o=s%m,n.d[0]=M(10,o<0?m+o:o),e==null)e=s>0?n:f;else{if(u=new N(e),!u.isInt()||u.lt(f))throw Error($+u);e=u.gt(n)?s>0?n:f:u}for(w=!1,u=new N(O(v)),c=N.precision,N.precision=s=v.length*m*2;a=S(u,n,0,1,1),t=i.plus(a.times(r)),t.cmp(e)!=1;)i=r,r=t,t=f,f=l.plus(a.times(t)),l=t,t=n,n=u.minus(a.times(t)),u=t;return t=S(e.minus(i),r,0,1,1),l=l.plus(t.times(f)),i=i.plus(t.times(r)),l.s=f.s=g.s,h=S(f,r,s,1).minus(g).abs().cmp(S(l,i,s,1).minus(g).abs())<1?[f,r]:[l,i],N.precision=c,w=!0,h};d.toHexadecimal=d.toHex=function(e,n){return ke(this,16,e,n)};d.toNearest=function(e,n){var i=this,r=i.constructor;if(i=new r(i),e==null){if(!i.d)return i;e=new r(1),n=r.rounding}else{if(e=new r(e),n===void 0?n=r.rounding:q(n,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(w=!1,i=S(i,e,0,n,1).times(e),w=!0,p(i)):(e.s=i.s,i=e),i};d.toNumber=function(){return+this};d.toOctal=function(e,n){return ke(this,8,e,n)};d.toPower=d.pow=function(e){var n,i,r,t,s,o,u=this,l=u.constructor,f=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(M(+u,f));if(u=new l(u),u.eq(1))return u;if(r=l.precision,s=l.rounding,e.eq(1))return p(u,r,s);if(n=A(e.e/m),n>=e.d.length-1&&(i=f<0?-f:f)<=ze)return t=De(l,u,i,r),e.s<0?new l(1).div(t):p(t,r,s);if(o=u.s,o<0){if(nl.maxE+1||n0?o/0:0):(w=!1,l.rounding=u.s=1,i=Math.min(12,(n+"").length),t=Ee(e.times(B(u,r+i)),r),t.d&&(t=p(t,r+5,1),Q(t.d,r,s)&&(n=r+10,t=p(Ee(e.times(B(u,n+i)),n),n+5,1),+O(t.d).slice(r+1,r+15)+1==1e14&&(t=p(t,r+1,0)))),t.s=o,w=!0,l.rounding=s,p(t,r,s))};d.toPrecision=function(e,n){var i,r=this,t=r.constructor;return e===void 0?i=I(r,r.e<=t.toExpNeg||r.e>=t.toExpPos):(q(e,1,V),n===void 0?n=t.rounding:q(n,0,8),r=p(new t(r),e,n),i=I(r,e<=r.e||r.e<=t.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+i:i};d.toSignificantDigits=d.toSD=function(e,n){var i=this,r=i.constructor;return e===void 0?(e=r.precision,n=r.rounding):(q(e,1,V),n===void 0?n=r.rounding:q(n,0,8)),p(new r(i),e,n)};d.toString=function(){var e=this,n=e.constructor,i=I(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i};d.truncated=d.trunc=function(){return p(new this.constructor(this),this.e+1,1)};d.valueOf=d.toJSON=function(){var e=this,n=e.constructor,i=I(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()?"-"+i:i};function O(e){var n,i,r,t=e.length-1,s="",o=e[0];if(t>0){for(s+=o,n=1;ni)throw Error($+e)}function Q(e,n,i,r){var t,s,o,u;for(s=e[0];s>=10;s/=10)--n;return--n<0?(n+=m,t=0):(t=Math.ceil((n+1)/m),n%=m),s=M(10,m-n),u=e[t]%s|0,r==null?n<3?(n==0?u=u/100|0:n==1&&(u=u/10|0),o=i<4&&u==99999||i>3&&u==49999||u==5e4||u==0):o=(i<4&&u+1==s||i>3&&u+1==s/2)&&(e[t+1]/s/100|0)==M(10,n-2)-1||(u==s/2||u==0)&&(e[t+1]/s/100|0)==0:n<4?(n==0?u=u/1e3|0:n==1?u=u/100|0:n==2&&(u=u/10|0),o=(r||i<4)&&u==9999||!r&&i>3&&u==4999):o=((r||i<4)&&u+1==s||!r&&i>3&&u+1==s/2)&&(e[t+1]/s/1e3|0)==M(10,n-3)-1,o}function ie(e,n,i){for(var r,t=[0],s,o=0,u=e.length;oi-1&&(t[r+1]===void 0&&(t[r+1]=0),t[r+1]+=t[r]/i|0,t[r]%=i)}return t.reverse()}function en(e,n){var i,r,t;if(n.isZero())return n;r=n.d.length,r<32?(i=Math.ceil(r/3),t=(1/fe(4,i)).toString()):(i=16,t="2.3283064365386962890625e-10"),e.precision+=i,n=J(e,1,n.times(t),new e(1));for(var s=i;s--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return e.precision-=i,n}var S=function(){function e(r,t,s){var o,u=0,l=r.length;for(r=r.slice();l--;)o=r[l]*t+u,r[l]=o%s|0,u=o/s|0;return u&&r.unshift(u),r}function n(r,t,s,o){var u,l;if(s!=o)l=s>o?1:-1;else for(u=l=0;ut[u]?1:-1;break}return l}function i(r,t,s,o){for(var u=0;s--;)r[s]-=u,u=r[s]1;)r.shift()}return function(r,t,s,o,u,l){var f,c,a,h,g,v,N,_,C,T,E,P,x,D,le,z,W,ce,L,y,ee=r.constructor,ae=r.s==t.s?1:-1,b=r.d,k=t.d;if(!b||!b[0]||!k||!k[0])return new ee(!r.s||!t.s||(b?k&&b[0]==k[0]:!k)?NaN:b&&b[0]==0||!k?ae*0:ae/0);for(l?(g=1,c=r.e-t.e):(l=F,g=m,c=A(r.e/g)-A(t.e/g)),L=k.length,W=b.length,C=new ee(ae),T=C.d=[],a=0;k[a]==(b[a]||0);a++);if(k[a]>(b[a]||0)&&c--,s==null?(D=s=ee.precision,o=ee.rounding):u?D=s+(r.e-t.e)+1:D=s,D<0)T.push(1),v=!0;else{if(D=D/g+2|0,a=0,L==1){for(h=0,k=k[0],D++;(a1&&(k=e(k,h,l),b=e(b,h,l),L=k.length,W=b.length),z=L,E=b.slice(0,L),P=E.length;P=l/2&&++ce;do h=0,f=n(k,E,L,P),f<0?(x=E[0],L!=P&&(x=x*l+(E[1]||0)),h=x/ce|0,h>1?(h>=l&&(h=l-1),N=e(k,h,l),_=N.length,P=E.length,f=n(N,E,_,P),f==1&&(h--,i(N,L<_?y:k,_,l))):(h==0&&(f=h=1),N=k.slice()),_=N.length,_=10;h/=10)a++;C.e=a+c*g-1,p(C,u?s+C.e+1:s,o,v)}return C}}();function p(e,n,i,r){var t,s,o,u,l,f,c,a,h,g=e.constructor;e:if(n!=null){if(a=e.d,!a)return e;for(t=1,u=a[0];u>=10;u/=10)t++;if(s=n-t,s<0)s+=m,o=n,c=a[h=0],l=c/M(10,t-o-1)%10|0;else if(h=Math.ceil((s+1)/m),u=a.length,h>=u)if(r){for(;u++<=h;)a.push(0);c=l=0,t=1,s%=m,o=s-m+1}else break e;else{for(c=u=a[h],t=1;u>=10;u/=10)t++;s%=m,o=s-m+t,l=o<0?0:c/M(10,t-o-1)%10|0}if(r=r||n<0||a[h+1]!==void 0||(o<0?c:c%M(10,t-o-1)),f=i<4?(l||r)&&(i==0||i==(e.s<0?3:2)):l>5||l==5&&(i==4||r||i==6&&(s>0?o>0?c/M(10,t-o):0:a[h-1])%10&1||i==(e.s<0?8:7)),n<1||!a[0])return a.length=0,f?(n-=e.e+1,a[0]=M(10,(m-n%m)%m),e.e=-n||0):a[0]=e.e=0,e;if(s==0?(a.length=h,u=1,h--):(a.length=h+1,u=M(10,m-s),a[h]=o>0?(c/M(10,t-o)%M(10,o)|0)*u:0),f)for(;;)if(h==0){for(s=1,o=a[0];o>=10;o/=10)s++;for(o=a[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(e.e++,a[0]==F&&(a[0]=1));break}else{if(a[h]+=u,a[h]!=F)break;a[h--]=0,u=1}for(s=a.length;a[--s]===0;)a.pop()}return w&&(e.e>g.maxE?(e.d=null,e.e=NaN):e.e0?s=s.charAt(0)+"."+s.slice(1)+U(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):t<0?(s="0."+U(-t-1)+s,i&&(r=i-o)>0&&(s+=U(r))):t>=o?(s+=U(t+1-o),i&&(r=i-t-1)>0&&(s=s+"."+U(r))):((r=t+1)0&&(t+1===o&&(s+="."),s+=U(r))),s}function ue(e,n){var i=e[0];for(n*=m;i>=10;i/=10)n++;return n}function se(e,n,i){if(n>ye)throw w=!0,i&&(e.precision=i),Error(Te);return p(new e(re),n,1,!0)}function R(e,n,i){if(n>ve)throw Error(Te);return p(new e(te),n,i,!0)}function Ie(e){var n=e.length-1,i=n*m+1;if(n=e[n],n){for(;n%10==0;n/=10)i--;for(n=e[0];n>=10;n/=10)i++}return i}function U(e){for(var n="";e--;)n+="0";return n}function De(e,n,i,r){var t,s=new e(1),o=Math.ceil(r/m+4);for(w=!1;;){if(i%2&&(s=s.times(n),Ae(s.d,o)&&(t=!0)),i=A(i/2),i===0){i=s.d.length-1,t&&s.d[i]===0&&++s.d[i];break}n=n.times(n),Ae(n.d,o)}return w=!0,s}function be(e){return e.d[e.d.length-1]&1}function Ze(e,n,i){for(var r,t=new e(n[0]),s=0;++s17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(n==null?(w=!1,l=v):l=n,u=new h(.03125);e.e>-2;)e=e.times(u),a+=5;for(r=Math.log(M(2,a))/Math.LN10*2+5|0,l+=r,i=s=o=new h(1),h.precision=l;;){if(s=p(s.times(e),l,1),i=i.times(++c),u=o.plus(S(s,i,l,1)),O(u.d).slice(0,l)===O(o.d).slice(0,l)){for(t=a;t--;)o=p(o.times(o),l,1);if(n==null)if(f<3&&Q(o.d,l-r,g,f))h.precision=l+=10,i=s=u=new h(1),c=0,f++;else return p(o,h.precision=v,g,w=!0);else return h.precision=v,o}o=u}}function B(e,n){var i,r,t,s,o,u,l,f,c,a,h,g=1,v=10,N=e,_=N.d,C=N.constructor,T=C.rounding,E=C.precision;if(N.s<0||!_||!_[0]||!N.e&&_[0]==1&&_.length==1)return new C(_&&!_[0]?-1/0:N.s!=1?NaN:_?0:N);if(n==null?(w=!1,c=E):c=n,C.precision=c+=v,i=O(_),r=i.charAt(0),Math.abs(s=N.e)<15e14){for(;r<7&&r!=1||r==1&&i.charAt(1)>3;)N=N.times(e),i=O(N.d),r=i.charAt(0),g++;s=N.e,r>1?(N=new C("0."+i),s++):N=new C(r+"."+i.slice(1))}else return f=se(C,c+2,E).times(s+""),N=B(new C(r+"."+i.slice(1)),c-v).plus(f),C.precision=E,n==null?p(N,E,T,w=!0):N;for(a=N,l=o=N=S(N.minus(1),N.plus(1),c,1),h=p(N.times(N),c,1),t=3;;){if(o=p(o.times(h),c,1),f=l.plus(S(o,new C(t),c,1)),O(f.d).slice(0,c)===O(l.d).slice(0,c))if(l=l.times(2),s!==0&&(l=l.plus(se(C,c+2,E).times(s+""))),l=S(l,new C(g),c,1),n==null)if(Q(l.d,c-v,T,u))C.precision=c+=v,f=o=N=S(a.minus(1),a.plus(1),c,1),h=p(N.times(N),c,1),t=u=1;else return p(l,C.precision=E,T,w=!0);else return C.precision=E,l;l=f,t+=2}}function Ue(e){return String(e.s*e.s/0)}function Se(e,n){var i,r,t;for((i=n.indexOf("."))>-1&&(n=n.replace(".","")),(r=n.search(/e/i))>0?(i<0&&(i=r),i+=+n.slice(r+1),n=n.substring(0,r)):i<0&&(i=n.length),r=0;n.charCodeAt(r)===48;r++);for(t=n.length;n.charCodeAt(t-1)===48;--t);if(n=n.slice(r,t),n){if(t-=r,e.e=i=i-r-1,e.d=[],r=(i+1)%m,i<0&&(r+=m),re.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Fe.test(n))return Se(e,n)}else if(n==="Infinity"||n==="NaN")return+n||(e.s=NaN),e.e=NaN,e.d=null,e;if(Ye.test(n))i=16,n=n.toLowerCase();else if(Qe.test(n))i=2;else if(xe.test(n))i=8;else throw Error($+n);for(s=n.search(/p/i),s>0?(l=+n.slice(s+1),n=n.substring(2,s)):n=n.slice(2),s=n.indexOf("."),o=s>=0,r=e.constructor,o&&(n=n.replace(".",""),u=n.length,s=u-s,t=De(r,new r(i),s,s*2)),f=ie(n,i,F),c=f.length-1,s=c;f[s]===0;--s)f.pop();return s<0?new r(e.s*0):(e.e=ue(f,c),e.d=f,w=!1,o&&(e=S(e,t,u*4)),l&&(e=e.times(Math.abs(l)<54?M(2,l):Y.pow(2,l))),w=!0,e)}function rn(e,n){var i,r=n.d.length;if(r<3)return n.isZero()?n:J(e,2,n,n);i=1.4*Math.sqrt(r),i=i>16?16:i|0,n=n.times(1/fe(5,i)),n=J(e,2,n,n);for(var t,s=new e(5),o=new e(16),u=new e(20);i--;)t=n.times(n),n=n.times(s.plus(t.times(o.times(t).minus(u))));return n}function J(e,n,i,r,t){var s,o,u,l,f=1,c=e.precision,a=Math.ceil(c/m);for(w=!1,l=i.times(i),u=new e(r);;){if(o=S(u.times(l),new e(n++*n++),c,1),u=t?r.plus(o):r.minus(o),r=S(o.times(l),new e(n++*n++),c,1),o=u.plus(r),o.d[a]!==void 0){for(s=a;o.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=r,r=o,o=s,f++}return w=!0,o.d.length=a+1,o}function fe(e,n){for(var i=e;--n;)i*=e;return i}function Be(e,n){var i,r=n.s<0,t=R(e,e.precision,1),s=t.times(.5);if(n=n.abs(),n.lte(s))return Z=r?4:1,n;if(i=n.divToInt(t),i.isZero())Z=r?3:2;else{if(n=n.minus(i.times(t)),n.lte(s))return Z=be(i)?r?2:3:r?4:1,n;Z=be(i)?r?1:4:r?3:2}return n.minus(t).abs()}function ke(e,n,i,r){var t,s,o,u,l,f,c,a,h,g=e.constructor,v=i!==void 0;if(v?(q(i,1,V),r===void 0?r=g.rounding:q(r,0,8)):(i=g.precision,r=g.rounding),!e.isFinite())c=Ue(e);else{for(c=I(e),o=c.indexOf("."),v?(t=2,n==16?i=i*4-3:n==8&&(i=i*3-2)):t=n,o>=0&&(c=c.replace(".",""),h=new g(1),h.e=c.length-o,h.d=ie(I(h),10,t),h.e=h.d.length),a=ie(c,10,t),s=l=a.length;a[--l]==0;)a.pop();if(!a[0])c=v?"0p+0":"0";else{if(o<0?s--:(e=new g(e),e.d=a,e.e=s,e=S(e,h,i,r,0,t),a=e.d,s=e.e,f=qe),o=a[i],u=t/2,f=f||a[i+1]!==void 0,f=r<4?(o!==void 0||f)&&(r===0||r===(e.s<0?3:2)):o>u||o===u&&(r===4||f||r===6&&a[i-1]&1||r===(e.s<0?8:7)),a.length=i,f)for(;++a[--i]>t-1;)a[i]=0,i||(++s,a.unshift(1));for(l=a.length;!a[l-1];--l);for(o=0,c="";o1)if(n==16||n==8){for(o=n==16?4:3,--l;l%o;l++)c+="0";for(a=ie(c,t,n),l=a.length;!a[l-1];--l);for(o=1,c="1.";ol)for(s-=l;s--;)c+="0";else sn)return e.length=n,!0}function tn(e){return new this(e).abs()}function sn(e){return new this(e).acos()}function on(e){return new this(e).acosh()}function un(e,n){return new this(e).plus(n)}function fn(e){return new this(e).asin()}function ln(e){return new this(e).asinh()}function cn(e){return new this(e).atan()}function an(e){return new this(e).atanh()}function hn(e,n){e=new this(e),n=new this(n);var i,r=this.precision,t=this.rounding,s=r+4;return!e.s||!n.s?i=new this(NaN):!e.d&&!n.d?(i=R(this,s,1).times(n.s>0?.25:.75),i.s=e.s):!n.d||e.isZero()?(i=n.s<0?R(this,r,t):new this(0),i.s=e.s):!e.d||n.isZero()?(i=R(this,s,1).times(.5),i.s=e.s):n.s<0?(this.precision=s,this.rounding=1,i=this.atan(S(e,n,s,1)),n=R(this,s,1),this.precision=r,this.rounding=t,i=e.s<0?i.minus(n):i.plus(n)):i=this.atan(S(e,n,s,1)),i}function dn(e){return new this(e).cbrt()}function pn(e){return p(e=new this(e),e.e+1,2)}function gn(e,n,i){return new this(e).clamp(n,i)}function mn(e){if(!e||typeof e!="object")throw Error(oe+"Object expected");var n,i,r,t=e.defaults===!0,s=["precision",1,V,"rounding",0,8,"toExpNeg",-H,0,"toExpPos",0,H,"maxE",0,H,"minE",-H,0,"modulo",0,9];for(n=0;n=s[n+1]&&r<=s[n+2])this[i]=r;else throw Error($+i+": "+r);if(i="crypto",t&&(this[i]=Ne[i]),(r=e[i])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[i]=!0;else throw Error(Le);else this[i]=!1;else throw Error($+i+": "+r);return this}function wn(e){return new this(e).cos()}function Nn(e){return new this(e).cosh()}function $e(e){var n,i,r;function t(s){var o,u,l,f=this;if(!(f instanceof t))return new t(s);if(f.constructor=t,_e(s)){f.s=s.s,w?!s.d||s.e>t.maxE?(f.e=NaN,f.d=null):s.e=10;u/=10)o++;w?o>t.maxE?(f.e=NaN,f.d=null):o=429e7?n[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=t%1e7;else if(crypto.randomBytes){for(n=crypto.randomBytes(r*=4);s=214e7?crypto.randomBytes(4).copy(n,s):(u.push(t%1e7),s+=4);s=r/4}else throw Error(Le);else for(;s=10;t/=10)r++;r - * MIT Licence - *) -*/ -//# sourceMappingURL=index-browser.js.map diff --git a/chase/backend/prisma/generated/client/runtime/library.d.ts b/chase/backend/prisma/generated/client/runtime/library.d.ts deleted file mode 100644 index d3144d49..00000000 --- a/chase/backend/prisma/generated/client/runtime/library.d.ts +++ /dev/null @@ -1,2736 +0,0 @@ -/** - * TODO - * @param this - */ -declare function $extends(this: Client, extension: Args | ((client: Client) => Client)): Client; - -export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; - -export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum'; - -export declare type AllModelsToStringIndex, K extends PropertyKey> = Args extends { - [P in K]: { - $allModels: infer AllModels; - }; -} ? { - [P in K]: Record; -} : {}; - -declare class AnyNull extends NullTypesEnumValue { -} - -export declare type Args = Optional; - -export declare type Args_2 = InternalArgs; - -export declare type Args_3 = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : never; - -/** - * Attributes is a map from string to attribute values. - * - * Note: only the own enumerable keys are counted as valid attribute keys. - */ -export declare interface Attributes { - [attributeKey: string]: AttributeValue | undefined; -} - -/** - * Attribute values may be any non-nullish primitive value except an object. - * - * null or undefined attribute values are invalid and will result in undefined behavior. - */ -export declare type AttributeValue = string | number | boolean | Array | Array | Array; - -export declare type BaseDMMF = Pick; - -export declare type BatchArgs = { - queries: BatchQuery[]; - transaction?: { - isolationLevel?: IsolationLevel; - }; -}; - -export declare type BatchInternalParams = { - requests: RequestParams[]; - customDataProxyFetch?: CustomDataProxyFetch; -}; - -export declare type BatchQuery = { - model: string | undefined; - operation: string; - args: JsArgs | RawQueryArgs; -}; - -export declare type BatchQueryEngineResult = QueryEngineResult | Error; - -export declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise; - -export declare type BatchQueryOptionsCbArgs = { - args: BatchArgs; - query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise; - __internalParams: BatchInternalParams; -}; - -export declare type BatchTransactionOptions = { - isolationLevel?: Transaction.IsolationLevel; -}; - -export declare interface BinaryTargetsEnvValue { - fromEnvVar: string | null; - value: string; - native?: boolean; -} - -export declare type Call = (F & { - params: P; -})['returns']; - -export declare interface CallSite { - getLocation(): LocationInFile | null; -} - -export declare type Cast = A extends W ? A : W; - -export declare type Client = ReturnType extends new () => infer T ? T : never; - -export declare type ClientArg = { - [MethodName in string]: unknown; -}; - -export declare type ClientArgs = { - client: ClientArg; -}; - -export declare type ClientBuiltInProp = keyof DynamicClientExtensionThisBuiltin; - -export declare type Compute = T extends Function ? T : { - [K in keyof T]: T[K]; -} & unknown; - -export declare type ComputeDeep = T extends Function ? T : { - [K in keyof T]: ComputeDeep; -} & unknown; - -export declare type ComputedField = { - name: string; - needs: string[]; - compute: ResultArgsFieldCompute; -}; - -export declare type ComputedFieldsMap = { - [fieldName: string]: ComputedField; -}; - -export declare interface Context { - /** - * Get a value from the context. - * - * @param key key which identifies a context value - */ - getValue(key: symbol): unknown; - /** - * Create a new context which inherits from this context and has - * the given key set to the given value. - * - * @param key context key for which to set the value - * @param value value to set for the given key - */ - setValue(key: symbol, value: unknown): Context; - /** - * Return a new context which inherits from this context but does - * not contain a value for the given key. - * - * @param key context key for which to clear a value - */ - deleteValue(key: symbol): Context; -} - -export declare type Context_2 = T extends { - [K: symbol]: { - ctx: infer C; - }; -} ? C & T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -} : T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -}; - -export declare type Count = { - [K in keyof O]: Count; -} & {}; - -export declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch; - -declare class DataLoader { - private options; - batches: { - [key: string]: Job[]; - }; - private tickActive; - constructor(options: DataLoaderOptions); - request(request: T): Promise; - private dispatchBatches; - get [Symbol.toStringTag](): string; -} - -export declare type DataLoaderOptions = { - singleLoader: (request: T) => Promise; - batchLoader: (request: T[]) => Promise; - batchBy: (request: T) => string | undefined; - batchOrder: (requestA: T, requestB: T) => number; -}; - -export declare type Datasource = { - url?: string; -}; - -export declare type Datasources = { - [name in string]: Datasource; -}; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare interface Debug { - (namespace: string): Debugger; - disable: () => string; - enable: (namespace: string) => void; - enabled: (namespace: string) => boolean; - log: (...args: any[]) => any; - formatters: Record string) | undefined>; -} - -export declare interface Debugger { - (format: any, ...args: any[]): void; - log: (...args: any[]) => any; - extend: (namespace: string, delimiter?: string) => Debugger; - color: string | number; - enabled: boolean; - namespace: string; -} - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -/** - * Interface for any Decimal.js-like library - * Allows us to accept Decimal.js from different - * versions and some compatible alternatives - */ -export declare interface DecimalJsLike { - d: number[]; - e: number; - s: number; - toFixed(): string; -} - -export declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>; - -export declare type DefaultSelection

= UnwrapPayload<{ - default: P; -}>['default']; - -export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; - -declare function defineExtension(ext: Args | ((client: Client) => Client)): (client: Client) => Client; - -export declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"]; - -export declare interface Dictionary { - [key: string]: T; -} - -export declare type Dictionary_2 = { - [key: string]: T | undefined; -}; - -export declare namespace DMMF { - export interface Document { - datamodel: Datamodel; - schema: Schema; - mappings: Mappings; - } - export interface Mappings { - modelOperations: ModelMapping[]; - otherOperations: { - read: string[]; - write: string[]; - }; - } - export interface OtherOperationMappings { - read: string[]; - write: string[]; - } - export interface DatamodelEnum { - name: string; - values: EnumValue[]; - dbName?: string | null; - documentation?: string; - } - export interface SchemaEnum { - name: string; - values: string[]; - } - export interface EnumValue { - name: string; - dbName: string | null; - } - export interface Datamodel { - models: Model[]; - enums: DatamodelEnum[]; - types: Model[]; - } - export interface uniqueIndex { - name: string; - fields: string[]; - } - export interface PrimaryKey { - name: string | null; - fields: string[]; - } - export interface Model { - name: string; - dbName: string | null; - fields: Field[]; - uniqueFields: string[][]; - uniqueIndexes: uniqueIndex[]; - documentation?: string; - primaryKey: PrimaryKey | null; - isGenerated?: boolean; - } - export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; - export type FieldNamespace = 'model' | 'prisma'; - export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; - export interface Field { - kind: FieldKind; - name: string; - isRequired: boolean; - isList: boolean; - isUnique: boolean; - isId: boolean; - isReadOnly: boolean; - isGenerated?: boolean; - isUpdatedAt?: boolean; - /** - * Describes the data type in the same the way it is defined in the Prisma schema: - * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName - */ - type: string; - dbName?: string | null; - hasDefaultValue: boolean; - default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; - relationFromFields?: string[]; - relationToFields?: any[]; - relationOnDelete?: string; - relationName?: string; - documentation?: string; - } - export interface FieldDefault { - name: string; - args: any[]; - } - export type FieldDefaultScalar = string | boolean | number; - export interface Schema { - rootQueryType?: string; - rootMutationType?: string; - inputObjectTypes: { - model?: InputType[]; - prisma: InputType[]; - }; - outputObjectTypes: { - model: OutputType[]; - prisma: OutputType[]; - }; - enumTypes: { - model?: SchemaEnum[]; - prisma: SchemaEnum[]; - }; - fieldRefTypes: { - prisma?: FieldRefType[]; - }; - } - export interface Query { - name: string; - args: SchemaArg[]; - output: QueryOutput; - } - export interface QueryOutput { - name: string; - isRequired: boolean; - isList: boolean; - } - export type TypeRef = { - isList: boolean; - type: string; - location: AllowedLocations; - namespace?: FieldNamespace; - }; - export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>; - export interface SchemaArg { - name: string; - comment?: string; - isNullable: boolean; - isRequired: boolean; - inputTypes: InputTypeRef[]; - deprecation?: Deprecation; - } - export interface OutputType { - name: string; - fields: SchemaField[]; - } - export interface SchemaField { - name: string; - isNullable?: boolean; - outputType: OutputTypeRef; - args: SchemaArg[]; - deprecation?: Deprecation; - documentation?: string; - } - export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>; - export interface Deprecation { - sinceVersion: string; - reason: string; - plannedRemovalVersion?: string; - } - export interface InputType { - name: string; - constraints: { - maxNumFields: number | null; - minNumFields: number | null; - fields?: string[]; - }; - meta?: { - source?: string; - }; - fields: SchemaArg[]; - } - export interface FieldRefType { - name: string; - allowTypes: FieldRefAllowType[]; - fields: SchemaArg[]; - } - export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>; - export interface ModelMapping { - model: string; - plural: string; - findUnique?: string | null; - findUniqueOrThrow?: string | null; - findFirst?: string | null; - findFirstOrThrow?: string | null; - findMany?: string | null; - create?: string | null; - createMany?: string | null; - update?: string | null; - updateMany?: string | null; - upsert?: string | null; - delete?: string | null; - deleteMany?: string | null; - aggregate?: string | null; - groupBy?: string | null; - count?: string | null; - findRaw?: string | null; - aggregateRaw?: string | null; - } - export enum ModelAction { - findUnique = "findUnique", - findUniqueOrThrow = "findUniqueOrThrow", - findFirst = "findFirst", - findFirstOrThrow = "findFirstOrThrow", - findMany = "findMany", - create = "create", - createMany = "createMany", - update = "update", - updateMany = "updateMany", - upsert = "upsert", - delete = "delete", - deleteMany = "deleteMany", - groupBy = "groupBy", - count = "count", - aggregate = "aggregate", - findRaw = "findRaw", - aggregateRaw = "aggregateRaw" - } -} - -export declare class DMMFClass implements DMMF.Document { - document: DMMF.Document; - private compositeNames; - private inputTypesByName; - readonly typeAndModelMap: Dictionary; - readonly mappingsMap: Dictionary; - readonly outputTypeMap: NamespacedTypeMap; - readonly rootFieldMap: Dictionary; - constructor(document: DMMF.Document); - get datamodel(): DMMF.Datamodel; - get mappings(): DMMF.Mappings; - get schema(): DMMF.Schema; - get inputObjectTypes(): { - model?: DMMF.InputType[] | undefined; - prisma: DMMF.InputType[]; - }; - get outputObjectTypes(): { - model: DMMF.OutputType[]; - prisma: DMMF.OutputType[]; - }; - isComposite(modelOrTypeName: string): boolean; - getOtherOperationNames(): string[]; - hasEnumInNamespace(enumName: string, namespace: DMMF.FieldNamespace): boolean; - resolveInputObjectType(ref: DMMF.InputTypeRef): DMMF.InputType | undefined; - resolveOutputObjectType(ref: DMMF.OutputTypeRef): DMMF.OutputType | undefined; - private buildModelMap; - private buildTypeMap; - private buildTypeModelMap; - private buildMappingsMap; - private buildMergedOutputTypeMap; - private buildRootFieldMap; - private buildInputTypesMap; -} - -/** Client */ -export declare type DynamicClientExtensionArgs> = { - [P in keyof C_]: unknown; -} & { - [K: symbol]: { - ctx: Optional, ITXClientDenyList> & { - $parent: Optional, ITXClientDenyList>; - }; - }; -}; - -export declare type DynamicClientExtensionThis> = { - [P in keyof ExtArgs['client']]: Return; -} & { - [P in Exclude]: DynamicModelExtensionThis, ExtArgs>; -} & { - [P in Exclude]: >(...args: ToTuple) => PrismaPromise_2; -} & { - [P in Exclude]: DynamicClientExtensionThisBuiltin[P]; -}; - -export declare type DynamicClientExtensionThisBuiltin> = { - $extends: ExtendsHook<'extends', TypeMapCb, ExtArgs>; - $transaction

[]>(arg: [...P], options?: { - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise>; - $transaction(fn: (client: Omit, ITXClientDenyList>) => Promise, options?: { - maxWait?: number; - timeout?: number; - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise; - $disconnect(): Promise; - $connect(): Promise; -}; - -/** Model */ -export declare type DynamicModelExtensionArgs> = { - [K in keyof M_]: K extends '$allModels' ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: {}; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: { - ctx: DynamicModelExtensionThis, ExtArgs> & { - $parent: DynamicClientExtensionThis; - } & { - $name: ModelKey; - } & { - /** - * @deprecated Use `$name` instead. - */ - name: ModelKey; - }; - }; - } : never; -}; - -export declare type DynamicModelExtensionFluentApi = { - [K in keyof TypeMap['model'][M]['payload']['objects']]: (args?: Exact>) => PrismaPromise_2, [K]> | Null> & DynamicModelExtensionFluentApi>; -}; - -export declare type DynamicModelExtensionFnResult> = P extends FluentOperation ? DynamicModelExtensionFluentApi & PrismaPromise_2 | Null> : PrismaPromise_2>; - -export declare type DynamicModelExtensionFnResultBase = GetResult; - -export declare type DynamicModelExtensionFnResultNull

= P extends 'findUnique' | 'findFirst' ? null : never; - -export declare type DynamicModelExtensionOperationFn = {} extends TypeMap['model'][M]['operations'][P]['args'] ? (args?: Exact) => DynamicModelExtensionFnResult : (args: Exact) => DynamicModelExtensionFnResult; - -export declare type DynamicModelExtensionThis> = { - [P in keyof ExtArgs['model'][Uncapitalize]]: Return][P]>; -} & { - [P in Exclude]>]: DynamicModelExtensionOperationFn; -} & { - [P in Exclude<'fields', keyof ExtArgs['model'][Uncapitalize]>]: TypeMap['model'][M]['fields']; -} & { - [K: symbol]: { - types: TypeMap['model'][M]; - }; -}; - -/** Query */ -export declare type DynamicQueryExtensionArgs = { - [K in keyof Q_]: K extends '$allOperations' ? (args: { - model?: string; - operation: string; - args: any; - query: (args: any) => PrismaPromise_2; - }) => Promise : K extends '$allModels' ? { - [P in keyof Q_[K] | keyof TypeMap['model'][keyof TypeMap['model']]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb : P extends keyof TypeMap['model'][keyof TypeMap['model']]['operations'] ? DynamicQueryExtensionCb : never; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof Q_[K] | keyof TypeMap['model'][ModelKey]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb, keyof TypeMap['model'][ModelKey]['operations']> : P extends keyof TypeMap['model'][ModelKey]['operations'] ? DynamicQueryExtensionCb, P> : never; - } : K extends keyof TypeMap['other']['operations'] ? DynamicQueryExtensionCb<[TypeMap], 0, 'other', K> : never; -}; - -export declare type DynamicQueryExtensionCb = >(args: A) => Promise; - -export declare type DynamicQueryExtensionCbArgs = (_1 extends unknown ? _2 extends unknown ? { - args: DynamicQueryExtensionCbArgsArgs; - model: _0 extends 0 ? undefined : _1; - operation: _2; - query: >(args: A) => PrismaPromise_2; -} : never : never) & { - query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise_2; -}; - -export declare type DynamicQueryExtensionCbArgsArgs = _2 extends '$queryRaw' | '$executeRaw' ? Sql : TypeMap[_0][_1]['operations'][_2]['args']; - -/** Result */ -export declare type DynamicResultExtensionArgs = { - [K in keyof R_]: { - [P in keyof R_[K]]?: { - needs?: DynamicResultExtensionNeeds, R_[K][P]>; - compute(data: DynamicResultExtensionData, R_[K][P]>): any; - }; - }; -}; - -export declare type DynamicResultExtensionData = GetFindResult; - -export declare type DynamicResultExtensionNeeds = { - [K in keyof S]: K extends keyof TypeMap['model'][M]['payload']['scalars'] ? S[K] : never; -} & { - [N in keyof TypeMap['model'][M]['payload']['scalars']]?: boolean; -}; - -/** - * Placeholder value for "no text". - */ -export declare const empty: Sql; - -export declare type EmptyToUnknown = T; - -declare abstract class Engine { - abstract on(event: EngineEventType, listener: (args?: any) => any): void; - abstract start(): Promise; - abstract stop(): Promise; - abstract version(forceRun?: boolean): Promise | string; - abstract request(query: JsonQuery, options: RequestOptions): Promise>; - abstract requestBatch(queries: JsonQuery[], options: RequestBatchOptions): Promise[]>; - abstract transaction(action: 'start', headers: Transaction.TransactionHeaders, options?: Transaction.Options): Promise>; - abstract transaction(action: 'commit', headers: Transaction.TransactionHeaders, info: Transaction.InteractiveTransactionInfo): Promise; - abstract transaction(action: 'rollback', headers: Transaction.TransactionHeaders, info: Transaction.InteractiveTransactionInfo): Promise; - abstract metrics(options: MetricsOptionsJson): Promise; - abstract metrics(options: MetricsOptionsPrometheus): Promise; -} - -export declare interface EngineConfig { - cwd: string; - dirname: string; - datamodelPath: string; - enableDebugLogs?: boolean; - allowTriggerPanic?: boolean; - prismaPath?: string; - generator?: GeneratorConfig; - overrideDatasources: Datasources; - showColors?: boolean; - logQueries?: boolean; - logLevel?: 'info' | 'warn'; - env: Record; - flags?: string[]; - clientVersion: string; - engineVersion: string; - previewFeatures?: string[]; - engineEndpoint?: string; - activeProvider?: string; - logEmitter: EventEmitter; - /** - * The contents of the schema encoded into a string - * @remarks only used for the purpose of data proxy - */ - inlineSchema: string; - /** - * The contents of the datasource url saved in a string - * @remarks only used for the purpose of data proxy - */ - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - /** - * The string hash that was produced for a given schema - * @remarks only used for the purpose of data proxy - */ - inlineSchemaHash: string; - /** - * The helper for interaction with OTEL tracing - * @remarks enabling is determined by the client and @prisma/instrumentation package - */ - tracingHelper: TracingHelper; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; -} - -export declare type EngineEventType = 'query' | 'info' | 'warn' | 'error' | 'beforeExit'; - -export declare type EngineSpan = { - span: boolean; - name: string; - trace_id: string; - span_id: string; - parent_span_id: string; - start_time: [number, number]; - end_time: [number, number]; - attributes?: Record; - links?: { - trace_id: string; - span_id: string; - }[]; -}; - -export declare type EngineSpanEvent = { - span: boolean; - spans: EngineSpan[]; -}; - -export declare interface EnvValue { - fromEnvVar: null | string; - value: null | string; -} - -export declare type Equals = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? 1 : 0; - -export declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; - -export declare interface ErrorWithBatchIndex { - batchRequestIdx?: number; -} - -export declare interface EventEmitter { - on(event: string, listener: (...args: any[]) => void): unknown; - emit(event: string, args?: any): boolean; -} - -export declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof W]: K extends keyof A ? Exact : never; -} : W) : never) | (A extends Narrowable ? A : never); - -/** - * Defines Exception. - * - * string or an object with one of (message or name or code) and optional stack - */ -export declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; - -export declare interface ExceptionWithCode { - code: string | number; - name?: string; - message?: string; - stack?: string; -} - -export declare interface ExceptionWithMessage { - code?: string | number; - message: string; - name?: string; - stack?: string; -} - -export declare interface ExceptionWithName { - code?: string | number; - message?: string; - name: string; - stack?: string; -} - -export declare type ExtendedSpanOptions = SpanOptions & { - /** The name of the span */ - name: string; - internal?: boolean; - middleware?: boolean; - /** Whether it propagates context (?=true) */ - active?: boolean; - /** The context to append the span to */ - context?: Context; -}; - -/** $extends, defineExtension */ -export declare interface ExtendsHook, TypeMap extends TypeMapDef = Call> { - extArgs: ExtArgs; - , MergedArgs extends InternalArgs = MergeExtArgs>(extension: ((client: DynamicClientExtensionThis) => { - $extends: { - extArgs: Args; - }; - }) | { - name?: string; - query?: DynamicQueryExtensionArgs; - result?: DynamicResultExtensionArgs & R; - model?: DynamicModelExtensionArgs & M; - client?: DynamicClientExtensionArgs & C; - }): { - 'extends': DynamicClientExtensionThis, TypeMapCb, MergedArgs>; - 'define': (client: any) => { - $extends: { - extArgs: Args; - }; - }; - }[Variant]; -} - -declare namespace Extensions { - export { - defineExtension, - getExtensionContext - } -} -export { Extensions } - -declare namespace Extensions_2 { - export { - InternalArgs, - Args_2 as Args, - DefaultArgs, - GetResult_2 as GetResult, - GetSelect, - ExtendsHook, - TypeMapCbDef, - RequiredArgs as UserArgs - } -} - -export declare type Fetch = typeof nodeFetch; - -/** - * A reference to a specific field of a specific model - */ -export declare interface FieldRef { - readonly modelName: Model; - readonly name: string; - readonly typeName: FieldType; - readonly isList: boolean; -} - -export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete'; - -export declare interface Fn { - params: Params; - returns: Returns; -} - -export declare interface GeneratorConfig { - name: string; - output: EnvValue | null; - isCustomOutput?: boolean; - provider: EnvValue; - config: Dictionary_2; - binaryTargets: BinaryTargetsEnvValue[]; - previewFeatures: string[]; -} - -export declare type GetAggregateResult

= { - [K in keyof A as K extends Aggregate ? K : never]: K extends '_count' ? A[K] extends true ? number : Count : { - [J in keyof A[K] & string]: P['scalars'][J] | null; - }; -}; - -export declare type GetBatchResult = { - count: number; -}; - -export declare type GetCountResult = A extends { - select: infer S; -} ? (S extends true ? number : Count) : number; - -declare function getExtensionContext(that: T): Context_2; - -export declare type GetFindResult

= Equals extends 1 ? DefaultSelection

: A extends { - select: infer S extends object; -} & Record | { - include: infer I extends object; -} & Record ? { - [K in keyof S | keyof I as (S & I)[K] extends false | undefined | null ? never : K]: (S & I)[K] extends object ? P extends SelectablePayloadFields ? O extends Payload ? GetFindResult[] : never : P extends SelectablePayloadFields ? O extends Payload ? GetFindResult | SelectField & null : never : K extends '_count' ? Count> : never : P extends SelectablePayloadFields ? O extends Payload ? DefaultSelection[] : never : P extends SelectablePayloadFields ? O extends Payload ? DefaultSelection | SelectField & null : never : P extends { - scalars: { - [k in K]: infer O; - }; - } ? O : K extends '_count' ? Count : never; -} & (A extends { - include: any; -} & Record ? DefaultSelection

: unknown) : DefaultSelection

; - -export declare type GetGroupByResult

= A extends { - by: string[]; -} ? Array & { - [K in A['by'][number]]: P['scalars'][K]; -}> : A extends { - by: string; -} ? Array & { - [K in A['by']]: P['scalars'][K]; -}> : never; - -export declare function getPrismaClient(config: GetPrismaClientConfig): { - new (optionsArg?: PrismaClientOptions): { - _runtimeDataModel: RuntimeDataModel; - _requestHandler: RequestHandler; - _connectionPromise?: Promise | undefined; - _disconnectionPromise?: Promise | undefined; - _engineConfig: EngineConfig; - _clientVersion: string; - _errorFormat: ErrorFormat; - _tracingHelper: TracingHelper; - _metrics: MetricsClient; - _middlewares: MiddlewareHandler; - _previewFeatures: string[]; - _activeProvider: string; - _extensions: MergedExtensionsList; - _engine: Engine; - /** - * A fully constructed/applied Client that references the parent - * PrismaClient. This is used for Client extensions only. - */ - _appliedParent: any; - _createPrismaPromise: PrismaPromiseFactory; - /** - * Hook a middleware into the client - * @param middleware to hook - */ - $use(middleware: QueryMiddleware): void; - $on(eventType: EngineEventType, callback: (event: any) => void): void; - $connect(): Promise; - /** - * Disconnect from the database - */ - $disconnect(): Promise; - /** - * Executes a raw query and always returns a number - */ - $executeRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise; - /** - * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise; - /** - * Executes a raw command only for MongoDB - * - * @param command - * @returns - */ - $runCommandRaw(command: Record): PrismaPromise; - /** - * Executes a raw query and returns selected data - */ - $queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise; - /** - * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise; - /** - * Execute a batch of requests in a transaction - * @param requests - * @param options - */ - _transactionWithArray({ promises, options, }: { - promises: Array>; - options?: BatchTransactionOptions | undefined; - }): Promise; - /** - * Perform a long-running transaction - * @param callback - * @param options - * @returns - */ - _transactionWithCallback({ callback, options, }: { - callback: (client: Client) => Promise; - options?: Options_2 | undefined; - }): Promise; - _createItxClient(transaction: PrismaPromiseInteractiveTransaction): Client; - /** - * Execute queries within a transaction - * @param input a callback or a query list - * @param options to set timeouts (callback) - * @returns - */ - $transaction(input: any, options?: any): Promise; - /** - * Runs the middlewares over params before executing a request - * @param internalParams - * @returns - */ - _request(internalParams: InternalRequestParams): Promise; - _executeRequest({ args, clientMethod, dataPath, callsite, action, model, argsMapper, transaction, unpacker, otelParentCtx, customDataProxyFetch, }: InternalRequestParams): Promise; - readonly $metrics: MetricsClient; - /** - * Shortcut for checking a preview flag - * @param feature preview flag - * @returns - */ - _hasPreviewFlag(feature: string): boolean; - $extends: typeof $extends; - readonly [Symbol.toStringTag]: string; - }; -}; - -/** - * Config that is stored into the generated client. When the generated client is - * loaded, this same config is passed to {@link getPrismaClient} which creates a - * closure with that config around a non-instantiated [[PrismaClient]]. - */ -export declare type GetPrismaClientConfig = { - runtimeDataModel: RuntimeDataModel; - generator?: GeneratorConfig; - relativeEnvPaths: { - rootEnvPath?: string | null; - schemaEnvPath?: string | null; - }; - relativePath: string; - dirname: string; - filename?: string; - clientVersion: string; - engineVersion: string; - datasourceNames: string[]; - activeProvider: string; - /** - * The contents of the schema encoded into a string - * @remarks only used for the purpose of data proxy - */ - inlineSchema: string; - /** - * A special env object just for the data proxy edge runtime. - * Allows bundlers to inject their own env variables (Vercel). - * Allows platforms to declare global variables as env (Workers). - * @remarks only used for the purpose of data proxy - */ - injectableEdgeEnv?: () => LoadedEnv; - /** - * The contents of the datasource url saved in a string. - * This can either be an env var name or connection string. - * It is needed by the client to connect to the Data Proxy. - * @remarks only used for the purpose of data proxy - */ - inlineDatasources: { - [name in string]: { - url: EnvValue; - }; - }; - /** - * The string hash that was produced for a given schema - * @remarks only used for the purpose of data proxy - */ - inlineSchemaHash: string; - /** - * A marker to indicate that the client was not generated via `prisma - * generate` but was generated via `generate --postinstall` script instead. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - postinstall?: boolean; - /** - * Information about the CI where the Prisma Client has been generated. The - * name of the CI environment is stored at generation time because CI - * information is not always available at runtime. Moreover, the edge client - * has no notion of environment variables, so this works around that. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - ciName?: string; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * A boolean that is `true` when the client was generated with --no-engine. At - * runtime, this means the client will be bound to be using the Data Proxy. - */ - noEngine?: boolean; -}; - -export declare type GetResult

= { - findUnique: GetFindResult | null; - findUniqueOrThrow: GetFindResult; - findFirst: GetFindResult | null; - findFirstOrThrow: GetFindResult; - findMany: GetFindResult[]; - create: GetFindResult; - createMany: GetBatchResult; - update: GetFindResult; - updateMany: GetBatchResult; - upsert: GetFindResult; - delete: GetFindResult; - deleteMany: GetBatchResult; - aggregate: GetAggregateResult; - count: GetCountResult; - groupBy: GetGroupByResult; - $queryRaw: unknown; - $executeRaw: number; - $queryRawUnsafe: unknown; - $executeRawUnsafe: number; - $runCommandRaw: JsonObject; - findRaw: JsonObject; - aggregateRaw: JsonObject; -}[O]; - -export declare type GetResult_2, R extends Args_2['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = unknown extends R ? Base : { - [K in KR | keyof Base]: K extends KR ? R[K] extends (() => { - compute: (...args: any) => infer C; - }) ? C : never : Base[K]; -}; - -export declare type GetSelect, R extends Args_2['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { - [K in KR | keyof Base]?: K extends KR ? boolean : Base[K]; -}; - -export declare type HandleErrorParams = { - args: JsArgs; - error: any; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; -}; - -/** - * Defines High-Resolution Time. - * - * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. - * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. - * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. - * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: - * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. - * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: - * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. - * This is represented in HrTime format as [1609504210, 150000000]. - */ -export declare type HrTime = [number, number]; - -export declare type InteractiveTransactionInfo = { - /** - * Transaction ID returned by the query engine. - */ - id: string; - /** - * Arbitrary payload the meaning of which depends on the `Engine` implementation. - * For example, `DataProxyEngine` needs to associate different API endpoints with transactions. - * In `LibraryEngine` and `BinaryEngine` it is currently not used. - */ - payload: Payload; -}; - -export declare type InteractiveTransactionOptions = Transaction.InteractiveTransactionInfo; - -export declare type InternalArgs = { - result: { - [K in keyof R]: { - [P in keyof R[K]]: () => R[K][P]; - }; - }; - model: { - [K in keyof M]: { - [P in keyof M[K]]: () => M[K][P]; - }; - }; - query: { - [K in keyof Q]: { - [P in keyof Q[K]]: () => Q[K][P]; - }; - }; - client: { - [K in keyof C]: () => C[K]; - }; -}; - -export declare type InternalRequestParams = { - /** - * The original client method being called. - * Even though the rootField / operation can be changed, - * this method stays as it is, as it's what the user's - * code looks like - */ - clientMethod: string; - /** - * Name of js model that triggered the request. Might be used - * for warnings or error messages - */ - jsModelName?: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - unpacker?: Unpacker; - otelParentCtx?: Context; - /** Used to "desugar" a user input into an "expanded" one */ - argsMapper?: (args?: UserArgs) => UserArgs; - /** Used to convert args for middleware and back */ - middlewareArgsMapper?: MiddlewareArgsMapper; - /** Used for Accelerate client extension via Data Proxy */ - customDataProxyFetch?: (fetch: Fetch) => Fetch; -} & Omit; - -declare enum IsolationLevel { - ReadUncommitted = "ReadUncommitted", - ReadCommitted = "ReadCommitted", - RepeatableRead = "RepeatableRead", - Snapshot = "Snapshot", - Serializable = "Serializable" -} - -export declare type ITXClientDenyList = (typeof denylist)[number]; - -export declare interface Job { - resolve: (data: any) => void; - reject: (data: any) => void; - request: any; -} - -/** - * Create a SQL query for a list of values. - */ -export declare function join(values: RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; - -export declare type JsArgs = { - select?: Selection_2; - include?: Selection_2; - [argName: string]: JsInputValue; -}; - -export declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | JsonConvertible | FieldRef | JsInputValue[] | { - [key: string]: JsInputValue; -}; - -export declare type JsonArgumentValue = number | string | boolean | null | JsonTaggedValue | JsonArgumentValue[] | { - [key: string]: JsonArgumentValue; -}; - -export declare interface JsonArray extends Array { -} - -export declare interface JsonConvertible { - toJSON(): unknown; -} - -export declare type JsonFieldSelection = { - arguments?: Record; - selection: JsonSelectionSet; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -export declare type JsonObject = { - [Key in string]?: JsonValue; -}; - -export declare type JsonQuery = { - modelName?: string; - action: JsonQueryAction; - query: JsonFieldSelection; -}; - -export declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw'; - -export declare type JsonSelectionSet = { - $scalars?: boolean; - $composites?: boolean; -} & { - [fieldName: string]: boolean | JsonFieldSelection; -}; - -export declare type JsonTaggedValue = { - $type: 'Json'; - value: string; -}; - -export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null; - -export declare type JsPromise = Promise & {}; - -export declare type KnownErrorParams = { - code: string; - clientVersion: string; - meta?: Record; - batchRequestIdx?: number; -}; - -/** - * A pointer from the current {@link Span} to another span in the same trace or - * in a different trace. - * Few examples of Link usage. - * 1. Batch Processing: A batch of elements may contain elements associated - * with one or more traces/spans. Since there can only be one parent - * SpanContext, Link is used to keep reference to SpanContext of all - * elements in the batch. - * 2. Public Endpoint: A SpanContext in incoming client request on a public - * endpoint is untrusted from service provider perspective. In such case it - * is advisable to start a new trace with appropriate sampling decision. - * However, it is desirable to associate incoming SpanContext to new trace - * initiated on service provider side so two traces (from Client and from - * Service Provider) can be correlated. - */ -export declare interface Link { - /** The {@link SpanContext} of a linked span. */ - context: SpanContext; - /** A set of {@link SpanAttributes} on the link. */ - attributes?: SpanAttributes; - /** Count of attributes of the link that were dropped due to collection limits */ - droppedAttributesCount?: number; -} - -export declare type LoadedEnv = { - message?: string; - parsed: { - [x: string]: string; - }; -} | undefined; - -export declare type LocationInFile = { - fileName: string; - lineNumber: number | null; - columnNumber: number | null; -}; - -export declare type LogDefinition = { - level: LogLevel; - emit: 'stdout' | 'event'; -}; - -export declare type LogLevel = 'info' | 'query' | 'warn' | 'error'; - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -/** - * Class that holds the list of all extensions, applied to particular instance, - * as well as resolved versions of the components that need to apply on - * different levels. Main idea of this class: avoid re-resolving as much of the - * stuff as possible when new extensions are added while also delaying the - * resolve until the point it is actually needed. For example, computed fields - * of the model won't be resolved unless the model is actually queried. Neither - * adding extensions with `client` component only cause other components to - * recompute. - */ -declare class MergedExtensionsList { - private head?; - private constructor(); - static empty(): MergedExtensionsList; - static single(extension: Args): MergedExtensionsList; - isEmpty(): boolean; - append(extension: Args): MergedExtensionsList; - getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined; - getAllClientExtensions(): ClientArg | undefined; - getAllModelExtensions(dmmfModelName: string): ModelArg | undefined; - getAllQueryCallbacks(jsModelName: string, operation: string): any; - getAllBatchQueryCallbacks(): BatchQueryOptionsCb[]; -} - -export declare type MergeExtArgs, Args extends Record> = ComputeDeep & AllModelsToStringIndex>; - -export declare type Metric = { - key: string; - value: T; - labels: Record; - description: string; -}; - -export declare type MetricHistogram = { - buckets: MetricHistogramBucket[]; - sum: number; - count: number; -}; - -export declare type MetricHistogramBucket = [maxValue: number, count: number]; - -export declare type Metrics = { - counters: Metric[]; - gauges: Metric[]; - histograms: Metric[]; -}; - -export declare class MetricsClient { - private _engine; - constructor(engine: Engine); - /** - * Returns all metrics gathered up to this point in prometheus format. - * Result of this call can be exposed directly to prometheus scraping endpoint - * - * @param options - * @returns - */ - prometheus(options?: MetricsOptions): Promise; - /** - * Returns all metrics gathered up to this point in prometheus format. - * - * @param options - * @returns - */ - json(options?: MetricsOptions): Promise; -} - -export declare type MetricsOptions = { - /** - * Labels to add to every metrics in key-value format - */ - globalLabels?: Record; -}; - -export declare type MetricsOptionsCommon = { - globalLabels?: Record; -}; - -export declare type MetricsOptionsJson = { - format: 'json'; -} & MetricsOptionsCommon; - -export declare type MetricsOptionsPrometheus = { - format: 'prometheus'; -} & MetricsOptionsCommon; - -export declare type MiddlewareArgsMapper = { - requestArgsToMiddlewareArgs(requestArgs: RequestArgs): MiddlewareArgs; - middlewareArgsToRequestArgs(middlewareArgs: MiddlewareArgs): RequestArgs; -}; - -declare class MiddlewareHandler { - private _middlewares; - use(middleware: M): void; - get(id: number): M | undefined; - has(id: number): boolean; - length(): number; -} - -export declare type ModelArg = { - [MethodName in string]: unknown; -}; - -export declare type ModelArgs = { - model: { - [ModelName in string]: ModelArg; - }; -}; - -export declare type ModelKey = M extends keyof TypeMap['model'] ? M : Capitalize; - -export declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise; - -export declare type ModelQueryOptionsCbArgs = { - model: string; - operation: string; - args: JsArgs; - query: (args: JsArgs) => Promise; -}; - -export declare type NameArgs = { - name?: string; -}; - -export declare type NamespacedTypeMap = { - prisma: Record; - model: Record; -}; - -export declare type Narrow = { - [K in keyof A]: A[K] extends Function ? A[K] : Narrow; -} | (A extends Narrowable ? A : never); - -export declare type Narrowable = string | number | bigint | boolean | []; - -export declare type NeverToUnknown = [T] extends [never] ? unknown : T; - -/** - * Imitates `fetch` via `https` to only suit our needs, it does nothing more. - * This is because we cannot bundle `node-fetch` as it uses many other Node.js - * utilities, while also bloating our bundles. This approach is much leaner. - * @param url - * @param options - * @returns - */ -declare function nodeFetch(url: string, options?: RequestOptions_2): Promise; - -declare class NodeHeaders { - readonly headers: Map; - constructor(init?: Record); - append(name: string, value: string): void; - delete(name: string): void; - get(name: string): string | null; - has(name: string): boolean; - set(name: string, value: string): void; - forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void; -} - -/** - * @deprecated Please don´t rely on type checks to this error anymore. - * This will become a regular `PrismaClientKnownRequestError` with code `P2025` - * in the future major version of the client. - * Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`. - */ -export declare class NotFoundError extends PrismaClientKnownRequestError { - constructor(message: string, clientVersion: string); -} - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * Base class for unique values of object-valued enums. - */ -declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -export declare type Omit_2 = { - [P in keyof T as P extends K ? never : P]: T[P]; -}; - -export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -export declare type Optional = { - [P in K & keyof O]?: O[P]; -} & { - [P in Exclude]: O[P]; -}; - -export declare type OptionalFlat = { - [K in keyof T]?: T[K]; -}; - -export declare type OptionalKeys = { - [K in keyof O]-?: {} extends Pick_2 ? K : never; -}[keyof O]; - -export declare type Options = { - clientVersion: string; -}; - -/** - * maxWait ?= 2000 - * timeout ?= 5000 - */ -export declare type Options_2 = { - maxWait?: number; - timeout?: number; - isolationLevel?: IsolationLevel; -}; - -export declare type Or = { - 0: { - 0: 0; - 1: 1; - }; - 1: { - 0: 1; - 1: 1; - }; -}[A][B]; - -export declare type PatchFlat = O1 & Omit_2; - -export declare type Path = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path : Default : O : never; - -export declare type Payload = { - scalars: { - [ScalarName in string]: unknown; - }; - objects: { - [ObjectName in string]: unknown; - }; - composites: { - [CompositeName in string]: unknown; - }; -}; - -export declare type Payload_2 = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? T[symbol]['types']['payload'] : never; - -export declare type PayloadToResult = RenameAndNestPayloadKeys

> = { - [K in keyof O]?: O[K][K] extends any[] ? PayloadToResult[] : O[K][K] extends object ? PayloadToResult : O[K][K]; -}; - -export declare type Pick_2 = { - [P in keyof T as P extends K ? P : never]: T[P]; -}; - -export declare class PrismaClientInitializationError extends Error { - clientVersion: string; - errorCode?: string; - retryable?: boolean; - constructor(message: string, clientVersion: string, errorCode?: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientKnownRequestError extends Error implements ErrorWithBatchIndex { - code: string; - meta?: Record; - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { code, clientVersion, meta, batchRequestIdx }: KnownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare type PrismaClientOptions = { - /** - * Overwrites the primary datasource url from your schema.prisma file - */ - datasourceUrl?: string; - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources; - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat; - /** - * @example - * \`\`\` - * // Defaults to stdout - * log: ['query', 'info', 'warn'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * ] - * \`\`\` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: Array; - /** - * @internal - * You probably don't want to use this. \`__internal\` is used by internal tooling. - */ - __internal?: { - debug?: boolean; - engine?: { - cwd?: string; - binaryPath?: string; - endpoint?: string; - allowTriggerPanic?: boolean; - }; - }; -}; - -export declare class PrismaClientRustPanicError extends Error { - clientVersion: string; - constructor(message: string, clientVersion: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientUnknownRequestError extends Error implements ErrorWithBatchIndex { - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { clientVersion, batchRequestIdx }: UnknownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientValidationError extends Error { - name: string; - clientVersion: string; - constructor(message: string, { clientVersion }: Options); - get [Symbol.toStringTag](): string; -} - -/** - * Prisma's `Promise` that is backwards-compatible. All additions on top of the - * original `Promise` are optional so that it can be backwards-compatible. - * @see [[createPrismaPromise]] - */ -export declare interface PrismaPromise extends Promise { - /** - * Extension of the original `.then` function - * @param onfulfilled same as regular promises - * @param onrejected same as regular promises - * @param transaction transaction options - */ - then(onfulfilled?: (value: A) => R1 | PromiseLike, onrejected?: (error: unknown) => R2 | PromiseLike, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.catch` function - * @param onrejected same as regular promises - * @param transaction transaction options - */ - catch(onrejected?: ((reason: any) => R | PromiseLike) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.finally` function - * @param onfinally same as regular promises - * @param transaction transaction options - */ - finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Called when executing a batch of regular tx - * @param transaction transaction options for batch tx - */ - requestTransaction?(transaction: PrismaPromiseBatchTransaction): PromiseLike; -} - -export declare interface PrismaPromise_2 extends Promise { - [Symbol.toStringTag]: 'PrismaPromise'; -} - -export declare type PrismaPromiseBatchTransaction = { - kind: 'batch'; - id: number; - isolationLevel?: IsolationLevel; - index: number; - lock: PromiseLike; -}; - -export declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise; - -/** - * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which - * is essentially a proxy for `Promise`. All the transaction-compatible client - * methods return one, this allows for pre-preparing queries without executing - * them until `.then` is called. It's the foundation of Prisma's query batching. - * @param callback that will be wrapped within our promise implementation - * @see [[PrismaPromise]] - * @returns - */ -export declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise; - -export declare type PrismaPromiseInteractiveTransaction = { - kind: 'itx'; - id: string; - payload: PayloadType; -}; - -export declare type PrismaPromiseTransaction = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare namespace Public_2 { - export { - Args_3 as Args, - Result_2 as Result, - Payload_2 as Payload, - PrismaPromise_2 as PrismaPromise, - Operation, - Exact - } -} - -export declare type QueryEngineResult = { - data: T; - elapsed: number; -}; - -export declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise) => Promise; - -export declare type QueryMiddlewareParams = { - /** The model this is executed on */ - model?: string; - /** The action that is being handled */ - action: Action; - /** TODO what is this */ - dataPath: string[]; - /** TODO what is this */ - runInTransaction: boolean; - args?: UserArgs; -}; - -export declare type QueryOptions = { - query: { - [ModelName in string]: { - [ModelAction in string]: ModelQueryOptionsCb; - } | QueryOptionsCb; - }; -}; - -export declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise; - -export declare type QueryOptionsCbArgs = { - model?: string; - operation: string; - args: JsArgs | RawQueryArgs; - query: (args: JsArgs | RawQueryArgs) => Promise; -}; - -/** - * Create raw SQL statement. - */ -export declare function raw(value: string): Sql; - -export declare type RawParameters = { - __prismaRawParameters__: true; - values: string; -}; - -export declare type RawQueryArgs = Sql | [query: string, ...values: RawValue[]]; - -/** - * Supported value or SQL instance. - */ -export declare type RawValue = Value | Sql; - -export declare type ReadonlyDeep = { - readonly [K in keyof T]: ReadonlyDeep; -}; - -export declare type Record_2 = { - [P in T]: U; -}; - -export declare type RenameAndNestPayloadKeys

= { - [K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K]; -}; - -export declare type RequestBatchOptions = { - transaction?: TransactionOptions; - traceparent?: string; - numTry?: number; - containsWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare class RequestHandler { - client: Client; - dataloader: DataLoader; - private logEmitter?; - constructor(client: Client, logEmitter?: EventEmitter); - request(params: RequestParams): Promise; - mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult): any; - /** - * Handles the error and logs it, logging the error is done synchronously waiting for the event - * handlers to finish. - */ - handleAndLogRequestError(params: HandleErrorParams): never; - handleRequestError({ error, clientMethod, callsite, transaction, args }: HandleErrorParams): never; - sanitizeMessage(message: any): any; - unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any; - get [Symbol.toStringTag](): string; -} - -export declare type RequestOptions = { - traceparent?: string; - numTry?: number; - interactiveTransaction?: InteractiveTransactionOptions; - isWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -export declare type RequestOptions_2 = { - method?: string; - headers?: Record; - body?: string; -}; - -export declare type RequestParams = { - modelName?: string; - action: Action; - protocolQuery: JsonQuery; - dataPath: string[]; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - extensions: MergedExtensionsList; - args?: any; - headers?: Record; - unpacker?: Unpacker; - otelParentCtx?: Context; - otelChildCtx?: Context; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -export declare type RequestResponse = { - ok: boolean; - url: string; - statusText?: string; - status: number; - headers: NodeHeaders; - text: () => Promise; - json: () => Promise; -}; - -export declare type RequiredArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; - -export declare type RequiredKeys = { - [K in keyof O]-?: {} extends Pick_2 ? never : K; -}[keyof O]; - -declare namespace Result { - export { - Operation, - FluentOperation, - GetFindResult, - DefaultSelection, - GetResult - } -} - -export declare type Result_2 = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? GetResult : never; - -export declare type ResultArg = { - [FieldName in string]: ResultFieldDefinition; -}; - -export declare type ResultArgs = { - result: { - [ModelName in string]: ResultArg; - }; -}; - -export declare type ResultArgsFieldCompute = (model: any) => unknown; - -export declare type ResultFieldDefinition = { - needs?: { - [FieldName in string]: boolean; - }; - compute: ResultArgsFieldCompute; -}; - -export declare type Return = T extends (...args: any[]) => infer R ? R : T; - -export declare type RuntimeDataModel = { - readonly models: Record; - readonly enums: Record; - readonly types: Record; -}; - -export declare type RuntimeEnum = Omit; - -export declare type RuntimeModel = Omit; - -export declare type Select = T extends U ? T : never; - -export declare type SelectablePayloadFields = { - objects: { - [k in K]: O; - }; -} | { - composites: { - [k in K]: O; - }; -}; - -export declare type SelectField

, K extends PropertyKey> = P extends { - objects: Record; -} ? P['objects'][K] : P extends { - composites: Record; -} ? P['composites'][K] : never; - -export declare type Selection_2 = Record; - -/** - * An interface that represents a span. A span represents a single operation - * within a trace. Examples of span might include remote procedure calls or a - * in-process function calls to sub-components. A Trace has a single, top-level - * "root" Span that in turn may have zero or more child Spans, which in turn - * may have children. - * - * Spans are created by the {@link Tracer.startSpan} method. - */ -export declare interface Span { - /** - * Returns the {@link SpanContext} object associated with this Span. - * - * Get an immutable, serializable identifier for this span that can be used - * to create new child spans. Returned SpanContext is usable even after the - * span ends. - * - * @returns the SpanContext object associated with this Span. - */ - spanContext(): SpanContext; - /** - * Sets an attribute to the span. - * - * Sets a single Attribute with the key and value passed as arguments. - * - * @param key the key for this attribute. - * @param value the value for this attribute. Setting a value null or - * undefined is invalid and will result in undefined behavior. - */ - setAttribute(key: string, value: SpanAttributeValue): this; - /** - * Sets attributes to the span. - * - * @param attributes the attributes that will be added. - * null or undefined attribute values - * are invalid and will result in undefined behavior. - */ - setAttributes(attributes: SpanAttributes): this; - /** - * Adds an event to the Span. - * - * @param name the name of the event. - * @param [attributesOrStartTime] the attributes that will be added; these are - * associated with this event. Can be also a start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [startTime] start time of the event. - */ - addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; - /** - * Sets a status to the span. If used, this will override the default Span - * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value - * of previous calls to SetStatus on the Span. - * - * @param status the SpanStatus to set. - */ - setStatus(status: SpanStatus): this; - /** - * Updates the Span name. - * - * This will override the name provided via {@link Tracer.startSpan}. - * - * Upon this update, any sampling behavior based on Span name will depend on - * the implementation. - * - * @param name the Span name. - */ - updateName(name: string): this; - /** - * Marks the end of Span execution. - * - * Call to End of a Span MUST not have any effects on child spans. Those may - * still be running and can be ended later. - * - * Do not return `this`. The Span generally should not be used after it - * is ended so chaining is not desired in this context. - * - * @param [endTime] the time to set as Span's end time. If not provided, - * use the current time as the span's end time. - */ - end(endTime?: TimeInput): void; - /** - * Returns the flag whether this span will be recorded. - * - * @returns true if this Span is active and recording information like events - * with the `AddEvent` operation and attributes using `setAttributes`. - */ - isRecording(): boolean; - /** - * Sets exception as a span event - * @param exception the exception the only accepted values are string or Error - * @param [time] the time to set as Span's event time. If not provided, - * use the current time. - */ - recordException(exception: Exception, time?: TimeInput): void; -} - -/** - * @deprecated please use {@link Attributes} - */ -export declare type SpanAttributes = Attributes; - -/** - * @deprecated please use {@link AttributeValue} - */ -export declare type SpanAttributeValue = AttributeValue; - -export declare type SpanCallback = (span?: Span, context?: Context) => R; - -/** - * A SpanContext represents the portion of a {@link Span} which must be - * serialized and propagated along side of a {@link Baggage}. - */ -export declare interface SpanContext { - /** - * The ID of the trace that this span belongs to. It is worldwide unique - * with practically sufficient probability by being made as 16 randomly - * generated bytes, encoded as a 32 lowercase hex characters corresponding to - * 128 bits. - */ - traceId: string; - /** - * The ID of the Span. It is globally unique with practically sufficient - * probability by being made as 8 randomly generated bytes, encoded as a 16 - * lowercase hex characters corresponding to 64 bits. - */ - spanId: string; - /** - * Only true if the SpanContext was propagated from a remote parent. - */ - isRemote?: boolean; - /** - * Trace flags to propagate. - * - * It is represented as 1 byte (bitmap). Bit to represent whether trace is - * sampled or not. When set, the least significant bit documents that the - * caller may have recorded trace data. A caller who does not record trace - * data out-of-band leaves this flag unset. - * - * see {@link TraceFlags} for valid flag values. - */ - traceFlags: number; - /** - * Tracing-system-specific info to propagate. - * - * The tracestate field value is a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * More Info: https://www.w3.org/TR/trace-context/#tracestate-field - * - * Examples: - * Single tracing system (generic format): - * tracestate: rojo=00f067aa0ba902b7 - * Multiple tracing systems (with different formatting): - * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE - */ - traceState?: TraceState; -} - -declare enum SpanKind { - /** Default value. Indicates that the span is used internally. */ - INTERNAL = 0, - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SERVER = 1, - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - CLIENT = 2, - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - PRODUCER = 3, - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - CONSUMER = 4 -} - -/** - * Options needed for span creation - */ -export declare interface SpanOptions { - /** - * The SpanKind of a span - * @default {@link SpanKind.INTERNAL} - */ - kind?: SpanKind; - /** A span's attributes */ - attributes?: SpanAttributes; - /** {@link Link}s span to other spans */ - links?: Link[]; - /** A manually specified start time for the created `Span` object. */ - startTime?: TimeInput; - /** The new span should be a root span. (Ignore parent from context). */ - root?: boolean; -} - -export declare interface SpanStatus { - /** The status code of this message. */ - code: SpanStatusCode; - /** A developer-facing error message. */ - message?: string; -} - -/** - * An enumeration of status codes. - */ -declare enum SpanStatusCode { - /** - * The default status. - */ - UNSET = 0, - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - OK = 1, - /** - * The operation contains an error. - */ - ERROR = 2 -} - -/** - * A SQL instance can be nested within each other to build SQL strings. - */ -export declare class Sql { - values: Value[]; - strings: string[]; - constructor(rawStrings: ReadonlyArray, rawValues: ReadonlyArray); - get text(): string; - get sql(): string; - inspect(): { - text: string; - sql: string; - values: unknown[]; - }; -} - -/** - * Create a SQL object from a template string. - */ -export declare function sqltag(strings: ReadonlyArray, ...values: RawValue[]): Sql; - -/** - * Defines TimeInput. - * - * hrtime, epoch milliseconds, performance.now() or Date - */ -export declare type TimeInput = HrTime | number | Date; - -export declare type ToTuple = T extends any[] ? T : [T]; - -export declare interface TraceState { - /** - * Create a new TraceState which inherits from this TraceState and has the - * given key set. - * The new entry will always be added in the front of the list of states. - * - * @param key key of the TraceState entry. - * @param value value of the TraceState entry. - */ - set(key: string, value: string): TraceState; - /** - * Return a new TraceState which inherits from this TraceState but does not - * contain the given key. - * - * @param key the key for the TraceState entry to be removed. - */ - unset(key: string): TraceState; - /** - * Returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - * - * @param key with which the specified value is to be associated. - * @returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - */ - get(key: string): string | undefined; - /** - * Serializes the TraceState to a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * - * @returns the serialized string. - */ - serialize(): string; -} - -export declare interface TracingHelper { - isEnabled(): boolean; - getTraceParent(context?: Context): string; - createEngineSpan(engineSpanEvent: EngineSpanEvent): void; - getActiveContext(): Context | undefined; - runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; -} - -declare namespace Transaction { - export { - IsolationLevel, - Options_2 as Options, - InteractiveTransactionInfo, - TransactionHeaders - } -} - -export declare type TransactionHeaders = { - traceparent?: string; -}; - -export declare type TransactionOptions = { - kind: 'itx'; - options: InteractiveTransactionOptions; -} | { - kind: 'batch'; - options: BatchTransactionOptions; -}; - -export declare type TypeMapCbDef = Fn<{ - extArgs: Args_2; -}, TypeMapDef>; - -/** Shared */ -export declare type TypeMapDef = Record; - -declare namespace Types { - export { - Result, - Extensions_2 as Extensions, - Utils, - Public_2 as Public, - Payload - } -} -export { Types } - -export declare type UnknownErrorParams = { - clientVersion: string; - batchRequestIdx?: number; -}; - -export declare type Unpacker = (data: any) => any; - -export declare type UnwrapPayload

= {} extends P ? unknown : { - [K in keyof P]: P[K] extends { - scalars: infer S; - composites: infer C; - }[] ? Array> : P[K] extends { - scalars: infer S; - composites: infer C; - } | null ? S & UnwrapPayload | Select : never; -}; - -export declare type UnwrapPromise

= P extends Promise ? R : P; - -export declare type UnwrapTuple = { - [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise ? X : UnwrapPromise : UnwrapPromise; -}; - -/** - * Input that flows from the user into the Client. - */ -export declare type UserArgs = any; - -declare namespace Utils { - export { - EmptyToUnknown, - NeverToUnknown, - PatchFlat, - Omit_2 as Omit, - Pick_2 as Pick, - ComputeDeep, - Compute, - OptionalFlat, - ReadonlyDeep, - Narrow, - Exact, - Cast, - JsonObject, - JsonArray, - JsonValue, - Record_2 as Record, - UnwrapTuple, - Path, - Fn, - Call, - RequiredKeys, - OptionalKeys, - Optional, - Return, - ToTuple, - RenameAndNestPayloadKeys, - PayloadToResult, - Select, - Equals, - Or, - JsPromise - } -} - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args_3>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -/** - * Values supported by SQL engine. - */ -export declare type Value = unknown; - -export declare function warnEnvConflicts(envPaths: any): void; - -export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void; - -export { } diff --git a/chase/backend/prisma/generated/client/runtime/library.js b/chase/backend/prisma/generated/client/runtime/library.js deleted file mode 100644 index 376c8890..00000000 --- a/chase/backend/prisma/generated/client/runtime/library.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict";var Fl=Object.create;var yr=Object.defineProperty;var kl=Object.getOwnPropertyDescriptor;var Ol=Object.getOwnPropertyNames;var Dl=Object.getPrototypeOf,_l=Object.prototype.hasOwnProperty;var q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rt=(e,t)=>{for(var r in t)yr(e,r,{get:t[r],enumerable:!0})},Gi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ol(t))!_l.call(e,i)&&i!==r&&yr(e,i,{get:()=>t[i],enumerable:!(n=kl(t,i))||n.enumerable});return e};var S=(e,t,r)=>(r=e!=null?Fl(Dl(e)):{},Gi(t||!e||!e.__esModule?yr(r,"default",{value:e,enumerable:!0}):r,e)),Nl=e=>Gi(yr({},"__esModule",{value:!0}),e);var no=q((om,ro)=>{"use strict";var tt=1e3,rt=tt*60,nt=rt*60,Ke=nt*24,Ll=Ke*7,$l=Ke*365.25;ro.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return ql(e);if(r==="number"&&isFinite(e))return t.long?jl(e):Vl(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ql(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*$l;case"weeks":case"week":case"w":return r*Ll;case"days":case"day":case"d":return r*Ke;case"hours":case"hour":case"hrs":case"hr":case"h":return r*nt;case"minutes":case"minute":case"mins":case"min":case"m":return r*rt;case"seconds":case"second":case"secs":case"sec":case"s":return r*tt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Vl(e){var t=Math.abs(e);return t>=Ke?Math.round(e/Ke)+"d":t>=nt?Math.round(e/nt)+"h":t>=rt?Math.round(e/rt)+"m":t>=tt?Math.round(e/tt)+"s":e+"ms"}function jl(e){var t=Math.abs(e);return t>=Ke?xr(e,t,Ke,"day"):t>=nt?xr(e,t,nt,"hour"):t>=rt?xr(e,t,rt,"minute"):t>=tt?xr(e,t,tt,"second"):e+" ms"}function xr(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Rn=q((sm,io)=>{"use strict";function Bl(e){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=i,r.enabled=s,r.humanize=no(),r.destroy=u,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let p=0;for(let d=0;d{if(G==="%%")return"%";R++;let $=r.formatters[Ue];if(typeof $=="function"){let z=P[R];G=$.call(T,z),P.splice(R,1),R--}return G}),r.formatArgs.call(T,P),(T.log||r.log).apply(T,P)}return g.namespace=c,g.useColors=r.useColors(),g.color=r.selectColor(c),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(f!==r.namespaces&&(f=r.namespaces,y=r.enabled(c)),y),set:P=>{d=P}}),typeof r.init=="function"&&r.init(g),g}function n(c,p){let d=r(this.namespace+(typeof p>"u"?":":p)+c);return d.log=this.log,d}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let p,d=(typeof c=="string"?c:"").split(/[\s,]+/),f=d.length;for(p=0;p"-"+p)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let p,d;for(p=0,d=r.skips.length;p{"use strict";le.formatArgs=Kl;le.save=Ql;le.load=Jl;le.useColors=Ul;le.storage=Gl();le.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();le.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ul(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Kl(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+br.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}le.log=console.debug||console.log||(()=>{});function Ql(e){try{e?le.storage.setItem("debug",e):le.storage.removeItem("debug")}catch{}}function Jl(){let e;try{e=le.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Gl(){try{return localStorage}catch{}}br.exports=Rn()(le);var{formatters:Hl}=br.exports;Hl.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Mn=q((am,so)=>{"use strict";so.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n{"use strict";var Wl=require("os"),ao=require("tty"),de=Mn(),{env:B}=process,Fe;de("no-color")||de("no-colors")||de("color=false")||de("color=never")?Fe=0:(de("color")||de("colors")||de("color=true")||de("color=always"))&&(Fe=1);"FORCE_COLOR"in B&&(B.FORCE_COLOR==="true"?Fe=1:B.FORCE_COLOR==="false"?Fe=0:Fe=B.FORCE_COLOR.length===0?1:Math.min(parseInt(B.FORCE_COLOR,10),3));function Sn(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function In(e,t){if(Fe===0)return 0;if(de("color=16m")||de("color=full")||de("color=truecolor"))return 3;if(de("color=256"))return 2;if(e&&!t&&Fe===void 0)return 0;let r=Fe||0;if(B.TERM==="dumb")return r;if(process.platform==="win32"){let n=Wl.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in B)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in B)||B.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in B)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(B.TEAMCITY_VERSION)?1:0;if(B.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in B){let n=parseInt((B.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(B.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(B.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(B.TERM)||"COLORTERM"in B?1:r}function zl(e){let t=In(e,e&&e.isTTY);return Sn(t)}lo.exports={supportsColor:zl,stdout:Sn(In(!0,ao.isatty(1))),stderr:Sn(In(!0,ao.isatty(2)))}});var co=q((H,wr)=>{"use strict";var Yl=require("tty"),Er=require("util");H.init=iu;H.log=tu;H.formatArgs=Xl;H.save=ru;H.load=nu;H.useColors=Zl;H.destroy=Er.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");H.colors=[6,2,3,4,5,1];try{let e=Fn();e&&(e.stderr||e).level>=2&&(H.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}H.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function Zl(){return"colors"in H.inspectOpts?!!H.inspectOpts.colors:Yl.isatty(process.stderr.fd)}function Xl(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${t} \x1B[0m`;e[0]=o+e[0].split(` -`).join(` -`+o),e.push(i+"m+"+wr.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=eu()+t+" "+e[0]}function eu(){return H.inspectOpts.hideDate?"":new Date().toISOString()+" "}function tu(...e){return process.stderr.write(Er.format(...e)+` -`)}function ru(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function nu(){return process.env.DEBUG}function iu(e){e.inspectOpts={};let t=Object.keys(H.inspectOpts);for(let r=0;rt.trim()).join(" ")};uo.O=function(e){return this.inspectOpts.colors=this.useColors,Er.inspect(e,this.inspectOpts)}});var po=q((um,kn)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?kn.exports=oo():kn.exports=co()});var vo=q((jm,$n)=>{"use strict";var A=$n.exports;$n.exports.default=A;var I="\x1B[",St="\x1B]",st="\x07",Ar=";",Po=process.env.TERM_PROGRAM==="Apple_Terminal";A.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?I+(e+1)+"G":I+(t+1)+";"+(e+1)+"H"};A.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=I+-e+"D":e>0&&(r+=I+e+"C"),t<0?r+=I+-t+"A":t>0&&(r+=I+t+"B"),r};A.cursorUp=(e=1)=>I+e+"A";A.cursorDown=(e=1)=>I+e+"B";A.cursorForward=(e=1)=>I+e+"C";A.cursorBackward=(e=1)=>I+e+"D";A.cursorLeft=I+"G";A.cursorSavePosition=Po?"\x1B7":I+"s";A.cursorRestorePosition=Po?"\x1B8":I+"u";A.cursorGetPosition=I+"6n";A.cursorNextLine=I+"E";A.cursorPrevLine=I+"F";A.cursorHide=I+"?25l";A.cursorShow=I+"?25h";A.eraseLines=e=>{let t="";for(let r=0;r[St,"8",Ar,Ar,t,st,e,St,"8",Ar,Ar,st].join("");A.image=(e,t={})=>{let r=`${St}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+st};A.iTerm={setCwd:(e=process.cwd())=>`${St}50;CurrentDir=${e}${st}`,annotation:(e,t={})=>{let r=`${St}1337;`,n=typeof t.x<"u",i=typeof t.y<"u";if((n||i)&&!(n&&i&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+st}}});var Ao=q((Bm,Co)=>{"use strict";var cu=Fn(),at=Mn();function To(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function qn(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(at("no-hyperlink")||at("no-hyperlinks")||at("hyperlink=false")||at("hyperlink=never"))return!1;if(at("hyperlink=true")||at("hyperlink=always")||"NETLIFY"in t)return!0;if(!cu.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=To(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=To(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}Co.exports={supportsHyperlink:qn,stdout:qn(process.stdout),stderr:qn(process.stderr)}});var Mo=q((Um,It)=>{"use strict";var pu=vo(),Vn=Ao(),Ro=(e,t,{target:r="stdout",...n}={})=>Vn[r]?pu.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`;It.exports=(e,t,r={})=>Ro(e,t,r);It.exports.stderr=(e,t,r={})=>Ro(e,t,{target:"stderr",...r});It.exports.isSupported=Vn.stdout;It.exports.stderr.isSupported=Vn.stderr});var $o=q((lf,Au)=>{Au.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var Vo=q((uf,Fr)=>{"use strict";var Ru=require("fs"),qo=require("path"),Mu=require("os"),Su=$o(),Iu=Su.version,Fu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ku(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,` -`);let n;for(;(n=Fu.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,` -`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function Kn(e){console.log(`[dotenv@${Iu}][DEBUG] ${e}`)}function Ou(e){return e[0]==="~"?qo.join(Mu.homedir(),e.slice(1)):e}function Du(e){let t=qo.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug),i=!!(e&&e.override);e&&(e.path!=null&&(t=Ou(e.path)),e.encoding!=null&&(r=e.encoding));try{let o=Ir.parse(Ru.readFileSync(t,{encoding:r}));return Object.keys(o).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(i===!0&&(process.env[s]=o[s]),n&&Kn(i===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=o[s]}),{parsed:o}}catch(o){return n&&Kn(`Failed to load ${t} ${o.message}`),{error:o}}}var Ir={config:Du,parse:ku};Fr.exports.config=Ir.config;Fr.exports.parse=Ir.parse;Fr.exports=Ir});var Jo=q((yf,Qo)=>{"use strict";Qo.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Ho=q((hf,Go)=>{"use strict";var $u=Jo();Go.exports=e=>{let t=$u(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Wo=q((xf,qu)=>{qu.exports={name:"@prisma/engines-version",version:"5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"61e140623197a131c2a6189271ffee05a7aa9a59"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.17.15",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Hn=q(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.enginesVersion=void 0;Or.enginesVersion=Wo().prisma.enginesVersion});var Xn=q((Ff,Zo)=>{"use strict";Zo.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var rs=q((Df,ts)=>{"use strict";ts.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var ni=q((_f,ns)=>{"use strict";var Wu=rs();ns.exports=e=>typeof e=="string"?e.replace(Wu(),""):e});var is=q((Lf,Dr)=>{"use strict";Dr.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};Dr.exports.default=Dr.exports});var $i=q((iP,La)=>{"use strict";La.exports=function(){function e(t,r,n,i,o){return tn?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;spe,DMMFClass:()=>hr,Debug:()=>On,Decimal:()=>we,Extensions:()=>vn,MetricsClient:()=>pt,NotFoundError:()=>Ce,PrismaClientInitializationError:()=>k,PrismaClientKnownRequestError:()=>U,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>K,PrismaClientValidationError:()=>X,Public:()=>Tn,Sql:()=>oe,Types:()=>Cn,defineDmmfProperty:()=>as,empty:()=>us,getPrismaClient:()=>Ml,join:()=>ls,makeStrictEnum:()=>Sl,objectEnumValues:()=>$r,raw:()=>li,sqltag:()=>ui,warnEnvConflicts:()=>Il,warnOnce:()=>Lt});module.exports=Nl(Gd);var vn={};Rt(vn,{defineExtension:()=>Hi,getExtensionContext:()=>Wi});function Hi(e){return typeof e=="function"?e:t=>t.$extends(e)}function Wi(e){return e}var Tn={};Rt(Tn,{validator:()=>zi});function zi(...e){return t=>t}var Cn={};Rt(Cn,{Extensions:()=>Yi,Public:()=>Zi,Result:()=>Xi,Utils:()=>eo});var Yi={};var Zi={};var Xi={};var eo={};var Ie=(e,t)=>{let r={};for(let n of e){let i=n[t];r[i]=n}return r};function to(e){return e.substring(0,1).toLowerCase()+e.substring(1)}var hr=class{constructor(t){this.document=t;this.compositeNames=new Set(this.datamodel.types.map(r=>r.name)),this.typeAndModelMap=this.buildTypeModelMap(),this.mappingsMap=this.buildMappingsMap(),this.outputTypeMap=this.buildMergedOutputTypeMap(),this.rootFieldMap=this.buildRootFieldMap(),this.inputTypesByName=this.buildInputTypesMap()}get datamodel(){return this.document.datamodel}get mappings(){return this.document.mappings}get schema(){return this.document.schema}get inputObjectTypes(){return this.schema.inputObjectTypes}get outputObjectTypes(){return this.schema.outputObjectTypes}isComposite(t){return this.compositeNames.has(t)}getOtherOperationNames(){return[Object.values(this.mappings.otherOperations.write),Object.values(this.mappings.otherOperations.read)].flat()}hasEnumInNamespace(t,r){return this.schema.enumTypes[r]?.find(n=>n.name===t)!==void 0}resolveInputObjectType(t){return this.inputTypesByName.get(An(t.type,t.namespace))}resolveOutputObjectType(t){if(t.location==="outputObjectTypes")return this.outputObjectTypes[t.namespace??"prisma"].find(r=>r.name===t.type)}buildModelMap(){return Ie(this.datamodel.models,"name")}buildTypeMap(){return Ie(this.datamodel.types,"name")}buildTypeModelMap(){return{...this.buildTypeMap(),...this.buildModelMap()}}buildMappingsMap(){return Ie(this.mappings.modelOperations,"model")}buildMergedOutputTypeMap(){return{model:Ie(this.schema.outputObjectTypes.model,"name"),prisma:Ie(this.schema.outputObjectTypes.prisma,"name")}}buildRootFieldMap(){return{...Ie(this.outputTypeMap.prisma.Query.fields,"name"),...Ie(this.outputTypeMap.prisma.Mutation.fields,"name")}}buildInputTypesMap(){let t=new Map;for(let r of this.inputObjectTypes.prisma)t.set(An(r.name,"prisma"),r);if(!this.inputObjectTypes.model)return t;for(let r of this.inputObjectTypes.model)t.set(An(r.name,"model"),r);return t}};function An(e,t){return t?`${t}.${e}`:e}var pe;(t=>{let e;(x=>(x.findUnique="findUnique",x.findUniqueOrThrow="findUniqueOrThrow",x.findFirst="findFirst",x.findFirstOrThrow="findFirstOrThrow",x.findMany="findMany",x.create="create",x.createMany="createMany",x.update="update",x.updateMany="updateMany",x.upsert="upsert",x.delete="delete",x.deleteMany="deleteMany",x.groupBy="groupBy",x.count="count",x.aggregate="aggregate",x.findRaw="findRaw",x.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(pe||(pe={}));var Pr=S(po()),ou=100,Mt=[];typeof process<"u"&&typeof process.stderr?.write!="function"&&(Pr.default.log=console.debug??console.log);function su(e){let t=(0,Pr.default)(e),r=Object.assign((...n)=>(t.log=r.log,n.length!==0&&Mt.push([e,...n]),Mt.length>ou&&Mt.shift(),t("",...n)),t);return r}var On=Object.assign(su,Pr.default);function mo(e=7500){let t=Mt.map(r=>r.map(n=>typeof n=="string"?n:JSON.stringify(n)).join(" ")).join(` -`);return t.length2&&i.push.apply(i,r.slice(1,r.length-1)),new e(this.value,this.cases.concat([{match:function(s){var a={},l=!!(i.some(function(u){return lu(u,s,function(c,p){a[c]=p})})&&o.every(function(u){return u(s)}));return{matched:l,value:l&&Object.keys(a).length?Eo in a?a[Eo]:a:s}},handler:n}]))},t.when=function(r,n){return new e(this.value,this.cases.concat([{match:function(i){return{matched:!!r(i),value:i}},handler:n}]))},t.otherwise=function(r){return new e(this.value,this.cases.concat([{match:function(n){return{matched:!0,value:n}},handler:r}])).run()},t.exhaustive=function(){return this.run()},t.run=function(){for(var r=this.value,n=void 0,i=0;i!process.env.PRISMA_DISABLE_WARNINGS};function kt(e,...t){mu.warn()&&console.warn(`${du.warn} ${e}`,...t)}var fu=(0,Oo.promisify)(ko.default.exec),ie=D("prisma:get-platform"),gu=["1.0.x","1.1.x","3.0.x"];async function Do(){let e=Mr.default.platform(),t=process.arch;if(e==="freebsd"){let s=await Sr("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:t}}}if(e!=="linux")return{platform:e,arch:t};let r=await hu(),n=await Cu(),i=bu({arch:t,archFromUname:n,familyDistro:r.familyDistro}),{libssl:o}=await Eu(i);return{platform:"linux",libssl:o,arch:t,archFromUname:n,...r}}function yu(e){let t=/^ID="?([^"\n]*)"?$/im,r=/^ID_LIKE="?([^"\n]*)"?$/im,n=t.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=r.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=ot({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return ie(`Found distro info: -${JSON.stringify(a,null,2)}`),a}async function hu(){let e="/etc/os-release";try{let t=await jn.default.readFile(e,{encoding:"utf-8"});return yu(t)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function xu(e){let t=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(t){let r=`${t[1]}.x`;return _o(r)}}function Io(e){let t=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(t){let r=`${t[1]}${t[2]??".0"}.x`;return _o(r)}}function _o(e){let t=(()=>{if(Lo(e))return e;let r=e.split(".");return r[1]="0",r.join(".")})();if(gu.includes(t))return t}function bu(e){return ot(e).with({familyDistro:"musl"},()=>(ie('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:t})=>(ie('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${t}-linux-gnu`,`/lib/${t}-linux-gnu`])).with({familyDistro:"rhel"},()=>(ie('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:t,arch:r,archFromUname:n})=>(ie(`Don't know any platform-specific paths for "${t}" on ${r} (${n})`),[]))}async function Eu(e){let t='grep -v "libssl.so.0"',r=await Fo(e);if(r){ie(`Found libssl.so file using platform-specific paths: ${r}`);let o=Io(r);if(ie(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}ie('Falling back to "ldconfig" and other generic paths');let n=await Sr(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${t}`);if(n||(n=await Fo(["/lib64","/usr/lib64","/lib"])),n){ie(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=Io(n);if(ie(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Sr("openssl version -v");if(i){ie(`Found openssl binary with version: ${i}`);let o=xu(i);if(ie(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return ie("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Fo(e){for(let t of e){let r=await wu(t);if(r)return r}}async function wu(e){try{return(await jn.default.readdir(e)).find(r=>r.startsWith("libssl.so.")&&!r.startsWith("libssl.so.0"))}catch(t){if(t.code==="ENOENT")return;throw t}}async function lt(){let{binaryTarget:e}=await No();return e}function Pu(e){return e.binaryTarget!==void 0}async function Bn(){let{memoized:e,...t}=await No();return t}var Rr={};async function No(){if(Pu(Rr))return Promise.resolve({...Rr,memoized:!0});let e=await Do(),t=vu(e);return Rr={...e,binaryTarget:t},{...Rr,memoized:!1}}function vu(e){let{platform:t,arch:r,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;t==="linux"&&!["x64","arm64"].includes(r)&&kt(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures. If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(t==="linux"&&i===void 0){let c=ot({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");kt(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}". -${c}`)}let u="debian";if(t==="linux"&&o===void 0&&kt(`Prisma doesn't know which engines to download for the Linux distro "${a}". Falling back to Prisma engines built "${u}". -Please report your experience by creating an issue at ${Ft("https://github.com/prisma/prisma/issues")} so we can add your distro to the list of known supported distros.`),t==="darwin"&&r==="arm64")return"darwin-arm64";if(t==="darwin")return"darwin";if(t==="win32")return"windows";if(t==="freebsd")return o;if(t==="openbsd")return"openbsd";if(t==="netbsd")return"netbsd";if(t==="linux"&&o==="nixos")return"linux-nixos";if(t==="linux"&&r==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(t==="linux"&&r==="arm")return`linux-arm-openssl-${i||l}`;if(t==="linux"&&o==="musl"){let c="linux-musl";return!i||Lo(i)?c:`${c}-openssl-${i}`}return t==="linux"&&o&&i?`${o}-openssl-${i}`:(t!=="linux"&&kt(`Prisma detected unknown OS "${t}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function Tu(e){try{return await e()}catch{return}}function Sr(e){return Tu(async()=>{let t=await fu(e);return ie(`Command "${e}" successfully returned "${t.stdout}"`),t.stdout})}async function Cu(){return typeof Mr.default.machine=="function"?Mr.default.machine():(await Sr("uname -m"))?.trim()}function Lo(e){return e.startsWith("1.")}var Un=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","openbsd","netbsd","arm"];var Jn=S(Vo()),kr=S(require("fs"));var ut=S(require("path"));function jo(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var Qn=D("prisma:tryLoadEnv");function Ot({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=Bo(e);r.conflictCheck!=="none"&&_u(n,t,r.conflictCheck);let i=null;return Uo(n?.path,t)||(i=Bo(t)),!n&&!i&&Qn("No Environment variables loaded"),i?.dotenvResult.error?console.error(me(ne("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` -`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function _u(e,t,r){let n=e?.dotenvResult.parsed,i=!Uo(e?.path,t);if(n&&t&&i&&kr.default.existsSync(t)){let o=Jn.default.parse(kr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=ut.default.relative(process.cwd(),e.path),l=ut.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${te(a)} and ${te(l)} -Conflicting env vars: -${s.map(c=>` ${ne(c)}`).join(` -`)} - -We suggest to move the contents of ${te(l)} to ${te(a)} to consolidate your env vars. -`;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>ne(c)).join(", ")} in ${te(a)} and ${te(l)} -Env vars from ${te(l)} overwrite the ones from ${te(a)} - `;console.warn(`${he("warn(prisma)")} ${u}`)}}}}function Bo(e){return Nu(e)?(Qn(`Environment variables loaded from ${e}`),{dotenvResult:jo(Jn.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0})),message:ke(`Environment variables loaded from ${ut.default.relative(process.cwd(),e)}`),path:e}):(Qn(`Environment variables not found at ${e}`),null)}function Uo(e,t){return e&&t&&ut.default.resolve(e)===ut.default.resolve(t)}function Nu(e){return!!(e&&kr.default.existsSync(e))}var Ko="library";function Gn(e){let t=Lu();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Ko)}function Lu(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var Vu=S(Hn());var N=S(require("path")),ju=S(Hn()),wf=D("prisma:engines");function zo(){return N.default.join(__dirname,"../")}var Pf="libquery-engine";N.default.join(__dirname,"../query-engine-darwin");N.default.join(__dirname,"../query-engine-darwin-arm64");N.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");N.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");N.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");N.default.join(__dirname,"../query-engine-linux-static-x64");N.default.join(__dirname,"../query-engine-linux-static-arm64");N.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");N.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");N.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");N.default.join(__dirname,"../libquery_engine-darwin.dylib.node");N.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");N.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");N.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");N.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");N.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");N.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");N.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");N.default.join(__dirname,"../libquery_engine-linux-musl.so.node");N.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");N.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");N.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");N.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");N.default.join(__dirname,"../query_engine-windows.dll.node");var Wn=S(require("fs")),Yo=D("chmodPlusX");function zn(e){if(process.platform==="win32")return;let t=Wn.default.statSync(e),r=t.mode|64|8|1;if(t.mode===r){Yo(`Execution permissions of ${e} are fine`);return}let n=r.toString(8).slice(-3);Yo(`Have to call chmodPlusX on ${e}`),Wn.default.chmodSync(e,n)}function Yn(e){let t=e.e,r=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=t.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${Ft("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${ke(e.id)}\`).`,s=ot({message:t.message,code:t.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${r("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${r("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${r("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o} -${s} - -Details: ${t.message}`}var Dt=S(require("path"));function Zn(e){return Dt.default.sep===Dt.default.posix.sep?e:e.split(Dt.default.sep).join(Dt.default.posix.sep)}var Xo=S(Xn());function ti(e){return String(new ei(e))}var ei=class{constructor(t){this.config=t}toString(){let{config:t}=this,r=t.provider.fromEnvVar?`env("${t.provider.fromEnvVar}")`:t.provider.value,n=JSON.parse(JSON.stringify({provider:r,binaryTargets:Bu(t.binaryTargets)}));return`generator ${t.name} { -${(0,Xo.default)(Uu(n),2)} -}`}};function Bu(e){let t;if(e.length>0){let r=e.find(n=>n.fromEnvVar!==null);r?t=`env("${r.fromEnvVar}")`:t=e.map(n=>n.native?"native":n.value)}else t=void 0;return t}function Uu(e){let t=Object.keys(e).reduce((r,n)=>Math.max(r,n.length),0);return Object.entries(e).map(([r,n])=>`${r.padEnd(t)} = ${Ku(n)}`).join(` -`)}function Ku(e){return JSON.parse(JSON.stringify(e,(t,r)=>Array.isArray(r)?`[${r.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(r)))}var Nt={};Rt(Nt,{error:()=>Gu,info:()=>Ju,log:()=>Qu,query:()=>Hu,should:()=>es,tags:()=>_t,warn:()=>ri});var _t={error:me("prisma:error"),warn:he("prisma:warn"),info:Oe("prisma:info"),query:it("prisma:query")},es={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Qu(...e){console.log(...e)}function ri(e,...t){es.warn()&&console.warn(`${_t.warn} ${e}`,...t)}function Ju(e,...t){console.info(`${_t.info} ${e}`,...t)}function Gu(e,...t){console.error(`${_t.error} ${e}`,...t)}function Hu(e,...t){console.log(`${_t.query} ${e}`,...t)}function Ge(e,t){throw new Error(t)}function ii(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var oi=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});function ct(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function si(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{os.has(e)||(os.add(e),ri(t,...r))};var U=class extends Error{constructor(r,{code:n,clientVersion:i,meta:o,batchRequestIdx:s}){super(r);this.name="PrismaClientKnownRequestError",this.code=n,this.clientVersion=i,this.meta=o,Object.defineProperty(this,"batchRequestIdx",{value:s,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};E(U,"PrismaClientKnownRequestError");var Ce=class extends U{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};E(Ce,"NotFoundError");var k=class e extends Error{constructor(r,n,i){super(r);this.name="PrismaClientInitializationError",this.clientVersion=n,this.errorCode=i,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};E(k,"PrismaClientInitializationError");var ue=class extends Error{constructor(r,n){super(r);this.name="PrismaClientRustPanicError",this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};E(ue,"PrismaClientRustPanicError");var K=class extends Error{constructor(r,{clientVersion:n,batchRequestIdx:i}){super(r);this.name="PrismaClientUnknownRequestError",this.clientVersion=n,Object.defineProperty(this,"batchRequestIdx",{value:i,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};E(K,"PrismaClientUnknownRequestError");var X=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};E(X,"PrismaClientValidationError");var pt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};function $t(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function as(e,t){let r=$t(()=>zu(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function zu(e){return{datamodel:{models:ai(e.models),enums:ai(e.enums),types:ai(e.types)}}}function ai(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Cl=require("async_hooks"),Al=require("events"),Rl=S(require("fs")),fr=S(require("path"));var oe=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var ds=require("util");var _r={enumerable:!0,configurable:!0,writable:!0};function Nr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>_r,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var cs=Symbol.for("nodejs.util.inspect.custom");function be(e,t){let r=Yu(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=ps(Reflect.ownKeys(o),r),a=ps(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{..._r,...l?.getPropertyDescriptor(s)}:_r:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[cs]=function(o,s,a=ds.inspect){let l={...this};return delete l[cs],a(l,s)},i}function Yu(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function ps(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Vt(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}var dt=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};var Lr=Symbol(),ci=new WeakMap,Ae=class{constructor(t){t===Lr?ci.set(this,`Prisma.${this._getName()}`):ci.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return ci.get(this)}},jt=class extends Ae{_getNamespace(){return"NullTypes"}},Bt=class extends jt{};pi(Bt,"DbNull");var Ut=class extends jt{};pi(Ut,"JsonNull");var Kt=class extends jt{};pi(Kt,"AnyNull");var $r={classes:{DbNull:Bt,JsonNull:Ut,AnyNull:Kt},instances:{DbNull:new Bt(Lr),JsonNull:new Ut(Lr),AnyNull:new Kt(Lr)}};function pi(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}function mt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function qr(e){return e.toString()!=="Invalid Date"}var ft=9e15,Le=1e9,di="0123456789abcdef",jr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Br="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",mi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ft,maxE:ft,crypto:!1},ys,Re,w=!0,Kr="[DecimalError] ",Ne=Kr+"Invalid argument: ",hs=Kr+"Precision limit exceeded",xs=Kr+"crypto unavailable",bs="[object Decimal]",ee=Math.floor,j=Math.pow,Zu=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Xu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ec=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Es=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,b=7,tc=9007199254740991,rc=jr.length-1,fi=Br.length-1,m={toStringTag:bs};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),h(e)};m.ceil=function(){return h(new this.constructor(this),this.e+1,2)};m.clampedTo=m.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Ne+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};m.comparedTo=m.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};m.cosine=m.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+b,n.rounding=1,r=nc(n,Cs(n,r)),n.precision=e,n.rounding=t,h(Re==2||Re==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};m.cubeRoot=m.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(w=!1,o=c.s*j(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=W(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=j(r,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=O(u.plus(c).times(a),u.plus(l),s+2,1),W(a.d).slice(0,s)===(r=W(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(h(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(h(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return w=!0,h(n,e,p.rounding,t)};m.decimalPlaces=m.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ee(this.e/b))*b,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};m.dividedBy=m.div=function(e){return O(this,new this.constructor(e))};m.dividedToIntegerBy=m.divToInt=function(e){var t=this,r=t.constructor;return h(O(t,new r(e),0,1,1),r.precision,r.rounding)};m.equals=m.eq=function(e){return this.cmp(e)===0};m.floor=function(){return h(new this.constructor(this),this.e+1,3)};m.greaterThan=m.gt=function(e){return this.cmp(e)>0};m.greaterThanOrEqualTo=m.gte=function(e){var t=this.cmp(e);return t==1||t===0};m.hyperbolicCosine=m.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Jr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=gt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return h(o,s.precision=r,s.rounding=n,!0)};m.hyperbolicSine=m.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=gt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Jr(5,e)),i=gt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,h(i,t,r,!0)};m.hyperbolicTangent=m.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,O(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};m.inverseCosine=m.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?fe(r,i,o):new r(0):new r(NaN):t.isZero()?fe(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=fe(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};m.inverseHyperbolicCosine=m.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,w=!1,r=r.times(r).minus(1).sqrt().plus(r),w=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};m.inverseHyperbolicSine=m.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,w=!1,r=r.times(r).plus(1).sqrt().plus(r),w=!0,n.precision=e,n.rounding=t,r.ln())};m.inverseHyperbolicTangent=m.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?h(new o(i),e,t,!0):(o.precision=r=n-i.e,i=O(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};m.inverseSine=m.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=fe(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};m.inverseTangent=m.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=fi)return s=fe(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=fi)return s=fe(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/b+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(w=!1,t=Math.ceil(a/b),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};m.isNaN=function(){return!this.s};m.isNegative=m.isNeg=function(){return this.s<0};m.isPositive=m.isPos=function(){return this.s>0};m.isZero=function(){return!!this.d&&this.d[0]===0};m.lessThan=m.lt=function(e){return this.cmp(e)<0};m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1};m.logarithm=m.log=function(e){var t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,f=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(w=!1,a=p+f,s=_e(u,a),n=t?Ur(c,a+10):_e(e,a),l=O(s,n,a,1),Qt(l.d,i=p,d))do if(a+=10,s=_e(u,a),n=t?Ur(c,a+10):_e(e,a),l=O(s,n,a,1),!o){+W(l.d).slice(i+1,i+15)+1==1e14&&(l=h(l,p+1,0));break}while(Qt(l.d,i+=10,d));return w=!0,h(l,p,d)};m.minus=m.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,f=this,y=f.constructor;if(e=new y(e),!f.d||!e.d)return!f.s||!e.s?e=new y(NaN):f.d?e.s=-e.s:e=new y(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,d=e.d,a=y.precision,l=y.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new y(f);else return new y(l===3?-0:0);return w?h(e,a,l):e}if(r=ee(e.e/b),c=ee(f.e/b),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/b),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Qr(u,n),w?h(e,a,l):e};m.precision=m.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ne+e);return r.d?(t=ws(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};m.round=function(){var e=this,t=e.constructor;return h(new t(e),e.e+1,t.rounding)};m.sine=m.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+b,n.rounding=1,r=oc(n,Cs(n,r)),n.precision=e,n.rounding=t,h(Re>2?r.neg():r,e,t,!0)):new n(NaN)};m.squareRoot=m.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(w=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=W(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=ee((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(O(s,o,r+2,1)).times(.5),W(o.d).slice(0,r)===(t=W(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(h(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(h(n,l+1,1),e=!n.times(n).eq(s));break}return w=!0,h(n,l,c.rounding,e)};m.tangent=m.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=O(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,h(Re==2||Re==4?r.neg():r,e,t,!0)):new n(NaN)};m.times=m.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,f=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!f||!f[0])return new p(!e.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:!d||!f?e.s/0:e.s*0);for(r=ee(c.e/b)+ee(e.e/b),l=d.length,u=f.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+f[n]*d[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Qr(o,r),w?h(e,p.precision,p.rounding):e};m.toBinary=function(e,t){return hi(this,2,e,t)};m.toDecimalPlaces=m.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(se(e,0,Le),t===void 0?t=n.rounding:se(t,0,8),h(r,e+r.e+1,t))};m.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ee(n,!0):(se(e,0,Le),t===void 0?t=i.rounding:se(t,0,8),n=h(new i(n),e+1,t),r=Ee(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Ee(i):(se(e,0,Le),t===void 0?t=o.rounding:se(t,0,8),n=h(new o(i),e+i.e+1,t),r=Ee(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};m.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,f=this,y=f.d,g=f.constructor;if(!y)return new g(f);if(u=r=new g(1),n=l=new g(0),t=new g(n),o=t.e=ws(y)-f.e-1,s=o%b,t.d[0]=j(10,s<0?b+s:s),e==null)e=o>0?t:u;else{if(a=new g(e),!a.isInt()||a.lt(u))throw Error(Ne+a);e=a.gt(t)?o>0?t:u:a}for(w=!1,a=new g(W(y)),c=g.precision,g.precision=o=y.length*b*2;p=O(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=O(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=f.s,d=O(u,n,o,1).minus(f).abs().cmp(O(l,r,o,1).minus(f).abs())<1?[u,n]:[l,r],g.precision=c,w=!0,d};m.toHexadecimal=m.toHex=function(e,t){return hi(this,16,e,t)};m.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:se(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(w=!1,r=O(r,e,0,t,1).times(e),w=!0,h(r)):(e.s=r.s,r=e),r};m.toNumber=function(){return+this};m.toOctal=function(e,t){return hi(this,8,e,t)};m.toPower=m.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(j(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return h(a,n,o);if(t=ee(e.e/b),t>=e.d.length-1&&(r=u<0?-u:u)<=tc)return i=Ps(l,a,r,n),e.s<0?new l(1).div(i):h(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(w=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=gi(e.times(_e(a,n+r)),n),i.d&&(i=h(i,n+5,1),Qt(i.d,n,o)&&(t=n+10,i=h(gi(e.times(_e(a,t+r)),t),t+5,1),+W(i.d).slice(n+1,n+15)+1==1e14&&(i=h(i,n+1,0)))),i.s=s,w=!0,l.rounding=o,h(i,n,o))};m.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ee(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(se(e,1,Le),t===void 0?t=i.rounding:se(t,0,8),n=h(new i(n),e,t),r=Ee(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toSignificantDigits=m.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(se(e,1,Le),t===void 0?t=n.rounding:se(t,0,8)),h(new n(r),e,t)};m.toString=function(){var e=this,t=e.constructor,r=Ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};m.truncated=m.trunc=function(){return h(new this.constructor(this),this.e+1,1)};m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,r=Ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function W(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Ne+e)}function Qt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=b,i=0):(i=Math.ceil((t+1)/b),t%=b),o=j(10,b-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==j(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==j(10,t-3)-1,s}function Vr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function nc(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Jr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=gt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var O=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,f,y,g,P,T,C,x,R,ce,G,Ue,$,z,Te,Y,et,gr=n.constructor,Pn=n.s==i.s?1:-1,Z=n.d,F=i.d;if(!Z||!Z[0]||!F||!F[0])return new gr(!n.s||!i.s||(Z?F&&Z[0]==F[0]:!F)?NaN:Z&&Z[0]==0||!F?Pn*0:Pn/0);for(l?(f=1,c=n.e-i.e):(l=ge,f=b,c=ee(n.e/f)-ee(i.e/f)),Y=F.length,z=Z.length,T=new gr(Pn),C=T.d=[],p=0;F[p]==(Z[p]||0);p++);if(F[p]>(Z[p]||0)&&c--,o==null?(G=o=gr.precision,s=gr.rounding):a?G=o+(n.e-i.e)+1:G=o,G<0)C.push(1),y=!0;else{if(G=G/f+2|0,p=0,Y==1){for(d=0,F=F[0],G++;(p1&&(F=e(F,d,l),Z=e(Z,d,l),Y=F.length,z=Z.length),$=Y,x=Z.slice(0,Y),R=x.length;R=l/2&&++Te;do d=0,u=t(F,x,Y,R),u<0?(ce=x[0],Y!=R&&(ce=ce*l+(x[1]||0)),d=ce/Te|0,d>1?(d>=l&&(d=l-1),g=e(F,d,l),P=g.length,R=x.length,u=t(g,x,P,R),u==1&&(d--,r(g,Y=10;d/=10)p++;T.e=p+c*f-1,h(T,a?o+T.e+1:o,s,y)}return T}}();function h(e,t,r,n){var i,o,s,a,l,u,c,p,d,f=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=b,s=t,c=p[d=0],l=c/j(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/b),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=b,s=o-b+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=b,s=o-b+i,l=s<0?0:c/j(10,i-s-1)%10|0}if(n=n||t<0||p[d+1]!==void 0||(s<0?c:c%j(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?c/j(10,i-s):0:p[d-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,u?(t-=e.e+1,p[0]=j(10,(b-t%b)%b),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=j(10,b-o),p[d]=s>0?(c/j(10,i-s)%j(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==ge&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=ge)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return w&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+De(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+De(-i-1)+o,r&&(n=r-s)>0&&(o+=De(n))):i>=s?(o+=De(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+De(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=De(n))),o}function Qr(e,t){var r=e[0];for(t*=b;r>=10;r/=10)t++;return t}function Ur(e,t,r){if(t>rc)throw w=!0,r&&(e.precision=r),Error(hs);return h(new e(jr),t,1,!0)}function fe(e,t,r){if(t>fi)throw Error(hs);return h(new e(Br),t,r,!0)}function ws(e){var t=e.length-1,r=t*b+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function De(e){for(var t="";e--;)t+="0";return t}function Ps(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/b+4);for(w=!1;;){if(r%2&&(o=o.times(t),fs(o.d,s)&&(i=!0)),r=ee(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),fs(t.d,s)}return w=!0,o}function ms(e){return e.d[e.d.length-1]&1}function vs(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(w=!1,l=y):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(j(2,p))/Math.LN10*2+5|0,l+=n,r=o=s=new d(1),d.precision=l;;){if(o=h(o.times(e),l,1),r=r.times(++c),a=s.plus(O(o,r,l,1)),W(a.d).slice(0,l)===W(s.d).slice(0,l)){for(i=p;i--;)s=h(s.times(s),l,1);if(t==null)if(u<3&&Qt(s.d,l-n,f,u))d.precision=l+=10,r=o=a=new d(1),c=0,u++;else return h(s,d.precision=y,f,w=!0);else return d.precision=y,s}s=a}}function _e(e,t){var r,n,i,o,s,a,l,u,c,p,d,f=1,y=10,g=e,P=g.d,T=g.constructor,C=T.rounding,x=T.precision;if(g.s<0||!P||!P[0]||!g.e&&P[0]==1&&P.length==1)return new T(P&&!P[0]?-1/0:g.s!=1?NaN:P?0:g);if(t==null?(w=!1,c=x):c=t,T.precision=c+=y,r=W(P),n=r.charAt(0),Math.abs(o=g.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=W(g.d),n=r.charAt(0),f++;o=g.e,n>1?(g=new T("0."+r),o++):g=new T(n+"."+r.slice(1))}else return u=Ur(T,c+2,x).times(o+""),g=_e(new T(n+"."+r.slice(1)),c-y).plus(u),T.precision=x,t==null?h(g,x,C,w=!0):g;for(p=g,l=s=g=O(g.minus(1),g.plus(1),c,1),d=h(g.times(g),c,1),i=3;;){if(s=h(s.times(d),c,1),u=l.plus(O(s,new T(i),c,1)),W(u.d).slice(0,c)===W(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(Ur(T,c+2,x).times(o+""))),l=O(l,new T(f),c,1),t==null)if(Qt(l.d,c-y,C,a))T.precision=c+=y,u=s=g=O(p.minus(1),p.plus(1),c,1),d=h(g.times(g),c,1),i=a=1;else return h(l,T.precision=x,C,w=!0);else return T.precision=x,l;l=u,i+=2}}function Ts(e){return String(e.s*e.s/0)}function yi(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%b,r<0&&(n+=b),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Es.test(t))return yi(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Xu.test(t))r=16,t=t.toLowerCase();else if(Zu.test(t))r=2;else if(ec.test(t))r=8;else throw Error(Ne+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Ps(n,new n(r),o,o*2)),u=Vr(t,r,ge),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Qr(u,c),e.d=u,w=!1,s&&(e=O(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?j(2,l):We.pow(2,l))),w=!0,e)}function oc(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:gt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Jr(5,r)),t=gt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function gt(e,t,r,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/b);for(w=!1,l=r.times(r),a=new e(n);;){if(s=O(a.times(l),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=O(s.times(l),new e(t++*t++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return w=!0,s.d.length=p+1,s}function Jr(e,t){for(var r=e;--t;)r*=e;return r}function Cs(e,t){var r,n=t.s<0,i=fe(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Re=n?4:1,t;if(r=t.divToInt(i),r.isZero())Re=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Re=ms(r)?n?2:3:n?4:1,t;Re=ms(r)?n?1:4:n?3:2}return t.minus(i).abs()}function hi(e,t,r,n){var i,o,s,a,l,u,c,p,d,f=e.constructor,y=r!==void 0;if(y?(se(r,1,Le),n===void 0?n=f.rounding:se(n,0,8)):(r=f.precision,n=f.rounding),!e.isFinite())c=Ts(e);else{for(c=Ee(e),s=c.indexOf("."),y?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),d=new f(1),d.e=c.length-s,d.d=Vr(Ee(d),10,i),d.e=d.d.length),p=Vr(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=y?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=O(e,d,r,n,0,i),p=e.d,o=e.e,u=ys),s=p[r],a=i/2,u=u||p[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,u)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(p=Vr(c,i,t),l=p.length;!p[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else ot)return e.length=t,!0}function sc(e){return new this(e).abs()}function ac(e){return new this(e).acos()}function lc(e){return new this(e).acosh()}function uc(e,t){return new this(e).plus(t)}function cc(e){return new this(e).asin()}function pc(e){return new this(e).asinh()}function dc(e){return new this(e).atan()}function mc(e){return new this(e).atanh()}function fc(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=fe(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?fe(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=fe(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(O(e,t,o,1)),t=fe(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(O(e,t,o,1)),r}function gc(e){return new this(e).cbrt()}function yc(e){return h(e=new this(e),e.e+1,2)}function hc(e,t,r){return new this(e).clamp(t,r)}function xc(e){if(!e||typeof e!="object")throw Error(Kr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Le,"rounding",0,8,"toExpNeg",-ft,0,"toExpPos",0,ft,"maxE",0,ft,"minE",-ft,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ne+r+": "+n);if(r="crypto",i&&(this[r]=mi[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(xs);else this[r]=!1;else throw Error(Ne+r+": "+n);return this}function bc(e){return new this(e).cos()}function Ec(e){return new this(e).cosh()}function As(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,gs(o)){u.s=o.s,w?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;w?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(xs);else for(;o=10;i/=10)n++;n`}};function ht(e){return e instanceof Jt}var Gr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var Hr=e=>e,Wr={bold:Hr,red:Hr,green:Hr,dim:Hr},Rs={bold:ne,red:me,green:Qe,dim:ke},xt={write(e){e.writeLine(",")}};var Pe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};var $e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var bt=class extends $e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new Gr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Pe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(xt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}};var Ms=": ",zr=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Ms.length}write(t){let r=new Pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Ms).write(this.value)}};var Q=class e extends $e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof bt&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select");if(r?.value instanceof e)return{kind:"select",value:r.value};let n=this.getField("include");if(n?.value instanceof e)return{kind:"include",value:n.value}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}writeEmpty(r){let n=new Pe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(xt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};var J=class extends $e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}};var xi=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Yr(e){return new xi(Ss(e))}function Ss(e){let t=new Q;for(let[r,n]of Object.entries(e)){let i=new zr(r,Is(n));t.addField(i)}return t}function Is(e){if(typeof e=="string")return new J(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new J(String(e));if(typeof e=="bigint")return new J(`${e}n`);if(e===null)return new J("null");if(e===void 0)return new J("undefined");if(yt(e))return new J(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new J(`Buffer.alloc(${e.byteLength})`):new J(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=qr(e)?e.toISOString():"Invalid Date";return new J(`new Date("${t}")`)}return e instanceof Ae?new J(`Prisma.${e._getName()}`):ht(e)?new J(`prisma.${to(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Jc(e):typeof e=="object"?Ss(e):new J(Object.prototype.toString.call(e))}function Jc(e){let t=new bt;for(let r of e)t.addItem(Is(r));return t}function Fs(e){if(e===void 0)return"";let t=Yr(e);return new dt(0,{colors:Wr}).write(t).toString()}var Gt="";function ks(e){var t=e.split(` -`);return t.reduce(function(r,n){var i=Wc(n)||Yc(n)||ep(n)||ip(n)||rp(n);return i&&r.push(i),r},[])}var Gc=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Hc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Wc(e){var t=Gc.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=Hc.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||Gt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var zc=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Yc(e){var t=zc.exec(e);return t?{file:t[2],methodName:t[1]||Gt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Zc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Xc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ep(e){var t=Zc.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Xc.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||Gt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var tp=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function rp(e){var t=tp.exec(e);return t?{file:t[3],methodName:t[1]||Gt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var np=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function ip(e){var t=np.exec(e);return t?{file:t[2],methodName:t[1]||Gt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var bi=class{getLocation(){return null}},Ei=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=ks(t).find(i=>{if(!i.file)return!1;let o=Zn(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function qe(e){return e==="minimal"?new bi:new Ei}var Os={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Et(e={}){let t=sp(e);return Object.entries(t).reduce((n,[i,o])=>(Os[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function sp(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Zr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Ds(e,t){let r=Zr(e);return t({action:"aggregate",unpacker:r,argsMapper:Et})(e)}function ap(e={}){let{select:t,...r}=e;return typeof t=="object"?Et({...r,_count:t}):Et({...r,_count:{_all:!0}})}function lp(e={}){return typeof e.select=="object"?t=>Zr(e)(t)._count:t=>Zr(e)(t)._count._all}function _s(e,t){return t({action:"count",unpacker:lp(e),argsMapper:ap})(e)}function up(e={}){let t=Et(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function cp(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Ns(e,t){return t({action:"groupBy",unpacker:cp(e),argsMapper:up})(e)}function Ls(e,t,r){if(t==="aggregate")return n=>Ds(n,r);if(t==="count")return n=>_s(n,r);if(t==="groupBy")return n=>Ns(n,r)}function $s(e,t){let r=t.fields.filter(i=>!i.relationName),n=oi(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Jt(e,o,s.type,s.isList,s.kind==="enum")},...Nr(Object.keys(n))})}var qs=e=>Array.isArray(e)?e:e.split("."),wi=(e,t)=>qs(t).reduce((r,n)=>r&&r[n],e),Vs=(e,t,r)=>qs(t).reduceRight((n,i,o,s)=>Object.assign({},wi(e,s.slice(0,o)),{[i]:n}),r);function pp(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function dp(e,t,r){return t===void 0?e??{}:Vs(t,r,e||!0)}function Pi(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=qe(e._errorFormat),c=pp(n,i),p=dp(l,o,c),d=r({dataPath:c,callsite:u})(p),f=mp(e,t);return new Proxy(d,{get(y,g){if(!f.includes(g))return y[g];let T=[a[g].type,r,g],C=[c,p];return Pi(e,...T,...C)},...Nr([...f,...Object.getOwnPropertyNames(d)])})}}function mp(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Js=S(Xn());var Qs=S(require("fs"));var js={keyword:Oe,entity:Oe,value:e=>ne(it(e)),punctuation:it,directive:Oe,function:Oe,variable:e=>ne(it(e)),string:e=>ne(Qe(e)),boolean:he,number:Oe,comment:vr};var fp=e=>e,Xr={},gp=0,v={manual:Xr.Prism&&Xr.Prism.manual,disableWorkerMessageHandler:Xr.Prism&&Xr.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof ye){let t=e;return new ye(t.type,v.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(v.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Te instanceof ye)continue;if(ce&&$!=t.length-1){C.lastIndex=z;var p=C.exec(e);if(!p)break;var c=p.index+(R?p[1].length:0),d=p.index+p[0].length,a=$,l=z;for(let F=t.length;a=l&&(++$,z=l);if(t[$]instanceof ye)continue;u=a-$,Te=e.slice(z,l),p.index-=z}else{C.lastIndex=0;var p=C.exec(Te),u=1}if(!p){if(o)break;continue}R&&(G=p[1]?p[1].length:0);var c=p.index+G,p=p[0].slice(G),d=c+p.length,f=Te.slice(0,c),y=Te.slice(d);let Y=[$,u];f&&(++$,z+=f.length,Y.push(f));let et=new ye(g,x?v.tokenize(p,x):p,Ue,p,ce);if(Y.push(et),y&&Y.push(y),Array.prototype.splice.apply(t,Y),u!=1&&v.matchGrammar(e,t,r,$,z,!0,g),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return v.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=v.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=v.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:ye};v.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};v.languages.javascript=v.languages.extend("clike",{"class-name":[v.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});v.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;v.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:v.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:v.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:v.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:v.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});v.languages.markup&&v.languages.markup.tag.addInlined("script","javascript");v.languages.js=v.languages.javascript;v.languages.typescript=v.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});v.languages.ts=v.languages.typescript;function ye(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}ye.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return ye.stringify(r,t)}).join(""):yp(e.type)(e.content)};function yp(e){return js[e]||fp}function Bs(e){return hp(e,v.languages.javascript)}function hp(e,t){return v.tokenize(e,t).map(n=>ye.stringify(n)).join("")}var Us=S(Ho());function Ks(e){return(0,Us.default)(e)}var en=class e{static read(t){let r;try{r=Qs.default.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` -`);return new e(t,Ks(n).split(` -`))}highlight(){let t=Bs(this.toString());return new e(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var xp={red:me,gray:vr,dim:ke,bold:ne,underline:te,highlightSource:e=>e.highlight()},bp={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ep({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s={functionName:`prisma.${r}()`,message:t,isPanic:n??!1,callArguments:i};if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=en.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Pp(c),d=wp(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,y=>y.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((y,g)=>o.gray(String(g).padStart(f))+" "+y).mapLines(y=>o.dim(y)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let y=p+f+1;y+=2,s.callArguments=(0,Js.default)(i,y).slice(y)}}return s}function wp(e){let t=Object.keys(pe.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Pp(e){let t=0;for(let r=0;r{if("rejectOnNotFound"in n.args){let o=wt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new X(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof U&&o.code==="P2025"?new Ce(`No ${e} found`,t):o})}}function ve(e){return e.replace(/^./,t=>t.toLowerCase())}var Ap=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Rp=["aggregate","count","groupBy"];function vi(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Mp(e,t),Ip(e,t),qt(r),re("name",()=>t),re("$name",()=>t),re("$parent",()=>e._appliedParent)];return be({},n)}function Mp(e,t){let r=ve(t),n=Object.keys(pe.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=Gs(o,t,e._clientVersion,s);let a=l=>u=>{let c=qe(e._errorFormat);return e._createPrismaPromise(p=>{let d={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:p,callsite:c};return s({...d,...l})})};return Ap.includes(o)?Pi(e,t,a):Sp(i)?Ls(e,i,a):a({})}}}function Sp(e){return Rp.includes(e)}function Ip(e,t){return He(re("fields",()=>{let r=e._runtimeDataModel.models[t];return $s(t,r)}))}function Hs(e){return e.replace(/^./,t=>t.toUpperCase())}var Ti=Symbol();function Ht(e){let t=[Fp(e),re(Ti,()=>e),re("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(qt(r)),be(e,t)}function Fp(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(ve),n=[...new Set(t.concat(r))];return He({getKeys(){return n},getPropertyValue(i){let o=Hs(i);if(e._runtimeDataModel.models[o]!==void 0)return vi(e,o);if(e._runtimeDataModel.models[i]!==void 0)return vi(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function tn(e){return e[Ti]?e[Ti]:e}function Ws(e){if(typeof e=="function")return e(this);let t=tn(this),r=Object.create(t,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Ht(r)}function zs({result:e,modelName:t,select:r,extensions:n}){let i=n.getAllComputedFields(t);if(!i)return e;let o=[],s=[];for(let a of Object.values(i)){if(r){if(!r[a.name])continue;let l=a.needs.filter(u=>!r[u]);l.length>0&&s.push(Vt(l))}kp(e,a.needs)&&o.push(Op(a,be(e,o)))}return o.length>0||s.length>0?be(e,[...o,...s]):e}function kp(e,t){return t.every(r=>ii(e,r))}function Op(e,t){return He(re(e.name,()=>e.compute(t)))}function rn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sc.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=rn({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Zs({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:rn({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(s,a,l)=>zs({result:s,modelName:ve(a),select:l.select,extensions:n})})}function Xs(e){if(e instanceof oe)return Dp(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Xs(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=oa(o,l),a.args=s,ta(e,a,r,n+1)}})})}function ra(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return ta(e,t,s)}function na(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?ia(r,n,0,e):e(r)}}function ia(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=oa(i,l),ia(a,t,r+1,n)}})}var ea=e=>e;function oa(e=ea,t=ea){return r=>e(t(r))}function aa(e,t,r){let n=ve(r);return!t.result||!(t.result.$allModels||t.result[n])?e:_p({...e,...sa(t.name,e,t.result.$allModels),...sa(t.name,e,t.result[n])})}function _p(e){let t=new xe,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return ct(e,n=>({...n,needs:r(n.name,new Set)}))}function sa(e,t,r){return r?ct(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Np(t,o,i)})):{}}function Np(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function la(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}var nn=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new xe;this.modelExtensionsCache=new xe;this.queryCallbacksCache=new xe;this.clientExtensions=$t(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=$t(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>aa(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=ve(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},on=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new nn(t))}isEmpty(){return this.head===void 0}append(t){return new e(new nn(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var ua=D("prisma:client"),ca={Vercel:"vercel","Netlify CI":"netlify"};function pa({postinstall:e,ciName:t,clientVersion:r}){if(ua("checkPlatformCaching:postinstall",e),ua("checkPlatformCaching:ciName",t),e===!0&&t&&t in ca){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${ca[t]}-build`;throw console.error(n),new k(n,r)}}function da(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}function zt({error:e,user_facing_error:t},r){return t.error_code?new U(t.message,{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new K(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}var Pt=class{};var ha=S(require("fs")),Yt=S(require("path"));function sn(e){let{runtimeBinaryTarget:t}=e;return`Add "${t}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: - -${Lp(e)}`}function Lp(e){let{generator:t,generatorBinaryTargets:r,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...r,i];return ti({...t,binaryTargets:o})}function Ve(e){let{runtimeBinaryTarget:t}=e;return`Prisma Client could not locate the Query Engine for runtime "${t}".`}function je(e){let{searchedLocations:t}=e;return`The following locations have been searched: -${[...new Set(t)].map(i=>` ${i}`).join(` -`)}`}function ma(e){let{runtimeBinaryTarget:t}=e;return`${Ve(e)} - -This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${t}". -${sn(e)} - -${je(e)}`}function an(e){return`We would appreciate if you could take the time to share some information with us. -Please help us by answering a few questions: https://pris.ly/${e}`}function fa(e){let{queryEngineName:t}=e;return`${Ve(e)} - -This is likely caused by a bundler that has not copied "${t}" next to the resulting bundle. -Ensure that "${t}" has been copied next to the bundle or in "${e.expectedLocation}". - -${an("engine-not-found-bundler-investigation")} - -${je(e)}`}function ga(e){let{runtimeBinaryTarget:t,generatorBinaryTargets:r}=e,n=r.find(i=>i.native);return`${Ve(e)} - -This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${t}". -${sn(e)} - -${je(e)}`}function ya(e){let{queryEngineName:t}=e;return`${Ve(e)} - -This is likely caused by tooling that has not copied "${t}" to the deployment folder. -Ensure that you ran \`prisma generate\` and that "${t}" has been copied to "${e.expectedLocation}". - -${an("engine-not-found-tooling-investigation")} - -${je(e)}`}var $p=D("prisma:client:engines:resolveEnginePath"),qp=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function xa(e,t){let r={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??t.prismaPath;if(r!==void 0)return r;let{enginePath:n,searchedLocations:i}=await Vp(e,t);if($p("enginePath",n),n!==void 0&&e==="binary"&&zn(n),n!==void 0)return t.prismaPath=n;let o=await lt(),s=t.generator?.binaryTargets??[],a=s.some(d=>d.native),l=!s.some(d=>d.value===o),u=__filename.match(qp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:t.generator,runtimeBinaryTarget:o,queryEngineName:ba(e,o),expectedLocation:Yt.default.relative(process.cwd(),t.dirname)},p;throw a&&l?p=ga(c):l?p=ma(c):u?p=fa(c):p=ya(c),new k(p,t.clientVersion)}async function Vp(engineType,config){let binaryTarget=await lt(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,Yt.default.resolve(dirname,".."),config.generator?.output?.value??dirname,Yt.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(zo());for(let e of searchLocations){let t=ba(engineType,binaryTarget),r=Yt.default.join(e,t);if(searchedLocations.push(e),ha.default.existsSync(r))return{enginePath:r,searchedLocations}}return{enginePath:void 0,searchedLocations}}function ba(e,t){return e==="library"?Nn(t,"fs"):`query-engine-${t}${t==="windows"?".exe":""}`}function ln(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}var Ci=S(ni());function Ea(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function wa(e){return e.split(` -`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}var Pa=S(is());function va({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.md",body:i}){return(0,Pa.default)({user:t,repo:r,template:n,title:e,body:i})}function Ta({version:e,platform:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=mo(6e3-(s?.length??0)),l=wa((0,Ci.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",c=(0,Ci.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${process.version?.padEnd(19)}| -| OS | ${t?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?Ea(s):""} -\`\`\` -`),p=va({title:r,body:c});return`${r} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${te(p)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}function un({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new k(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new k("error: Missing URL environment variable, value, or override.",n);return i}var cn=class extends Error{constructor(r,n){super(r);this.clientVersion=n.clientVersion,this.cause=n.cause}get[Symbol.toStringTag](){return this.name}};var ae=class extends cn{constructor(r,n){super(r,n);this.isRetryable=n.isRetryable??!0}};function M(e,t){return{...e,isRetryable:t}}var vt=class extends ae{constructor(r){super("This request must be retried",M(r,!0));this.name="ForcedRetryError";this.code="P5001"}};E(vt,"ForcedRetryError");var ze=class extends ae{constructor(r,n){super(r,M(n,!1));this.name="InvalidDatasourceError";this.code="P5002"}};E(ze,"InvalidDatasourceError");var Ye=class extends ae{constructor(r,n){super(r,M(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};E(Ye,"NotImplementedYetError");var L=class extends ae{constructor(r,n){super(r,n);this.response=n.response;let i=this.response.headers.get("prisma-request-id");if(i){let o=`(The request id was: ${i})`;this.message=this.message+" "+o}}};var Ze=class extends L{constructor(r){super("Schema needs to be uploaded",M(r,!0));this.name="SchemaMissingError";this.code="P5005"}};E(Ze,"SchemaMissingError");var Ai="This request could not be understood by the server",Zt=class extends L{constructor(r,n,i){super(n||Ai,M(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};E(Zt,"BadRequestError");var Xt=class extends L{constructor(r,n){super("Engine not started: healthcheck timeout",M(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};E(Xt,"HealthcheckTimeoutError");var er=class extends L{constructor(r,n,i){super(n,M(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};E(er,"EngineStartupError");var tr=class extends L{constructor(r){super("Engine version is not supported",M(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};E(tr,"EngineVersionNotSupportedError");var Ri="Request timed out",rr=class extends L{constructor(r,n=Ri){super(n,M(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};E(rr,"GatewayTimeoutError");var jp="Interactive transaction error",nr=class extends L{constructor(r,n=jp){super(n,M(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};E(nr,"InteractiveTransactionError");var Bp="Request parameters are invalid",ir=class extends L{constructor(r,n=Bp){super(n,M(r,!1));this.name="InvalidRequestError";this.code="P5011"}};E(ir,"InvalidRequestError");var Mi="Requested resource does not exist",or=class extends L{constructor(r,n=Mi){super(n,M(r,!1));this.name="NotFoundError";this.code="P5003"}};E(or,"NotFoundError");var Si="Unknown server error",Tt=class extends L{constructor(r,n,i){super(n||Si,M(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};E(Tt,"ServerError");var Ii="Unauthorized, check your connection string",sr=class extends L{constructor(r,n=Ii){super(n,M(r,!1));this.name="UnauthorizedError";this.code="P5007"}};E(sr,"UnauthorizedError");var Fi="Usage exceeded, retry again later",ar=class extends L{constructor(r,n=Fi){super(n,M(r,!0));this.name="UsageExceededError";this.code="P5008"}};E(ar,"UsageExceededError");async function Up(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function lr(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Up(e);if(n.type==="QueryEngineError")throw new U(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Tt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Ze(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new tr(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new er(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new k(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Xt(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new nr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new ir(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new sr(r,Ct(Ii,n));if(e.status===404)return new or(r,Ct(Mi,n));if(e.status===429)throw new ar(r,Ct(Fi,n));if(e.status===504)throw new rr(r,Ct(Ri,n));if(e.status>=500)throw new Tt(r,Ct(Si,n));if(e.status>=400)throw new Zt(r,Ct(Ai,n))}function Ct(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function Ca(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}function Aa(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new k("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}var Ra={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*","@swc/core":"1.3.75","@swc/jest":"0.2.29","@types/jest":"29.5.4","@types/node":"18.17.12",execa:"5.1.1",jest:"29.6.4",typescript:"5.2.2"};var ur=class extends ae{constructor(r,n){super(`Cannot fetch data from service: -${r}`,M(n,!0));this.name="RequestError";this.code="P5010"}};E(ur,"RequestError");async function Xe(e,t,r=n=>n){let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(ki)(e,t)}catch(i){console.log(e);let o=i.message??"Unknown error";throw new ur(o,{clientVersion:n})}}function Qp(e){return{...e.headers,"Content-Type":"application/json"}}function Jp(e){return{method:e.method,headers:Qp(e)}}function Gp(e,t){return{text:()=>Promise.resolve(Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Oi(t.headers)}}async function ki(e,t={}){let r=Hp("https"),n=Jp(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{let l=r.request(e,n,u=>{let{statusCode:c,headers:{location:p}}=u;c>=301&&c<=399&&p&&(p.startsWith("http")===!1?s(ki(`${o}${p}`,t)):s(ki(p,t))),u.on("data",d=>i.push(d)),u.on("end",()=>s(Gp(i,u))),u.on("error",a)});l.on("error",a),l.end(t.body??"")})}var Hp=typeof require<"u"?require:()=>{},Oi=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){return this.headers.get(t)??null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Wp=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Ma=D("prisma:client:dataproxyEngine");async function zp(e,t){let r=Ra["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Wp.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=Yp(`<=${a}.${l}.${u}`),p=await Xe(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||""}`);let d=await p.text();Ma("length of body fetched from unpkg.com",d.length);let f;try{f=JSON.parse(d)}catch(y){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),y}return f.version}throw new Ye("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Sa(e,t){let r=await zp(e,t);return Ma("version",r),r}function Yp(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Ia=3,Di=D("prisma:client:dataproxyEngine"),_i=class{constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},cr=class extends Pt{constructor(r){super();Aa(r),this.config=r,this.env={...this.config.env,...process.env},this.inlineSchema=r.inlineSchema??"",this.inlineDatasources=r.inlineDatasources??{},this.inlineSchemaHash=r.inlineSchemaHash??"",this.clientVersion=r.clientVersion??"unknown",this.logEmitter=r.logEmitter,this.tracingHelper=this.config.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return"unknown"}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[r,n]=this.extractHostAndApiKey();this.host=r,this.headerBuilder=new _i({apiKey:n,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries}),this.remoteClientVersion=await Sa(r,this.config),Di("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){r?.logs?.length&&r.logs.forEach(n=>{switch(n.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let i=typeof n.attributes.query=="string"?n.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[o]=i.split("/* traceparent");i=o}this.logEmitter.emit("query",{query:i,timestamp:n.timestamp,duration:n.attributes.duration_ms,params:n.attributes.params,target:n.attributes.target})}}}),r?.traces?.length&&this.tracingHelper.createEngineSpan({span:!0,spans:r.traces})}on(r,n){if(r==="beforeExit")throw new Error('"beforeExit" hook is not applicable to the remote query engine');this.logEmitter.on(r,n)}async url(r){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async uploadSchema(){let r={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(r,async()=>{let n=await Xe(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});n.ok||Di("schema response status",n.status);let i=await lr(n,this.clientVersion);if(i)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${i.message}`}),i;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`})})}request(r,{traceparent:n,interactiveTransaction:i,customDataProxyFetch:o}){return this.requestInternal({body:r,traceparent:n,interactiveTransaction:i,customDataProxyFetch:o})}async requestBatch(r,{traceparent:n,transaction:i,customDataProxyFetch:o}){let s=i?.kind==="itx"?i.options:void 0,a=ln(r,i),{batchResult:l,elapsed:u}=await this.requestInternal({body:a,customDataProxyFetch:o,interactiveTransaction:s,traceparent:n});return l.map(c=>"errors"in c&&c.errors.length>0?zt(c.errors[0],this.clientVersion):{data:c,elapsed:u})}requestInternal({body:r,traceparent:n,customDataProxyFetch:i,interactiveTransaction:o}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:s})=>{let a=o?`${o.payload.endpoint}/graphql`:await this.url("graphql");s(a);let l=await Xe(a,{method:"POST",headers:this.headerBuilder.build({traceparent:n,interactiveTransaction:o}),body:JSON.stringify(r),clientVersion:this.clientVersion},i);l.ok||Di("graphql response status",l.status),await this.handleError(await lr(l,this.clientVersion));let u=await l.json(),c=u.extensions;if(c&&this.propagateResponseExtensions(c),u.errors)throw u.errors.length===1?zt(u.errors[0],this.config.clientVersion):new K(u.errors,{clientVersion:this.config.clientVersion});return u}})}async transaction(r,n,i){let o={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${o[r]} transaction`,callback:async({logHttpCall:s})=>{if(r==="start"){let a=JSON.stringify({max_wait:i?.maxWait??2e3,timeout:i?.timeout??5e3,isolation_level:i?.isolationLevel}),l=await this.url("transaction/start");s(l);let u=await Xe(l,{method:"POST",headers:this.headerBuilder.build({traceparent:n.traceparent}),body:a,clientVersion:this.clientVersion});await this.handleError(await lr(u,this.clientVersion));let c=await u.json(),p=c.extensions;p&&this.propagateResponseExtensions(p);let d=c.id,f=c["data-proxy"].endpoint;return{id:d,payload:{endpoint:f}}}else{let a=`${i.payload.endpoint}/${r}`;s(a);let l=await Xe(a,{method:"POST",headers:this.headerBuilder.build({traceparent:n.traceparent}),clientVersion:this.clientVersion});await this.handleError(await lr(l,this.clientVersion));let c=(await l.json()).extensions;c&&this.propagateResponseExtensions(c);return}}})}extractHostAndApiKey(){let r={clientVersion:this.clientVersion},n=Object.keys(this.inlineDatasources)[0],i=un({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),o;try{o=new URL(i)}catch{throw new ze(`Error validating datasource \`${n}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:s,host:a,searchParams:l}=o;if(s!=="prisma:")throw new ze(`Error validating datasource \`${n}\`: the URL must start with the protocol \`prisma://\``,r);let u=l.get("api_key");if(u===null||u.length<1)throw new ze(`Error validating datasource \`${n}\`: the URL must contain a valid API key`,r);return[a,u]}metrics(){throw new Ye("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){for(let n=0;;n++){let i=o=>{this.logEmitter.emit("info",{message:`Calling ${o} (n=${n})`})};try{return await r.callback({logHttpCall:i})}catch(o){if(!(o instanceof ae)||!o.isRetryable)throw o;if(n>=Ia)throw o instanceof vt?o.cause:o;this.logEmitter.emit("warn",{message:`Attempt ${n+1}/${Ia} failed for ${r.actionGerund}: ${o.message??"(unknown)"}`});let s=await Ca(n);this.logEmitter.emit("warn",{message:`Retrying after ${s}ms`})}}}async handleError(r){if(r instanceof Ze)throw await this.uploadSchema(),new vt({clientVersion:this.clientVersion,cause:r});if(r)throw r}};var _a=S(require("fs"));function Fa(e){if(e?.kind==="itx")return e.options.id}var Li=S(require("os")),ka=S(require("path"));var Ni=Symbol("PrismaLibraryEngineCache");function Zp(){let e=globalThis;return e[Ni]===void 0&&(e[Ni]={}),e[Ni]}function Xp(e){let t=Zp();if(t[e]!==void 0)return t[e];let r=ka.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=Li.default.constants.dlopen.RTLD_LAZY|Li.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,r,i),t[e]=n.exports,n.exports}var pn=class{constructor(t){this.config=t}async loadLibrary(){let t=await Bn(),r=await xa("library",this.config);try{return this.config.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>Xp(r))}catch(n){let i=Yn({e:n,platformInfo:t,id:r});throw new k(i,this.config.clientVersion)}}};var Me=D("prisma:client:libraryEngine");function ed(e){return e.item_type==="query"&&"query"in e}function td(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var Oa=[...Un,"native"],Da=0,pr=class extends Pt{constructor(r,n=new pn(r)){super();try{this.datamodel=_a.default.readFileSync(r.datamodelPath,"utf-8")}catch(s){throw s.stack.match(/\/\.next|\/next@|\/next\//)?new k(`Your schema.prisma could not be found, and we detected that you are using Next.js. -Find out why and learn how to fix this: https://pris.ly/d/schema-not-found-nextjs`,r.clientVersion):r.isBundled===!0?new k("Prisma Client could not find its `schema.prisma`. This is likely caused by a bundling step, which leads to `schema.prisma` not being copied near the resulting bundle. We would appreciate if you could take the time to share some information with us.\nPlease help us by answering a few questions: https://pris.ly/bundler-investigation-error",r.clientVersion):s}this.config=r,this.libraryStarted=!1,this.logQueries=r.logQueries??!1,this.logLevel=r.logLevel??"error",this.libraryLoader=n,this.logEmitter=r.logEmitter,r.enableDebugLogs&&(this.logLevel="debug");let i=Object.keys(r.overrideDatasources)[0],o=r.overrideDatasources[i]?.url;i!==void 0&&o!==void 0&&(this.datasourceOverrides={[i]:o}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){Da===10&&console.warn(`${he("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async transaction(r,n,i){await this.start();let o=JSON.stringify(n),s;if(r==="start"){let l=JSON.stringify({max_wait:i?.maxWait??2e3,timeout:i?.timeout??5e3,isolation_level:i?.isolationLevel});s=await this.engine?.startTransaction(l,o)}else r==="commit"?s=await this.engine?.commitTransaction(i.id,o):r==="rollback"&&(s=await this.engine?.rollbackTransaction(i.id,o));let a=this.parseEngineResponse(s);if(a.error_code)throw new U(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta});return a}async instantiateLibrary(){if(Me("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;_n(),this.platform=await this.getPlatform(),await this.loadEngine(),this.version()}async getPlatform(){if(this.platform)return this.platform;let r=await lt();if(!Oa.includes(r))throw new k(`Unknown ${me("PRISMA_QUERY_ENGINE_LIBRARY")} ${me(ne(r))}. Possible binaryTargets: ${Qe(Oa.join(", "))} or a path to the query engine library. -You may have to run ${Qe("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}parseEngineResponse(r){if(!r)throw new K("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new K("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(),this.QueryEngineConstructor=this.library.QueryEngine);try{let r=new WeakRef(this);this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{r.deref()?.logger(n)}),Da++}catch(r){let n=r,i=this.parseInitError(n.message);throw typeof i=="string"?n:new k(i.message,this.config.clientVersion,i.error_code)}}}logger(r){let n=this.parseEngineResponse(r);if(n){if("span"in n){this.config.tracingHelper.createEngineSpan(n);return}n.level=n?.level.toLowerCase()??"unknown",ed(n)?this.logEmitter.emit("query",{timestamp:new Date,query:n.query,params:n.params,duration:Number(n.duration_ms),target:n.module_path}):td(n)?this.loggerRustPanic=new ue(this.getErrorMessageWithLink(`${n.message}: ${n.reason} in ${n.file}:${n.line}:${n.column}`),this.config.clientVersion):this.logEmitter.emit(n.level,{timestamp:new Date,message:n.message,target:n.module_path})}}getErrorMessageWithLink(r){return Ta({platform:this.platform,title:r,version:this.config.clientVersion,engineVersion:this.versionInfo?.commit,database:this.config.activeProvider,query:this.lastQuery})}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}on(r,n){if(r==="beforeExit")throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.');this.logEmitter.on(r,n)}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Me(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{Me("library starting");try{let n={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(n)),this.libraryStarted=!0,Me("library started")}catch(n){let i=this.parseInitError(n.message);throw typeof i=="string"?n:new k(i.message,this.config.clientVersion,i.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Me("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(i=>setTimeout(i,5)),Me("library stopping");let n={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(n)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Me("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",r),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(r){return this.library?.debugPanic(r)}async request(r,{traceparent:n,interactiveTransaction:i}){Me(`sending request, this.libraryStarted: ${this.libraryStarted}`);let o=JSON.stringify({traceparent:n}),s=JSON.stringify(r);try{await this.start(),this.executingQueryPromise=this.engine?.query(s,o,i?.id),this.lastQuery=s;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0]):new K(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a,elapsed:0}}catch(a){if(a instanceof k)throw a;if(a.code==="GenericFailure"&&a.message?.startsWith("PANIC:"))throw new ue(this.getErrorMessageWithLink(a.message),this.config.clientVersion);let l=this.parseRequestError(a.message);throw typeof l=="string"?a:new K(`${l.message} -${l.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:n,traceparent:i}){Me("requestBatch");let o=ln(r,n);await this.start(),this.lastQuery=JSON.stringify(o),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:i}),Fa(n));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0]):new K(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:l,errors:u}=a;if(Array.isArray(l))return l.map(c=>c.errors&&c.errors.length>0?this.loggerRustPanic??this.buildQueryError(c.errors[0]):{data:c,elapsed:0});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(r){return r.user_facing_error.is_panic?new ue(this.getErrorMessageWithLink(r.user_facing_error.message),this.config.clientVersion):zt(r,this.config.clientVersion)}async metrics(r){await this.start();let n=await this.engine.metrics(JSON.stringify(r));return r.format==="prometheus"?n:this.parseEngineResponse(n)}};function Na(e,t){let r;try{r=un({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}e.noEngine!==!0&&r?.startsWith("prisma://")&&Lt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Gn(t.generator);if(r?.startsWith("prisma://")||e.noEngine)return new cr(t);if(n==="library")return new pr(t);throw"binary",new X("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}var Ba=S($i());function Va(e,t){let r=ja(e),n=rd(r),i=id(n);i?dn(i,t):t.addErrorMessage(()=>"Unknown error")}function ja(e){return e.errors.flatMap(t=>t.kind==="Union"?ja(t):[t])}function rd(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:nd(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function nd(e,t){return[...new Set(e.concat(t))]}function id(e){return si(e,(t,r)=>{let n=$a(t),i=$a(r);return n!==i?n-i:qa(t)-qa(r)})}function $a(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function qa(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var Se=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};var mn=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(xt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function dn(e,t){switch(e.kind){case"IncludeAndSelect":od(e,t);break;case"IncludeOnScalar":sd(e,t);break;case"EmptySelection":ad(e,t);break;case"UnknownSelectionField":ld(e,t);break;case"UnknownArgument":ud(e,t);break;case"UnknownInputField":cd(e,t);break;case"RequiredArgumentMissing":pd(e,t);break;case"InvalidArgumentType":dd(e,t);break;case"InvalidArgumentValue":md(e,t);break;case"ValueTooLarge":fd(e,t);break;case"SomeFieldsMissing":gd(e,t);break;case"TooManyFieldsGiven":yd(e,t);break;case"Union":Va(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function od(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath);r&&r instanceof Q&&(r.getField("include")?.markAsError(),r.getField("select")?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green("`include`")} or ${n.green("`select`")}, but ${n.red("not both")} at the same time.`)}function sd(e,t){let[r,n]=fn(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new Se(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${dr(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function ad(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Qa(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${dr(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function ld(e,t){let[r,n]=fn(e.selectionPath),i=t.arguments.getDeepSelectionParent(r);i&&(i.value.getField(n)?.markAsError(),Qa(i.value,e.outputType)),t.addErrorMessage(o=>{let s=[`Unknown field ${o.red(`\`${n}\``)}`];return i&&s.push(`for ${o.bold(i.kind)} statement`),s.push(`on model ${o.bold(`\`${e.outputType.name}\``)}.`),s.push(dr(o)),s.join(" ")})}function ud(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof Q&&(n.getField(r)?.markAsError(),hd(n,e.arguments)),t.addErrorMessage(i=>Ua(i,r,e.arguments.map(o=>o.name)))}function cd(e,t){let[r,n]=fn(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(i instanceof Q){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r);o instanceof Q&&Ja(o,e.inputType)}t.addErrorMessage(o=>Ua(o,n,e.inputType.fields.map(s=>s.name)))}function Ua(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=bd(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(dr(e)),n.join(" ")}function pd(e,t){let r;t.addErrorMessage(l=>r?.value instanceof J&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(!(n instanceof Q))return;let[i,o]=fn(e.argumentPath),s=new mn,a=n.getDeepFieldValue(i);if(a instanceof Q)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new Se(o,s).makeRequired())}else{let l=e.inputTypes.map(Ka).join(" | ");a.addSuggestion(new Se(o,l).makeRequired())}}function Ka(e){return e.kind==="list"?`${Ka(e.elementType)}[]`:e.name}function dd(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof Q&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=gn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function md(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath);n instanceof Q&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=gn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function fd(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath),i;if(n instanceof Q){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof J&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function gd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath);if(n instanceof Q){let i=n.getDeepFieldValue(e.argumentPath);i instanceof Q&&Ja(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${gn("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(dr(i)),o.join(" ")})}function yd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath),i=[];if(n instanceof Q){let o=n.getDeepFieldValue(e.argumentPath);o instanceof Q&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${gn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Qa(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Se(r.name,"true"))}function hd(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new Se(r.name,r.typeNames.join(" | ")))}function Ja(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Se(r.name,r.typeNames.join(" | ")))}function fn(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function dr({green:e}){return`Available options are listed in ${e("green")}.`}function gn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var xd=3;function bd(e,t){let r=1/0,n;for(let i of t){let o=(0,Ba.default)(e,i);o>xd||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.model?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};var za=e=>({command:e});var Ya=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function mr(e){try{return Za(e,"fast")}catch{return Za(e,"slow")}}function Za(e,t){return JSON.stringify(e.map(r=>Md(r,t)))}function Md(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:mt(e)?{prisma__type:"date",prisma__value:e.toJSON()}:we.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Sd(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?el(e):e}function Sd(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function el(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Xa);let t={};for(let r of Object.keys(e))t[r]=Xa(e[r]);return t}function Xa(e){return typeof e=="bigint"?e.toString():el(e)}var Id=/^(\s*alter\s)/i,tl=D("prisma:client");function ji(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Id.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Bi=(e,t)=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:mr(s||[]),__prismaRawParameters__:!0}}else switch(e){case"sqlite":case"mysql":{n=r.sql,i={values:mr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":{n=r.text,i={values:mr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Ya(r),i={values:mr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${e} provider does not support ${t}`)}return i?.values?tl(`prisma.${t}(${n}, ${i.values})`):tl(`prisma.${t}(${n})`),{query:n,parameters:i}},rl={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new oe(t,r)}},nl={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Ui(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??(n=il(r(o))):il(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function il(e){return typeof e.then=="function"?e:Promise.resolve(e)}var ol={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Ki=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??ol}};function sl(e){return e.includes("tracing")?new Ki:ol}function al(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function ll(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}var Fd=["$connect","$disconnect","$on","$transaction","$use","$extends"],ul=Fd;var hn=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var pl=S(ni());function xn(e){return typeof e.batchRequestIdx=="number"}function bn(e){return e===null?e:Array.isArray(e)?e.map(bn):typeof e=="object"?kd(e)?Od(e):ct(e,bn):e}function kd(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Od({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new we(t);case"Json":return JSON.parse(t);default:Ge(t,"Unknown tagged value")}}function cl(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Qi(e.query.arguments)),t.push(Qi(e.query.selection)),t.join("")}function Qi(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Qi(n)})`:r}).join(" ")})`}var Dd={aggregate:!1,aggregateRaw:!1,createMany:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Ji(e){return Dd[e]}var En=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>Ji(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Nd(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?dl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Ji(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:cl(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return process.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o}){if(_d(t),Ld(t,i)||t instanceof Ce)throw t;if(t instanceof U&&$d(t)){let a=ml(t.meta);yn({args:o,errors:[a],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let s=t.message;throw n&&(s=wt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:s})),s=this.sanitizeMessage(s),t.code?new U(s,{code:t.code,clientVersion:this.client._clientVersion,meta:t.meta,batchRequestIdx:t.batchRequestIdx}):t.isPanic?new ue(s,this.client._clientVersion):t instanceof K?new K(s,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx}):t instanceof k?new k(s,this.client._clientVersion):t instanceof ue?new ue(s,this.client._clientVersion):(t.clientVersion=this.client._clientVersion,t)}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,pl.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=bn(wi(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function Nd(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:dl(e)};Ge(e,"Unknown transaction kind")}}function dl(e){return{id:e.id,payload:e.payload}}function Ld(e,t){return xn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function $d(e){return e.code==="P2009"||e.code==="P2012"}function ml(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(ml)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var fl="5.3.1";var gl=fl;function yl(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=hl(t[n]);return r})}function hl({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return Buffer.from(t,"base64");case"decimal":return new we(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(hl);default:return t}}var wl=S($i());var V=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};E(V,"PrismaClientConstructorValidationError");var xl=["datasources","datasourceUrl","errorFormat","log","__internal"],bl=["pretty","colorless","minimal"],El=["info","query","warn","error"],Vd={datasources:(e,t)=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new V(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=At(r,t)||` Available datasources: ${t.join(", ")}`;throw new V(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new V(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new V(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new V(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new V(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new V(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!bl.includes(e)){let t=At(e,bl);throw new V(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new V(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!El.includes(r)){let n=At(r,El);throw new V(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=At(i,o);throw new V(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new V(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},__internal:e=>{if(!e)return;let t=["debug","hooks","engine","measurePerformance"];if(typeof e!="object")throw new V(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=At(r,t);throw new V(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Pl(e,t){for(let[r,n]of Object.entries(e)){if(!xl.includes(r)){let i=At(r,xl);throw new V(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Vd[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new V('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function At(e,t){if(t.length===0||typeof e!="string")return"";let r=jd(e,t);return r?` Did you mean "${r}"?`:""}function jd(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,wl.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=c,a()},c=>{if(!xn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Be=D("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Bd={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Ud=Symbol.for("prisma.client.transaction.id"),Kd={id:0,nextId(){return++this.id}};function Ml(e){class t{constructor(n){this._middlewares=new hn;this._createPrismaPromise=Ui();this.$extends=Ws;pa(e),n&&Pl(n,e.datasourceNames);let i=new Al.EventEmitter().on("error",()=>{});this._extensions=on.empty(),this._previewFeatures=e.generator?.previewFeatures??[],this._clientVersion=e.clientVersion??gl,this._activeProvider=e.activeProvider,this._tracingHelper=sl(this._previewFeatures);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&fr.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&fr.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s=Ot(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let a=n??{},l=a.__internal??{},u=l.debug===!0;u&&D.enable("prisma:client");let c=fr.default.resolve(e.dirname,e.relativePath);Rl.default.existsSync(c)||(c=e.dirname),Be("dirname",e.dirname),Be("relativePath",e.relativePath),Be("cwd",c);let p=l.engine||{};if(a.errorFormat?this._errorFormat=a.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:c,dirname:e.dirname,enableDebugLogs:u,allowTriggerPanic:p.allowTriggerPanic,datamodelPath:fr.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:p.binaryPath??void 0,engineEndpoint:p.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:a.log&&ll(a.log),logQueries:a.log&&!!(typeof a.log=="string"?a.log==="query":a.log.find(d=>typeof d=="string"?d==="query":d.level==="query")),env:s?.parsed??{},flags:[],clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:da(a,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,logEmitter:i,isBundled:e.isBundled},Be("clientVersion",e.clientVersion),this._engine=Na(e,this._engineConfig),this._requestHandler=new wn(this,i),a.log)for(let d of a.log){let f=typeof d=="string"?d:d.emit==="stdout"?d.level:null;f&&this.$on(f,y=>{Nt.log(`${Nt.tags[f]??""}`,y.message||y.query)})}this._metrics=new pt(this._engine)}catch(a){throw a.clientVersion=this._clientVersion,a}return this._appliedParent=Ht(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.on("beforeExit",i):this._engine.on(n,o=>{let s=o.fields;return i(n==="query"?{timestamp:o.timestamp,query:s?.query??o.query,params:s?.params??o.params,duration:s?.duration_ms??o.duration,target:o.target}:{timestamp:o.timestamp,message:s?.message??o.message,target:o.target})})}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{fo()}}$executeRawInternal(n,i,o,s){return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Bi(this._activeProvider,i),callsite:qe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Tl(n,i);return ji(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new X("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(ji(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new X(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:za,callsite:qe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Bi(this._activeProvider,i),callsite:qe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(yl)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Tl(n,i));throw new X("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Kd.nextId(),s=al(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return vl(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s=await this._engine.transaction("start",o,i),a;try{let l={kind:"itx",...s};a=await n(this._createItxClient(l)),await this._engine.transaction("commit",o,s)}catch(l){throw await this._engine.transaction("rollback",o,s).catch(()=>{}),l}return a}_createItxClient(n){return Ht(be(tn(this),[re("_appliedParent",()=>this._appliedParent._createItxClient(n)),re("_createPrismaPromise",()=>Ui(n)),re(Ud,()=>n.id),Vt(ul)]))}$transaction(n,i){let o;typeof n=="function"?o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Bd,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,P=>c(u,T=>(P?.end(),l(T))));let{runInTransaction:p,args:d,...f}=u,y={...n,...f};d&&(y.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete y.transaction;let g=await ra(this,y);return y.model?Zs({result:g,modelName:y.model,args:y.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):g};return this._tracingHelper.runInChildSpan(s.operation,()=>new Cl.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:f}){try{n=u?u(n):n;let y={name:"serialize"},g=this._tracingHelper.runInChildSpan(y,()=>Ga({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion}));return D.enabled("prisma:client")&&(Be("Prisma Client call:"),Be(`prisma.${i}(${Fs(n)})`),Be("Generated request:"),Be(JSON.stringify(g,null,2)+` -`)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:g,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:f})}catch(y){throw y.clientVersion=this._clientVersion,y}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new X("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}}return t}function Tl(e,t){return Qd(e)?[new oe(e,t),rl]:[e,nl]}function Qd(e){return Array.isArray(e)&&Array.isArray(e.raw)}var Jd=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Sl(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Jd.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function Il(e){Ot(e,{conflictCheck:"warn"})}0&&(module.exports={DMMF,DMMFClass,Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,Types,defineDmmfProperty,empty,getPrismaClient,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -/*! Bundled license information: - -decimal.js/decimal.mjs: - (*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - *) -*/ -//# sourceMappingURL=library.js.map diff --git a/chase/backend/prisma/generated/client/schema.prisma b/chase/backend/prisma/generated/client/schema.prisma deleted file mode 100644 index afc60c52..00000000 --- a/chase/backend/prisma/generated/client/schema.prisma +++ /dev/null @@ -1,36 +0,0 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -generator client { - provider = "prisma-client-js" - output = "./generated/client" -} - -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} - -/// A conference entity -model Conference { - id String @id @default(uuid()) - name String @unique - committees Committee[] - start DateTime? - end DateTime? -} - -/// Consumeable token which grants the creation of a conference -model ConferenceCreateToken { - token String @id -} - -model Committee { - id String @id @default(uuid()) - name String - abbreviation String - conference Conference @relation(fields: [conferenceId], references: [id]) - conferenceId String - - @@unique([name, conferenceId]) -} diff --git a/chase/backend/prisma/migrations/20230920131652_/migration.sql b/chase/backend/prisma/migrations/20230920131652_/migration.sql deleted file mode 100644 index 278d84e3..00000000 --- a/chase/backend/prisma/migrations/20230920131652_/migration.sql +++ /dev/null @@ -1,35 +0,0 @@ --- CreateTable -CREATE TABLE "Conference" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "start" TIMESTAMP(3), - "end" TIMESTAMP(3), - - CONSTRAINT "Conference_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "ConferenceCreateToken" ( - "token" TEXT NOT NULL, - - CONSTRAINT "ConferenceCreateToken_pkey" PRIMARY KEY ("token") -); - --- CreateTable -CREATE TABLE "Committee" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "abbreviation" TEXT NOT NULL, - "conferenceId" TEXT NOT NULL, - - CONSTRAINT "Committee_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE UNIQUE INDEX "Conference_name_key" ON "Conference"("name"); - --- CreateIndex -CREATE UNIQUE INDEX "Committee_name_conferenceId_key" ON "Committee"("name", "conferenceId"); - --- AddForeignKey -ALTER TABLE "Committee" ADD CONSTRAINT "Committee_conferenceId_fkey" FOREIGN KEY ("conferenceId") REFERENCES "Conference"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/chase/backend/prisma/migrations/20240226214030_/migration.sql b/chase/backend/prisma/migrations/20240226214030_/migration.sql new file mode 100644 index 00000000..9112aa7d --- /dev/null +++ b/chase/backend/prisma/migrations/20240226214030_/migration.sql @@ -0,0 +1,290 @@ +-- CreateEnum +CREATE TYPE "ConferenceRole" AS ENUM ('ADMIN', 'SECRETARIAT', 'CHAIR', 'COMMITTEE_ADVISOR', 'NON_STATE_ACTOR', 'PRESS_CORPS', 'GUEST', 'PARTICIPANT_CARE', 'MISCELLANEOUS_TEAM'); + +-- CreateEnum +CREATE TYPE "CommitteeCategory" AS ENUM ('COMMITTEE', 'CRISIS', 'ICJ'); + +-- CreateEnum +CREATE TYPE "CommitteeStatus" AS ENUM ('FORMAL', 'INFORMAL', 'PAUSE', 'SUSPENSION', 'CLOSED'); + +-- CreateEnum +CREATE TYPE "Presence" AS ENUM ('PRESENT', 'EXCUSED', 'ABSENT'); + +-- CreateEnum +CREATE TYPE "SpeakersListCategory" AS ENUM ('SPEAKERS_LIST', 'COMMENT_LIST', 'MODERATED_CAUCUS'); + +-- CreateEnum +CREATE TYPE "NationVariant" AS ENUM ('NATION', 'NON_STATE_ACTOR', 'SPECIAL_PERSON'); + +-- CreateEnum +CREATE TYPE "MessageCategory" AS ENUM ('TO_CHAIR', 'GUEST_SPEAKER', 'FACT_CHECK', 'INFORMATION', 'GENERAL_SECRETARY', 'OTHER'); + +-- CreateEnum +CREATE TYPE "MessageStatus" AS ENUM ('UNREAD', 'READ', 'PRIORITY', 'ASSIGNED', 'ARCHIVED'); + +-- CreateTable +CREATE TABLE "Password" ( + "id" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "passwordHash" TEXT NOT NULL, + + CONSTRAINT "Password_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Token" ( + "id" TEXT NOT NULL, + "tokenHash" TEXT NOT NULL, + "expiresAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Token_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "PendingCredentialCreateTask" ( + "id" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "tokenId" TEXT NOT NULL, + + CONSTRAINT "PendingCredentialCreateTask_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Email" ( + "email" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "validated" BOOLEAN NOT NULL DEFAULT false, + "validationTokenId" TEXT, + + CONSTRAINT "Email_pkey" PRIMARY KEY ("email") +); + +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ConferenceCreateToken" ( + "token" TEXT NOT NULL, + + CONSTRAINT "ConferenceCreateToken_pkey" PRIMARY KEY ("token") +); + +-- CreateTable +CREATE TABLE "Conference" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "start" TIMESTAMP(3), + "end" TIMESTAMP(3), + + CONSTRAINT "Conference_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ConferenceMember" ( + "id" TEXT NOT NULL, + "conferenceId" TEXT NOT NULL, + "userId" TEXT, + "role" "ConferenceRole" NOT NULL, + + CONSTRAINT "ConferenceMember_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Committee" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "abbreviation" TEXT NOT NULL, + "category" "CommitteeCategory" NOT NULL, + "conferenceId" TEXT NOT NULL, + "parentId" TEXT, + "whiteboardContent" TEXT NOT NULL DEFAULT '

Hello, World

', + "status" "CommitteeStatus" NOT NULL DEFAULT 'CLOSED', + "stateOfDebate" TEXT, + "statusHeadline" TEXT, + "statusUntil" TIMESTAMP(3), + "allowDelegationsToAddThemselvesToSpeakersList" BOOLEAN NOT NULL DEFAULT false, + + CONSTRAINT "Committee_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "CommitteeMember" ( + "id" TEXT NOT NULL, + "committeeId" TEXT NOT NULL, + "userId" TEXT, + "delegationId" TEXT, + "presence" "Presence" NOT NULL DEFAULT 'ABSENT', + + CONSTRAINT "CommitteeMember_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "AgendaItem" ( + "id" TEXT NOT NULL, + "committeeId" TEXT NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT, + "isActive" BOOLEAN NOT NULL DEFAULT false, + + CONSTRAINT "AgendaItem_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "SpeakersList" ( + "id" TEXT NOT NULL, + "agendaItemId" TEXT NOT NULL, + "type" "SpeakersListCategory" NOT NULL, + "speakingTime" INTEGER NOT NULL, + "timeLeft" INTEGER, + "startTimestamp" TIMESTAMP(3), + "isClosed" BOOLEAN NOT NULL DEFAULT false, + + CONSTRAINT "SpeakersList_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "SpeakerOnList" ( + "id" TEXT NOT NULL, + "speakersListId" TEXT NOT NULL, + "committeeMemberId" TEXT NOT NULL, + "position" INTEGER NOT NULL, + + CONSTRAINT "SpeakerOnList_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Delegation" ( + "id" TEXT NOT NULL, + "conferenceId" TEXT NOT NULL, + "nationId" TEXT NOT NULL, + + CONSTRAINT "Delegation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Nation" ( + "id" TEXT NOT NULL, + "alpha3Code" TEXT NOT NULL, + "variant" "NationVariant" NOT NULL DEFAULT 'NATION', + + CONSTRAINT "Nation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Message" ( + "id" TEXT NOT NULL, + "subject" TEXT NOT NULL, + "category" "MessageCategory" NOT NULL DEFAULT 'TO_CHAIR', + "message" TEXT NOT NULL, + "committeeId" TEXT NOT NULL, + "authorId" TEXT NOT NULL, + "timestamp" TIMESTAMP(3) NOT NULL, + "status" "MessageStatus"[] DEFAULT ARRAY['UNREAD']::"MessageStatus"[], + "metaEmail" TEXT, + "metaDelegation" TEXT, + "metaCommittee" TEXT, + "metaAgendaItem" TEXT, + + CONSTRAINT "Message_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Email_userId_email_key" ON "Email"("userId", "email"); + +-- CreateIndex +CREATE UNIQUE INDEX "Conference_name_key" ON "Conference"("name"); + +-- CreateIndex +CREATE UNIQUE INDEX "ConferenceMember_userId_conferenceId_key" ON "ConferenceMember"("userId", "conferenceId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Committee_name_conferenceId_key" ON "Committee"("name", "conferenceId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Committee_abbreviation_conferenceId_key" ON "Committee"("abbreviation", "conferenceId"); + +-- CreateIndex +CREATE UNIQUE INDEX "CommitteeMember_committeeId_delegationId_key" ON "CommitteeMember"("committeeId", "delegationId"); + +-- CreateIndex +CREATE UNIQUE INDEX "CommitteeMember_committeeId_userId_key" ON "CommitteeMember"("committeeId", "userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "SpeakersList_agendaItemId_type_key" ON "SpeakersList"("agendaItemId", "type"); + +-- CreateIndex +CREATE UNIQUE INDEX "SpeakerOnList_speakersListId_position_key" ON "SpeakerOnList"("speakersListId", "position"); + +-- CreateIndex +CREATE UNIQUE INDEX "SpeakerOnList_speakersListId_committeeMemberId_key" ON "SpeakerOnList"("speakersListId", "committeeMemberId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Delegation_conferenceId_nationId_key" ON "Delegation"("conferenceId", "nationId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Nation_alpha3Code_key" ON "Nation"("alpha3Code"); + +-- AddForeignKey +ALTER TABLE "Password" ADD CONSTRAINT "Password_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "PendingCredentialCreateTask" ADD CONSTRAINT "PendingCredentialCreateTask_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "PendingCredentialCreateTask" ADD CONSTRAINT "PendingCredentialCreateTask_tokenId_fkey" FOREIGN KEY ("tokenId") REFERENCES "Token"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Email" ADD CONSTRAINT "Email_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Email" ADD CONSTRAINT "Email_validationTokenId_fkey" FOREIGN KEY ("validationTokenId") REFERENCES "Token"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ConferenceMember" ADD CONSTRAINT "ConferenceMember_conferenceId_fkey" FOREIGN KEY ("conferenceId") REFERENCES "Conference"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ConferenceMember" ADD CONSTRAINT "ConferenceMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Committee" ADD CONSTRAINT "Committee_conferenceId_fkey" FOREIGN KEY ("conferenceId") REFERENCES "Conference"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Committee" ADD CONSTRAINT "Committee_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "Committee"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "CommitteeMember" ADD CONSTRAINT "CommitteeMember_committeeId_fkey" FOREIGN KEY ("committeeId") REFERENCES "Committee"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "CommitteeMember" ADD CONSTRAINT "CommitteeMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "CommitteeMember" ADD CONSTRAINT "CommitteeMember_delegationId_fkey" FOREIGN KEY ("delegationId") REFERENCES "Delegation"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "AgendaItem" ADD CONSTRAINT "AgendaItem_committeeId_fkey" FOREIGN KEY ("committeeId") REFERENCES "Committee"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SpeakersList" ADD CONSTRAINT "SpeakersList_agendaItemId_fkey" FOREIGN KEY ("agendaItemId") REFERENCES "AgendaItem"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SpeakerOnList" ADD CONSTRAINT "SpeakerOnList_speakersListId_fkey" FOREIGN KEY ("speakersListId") REFERENCES "SpeakersList"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SpeakerOnList" ADD CONSTRAINT "SpeakerOnList_committeeMemberId_fkey" FOREIGN KEY ("committeeMemberId") REFERENCES "CommitteeMember"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Delegation" ADD CONSTRAINT "Delegation_conferenceId_fkey" FOREIGN KEY ("conferenceId") REFERENCES "Conference"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Delegation" ADD CONSTRAINT "Delegation_nationId_fkey" FOREIGN KEY ("nationId") REFERENCES "Nation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Message" ADD CONSTRAINT "Message_committeeId_fkey" FOREIGN KEY ("committeeId") REFERENCES "Committee"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Message" ADD CONSTRAINT "Message_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/chase/backend/prisma/migrations/20240228145111_/migration.sql b/chase/backend/prisma/migrations/20240228145111_/migration.sql new file mode 100644 index 00000000..f584ae2a --- /dev/null +++ b/chase/backend/prisma/migrations/20240228145111_/migration.sql @@ -0,0 +1,16 @@ +/* + Warnings: + + - The values [READ] on the enum `MessageStatus` will be removed. If these variants are still used in the database, this will fail. + +*/ +-- AlterEnum +BEGIN; +CREATE TYPE "MessageStatus_new" AS ENUM ('UNREAD', 'PRIORITY', 'ASSIGNED', 'ARCHIVED'); +ALTER TABLE "Message" ALTER COLUMN "status" DROP DEFAULT; +ALTER TABLE "Message" ALTER COLUMN "status" TYPE "MessageStatus_new"[] USING ("status"::text::"MessageStatus_new"[]); +ALTER TYPE "MessageStatus" RENAME TO "MessageStatus_old"; +ALTER TYPE "MessageStatus_new" RENAME TO "MessageStatus"; +DROP TYPE "MessageStatus_old"; +ALTER TABLE "Message" ALTER COLUMN "status" SET DEFAULT ARRAY['UNREAD']::"MessageStatus"[]; +COMMIT; diff --git a/chase/backend/prisma/migrations/20240229180001_/migration.sql b/chase/backend/prisma/migrations/20240229180001_/migration.sql new file mode 100644 index 00000000..dd110bbf --- /dev/null +++ b/chase/backend/prisma/migrations/20240229180001_/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Message" ADD COLUMN "forwarded" BOOLEAN NOT NULL DEFAULT false; diff --git a/chase/backend/prisma/schema.prisma b/chase/backend/prisma/schema.prisma index afc60c52..f80dfcd9 100644 --- a/chase/backend/prisma/schema.prisma +++ b/chase/backend/prisma/schema.prisma @@ -11,13 +11,76 @@ datasource db { url = env("DATABASE_URL") } -/// A conference entity -model Conference { - id String @id @default(uuid()) - name String @unique - committees Committee[] - start DateTime? - end DateTime? +generator typebox { + provider = "prisma-typebox-generator" + output = "./generated/schema" +} + +// model Authenticator { +// id String @id @default(uuid()) +// user User @relation(fields: [userId], references: [id]) +// userId String + +// credentialID String @db.Text +// credentialPublicKey Bytes +// counter BigInt +// credentialDeviceType String @db.VarChar(32) +// credentialBackedUp Boolean +// transports String[] @db.VarChar(255) +// } + +// TODO a max amount would make sense + +model Password { + id String @id @default(uuid()) + user User @relation(fields: [userId], references: [id]) + userId String + passwordHash String +} + +/// A token which can be used to grant one time access to something in the app +/// e.g. confirming an email, resetting a password +model Token { + id String @id @default(uuid()) + tokenHash String + expiresAt DateTime + + pendingEmailConfirmations Email[] + pendingCredentialCreations PendingCredentialCreateTask[] +} + +model PendingCredentialCreateTask { + id String @id @default(uuid()) + + user User @relation(fields: [userId], references: [id]) + userId String + token Token @relation(fields: [tokenId], references: [id]) + tokenId String +} + +model Email { + email String @id + user User @relation(fields: [userId], references: [id]) + userId String + + validated Boolean @default(false) + validationToken Token? @relation(fields: [validationTokenId], references: [id]) + validationTokenId String? + + @@unique([userId, email]) +} + +/// A user in the system +model User { + id String @id @default(uuid()) + name String + conferenceMemberships ConferenceMember[] + committeeMemberships CommitteeMember[] + Messages Message[] + emails Email[] + passwords Password[] + // authenticators Authenticator[] + pendingCredentialCreationTasks PendingCredentialCreateTask[] } /// Consumeable token which grants the creation of a conference @@ -25,12 +88,216 @@ model ConferenceCreateToken { token String @id } -model Committee { - id String @id @default(uuid()) - name String - abbreviation String - conference Conference @relation(fields: [conferenceId], references: [id]) +/// A conference in the system +model Conference { + id String @id @default(uuid()) + name String @unique + committees Committee[] + start DateTime? + end DateTime? + delegations Delegation[] + members ConferenceMember[] +} + +/// The role of a user in a conference +enum ConferenceRole { + ADMIN + SECRETARIAT + CHAIR + COMMITTEE_ADVISOR + NON_STATE_ACTOR + PRESS_CORPS + GUEST + PARTICIPANT_CARE + MISCELLANEOUS_TEAM +} + +/// A user's membership in a conference, providing them with a role in the conference +model ConferenceMember { + id String @id @default(uuid()) + conference Conference @relation(fields: [conferenceId], references: [id]) conferenceId String + user User? @relation(fields: [userId], references: [id]) + userId String? + role ConferenceRole + + @@unique([userId, conferenceId]) +} + +/// The type of a committee in a conference +enum CommitteeCategory { + /// A standard committee + COMMITTEE + /// A crisis simulation + CRISIS + /// A International Court of Justice simulation + ICJ +} + +enum CommitteeStatus { + FORMAL + INFORMAL + PAUSE + SUSPENSION + CLOSED /// Don't display a Widget +} + +/// A committee in a conference +model Committee { + id String @id @default(uuid()) + name String + abbreviation String + category CommitteeCategory + conference Conference @relation(fields: [conferenceId], references: [id]) + conferenceId String + members CommitteeMember[] + parent Committee? @relation("subCommittee", fields: [parentId], references: [id]) + parentId String? + subCommittees Committee[] @relation("subCommittee") + messages Message[] + agendaItems AgendaItem[] + whiteboardContent String @default("

Hello, World

") + status CommitteeStatus @default(CLOSED) + stateOfDebate String? + statusHeadline String? + statusUntil DateTime? + allowDelegationsToAddThemselvesToSpeakersList Boolean @default(false) @@unique([name, conferenceId]) + @@unique([abbreviation, conferenceId]) +} + +/// The presence status of a CommitteeMember +enum Presence { + PRESENT + EXCUSED + ABSENT +} + +/// A user's membership in a committee, providing them with a role in the committee +model CommitteeMember { + id String @id @default(uuid()) + committee Committee @relation(fields: [committeeId], references: [id]) + committeeId String + user User? @relation(fields: [userId], references: [id]) + userId String? + speakerLists SpeakerOnList[] + delegation Delegation? @relation(fields: [delegationId], references: [id]) + delegationId String? + presence Presence @default(ABSENT) + + @@unique([committeeId, delegationId]) + @@unique([committeeId, userId]) +} + +/// An agenda item in a committee. This is a topic of discussion in a committee. +model AgendaItem { + id String @id @default(uuid()) + committee Committee @relation(fields: [committeeId], references: [id]) + committeeId String + title String + description String? + speakerLists SpeakersList[] + isActive Boolean @default(false) +} + +/// The type of a speakers list +enum SpeakersListCategory { + /// A standard speakers list + SPEAKERS_LIST + /// A comment list + COMMENT_LIST + /// A moderated caucus + MODERATED_CAUCUS +} + +/// A speakers list in a committee +model SpeakersList { + id String @id @default(uuid()) + agendaItem AgendaItem @relation(fields: [agendaItemId], references: [id]) + agendaItemId String + type SpeakersListCategory + speakers SpeakerOnList[] + /// The time in seconds that a speaker has to speak + speakingTime Int + timeLeft Int? + startTimestamp DateTime? + isClosed Boolean @default(false) + + @@unique([agendaItemId, type]) +} + +/// A speaker on a speakers list, storing their position in the list +model SpeakerOnList { + id String @id @default(uuid()) + speakersList SpeakersList @relation(fields: [speakersListId], references: [id]) + speakersListId String + committeeMember CommitteeMember @relation(fields: [committeeMemberId], references: [id]) + committeeMemberId String + position Int + + @@unique([speakersListId, position]) + @@unique([speakersListId, committeeMemberId]) +} + +model Delegation { + id String @id @default(uuid()) + conference Conference @relation(fields: [conferenceId], references: [id]) + conferenceId String + nation Nation @relation(fields: [nationId], references: [id]) + nationId String + members CommitteeMember[] + + @@unique([conferenceId, nationId]) +} + +enum NationVariant { + NATION + NON_STATE_ACTOR + SPECIAL_PERSON +} + +//TODO should we allow for customizing these per conference and just allow loading template at creation? +/// A nation in the system. E.g. Germany +model Nation { + id String @id @default(uuid()) + alpha3Code String @unique + variant NationVariant @default(NATION) + delegations Delegation[] +} + +enum MessageCategory { + TO_CHAIR + GUEST_SPEAKER + FACT_CHECK + INFORMATION + GENERAL_SECRETARY + OTHER +} + +enum MessageStatus { + UNREAD + PRIORITY + ASSIGNED + ARCHIVED +} + +model Message { + id String @id @default(uuid()) + subject String + category MessageCategory @default(TO_CHAIR) + message String + committee Committee @relation(fields: [committeeId], references: [id]) + committeeId String + author User @relation(fields: [authorId], references: [id]) + authorId String + timestamp DateTime + status MessageStatus[] @default([UNREAD]) + forwarded Boolean @default(false) /// If the message was forwarded to the Research Service + + /// Saved Metadata without relation + metaEmail String? + metaDelegation String? + metaCommittee String? + metaAgendaItem String? } diff --git a/chase/backend/prisma/seed.ts b/chase/backend/prisma/seed.ts new file mode 100644 index 00000000..a81b839b --- /dev/null +++ b/chase/backend/prisma/seed.ts @@ -0,0 +1,238 @@ +// import { faker } from "@faker-js/faker"; +import { $Enums, PrismaClient } from "./generated/client"; +const prisma = new PrismaClient(); + +const allCountries = [ + { alpha3Code: "afg" }, + { alpha3Code: "alb" }, + { alpha3Code: "dza" }, + { alpha3Code: "and" }, + { alpha3Code: "ago" }, + { alpha3Code: "atg" }, + { alpha3Code: "arg" }, + { alpha3Code: "arm" }, + { alpha3Code: "aus" }, + { alpha3Code: "aut" }, + { alpha3Code: "aze" }, + { alpha3Code: "bhs" }, + { alpha3Code: "bhr" }, + { alpha3Code: "bgd" }, + { alpha3Code: "brb" }, + { alpha3Code: "blr" }, + { alpha3Code: "bel" }, + { alpha3Code: "blz" }, + { alpha3Code: "ben" }, + { alpha3Code: "btn" }, + { alpha3Code: "bol" }, + { alpha3Code: "bih" }, + { alpha3Code: "bwa" }, + { alpha3Code: "bra" }, + { alpha3Code: "brn" }, + { alpha3Code: "bgr" }, + { alpha3Code: "bfa" }, + { alpha3Code: "bdi" }, + { alpha3Code: "khm" }, + { alpha3Code: "cmr" }, + { alpha3Code: "can" }, + { alpha3Code: "cpv" }, + { alpha3Code: "caf" }, + { alpha3Code: "tcd" }, + { alpha3Code: "chl" }, + { alpha3Code: "chn" }, + { alpha3Code: "col" }, + { alpha3Code: "com" }, + { alpha3Code: "cog" }, + { alpha3Code: "cod" }, + { alpha3Code: "cri" }, + { alpha3Code: "civ" }, + { alpha3Code: "hrv" }, + { alpha3Code: "cub" }, + { alpha3Code: "cyp" }, + { alpha3Code: "cze" }, + { alpha3Code: "dnk" }, + { alpha3Code: "dji" }, + { alpha3Code: "dma" }, + { alpha3Code: "dom" }, + { alpha3Code: "ecu" }, + { alpha3Code: "egy" }, + { alpha3Code: "slv" }, + { alpha3Code: "gnq" }, + { alpha3Code: "eri" }, + { alpha3Code: "est" }, + { alpha3Code: "eth" }, + { alpha3Code: "fji" }, + { alpha3Code: "fin" }, + { alpha3Code: "fra" }, + { alpha3Code: "gab" }, + { alpha3Code: "gmb" }, + { alpha3Code: "geo" }, + { alpha3Code: "deu" }, + { alpha3Code: "gha" }, + { alpha3Code: "grc" }, + { alpha3Code: "grd" }, + { alpha3Code: "gtm" }, + { alpha3Code: "gin" }, + { alpha3Code: "gnb" }, + { alpha3Code: "guy" }, + { alpha3Code: "hti" }, + { alpha3Code: "hnd" }, + { alpha3Code: "hun" }, + { alpha3Code: "isl" }, + { alpha3Code: "ind" }, + { alpha3Code: "idn" }, + { alpha3Code: "irn" }, + { alpha3Code: "irq" }, + { alpha3Code: "irl" }, + { alpha3Code: "isr" }, + { alpha3Code: "ita" }, + { alpha3Code: "jam" }, + { alpha3Code: "jpn" }, + { alpha3Code: "jor" }, + { alpha3Code: "kaz" }, + { alpha3Code: "ken" }, + { alpha3Code: "kir" }, + { alpha3Code: "prk" }, + { alpha3Code: "kor" }, + { alpha3Code: "kwt" }, + { alpha3Code: "kgz" }, + { alpha3Code: "lao" }, + { alpha3Code: "lva" }, + { alpha3Code: "lbn" }, + { alpha3Code: "lso" }, + { alpha3Code: "lbr" }, + { alpha3Code: "lby" }, + { alpha3Code: "lie" }, + { alpha3Code: "ltu" }, + { alpha3Code: "lux" }, + { alpha3Code: "mkd" }, + { alpha3Code: "mdg" }, + { alpha3Code: "mwi" }, + { alpha3Code: "mys" }, + { alpha3Code: "mdv" }, + { alpha3Code: "mli" }, + { alpha3Code: "mlt" }, + { alpha3Code: "mhl" }, + { alpha3Code: "mrt" }, + { alpha3Code: "mus" }, + { alpha3Code: "mex" }, + { alpha3Code: "fsm" }, + { alpha3Code: "mar" }, + { alpha3Code: "mda" }, + { alpha3Code: "mco" }, + { alpha3Code: "mng" }, + { alpha3Code: "mne" }, + { alpha3Code: "moz" }, + { alpha3Code: "mmr" }, + { alpha3Code: "nam" }, + { alpha3Code: "nru" }, + { alpha3Code: "npl" }, + { alpha3Code: "nld" }, + { alpha3Code: "nzl" }, + { alpha3Code: "nic" }, + { alpha3Code: "ner" }, + { alpha3Code: "nga" }, + { alpha3Code: "nor" }, + { alpha3Code: "omn" }, + { alpha3Code: "pak" }, + { alpha3Code: "plw" }, + { alpha3Code: "pan" }, + { alpha3Code: "png" }, + { alpha3Code: "pry" }, + { alpha3Code: "per" }, + { alpha3Code: "phl" }, + { alpha3Code: "pol" }, + { alpha3Code: "prt" }, + { alpha3Code: "qat" }, + { alpha3Code: "rou" }, + { alpha3Code: "rus" }, + { alpha3Code: "rwa" }, + { alpha3Code: "kna" }, + { alpha3Code: "lca" }, + { alpha3Code: "vct" }, + { alpha3Code: "wsm" }, + { alpha3Code: "smr" }, + { alpha3Code: "stp" }, + { alpha3Code: "sau" }, + { alpha3Code: "sen" }, + { alpha3Code: "srb" }, + { alpha3Code: "syc" }, + { alpha3Code: "sle" }, + { alpha3Code: "sgp" }, + { alpha3Code: "svk" }, + { alpha3Code: "svn" }, + { alpha3Code: "slb" }, + { alpha3Code: "som" }, + { alpha3Code: "zaf" }, + { alpha3Code: "ssd" }, + { alpha3Code: "esp" }, + { alpha3Code: "lka" }, + { alpha3Code: "sdn" }, + { alpha3Code: "sur" }, + { alpha3Code: "swz" }, + { alpha3Code: "swe" }, + { alpha3Code: "che" }, + { alpha3Code: "syr" }, + { alpha3Code: "tjk" }, + { alpha3Code: "tza" }, + { alpha3Code: "tha" }, + { alpha3Code: "tls" }, + { alpha3Code: "tgo" }, + { alpha3Code: "ton" }, + { alpha3Code: "tto" }, + { alpha3Code: "tun" }, + { alpha3Code: "tur" }, + { alpha3Code: "tkm" }, + { alpha3Code: "tuv" }, + { alpha3Code: "uga" }, + { alpha3Code: "ukr" }, + { alpha3Code: "are" }, + { alpha3Code: "gbr" }, + { alpha3Code: "usa" }, + { alpha3Code: "ury" }, + { alpha3Code: "uzb" }, + { alpha3Code: "vut" }, + { alpha3Code: "ven" }, + { alpha3Code: "vnm" }, + { alpha3Code: "yem" }, + { alpha3Code: "zmb" }, + { alpha3Code: "zwe" }, + + { alpha3Code: "unm", variant: $Enums.NationVariant.SPECIAL_PERSON }, // Male General Secretary + // { alpha3Code: "unw", variant: $Enums.NationVariant.SPECIAL_PERSON }, // Female General Secretary + { alpha3Code: "gsm", variant: $Enums.NationVariant.SPECIAL_PERSON }, // Male Guest Speaker + { alpha3Code: "gsw", variant: $Enums.NationVariant.SPECIAL_PERSON }, // Female Guest Speaker + { alpha3Code: "uno", variant: $Enums.NationVariant.SPECIAL_PERSON }, // MISC UN Official + + { alpha3Code: "nsa_amn", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Amnesty International + { alpha3Code: "nsa_gates", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Bill & Melinda Gates Foundation + { alpha3Code: "nsa_gnwp", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Global Network of Women Peacekeepers + { alpha3Code: "nsa_gp", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Greenpeace + { alpha3Code: "nsa_hrw", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Human Rights Watch + { alpha3Code: "nsa_iog", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // International + { alpha3Code: "nsa_icrc", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // International Red Cross + { alpha3Code: "nsa_icg", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // International Crisis Group + { alpha3Code: "nsa_ippnw", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // International Physicians for the Prevention of Nuclear War + { alpha3Code: "nsa_mercy", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Mercy Corps + { alpha3Code: "nsa_unwatch", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // UN Watch + { alpha3Code: "nsa_whh", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // Welthungerhilfe + { alpha3Code: "nsa_wef", variant: $Enums.NationVariant.NON_STATE_ACTOR }, // World Economic Forum +]; + +try { + /* + * ------------- + * Base Data + * ------------- + */ + + const countries = await prisma.nation.createMany({ + data: allCountries, + }); + console.info(`Created ${countries.count} countries as base country data`); + + await prisma.$disconnect(); +} catch (e) { + console.error(e); + await prisma.$disconnect(); + process.exit(1); +} diff --git a/chase/backend/src/auth/guards/committeeRoles.ts b/chase/backend/src/auth/guards/committeeRoles.ts new file mode 100644 index 00000000..2700b555 --- /dev/null +++ b/chase/backend/src/auth/guards/committeeRoles.ts @@ -0,0 +1,67 @@ +import Elysia, { t } from "elysia"; +import { session } from "../session"; +import { TypeCompiler } from "@sinclair/typebox/compiler"; +import { db } from "../../../prisma/db"; +import { CommitteeRole } from "../../../prisma/generated/client"; + +const parametersSchema = TypeCompiler.Compile( + t.Object({ + conferenceId: t.String(), + committeeId: t.String(), + }), +); + +export const committeeRoleGuard = new Elysia() + .use(session) + .macro(({ onBeforeHandle }) => { + return { + /** + * Checks if a user has the role in the committee. You can set the role to "any" to check if the user has any role in the committee. + * You can also set the role to an array of roles to check if the user has any of the roles in the committee. + */ + hasCommitteeRole(roles: CommitteeRole[] | "any") { + onBeforeHandle(async ({ session, set, params }) => { + if (!session.loggedIn) { + // biome-ignore lint/suspicious/noAssignInExpressions: This is a valid use case + return (set.status = "Unauthorized"); + } + + if (!parametersSchema.Check(params)) { + set.status = "Bad Request"; + return [...parametersSchema.Errors(params)]; + } + const { conferenceId, committeeId } = parametersSchema.Decode(params); + + if (!session.userData) { + // biome-ignore lint/suspicious/noAssignInExpressions: This is a valid use case + return (set.status = "Unauthorized"); + } + + const res = await db.committeeMember.findFirst({ + where: { + userId: session.userData.id, + committee: { + id: committeeId, + conference: { + id: conferenceId, + }, + }, + role: roles === "any" ? undefined : { in: roles }, + }, + }); + + if (!res) { + // biome-ignore lint/suspicious/noAssignInExpressions: This is a valid use case + return (set.status = "Unauthorized"); + } + }); + }, + }; + }) + // just for correct typing + .derive(({ session }) => { + return { + // biome-ignore lint/style/noNonNullAssertion: we can safely assume that session.userData is defined here + session: { ...session, userData: session.userData! }, + }; + }); diff --git a/chase/backend/src/auth/guards/conferenceRoles.ts b/chase/backend/src/auth/guards/conferenceRoles.ts new file mode 100644 index 00000000..ab8308fa --- /dev/null +++ b/chase/backend/src/auth/guards/conferenceRoles.ts @@ -0,0 +1,61 @@ +import Elysia, { t } from "elysia"; +import { session } from "../session"; +import { TypeCompiler } from "@sinclair/typebox/compiler"; +import { db } from "../../../prisma/db"; +import { ConferenceRole } from "../../../prisma/generated/client"; + +const parametersSchema = TypeCompiler.Compile( + t.Object({ + conferenceId: t.String(), + }), +); + +export const conferenceRoleGuard = new Elysia() + .use(session) + .macro(({ onBeforeHandle }) => { + return { + /** + * Checks if a user has the role in the conference. You can set the role to "any" to check if the user has any role in the conference. + * You can also set the role to an array of roles to check if the user has any of the roles in the conference. + */ + hasConferenceRole(roles: ConferenceRole[] | "any") { + onBeforeHandle(async ({ session, set, params }) => { + if (!session.loggedIn) { + // biome-ignore lint/suspicious/noAssignInExpressions: This is a valid use case + return (set.status = "Unauthorized"); + } + + if (!parametersSchema.Check(params)) { + set.status = "Bad Request"; + return [...parametersSchema.Errors(params)]; + } + const { conferenceId } = parametersSchema.Decode(params); + + if (!session.userData) { + // biome-ignore lint/suspicious/noAssignInExpressions: This is a valid use case + return (set.status = "Unauthorized"); + } + + const res = await db.conferenceMember.findFirst({ + where: { + userId: session.userData.id, + conferenceId, + role: roles === "any" ? undefined : { in: roles }, + }, + }); + + if (!res) { + // biome-ignore lint/suspicious/noAssignInExpressions: This is a valid use case + return (set.status = "Unauthorized"); + } + }); + }, + }; + }) + // just for correct typing + .derive(({ session }) => { + return { + // biome-ignore lint/style/noNonNullAssertion: we can safely assume that session.userData is defined here + session: { ...session, userData: session.userData! }, + }; + }); diff --git a/chase/backend/src/auth/guards/loggedIn.ts b/chase/backend/src/auth/guards/loggedIn.ts new file mode 100644 index 00000000..ebb2ed64 --- /dev/null +++ b/chase/backend/src/auth/guards/loggedIn.ts @@ -0,0 +1,26 @@ +import Elysia from "elysia"; +import { session } from "../session"; + +export const loggedIn = new Elysia() + .use(session) + .macro(({ onBeforeHandle }) => { + return { + mustBeLoggedIn(enabled = false) { + if (!enabled) return; + onBeforeHandle(async ({ session, set }) => { + if (session.loggedIn !== true) { + set.status = "Unauthorized"; + // biome-ignore lint/suspicious/noAssignInExpressions: This is a valid use case + return "Unauthorized"; + } + }); + }, + }; + }) + // just for correct typing + .derive(({ session }) => { + return { + // biome-ignore lint/style/noNonNullAssertion: we can safely assume that session.userData is defined here + session: { ...session, userData: session.userData! }, + }; + }); diff --git a/chase/backend/src/auth/session.ts b/chase/backend/src/auth/session.ts new file mode 100644 index 00000000..6888154c --- /dev/null +++ b/chase/backend/src/auth/session.ts @@ -0,0 +1,96 @@ +import Elysia, { t } from "elysia"; +import { nanoid } from "nanoid"; +import { redis } from "../../prisma/db"; +import { appConfiguration } from "../util/config"; + +interface UserData { + id: string; +} + +// interface PassKeyChallenge { +// userID: string; +// email: string; +// // biome-ignore lint/suspicious/noExplicitAny: +// challenge: any; +// } + +type sessionSchema = { + loggedIn: boolean; + userData?: UserData; + // currentPasskeyChallenge?: PassKeyChallenge; +}; + +export const session = new Elysia({ name: "session" }) + .guard({ + cookie: t.Cookie( + { + cookieConsent: t.Optional(t.BooleanString()), + sessionId: t.Optional(t.String()), + }, + { + cookie: { + httpOnly: true, + maxAge: 60 * 60 * 24 * 7, // 7 days + sameSite: appConfiguration.development ? "none" : "strict", + secure: true, + sign: ["sessionId"], + secrets: appConfiguration.cookie.secrets, + }, + }, + ), + }) + .derive(async ({ cookie: { sessionId, cookieConsent }, set }) => { + if (cookieConsent.value !== true) { + set.status = "Unavailable For Legal Reasons"; + throw new Error("You need to allow cookies to access this route"); + } + + let data: sessionSchema = { loggedIn: false }; + + // TODO: setter could be actual getters and setters + // const setPasskeyChallenge = async ( + // challenge: PassKeyChallenge | undefined, + // ) => { + // data.currentPasskeyChallenge = challenge; + // await redis.set(`user-session:${sessionId.value}`, JSON.stringify(data)); + // }; + + const setUserData = async (userData: UserData) => { + data.userData = userData; + await redis.set(`user-session:${sessionId.value}`, JSON.stringify(data)); + }; + + const setLoggedIn = async (loggedIn: boolean) => { + data.loggedIn = loggedIn; + await redis.set(`user-session:${sessionId.value}`, JSON.stringify(data)); + }; + + const createNewSessionInDB = async () => { + sessionId.value = nanoid(30); // sets the session id in the cookie + + await redis.set(`user-session:${sessionId.value}`, JSON.stringify(data)); + + return { + // session: { ...data, setPasskeyChallenge, setUserData, setLoggedIn }, + session: { ...data, setUserData, setLoggedIn }, + }; + }; + + // no session id given by user? create a new session + if (!sessionId.value) { + return createNewSessionInDB(); + } + + // if the user provides a session id, check if it exists in the db + const rawData = await redis.get(`user-session:${sessionId.value}`); + // if the session id doesn't exist in the db, create a new session + if (!rawData) { + return createNewSessionInDB(); + } + data = JSON.parse(rawData); + + return { + // session: { ...data, setPasskeyChallenge, setUserData, setLoggedIn }, + session: { ...data, setUserData, setLoggedIn }, + }; + }); diff --git a/chase/backend/src/email/email.ts b/chase/backend/src/email/email.ts new file mode 100644 index 00000000..75f193a9 --- /dev/null +++ b/chase/backend/src/email/email.ts @@ -0,0 +1,74 @@ +import { Email, User } from "../../prisma/generated/client"; +import { createTransport } from "nodemailer"; +import { appConfiguration } from "../util/config"; +import { emailConfirmation } from "./templates/emailConfirmation/emailConfirmation"; +import { credentialCreation } from "./templates/credentialCreation/credentialCreation"; + +export type EmailTemplate = { + subject: string; + text: string; +}; + +export type AvailableEmailLocales = "de" | "en"; + +const mailTransport = createTransport({ + host: appConfiguration.email.EMAIL_HOST, + port: appConfiguration.email.EMAIL_PORT, + secure: appConfiguration.email.EMAIL_SECURE, + auth: { + user: appConfiguration.email.EMAIL_AUTH_USER, + pass: appConfiguration.email.EMAIL_AUTH_PASS, + }, +}); + +export async function sendEmailConfirmationEmail({ + email, + locale, + redirectLink, +}: { + email: Pick["email"]; + locale: AvailableEmailLocales; + redirectLink: string; +}) { + const template = emailConfirmation({ + locale, + button_href: redirectLink, + }); + + const result = await mailTransport.sendMail({ + from: appConfiguration.email.EMAIL_FROM, + to: email, + html: template.text, + subject: template.subject, + }); + + if (result.rejected.length > 0) { + throw new Error(`Email to ${email} was rejected`); + } +} + +export async function sendCredentialCreationEmail({ + email, + locale, + redirectLink, +}: { + email: Pick["email"]; + locale: AvailableEmailLocales; + redirectLink: string; +}) { + const template = credentialCreation({ + locale, + button_href: redirectLink, + }); + + const result = await mailTransport.sendMail({ + from: appConfiguration.email.EMAIL_FROM, + to: email, + html: template.text, + subject: template.subject, + }); + + if (result.rejected.length > 0) { + throw new Error(`Email to ${email} was rejected`); + } +} diff --git a/chase/backend/src/email/parser.ts b/chase/backend/src/email/parser.ts new file mode 100644 index 00000000..7268fb45 --- /dev/null +++ b/chase/backend/src/email/parser.ts @@ -0,0 +1,20 @@ +import mjml2html from "mjml"; + +export function parse(mjml: string, variables: Record) { + const d = mjml2html(mjml); + if (d.errors.length > 0) { + throw new Error(d.errors[0]?.formattedMessage); + } + return replaceTemplateVariables(d.html, variables); +} + +export function replaceTemplateVariables( + template: string, + variables: Record, +) { + let replaced = template; + for (const [key, value] of Object.entries(variables)) { + replaced = replaced.replace(new RegExp(`{{${key}}}`, "g"), value); + } + return replaced; +} diff --git a/chase/backend/src/email/templates/credentialCreation/credentialCreation.ts b/chase/backend/src/email/templates/credentialCreation/credentialCreation.ts new file mode 100644 index 00000000..096c0d4a --- /dev/null +++ b/chase/backend/src/email/templates/credentialCreation/credentialCreation.ts @@ -0,0 +1,54 @@ +import { appConfiguration } from "../../../util/config"; +import { AvailableEmailLocales, EmailTemplate } from "../../email"; +import { parse, replaceTemplateVariables } from "../../parser"; +import template from "./template.mjml"; + +const de_subject = `${appConfiguration.appName} - Zugangsdaten festlegen`; +const de = parse(await Bun.file(template).text(), { + locale: "de", + title: `${appConfiguration.appName} Zugangsdaten festlegen`, + text: "Für dieses Konto wurde das Festlegen neuer Zugangsdaten angefordert. Über den nachfolgenden Link können diese festgelegt werden. Wenn diese E-Mail irrtümlich versendet wurde, kann sie einfach ignoriert werden.", + button_label: "Zugangsdaten festlegen", + greetings: "Mit freundlichen Grüßen, das Team von CHASE, DMUN e.V.", + disclaimer: + "CHASE wird entwickelt und ist Teil von Deutsche Model United Nations (DMUN) e.V. eingetragen im Vereinsregister des Amtsgerichts Stuttgart unter der Registernummer VR 6921. Die USt-IdNr lautet DE238582245. Diese E-Mail wurde automatisch versendet, weil ein Account für CHASE, die Konferenzverwaltungssoftware von DMUN e.V. angelegt wurde. Zu Fragen und Auskünften gilt das Impressum des Vereins unter https://www.dmun.de/impressum", +}); + +const en_subject = `${appConfiguration.appName} - Confirm account`; +const en = parse(await Bun.file(template).text(), { + locale: "en", + title: `Set ${appConfiguration.appName} credentials`, + text: "The setting of new crentials has been requested for this account. These can be set via the following link. If this e-mail was sent in error, it can simply be ignored.", + button_label: "Set credentials", + greetings: "Best regards, the team of CHASE, DMUN e.V.", + disclaimer: + "CHASE is developed and is part of Deutsche Model United Nations (DMUN) e.V. registered in the register of associations of the district court of Stuttgart under the registration number VR 6921. The VAT ID number is DE238582245. This e-mail was sent automatically because an account for CHASE, the conference management software of DMUN e.V. was created. For questions and information, please refer to the association's legal notice at https://www.dmun.de/impressum", +}); + +export function credentialCreation({ + locale, + button_href, +}: { + locale: AvailableEmailLocales; + button_href: string; +}): EmailTemplate { + if (locale === "de") { + return { + subject: de_subject, + text: replaceTemplateVariables(de, { + button_href, + }), + }; + } + + if (locale === "en") { + return { + subject: en_subject, + text: replaceTemplateVariables(en, { + button_href, + }), + }; + } + + throw new Error(`Unknown locale ${locale}`); +} diff --git a/chase/backend/src/email/templates/credentialCreation/template.mjml b/chase/backend/src/email/templates/credentialCreation/template.mjml new file mode 100644 index 00000000..30234108 --- /dev/null +++ b/chase/backend/src/email/templates/credentialCreation/template.mjml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{title}} + + + + + + + + + {{text}} + + + + + + + + {{button_label}} + + + + + + + + {{greetings}} + + + + + + + + {{disclaimer}} + + + + + + \ No newline at end of file diff --git a/chase/backend/src/email/templates/emailConfirmation/emailConfirmation.ts b/chase/backend/src/email/templates/emailConfirmation/emailConfirmation.ts new file mode 100644 index 00000000..64e6be75 --- /dev/null +++ b/chase/backend/src/email/templates/emailConfirmation/emailConfirmation.ts @@ -0,0 +1,54 @@ +import { appConfiguration } from "../../../util/config"; +import { AvailableEmailLocales, EmailTemplate } from "../../email"; +import { parse, replaceTemplateVariables } from "../../parser"; +import template from "./template.mjml"; + +const de_subject = `${appConfiguration.appName} - Account bestätigen`; +const de = parse(await Bun.file(template).text(), { + locale: "de", + title: `Willkommen bei ${appConfiguration.appName}!`, + text: "Für diese E-Mail-Adresse wurde ein Account bei CHASE erstellt. Bitte bestätige die E-Mail-Adresse durch Klicken auf den nachfolgenden Link. Wenn diese E-Mail irrtümlich versendet wurde, kann sie einfach ignoriert werden.", + button_label: "Account bestätigen", + greetings: "Mit freundlichen Grüßen, das Team von CHASE, DMUN e.V.", + disclaimer: + "CHASE wird entwickelt und ist Teil von Deutsche Model United Nations (DMUN) e.V. eingetragen im Vereinsregister des Amtsgerichts Stuttgart unter der Registernummer VR 6921. Die USt-IdNr lautet DE238582245. Diese E-Mail wurde automatisch versendet, weil ein Account für CHASE, die Konferenzverwaltungssoftware von DMUN e.V. angelegt wurde. Zu Fragen und Auskünften gilt das Impressum des Vereins unter https://www.dmun.de/impressum", +}); + +const en_subject = `${appConfiguration.appName} - Confirm account`; +const en = parse(await Bun.file(template).text(), { + locale: "en", + title: `Welcome to ${appConfiguration.appName}!`, + text: "A CHASE account has been created for this e-mail address. Please confirm the e-mail address by clicking on the following link. If this e-mail was sent in error, it can simply be ignored.", + button_label: "Confirm account", + greetings: "Best regards, the team of CHASE, DMUN e.V.", + disclaimer: + "CHASE is developed and is part of Deutsche Model United Nations (DMUN) e.V. registered in the register of associations of the district court of Stuttgart under the registration number VR 6921. The VAT ID number is DE238582245. This e-mail was sent automatically because an account for CHASE, the conference management software of DMUN e.V. was created. For questions and information, please refer to the association's legal notice at https://www.dmun.de/impressum", +}); + +export function emailConfirmation({ + locale, + button_href, +}: { + locale: AvailableEmailLocales; + button_href: string; +}): EmailTemplate { + if (locale === "de") { + return { + subject: de_subject, + text: replaceTemplateVariables(de, { + button_href, + }), + }; + } + + if (locale === "en") { + return { + subject: en_subject, + text: replaceTemplateVariables(en, { + button_href, + }), + }; + } + + throw new Error(`Unknown locale ${locale}`); +} diff --git a/chase/backend/src/email/templates/emailConfirmation/template.mjml b/chase/backend/src/email/templates/emailConfirmation/template.mjml new file mode 100644 index 00000000..30234108 --- /dev/null +++ b/chase/backend/src/email/templates/emailConfirmation/template.mjml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{title}} + + + + + + + + + {{text}} + + + + + + + + {{button_label}} + + + + + + + + {{greetings}} + + + + + + + + {{disclaimer}} + + + + + + \ No newline at end of file diff --git a/chase/backend/src/main.ts b/chase/backend/src/main.ts index c369f0d0..75c61f54 100644 --- a/chase/backend/src/main.ts +++ b/chase/backend/src/main.ts @@ -1,37 +1,95 @@ import { Elysia } from "elysia"; import { swagger } from "@elysiajs/swagger"; import { cors } from "@elysiajs/cors"; -import { committee } from "./routes/conference/committee"; import packagejson from "../package.json"; -import { isDevelopment } from "helpers"; -// import { conference } from "./routes/conference"; +import { appConfiguration } from "./util/config"; +import { errorLogging } from "./util/errorLogger"; +import { conference } from "./routes/conference"; +import { conferenceMember } from "./routes/conferenceMember"; +import { committee } from "./routes/committee"; +import { baseData } from "./routes/baseData"; +import { auth } from "./routes/auth/auth"; +import { agendaItem } from "./routes/agendaItem"; +import { delegation } from "./routes/delegation"; +import { user } from "./routes/user"; +import { speakersListGeneral } from "./routes/speakersList/general"; +import { speakersListModification } from "./routes/speakersList/modification"; +import { speakersListSpeakers } from "./routes/speakersList/speakers"; +import { messages } from "./routes/messages"; -const app = new Elysia() - .use(cors({ origin: process.env.ORIGIN ?? "http://localhost:3001" })) - // .use(conference) - .use(committee); +const m = new Elysia() + .use(errorLogging) + .use( + // @ts-ignore + cors({ + origin: appConfiguration.CORSOrigins, + allowedHeaders: ["content-type"], + methods: [ + "GET", + "PUT", + "POST", + "DELETE", + "PATCH", + "HEAD", + "OPTIONS", + "TRACE", + "CONNECT", + ], + }), + ) + .use(conference) + .use(conferenceMember) + .use(committee) + .use(delegation) + .use(agendaItem) + .use(speakersListGeneral) + .use(speakersListModification) + .use(speakersListSpeakers) + .use(messages) + .use(user) + .use(auth) + .use(baseData); -if (isDevelopment()) { - app.use( +// we make the api docs public +// biome-ignore lint/suspicious/noExplicitAny: we explicitly dont want type checking here +(new Elysia() as any) // just disable the type check for this object, since the middleware is causing issues + .use( swagger({ - path: "/documentation", + path: `/${appConfiguration.documentationPath}`, documentation: { info: { - title: "CHASE backend Docs", - description: "CHASE backend documentation", + title: `${appConfiguration.appName} documentation`, + description: `${appConfiguration.appName} documentation`, version: packagejson.version, }, }, - }) - ); + }), + ) + .use(m) + .listen(process.env.PORT ?? "3001"); +setTimeout(() => { console.info( - `Swagger documentation available at http://localhost:${ - process.env.PORT ?? "3001" - }/documentation` + ` + + Swagger documentation available at http://localhost:${ + process.env.PORT ?? "3001" + }/${appConfiguration.documentationPath} + + `, ); -} +}, 3000); -app.listen(process.env.PORT ?? "3001"); +if (appConfiguration.development) { + setTimeout(() => { + console.info( + ` + + Dummy emails sent to inbox at http://${appConfiguration.email.EMAIL_HOST}:3777 + + `, + ); + }, 3000); +} -export type App = typeof app; \ No newline at end of file +export type App = typeof m; diff --git a/chase/backend/src/plugins/auth.ts b/chase/backend/src/plugins/auth.ts deleted file mode 100755 index bb5db6b7..00000000 --- a/chase/backend/src/plugins/auth.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { Elysia } from "elysia"; -import { Permissions, User, introspect } from "authentication"; -import { isAuthMocked } from "helpers"; -import { Metadata } from "authentication"; -import { join } from "node:path"; -import { bearer } from "@elysiajs/bearer"; - -// while developing and not running a live ZITADEL instance, you can adjust this to test permission related things for incoming requests -// if you want to simulate a unauthorized request, just set this to undefined -let mockedPermissions: Metadata = { - chairPermissions: [], - conferenceAdminPermissions: [], - nonStateActorPermissions: [], - pronouns: "he/him", - representativePermissions: [], - secretaryMemberPermissions: [], - visitorPermissions: [], -}; - -let mockedUser: User = { - email: "test@test.de", - email_verified: true, - family_name: "Test", - given_name: "Test", - id: "42d35a24-cd3e-4625-9b91-b6510f728cc3", - locale: "de", - pronouns: "he/him", -}; - -if (isAuthMocked()) { - // load existing values if any - const devpath = join(import.meta.dir, "mockedAuth.json"); - const file = Bun.file(devpath); - { - if (await file.exists()) { - const mocks = JSON.parse(await file.text()); - mockedPermissions = mocks.permissions; - mockedUser = mocks.user; - } - } - - // save values to disk - setInterval(async () => { - Bun.write( - devpath, - JSON.stringify({ permissions: mockedPermissions, user: mockedUser }) - ); - }, 1000); -} - -const mockedIntrospection: { user: User; permissions: Permissions } = { - user: mockedUser, - //TODO consider making this permanent, maybe store on disk somewhere - permissions: new Permissions( - mockedUser.id, - mockedPermissions, - async (userId, metadata) => { - // we dont really care about other permissions in this scenario - if (userId !== mockedUser.id) { - console.info( - "tried to set metadata for user that is not the mocked user" - ); - return; - } - Object.entries(metadata).map(async ([key, data]) => { - // biome-ignore lint/suspicious/noExplicitAny: - mockedPermissions[key as keyof Metadata] = data as any; - }); - } - ), -}; - -class AuthError extends Error {} - -//TODO separate plugin for different auth states? (auth, isConferenceAdmin, isChar, etc.) -export const auth = new Elysia({ - name: "auth", // set name to avoid duplication on multiple uses https://elysiajs.com/concept/plugin.html#plugin-deduplication -}) - .use(bearer()) - .error({ AUTH_ERROR: AuthError }) - .onError(({ code }) => { - if (code === "AUTH_ERROR") { - return new Response("UNAUTHORIZED", { - status: 401, - }); - } - }) - .derive(async ({ bearer }) => { - if (isAuthMocked()) { - return { auth: mockedIntrospection }; - } - - if (!bearer) { - throw new AuthError("No bearer token provided"); - } - - const auth = await introspect(bearer); - - if (!auth) { - throw new AuthError("Invalid token"); - } - - return { auth }; - }); -// .derive(async ({ bearer }) => { -// if (isAuthMocked()) { -// return { auth: mockedIntrospection }; -// } - -// if (!bearer) { -// return new Response("No bearer token provided", { -// status: 401, -// }); -// } - -// const auth = await introspect(bearer); - -// if (!auth) { -// return new Response("Invalid token", { -// status: 401, -// }); -// } - -// return { auth }; -// }); -// .guard({ -// headers: t.Object({ -// authorization: t.String(), -// }), -// beforeHandle: [ -// async ({ set, headers }) => { -// const bearer = headers.authorization?.replace("Bearer ", ""); -// const auth = isAuthMocked() -// ? mockedIntrospection -// : // biome-ignore lint/style/noNonNullAssertion: we check for non null in the guard and want the correct type to be propagated by this plugin -// (await introspect(bearer as string))!; - -// if (!auth) { -// set.status = "Unauthorized"; -// return "Unauthorized"; -// } - -// return { auth }; -// }, -// ], -// }); - -// return (app: Elysia) => -// app -// .state('basicAuthRealm', null as string | null) -// .state('basicAuthUser', null as string | null) -// .addError({ BASIC_AUTH_ERROR: BasicAuthError }) -// .onError(({ code, error }) => { -// if (code === 'BASIC_AUTH_ERROR' && error.realm === options.realm) { -// return new Response(options.unauthorizedMessage, { -// status: options.unauthorizedStatus, -// headers: { 'WWW-Authenticate': `Basic realm="${options.realm}"` }, -// }) -// } -// }) -// .onRequest(ctx => { -// if (options.enabled && inScope(ctx) && !skipRequest(ctx.request)) { -// const authHeader = ctx.request.headers.get(options.header) -// if (!authHeader || !authHeader.toLowerCase().startsWith('basic ')) { -// throw new BasicAuthError('Invalid header', options.realm) -// } - -// const credentials = getCredentials(authHeader) -// if (!checkCredentials(credentials, credentialsMap)) { -// throw new BasicAuthError('Invalid credentials', options.realm) -// } - -// ctx.store.basicAuthRealm = options.realm -// ctx.store.basicAuthUser = credentials.username -// } -// }) diff --git a/chase/backend/src/routes/agendaItem.ts b/chase/backend/src/routes/agendaItem.ts new file mode 100644 index 00000000..538d9181 --- /dev/null +++ b/chase/backend/src/routes/agendaItem.ts @@ -0,0 +1,244 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../prisma/db"; +import { committeeRoleGuard } from "../auth/guards/committeeRoles"; +import { conferenceRoleGuard } from "../auth/guards/conferenceRoles"; +import { openApiTag } from "../util/openApiTags"; +import { AgendaItem } from "../../prisma/generated/schema"; +import { nullToUndefined } from "../util/nullToUndefined"; +import { $Enums } from "../../prisma/generated/client"; + +const AgendaItemWithoutRelations = t.Omit(AgendaItem, [ + "committee", + "speakerLists", +]); + +const AgendaItemData = t.Omit(AgendaItemWithoutRelations, [ + "id", + "committeeId", +]); + +export const agendaItem = new Elysia({ + prefix: "/conference/:conferenceId/committee/:committeeId", +}) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + .get( + "/agendaItem", + async ({ params: { conferenceId, committeeId } }) => { + const r = await db.agendaItem.findMany({ + where: { + committee: { + id: committeeId, + conferenceId, + }, + }, + }); + + // the return schema expects description to be set or undefined https://github.com/adeyahya/prisma-typebox-generator/issues/19 + return nullToUndefined(r); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all agenda items in this committee", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/agendaItem", + async ({ body, params: { conferenceId, committeeId } }) => { + const committeeHasActiveAgendaItem = !!(await db.agendaItem.findFirst({ + where: { + committeeId, + isActive: true, + }, + })); + const agendaItem = await db.agendaItem + .create({ + data: { + committee: { + connect: { + id: committeeId, + conferenceId, + }, + }, + title: body.title, + description: body.description, + }, + }) + .then((a) => ({ ...a, description: a.description || undefined })); + const _speakersLists = await db.speakersList.createMany({ + data: [ + { + type: $Enums.SpeakersListCategory.SPEAKERS_LIST, + agendaItemId: agendaItem.id, + speakingTime: 180, + }, + { + type: $Enums.SpeakersListCategory.COMMENT_LIST, + agendaItemId: agendaItem.id, + speakingTime: 30, + }, + ], + }); + return agendaItem; + }, + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Create a new agenda item in this committee", + tags: [openApiTag(import.meta.path)], + }, + body: AgendaItemData, + response: AgendaItemWithoutRelations, + }, + ) + .get( + "/agendaItem/active", + async ({ params: { committeeId }, set }) => { + const r = await db.agendaItem.findFirst({ + where: { + committeeId, + isActive: true, + }, + include: { + speakerLists: true, + }, + }); + + if (!r) { + set.status = "Not Found"; + throw new Error("No Active Committee"); + } + + return { ...r, description: r.description || undefined }; + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all active agenda items in this committee", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .get( + "/agendaItem/active/:type", + async ({ params: { conferenceId, committeeId, type }, set }) => { + const r = await db.agendaItem.findFirst({ + where: { + committeeId, + isActive: true, + }, + include: { + speakerLists: true, + }, + }); + + if (!r) { + set.status = "Not Found"; + throw new Error("No Active Committee"); + } + + return r?.speakerLists.find((sl) => sl.type === type) ?? null; + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all active agenda items in this committee", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .get( + "/agendaItem/:agendaItemId", + ({ params: { conferenceId, committeeId, agendaItemId } }) => + db.agendaItem + .findUniqueOrThrow({ + where: { + id: agendaItemId, + committee: { id: committeeId, conferenceId }, + }, + }) + .then((a) => ({ ...a, description: a.description || undefined })), + { + hasConferenceRole: "any", + detail: { + description: "Get a single agenda item by id", + tags: [openApiTag(import.meta.path)], + }, + response: AgendaItemWithoutRelations, + }, + ) + .post( + "/agendaItem/:agendaItemId/activate", + ({ params: { conferenceId, committeeId, agendaItemId } }) => + db.$transaction([ + db.agendaItem.update({ + where: { + id: agendaItemId, + committee: { id: committeeId, conferenceId }, + }, + data: { + isActive: true, + }, + }), + db.agendaItem.updateMany({ + where: { + committeeId, + id: { not: agendaItemId }, + }, + data: { + isActive: false, + }, + }), + ]), + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Activate an agenda item by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .delete( + "/agendaItem/:agendaItemId", + ({ params: { conferenceId, committeeId, agendaItemId } }) => + db.agendaItem.delete({ + where: { + id: agendaItemId, + committee: { id: committeeId, conferenceId }, + }, + }), + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Delete an agenda item by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .patch( + "/agendaItem/:agendaItemId", + async ({ params: { conferenceId, committeeId, agendaItemId }, body }) => { + return db.agendaItem.update({ + where: { + id: agendaItemId, + committee: { id: committeeId, conferenceId }, + }, + data: { + isActive: body.isActive, + title: body.title, + description: body.description, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: AgendaItemData, + detail: { + description: "Update an agenda item by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/auth/auth.ts b/chase/backend/src/routes/auth/auth.ts new file mode 100644 index 00000000..b9fd7796 --- /dev/null +++ b/chase/backend/src/routes/auth/auth.ts @@ -0,0 +1,294 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../../prisma/db"; +import { openApiTag } from "../../util/openApiTags"; +import { + sendEmailConfirmationEmail, + sendCredentialCreationEmail, +} from "../../email/email"; +import { nanoid } from "nanoid"; +import { appConfiguration } from "../../util/config"; +import { loggedIn } from "../../auth/guards/loggedIn"; +import { User } from "../../../prisma/generated/schema"; +import { passwords } from "./passwords"; + +const UserWithoutRelations = t.Omit(User, [ + "conferenceMemberships", + "committeeMemberships", + "researchServiceMessages", + "chairMessages", + "emails", + "passwords", + "pendingCredentialCreationTasks", +]); + +export const auth = new Elysia({ + prefix: "/auth", +}) + .use(passwords) + .use(loggedIn) + .get( + "/userState", + async ({ query: { email } }) => { + const foundEmail = await db.email.findUnique({ + where: { + email, + }, + include: { user: true }, + }); + + if (!foundEmail?.user) { + return "userNotFound"; + } + + if (!foundEmail.validated) { + return "emailNotValidated"; + } + + return "ok"; + }, + { + query: t.Object({ + email: t.String(), + }), + response: t.Union([ + t.Literal("userNotFound"), + t.Literal("emailNotValidated"), + t.Literal("ok"), + ]), + detail: { + description: + "Returns some info on the user in the system. Can be used to check if the user is existing and validated.", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .get( + "/myInfo", + async ({ session }) => { + return await db.user.findUniqueOrThrow({ + where: { id: session.userData.id }, + include: { + emails: true, + conferenceMemberships: { + select: { + id: true, + role: true, + conference: true, + }, + }, + committeeMemberships: { + include: { + committee: { + include: { + conference: true, + }, + }, + delegation: { + select: { + nation: true, + }, + }, + }, + }, + }, + }); + }, + { + mustBeLoggedIn: true, + detail: { + description: "Returns the user info when they are logged in", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/validateEmail", + async ({ body: { email, token } }) => { + const foundEmail = await db.email.findUnique({ + where: { + email, + }, + include: { validationToken: true }, + }); + + if (!foundEmail) { + return "emailNotFound"; + } + + if (foundEmail.validated) { + return "alreadyValidated"; + } + + if (!foundEmail.validationToken) { + return "emailDoesNotHaveActiveValidationToken"; + } + + if (new Date() > foundEmail.validationToken.expiresAt) { + return "tokenExpired"; + } + + if ( + !(await Bun.password.verify( + token, + foundEmail.validationToken.tokenHash, + )) + ) { + return "invalidToken"; + } + + await db.email.update({ + where: { + email, + }, + data: { + validated: true, + validationTokenId: null, + }, + }); + await db.token.delete({ + where: { id: foundEmail.validationToken.id }, + }); + + const credentialCreateToken = nanoid(32); + await db.pendingCredentialCreateTask.create({ + data: { + token: { + create: { + tokenHash: await Bun.password.hash(credentialCreateToken), + expiresAt: new Date(Date.now() + 1000 * 60 * 10), // 10 minutes + }, + }, + user: { + connect: { + id: foundEmail.userId, + }, + }, + }, + }); + + return { credentialCreateToken }; + }, + { + body: t.Object({ + email: t.String(), + token: t.String(), + }), + response: t.Union([ + t.Literal("emailNotFound"), + t.Literal("emailDoesNotHaveActiveValidationToken"), + t.Literal("invalidToken"), + t.Literal("alreadyValidated"), + t.Literal("tokenExpired"), + t.Object({ credentialCreateToken: t.String() }), + ]), + detail: { + description: + "Validates the email of a user. The token is the token that was sent to the user via email. Returns a token which can be used to create credentials", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/createUser", + async ({ body: { email, locale, name } }) => { + const emailValidationToken = nanoid(32); + const emailValidationTokenHash = + await Bun.password.hash(emailValidationToken); + await db.user.create({ + data: { + name: name ?? email, + emails: { + create: { + email, + validationToken: { + create: { + tokenHash: emailValidationTokenHash, + expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24), + }, + }, + }, + }, + }, + }); + + //TODO: report back errors in sending emails to the frontend in structured way + await sendEmailConfirmationEmail({ + email, + locale, + redirectLink: `${appConfiguration.email.EMAIL_VERIFY_REDIRECT_URL}?token=${emailValidationToken}&email=${email}`, + }); + }, + { + body: t.Object({ + email: t.String(), + locale: t.Union([t.Literal("en"), t.Literal("de")]), + name: t.Optional(t.String()), + }), + detail: { + description: "Creates a user", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + //TODO spam protection? + .get( + "/sendCredentialCreateToken", + async ({ query: { email, locale } }) => { + const token = nanoid(32); + + const foundEmail = await db.email.findUniqueOrThrow({ + where: { + email, + }, + }); + + await db.pendingCredentialCreateTask.create({ + data: { + token: { + create: { + tokenHash: await Bun.password.hash(token), + expiresAt: new Date(Date.now() + 1000 * 60 * 10), // 10 minutes + }, + }, + user: { + connect: { + id: foundEmail.userId, + }, + }, + }, + }); + + //TODO: report back errors in sending emails to the frontend in structured way + await sendCredentialCreationEmail({ + email, + locale, + redirectLink: `${appConfiguration.email.CREDENTIAL_CREATE_REDIRECT_URL}?token=${token}&email=${email}`, + }); + }, + { + query: t.Object({ + locale: t.Union([t.Literal("en"), t.Literal("de")]), + email: t.String(), + }), + detail: { + description: "Sends a credential creation token to the users email", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .get( + "/logout", + ({ session }) => { + session.setLoggedIn(false); + // delete the session cookie + return "ok"; + }, + { + response: t.Literal("ok"), + detail: { + description: + "Logs the user out. The user will be logged out on the next request", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/auth/passkeys.ts b/chase/backend/src/routes/auth/passkeys.ts new file mode 100644 index 00000000..45cf9da9 --- /dev/null +++ b/chase/backend/src/routes/auth/passkeys.ts @@ -0,0 +1,169 @@ +import { t, Elysia } from "elysia"; +import { + generateAuthenticationOptions, + generateRegistrationOptions, + verifyRegistrationResponse, +} from "@simplewebauthn/server"; +import { appConfiguration } from "../../util/config"; +import { db } from "../../../prisma/db"; +import { openApiTag } from "../../util/openApiTags"; +import { session } from "../../auth/session"; +import { nanoid } from "nanoid"; +import { sendEmailConfirmationEmail } from "../../email/email"; + +export const passkeys = new Elysia(); +// .use(session) +// .post( +// "/createUserWithPasskey", +// async ({ body: { email }, session }) => { +// const userID = nanoid(); + +// const options = await generateRegistrationOptions({ +// rpName: appConfiguration.passkeys.RELAY_NAME, +// rpID: appConfiguration.passkeys.RELAY_ID, +// userID, +// userName: email, +// // Don't prompt users for additional information about the authenticator +// // (Recommended for smoother UX) +// attestationType: 'none', +// // See "Guiding use of authenticators via authenticatorSelection" below +// authenticatorSelection: { +// residentKey: 'preferred', +// userVerification: 'preferred', +// requireResidentKey: false, +// authenticatorAttachment: 'cross-platform', +// }, +// }); + +// await session.setPasskeyChallenge({ +// challenge: options.challenge, +// email, +// userID: userID, +// }); + +// return options; +// }, +// { +// body: t.Object({ +// email: t.String(), +// }), +// detail: { +// description: "Starts the process of user creation with a passkey", +// tags: [openApiTag(import.meta.path)], +// }, +// }, +// ) +// .post( +// "/finishPasskeyRegistration", +// async ({ session, body: { challenge, locale, name } }) => { +// if (!session.currentPasskeyChallenge) { +// throw new Error("No challenge present for that session"); +// } + +// const verification = await verifyRegistrationResponse({ +// response: challenge, +// expectedChallenge: session.currentPasskeyChallenge.challenge, +// expectedOrigin: appConfiguration.passkeys.RELAY_ORIGIN, +// expectedRPID: appConfiguration.passkeys.RELAY_ID, +// }); + +// if (!verification.verified) { +// throw new Error(`Verification status: ${verification.verified}`); +// } + +// if (!verification.registrationInfo) { +// throw new Error("Registration info not set in verification"); +// } + +// await session.setPasskeyChallenge(undefined); + +// const emailValidationToken = nanoid(32); +// const emailValidationTokenHash = +// await Bun.password.hash(emailValidationToken); + +// await db.user.create({ +// data: { +// email: session.currentPasskeyChallenge.email, +// name: name ?? session.currentPasskeyChallenge.email, +// type: "PASSKEY", +// emailValidationTokenExpiry: new Date(Date.now() + 10 * 60 * 1000), +// emailValidationTokenHash, + +// passkeyCredentialID: new TextDecoder().decode( +// verification.registrationInfo.credentialID, +// ), +// passkeyCredentialPublicKey: new TextDecoder().decode( +// verification.registrationInfo.credentialPublicKey, +// ), +// passkeyCredentialCounter: verification.registrationInfo.counter, +// passkeyCredentialDeviceType: +// verification.registrationInfo.credentialDeviceType, +// passkeyCredentialBackedUp: +// verification.registrationInfo.credentialBackedUp, +// }, +// }); + +// //TODO: report back errors in sending emails to the frontend in structured way +// await sendAccountConfirmationEmail({ +// email: session.currentPasskeyChallenge.email, +// locale, +// redirectLink: `${appConfiguration.email.EMAIL_VERIFY_REDIRECT_URL}?token=${emailValidationToken}&email=${session.currentPasskeyChallenge.email}`, +// }); +// }, +// { +// body: t.Object({ +// challenge: t.Any(), +// locale: t.Union([t.Literal("en"), t.Literal("de")]), +// name: t.Optional(t.String()), +// }), +// detail: { +// description: "Finalizes passkey setup.", +// tags: [openApiTag(import.meta.path)], +// }, +// }, +// ) +// .post( +// "/startLoginWithPasskey", +// async ({ body: { email }, session }) => { +// const user = await db.user.findUniqueOrThrow({ +// where: { +// email, +// }, +// }); + +// if (!user.emailValidated) { +// throw new Error("Email not validated"); +// } + +// if ( +// user.type !== "PASSKEY" || +// !user.passkeyCredentialBackedUp || +// !user.passkeyCredentialID || +// !user.passkeyCredentialPublicKey +// ) { +// throw new Error("User is not a passkey user"); +// } + +// const options = await generateAuthenticationOptions({ +// rpID: appConfiguration.passkeys.RELAY_ID, +// // Require users to use a previously-registered authenticator +// allowCredentials: [ +// { +// id: user.passkeyCredentialID, +// type: "public-key", +// // transports: authenticator.transports, +// }, +// ], +// userVerification: "preferred", +// }); +// }, +// { +// body: t.Object({ +// email: t.String(), +// }), +// detail: { +// description: "Login with a passkey", +// tags: [openApiTag(import.meta.path)], +// }, +// }, +// ); diff --git a/chase/backend/src/routes/auth/passwords.ts b/chase/backend/src/routes/auth/passwords.ts new file mode 100644 index 00000000..f6999a57 --- /dev/null +++ b/chase/backend/src/routes/auth/passwords.ts @@ -0,0 +1,180 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../../prisma/db"; +import { openApiTag } from "../../util/openApiTags"; +import { loggedIn } from "../../auth/guards/loggedIn"; + +const passwordRegex = + /^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8,}$/; + +export const passwords = new Elysia() + .use(loggedIn) + .post( + "/password", + async ({ body: { email, password, credentialCreateToken } }) => { + const foundEmail = await db.email.findUniqueOrThrow({ + where: { + email, + }, + include: { + user: { + include: { + passwords: true, + pendingCredentialCreationTasks: { include: { token: true } }, + }, + }, + }, + }); + + if (!foundEmail.validated) { + throw new Error("Email not validated"); + } + + if (!passwordRegex.test(password)) { + throw new Error("Password does not meet requirements"); + } + + const foundTask = ( + await Promise.all( + foundEmail.user.pendingCredentialCreationTasks.map(async (task) => ({ + ...task, + hit: await Bun.password.verify( + credentialCreateToken, + task.token.tokenHash, + ), + })), + ) + ).find((t) => t.hit); + + if (!foundTask) { + throw new Error("Invalid token"); + } + + if ( + ( + await Promise.all( + foundEmail.user.passwords.map(async (p) => ({ + ...p, + hit: await Bun.password.verify(password, p.passwordHash), + })), + ) + ).find((p) => p.hit) + ) { + throw new Error("Password already exists"); + } + + await db.password.create({ + data: { + passwordHash: await Bun.password.hash(password), + user: { + connect: { + id: foundEmail.userId, + }, + }, + }, + }); + + await db.pendingCredentialCreateTask.delete({ + where: { + id: foundTask.id, + }, + }); + + await db.token.delete({ + where: { + id: foundTask.token.id, + }, + }); + }, + { + body: t.Object({ + email: t.String(), + password: t.String(), + credentialCreateToken: t.String(), + }), + detail: { + description: "Login with a password", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .delete( + "/password", + async ({ body: { password }, session }) => { + const user = await db.user.findUniqueOrThrow({ + where: { + id: session.userData.id, + }, + include: { passwords: true }, + }); + + const foundPassword = ( + await Promise.all( + user.passwords.map(async (p) => ({ + ...p, + hit: await Bun.password.verify(password, p.passwordHash), + })), + ) + ).find((p) => p.hit); + + if (!foundPassword) { + throw new Error("Password not found"); + } + + await db.password.delete({ + where: { + id: foundPassword.id, + }, + }); + }, + { + mustBeLoggedIn: true, + body: t.Object({ + password: t.String(), + }), + detail: { + description: "Delete a password", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/password/login", + async ({ body: { email, password }, session }) => { + const foundEmail = await db.email.findUniqueOrThrow({ + where: { + email, + }, + include: { user: { include: { passwords: true } } }, + }); + + if (!foundEmail.validated) { + throw new Error("Email not validated"); + } + if ( + !( + await Promise.all( + foundEmail.user.passwords.map((p) => + Bun.password.verify(password, p.passwordHash), + ), + ) + ).some((p) => p) + ) { + throw new Error("Invalid password"); + } + + session.setLoggedIn(true); + session.setUserData({ + id: foundEmail.user.id, + }); + }, + { + body: t.Object({ + email: t.String(), + password: t.String(), + }), + detail: { + description: "Login with a password", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/baseData.ts b/chase/backend/src/routes/baseData.ts new file mode 100644 index 00000000..9517f4d4 --- /dev/null +++ b/chase/backend/src/routes/baseData.ts @@ -0,0 +1,20 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../prisma/db"; +import { loggedIn } from "../auth/guards/loggedIn"; +import { Nation } from "../../prisma/generated/schema"; +import { openApiTag } from "../util/openApiTags"; + +export const baseData = new Elysia({ prefix: "/baseData" }) + .use(loggedIn) + .get( + "/countries", + () => db.nation.findMany({ select: { id: true, alpha3Code: true } }), + { + mustBeLoggedIn: true, + response: t.Array(t.Omit(Nation, ["delegations"])), + detail: { + description: "Get all nations in the system", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/committee.ts b/chase/backend/src/routes/committee.ts new file mode 100644 index 00000000..c3db4140 --- /dev/null +++ b/chase/backend/src/routes/committee.ts @@ -0,0 +1,301 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../prisma/db"; +import { committeeRoleGuard } from "../auth/guards/committeeRoles"; +import { conferenceRoleGuard } from "../auth/guards/conferenceRoles"; +import { openApiTag } from "../util/openApiTags"; +import { AgendaItem, Committee, Nation } from "../../prisma/generated/schema"; + +const CommitteeWithOnlyParentCommitteeRelation = t.Omit(Committee, [ + "conference", + "members", + "subCommittees", +]); +const CommitteeWithoutRelations = t.Omit( + CommitteeWithOnlyParentCommitteeRelation, + ["parentId"], +); + +const CommitteeData = t.Omit(CommitteeWithOnlyParentCommitteeRelation, [ + "id", + "conferenceId", + "parent", +]); + +export const committee = new Elysia({ + prefix: "/conference/:conferenceId", +}) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + .get( + "/committee", + async ({ params: { conferenceId } }) => { + return ( + await db.committee.findMany({ + where: { + conferenceId, + }, + include: { agendaItems: true }, + orderBy: { + abbreviation: "asc", + }, + }) + ).map((c) => ({ + ...c, + parentId: c.parentId ?? undefined, + statusHeadline: c.statusHeadline ?? undefined, + statusUntil: c.statusUntil ?? undefined, + parent: c.parentId ? { id: c.parentId } : undefined, + })); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all committees in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .get( + "/committee/:committeeId/allCountryCodes", + async ({ params: { conferenceId, committeeId } }) => { + const delegation = await db.delegation.findMany({ + where: { + members: { + some: { + committeeId, + }, + }, + }, + select: { + nation: true, + }, + }); + + return delegation.map((d) => d.nation); + }, + { + hasConferenceRole: "any", + response: t.Array(t.Pick(Nation, ["alpha3Code", "id"])), + detail: { + description: "Get all country codes of a committee", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/committee", + async ({ body, params: { conferenceId } }) => { + const res = await db.committee.create({ + data: { + abbreviation: body.abbreviation, + category: body.category, + conferenceId, + name: body.name, + parentId: body.parentId, + }, + }); + + return { + ...res, + parentId: res.parentId ?? undefined, + }; + }, + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Create a new committee in this conference", + tags: [openApiTag(import.meta.path)], + }, + body: t.Pick(Committee, ["name", "abbreviation", "category", "parentId"]), + }, + ) + .delete( + "/committee", + ({ params: { conferenceId } }) => + db.committee.deleteMany({ where: { conferenceId } }), + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Delete all committees in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .get( + "/committee/:committeeId", + ({ params: { conferenceId, committeeId } }) => { + return db.committee.findUniqueOrThrow({ + where: { conferenceId, id: committeeId }, + include: { + agendaItems: true, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get a single committee by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .delete( + "/committee/:committeeId", + ({ params: { conferenceId, committeeId } }) => + db.committee.delete({ where: { id: committeeId, conferenceId } }), + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Delete a committee by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .patch( + "/committee/:committeeId", + ({ params: { conferenceId, committeeId }, body }) => { + return db.committee.update({ + where: { id: committeeId, conferenceId }, + data: { + name: body.name, + abbreviation: body.abbreviation, + category: body.category, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: CommitteeData, + detail: { + description: "Update a committee by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + // Committee Status + .post( + "/committee/:committeeId/status", + ({ params: { conferenceId, committeeId }, body }) => { + return db.committee.update({ + where: { id: committeeId, conferenceId }, + data: { + status: body.status, + statusHeadline: body.statusHeadline, + statusUntil: body.statusUntil, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: t.Pick(Committee, ["status", "statusHeadline", "statusUntil"]), + detail: { + description: "Update the status of a committee by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/committee/:committeeId/stateOfDebate", + ({ params: { conferenceId, committeeId }, body }) => { + return db.committee.update({ + where: { id: committeeId, conferenceId }, + data: { + stateOfDebate: body.stateOfDebate, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: t.Pick(Committee, ["stateOfDebate"]), + detail: { + description: "Update the state of debate of a committee by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .get( + "/committee/:committeeId/delegations", + ({ params: { conferenceId, committeeId } }) => { + return db.delegation.findMany({ + where: { + members: { + some: { + committeeId, + }, + }, + }, + include: { + nation: true, + members: { + where: { + committeeId, + }, + select: { + presence: true, + id: true, + }, + }, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all delegations of a committee", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/committee/:committeeId/delegations/toggleAllowAddingThemselvesToSpeakersList", + async ({ params: { conferenceId, committeeId } }) => { + const committee = await db.committee.findUnique({ + where: { id: committeeId, conferenceId }, + }); + + if (!committee) { + throw new Error("Committee not found"); + } + + return db.committee.update({ + where: { id: committeeId, conferenceId }, + data: { + allowDelegationsToAddThemselvesToSpeakersList: + !committee.allowDelegationsToAddThemselvesToSpeakersList, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + detail: { + description: + "Toggle the ability for delegations to add themselves to the speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + // Whiteboard + .post( + "/committee/:committeeId/whiteboard", + ({ params: { conferenceId, committeeId }, body }) => { + return db.committee.update({ + where: { id: committeeId, conferenceId }, + data: { + whiteboardContent: body.whiteboardContent, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: t.Pick(Committee, ["whiteboardContent"]), + detail: { + description: "Update the whiteboard content of a committee by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/conference.ts b/chase/backend/src/routes/conference.ts new file mode 100644 index 00000000..d6065d1a --- /dev/null +++ b/chase/backend/src/routes/conference.ts @@ -0,0 +1,186 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../prisma/db"; +import { conferenceRoleGuard } from "../auth/guards/conferenceRoles"; +import { + Conference, + ConferenceCreateToken, + User, +} from "../../prisma/generated/schema"; +import { openApiTag } from "../util/openApiTags"; +import { loggedIn } from "../auth/guards/loggedIn"; + +const ConferenceWithoutRelations = t.Omit(Conference, [ + "committees", + "delegations", + "members", + "", +]); + +const ConferenceData = t.Omit(ConferenceWithoutRelations, ["id"]); + +export const conference = new Elysia() + .use(loggedIn) + .use(conferenceRoleGuard) // we inject the conferenceRole macro here + .get( + "/conference", + async () => { + return await db.conference.findMany(); + }, + { + isLoggedIn: true, + detail: { + description: "Get all conferences", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/conference", + async ({ body, session }) => { + // run this in a transaction, so if setting the permission/deleting the token fails, the conference is not created + const r = await db.$transaction(async (tx) => { + await tx.conferenceCreateToken.delete({ + where: { token: body.token }, + }); + + return await tx.conference.create({ + data: { + name: body.name, + start: body.start, + end: body.end, + // TODO: add the user that created the conference as an admin + // members: { + // create: { + // role: "ADMIN", + // user: { + // connect: { + // id: session.userData.id, + // }, + // }, + // }, + // }, + }, + }); + }); + + return { + id: r.id, + name: r.name, + end: r.end?.toISOString(), + start: r.start?.toISOString(), + }; + }, + { + isLoggedIn: true, + detail: { + description: "Create a new conference, consumes a token", + tags: [openApiTag(import.meta.path)], + }, + body: t.Composite([ConferenceData, ConferenceCreateToken]), + response: ConferenceWithoutRelations, + }, + ) + .get( + "/conference/:conferenceId", + async ({ params: { conferenceId } }) => { + const r = await db.conference.findUniqueOrThrow({ + where: { id: conferenceId }, + }); + + return { + id: r.id, + name: r.name, + start: r.start?.toISOString(), + end: r.end?.toISOString(), + }; + }, + { + isLoggedIn: true, + detail: { + description: "Get a single conference by id", + tags: [openApiTag(import.meta.path)], + }, + response: ConferenceWithoutRelations, + }, + ) + .patch( + "/conference/:conferenceId", + async ({ params: { conferenceId }, body }) => { + return db.conference.update({ + where: { id: conferenceId }, + data: { + name: body.name, + start: body.start, + end: body.end, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: ConferenceData, + detail: { + description: "Update a conference by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .patch( + "/conference/:conferenceId/addAdmin", + async ({ params: { conferenceId }, body }) => { + return db.conferenceMember.upsert({ + where: { + userId_conferenceId: { + conferenceId, + userId: body.user.id, + }, + }, + update: { + role: "ADMIN", + }, + create: { + role: "ADMIN", + user: { + connect: { + id: body.user.id, + }, + }, + conference: { + connect: { + id: conferenceId, + }, + }, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: t.Object({ + user: t.Pick(User, ["id"]), + }), + detail: { + description: "Add an admin to a conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .delete( + "/conference/:conferenceId", + ({ params: { conferenceId } }) => + db.conference.delete({ where: { id: conferenceId } }), + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Delete a conference by id", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .get("/conference/:conferenceId/checkAdminAccess", () => true, { + hasConferenceRole: ["ADMIN"], + response: t.Boolean(), + detail: { + description: + "Check if you are an admin of a conference. Returns true or errors in case you are not an admin.", + tags: [openApiTag(import.meta.path)], + }, + }); diff --git a/chase/backend/src/routes/conference/committee.ts b/chase/backend/src/routes/conference/committee.ts deleted file mode 100644 index 450d39e2..00000000 --- a/chase/backend/src/routes/conference/committee.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { t, Elysia } from "elysia"; -import { db } from "../../../prisma/db"; -import { auth } from "../../plugins/auth"; - -//TODO how are auth issuer roles/metadata removed from related users when the entity is deleted? - -export const committee = new Elysia() - .use(auth) - .get( - "/conference/:conferenceId/committee/list", - async ({ params: { conferenceId } }) => { - return db.committee.findFirstOrThrow({ where: { conferenceId } }); - } - ) - .post( - "/conference/:conferenceId/committee", - async ({ auth, body, params: { conferenceId } }) => { - if (!auth.permissions.isConferenceAdmin(conferenceId)) { - return new Response(null, { status: 401 }); - } - - return db.committee.create({ - data: { - name: body.name, - abbreviation: body.abbreviation, - conferenceId, - }, - }); - }, - { - detail: { - description: "Creates a committee on this conference", - }, - body: t.Object({ - name: t.String(), - abbreviation: t.String(), - }), - } - ) - .delete( - "/conference/:conferenceId/committee/:committeeId", - ({ auth, params: { committeeId, conferenceId } }) => { - if (!auth.permissions.isConferenceAdmin(conferenceId)) { - return new Response(null, { status: 401 }); - } - - return db.committee.delete({ where: { conferenceId, id: committeeId } }); - } - ); diff --git a/chase/backend/src/routes/conference/index.ts b/chase/backend/src/routes/conference/index.ts deleted file mode 100644 index c79d23ef..00000000 --- a/chase/backend/src/routes/conference/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { t, Elysia } from "elysia"; -import { auth } from "../../plugins/auth"; -import { db } from "../../../prisma/db"; - -export const conference = new Elysia({ prefix: "/conference" }) - .use(auth) - .get("/list", () => db.conference.findMany()) - .post( - "", - ({ body, auth }) => { - // run this in a transaction, so if setting the permission/deleting the token fails, the conference is not created - return db.$transaction(async (tx) => { - await tx.conferenceCreateToken.delete({ - where: { token: body.token }, - }); - - const newConference = await tx.conference.create({ - data: { - name: body.name, - start: body.time?.start, - end: body.time?.end, - }, - }); - - // do this last so the db is set beforehand. If that fails we can't easily roll back the perms as the db transaction - // so try to make permission calls last in transaction - await auth?.permissions.setConferenceAdmin(newConference.id); - - return newConference; - }); - }, - { - detail: { - description: "Creates a conference and consumes the creation token", - }, - body: t.Object({ - name: t.String({ minLength: 3 }), - token: t.String(), - time: t.Optional( - t.Object({ - start: t.Date({ minimumTimestamp: Date.now() }), - end: t.Date({ exclusiveMinimumTimestamp: Date.now() }), - }) - ), - }), - } - ) - .get("/:conferenceId", ({ params: { conferenceId } }) => - db.conference.findFirstOrThrow({ where: { id: conferenceId } }) - ) - .delete("/:conferenceId", ({ auth, params: { conferenceId } }) => { - if (!auth.permissions.isConferenceAdmin(conferenceId)) { - return new Response(null, { status: 401 }); - } - return db.conference.delete({ where: { id: conferenceId } }); - }); diff --git a/chase/backend/src/routes/conferenceMember.ts b/chase/backend/src/routes/conferenceMember.ts new file mode 100644 index 00000000..64543d7c --- /dev/null +++ b/chase/backend/src/routes/conferenceMember.ts @@ -0,0 +1,99 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../prisma/db"; +import { conferenceRoleGuard } from "../auth/guards/conferenceRoles"; +import { ConferenceMember } from "../../prisma/generated/schema"; +import { openApiTag } from "../util/openApiTags"; +import { loggedIn } from "../auth/guards/loggedIn"; +import { committeeRoleGuard } from "../auth/guards/committeeRoles"; + +const ConferenceMembersWithoutRelations = t.Omit(ConferenceMember, [ + "user", + "conference", +]); + +const ConferenceMemberCreationBody = t.Object({ + data: t.Pick(ConferenceMember, ["role"]), + count: t.Number({ default: 1, minimum: 1 }), +}); + +export const conferenceMember = new Elysia({ + prefix: "/conference/:conferenceId", +}) + .use(loggedIn) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + .get( + "/member", + ({ params: { conferenceId } }) => { + return db.conferenceMember.findMany({ + where: { + conferenceId, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + response: [ConferenceMembersWithoutRelations], + detail: { + description: "Get all conference-members in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/member", + ({ params: { conferenceId }, body }) => { + const createManyData = []; + for (let i = 0; i < body.count; i++) { + createManyData.push({ role: body.data.role, conferenceId }); + } + + return db.conferenceMember.createMany({ + data: createManyData, + }); + }, + { + hasConferenceRole: ["ADMIN"], + response: [ConferenceMembersWithoutRelations], + body: ConferenceMemberCreationBody, + detail: { + description: + "Create a new conference-member in this conference. Must provide a role and count (how many members of this role to create) in the body.", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .delete( + "/member", + ({ params: { conferenceId } }) => { + return db.conferenceMember.deleteMany({ + where: { + conferenceId, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Delete all conference-members in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .delete( + "/member/:memberId", + ({ params: { memberId } }) => { + return db.conferenceMember.delete({ + where: { + id: memberId, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + detail: { + description: "Delete a specific conference-member in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/delegation.ts b/chase/backend/src/routes/delegation.ts new file mode 100644 index 00000000..3228c8ef --- /dev/null +++ b/chase/backend/src/routes/delegation.ts @@ -0,0 +1,169 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../prisma/db"; +import { committeeRoleGuard } from "../auth/guards/committeeRoles"; +import { conferenceRoleGuard } from "../auth/guards/conferenceRoles"; +import { openApiTag } from "../util/openApiTags"; +import { + CommitteeMember, + Delegation, + Nation, +} from "../../prisma/generated/schema"; + +const DelegationBody = t.Pick(Nation, ["alpha3Code"]); + +export const delegation = new Elysia({ + prefix: "/conference/:conferenceId", +}) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + .get( + "/delegation", + ({ params: { conferenceId } }) => { + return db.delegation.findMany({ + where: { + conferenceId, + }, + include: { + nation: true, + members: true, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all delegations in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/delegation", + ({ body, params: { conferenceId } }) => { + return db.delegation.create({ + data: { + conference: { connect: { id: conferenceId } }, + nation: { connect: { alpha3Code: body.alpha3Code } }, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: DelegationBody, + detail: { + description: "Create a new delegation in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .get( + "/delegation/:delegationId", + ({ params: { delegationId } }) => { + return db.delegation.findUnique({ + where: { + id: delegationId, + }, + include: { + members: true, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get a specific delegation in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .delete( + "/delegation/:delegationId", + ({ params: { delegationId } }) => { + return db.$transaction([ + db.committeeMember.deleteMany({ + where: { + id: delegationId, + }, + }), + db.delegation.delete({ + where: { + id: delegationId, + }, + }), + ]); + }, + { + hasConferenceRole: ["ADMIN"], + detail: { + description: + "Delete a delegation and all its committee members in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + .post( + "/delegation/:delegationId/committee/:committeeId", + async ({ params: { delegationId, committeeId }, set }) => { + const committeeMember = await db.committeeMember.findFirst({ + where: { + committeeId, + delegationId, + }, + }); + + if (committeeMember) { + return db.committeeMember.delete({ + where: { + id: committeeMember.id, + }, + }); + } + + return await db.committeeMember.create({ + data: { + committeeId, + delegationId, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + detail: { + description: + "Connect a committee to a delegation in this conference. If the committee is already connected to the delegation, it will be disconnected.", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + // Presence + .post( + "/delegation/:delegationId/presence/:memberId", + ({ body, params: { delegationId, memberId } }) => { + return db.delegation.update({ + where: { + id: delegationId, + }, + data: { + members: { + update: { + where: { + id: memberId, + }, + data: { + presence: body.presence, + }, + }, + }, + }, + }); + }, + { + hasConferenceRole: ["ADMIN"], + body: t.Pick(CommitteeMember, ["presence"]), + detail: { + description: "Update a member's presence in a delegation", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/export.ts b/chase/backend/src/routes/export.ts new file mode 100644 index 00000000..92a29516 --- /dev/null +++ b/chase/backend/src/routes/export.ts @@ -0,0 +1,139 @@ +import { t, Elysia } from "elysia"; +import { conferenceRoleGuard } from "../auth/guards/conferenceRoles"; +import { openApiTag } from "../util/openApiTags"; +import { + AgendaItem, + Committee, + CommitteeMember, + Conference, + ConferenceMember, + Delegation, + Email, + User, +} from "../../prisma/generated/schema"; +import { Value } from "@sinclair/typebox/value"; +import { db } from "../../prisma/db"; +import { user } from "./user"; +import { nullToUndefined } from "../util/nullToUndefined"; + +//TODO ensure to other conferences can be edited when importing again + +const Data = t.Composite([ + t.Omit(Conference, [ + "committees", + "delegations", + "members", + "researchServiceMessagees", + ]), + t.Object({ + committees: t.Array( + t.Composite([ + t.Omit(Committee, [ + "conference", + "conferenceId", + "members", + "parent", + "subCommittees", + "messages", + "agendaItems", + ]), + t.Object({ + members: t.Omit(CommitteeMember, [ + "committee", + "user", + "speakerLists", + "delegation", + "presence", + ]), + agendaItems: t.Array( + t.Omit(AgendaItem, ["committee", "speakerLists"]), + ), + }), + ]), + ), + members: t.Array( + t.Composite([ + t.Omit(ConferenceMember, [ + "conference", + "conferenceId", + "user", + "nonStateActor", + ]), + t, + Object({ + user: t.Composite([ + t.Omit(User, [ + "conferenceMemberships", + "committeeMemberships", + "researchServiceMessages", + "chairMessages", + "emails", + "passwords", + "pendingCredentialCreationTasks", + ]), + t.Object({ + emails: t.Array( + t.Omit(Email, [ + "user", + "userId", + "validationToken", + "validationTokenId", + ]), + ), + }), + ]), + }), + ]), + ), + delegations: t.Array( + t.Omit(Delegation, ["conference", "conferenceId", "nation", "members"]), + ), + }), +]); + +export const committee = new Elysia({ + prefix: "/conference/:conferenceId", +}) + .use(conferenceRoleGuard) + .post( + "/export", + async ({ params: { conferenceId } }) => { + const res = await db.conference.findUniqueOrThrow({ + where: { id: conferenceId }, + include: { + committees: { + include: { + members: true, + agendaItems: true, + }, + }, + members: { + include: { + user: { + include: { + emails: { + select: { + email: true, + validated: true, + }, + }, + }, + }, + }, + }, + delegations: true, + }, + }); + + Value.Clean(Data, res); + return nullToUndefined(res); + }, + { + hasConferenceRole: ["ADMIN"], + response: Data, + detail: { + description: "Export the conference data", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/messages.ts b/chase/backend/src/routes/messages.ts new file mode 100644 index 00000000..d71ffcc7 --- /dev/null +++ b/chase/backend/src/routes/messages.ts @@ -0,0 +1,270 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../prisma/db"; +import { committeeRoleGuard } from "../auth/guards/committeeRoles"; +import { conferenceRoleGuard } from "../auth/guards/conferenceRoles"; +import { openApiTag } from "../util/openApiTags"; +import { Message } from "../../prisma/generated/schema"; +import { $Enums } from "../../prisma/generated/client"; + +export const messages = new Elysia({ + prefix: "", +}) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + .get( + "/conference/:conferenceId/messages/researchService", + ({ params: { conferenceId } }) => { + return db.message.findMany({ + where: { + committee: { + conferenceId, + }, + forwarded: true, + NOT: { + status: { + has: $Enums.MessageStatus.ARCHIVED, + }, + }, + }, + include: { + author: { + select: { + id: true, + name: true, + emails: true, + }, + }, + }, + orderBy: { + timestamp: "asc", + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all research service messages in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .get( + "/conference/:conferenceId/committee/:committeeId/messages", + ({ params: { committeeId } }) => { + return db.message.findMany({ + where: { + committeeId, + forwarded: false, + NOT: { + status: { + has: $Enums.MessageStatus.ARCHIVED, + }, + }, + }, + include: { + author: { + select: { + id: true, + name: true, + emails: true, + }, + }, + }, + orderBy: { + timestamp: "asc", + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all messages for the chair in this committee", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/conference/:conferenceId/committee/:committeeId/messages", + ({ body, params: { committeeId } }) => { + return db.message.create({ + data: { + committee: { connect: { id: committeeId } }, + subject: body.subject, + message: body.message, + author: { connect: { id: body.authorId } }, + timestamp: new Date(Date.now()), + metaEmail: body.metaEmail, + metaDelegation: body.metaDelegation, + metaCommittee: body.metaCommittee, + metaAgendaItem: body.metaAgendaItem, + category: body.category, + }, + }); + }, + { + hasConferenceRole: "any", + body: t.Pick(Message, [ + "subject", + "message", + "authorId", + "metaEmail", + "metaDelegation", + "metaCommittee", + "metaAgendaItem", + "category", + ]), + detail: { + description: "Create a new message", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .get( + "/conference/:conferenceId/messages/count", + async ({ params: { conferenceId } }) => { + return await db.message.count({ + where: { + committee: { + conferenceId, + }, + forwarded: true, + status: { + has: $Enums.MessageStatus.UNREAD, + }, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: + "Get the number of unread messages to the research service in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .get( + "/conference/:conferenceId/committee/:committeeId/messages/count", + ({ params: { committeeId } }) => { + return db.message.count({ + where: { + committeeId, + forwarded: false, + status: { + has: $Enums.MessageStatus.UNREAD, + }, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: + "Get the number of unread messages for the chair in this committee", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/message/:messageId/setStatus", + async ({ body, params: { messageId }, set }) => { + const message = await db.message.findUnique({ + where: { id: messageId }, + }); + + if (!message) { + set.status = "Not Found"; + throw new Error("Message not found"); + } + + if (!body?.status) { + set.status = "Bad Request"; + throw new Error("Status is required"); + } + + const updatedArray: $Enums.MessageStatus[] = message.status; + updatedArray.push(body.status as $Enums.MessageStatus); + + return await db.message.update({ + where: { id: messageId }, + data: { + status: updatedArray, + }, + }); + }, + { + hasConferenceRole: "any", + body: t.Object({ status: t.String() }), + detail: { + description: "Set a Status for a message from the MessageStatus enum", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/message/:messageId/removeStatus", + async ({ body, params: { messageId }, set }) => { + const message = await db.message.findUnique({ + where: { id: messageId }, + }); + + if (!message) { + set.status = "Not Found"; + throw new Error("Message not found"); + } + + if (!body?.status) { + set.status = "Bad Request"; + throw new Error("Status is required"); + } + + if (!message.status.includes(body.status as $Enums.MessageStatus)) { + set.status = "Bad Request"; + throw new Error("Message does not have this status"); + } + + const updatedArray: $Enums.MessageStatus[] = message.status.filter( + (status) => status !== body.status, + ); + + return await db.message.update({ + where: { id: messageId }, + data: { + status: updatedArray, + }, + }); + }, + { + hasConferenceRole: "any", + body: t.Object({ status: t.String() }), + detail: { + description: "Set a Status for a message from the MessageStatus enum", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/message/:messageId/forwardToResearchService", + async ({ params: { messageId } }) => { + return await db.message.update({ + where: { id: messageId }, + data: { + forwarded: true, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Forward a message to the research service", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/speakersList/general.ts b/chase/backend/src/routes/speakersList/general.ts new file mode 100644 index 00000000..ea785098 --- /dev/null +++ b/chase/backend/src/routes/speakersList/general.ts @@ -0,0 +1,136 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../../prisma/db"; +import { committeeRoleGuard } from "../../auth/guards/committeeRoles"; +import { conferenceRoleGuard } from "../../auth/guards/conferenceRoles"; +import { openApiTag } from "../../util/openApiTags"; +import { $Enums } from "../../../prisma/generated/client"; + +export const speakersListGeneral = new Elysia({ + prefix: "/conference/:conferenceId/committee/:committeeId", +}) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + .get( + "/speakersList", + async ({ params: { conferenceId, committeeId }, set }) => { + const agendaItem = await db.agendaItem.findFirst({ + where: { + committeeId, + isActive: true, + }, + }); + + if (!agendaItem) { + set.status = "Not Found"; + throw new Error("No active agenda item found"); + } + + const speakersList = await db.speakersList.findMany({ + where: { + agendaItemId: agendaItem.id, + }, + include: { + speakers: { + include: { + committeeMember: { + include: { + delegation: { + include: { + nation: { + select: { + alpha3Code: true, + }, + }, + }, + }, + }, + }, + }, + orderBy: { + position: "asc", + }, + }, + }, + }); + + return speakersList; + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all speakers lists in this committee", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .get( + "/speakersList/:type", + async ({ params: { conferenceId, committeeId, type }, set }) => { + const agendaItem = await db.agendaItem.findFirst({ + where: { + committeeId, + isActive: true, + }, + }); + + if (!agendaItem) { + set.status = "Not Found"; + throw new Error("No active agenda item found"); + } + + if (!Object.values($Enums.SpeakersListCategory).includes(type)) { + set.status = "Bad Request"; + throw new Error("Invalid speakers list type"); + } + + return await db.speakersList.findFirst({ + where: { + agendaItemId: agendaItem.id, + type: type as $Enums.SpeakersListCategory, + }, + include: { + speakers: { + include: { + committeeMember: { + select: { + id: true, + userId: true, + delegation: { + select: { + id: true, + nation: { + select: { + alpha3Code: true, + }, + }, + }, + }, + }, + }, + }, + orderBy: { + position: "asc", + }, + }, + agendaItem: { + select: { + id: true, + committee: { + select: { + allowDelegationsToAddThemselvesToSpeakersList: true, + }, + }, + }, + }, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get a single speakers list by type", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/speakersList/modification.ts b/chase/backend/src/routes/speakersList/modification.ts new file mode 100644 index 00000000..f36a89cd --- /dev/null +++ b/chase/backend/src/routes/speakersList/modification.ts @@ -0,0 +1,299 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../../prisma/db"; +import { committeeRoleGuard } from "../../auth/guards/committeeRoles"; +import { conferenceRoleGuard } from "../../auth/guards/conferenceRoles"; +import { openApiTag } from "../../util/openApiTags"; + +function calculateTimeLeft( + startTimestamp: Date | null | undefined, + stopTimestamp: Date, + speakingTime: number | null | undefined, +): number { + if (startTimestamp && speakingTime) { + const timeElapsed = + (stopTimestamp.getTime() - startTimestamp.getTime()) / 1000; + return Math.floor(speakingTime - timeElapsed); + } + return 0; +} + +export const speakersListModification = new Elysia({ + prefix: "/speakersList/:speakersListId", +}) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + .post( + "/setSpeakingTime", + async ({ params: { speakersListId }, body }) => { + const speakersList = await db.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + speakingTime: body.speakingTime, + }, + }); + + return speakersList; + }, + { + hasConferenceRole: "any", + body: t.Object({ + speakingTime: t.Number(), + }), + detail: { + description: "Set the time for a speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/close", + async ({ params: { speakersListId } }) => { + const speakersList = await db.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + isClosed: true, + }, + }); + + return speakersList; + }, + { + hasConferenceRole: "any", + detail: { + description: "Close a speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/open", + async ({ params: { speakersListId } }) => { + const speakersList = await db.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + isClosed: false, + }, + }); + + return speakersList; + }, + { + hasConferenceRole: "any", + detail: { + description: "Open a speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/startTimer", + async ({ params: { speakersListId } }, res) => { + const speakersList = await db.speakersList.findUnique({ + where: { + id: speakersListId, + }, + include: { + agendaItem: { + select: { + speakerLists: { + select: { + id: true, + type: true, + }, + }, + }, + }, + }, + }); + + if (!speakersList) { + res.status = "Not Found"; + throw new Error("Speakers List not found"); + } + + return await db.$transaction(async (tx) => { + if (speakersList.type === "COMMENT_LIST") { + await tx.speakersList.update({ + where: { + id: speakersList.agendaItem.speakerLists.find( + (sl) => sl.type === "SPEAKERS_LIST", + )?.id, + }, + data: { + startTimestamp: null, + timeLeft: speakersList.speakingTime, + }, + }); + } else if (speakersList.type === "SPEAKERS_LIST") { + await tx.speakersList.update({ + where: { + id: speakersList.agendaItem.speakerLists.find( + (sl) => sl.type === "COMMENT_LIST", + )?.id, + }, + data: { + startTimestamp: null, + }, + }); + } + + await tx.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + startTimestamp: new Date(Date.now()), + timeLeft: speakersList?.timeLeft ?? speakersList?.speakingTime, + }, + }); + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Start the timer for a speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/stopTimer", + async ({ params: { speakersListId } }) => { + const speakersList = await db.speakersList.findUnique({ + where: { + id: speakersListId, + }, + }); + + return await db.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + timeLeft: calculateTimeLeft( + speakersList?.startTimestamp, + new Date(Date.now()), + speakersList?.timeLeft, + ), + startTimestamp: null, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Stop the timer for a speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/resetTimer", + async ({ params: { speakersListId } }) => { + const SpeakersList = await db.speakersList.findUnique({ + where: { + id: speakersListId, + }, + }); + + return await db.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + startTimestamp: SpeakersList?.startTimestamp + ? new Date(Date.now()) + : null, + timeLeft: SpeakersList?.speakingTime, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Reset the timer for a speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/increaseSpeakingTime", + async ({ params: { speakersListId }, body, set }) => { + const speakersList = await db.speakersList.findUnique({ + where: { + id: speakersListId, + }, + }); + + if (!speakersList?.timeLeft) { + set.status = "Bad Request"; + throw new Error("No time set, increase not possible"); + } + + return await db.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + timeLeft: speakersList?.timeLeft + body.amount, + }, + }); + }, + { + hasConferenceRole: "any", + body: t.Object({ + amount: t.Number(), + }), + detail: { + description: "Increase the speaking time for a speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/decreaseSpeakingTime", + async ({ params: { speakersListId }, body, set }) => { + const speakersList = await db.speakersList.findUnique({ + where: { + id: speakersListId, + }, + }); + + if (!speakersList?.timeLeft) { + set.status = "Bad Request"; + throw new Error("No time set, decrease not possible"); + } + + return await db.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + timeLeft: speakersList?.timeLeft - body.amount, + }, + }); + }, + { + hasConferenceRole: "any", + body: t.Object({ + amount: t.Number(), + }), + detail: { + description: "Decrease the speaking time for a speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/speakersList/speakers.ts b/chase/backend/src/routes/speakersList/speakers.ts new file mode 100644 index 00000000..16c86b3e --- /dev/null +++ b/chase/backend/src/routes/speakersList/speakers.ts @@ -0,0 +1,597 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../../prisma/db"; +import { committeeRoleGuard } from "../../auth/guards/committeeRoles"; +import { conferenceRoleGuard } from "../../auth/guards/conferenceRoles"; +import { openApiTag } from "../../util/openApiTags"; +import { $Enums } from "../../../prisma/generated/client"; + +async function calculatePosition(speakersListId: string) { + const maxPosition = await db.speakerOnList.aggregate({ + _max: { + position: true, + }, + where: { + speakersListId, + }, + }); + + const newPosition = (maxPosition._max.position ?? 0) + 1; + + return newPosition; +} + +async function createSpeakerOnList( + speakersListId: string, + committeeMemberId: string, +) { + return await db.speakerOnList.create({ + data: { + speakersListId, + committeeMemberId, + position: await calculatePosition(speakersListId), + }, + }); +} + +export const speakersListSpeakers = new Elysia({ + prefix: "/speakersList/:speakersListId", +}) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + + .get( + "", + async ({ params: { speakersListId } }) => { + return await db.speakersList.findUnique({ + where: { + id: speakersListId, + }, + include: { + speakers: { + include: { + committeeMember: { + select: { + id: true, + userId: true, + delegation: { + select: { + id: true, + nation: { + select: { + alpha3Code: true, + }, + }, + }, + }, + }, + }, + }, + }, + agendaItem: { + select: { + id: true, + committee: { + select: { + allowDelegationsToAddThemselvesToSpeakersList: true, + }, + }, + }, + }, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get all speakers on the speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/addSpeaker/committeeMember/:committeeMemberId", + async ({ params: { speakersListId, committeeMemberId } }) => { + return await createSpeakerOnList(speakersListId, committeeMemberId); + }, + { + hasConferenceRole: "any", + detail: { + description: + "Add a speaker to the speakers list by chairs via committeeMemberId", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/addSpeaker/user/:userId", + async ({ params: { speakersListId, userId }, set }) => { + const speakersList = await db.speakersList.findUnique({ + where: { + id: speakersListId, + }, + include: { + agendaItem: { + select: { + id: true, + committee: { + select: { + allowDelegationsToAddThemselvesToSpeakersList: true, + }, + }, + }, + }, + speakers: { + select: { + committeeMember: { + select: { + id: true, + }, + }, + }, + }, + }, + }); + + const committeeMember = await db.committeeMember.findFirst({ + where: { + userId, + }, + }); + + if (!committeeMember) { + set.status = "Not Found"; + throw new Error("User not found"); + } + + if (!speakersList) { + set.status = "Not Found"; + throw new Error("Speakers list not found"); + } + + if ( + !speakersList.agendaItem.committee + .allowDelegationsToAddThemselvesToSpeakersList + ) { + set.status = "Forbidden"; + throw new Error( + "Speakers list does not allow speakers to add themselves", + ); + } + + if (speakersList.isClosed) { + set.status = "Forbidden"; + throw new Error("Speakers list is closed"); + } + + if (committeeMember.presence !== $Enums.Presence.PRESENT) { + set.status = "Forbidden"; + throw new Error("CommitteeMember is not present in this committee"); + } + + if ( + speakersList.speakers.some( + (speaker) => speaker.committeeMember.id === committeeMember.id, + ) + ) { + set.status = "Conflict"; + throw new Error("Speaker is already on the list"); + } + + return await createSpeakerOnList( + speakersListId, + committeeMember.id, + ).catch((e) => { + if (e.code === "P2002") { + set.status = "Conflict"; + throw new Error("Speaker is already on the list"); + } + set.status = "Internal Server Error"; + throw new Error("Error adding speaker"); + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Add a speaker to the speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/addSpeaker/code/:countryCode", + async ({ params: { speakersListId, countryCode }, set }) => { + const committeeMember = await db.committeeMember.findFirst({ + where: { + delegation: { + nation: { + alpha3Code: countryCode, + }, + }, + }, + }); + + if (!committeeMember) { + set.status = "Not Found"; + throw new Error("Committee member not found"); + } + + return await createSpeakerOnList(speakersListId, committeeMember.id); + }, + { + hasConferenceRole: "any", + detail: { + description: + "Add a speaker to the speakers list for chairs via countryCode", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .delete( + "/removeSpeaker/:speakerId", + async ({ params: { speakerId } }) => { + return await db.speakerOnList.delete({ + where: { + id: speakerId, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Remove a speaker from the speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .delete( + "/removeSpeaker/user/:userId", + async ({ params: { speakersListId, userId }, set }) => { + const committeeMember = await db.committeeMember.findFirst({ + where: { + userId, + }, + }); + + if (!committeeMember) { + set.status = "Not Found"; + throw new Error("Committee member not found"); + } + + return await db.speakerOnList.deleteMany({ + where: { + speakersListId, + committeeMemberId: committeeMember.id, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Remove a speaker from the speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .delete( + "/clearList", + async ({ params: { speakersListId } }) => { + return await db.speakerOnList.deleteMany({ + where: { + speakersListId, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Clear the speakers list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/moveSpeaker/:speakerId/up", + async ({ params: { speakersListId, speakerId }, set }) => { + const speaker = await db.speakerOnList.findUnique({ + where: { + id: speakerId, + }, + }); + + if (!speaker) { + set.status = "Not Found"; + throw new Error("Speaker not found"); + } + + const previousSpeaker = await db.speakerOnList.findFirst({ + where: { + speakersListId, + position: speaker.position - 1, + }, + }); + + if (!previousSpeaker) { + return speaker; + } + + return await db.$transaction([ + db.speakerOnList.update({ + where: { + id: speakerId, + }, + data: { + position: -1, + }, + }), + db.speakerOnList.update({ + where: { + id: previousSpeaker.id, + }, + data: { + position: speaker.position, + }, + }), + db.speakerOnList.update({ + where: { + id: speakerId, + }, + data: { + position: previousSpeaker.position, + }, + }), + ]); + }, + { + hasConferenceRole: "any", + detail: { + description: "Move a speaker up in the list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/moveSpeaker/:speakerId/down", + async ({ params: { speakersListId, speakerId }, set }) => { + const speaker = await db.speakerOnList.findUnique({ + where: { + id: speakerId, + }, + }); + + if (!speaker) { + set.status = "Not Found"; + throw new Error("Speaker not found"); + } + + const nextSpeaker = await db.speakerOnList.findFirst({ + where: { + speakersListId, + position: speaker.position + 1, + }, + }); + + if (!nextSpeaker) { + return speaker; + } + + return await db.$transaction([ + db.speakerOnList.update({ + where: { + id: speakerId, + }, + data: { + position: -1, + }, + }), + db.speakerOnList.update({ + where: { + id: nextSpeaker.id, + }, + data: { + position: speaker.position, + }, + }), + db.speakerOnList.update({ + where: { + id: speakerId, + }, + data: { + position: nextSpeaker.position, + }, + }), + ]); + }, + { + hasConferenceRole: "any", + detail: { + description: "Move a speaker down in the list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/moveSpeaker/:speakerId/toTheTop", + async ({ params: { speakersListId, speakerId }, set }) => { + const speaker = await db.speakerOnList.findUnique({ + where: { + id: speakerId, + }, + }); + + if (!speaker) { + set.status = "Not Found"; + throw new Error("Speaker not found"); + } + + const speakerOriginalPosition = speaker.position; + + // Make sure the speaker is not already the first + const minPosition = await db.speakerOnList.aggregate({ + _min: { + position: true, + }, + where: { + speakersListId, + }, + }); + + if (minPosition._min.position === speaker.position) { + set.status = "Locked"; + throw new Error("Speaker is already at the top of the list"); + } + + const allSpeakers = await db.speakerOnList.findMany({ + where: { + speakersListId, + position: { + gte: minPosition._min.position ?? 1, + lt: speakerOriginalPosition, + }, + }, + orderBy: { + position: "desc", + }, + }); + + return await db.$transaction(async (tx) => { + await tx.speakerOnList.update({ + where: { + id: speakerId, + }, + data: { + position: -1, + }, + }); + + for (const s of allSpeakers) { + await tx.speakerOnList.update({ + where: { + id: s.id, + }, + data: { + position: s.position + 1, + }, + }); + } + await tx.speakerOnList.update({ + where: { + id: speakerId, + }, + data: { + position: minPosition._min.position ?? 1, + }, + }); + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Move a speaker to the top of the list", + tags: [openApiTag(import.meta.path)], + }, + }, + ) + + .post( + "/nextSpeaker", + async ({ params: { speakersListId }, set }) => { + const currentSpeaker = await db.speakerOnList.findFirst({ + where: { + speakersListId, + }, + orderBy: { + position: "asc", + }, + }); + + if (!currentSpeaker) { + set.status = "Not Found"; + throw new Error("No next speaker found"); + } + + const speakersList = await db.speakersList.findUnique({ + where: { + id: speakersListId, + }, + include: { + agendaItem: { + select: { + id: true, + }, + }, + }, + }); + + if (!speakersList) { + set.status = "Not Found"; + throw new Error("Speakers list not found"); + } + + const transaction = [ + db.speakerOnList.delete({ + where: { + id: currentSpeaker.id, + }, + }), + db.speakersList.update({ + where: { + id: speakersListId, + }, + data: { + startTimestamp: null, + timeLeft: speakersList.speakingTime, + }, + }), + ]; + + if (speakersList.type === "SPEAKERS_LIST") { + const correspondingCommentList = await db.speakersList.findFirst({ + where: { + agendaItemId: speakersList.agendaItem.id, + type: "COMMENT_LIST", + }, + }); + + if (!correspondingCommentList) { + set.status = "Not Found"; + throw new Error("Corresponding comment list not found"); + } + return await db.$transaction([ + db.speakerOnList.deleteMany({ + where: { + speakersListId: correspondingCommentList.id, + }, + }), + db.speakersList.update({ + where: { + id: correspondingCommentList.id, + }, + data: { + startTimestamp: null, + timeLeft: correspondingCommentList.speakingTime, + }, + }), + ...transaction, + ]); + } + + return await db.$transaction(transaction); + }, + { + hasConferenceRole: "any", + detail: { + description: + "Remove the current speaker from a speakersList, making the next speaker the current speaker. Also resetting the timer and commentList", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/routes/user.ts b/chase/backend/src/routes/user.ts new file mode 100644 index 00000000..2fee394f --- /dev/null +++ b/chase/backend/src/routes/user.ts @@ -0,0 +1,37 @@ +import { t, Elysia } from "elysia"; +import { db } from "../../prisma/db"; +import { committeeRoleGuard } from "../auth/guards/committeeRoles"; +import { conferenceRoleGuard } from "../auth/guards/conferenceRoles"; +import { openApiTag } from "../util/openApiTags"; + +export const user = new Elysia({ + prefix: "/conference/:conferenceId", +}) + .use(conferenceRoleGuard) + .use(committeeRoleGuard) + .get( + "/user/:userId/delegation", + async ({ params: { conferenceId, userId } }) => { + const committeeMember = await db.committeeMember.findFirst({ + where: { + userId, + }, + }); + return await db.delegation.findFirst({ + where: { + conferenceId, + id: committeeMember?.delegationId ?? "0", + }, + include: { + nation: true, + }, + }); + }, + { + hasConferenceRole: "any", + detail: { + description: "Get the delegation of a user in this conference", + tags: [openApiTag(import.meta.path)], + }, + }, + ); diff --git a/chase/backend/src/util/config.ts b/chase/backend/src/util/config.ts new file mode 100644 index 00000000..5f776c23 --- /dev/null +++ b/chase/backend/src/util/config.ts @@ -0,0 +1,64 @@ +/** + * @param envName The env variable to load + * @returns The variable value or undefined + */ +export function requireEnv(envName: string): string { + const v = process.env[envName]; + if (!v) { + throw new Error(`${envName} env var must be set`); + } + return v; +} + +const NODE_ENV = process.env.NODE_ENV ?? "production"; +const development = NODE_ENV === "development"; + +export const appConfiguration = { + production: !development, + development, + CORSOrigins: development + ? ["localhost:3000", "localhost:3001"] + : requireEnv("CORS_ORIGINS") + ?.split(",") + .map((origin) => origin.trim()), + port: process.env.PORT ?? "3001", + documentationPath: process.env.DOCUMENTATION_PATH ?? "documentation", + appName: process.env.APP_NAME ?? "CHASE", + cookie: { + secrets: development + ? ["not", "very", "secure"] + : requireEnv("COOKIE_SECRETS") + ?.split(",") + .map((origin) => origin.trim()), + }, + db: { + postgresUrl: development + ? process.env.DATABASE_URL ?? + "postgresql://postgres:postgres@localhost:5432/postgres" + : requireEnv("DATABASE_URL"), + redisUrl: development + ? process.env.REDIS_URL ?? "redis://default:redispw@localhost:6379" + : requireEnv("REDIS_URL"), + }, + email: { + EMAIL_HOST: development ? "localhost" : requireEnv("EMAIL_HOST"), + EMAIL_PORT: development ? 5968 : Number.parseInt(requireEnv("EMAIL_PORT")), + EMAIL_SECURE: development ? false : requireEnv("EMAIL_SECURE") !== "false", + EMAIL_AUTH_USER: development ? "dev" : requireEnv("EMAIL_AUTH_USER"), + EMAIL_AUTH_PASS: development ? "dev" : requireEnv("EMAIL_AUTH_PASS"), + EMAIL_FROM: development ? "noreply@localhost" : requireEnv("EMAIL_FROM"), + EMAIL_VERIFY_REDIRECT_URL: development + ? "http://localhost:3000/login/validateEmail" + : requireEnv("EMAIL_VERIFY_REDIRECT_URL"), + CREDENTIAL_CREATE_REDIRECT_URL: development + ? "http://localhost:3000/login/createCredentials" + : requireEnv("EMAIL_VERIFY_REDIRECT_URL"), + }, + passkeys: { + RELAY_NAME: process.env.RELAY_NAME ?? "CHASE - DMUN e.V.", + RELAY_ID: process.env.RELAY_ID ?? "localhost", + RELAY_ORIGIN: development + ? "https://localhost:3000" + : requireEnv("RELAY_ORIGIN"), + }, +}; diff --git a/chase/backend/src/util/errorLogger.ts b/chase/backend/src/util/errorLogger.ts new file mode 100644 index 00000000..2eaa6831 --- /dev/null +++ b/chase/backend/src/util/errorLogger.ts @@ -0,0 +1,29 @@ +import Elysia from "elysia"; + +export const errorLogging = new Elysia().onError( + ({ error, code, path, set, request }) => { + console.error( + `Error in ${request.method} ${path}: ${code} ${error.message}`, + ); + console.error(error); + + if (code === "VALIDATION") { + return error.message; + } + + if (error.message.includes("Unauthorized")) { + set.status = "Unauthorized"; + return error.message; + } + + if (code === "NOT_FOUND") { + return `Path ${path} doesn't exist (${error.message})`; + } + + if (set.status === "Unavailable For Legal Reasons") { + return error.message; + } + + return "Internal server error"; + }, +); diff --git a/chase/backend/src/util/mjml.d.ts b/chase/backend/src/util/mjml.d.ts new file mode 100644 index 00000000..26cc011c --- /dev/null +++ b/chase/backend/src/util/mjml.d.ts @@ -0,0 +1,4 @@ +declare module "*.mjml" { + const value: string; + export default value; +} diff --git a/chase/backend/src/util/nullToUndefined.ts b/chase/backend/src/util/nullToUndefined.ts new file mode 100644 index 00000000..cb7aca81 --- /dev/null +++ b/chase/backend/src/util/nullToUndefined.ts @@ -0,0 +1,26 @@ +type UndefinedIfNull = T extends null + ? undefined + : T extends (infer U)[] + ? UndefinedIfNull[] + : T extends object + ? { [K in keyof T]: UndefinedIfNull } + : T; + +export function nullToUndefined(obj: T): UndefinedIfNull { + if (obj === null) { + // biome-ignore lint/suspicious/noExplicitAny: This is a valid use case for any + return undefined as any; + } + + if (typeof obj === "object") { + // biome-ignore lint/suspicious/noExplicitAny: This is a valid use case for any + const newObj: any = Array.isArray(obj) ? [] : {}; + for (const key in obj) { + newObj[key] = nullToUndefined(obj[key]); + } + return newObj; + } + + // biome-ignore lint/suspicious/noExplicitAny: This is a valid use case for any + return obj as any; +} diff --git a/chase/backend/src/util/openApiTags.ts b/chase/backend/src/util/openApiTags.ts new file mode 100644 index 00000000..8be97e2c --- /dev/null +++ b/chase/backend/src/util/openApiTags.ts @@ -0,0 +1,14 @@ +import path from "path"; + +export const allOpenApiTags: { name: string; description?: string }[] = []; + +export function openApiTag(filepath: string, description?: string) { + const tag = path + .relative(path.join(import.meta.dir, "..", "routes"), filepath) + .replace(/\.ts$/, ""); + if (!allOpenApiTags.find((existing) => existing.name === tag)) { + allOpenApiTags.push({ name: tag, description }); + } + + return tag; +} diff --git a/chase/backend/tsconfig.json b/chase/backend/tsconfig.json index 008067b5..119d6ac5 100644 --- a/chase/backend/tsconfig.json +++ b/chase/backend/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@tsconfig/node16/tsconfig.json", + // "extends": "@tsconfig/node16/tsconfig.json", "compilerOptions": { "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, "module": "ESNext" /* Specify what module code is generated. */, @@ -18,6 +18,7 @@ "noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */, "noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */, "skipDefaultLibCheck": true /* Skip type checking .d.ts files that are included with TypeScript. */, - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "skipLibCheck": true, /* Skip type checking all .d.ts files. */ + "noErrorTruncation": true } } diff --git a/chase/backend/users.csv b/chase/backend/users.csv new file mode 100644 index 00000000..4d0880bc --- /dev/null +++ b/chase/backend/users.csv @@ -0,0 +1,119 @@ +email,password,role +Zella44@yahoo.com,You-Ain't-Seen-Nothin'-Yet,ADMIN +Sibyl.Schinner53@yahoo.com,The-Tide-is-High,ADMIN +Audra20@gmail.com,Lady,ADMIN +Nettie98@yahoo.com,My-Love,CHAIR +Delta80@yahoo.com,Goodnight,CHAIR +Mckayla_Crona@hotmail.com,Third-Man-Theme,CHAIR +Walker.Oberbrunner@hotmail.com,Coming-Up,CHAIR +Bernadette_Kessler95@hotmail.com,Promiscuous,CHAIR +Santa_Pollich@hotmail.com,The-Thing,CHAIR +Jeramy.Stehr@hotmail.com,It's-Too-Late,CHAIR +Vincent_Kirlin42@hotmail.com,Somebody-That-I-Used-to-Know,CHAIR +Serena.Gleichner17@hotmail.com,Where-is-the-Love?,CHAIR +Abner.Simonis@gmail.com,Whole-Lotta-Love,CHAIR +Mason_Zboncak@gmail.com,Roll-With-It,CHAIR +Kiana98@gmail.com,Rock-Your-Baby,CHAIR +Rocio.Volkman@gmail.com,You're-Beautiful,CHAIR +Solon_Hand-Nader95@hotmail.com,Rock-Your-Baby,CHAIR +Nyasia71@hotmail.com,Disco-Lady,CHAIR +Cloyd88@hotmail.com,Some-Enchanted-Evening,CHAIR +Isaac.Littel@yahoo.com,Time-of-the-Season,CHAIR +Demetris.Ratke69@gmail.com,Gypsies,CHAIR +Muhammad.Leffler@yahoo.com,On-My-Own,CHAIR +Kian.Von@gmail.com,Addicted-to-Love,CHAIR +Magdalena_Kihn-Bayer@hotmail.com,Nobody-Does-it-Better,CHAIR +Bill57@hotmail.com,Time-After-Time,SimSim 1 Delegate +Makenzie60@hotmail.com,I-Want-You-Back,SimSim 1 Delegate +Rylee_Baumbach37@yahoo.com,Minnie-the-Moocher,SimSim 1 Delegate +Reyna.Brakus82@yahoo.com,The-Twist,SimSim 1 Delegate +Jeremy_Macejkovic93@hotmail.com,I-Feel-Love,SimSim 1 Delegate +Christelle70@gmail.com,Sailing,SimSim 1 Delegate +Pierce51@hotmail.com,Let's-Hear-it-For-the-Boy,SimSim 1 Delegate +Elna_Haley60@hotmail.com,Knock-On-Wood,SimSim 1 Delegate +Jordyn.Pollich28@yahoo.com,In-the-Year-2525-(Exordium-&-Terminus),SimSim 1 Delegate +Carlee19@gmail.com,The-Christmas-Song-(Chestnuts-Roasting-On-An-Open-Fire),SimSim 1 Delegate +Rae_OKon59@hotmail.com,The-Way-You-Look-Tonight,SimSim 1 Delegate +Colten49@hotmail.com,Play-That-Funky-Music,SimSim 1 Delegate +Noah_Kohler81@hotmail.com,Bad-Day,SimSim 1 Delegate +Otis.Nitzsche@yahoo.com,Dardanella,SimSim 1 Delegate +Geovanny_Hudson@gmail.com,You-Always-Hurt-the-One-You-Love,SimSim 1 Delegate +John_Schimmel@hotmail.com,Stairway-to-Heaven,SimSim 1 Delegate +Sallie4@hotmail.com,The-Tide-is-High,SimSim 1 Delegate +Marianna_Hickle5@yahoo.com,Hang-On-Sloopy,SimSim 1 Delegate +Brady.Hansen96@gmail.com,Blaze-of-Glory,SimSim 1 Delegate +Jovany.Fay93@gmail.com,Mule-Train,SimSim 1 Delegate +Alexandrine.Hauck65@yahoo.com,In-the-Year-2525-(Exordium-&-Terminus),SimSim 1 Delegate +Braxton_Beatty3@yahoo.com,Jack-&-Diane,SimSim 1 Delegate +Andrew_Ondricka65@hotmail.com,One-Sweet-Day,SimSim 1 Delegate +Madelyn99@yahoo.com,Want-Ads,SimSim 1 Delegate +Lucie66@yahoo.com,T-For-Texas-(Blue-Yodel-No-1),SimSim 1 Delegate +Mozelle.Tromp15@gmail.com,Paper-Planes,SimSim 1 Delegate +Sophia_Stamm@hotmail.com,Toxic,SimSim 1 Delegate +Bella.Parker@hotmail.com,(Ghost)-Riders-in-the-Sky,SimSim 1 Delegate +Price23@gmail.com,Instant-Karma,SimSim 1 Delegate +Lizzie.Sanford@hotmail.com,Say-My-Name,SimSim 1 Delegate +Kattie69@hotmail.com,Don't-Worry-Be-Happy,SimSim 1 Delegate +Holly12@hotmail.com,Light-My-Fire,SimSim 1 Delegate +Rae_Daniel24@hotmail.com,Vogue,SimSim 1 Delegate +Robin.Greenfelder94@hotmail.com,Papa-Don't-Preach,SimSim 1 Delegate +Ceasar.Wehner@gmail.com,Proud-Mary,SimSim 1 Delegate +Karelle.Terry@gmail.com,Hello,SimSim 1 Delegate +Justice51@hotmail.com,Purple-Rain,SimSim 1 Delegate +Tatum.Effertz@hotmail.com,YMCA,SimSim 1 Delegate +Devante7@hotmail.com,Paper-Planes,SimSim 1 Delegate +Zelda_Raynor43@yahoo.com,You've-Lost-That-Lovin'-Feelin',SimSim 1 Delegate +Hope.OConner@hotmail.com,Music,SimSim 1 Delegate +Winona_McCullough@gmail.com,Just-My-Imagination-(Running-Away-With-Me),SimSim 1 Delegate +Elissa.McCullough88@hotmail.com,Instant-Karma,SimSim 1 Delegate +Rosario86@hotmail.com,Mister-Sandman,SimSim 1 Delegate +Domenico.Upton@hotmail.com,Paper-Planes,SimSim 1 Delegate +Junior_Rohan13@yahoo.com,Hanky-Panky,SimSim 1 Delegate +Brady.Kerluke@gmail.com,I-Shot-the-Sheriff,SimSim 1 Delegate +Vince_Stoltenberg@yahoo.com,In-the-Summertime,SimSim 2 Delegate +Aubree.Cartwright@gmail.com,Cat's-in-the-Cradle,SimSim 2 Delegate +Sigurd_Bruen4@gmail.com,Joy-to-the-World,SimSim 2 Delegate +Guido.Oberbrunner5@yahoo.com,I-Love-Rock-'n'-Roll,SimSim 2 Delegate +Nyah28@hotmail.com,Stormy-Weather-(Keeps-Rainin'-All-the-Time),SimSim 2 Delegate +Harold_Wilderman89@yahoo.com,Love-Hangover,SimSim 2 Delegate +Evans1@hotmail.com,Let-Me-Call-You-Sweetheart,SimSim 2 Delegate +Telly_Durgan@gmail.com,Ruby-Tuesday,SimSim 2 Delegate +Coy.Stark89@gmail.com,You-Belong-to-Me,SimSim 2 Delegate +Devin_Stroman47@yahoo.com,Whole-Lotta-Shakin'-Goin'-On,SimSim 2 Delegate +Garfield98@gmail.com,More-Than-a-Feeling,SimSim 2 Delegate +Dakota89@hotmail.com,My-Eyes-Adored-You,SimSim 2 Delegate +Tyrese.Casper@hotmail.com,Walk-Don't-Run,SimSim 2 Delegate +Johnnie.Lang@hotmail.com,Love-Theme-From-'A-Star-is-Born'-(Evergreen),SimSim 2 Delegate +Owen_Schamberger@hotmail.com,ABC,SimSim 2 Delegate +Mckayla92@gmail.com,I'll-Walk-Alone,SimSim 2 Delegate +Adriel9@yahoo.com,Soul-Man,SimSim 2 Delegate +Melvin.Kuhic@gmail.com,Stayin'-Alive,SimSim 2 Delegate +Weston5@hotmail.com,Boogie-Woogie-Bugle-Boy,SimSim 2 Delegate +Edwin.Bins@hotmail.com,I-Write-the-Songs,SimSim 2 Delegate +Raegan17@gmail.com,Wedding-Bell-Blues,SimSim 2 Delegate +Walton17@hotmail.com,Under-the-Boardwalk,SimSim 2 Delegate +Carmine91@gmail.com,I'll-Make-Love-to-You,SimSim 2 Delegate +Janessa.Powlowski46@hotmail.com,Hey-Jude,SimSim 2 Delegate +Christ_Lubowitz@yahoo.com,Besame-Mucho,SimSim 2 Delegate +Diana.Orn@hotmail.com,Battle-of-New-Orleans,SimSim 2 Delegate +Johnathan9@yahoo.com,That's-Amore,SimSim 2 Delegate +Ozella40@hotmail.com,The-Boy-is-Mine,SimSim 2 Delegate +Kip_Sauer@yahoo.com,Moonlight-Serenade,SimSim 2 Delegate +Brandi_OKon@hotmail.com,Daydream-Believer,SimSim 2 Delegate +Mae.Emmerich@yahoo.com,Cat's-in-the-Cradle,SimSim 2 Delegate +Veda.Turner43@gmail.com,Low,SimSim 2 Delegate +Grover39@gmail.com,West-End-Blues,SimSim 2 Delegate +Orrin_Goodwin@yahoo.com,Stronger,SimSim 2 Delegate +Toby_Stroman@yahoo.com,My-Boyfriend's-Back,SimSim 2 Delegate +Wallace32@gmail.com,Hello-Dolly,SimSim 2 Delegate +Issac72@hotmail.com,Another-Night,SimSim 2 Delegate +Margarette.Goyette10@gmail.com,You-Really-Got-Me,SimSim 2 Delegate +Maria51@gmail.com,Because-You-Loved-Me,SimSim 2 Delegate +Frederick.Wisoky-Krajcik@gmail.com,Why-Do-Fools-Fall-in-Love?,SimSim 2 Delegate +Griffin48@hotmail.com,Smells-Like-Teen-Spirit,SimSim 2 Delegate +Boyd_Grant@yahoo.com,Layla,SimSim 2 Delegate +Icie.OKeefe@gmail.com,California-Dreamin',SimSim 2 Delegate +Nils_Nikolaus@hotmail.com,My-Boyfriend's-Back,SimSim 2 Delegate +Norwood53@yahoo.com,Under-the-Bridge,SimSim 2 Delegate +Tristian93@hotmail.com,Do-That-to-Me-One-More-Time,SimSim 2 Delegate +Damian19@hotmail.com,You-Are-the-Sunshine-of-My-Life,SimSim 2 Delegate \ No newline at end of file diff --git a/chase/frontend/.npmrc b/chase/frontend/.npmrc new file mode 100644 index 00000000..52d5ff04 --- /dev/null +++ b/chase/frontend/.npmrc @@ -0,0 +1,2 @@ +@fortawesome:registry=https://npm.fontawesome.com/ +//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN} diff --git a/chase/frontend/app/(pages)/docs/page.module.css b/chase/frontend/app/(pages)/docs/page.module.css new file mode 100644 index 00000000..ab603d99 --- /dev/null +++ b/chase/frontend/app/(pages)/docs/page.module.css @@ -0,0 +1,85 @@ +/* Container */ +.container { + @apply w-full; +} + +/* Headings */ +.container h1 { + @apply text-4xl font-bold font-serif mb-4; +} + +.container h2 { + @apply text-3xl font-bold font-serif mb-3; +} + +.container h3 { + @apply text-2xl font-bold font-serif mb-2; +} + +.container h4 { + @apply text-xl font-semibold mb-1; +} + +.container h5 { + @apply text-lg font-medium; +} + +.container h6 { + @apply text-base font-medium; +} + +/* Paragraphs */ +.container p { + @apply text-base leading-relaxed mb-4; +} + +/* Blockquotes */ +.container blockquote { + @apply border-l-4 border-gray-400 pl-4 italic text-gray-600 mb-4; +} + +/* Lists */ +.container ul { + @apply list-disc pl-5 mb-4; +} + +.container ol { + @apply list-decimal pl-5 mb-4; +} + +/* Code Blocks */ +.container pre { + @apply bg-gray-100 text-sm p-3 overflow-x-auto mb-4; +} + +.container code { + @apply bg-gray-100 rounded-md p-1 text-red-500; +} + +/* Tables */ +.container table { + @apply min-w-full divide-y divide-gray-200 mb-4; +} + +.container th { + @apply text-left text-xs font-semibold text-gray-600 uppercase tracking-wider p-3; +} + +.container td { + @apply text-base p-3 border-b border-gray-200; +} + +/* Links */ +.container a { + @apply text-blue-500 hover:text-blue-700 underline; +} + +/* Images */ +.container img { + @apply max-w-full h-auto mb-4; +} + +/* Horizontal Rule */ +.container hr { + @apply my-8 border-gray-200; +} diff --git a/chase/frontend/app/(pages)/docs/page.tsx b/chase/frontend/app/(pages)/docs/page.tsx new file mode 100644 index 00000000..d3feecd0 --- /dev/null +++ b/chase/frontend/app/(pages)/docs/page.tsx @@ -0,0 +1,37 @@ +"use client"; +import React from "react"; +import Navbar from "@/components/home/navbar"; +import { faArrowLeft } from "@fortawesome/pro-solid-svg-icons"; +import Button from "@/components/button"; +import { useRouter } from "next/navigation"; +import { useI18nContext } from "@/i18n/i18n-react"; +import MarkdownReader from "@/components/home/md_reader"; + +export default function Docs() { + const Router = useRouter(); + const { LL } = useI18nContext(); + + return ( + <> + +
+
+
+

{LL.docs.TITLE()}

+

+ {LL.docs.DESCRIPTION()} +

+
+ +
+
+ + ); +} diff --git a/chase/frontend/app/(pages)/faq/page.tsx b/chase/frontend/app/(pages)/faq/page.tsx new file mode 100644 index 00000000..322ea474 --- /dev/null +++ b/chase/frontend/app/(pages)/faq/page.tsx @@ -0,0 +1,38 @@ +"use client"; +import React from "react"; +import Navbar from "@/components/home/navbar"; +import { faArrowLeft } from "@fortawesome/pro-solid-svg-icons"; +import Button from "@/components/button"; +import { useRouter } from "next/navigation"; +import MarkdownReader from "@/components/home/md_reader"; +import { useI18nContext } from "@/i18n/i18n-react"; + +export default function Docs() { + const Router = useRouter(); + + const { LL } = useI18nContext(); + + return ( + <> + +
+
+
+

{LL.faq.TITLE()}

+

+ {LL.faq.DESCRIPTION()} +

+
+ +
+
+ + ); +} diff --git a/chase/frontend/app/(pages)/layout.tsx b/chase/frontend/app/(pages)/layout.tsx new file mode 100644 index 00000000..1353c84d --- /dev/null +++ b/chase/frontend/app/(pages)/layout.tsx @@ -0,0 +1,18 @@ +import Footer from "@/components/home/footer"; +import Navbar from "@/components/home/navbar"; + +export default ({ + children, +}: { + children: React.ReactNode; +}) => { + return ( + <> + +
+ {children} +
+