commit b79c4faa03df87ce2f807b420622312662603132 Author: Rother Date: Wed May 28 00:41:23 2025 +0200 push diff --git a/src/app/admin/[tab]/page.tsx b/src/app/admin/[tab]/page.tsx new file mode 100644 index 0000000..33a2efc --- /dev/null +++ b/src/app/admin/[tab]/page.tsx @@ -0,0 +1,41 @@ +'use client' + +import { use, useState } from 'react' +import { notFound } from 'next/navigation' +import Card from '@/app/components/Card' +import TeamCardComponent from '@/app/components/TeamCardComponent' +import MatchesAdminManager from '@/app/components/MatchesAdminManager' +import MatchList from '@/app/components/MatchList' + +export default function Page({ params }: { params: Promise<{ tab: string }> }) { + const { tab } = use(params) + + const [refetchKey, setRefetchKey] = useState('') // 🔥 Gemeinsamer Reload-Key + + const renderTabContent = () => { + switch (tab) { + case 'matches': + return ( + + + + ) + case 'privacy': + return ( + + ) + case 'team': + return ( + +
+ +
+
+ ) + default: + return notFound() + } + } + + return <>{renderTabContent()} +} diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx new file mode 100644 index 0000000..664861a --- /dev/null +++ b/src/app/admin/layout.tsx @@ -0,0 +1,17 @@ +import { Tabs } from '@/app/components/Tabs' +import Tab from '@/app/components/Tab' + +export default function AdminLayout({ children }: { children: React.ReactNode }) { + return ( +
+ + + + + +
+ {children} +
+
+ ) +} diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx new file mode 100644 index 0000000..d415502 --- /dev/null +++ b/src/app/admin/page.tsx @@ -0,0 +1,6 @@ +// src/app/admin/page.tsx +import { redirect } from 'next/navigation' + +export default function AdminRedirectPage() { + redirect('/admin/matches') +} diff --git a/src/app/api/admin/teams/route.ts b/src/app/api/admin/teams/route.ts new file mode 100644 index 0000000..7c3916a --- /dev/null +++ b/src/app/api/admin/teams/route.ts @@ -0,0 +1,10 @@ +import { prisma } from '@/app/lib/prisma' +import { NextResponse } from 'next/server' + +export async function GET() { + const teams = await prisma.team.findMany({ + select: { id: true, name: true } + }) + + return NextResponse.json(teams) +} diff --git a/src/app/api/auth/[...nextauth]/route.ts b/src/app/api/auth/[...nextauth]/route.ts new file mode 100644 index 0000000..828c770 --- /dev/null +++ b/src/app/api/auth/[...nextauth]/route.ts @@ -0,0 +1,9 @@ +import NextAuth from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { type NextRequest } from 'next/server' + +export const handler = async (req: NextRequest, ctx: any) => { + return NextAuth(req, ctx, authOptions(req)) // mit Request +} + +export { handler as GET, handler as POST } diff --git a/src/app/api/cs2/getNextCode/route.ts b/src/app/api/cs2/getNextCode/route.ts new file mode 100644 index 0000000..4070752 --- /dev/null +++ b/src/app/api/cs2/getNextCode/route.ts @@ -0,0 +1,82 @@ +import { NextRequest, NextResponse } from 'next/server' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { prisma } from '@/app/lib/prisma' +import { decrypt, encrypt } from '@/app/lib/crypto' +import { decodeMatchShareCode, MatchInformation } from 'csgo-sharecode'; + +function delay(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)) +} + +export async function GET(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + let steamId = session?.user?.steamId ?? req.headers.get('x-steamid') ?? undefined; + + if (!steamId) { + return NextResponse.json({ valid: false, reason: 'Missing steamId' }); + } + + try { + const user = await prisma.user.findUnique({ + where: { steamId }, + select: { authCode: true, lastKnownShareCode: true }, + }); + + if (!user?.authCode || !user.lastKnownShareCode) { + return NextResponse.json({ valid: false }); + } + + const decryptedAuthCode = decrypt(user.authCode); + + // Nur EINEN nächsten Code abrufen + const url = `https://api.steampowered.com/ICSGOPlayers_730/GetNextMatchSharingCode/v1?key=${process.env.STEAM_API_KEY}&steamid=${steamId}&steamidkey=${decryptedAuthCode}&knowncode=${user.lastKnownShareCode}`; + + const res = await fetch(url); + const data = await res.json(); + + const nextCode = data?.result?.nextcode ?? 'n/a'; + + if (nextCode === 'n/a') { + return NextResponse.json({ valid: true, nextCode: null }); + } + + // MatchInfo extrahieren & speichern + const matchInfo = decodeMatchShareCode(nextCode); + await prisma.cS2MatchRequest.upsert({ + where: { + steamId_matchId: { + steamId, + matchId: matchInfo.matchId, + }, + }, + update: {}, + create: { + userId: steamId, + steamId: steamId, + matchId: matchInfo.matchId, + reservationId: matchInfo.reservationId, + tvPort: matchInfo.tvPort, + }, + }); + + return NextResponse.json({ + valid: true, + nextCode, + }); + + } catch (err) { + if (err instanceof Error && err.message === 'INVALID_CODE') { + return NextResponse.json({ + valid: false, + error: 'Invalid authCode or knownCode (veraltet oder ungültig)', + }); + } + + return NextResponse.json({ + valid: false, + error: err instanceof Error ? err.message : String(err), + }); + } +} + diff --git a/src/app/api/cs2/sharecode/route.ts b/src/app/api/cs2/sharecode/route.ts new file mode 100644 index 0000000..12187cd --- /dev/null +++ b/src/app/api/cs2/sharecode/route.ts @@ -0,0 +1,66 @@ +import { NextRequest, NextResponse } from 'next/server' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { prisma } from '@/app/lib/prisma' +import { encrypt, decrypt } from '@/app/lib/crypto' + +export async function PUT(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + const steamId = session?.user?.steamId + + if (!steamId) { + return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) + } + + const { authCode, lastKnownShareCode } = await req.json() + + + if (!authCode || typeof authCode !== 'string') { + return NextResponse.json({ error: 'Ungültiger Auth Code' }, { status: 400 }) + } + + try { + await prisma.user.update({ + where: { steamId }, + data: { + authCode: encrypt(authCode), + lastKnownShareCode: lastKnownShareCode || undefined, + lastKnownShareCodeDate: lastKnownShareCode ? new Date() : undefined, + }, + }) + + return new NextResponse(null, { status: 204 }) + } catch (error) { + console.error('Fehler beim Speichern:', error) + return NextResponse.json({ error: 'Fehler beim Speichern der Codes' }, { status: 500 }) + } +} + +export async function GET(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + const steamId = session?.user?.steamId + + if (!steamId) { + return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) + } + + try { + const user = await prisma.user.findUnique({ + where: { steamId }, + select: { + authCode: true, + lastKnownShareCode: true, + lastKnownShareCodeDate: true, + }, + }) + + return NextResponse.json({ + authCode: user?.authCode ? decrypt(user.authCode) : null, + lastKnownShareCode: user?.lastKnownShareCode ?? null, + lastKnownShareCodeDate: user?.lastKnownShareCodeDate ?? null, + }) + } catch (error) { + console.error('Fehler beim Abrufen:', error) + return NextResponse.json({ error: 'Fehler beim Abrufen der Codes' }, { status: 500 }) + } +} diff --git a/src/app/api/matches/[id]/route.ts b/src/app/api/matches/[id]/route.ts new file mode 100644 index 0000000..1900393 --- /dev/null +++ b/src/app/api/matches/[id]/route.ts @@ -0,0 +1,168 @@ +// /app/api/matches/[id]/route.ts +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' + +type Params = { params: { id: string } } + +export async function GET(_: Request, { params }: Params) { + const { id } = params + if (!id) { + return NextResponse.json({ error: 'Missing ID' }, { status: 400 }) + } + + try { + const match = await prisma.match.findUnique({ + where: { matchId: BigInt(id) }, + include: { + teamA: true, + teamB: true, + players: { + include: { user: true, stats: true } + } + } + }) + + if (!match) { + return NextResponse.json({ error: 'Match not found' }, { status: 404 }) + } + + // Trenne MatchPlayer-Daten nach Team + const playersA = match.players.filter(p => p.teamId === match.teamAId) + const playersB = match.players.filter(p => p.teamId === match.teamBId) + + return NextResponse.json({ + ...match, + playersA, + playersB, + }) + } catch (err) { + console.error(`GET /matches/${id} failed:`, err) + return NextResponse.json({ error: 'Failed to load match' }, { status: 500 }) + } +} + + +export async function PUT(req: NextRequest, { params }: Params) { + const session = await getServerSession(authOptions(req)) + const userId = session?.user?.steamId + const isAdmin = session?.user?.isAdmin + + if (!userId) { + return NextResponse.json({ error: 'Unauthorized' }, { status: 403 }) + } + + const { id } = params + const body = await req.json() + const { title, description, matchDate, players } = body + + const match = await prisma.match.findUnique({ + where: { matchId: BigInt(id) }, + include: { + teamA: { include: { leader: true } }, + teamB: { include: { leader: true } }, + } + + }) + + if (!match) { + return NextResponse.json({ error: 'Match not found' }, { status: 404 }) + } + + const isTeamLeaderA = match.teamA?.leaderId === userId + const isTeamLeaderB = match.teamB?.leaderId === userId + + if (!isAdmin && !isTeamLeaderA && !isTeamLeaderB) { + return NextResponse.json({ error: 'Forbidden' }, { status: 403 }) + } + + // Wenn kein Admin: validiere Spieler gegen aktives Team + if (!isAdmin) { + const ownTeamId = isTeamLeaderA ? match.teamAId : match.teamBId + + if (!ownTeamId) { + return NextResponse.json({ error: 'Team-ID fehlt' }, { status: 400 }); + } + + const ownTeam = await prisma.team.findUnique({ where: { id: ownTeamId } }) + const allowed = new Set(ownTeam?.activePlayers || []) + const invalid = players.some((p: any) => p.teamId === ownTeamId && !allowed.has(p.userId)) + if (invalid) { + return NextResponse.json({ error: 'Ungültige Spielerzuweisung' }, { status: 403 }) + } + } + + try { + await prisma.matchPlayer.deleteMany({ where: { matchId: BigInt(id) } }) + + await prisma.matchPlayer.createMany({ + data: players.map((p: any) => ({ + matchId: id, + userId: p.userId, + teamId: p.teamId, + })), + }) + + const updated = await prisma.match.update({ + where: { matchId: BigInt(id) }, + data: { + title, + description, + matchDate: new Date(matchDate), + }, + include: { + teamA: true, + teamB: true, + players: { + include: { user: true } + } + } + }) + + // Spieler wieder trennen nach Team + const playersA = updated.players + .filter(p => p.teamId === updated.teamAId) + .map(p => ({ + steamId: p.user.steamId, + name: p.user.name, + avatar: p.user.avatar, + location: p.user.location, + })) + + const playersB = updated.players + .filter(p => p.teamId === updated.teamBId) + .map(p => ({ + steamId: p.user.steamId, + name: p.user.name, + avatar: p.user.avatar, + location: p.user.location, + })) + + return NextResponse.json({ + ...updated, + playersA, + playersB, + }) + } catch (err) { + console.error(`PUT /matches/${id} failed:`, err) + return NextResponse.json({ error: 'Failed to update match' }, { status: 500 }) + } +} + +export async function DELETE(req: NextRequest, { params }: Params) { + const session = await getServerSession(authOptions(req)) + if (!session?.user?.isAdmin) { + return NextResponse.json({ error: 'Unauthorized' }, { status: 403 }) + } + + const { id } = params + + try { + await prisma.match.delete({ where: { matchId: BigInt(id) } }) + return NextResponse.json({ success: true }) + } catch (err) { + console.error(`DELETE /matches/${id} failed:`, err) + return NextResponse.json({ error: 'Failed to delete match' }, { status: 500 }) + } +} diff --git a/src/app/api/matches/create/route.ts b/src/app/api/matches/create/route.ts new file mode 100644 index 0000000..a302a9b --- /dev/null +++ b/src/app/api/matches/create/route.ts @@ -0,0 +1,73 @@ +// /app/api/matches/create/route.ts +import { NextRequest, NextResponse } from 'next/server' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { prisma } from '@/app/lib/prisma' + +export async function POST (req: NextRequest) { + /* ▸ Berechtigung ---------------------------------------------------------------- */ + const session = await getServerSession(authOptions(req)) + if (!session?.user?.isAdmin) { + return NextResponse.json({ error: 'Unauthorized' }, { status : 403 }) + } + + /* ▸ Eingaben aus dem Body -------------------------------------------------------- */ + const { teamAId, teamBId, title, description, matchDate, map } = await req.json() + + if (!teamAId || !teamBId || !matchDate) { + return NextResponse.json({ error: 'Missing fields' }, { status : 400 }) + } + + try { + /* ▸ Aktive Spieler der Teams laden ------------------------------------------- */ + const [teamA, teamB] = await Promise.all([ + prisma.team.findUnique({ where: { id: teamAId }, select: { activePlayers: true } }), + prisma.team.findUnique({ where: { id: teamBId }, select: { activePlayers: true } }) + ]) + + if (!teamA || !teamB) { + return NextResponse.json({ error: 'Team not found' }, { status : 404 }) + } + + /* ▸ Match & Match‑Players in einer Transaktion anlegen ----------------------- */ + const result = await prisma.$transaction(async (tx) => { + /* 1. Match */ + const newMatch = await tx.match.create({ + data: { + teamAId, + teamBId, + title : title?.trim() || `${teamAId}-${teamBId}`, + description : description?.trim() || null, + map : map?.trim() || null, + matchDate : new Date(matchDate) + } + }) + + /* 2. Spieler-Datensätze vorbereiten */ + const playersData = [ + ...teamA.activePlayers.map((steamId: string) => ({ + matchId: newMatch.matchId, + steamId, + teamId : teamAId + })), + ...teamB.activePlayers.map((steamId: string) => ({ + matchId: newMatch.matchId, + steamId, + teamId : teamBId + })) + ] + + /* 3. Anlegen (nur wenn Spieler vorhanden) */ + if (playersData.length) { + await tx.matchPlayer.createMany({ data: playersData, skipDuplicates: true }) + } + + return newMatch + }) + + return NextResponse.json(result, { status: 201 }) + } catch (err) { + console.error('POST /matches/create failed:', err) + return NextResponse.json({ error: 'Failed to create match' }, { status : 500 }) + } +} diff --git a/src/app/api/matches/route.ts b/src/app/api/matches/route.ts new file mode 100644 index 0000000..d658fe6 --- /dev/null +++ b/src/app/api/matches/route.ts @@ -0,0 +1,25 @@ +import { NextResponse } from 'next/server' +import { prisma } from '@/app/lib/prisma' + +export async function GET() { + try { + const matches = await prisma.match.findMany({ + orderBy: { matchDate: 'asc' }, + include: { + teamA: true, + teamB: true, + players: { + include: { + user: true, + stats: true, + }, + }, + }, + }) + + return NextResponse.json(matches) + } catch (err) { + console.error('GET /matches failed:', err) + return NextResponse.json({ error: 'Failed to load matches' }, { status: 500 }) + } +} diff --git a/src/app/api/notifications/create/route.ts b/src/app/api/notifications/create/route.ts new file mode 100644 index 0000000..a7a76b8 --- /dev/null +++ b/src/app/api/notifications/create/route.ts @@ -0,0 +1,55 @@ +import { prisma } from '@/app/lib/prisma' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { NextResponse, type NextRequest } from 'next/server' + +// ✅ Neue Notification erstellen +export async function POST(req: NextRequest) { + const { userId, title, message } = await req.json() + + if (!userId || !title || !message) { + return NextResponse.json({ message: 'Fehlende Felder' }, { status: 400 }) + } + + const notification = await prisma.notification.create({ + data: { + userId, + title, + message, + } + }) + + return NextResponse.json({ notification }) +} + +// ✅ Notifications für aktuellen User laden +export async function GET(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + + if (!session?.user?.id) { + return NextResponse.json({ message: 'Nicht eingeloggt' }, { status: 401 }) + } + + const notifications = await prisma.notification.findMany({ + where: { userId: session.user.id }, + orderBy: { createdAt: 'desc' }, + }) + + return NextResponse.json({ notifications }) +} + +// ✅ Alle Notifications auf "gelesen" setzen +export async function PUT(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + + if (!session?.user?.id) { + return NextResponse.json({ message: 'Nicht eingeloggt' }, { status: 401 }) + } + + await prisma.notification.updateMany({ + where: { userId: session.user.id, read: false }, + data: { read: true }, + }) + + return NextResponse.json({ message: 'Alle Notifications gelesen' }) +} diff --git a/src/app/api/notifications/mark-all-read/route.ts b/src/app/api/notifications/mark-all-read/route.ts new file mode 100644 index 0000000..72daa1c --- /dev/null +++ b/src/app/api/notifications/mark-all-read/route.ts @@ -0,0 +1,20 @@ +// /api/notifications/mark-all-read/route.ts +import { prisma } from '@/app/lib/prisma' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { NextResponse, type NextRequest } from 'next/server' + +export async function POST(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + + if (!session?.user?.steamId) { + return NextResponse.json({ message: 'Nicht eingeloggt' }, { status: 401 }) + } + + await prisma.notification.updateMany({ + where: { userId: session.user.steamId, read: false }, + data: { read: true }, + }) + + return NextResponse.json({ message: 'Alle Notifications als gelesen markiert' }) +} diff --git a/src/app/api/notifications/mark-read/[id]/route.ts b/src/app/api/notifications/mark-read/[id]/route.ts new file mode 100644 index 0000000..3bb28f6 --- /dev/null +++ b/src/app/api/notifications/mark-read/[id]/route.ts @@ -0,0 +1,39 @@ +// app/api/notifications/mark-read/[id]/route.ts + +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { prisma } from '@/app/lib/prisma' +import { NextResponse } from 'next/server' +import type { NextRequest } from 'next/server' + +export async function POST(req: NextRequest, { params }: { params: { id: string } }) { + const session = await getServerSession(authOptions(req)) + + if (!session?.user?.id) { + return NextResponse.json({ error: 'Nicht eingeloggt' }, { status: 401 }) + } + + const param = await params + const notificationId = param.id + + try { + const notification = await prisma.notification.findUnique({ + where: { id: notificationId }, + }) + + if (!notification || notification.userId !== session.user.id) { + return NextResponse.json({ error: 'Nicht gefunden oder nicht erlaubt' }, { status: 403 }) + } + + await prisma.notification.update({ + where: { id: notificationId }, + data: { read: true }, + }) + + return NextResponse.json({ success: true }) + } catch (error) { + console.error('[Notification] Fehler beim Markieren:', error) + return NextResponse.json({ error: 'Serverfehler' }, { status: 500 }) + } +} + diff --git a/src/app/api/notifications/route.ts b/src/app/api/notifications/route.ts new file mode 100644 index 0000000..e29f0a2 --- /dev/null +++ b/src/app/api/notifications/route.ts @@ -0,0 +1,20 @@ +import { prisma } from '@/app/lib/prisma' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { NextResponse, type NextRequest } from 'next/server' + +export async function GET(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + + if (!session?.user?.steamId) { + return NextResponse.json({ message: 'Nicht eingeloggt' }, { status: 401 }) + } + + const notifications = await prisma.notification.findMany({ + where: { userId: session.user.steamId }, + orderBy: { createdAt: 'desc' }, + take: 10, + }) + + return NextResponse.json({ notifications }) +} diff --git a/src/app/api/notifications/user/route.ts b/src/app/api/notifications/user/route.ts new file mode 100644 index 0000000..9214351 --- /dev/null +++ b/src/app/api/notifications/user/route.ts @@ -0,0 +1,31 @@ +// /api/notifications/user/route.ts +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { prisma } from '@/app/lib/prisma' +import { NextRequest, NextResponse } from 'next/server' + +export async function GET(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + + if (!session?.user?.steamId) { + return NextResponse.json({ message: 'Nicht eingeloggt' }, { status: 401 }) + } + + const notifications = await prisma.notification.findMany({ + where: { + userId: session.user.steamId, + }, + orderBy: { createdAt: 'desc' }, + select: { + id: true, + title: true, + message: true, + read: true, + actionType: true, + actionData: true, + createdAt: true, + }, + }) + + return NextResponse.json({ notifications }) +} diff --git a/src/app/api/steam/profile/route.ts b/src/app/api/steam/profile/route.ts new file mode 100644 index 0000000..55dbd7b --- /dev/null +++ b/src/app/api/steam/profile/route.ts @@ -0,0 +1,37 @@ +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { NextResponse, type NextRequest } from 'next/server' + +export async function GET(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + + if (!session || !session.user?.id) { + return NextResponse.json( + { error: 'Nicht eingeloggt oder Steam ID fehlt' }, + { status: 401 } + ) + } + + const steamId = session.user.id + const apiKey = process.env.STEAM_API_KEY + + if (!apiKey) { + return NextResponse.json( + { error: 'STEAM_API_KEY nicht gesetzt' }, + { status: 500 } + ) + } + + const url = `https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=${apiKey}&steamids=${steamId}` + const res = await fetch(url) + + if (!res.ok) { + return NextResponse.json( + { error: 'Fehler beim Abrufen der Steam-Daten' }, + { status: res.status } + ) + } + + const data = await res.json() + return NextResponse.json(data.response.players[0]) +} diff --git a/src/app/api/team/[teamId]/route.ts b/src/app/api/team/[teamId]/route.ts new file mode 100644 index 0000000..2f4d5ed --- /dev/null +++ b/src/app/api/team/[teamId]/route.ts @@ -0,0 +1,34 @@ +// ✅ /api/team/[teamId]/route.ts +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma' + +export async function GET( + req: NextRequest, + { params }: { params: { teamId: string } } +) { + try { + const param = await params + const team = await prisma.team.findUnique({ + where: { id: param.teamId }, + }) + + if (!team) { + return NextResponse.json({ error: 'Team nicht gefunden' }, { status: 404 }) + } + + const activePlayers = await prisma.user.findMany({ + where: { steamId: { in: team.activePlayers } }, + select: { steamId: true, name: true, avatar: true, location: true }, + }) + + const inactivePlayers = await prisma.user.findMany({ + where: { steamId: { in: team.inactivePlayers } }, + select: { steamId: true, name: true, avatar: true, location: true }, + }) + + return NextResponse.json(team) + } catch (error) { + console.error('Fehler beim Laden des Teams:', error) + return NextResponse.json({ error: 'Interner Serverfehler' }, { status: 500 }) + } +} diff --git a/src/app/api/team/available-users/route.ts b/src/app/api/team/available-users/route.ts new file mode 100644 index 0000000..5ce68da --- /dev/null +++ b/src/app/api/team/available-users/route.ts @@ -0,0 +1,26 @@ +import { NextResponse } from 'next/server' +import { prisma } from '@/app/lib/prisma' + +export async function GET() { + try { + const allUsers = await prisma.user.findMany({ + where: { + team: null, + }, + select: { + steamId: true, + name: true, + avatar: true, + location: true, + }, + orderBy: { + name: 'asc', + }, + }) + + return NextResponse.json({ users: allUsers }) + } catch (error) { + console.error('Fehler beim Laden der verfügbaren Benutzer:', error) + return NextResponse.json({ message: 'Fehler beim Laden' }, { status: 500 }) + } +} diff --git a/src/app/api/team/change-logo/route.ts b/src/app/api/team/change-logo/route.ts new file mode 100644 index 0000000..1f7d0d7 --- /dev/null +++ b/src/app/api/team/change-logo/route.ts @@ -0,0 +1,25 @@ +// /pages/api/team/change-logo.ts +import { NextApiRequest, NextApiResponse } from 'next' +import { prisma } from '@/app/lib/prisma' + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + if (req.method !== 'POST') return res.status(405).end() + + const { teamId, logoUrl } = req.body + + if (!teamId || !logoUrl) { + return res.status(400).json({ error: 'Team-ID oder Logo-URL fehlt' }) + } + + try { + await prisma.team.update({ + where: { id: teamId }, + data: { logo: logoUrl }, + }) + + return res.status(200).json({ success: true }) + } catch (err) { + console.error(err) + return res.status(500).json({ error: 'Logo konnte nicht geändert werden' }) + } +} diff --git a/src/app/api/team/create/route.ts b/src/app/api/team/create/route.ts new file mode 100644 index 0000000..f8f7c07 --- /dev/null +++ b/src/app/api/team/create/route.ts @@ -0,0 +1,60 @@ +// /api/team/create/route.ts +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma'; +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client'; + +export async function POST(req: NextRequest) { + try { + const { teamname, leader } = await req.json(); + + if (!teamname || !leader) { + return NextResponse.json({ message: 'Fehlende Eingaben.' }, { status: 400 }); + } + + const existingTeam = await prisma.team.findFirst({ where: { name: teamname } }); + if (existingTeam) { + return NextResponse.json({ message: 'Teamname bereits vergeben.' }, { status: 400 }); + } + + const existingUser = await prisma.user.findUnique({ where: { steamId: leader } }); + if (!existingUser) { + return NextResponse.json({ message: 'Benutzer nicht gefunden.' }, { status: 404 }); + } + + const newTeam = await prisma.team.create({ + data: { + name: teamname, + leaderId: leader, + activePlayers: [leader], + inactivePlayers: [], + }, + }); + + await prisma.user.update({ + where: { steamId: leader }, + data: { teamId: newTeam.id }, + }); + + await prisma.notification.create({ + data: { + userId: leader, + title: 'Team erstellt', + message: `Du hast erfolgreich das Team "${teamname}" erstellt.`, + }, + }); + + // 📢 WebSocket Nachricht senden + await sendServerWebSocketMessage({ + type: 'team-created', + title: 'Team erstellt', + message: `Das Team "${teamname}" wurde erstellt.`, + teamId: newTeam.id, + }); + + return NextResponse.json({ message: 'Team erstellt', team: newTeam }); + + } catch (error: any) { + console.error('Fehler beim Team erstellen:', error.message, error.stack); + return NextResponse.json({ message: 'Interner Serverfehler.' }, { status: 500 }); + } +} diff --git a/src/app/api/team/delete/route.ts b/src/app/api/team/delete/route.ts new file mode 100644 index 0000000..94d5a5d --- /dev/null +++ b/src/app/api/team/delete/route.ts @@ -0,0 +1,21 @@ +// /pages/api/team/delete.ts +import { NextApiRequest, NextApiResponse } from 'next' +import { prisma } from '@/app/lib/prisma' + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + if (req.method !== 'POST') return res.status(405).end() + + const { teamId } = req.body + + if (!teamId) { + return res.status(400).json({ error: 'Team-ID fehlt' }) + } + + try { + await prisma.team.delete({ where: { id: teamId } }) + return res.status(200).json({ success: true }) + } catch (err) { + console.error(err) + return res.status(500).json({ error: 'Team konnte nicht gelöscht werden' }) + } +} diff --git a/src/app/api/team/get/route.ts b/src/app/api/team/get/route.ts new file mode 100644 index 0000000..4c5da10 --- /dev/null +++ b/src/app/api/team/get/route.ts @@ -0,0 +1,56 @@ +import { NextRequest, NextResponse } from 'next/server' +import { prisma } from '@/app/lib/prisma' + +export async function GET(req: NextRequest) { + const teamId = req.nextUrl.searchParams.get('id') + + if (!teamId) { + return NextResponse.json({ message: 'Team-ID fehlt.' }, { status: 400 }) + } + + try { + const team = await prisma.team.findUnique({ + where: { id: teamId }, + include: { + leader: { + select: { + steamId: true, + name: true, + avatar: true, + location: true, + }, + }, + }, + }) + + if (!team) { + return NextResponse.json({ message: 'Team nicht gefunden.' }, { status: 404 }) + } + + const steamIds = [...team.activePlayers, ...team.inactivePlayers] + + const players = await prisma.user.findMany({ + where: { steamId: { in: steamIds } }, + select: { + steamId: true, + name: true, + avatar: true, + location: true, + }, + }) + + return NextResponse.json({ + team: { + id: team.id, + teamname: team.name, + logo: team.logo, + leader: team.leader, + activePlayers: players.filter(p => team.activePlayers.includes(p.steamId)), + inactivePlayers: players.filter(p => team.inactivePlayers.includes(p.steamId)), + }, + }) + } catch (err) { + console.error('[GET /api/team/get] Fehler:', err) + return NextResponse.json({ message: 'Interner Serverfehler' }, { status: 500 }) + } +} diff --git a/src/app/api/team/invite/route.ts b/src/app/api/team/invite/route.ts new file mode 100644 index 0000000..0ace3bf --- /dev/null +++ b/src/app/api/team/invite/route.ts @@ -0,0 +1,67 @@ +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' + +export async function POST(req: NextRequest) { + try { + const body = await req.json() + const { teamId, userIds: rawUserIds, invitedBy } = body + + if (!teamId || !rawUserIds || !invitedBy) { + return NextResponse.json({ message: 'Fehlende Daten' }, { status: 400 }) + } + + const userIds = rawUserIds.filter((id: string) => id !== invitedBy) + + const team = await prisma.team.findUnique({ + where: { id: teamId }, + select: { name: true }, + }) + + if (!team) { + return NextResponse.json({ message: 'Team nicht gefunden' }, { status: 404 }) + } + + const teamName = team.name || 'Unbekanntes Team' + + const results = await Promise.all( + userIds.map(async (userId: string) => { + const invitation = await prisma.invitation.create({ + data: { + userId, + teamId, + type: 'team-invite', + }, + }) + + const notification = await prisma.notification.create({ + data: { + userId, + title: 'Teameinladung', + message: `Du wurdest in das Team "${teamName}" eingeladen.`, + actionType: 'team-invite', + actionData: invitation.id, + }, + }) + + + await sendServerWebSocketMessage({ + type: notification.actionType ?? 'notification', + targetUserIds: [userId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }) + + return invitation.id + }) + ) + + return NextResponse.json({ message: 'Einladungen versendet', invitationIds: results }) + } catch (error) { + console.error('Fehler beim Versenden der Einladungen:', error) + return NextResponse.json({ message: 'Fehler beim Einladen' }, { status: 500 }) + } +} diff --git a/src/app/api/team/kick/route.ts b/src/app/api/team/kick/route.ts new file mode 100644 index 0000000..dadea65 --- /dev/null +++ b/src/app/api/team/kick/route.ts @@ -0,0 +1,96 @@ +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' + +export const dynamic = 'force-dynamic' + +export async function POST(req: NextRequest) { + try { + const { teamId, steamId } = await req.json() + + if (!teamId || !steamId) { + return NextResponse.json({ message: 'Fehlende Daten' }, { status: 400 }) + } + + const team = await prisma.team.findUnique({ where: { id: teamId } }) + if (!team) { + return NextResponse.json({ message: 'Team nicht gefunden' }, { status: 404 }) + } + + const user = await prisma.user.findUnique({ + where: { steamId }, + select: { name: true } + }) + + const userName = user?.name ?? 'Ein Mitglied' + const teamName = team.name ?? 'Unbekanntes Team' + + const active = team.activePlayers.filter((id) => id !== steamId) + const inactive = team.inactivePlayers.filter((id) => id !== steamId) + + await prisma.team.update({ + where: { id: teamId }, + data: { + activePlayers: { set: active }, + inactivePlayers: { set: inactive }, + }, + }) + + await prisma.user.update({ + where: { steamId }, + data: { teamId: null }, + }) + + // 🟥 Gekickter User> + const notification = await prisma.notification.create({ + data: { + userId: steamId, + title: 'Teamverlassen', + message: `Du wurdest aus dem Team "${teamName}" geworfen.`, + actionType: 'team-kick', + actionData: null, + }, + }) + + await sendServerWebSocketMessage({ + type: notification.actionType ?? 'notification', + targetUserIds: [steamId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }) + + // 🟩 Verbleibende Mitglieder + const remainingUserIds = [...active, ...inactive] + await Promise.all( + remainingUserIds.map(async (userId) => { + const notification = await prisma.notification.create({ + data: { + userId, + title: 'Teamupdate', + message: `${userName} wurde aus dem Team "${teamName}" geworfen.`, + actionType: 'team-kick-other', + actionData: null, + }, + }) + + await sendServerWebSocketMessage({ + type: notification.actionType ?? 'notification', + targetUserIds: [userId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }) + }) + ) + + return NextResponse.json({ message: 'Mitglied entfernt' }) + } catch (error) { + console.error('[KICK] Fehler:', error) + return NextResponse.json({ message: 'Serverfehler' }, { status: 500 }) + } +} diff --git a/src/app/api/team/leave/route.ts b/src/app/api/team/leave/route.ts new file mode 100644 index 0000000..35b673a --- /dev/null +++ b/src/app/api/team/leave/route.ts @@ -0,0 +1,113 @@ +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma' +import { removePlayerFromTeam } from '@/app/lib/removePlayerFromTeam' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' + +export async function POST(req: NextRequest) { + try { + const { steamId } = await req.json() + + if (!steamId) { + return NextResponse.json({ message: 'Steam ID fehlt' }, { status: 400 }) + } + + const team = await prisma.team.findFirst({ + where: { + OR: [ + { activePlayers: { has: steamId } }, + { inactivePlayers: { has: steamId } }, + ], + }, + }) + + if (!team) { + return NextResponse.json({ message: 'Kein Team gefunden.' }, { status: 404 }) + } + + const { activePlayers, inactivePlayers, leader } = removePlayerFromTeam( + { + activePlayers: team.activePlayers, + inactivePlayers: team.inactivePlayers, + leader: team.leaderId, + }, steamId) + + if (!leader) { + await prisma.team.delete({ where: { id: team.id } }) + } else { + await prisma.team.update({ + where: { id: team.id }, + data: { + leader: { + connect: { steamId: leader }, + }, + activePlayers, + inactivePlayers, + }, + }) + } + + await prisma.user.update({ + where: { steamId }, + data: { teamId: null }, + }) + + const user = await prisma.user.findUnique({ + where: { steamId }, + select: { name: true }, + }) + + const notification = await prisma.notification.create({ + data: { + userId: steamId, + title: 'Teamupdate', + message: `Du hast das Team "${team.name}" verlassen.`, + actionType: 'team-left', + actionData: null, + }, + }) + + await sendServerWebSocketMessage({ + type: notification.actionType ?? 'notification', + targetUserIds: [steamId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }) + + const allRemainingPlayers = Array.from(new Set([ + ...activePlayers, + ...inactivePlayers, + ])).filter(id => id !== steamId) + + await Promise.all( + allRemainingPlayers.map(async (userId) => { + const notification = await prisma.notification.create({ + data: { + userId, + title: 'Teamupdate', + message: `${user?.name ?? 'Ein Spieler'} hat das Team verlassen.`, + actionType: 'team-member-left', + actionData: null, + }, + }) + + await sendServerWebSocketMessage({ + type: notification.actionType ?? 'notification', + targetUserIds: [userId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }) + }) + ) + + return NextResponse.json({ message: 'Erfolgreich aus dem Team entfernt' }) + } catch (error) { + console.error('Fehler beim Verlassen des Teams:', error) + return NextResponse.json({ message: 'Fehler beim Verlassen des Teams' }, { status: 500 }) + } +} diff --git a/src/app/api/team/list/route.ts b/src/app/api/team/list/route.ts new file mode 100644 index 0000000..db6cbb8 --- /dev/null +++ b/src/app/api/team/list/route.ts @@ -0,0 +1,53 @@ +// src/app/api/team/list/route.ts +import { NextResponse } from 'next/server' +import { prisma } from '@/app/lib/prisma' + +/** + * GET /api/team/list + * Liefert alle Teams inklusive aller Mitglieder (User‑Objekte) + * Struktur: + * [ + * { + * id, teamname, logo, leader, createdAt, + * players: [ { steamId, name, avatar, location } ] + * }, + * … + * ] + */ +export async function GET() { + try { + /* 1. Alle Teams holen */ + const teams = await prisma.team.findMany() + + /* 2. Für jedes Team die zugehörigen User‑Datensätze besorgen */ + const teamsWithPlayers = await Promise.all( + teams.map(async (t) => { + const steamIds = [...t.activePlayers, ...t.inactivePlayers] + + // User abrufen, die in active+inactive vorkommen + const players = await prisma.user.findMany({ + where: { steamId: { in: steamIds } }, + select: { + steamId: true, + name: true, + avatar: true, + location: true, + }, + }) + + return { + ...t, + players, + } + }) + ) + + return NextResponse.json({ teams: teamsWithPlayers }, { status: 200 }) + } catch (err) { + console.error('GET /api/team/list failed:', err) + return NextResponse.json( + { message: 'Interner Serverfehler' }, + { status: 500 } + ) + } +} diff --git a/src/app/api/team/rename/route.ts b/src/app/api/team/rename/route.ts new file mode 100644 index 0000000..c530d27 --- /dev/null +++ b/src/app/api/team/rename/route.ts @@ -0,0 +1,32 @@ +// /app/api/team/rename/route.ts +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' + +export async function POST(req: NextRequest) { + try { + const { teamId, newName } = await req.json() + + if (!teamId || !newName) { + return NextResponse.json({ error: 'Fehlende Parameter' }, { status: 400 }) + } + + await prisma.team.update({ + where: { id: teamId }, + data: { name: newName }, + }) + + // 🔔 WebSocket Nachricht an alle User (global) + await sendServerWebSocketMessage({ + type: 'team-renamed', + title: 'Team umbenannt!', + message: `Das Team wurde umbenannt in "${newName}".`, + teamId, + }) + + return NextResponse.json({ success: true }) + } catch (err) { + console.error('Fehler beim Umbenennen:', err) + return NextResponse.json({ error: 'Interner Serverfehler' }, { status: 500 }) + } +} diff --git a/src/app/api/team/request-join/route.ts b/src/app/api/team/request-join/route.ts new file mode 100644 index 0000000..f4c4474 --- /dev/null +++ b/src/app/api/team/request-join/route.ts @@ -0,0 +1,82 @@ +// src/app/api/team/request-join/route.ts +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' + +export async function POST(req: NextRequest) { + try { + /* ---- Session prüfen ------------------------------------------ */ + const session = await getServerSession(authOptions(req)) + if (!session?.user?.steamId) { + return NextResponse.json({ message: 'Nicht eingeloggt' }, { status: 401 }) + } + const requesterSteamId = session.user.steamId + + /* ---- Body validieren ----------------------------------------- */ + const { teamId } = await req.json() + if (!teamId) { + return NextResponse.json({ message: 'teamId fehlt' }, { status: 400 }) + } + + /* ---- Team holen ---------------------------------------------- */ + const team = await prisma.team.findUnique({ where: { id: teamId } }) + if (!team) { + return NextResponse.json({ message: 'Team nicht gefunden' }, { status: 404 }) + } + + /* ---- Bereits Mitglied? --------------------------------------- */ + if ( + requesterSteamId === team.leaderId || + team.activePlayers.includes(requesterSteamId) || + team.inactivePlayers.includes(requesterSteamId) + ) { + return NextResponse.json({ message: 'Du bist bereits Mitglied' }, { status: 400 }) + } + + /* ---- Doppelte Anfrage vermeiden ------------------------------ */ + const existingInvite = await prisma.invitation.findFirst({ + where: { userId: requesterSteamId, teamId }, + }) + if (existingInvite) { + return NextResponse.json({ message: 'Anfrage läuft bereits' }, { status: 200 }) + } + + /* ---- Invitation anlegen -------------------------------------- */ + await prisma.invitation.create({ + data: { + userId: requesterSteamId, // User.steamId + teamId, + type: 'team-join-request', + }, + }) + + /* ---- Leader benachrichtigen ---------------------------------- */ + const notification = await prisma.notification.create({ + data: { + userId: team.leaderId!, + title: 'Beitrittsanfrage', + message: `${session.user.name ?? 'Ein Spieler'} möchte deinem Team beitreten.`, + actionType: 'team-join-request', + actionData: teamId, + }, + }) + + /* ---- WebSocket Event (optional) ------------------------------ */ + await sendServerWebSocketMessage({ + type: notification.actionType ?? 'notification', + targetUserIds: [team.leaderId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }) + + return NextResponse.json({ message: 'Anfrage gesendet' }, { status: 200 }) + } catch (err) { + console.error('POST /api/team/request-join', err) + return NextResponse.json({ message: 'Interner Serverfehler' }, { status: 500 }) + } +} diff --git a/src/app/api/team/route.ts b/src/app/api/team/route.ts new file mode 100644 index 0000000..8c0fad5 --- /dev/null +++ b/src/app/api/team/route.ts @@ -0,0 +1,76 @@ +import { getServerSession } from 'next-auth' +import { baseAuthOptions } from '@/app/lib/auth' +import { prisma } from '@/app/lib/prisma' +import { NextResponse, type NextRequest } from 'next/server' + +export async function GET() { + const session = await getServerSession(baseAuthOptions) + + if (!session?.user?.steamId) { + return NextResponse.json({ message: 'Nicht eingeloggt' }, { status: 401 }) + } + + try { + const team = await prisma.team.findFirst({ + where: { + OR: [ + { leader: { steamId: session.user.steamId} }, + { activePlayers: { has: session.user.steamId } }, + { inactivePlayers: { has: session.user.steamId } }, + ], + }, + include: { + matchesAsTeamA: { + include: { + teamA: true, + teamB: true, + } + }, + matchesAsTeamB: { + include: { + teamA: true, + teamB: true, + } + } + } + }) + + if (!team) { + return NextResponse.json({ team: null }, { status: 200 }) + } + + const steamIds = [...team.activePlayers, ...team.inactivePlayers] + + const playerData = await prisma.user.findMany({ + where: { steamId: { in: steamIds } }, + select: { steamId: true, name: true, avatar: true, location: true }, + }) + + const activePlayers = team.activePlayers + .map((id) => playerData.find((m) => m.steamId === id)) + .filter(Boolean) + + const inactivePlayers = team.inactivePlayers + .map((id) => playerData.find((m) => m.steamId === id)) + .filter(Boolean) + + const matches = [...team.matchesAsTeamA, ...team.matchesAsTeamB] + .filter(m => m.teamA && m.teamB) + .sort((a, b) => new Date(a.matchDate).getTime() - new Date(b.matchDate).getTime()) + + return NextResponse.json({ + team: { + id: team.id, + teamname: team.name, + logo: team.logo, + leader: team.leaderId, + activePlayers, + inactivePlayers, + matches, + }, + }) + } catch (error) { + console.error('Fehler in /api/team:', error) + return NextResponse.json({ error: 'Interner Fehler beim Laden des Teams' }, { status: 500 }) + } +} diff --git a/src/app/api/team/transfer-leader/route.ts b/src/app/api/team/transfer-leader/route.ts new file mode 100644 index 0000000..e19d8f9 --- /dev/null +++ b/src/app/api/team/transfer-leader/route.ts @@ -0,0 +1,55 @@ +// /app/api/team/transfer-leader/route.ts + +import { prisma } from '@/app/lib/prisma' +import { NextResponse, type NextRequest } from 'next/server' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' + +export async function POST(req: NextRequest) { + try { + const { teamId, newLeaderSteamId } = await req.json() + + if (!teamId || !newLeaderSteamId) { + return NextResponse.json({ message: 'Fehlende Parameter' }, { status: 400 }) + } + + const team = await prisma.team.findUnique({ + where: { id: teamId }, + }) + + if (!team) { + return NextResponse.json({ message: 'Team nicht gefunden.' }, { status: 404 }) + } + + const allPlayerIds = Array.from(new Set([ + ...(team.activePlayers || []), + ...(team.inactivePlayers || []), + ])) + + if (!allPlayerIds.includes(newLeaderSteamId)) { + return NextResponse.json({ message: 'Neuer Leader ist kein Teammitglied.' }, { status: 400 }) + } + + await prisma.team.update({ + where: { id: teamId }, + data: { leader: newLeaderSteamId }, + }) + + const newLeader = await prisma.user.findUnique({ + where: { steamId: newLeaderSteamId }, + select: { name: true }, + }) + + await sendServerWebSocketMessage({ + type: 'team-leader-changed', + title: 'Neuer Teamleader', + message: `${newLeader?.name ?? 'Ein Spieler'} ist jetzt Teamleader.`, + teamId, + targetUserIds: allPlayerIds, + }) + + return NextResponse.json({ message: 'Leader erfolgreich übertragen.' }) + } catch (error) { + console.error('Fehler beim Leaderwechsel:', error) + return NextResponse.json({ message: 'Serverfehler beim Leaderwechsel.' }, { status: 500 }) + } +} diff --git a/src/app/api/team/update-players/route.ts b/src/app/api/team/update-players/route.ts new file mode 100644 index 0000000..6c1c76b --- /dev/null +++ b/src/app/api/team/update-players/route.ts @@ -0,0 +1,32 @@ +// ✅ /api/team/update-players/route.ts +import { prisma } from '@/app/lib/prisma' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' +import { NextResponse, type NextRequest } from 'next/server' + +export async function POST(req: NextRequest) { + try { + const { teamId, activePlayers, inactivePlayers } = await req.json() + + if (!teamId || !Array.isArray(activePlayers) || !Array.isArray(inactivePlayers)) { + return NextResponse.json({ error: 'Ungültige Eingabedaten' }, { status: 400 }) + } + + await prisma.team.update({ + where: { id: teamId }, + data: { activePlayers, inactivePlayers }, + }) + + const allSteamIds = [...activePlayers, ...inactivePlayers] + + await sendServerWebSocketMessage({ + type: 'team-updated', + teamId, + targetUserIds: allSteamIds, + }) + + return NextResponse.json({ message: 'Team-Mitglieder erfolgreich aktualisiert' }) + } catch (error) { + console.error('Fehler beim Aktualisieren der Team-Mitglieder:', error) + return NextResponse.json({ error: 'Serverfehler beim Aktualisieren' }, { status: 500 }) + } +} \ No newline at end of file diff --git a/src/app/api/team/upload-logo/route.ts b/src/app/api/team/upload-logo/route.ts new file mode 100644 index 0000000..165c092 --- /dev/null +++ b/src/app/api/team/upload-logo/route.ts @@ -0,0 +1,58 @@ +// /api/team/upload-logo/route.ts +import { NextResponse, type NextRequest } from 'next/server' +import { writeFile, mkdir, unlink } from 'fs/promises' +import { join, dirname } from 'path' +import { randomUUID } from 'crypto' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' + +export async function POST(req: NextRequest) { + const formData = await req.formData() + const file = formData.get('logo') as File + const teamId = formData.get('teamId') as string + + if (!file || !teamId) { + return NextResponse.json({ message: 'Ungültige Daten' }, { status: 400 }) + } + + const buffer = Buffer.from(await file.arrayBuffer()) + const ext = file.name.split('.').pop() + const filename = `${teamId}-${randomUUID()}.${ext}` + const filepath = join(process.cwd(), 'public/assets/img/logos', filename) + + await mkdir(dirname(filepath), { recursive: true }) + + // Prisma laden und altes Logo abfragen + const { prisma } = await import('@/app/lib/prisma') + const existingTeam = await prisma.team.findUnique({ + where: { id: teamId }, + select: { logo: true }, + }) + + // Altes Logo löschen (falls vorhanden) + if (existingTeam?.logo) { + const oldPath = join(process.cwd(), 'public/assets/img/logos', existingTeam.logo) + try { + await unlink(oldPath) + } catch (err) { + console.warn('Altes Logo konnte nicht gelöscht werden (evtl. nicht vorhanden):', err) + } + } + + // Neues Logo speichern + await writeFile(filepath, buffer) + + // Team in DB aktualisieren + await prisma.team.update({ + where: { id: teamId }, + data: { logo: filename }, + }) + + await sendServerWebSocketMessage({ + type: 'team-logo-updated', + title: 'Team-Logo hochgeladen!', + message: `Das Teamlogo wurde aktualisiert.`, + teamId + }); + + return NextResponse.json({ success: true, filename }) +} diff --git a/src/app/api/user/invitations/[action]/route.ts b/src/app/api/user/invitations/[action]/route.ts new file mode 100644 index 0000000..33a3a2e --- /dev/null +++ b/src/app/api/user/invitations/[action]/route.ts @@ -0,0 +1,135 @@ +// /api/user/invitations/[action]/route.ts +import { NextResponse, type NextRequest } from 'next/server' +import { prisma } from '@/app/lib/prisma' +import { sendServerWebSocketMessage } from '@/app/lib/websocket-server-client' + +export const dynamic = 'force-dynamic' + +export async function POST( + req: NextRequest, + { params }: { params: { action: string } } +) { + try { + const param = await params + const action = param.action + const { invitationId } = await req.json() + + if (!invitationId) { + return NextResponse.json({ message: 'Invitation ID fehlt' }, { status: 400 }) + } + + const invitation = await prisma.invitation.findUnique({ where: { id: invitationId } }) + if (!invitation) { + return NextResponse.json({ message: 'Einladung existiert nicht mehr' }, { status: 404 }) + } + + const { userId, teamId, type } = invitation + + if (action === 'accept') { + await prisma.user.update({ where: { steamId: userId }, data: { teamId } }) + await prisma.team.update({ + where: { id: teamId }, + data: { inactivePlayers: { push: userId } }, + }) + + await prisma.invitation.delete({ where: { id: invitationId } }) + await prisma.notification.updateMany({ + where: { userId, actionType: 'team-invite', actionData: invitationId }, + data: { read: true, actionType: null, actionData: null }, + }) + + const team = await prisma.team.findUnique({ + where: { id: teamId }, + select: { name: true, activePlayers: true, inactivePlayers: true }, + }) + + const allSteamIds = Array.from(new Set([ + ...(team?.activePlayers ?? []), + ...(team?.inactivePlayers ?? []), + ])) + + const notification = await prisma.notification.create({ + data: { + userId, + title: 'Teambeitritt', + message: `Du bist dem Team "${team?.name ?? 'Unbekannt'}" beigetreten.`, + actionType: 'team-joined', + actionData: teamId, + }, + }) + + await sendServerWebSocketMessage({ + type: notification.actionType ?? 'notification', + targetUserIds: [userId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }) + + const joiningUser = await prisma.user.findUnique({ + where: { steamId: userId }, + select: { name: true }, + }) + + const otherUserIds = allSteamIds.filter(id => id !== userId) + await Promise.all( + otherUserIds.map(async (otherUserId) => { + const notification = await prisma.notification.create({ + data: { + userId: otherUserId, + title: 'Neues Mitglied', + message: `${joiningUser?.name ?? 'Ein Spieler'} ist deinem Team beigetreten.`, + actionType: 'team-member-joined', + actionData: userId, + }, + }) + + await sendServerWebSocketMessage({ + type: notification.actionType ?? 'notification', + targetUserIds: [otherUserId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }) + }) + ) + + return NextResponse.json({ message: 'Einladung angenommen' }) + } + + if (action === 'reject') { + const team = await prisma.team.findUnique({ + where: { id: teamId }, + select: { name: true }, + }) + + await prisma.invitation.delete({ where: { id: invitationId } }) + + await prisma.notification.updateMany({ + where: { userId, actionData: invitationId }, + data: { read: true, actionType: null, actionData: null }, + }) + + const eventType = type === 'team-join-request' + ? 'team-join-request-reject' + : 'team-invite-reject' + + await sendServerWebSocketMessage({ + type: eventType, + targetUserIds: [userId], + message: `Einladung zu Team "${team?.name}" wurde abgelehnt.`, + }) + + return NextResponse.json({ message: 'Einladung abgelehnt' }) + } + + return NextResponse.json({ message: 'Ungültige Aktion' }, { status: 400 }) + } catch (error) { + console.error('Fehler bei Einladung:', error) + return NextResponse.json({ message: 'Serverfehler' }, { status: 500 }) + } +} diff --git a/src/app/api/user/invitations/route.ts b/src/app/api/user/invitations/route.ts new file mode 100644 index 0000000..8e5f1ea --- /dev/null +++ b/src/app/api/user/invitations/route.ts @@ -0,0 +1,37 @@ +// src/app/api/user/invitations/route.ts +import { NextResponse, type NextRequest } from 'next/server' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { prisma } from '@/app/lib/prisma' + +export async function GET(req: NextRequest) { + try { + const session = await getServerSession(authOptions(req)) + if (!session?.user?.steamId) { + return NextResponse.json({ message: 'Nicht eingeloggt' }, { status: 401 }) + } + + const invitations = await prisma.invitation.findMany({ + where: { + userId: session.user.steamId, + }, + select: { + id: true, + teamId: true, + createdAt: true, + type: true, + team: { + select: { + name: true, + } + } + }, + orderBy: { createdAt: 'desc' } + }) + + return NextResponse.json({ invitations }) + } catch (err) { + console.error('Fehler beim Laden der Einladungen:', err) + return NextResponse.json({ message: 'Serverfehler' }, { status: 500 }) + } +} diff --git a/src/app/api/user/route.ts b/src/app/api/user/route.ts new file mode 100644 index 0000000..d71fa8d --- /dev/null +++ b/src/app/api/user/route.ts @@ -0,0 +1,30 @@ +import { NextResponse, type NextRequest } from 'next/server' +import { getServerSession } from 'next-auth' +import { authOptions } from '@/app/lib/auth' +import { prisma } from '@/app/lib/prisma' + +export async function GET(req: NextRequest) { + const session = await getServerSession(authOptions(req)) + + const steamId = session?.user?.steamId + if (!steamId) { + return NextResponse.json({ error: 'Nicht eingeloggt' }, { status: 401 }) + } + + const user = await prisma.user.findUnique({ + where: { steamId }, + select: { + name: true, + steamId: true, + avatar: true, + team: true, + isAdmin: true, + }, + }) + + if (!user) { + return NextResponse.json({ error: 'User nicht gefunden' }, { status: 404 }) + } + + return NextResponse.json(user) +} diff --git a/src/app/components/Button.tsx b/src/app/components/Button.tsx new file mode 100644 index 0000000..6eab8cd --- /dev/null +++ b/src/app/components/Button.tsx @@ -0,0 +1,153 @@ +'use client' + +import { ReactNode, forwardRef, useState, useRef, useEffect } from 'react' + +type ButtonProps = { + title?: string + children?: ReactNode + onClick?: () => void + onToggle?: (open: boolean) => void + modalId?: string + color?: 'blue' | 'red' | 'gray' | 'green' | 'teal' | 'transparent' + variant?: 'solid' | 'outline' | 'ghost' | 'soft' | 'white' | 'link' + size?: 'sm' | 'md' | 'lg' + className?: string + dropDirection?: "up" | "down" | "auto" +} + +const Button = forwardRef(function Button( + { + title, + children, + onClick, + onToggle, + modalId, + color = 'blue', + variant = 'solid', + size = 'md', + className, + dropDirection = "down" + }, + ref +) { + const [open, setOpen] = useState(false) + const [direction, setDirection] = useState<'up' | 'down'>('down') + const localRef = useRef(null) + const buttonRef = (ref as React.RefObject) || localRef + + const modalAttributes: { [key: string]: string } = modalId + ? { + 'aria-haspopup': 'dialog', + 'aria-expanded': 'false', + 'aria-controls': modalId, + 'data-hs-overlay': `#${modalId}`, + } + : {} + + const sizeClasses: Record = { + sm: 'py-2 px-3', + md: 'py-3 px-4', + lg: 'p-4 sm:p-5', + } + + const base = ` + ${sizeClasses[size] || sizeClasses['md']} + inline-flex items-center gap-x-2 text-sm font-medium rounded-lg + focus:outline-hidden disabled:opacity-50 disabled:pointer-events-none + ` + + const variants: Record> = { + solid: { + blue: 'bg-blue-600 text-white hover:bg-blue-700 focus:bg-blue-700', + red: 'bg-red-600 text-white hover:bg-red-700 focus:bg-red-700', + gray: 'bg-gray-600 text-white hover:bg-gray-700 focus:bg-gray-700', + teal: 'bg-teal-600 text-white hover:bg-teal-700 focus:bg-teal-700', + green: 'bg-green-600 text-white hover:bg-green-700 focus:bg-green-700', + transparent: 'bg-transparent-600 text-white hover:bg-transparent-700 focus:bg-transparent-700', + }, + outline: { + blue: 'border border-gray-200 text-gray-500 hover:border-blue-600 hover:text-blue-600 focus:border-blue-600 focus:text-blue-600 dark:border-neutral-700 dark:text-neutral-400 dark:hover:text-blue-500 dark:hover:border-blue-600 dark:focus:text-blue-500 dark:focus:border-blue-600', + red: 'border border-gray-200 text-gray-500 hover:border-red-600 hover:text-red-600 focus:border-red-600 focus:text-red-600 dark:border-neutral-700 dark:text-neutral-400 dark:hover:text-red-500 dark:hover:border-red-600 dark:focus:text-red-500 dark:focus:border-red-600', + gray: 'border border-gray-200 text-gray-500 hover:border-gray-600 hover:text-gray-600 focus:border-gray-600 focus:text-gray-600 dark:border-neutral-700 dark:text-neutral-400 dark:hover:text-white dark:hover:border-neutral-600 dark:focus:text-white dark:focus:border-neutral-600', + teal: 'border border-teal-200 text-teal-500 hover:border-teal-600 hover:text-teal-600 focus:border-teal-600 focus:text-teal-600 dark:border-neutral-700 dark:text-neutral-400 dark:hover:text-white dark:hover:border-neutral-600 dark:focus:text-white dark:focus:border-neutral-600', + green: 'border border-green-200 text-green-500 hover:border-green-600 hover:text-green-600 focus:border-green-600 focus:text-green-600 dark:border-neutral-700 dark:text-neutral-400 dark:hover:text-white dark:hover:border-neutral-600 dark:focus:text-white dark:focus:border-neutral-600', + transparent: 'border border-transparent-200 text-transparent-500 hover:border-transparent-600 hover:text-transparent-600 focus:border-transparent-600 focus:text-transparent-600 dark:border-neutral-700 dark:text-neutral-400 dark:hover:text-white dark:hover:border-neutral-600 dark:focus:text-white dark:focus:border-neutral-600', + }, + ghost: { + blue: 'border border-transparent text-blue-600 hover:bg-blue-100 hover:text-blue-800 focus:bg-blue-100 focus:text-blue-800 dark:text-blue-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400', + red: 'border border-transparent text-red-600 hover:bg-red-100 hover:text-red-800 focus:bg-red-100 focus:text-red-800 dark:text-red-500 dark:hover:bg-red-800/30 dark:hover:text-red-400 dark:focus:bg-red-800/30 dark:focus:text-red-400', + gray: 'border border-transparent text-gray-600 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100 focus:text-gray-800 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-white dark:focus:bg-neutral-700 dark:focus:text-white', + teal: 'border border-transparent text-teal-600 hover:bg-teal-100 hover:text-teal-800 focus:bg-teal-100 focus:text-teal-800 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-white dark:focus:bg-neutral-700 dark:focus:text-white', + green: 'border border-transparent text-green-600 hover:bg-green-100 hover:text-green-800 focus:bg-green-100 focus:text-green-800 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-white dark:focus:bg-neutral-700 dark:focus:text-white', + transparent: 'border border-transparent text-transparent-600 hover:bg-transparent-100 hover:text-transparent-800 focus:bg-transparent-100 focus:text-transparent-800 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-white dark:focus:bg-neutral-700 dark:focus:text-white', + }, + soft: { + blue: 'bg-blue-100 text-blue-800 hover:bg-blue-200 focus:bg-blue-200 dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900', + red: 'bg-red-100 text-red-800 hover:bg-red-200 focus:bg-red-200 dark:text-red-400 dark:hover:bg-red-900 dark:focus:bg-red-900', + gray: 'bg-gray-100 text-gray-800 hover:bg-gray-200 focus:bg-gray-200 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + teal: 'bg-teal-100 text-teal-800 hover:bg-teal-200 focus:bg-teal-200 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + green: 'bg-green-100 text-green-800 hover:bg-green-200 focus:bg-green-200 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + transparent: 'bg-transparent-100 text-transparent-800 hover:bg-transparent-200 focus:bg-transparent-200 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + }, + white: { + blue: 'border border-teal-200 bg-white text-gray-800 shadow-2xs hover:bg-gray-50 focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + red: 'border border-gray-200 bg-white text-gray-800 shadow-2xs hover:bg-gray-50 focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + gray: 'border border-gray-200 bg-white text-gray-800 shadow-2xs hover:bg-gray-50 focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + teal: 'border border-teal-200 bg-white text-teal-800 shadow-2xs hover:bg-teal-50 focus:bg-teal-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + green: 'border border-green-200 bg-white text-green-800 shadow-2xs hover:bg-green-50 focus:bg-green-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + transparent: 'border border-transparent-200 bg-white text-transparent-800 shadow-2xs hover:bg-transparent-50 focus:bg-transparent-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700', + }, + link: { + blue: 'border border-transparent text-blue-600 hover:text-blue-800 focus:text-blue-800 dark:text-blue-500 dark:hover:text-blue-400 dark:focus:text-blue-400', + red: 'border border-transparent text-red-600 hover:text-red-800 focus:text-red-800 dark:text-red-500 dark:hover:text-red-400 dark:focus:text-red-400', + gray: 'border border-transparent text-gray-600 hover:text-gray-800 focus:text-gray-800 dark:text-neutral-400 dark:hover:text-white dark:focus:text-white', + teal: 'border border-transparent text-teal-600 hover:text-teal-800 focus:text-teal-800 dark:text-neutral-400 dark:hover:text-white dark:focus:text-white', + green: 'border border-transparent text-green-600 hover:text-green-800 focus:text-green-800 dark:text-neutral-400 dark:hover:text-white dark:focus:text-white', + transparent: 'border border-transparent text-transparent-600 hover:text-transparent-800 focus:text-transparent-800 dark:text-neutral-400 dark:hover:text-white dark:focus:text-white' + }, + } + + const classes = ` + ${base} + ${variants[variant]?.[color] || variants.solid.blue} + ${className || ''} + ` + + useEffect(() => { + if (open && dropDirection === "auto" && buttonRef.current) { + requestAnimationFrame(() => { + const rect = buttonRef.current!.getBoundingClientRect(); + const dropdownHeight = 200; + const spaceBelow = window.innerHeight - rect.bottom; + const spaceAbove = rect.top; + + if (spaceBelow < dropdownHeight && spaceAbove > dropdownHeight) { + setDirection("up"); + } else { + setDirection("down"); + } + }); + } + }, [open, dropDirection]); + + const toggle = () => { + const next = !open + setOpen(next) + onToggle?.(next) + onClick?.() + } + + return ( + + ) +}) + +export default Button \ No newline at end of file diff --git a/src/app/components/Card.tsx b/src/app/components/Card.tsx new file mode 100644 index 0000000..7f428ad --- /dev/null +++ b/src/app/components/Card.tsx @@ -0,0 +1,59 @@ +'use client' + +type CardWidth = + | 'sm' // 24rem (max‑w‑sm) + | 'md' // 28rem (max‑w‑md) + | 'lg' // 32rem (max‑w‑lg) + | 'xl' // 36rem (max‑w‑xl) + | '2xl' // 42rem (max‑w‑2xl) + | 'full' // 100 % (w‑full) + | 'auto' // keine Begrenzung + +type CardProps = { + title?: string + description?: string + children?: React.ReactNode + /** links, rechts oder (Default) zentriert */ + align?: 'left' | 'right' | 'center' + /** gewünschte Max‑Breite (Default: lg) */ + maxWidth?: CardWidth +} + +export default function Card({ + children, + align = 'center', + maxWidth = 'lg' +}: CardProps) { + /* Ausrichtung bestimmen */ + const alignClasses = + align === 'left' + ? 'mr-auto' + : align === 'right' + ? 'ml-auto' + : 'mx-auto' // center + + /* Breite in Tailwind‑Klasse übersetzen */ + const widthClasses: Record = { + sm: 'max-w-sm', + md: 'max-w-md', + lg: 'max-w-lg', + xl: 'max-w-xl', + '2xl': 'max-w-2xl', + full: 'w-full', + auto: '' // keine Begrenzung + } + + return ( +
+
+ {children &&
{children}
} +
+
+ ) +} diff --git a/src/app/components/ComboBox.tsx b/src/app/components/ComboBox.tsx new file mode 100644 index 0000000..a601254 --- /dev/null +++ b/src/app/components/ComboBox.tsx @@ -0,0 +1,80 @@ +'use client' + +type ComboBoxProps = { + value: string + items?: string[] + onSelect: (value: string) => void +} + +export default function ComboBox({ value, items, onSelect }: ComboBoxProps) { + return ( +
+
+ + +
+ +
+ {items?.map((item, idx) => ( +
onSelect(item)} + data-hs-combo-box-output-item="" + data-hs-combo-box-item-stored-data={JSON.stringify({ id: idx, name: item })} + > +
+ {item} + {item === value && ( + + + + + + )} +
+
+ ))} +
+
+ ) +} diff --git a/src/app/components/CreateTeamButton.tsx b/src/app/components/CreateTeamButton.tsx new file mode 100644 index 0000000..3b43212 --- /dev/null +++ b/src/app/components/CreateTeamButton.tsx @@ -0,0 +1,154 @@ +'use client' + +import { useEffect, useState, useImperativeHandle, forwardRef } from 'react' +import { useSession } from 'next-auth/react' +import Modal from './Modal' +import Button from './Button' +import { Player, Team } from '../types/team' + +type CreateTeamButtonProps = { + setRefetchKey: (key: string) => void +} + +const CreateTeamButton = forwardRef(({ setRefetchKey }, ref) => { + const { data: session } = useSession() + + const [teamname, setTeamname] = useState('') + const [showModal, setShowModal] = useState(false) + const [status, setStatus] = useState<'idle' | 'success' | 'error'>('idle') + const [message, setMessage] = useState('') + + const handleSubmit = async () => { + setStatus('idle') + setMessage('') + + if (!teamname.trim()) { + setStatus('error') + setMessage('Bitte gib einen Teamnamen ein.') + return + } + + try { + const res = await fetch('/api/team/create', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ teamname, leader: session?.user?.steamId }), + }) + + const result = await res.json() + + if (!res.ok) { + throw new Error(result.message || 'Fehler beim Erstellen') + } + + setStatus('success') + setMessage(`Team "${result.team.teamname}" wurde erfolgreich erstellt!`) + setTeamname('') + + setTimeout(() => { + const modalEl = document.getElementById('modal-create-team') + if (modalEl && window.HSOverlay?.close) { + window.HSOverlay.close(modalEl) + } + setShowModal(false) + + setRefetchKey(Date.now().toString()) // 🔥 Neuer Key zum Reload + }, 1500) + + } catch (err: any) { + setStatus('error') + setMessage(err.message || 'Fehler beim Erstellen des Teams') + } + } + + return ( +
+ + + setShowModal(false)} + onSave={handleSubmit} + closeButtonTitle="Team erstellen" + > +
+ + +
+ { + setTeamname(e.target.value) + setStatus('idle') + setMessage('') + }} + className={`py-2.5 px-4 block w-full rounded-lg sm:text-sm focus:ring-1 + dark:bg-neutral-800 dark:text-neutral-200 dark:border-neutral-700 + ${ + status === 'error' + ? 'border-red-500 focus:border-red-500 focus:ring-red-500' + : status === 'success' + ? 'border-teal-500 focus:border-teal-500 focus:ring-teal-500' + : 'border-gray-300 focus:border-blue-500 focus:ring-blue-500' + } + `} + required + name="teamname" + aria-describedby="teamname-feedback" + /> + + {status !== 'idle' && ( +
+ + {status === 'error' ? ( + <> + + + + + ) : ( + + )} + +
+ )} +
+ + {message && ( +

+ {message} +

+ )} +
+
+
+ ) +}) + +CreateTeamButton.displayName = 'CreateTeamButton' + +export default CreateTeamButton diff --git a/src/app/components/DatePickerWithTime.tsx b/src/app/components/DatePickerWithTime.tsx new file mode 100644 index 0000000..be6ac1e --- /dev/null +++ b/src/app/components/DatePickerWithTime.tsx @@ -0,0 +1,209 @@ +"use client"; + +import { useState, useRef, useEffect } from "react"; +import Select from "./Select"; +import Button from "./Button"; + +const months = [ + "Januar", "Februar", "März", "April", "Mai", "Juni", + "Juli", "August", "September", "Oktober", "November", "Dezember" +]; +const years = Array.from({ length: 5 }, (_, i) => new Date().getFullYear() + i); + +type DatePickerWithTimeProps = { + value: Date; + onChange: (date: Date) => void; +}; + +export default function DatePickerWithTime({ value, onChange }: DatePickerWithTimeProps) { + const [showPicker, setShowPicker] = useState(false); + const [month, setMonth] = useState(value.getMonth()); + const [year, setYear] = useState(value.getFullYear()); + const [hour, setHour] = useState(value.getHours()); + const [minute, setMinute] = useState(value.getMinutes()); + const [direction, setDirection] = useState<"up" | "down">("down"); + + const buttonRef = useRef(null); + + const daysInMonth = new Date(year, month + 1, 0).getDate(); + const firstDay = new Date(year, month, 1).getDay(); + const offset = (firstDay + 6) % 7; // Mo=0 + + const formattedDate = `${value.toLocaleDateString("de-DE")} ${value.toLocaleTimeString("de-DE", { + hour: "2-digit", + minute: "2-digit", + hour12: false, + })}`; + + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if ( + !buttonRef.current?.contains(event.target as Node) && + !document.getElementById("datepicker-popover")?.contains(event.target as Node) + ) { + setShowPicker(false); + } + }; + document.addEventListener("mousedown", handleClickOutside); + return () => document.removeEventListener("mousedown", handleClickOutside); + }, []); + + // Aktualisiere value bei Uhrzeit-/Datumsauswahl + useEffect(() => { + const newDate = new Date(year, month, value.getDate(), hour, minute); + onChange(newDate); + }, [hour, minute, year, month]); + + useEffect(() => { + if (showPicker && buttonRef.current) { + requestAnimationFrame(() => { + const rect = buttonRef.current!.getBoundingClientRect(); + const dropdownHeight = 350; + const spaceBelow = window.innerHeight - rect.bottom; + const spaceAbove = rect.top; + + if (spaceBelow < dropdownHeight && spaceAbove > dropdownHeight) { + setDirection("up"); + } else { + setDirection("down"); + } + }); + } + }, [showPicker]); + + const handleDayClick = (day: number) => { + const newDate = new Date(year, month, day, hour, minute); + onChange(newDate); + }; + + return ( +
+ + + {showPicker && ( +
+
+ {/* Header: Monat / Jahr / Prev / Next */} +
+
+ +
+ +
+ ({ value: y.toString(), label: y.toString() }))} + value={year.toString()} + onChange={(val) => setYear(Number(val))} + className="min-w-[5rem]" + /> +
+ +
+ +
+
+ + {/* Wochentage */} +
+ {["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"].map((d) => ( + + {d} + + ))} +
+ + {/* Kalendertage */} +
+ {Array.from({ length: offset }).map((_, i) => ( +
+ ))} + {Array.from({ length: daysInMonth }, (_, i) => { + const day = i + 1; + const isSelected = + value.getDate() === day && + value.getMonth() === month && + value.getFullYear() === year; + return ( + + ); + })} +
+ + {/* Uhrzeit-Auswahl */} +
+ ({ + value: m.toString(), + label: m.toString().padStart(2, "0") + }))} + value={minute.toString()} + onChange={(val) => setMinute(Number(val))} + /> +
+
+
+ )} +
+ ); +} diff --git a/src/app/components/Dropdown.tsx b/src/app/components/Dropdown.tsx new file mode 100644 index 0000000..b20ae05 --- /dev/null +++ b/src/app/components/Dropdown.tsx @@ -0,0 +1,78 @@ +import { useEffect, useRef, useState } from 'react' + +export type DropdownItem = { + label: string + icon?: React.ReactNode + onClick?: () => void + disabled?: boolean +} + +type DropdownProps = { + items: DropdownItem[] +} + +export default function Dropdown({ items }: DropdownProps) { + const [open, setOpen] = useState(false) + const dropdownRef = useRef(null) + + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { + setOpen(false) + } + } + + if (open) { + document.addEventListener('mousedown', handleClickOutside) + } else { + document.removeEventListener('mousedown', handleClickOutside) + } + + return () => { + document.removeEventListener('mousedown', handleClickOutside) + } + }, [open]) + + return ( +
+ + + {open && ( +
+
+ {items.map((item, index) => ( + + ))} +
+
+ )} +
+ ) + } \ No newline at end of file diff --git a/src/app/components/DroppableZone.tsx b/src/app/components/DroppableZone.tsx new file mode 100644 index 0000000..a162532 --- /dev/null +++ b/src/app/components/DroppableZone.tsx @@ -0,0 +1,29 @@ +'use client' + +import { useDroppable } from '@dnd-kit/core' +import { Player } from '../types/team' + +type DroppableZoneProps = { + id: string + label: string + children: React.ReactNode + activeDragItem: Player | null +} + +export function DroppableZone({ id, label, children, activeDragItem }: DroppableZoneProps) { + const { isOver, setNodeRef } = useDroppable({ id }) + + const baseClasses = ` + p-4 rounded-lg border-2 min-h-[200px] transition-all + ${isOver ? 'border-blue-400 border-dashed bg-gray-200 dark:bg-neutral-800' : 'border-gray-300 dark:border-neutral-700'} + ` + + return ( +
+

{label}

+
+ {children} +
+
+ ) +} diff --git a/src/app/components/EditButton.tsx b/src/app/components/EditButton.tsx new file mode 100644 index 0000000..dde1c24 --- /dev/null +++ b/src/app/components/EditButton.tsx @@ -0,0 +1,26 @@ +'use client' + +import { useSession } from 'next-auth/react' +import Link from 'next/link' + +export default function EditButton({ match }: { match: any }) { + const { data: session } = useSession() + + const isLeader = + session?.user?.steamId && + (session.user.steamId === match.teamA.leader || + session.user.steamId === match.teamB.leader) + + if (!isLeader) return null + + return ( +
+ + Match bearbeiten + +
+ ) +} diff --git a/src/app/components/EditMatchPlayersModal.tsx b/src/app/components/EditMatchPlayersModal.tsx new file mode 100644 index 0000000..97f79ea --- /dev/null +++ b/src/app/components/EditMatchPlayersModal.tsx @@ -0,0 +1,179 @@ +'use client' + +import { useEffect, useState } from 'react' +import Modal from '@/app/components/Modal' +import MiniCard from '@/app/components/MiniCard' +import LoadingSpinner from '@/app/components/LoadingSpinner' +import { useSession } from 'next-auth/react' +import { Player } from '@/app/types/team' +import { Team } from '@/app/types/team' + +type Props = { + show: boolean + onClose: () => void + matchId: string + teamA: Team + teamB: Team + initialPlayersA: string[] + initialPlayersB: string[] + onSaved?: () => void +} + +export default function EditMatchPlayersModal({ + show, + onClose, + matchId, + teamA, + teamB, + initialPlayersA, + initialPlayersB, + onSaved, +}: Props) { + const { data: session } = useSession() + const [playersA, setPlayersA] = useState([]) + const [playersB, setPlayersB] = useState([]) + const [selectedA, setSelectedA] = useState([]) + const [selectedB, setSelectedB] = useState([]) + const [loading, setLoading] = useState(false) + const [saved, setSaved] = useState(false) + + const steamId = session?.user?.steamId + const isLeaderA = steamId && teamA?.leader && steamId === teamA.leader + const isLeaderB = steamId && teamB?.leader && steamId === teamB.leader + const isAdmin = session?.user?.isAdmin + + const canEdit = isAdmin || isLeaderA || isLeaderB + + if (!teamA || !teamB) return + + useEffect(() => { + if (show) { + fetchTeamPlayers() + setSelectedA(initialPlayersA) + setSelectedB(initialPlayersB) + setSaved(false) + } + }, [show]) + + const fetchTeamPlayers = async () => { + try { + const [resA, resB] = await Promise.all([ + fetch(`/api/team/${teamA.id}`).then(res => res.json()), + fetch(`/api/team/${teamB.id}`).then(res => res.json()), + ]) + setPlayersA(resA.activePlayers || []) + setPlayersB(resB.activePlayers || []) + } catch (err) { + console.error('Fehler beim Laden der Spieler:', err) + } + } + + const toggleSelect = (team: 'A' | 'B', steamId: string) => { + if (team === 'A') { + setSelectedA(prev => + prev.includes(steamId) ? prev.filter(id => id !== steamId) : [...prev, steamId] + ) + } else { + setSelectedB(prev => + prev.includes(steamId) ? prev.filter(id => id !== steamId) : [...prev, steamId] + ) + } + } + + const handleSave = async () => { + setLoading(true) + try { + const players = [ + ...selectedA.map(userId => ({ userId, teamId: teamA.id })), + ...selectedB.map(userId => ({ userId, teamId: teamB.id })), + ] + const res = await fetch(`/api/matches/${matchId}`, { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ players }), + }) + if (!res.ok) throw new Error('Fehler beim Speichern') + setSaved(true) + onSaved?.() + } catch (err) { + console.error('Speichern fehlgeschlagen:', err) + } finally { + setLoading(false) + } + } + + return ( + + {!canEdit ? ( +

+ Du bist kein Teamleiter dieses Matches. +

+ ) : ( + <> + {saved && ( +
+ Änderungen gespeichert +
+ )} +
+
+

{teamA.teamname}

+ {playersA.length === 0 ? ( + + ) : ( +
+ {playersA.map((p) => ( + toggleSelect('A', p.steamId)} + currentUserSteamId={steamId!} + teamLeaderSteamId={teamA.leader} + hideActions + /> + ))} +
+ )} +
+ +
+

{teamB.teamname}

+ {playersB.length === 0 ? ( + + ) : ( +
+ {playersB.map((p) => ( + toggleSelect('B', p.steamId)} + currentUserSteamId={steamId!} + teamLeaderSteamId={teamB.leader} + hideActions + /> + ))} +
+ )} +
+
+ + )} +
+ ) +} diff --git a/src/app/components/Input.tsx b/src/app/components/Input.tsx new file mode 100644 index 0000000..18f8743 --- /dev/null +++ b/src/app/components/Input.tsx @@ -0,0 +1,39 @@ +type InputProps = { + id?: string + label: string + type?: string + value: string + onChange: (e: React.ChangeEvent) => void + placeholder?: string + disabled?: boolean + } + + export default function Input({ + id, + label, + type = 'text', + value, + onChange, + placeholder, + disabled = false, + }: InputProps) { + const inputId = id || label.toLowerCase().replace(/\s+/g, '-') + + return ( +
+ + +
+ ) + } + \ No newline at end of file diff --git a/src/app/components/InvitePlayersModal.tsx b/src/app/components/InvitePlayersModal.tsx new file mode 100644 index 0000000..d14b43c --- /dev/null +++ b/src/app/components/InvitePlayersModal.tsx @@ -0,0 +1,140 @@ +'use client' + +import { useState, useEffect } from 'react' +import Modal from './Modal' +import MiniCard from './MiniCard' +import { useSession } from 'next-auth/react' +import LoadingSpinner from './LoadingSpinner' +import { Player, Team } from '../types/team' + +type Props = { + show: boolean + onClose: () => void + onSuccess: () => void + team: Team +} + +export default function InvitePlayersModal({ show, onClose, onSuccess, team }: Props) { + const { data: session } = useSession() + const steamId = session?.user?.steamId + + const [allUsers, setAllUsers] = useState([]) + const [selectedIds, setSelectedIds] = useState([]) + const [isLoading, setIsLoading] = useState(false); + const [isSuccess, setIsSuccess] = useState(false) + const [sentCount, setSentCount] = useState(0) + + useEffect(() => { + if (show) { + fetchUsersNotInTeam() + setIsSuccess(false) // Status zurücksetzen beim Öffnen + } + }, [show]) + + const fetchUsersNotInTeam = async () => { + try { + setIsLoading(true); + const res = await fetch('/api/team/available-users') + const data = await res.json() + setAllUsers(data.users || []) + } catch (err) { + console.error('Fehler beim Laden der Benutzer:', err) + } + finally { + setIsLoading(false); + } + } + + const handleSelect = (steamId: string) => { + setSelectedIds((prev) => + prev.includes(steamId) ? prev.filter((id) => id !== steamId) : [...prev, steamId] + ) + } + + // Entferne das setTimeout aus handleInvite komplett! + + const handleInvite = async () => { + if (selectedIds.length === 0 || !steamId) return + + try { + const res = await fetch('/api/team/invite', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + teamId: team.id, + userIds: selectedIds, + invitedBy: steamId, + }), + }) + + + if (!res.ok) { + const error = await res.json() + console.error('Fehler beim Einladen:', error.message) + } else { + setSentCount(selectedIds.length) // 👈 speichere Anzahl + setIsSuccess(true) // ✅ Erfolg markieren + setSelectedIds([]) // Optional: Selektion leeren + onSuccess() // ⚡ Nur Success-Callback, kein Schließen hier! + } + } catch (err) { + console.error('Fehler beim Einladen:', err) + } + } + + useEffect(() => { + if (isSuccess) { + const timeout = setTimeout(() => { + const modalEl = document.getElementById('invite-members-modal') + if (modalEl && window.HSOverlay?.close) { + window.HSOverlay.close(modalEl) + } + onClose() + }, 1500) + + return () => clearTimeout(timeout) + } + }, [isSuccess, onClose]) + + return ( + +

+ Wähle Benutzer aus, die du in dein Team einladen möchtest: +

+ {isSuccess && ( +
+ {sentCount} Einladung{sentCount !== 1 ? 'en' : ''} erfolgreich versendet! +
+ )} +
+ {isLoading ? ( + + ) : ( + allUsers.map((user) => ( + + )) + )} +
+
+ ) +} diff --git a/src/app/components/LeaveTeamModal.tsx b/src/app/components/LeaveTeamModal.tsx new file mode 100644 index 0000000..1018cdc --- /dev/null +++ b/src/app/components/LeaveTeamModal.tsx @@ -0,0 +1,88 @@ +'use client' + +import { useState, useEffect } from 'react' +import Modal from './Modal' +import MiniCard from './MiniCard' +import { useSession } from 'next-auth/react' +import { Player, Team } from '../types/team' +import { useTeamManager } from '../hooks/useTeamManager' + +type Props = { + show: boolean + onClose: () => void + onSuccess: () => void + team: Team +} + +export default function LeaveTeamModal({ show, onClose, onSuccess, team }: Props) { + const { data: session } = useSession() + const steamId = session?.user?.steamId + + const [newLeaderId, setNewLeaderId] = useState('') + const [isSubmitting, setIsSubmitting] = useState(false) + const { leaveTeam } = useTeamManager({}, null) + + useEffect(() => { + if (show && team.leader) { + setNewLeaderId(team.leader) + } + }, [show, team.leader]) + + const handleLeave = async () => { + if (!steamId) return + + setIsSubmitting(true) + + try { + const payload = team.leader === steamId + ? { steamId, newLeaderId } + : { steamId } + + const success = await leaveTeam(steamId, team.leader === steamId ? newLeaderId : undefined) + if (success) { + onSuccess() + } + } catch (err) { + console.error('Fehler beim Verlassen:', err) + } finally { + setIsSubmitting(false) + onClose() + } + } + + return ( + +

+ Du bist der Teamleader. Bitte wähle ein anderes Mitglied aus, das die Rolle des Leaders übernehmen soll: +

+
+ {(team.players ?? []) + .filter((player) => player.steamId !== steamId) + .map((player: Player) => ( + + ))} +
+
+ ) +} diff --git a/src/app/components/LoadingSpinner.tsx b/src/app/components/LoadingSpinner.tsx new file mode 100644 index 0000000..ee4df8b --- /dev/null +++ b/src/app/components/LoadingSpinner.tsx @@ -0,0 +1,17 @@ +'use client' + +export default function LoadingSpinner() { + return ( +
+
+
+ Loading... +
+
+
+ ) +} diff --git a/src/app/components/MatchDetails.tsx b/src/app/components/MatchDetails.tsx new file mode 100644 index 0000000..32de0a4 --- /dev/null +++ b/src/app/components/MatchDetails.tsx @@ -0,0 +1,175 @@ +'use client' + +import { useEffect, useState } from 'react' +import Image from 'next/image' +import { useSession } from 'next-auth/react' +import Button from './Button' +import EditMatchPlayersModal from './EditMatchPlayersModal' +import PlayerCard from './PlayerCard' +import { Match } from '../types/match' +import { Player } from '../types/team' +import MatchTeamCard from './MatchTeamCard' + +function getTeamLogo(logo: string | null) { + return logo ? `/assets/img/logos/${logo}` : '/default-logo.png' +} + +export default function MatchDetails({ matchId }: { matchId: string }) { + const { data: session } = useSession() + const [match, setMatch] = useState(null) + const [showModal, setShowModal] = useState(false) + const [saved, setSaved] = useState(false) + + useEffect(() => { + fetch(`/api/matches/${matchId}`) + .then((res) => res.ok ? res.json() : null) + .then((data) => { + // Ensure teamA and teamB match the expected Team type + if (data) { + // Convert undefined to null for logo and leader + const processedData = { + ...data, + teamA: { + ...data.teamA, + logo: data.teamA.logo || null, + leader: data.teamA.leader || null, + }, + teamB: { + ...data.teamB, + logo: data.teamB.logo || null, + leader: data.teamB.leader || null, + } + }; + setMatch(processedData); + } + }) + }, [matchId]) + + const isTeamLeader = + session?.user?.steamId && + (session.user.steamId === match?.teamA?.leader || session.user.steamId === match?.teamB?.leader) + + const isAdmin = session?.user?.isAdmin + + if (!match) return

Match wird geladen …

+ + return ( +
+
+
+
+ {/* Team A */} +
+ {match.teamA.teamname} +
{match.teamA.teamname}
+
+ + {/* Score + Datum */} +
+
+ {match.scoreA ?? '-'} + + {match.scoreB ?? '-'} +
+
+ {new Date(match.matchDate).toLocaleDateString('de-DE')} +
+ {new Date(match.matchDate).toLocaleTimeString('de-DE', { + hour: '2-digit', + minute: '2-digit', + })} Uhr +
+
+ + {/* Team B */} +
+ {match.teamB.teamname} +
{match.teamB.teamname}
+
+
+ + {/* Beschreibung */} + {match.description && ( +
+

{match.description}

+
+ )} +
+ + {/* Spieler‑Listen */} +
+ setShowModal(true)} + /> + setShowModal(true)} + /> +
+ + {/* Modal */} + {match?.teamA && match?.teamB && ( + setShowModal(false)} + matchId={match.id} + teamA={match.teamA} + teamB={match.teamB} + initialPlayersA={match.playersA.map(p => p.user.steamId)} + initialPlayersB={match.playersB.map(p => p.user.steamId)} + onSaved={() => { + setSaved(true); + // Refresh match data after saving + fetch(`/api/matches/${matchId}`) + .then((res) => res.ok ? res.json() : null) + .then((data) => { + if (data) { + // Apply the same processing + const processedData = { + ...data, + teamA: { + ...data.teamA, + logo: data.teamA.logo || null, + leader: data.teamA.leader || null, + }, + teamB: { + ...data.teamB, + logo: data.teamB.logo || null, + leader: data.teamB.leader || null, + } + }; + setMatch(processedData); + } + }); + }} + /> + )} + + {saved && ( +
✓ Änderungen gespeichert
+ )} +
+
+ ) +} \ No newline at end of file diff --git a/src/app/components/MatchList.tsx b/src/app/components/MatchList.tsx new file mode 100644 index 0000000..371e0a8 --- /dev/null +++ b/src/app/components/MatchList.tsx @@ -0,0 +1,121 @@ +'use client' + +import Link from 'next/link' +import Image from 'next/image' +import { useEffect, useState } from 'react' +import { useSession } from 'next-auth/react' +import Switch from '@/app/components/Switch' + +type Match = { + id: string + title: string + description?: string + matchDate: string + teamA: { id: string; teamname: string; logo?: string | null } + teamB: { id: string; teamname: string; logo?: string | null } +} + +function getTeamLogo(logo?: string | null) { + return logo ? `/assets/img/logos/${logo}` : '/default-logo.png' +} + +export default function MatchList() { + const { data: session } = useSession() + const [matches, setMatches] = useState([]) + const [onlyOwnTeam, setOnlyOwnTeam] = useState(false) + + useEffect(() => { + fetch('/api/matches') + .then((res) => res.ok ? res.json() : []) + .then(setMatches) + .catch((err) => console.error('Fehler beim Laden der Matches:', err)) + }, []) + + const filteredMatches = onlyOwnTeam && session?.user?.team + ? matches.filter(m => + m.teamA.id === session.user.team || m.teamB.id === session.user.team + ) + : matches + + return ( +
+
+

Geplante Matches

+ {session?.user?.team && ( + + )} +
+ + {filteredMatches.length === 0 ? ( +

Keine Matches geplant.

+ ) : ( +
    + {filteredMatches.map((match) => ( +
  • + +
    + {/* Team A */} +
    + {match.teamA.teamname} + + {match.teamA.teamname} + +
    + + {/* Datum / Zeit */} +
    +
    {new Date(match.matchDate).toLocaleDateString('de-DE')}
    +
    {new Date(match.matchDate).toLocaleTimeString('de-DE', { + hour: '2-digit', + minute: '2-digit' + })} Uhr
    +
    + + {/* Team B */} +
    + {match.teamB.teamname} + + {match.teamB.teamname} + +
    +
    + + {/* Match-Titel */} +
    + {match.title} +
    + + {/* Match-Beschreibung (optional) */} + {match.description && ( +
    + {match.description} +
    + )} + +
  • + ))} +
+ )} +
+ ) +} diff --git a/src/app/components/MatchPlayerCard.tsx b/src/app/components/MatchPlayerCard.tsx new file mode 100644 index 0000000..cbfdb93 --- /dev/null +++ b/src/app/components/MatchPlayerCard.tsx @@ -0,0 +1,43 @@ +import Table from './Table' +import Image from 'next/image' +import { MatchPlayer } from '@/app/types/match' + +type Props = { + player: MatchPlayer +} + +export default function MatchPlayerCard({ player }: Props) { + return ( + + + {`Avatar + + + {player.user.name} + + + {player.stats?.kills ?? '-'} + + + {player.stats?.deaths ?? '-'} + + + {player.stats?.assists ?? '-'} + + + {player.stats?.adr ?? '-'} + + + {player.stats?.adr ?? '-'} + + + + + + ) +} diff --git a/src/app/components/MatchTeamCard.tsx b/src/app/components/MatchTeamCard.tsx new file mode 100644 index 0000000..9b4bbd8 --- /dev/null +++ b/src/app/components/MatchTeamCard.tsx @@ -0,0 +1,95 @@ +'use client' + +import { Team } from '@/app/types/team' +import { MatchPlayer } from '../types/match' +import MatchPlayerCard from './MatchPlayerCard' +import Image from 'next/image' +import Button from './Button' +import Table from './Table' + +type Props = { + team: Team + players: MatchPlayer[] + onEditClick?: () => void + editable?: boolean +} + +function getTeamLogo(logo: string | null) { + return logo ? `/assets/img/logos/${logo}` : '/default-logo.png' +} + +const StatIcons = { + kills: + + + + , + deaths: + + + + , + assist: + + + + , + adr: + + + + , + utildmg: + + + + , +} + +export default function MatchTeamCard({ team, players, onEditClick, editable }: Props) { + return ( +
+ {/* Gemeinsamer Rahmen mit Abrundung */} +
+ {/* Teamkopf */} +
+
+ {team.teamname} +

+ {team.teamname} +

+
+ {editable &&
+ + {/* Tabelle ohne extra Rahmen */} + + + + + Name + {StatIcons.kills} + {StatIcons.deaths} + {StatIcons.assist} + {StatIcons.adr} + {StatIcons.utildmg} + + + + + {players.map(player => ( + + ))} + +
+
+
+ ) +} + diff --git a/src/app/components/MatchesAdminManager.tsx b/src/app/components/MatchesAdminManager.tsx new file mode 100644 index 0000000..75163f3 --- /dev/null +++ b/src/app/components/MatchesAdminManager.tsx @@ -0,0 +1,209 @@ +'use client' + +import { useEffect, useState } from 'react' +import { useSession } from 'next-auth/react' +import Modal from '@/app/components/Modal' +import Select from '@/app/components/Select' +import Input from './Input' +import Button from './Button' +import DatePickerWithTime from './DatePickerWithTime' +import Link from 'next/link' +import Image from 'next/image' +import Switch from './Switch' + +function getRoundedDate() { + const now = new Date() + const minutes = now.getMinutes() + const roundedMinutes = Math.ceil(minutes / 15) * 15 + now.setMinutes(roundedMinutes === 60 ? 0 : roundedMinutes) + if (roundedMinutes === 60) now.setHours(now.getHours() + 1) + now.setSeconds(0) + now.setMilliseconds(0) + return now +} + +function getTeamLogo(logo?: string | null) { + return logo ? `/assets/img/logos/${logo}` : '/default-logo.png' +} + +export default function MatchesAdminManager() { + const { data: session } = useSession() + const [teams, setTeams] = useState([]) + const [matches, setMatches] = useState([]) + const [teamAId, setTeamAId] = useState('') + const [teamBId, setTeamBId] = useState('') + const [title, setTitle] = useState('') + const [titleManuallySet, setTitleManuallySet] = useState(false) + const [description, setDescription] = useState('') + const [matchDate, setMatchDate] = useState(getRoundedDate()) + const [showModal, setShowModal] = useState(false) + const [onlyOwnTeam, setOnlyOwnTeam] = useState(false) + + useEffect(() => { + fetch('/api/admin/teams').then(res => res.json()).then(setTeams) + fetchMatches() + }, []) + + useEffect(() => { + if (!titleManuallySet && teamAId && teamBId && teamAId !== teamBId) { + const teamA = teams.find(t => t.id === teamAId) + const teamB = teams.find(t => t.id === teamBId) + if (teamA && teamB) { + setTitle(`${teamA.teamname} vs ${teamB.teamname}`) + } + } + }, [teamAId, teamBId, teams, titleManuallySet]) + + const fetchMatches = async () => { + const res = await fetch('/api/matches') + if (res.ok) { + const data = await res.json() + setMatches(data) + } + } + + const filteredMatches = onlyOwnTeam && session?.user?.team + ? matches.filter((m: any) => + m.teamA.id === session.user.team || m.teamB.id === session.user.team) + : matches + + const resetFields = () => { + setTitle('') + setTitleManuallySet(false) + setDescription('') + setMatchDate(getRoundedDate()) + setTeamAId('') + setTeamBId('') + } + + const createMatch = async () => { + if (!teamAId || !teamBId || !title || !matchDate || teamAId === teamBId) { + alert('Bitte alle Felder korrekt ausfüllen.') + return + } + + const res = await fetch('/api/matches/create', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ teamAId, teamBId, title, description, matchDate }) + }) + + if (res.ok) { + resetFields() + setShowModal(false) + fetchMatches() + } else { + alert('Fehler beim Erstellen') + } + } + + return ( + <> +
+ {filteredMatches.length === 0 ? ( +

Keine Matches geplant.

+ ) : ( +
    + {filteredMatches.map((match: any) => ( +
  • + +
    +
    + {match.teamA.teamname} + + {match.teamA.teamname} + +
    +
    +
    {new Date(match.matchDate).toLocaleDateString('de-DE')}
    +
    {new Date(match.matchDate).toLocaleTimeString('de-DE', { + hour: '2-digit', + minute: '2-digit' + })} Uhr
    +
    +
    + {match.teamB.teamname} + + {match.teamB.teamname} + +
    +
    + + {match.description && ( +
    + {match.description} +
    + )} + +
  • + ))} +
+ )} +
+ + {/* Modal zum Erstellen */} + setShowModal(false)} + onSave={createMatch} + closeButtonTitle="Erstellen" + closeButtonColor="blue" + > +
+
+ + t.id !== teamAId).map(t => ({ value: t.id, label: t.teamname }))} + placeholder="Wählen" + /> +
+
+ { + setTitle(e.target.value) + setTitleManuallySet(true) + }} + /> +
+
+ setDescription(e.target.value)} + /> +
+
+ +
+
+
+ + ) +} diff --git a/src/app/components/MiniCard.tsx b/src/app/components/MiniCard.tsx new file mode 100644 index 0000000..395fea3 --- /dev/null +++ b/src/app/components/MiniCard.tsx @@ -0,0 +1,125 @@ +'use client' + +import Button from './Button' +import Image from 'next/image' + +type MiniCardProps = { + title: string + avatar: string + steamId: string + selected?: boolean + onSelect?: (steamId: string) => void + onKick?: (steamId: string) => void + isLeader?: boolean + draggable?: boolean + currentUserSteamId: string + teamLeaderSteamId: string + location?: string + dragListeners?: any + hoverEffect?: boolean + onPromote?: (steamId: string) => void + hideActions?: boolean + hideOverlay?: boolean +} + +export default function MiniCard({ + title, + avatar, + steamId, + selected, + onSelect, + onKick, + isLeader = false, + draggable, + currentUserSteamId, + teamLeaderSteamId, + location, + dragListeners, + hoverEffect = false, + onPromote, + hideActions = false, + hideOverlay = false, +}: MiniCardProps) { + const isSelectable = typeof onSelect === 'function' + const canKick = currentUserSteamId === teamLeaderSteamId && steamId !== teamLeaderSteamId + + const cardClasses = ` + relative flex flex-col items-center p-4 border rounded-lg transition + max-h-[154px] w-full overflow-hidden + bg-white dark:bg-neutral-800 border shadow-2xs rounded-xl + ${selected ? 'ring-1 ring-blue-500 border-blue-500 dark:ring-blue-400' : 'border-gray-200 dark:border-neutral-700'} + ${hoverEffect ? 'hover:cursor-grab hover:scale-105' : ''} + ${isSelectable ? 'hover:border-blue-400 dark:hover:border-blue-400 cursor-pointer' : ''} + ` + + const avatarWrapper = 'relative w-16 h-16 mb-2' + + const handleCardClick = () => { + if (isSelectable) onSelect?.(steamId) + } + + const handleKickClick = (e: React.MouseEvent) => { + onKick?.(steamId) + } + + const handlePromoteClick = (e: React.MouseEvent) => { + onPromote?.(steamId) + } + + const stopDrag = (e: React.PointerEvent | React.MouseEvent) => { + e.stopPropagation() + } + + return ( +
+ {canKick && !hideActions && !hideOverlay && ( +
+ {title} +
+
+ {typeof onPromote === 'function' && ( +
+
+ )} +
+ )} + +
+
+
+ {title} + {isLeader && ( +
+ + + +
+ )} +
+
+ + + {title} + + + {location ? ( + + ) : ( + 🌐 + )} +
+
+ ) +} diff --git a/src/app/components/MiniCardDummy.tsx b/src/app/components/MiniCardDummy.tsx new file mode 100644 index 0000000..0801346 --- /dev/null +++ b/src/app/components/MiniCardDummy.tsx @@ -0,0 +1,39 @@ +type MiniCardDummyProps = { + title: string + onClick?: () => void + children?: React.ReactNode +} + +export default function MiniCardDummy({ title, onClick, children }: MiniCardDummyProps) { + return ( +
+
+
+ {children ? ( + children + ) : ( + Dummy Avatar + )} +
+ + + {title} + +
+ + {/* reserviere Platz für Flagge oder Button, auch wenn leer */} +
+
+ ) +} diff --git a/src/app/components/Modal.tsx b/src/app/components/Modal.tsx new file mode 100644 index 0000000..184b061 --- /dev/null +++ b/src/app/components/Modal.tsx @@ -0,0 +1,153 @@ +'use client' + +import { useEffect } from 'react' + +type ModalProps = { + id: string + title: string + children?: React.ReactNode + show: boolean + onClose?: () => void + onSave?: () => void + hideCloseButton?: boolean + closeButtonColor?: string + closeButtonTitle?: string +} + +export default function Modal({ + id, + title, + children, + show, + onClose, + onSave, + hideCloseButton = false, + closeButtonColor = "blue", + closeButtonTitle = "Speichern" +}: ModalProps) { + + useEffect(() => { + const modalEl = document.getElementById(id); + const hs = (window as any).HSOverlay; + + const handleClose = () => { + if (typeof onClose === 'function') { + onClose(); + } + }; + + modalEl?.addEventListener('hsOverlay:close', handleClose); + + const tryOpen = () => { + try { + if (typeof hs?.autoInit === 'function') { + hs.autoInit(); + } + + if (modalEl && typeof hs?.open === 'function') { + hs.open(modalEl); + } + } catch (err) { + console.error('[Modal] Fehler beim Öffnen des Modals:', err); + } + }; + + const tryClose = () => { + try { + if (modalEl && typeof hs?.close === 'function') { + const isInCollection = hs?.collection?.find?.((item: any) => item.element === modalEl); + if (isInCollection) { + hs.close(modalEl); + } + } + } catch (err) { + console.error('[Modal] Fehler beim Schließen des Modals:', err); + } + }; + + if (show) { + tryOpen(); + } else { + tryClose(); + } + + return () => { + modalEl?.removeEventListener('hsOverlay:close', handleClose); + }; + }, [show, id]); + + return ( + + ); +} diff --git a/src/app/components/Navbar.tsx b/src/app/components/Navbar.tsx new file mode 100644 index 0000000..9da8a06 --- /dev/null +++ b/src/app/components/Navbar.tsx @@ -0,0 +1,91 @@ +'use client' + +import Link from "next/link" +import { usePathname } from 'next/navigation' + +export default function Navbar({ children }: { children?: React.ReactNode }) { + const pathname = usePathname() + + return ( + <> +
+ +
+ + ) +} \ No newline at end of file diff --git a/src/app/components/NoTeamView.tsx b/src/app/components/NoTeamView.tsx new file mode 100644 index 0000000..f77ccc0 --- /dev/null +++ b/src/app/components/NoTeamView.tsx @@ -0,0 +1,70 @@ +'use client' + +import { useEffect, useState } from 'react' +import { useSession } from 'next-auth/react' +import TeamCard from './TeamCard' +import { Team } from '../types/team' + +export default function NoTeamView() { + const { data: session } = useSession() + const [teams, setTeams] = useState([]) + const [teamToInvitationId, setTeamToInvitationId] = useState>({}) + const [loading, setLoading] = useState(true) + + const fetchData = async () => { + setLoading(true) + const [teamRes, invitesRes] = await Promise.all([ + fetch('/api/team/list'), + fetch('/api/user/invitations'), + ]) + const teamData = await teamRes.json() + const inviteData = await invitesRes.json() + + setTeams(teamData.teams || []) + const mapping: Record = {} + for (const invite of inviteData?.invitations || []) { + if (invite.type === 'team-join-request') { + mapping[invite.teamId] = invite.id + } + } + setTeamToInvitationId(mapping) + setLoading(false) + } + + useEffect(() => { + fetchData() + }, []) + + const updateInvitationMap = (teamId: string, newId: string | null) => { + setTeamToInvitationId((prev) => { + const updated = { ...prev } + if (newId) updated[teamId] = newId + else delete updated[teamId] + return updated + }) + } + + if (loading) return

Lade Teams …

+ + return ( +
+

+ Du bist noch in keinem Team. +
+ Tritt jetzt einem Team bei! +

+ +
+ {teams.map((team) => ( + + ))} +
+
+ ) +} \ No newline at end of file diff --git a/src/app/components/NotificationCenter.tsx b/src/app/components/NotificationCenter.tsx new file mode 100644 index 0000000..bab3bb2 --- /dev/null +++ b/src/app/components/NotificationCenter.tsx @@ -0,0 +1,182 @@ +'use client' + +import { useEffect, useState } from 'react' +import NotificationDropdown from './NotificationDropdown' +import { useWS } from '@/app/lib/wsStore' +import { useSession } from 'next-auth/react' +import { useTeamManager } from '../hooks/useTeamManager' +import { useRouter } from 'next/navigation' + +type Notification = { + id: string + text: string + read: boolean + actionType?: string + actionData?: string + createdAt?: string +} + +export default function NotificationCenter() { + const { data: session } = useSession() + const [notifications, setNotifications] = useState([]) + const [open, setOpen] = useState(false) + const { socket, connect } = useWS() + const { markAllAsRead, markOneAsRead, handleInviteAction } = useTeamManager({}, null) + const router = useRouter() + const [previewText, setPreviewText] = useState(null) + const [showPreview, setShowPreview] = useState(false) + const [animateBell, setAnimateBell] = useState(false) + + useEffect(() => { + const steamId = session?.user?.steamId + if (!steamId) return + + const loadNotifications = async () => { + try { + const res = await fetch('/api/notifications/user') + if (!res.ok) throw new Error('Fehler beim Laden') + const data = await res.json() + const loaded = data.notifications.map((n: any) => ({ + id: n.id, + text: n.message, + read: n.read, + actionType: n.actionType, + actionData: n.actionData, + createdAt: n.createdAt, + })) + setNotifications(loaded) + } catch (err) { + console.error('[NotificationCenter] Fehler beim Laden:', err) + } + } + + loadNotifications() + connect(steamId) + }, [session?.user?.steamId, connect]) + + useEffect(() => { + if (!socket) return + + const handleMessage = (event: MessageEvent) => { + const data = JSON.parse(event.data) + if (data.type === 'heartbeat') return + + const isNotificationType = [ + 'notification', + 'invitation', + 'team-invite', + 'team-joined', + 'team-member-joined', + 'team-kick', + 'team-kick-other', + 'team-left', + 'team-member-left', + 'team-leader-changed', + 'team-join-request' + ].includes(data.type) + + if (!isNotificationType) return + + const newNotification: Notification = { + id: data.id, + text: data.message || 'Neue Benachrichtigung', + read: false, + actionType: data.actionType, + actionData: data.actionData, + createdAt: data.createdAt, + } + + setNotifications(prev => [newNotification, ...prev]) + setPreviewText(newNotification.text) + setShowPreview(true) + setAnimateBell(true) + + setTimeout(() => { + setShowPreview(false) + setTimeout(() => { + setPreviewText(null) + }, 300) + setAnimateBell(false) + }, 3000) + + + } + + socket.addEventListener('message', handleMessage) + return () => socket.removeEventListener('message', handleMessage) + }, [socket]) + + return ( +
+ + + {/* Dropdown */} + {open && ( + { + await markAllAsRead() + setNotifications(prev => prev.map(n => ({ ...n, read: true }))) + }} + onSingleRead={async (id) => { + await markOneAsRead(id) + setNotifications(prev => prev.map(n => (n.id === id ? { ...n, read: true } : n))) + }} + onClose={() => setOpen(false)} + onAction={async (action, id) => { + await handleInviteAction(action, id) + setNotifications(prev => + prev.map(n => + n.actionData === id + ? { ...n, read: true, actionType: undefined, actionData: undefined } + : n + ) + ) + if (action === 'accept') router.refresh() + }} + /> + )} +
+ ) +} diff --git a/src/app/components/NotificationDropdown.tsx b/src/app/components/NotificationDropdown.tsx new file mode 100644 index 0000000..650a116 --- /dev/null +++ b/src/app/components/NotificationDropdown.tsx @@ -0,0 +1,173 @@ +'use client' + +import { useEffect, useRef } from 'react' +import Button from './Button' +import { formatDistanceToNow } from 'date-fns' +import { de } from 'date-fns/locale' + +type Notification = { + id: string + text: string + read: boolean + actionType?: string // z. B. "team-invite" | "team-join-request" + actionData?: string // invitationId oder teamId + createdAt?: string +} + +type Props = { + notifications: Notification[] + markAllAsRead: () => void + onSingleRead: (id: string) => void + onClose: () => void + onAction: (action: 'accept' | 'reject', invitationId: string) => void +} + +export default function NotificationDropdown({ + notifications, + markAllAsRead, + onSingleRead, + onClose, + onAction, +}: Props) { + const dropdownRef = useRef(null) + + /* --- Klick außerhalb schließt Dropdown ------------------------- */ + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if ( + dropdownRef.current && + !dropdownRef.current.contains(event.target as Node) + ) { + onClose() + } + } + + document.addEventListener('mousedown', handleClickOutside) + return () => document.removeEventListener('mousedown', handleClickOutside) + }, [onClose]) + + /* --- Render ----------------------------------------------------- */ + return ( +
+ {/* Kopfzeile */} +
+ + Benachrichtigungen + + + +
+ + {/* Liste */} +
+ {notifications.length === 0 ? ( +
+ Keine Benachrichtigungen +
+ ) : ( + notifications.map((n) => { + const needsAction = + !n.read && + (n.actionType === 'team-invite' || + n.actionType === 'team-join-request') + + return ( +
+ {/* roter Punkt */} +
+ +
+ + {/* Text + Timestamp */} +
+ + {n.text} + + + {n.createdAt && + formatDistanceToNow(new Date(n.createdAt), { + addSuffix: true, + locale: de, + })} + +
+ + {/* Aktionen */} +
+ {needsAction ? ( + <> + + + + ) : ( + !n.read && ( + + ) + )} +
+
+ ) + }) + )} +
+
+ ) +} diff --git a/src/app/components/PlayerCard.tsx b/src/app/components/PlayerCard.tsx new file mode 100644 index 0000000..ab71b59 --- /dev/null +++ b/src/app/components/PlayerCard.tsx @@ -0,0 +1,81 @@ +'use client' + +import Image from 'next/image' +import { Player, Team } from '@/app/types/team' + +export type CardWidth = + | 'sm' // max-w-sm (24rem) + | 'md' // max-w-md (28rem) + | 'lg' // max-w-lg (32rem) + | 'xl' // max-w-xl (36rem) + | '2xl' // max-w-2xl (42rem) + | 'full' // w-full + | 'auto' // keine Begrenzung + +type Props = { + player: Player + team?: Team // aktuell nicht genutzt, aber falls du später z. B. Team‑Farbe brauchst + align?: 'left' | 'right' + maxWidth?: CardWidth +} + +export default function PlayerCard({ + player, + team, + align = 'left', + maxWidth = 'sm', +}: Props) { + /* --- Hilfs‑Klassen ----------------------------------------------------- */ + + const widthClasses: Record = { + sm: 'max-w-sm', + md: 'max-w-md', + lg: 'max-w-lg', + xl: 'max-w-xl', + '2xl':'max-w-2xl', + full: 'w-full', + auto: '', // keine Begrenzung + } + + // Linksbündig = Karte nach links schieben, Rechtsbündig = nach rechts + const alignClasses = + align === 'right' + ? 'ml-auto' + : align === 'left' + ? 'mr-auto' + : 'mx-auto' + + // Für den Flex‑Container innen: + // * links: Avatar – Name (row) + // * rechts: Name – Avatar (row‑reverse) + const rowDir = align === 'right' ? 'flex-row-reverse text-right' : '' + + const avatarSrc = player.avatar || '/default-avatar.png' + + /* --- Rendering --------------------------------------------------------- */ + + return ( +
+
+
+ {player.name} + + {player.name} + +
+
+
+ ) +} diff --git a/src/app/components/Popover.tsx b/src/app/components/Popover.tsx new file mode 100644 index 0000000..dbff227 --- /dev/null +++ b/src/app/components/Popover.tsx @@ -0,0 +1,58 @@ +'use client' + +import React, { useState, useRef, useEffect } from 'react' + +interface PopoverProps { + text: string + children: React.ReactNode + size?: 'sm' | 'md' | 'lg' | 'xl' +} + +export default function Popover({ text, children, size = 'sm' }: PopoverProps) { + const [open, setOpen] = useState(false) + const buttonRef = useRef(null) + const popoverRef = useRef(null) + + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if ( + popoverRef.current && + !popoverRef.current.contains(event.target as Node) && + !buttonRef.current?.contains(event.target as Node) + ) { + setOpen(false) + } + } + document.addEventListener('mousedown', handleClickOutside) + return () => document.removeEventListener('mousedown', handleClickOutside) + }, []) + + const sizeClass = { + sm: 'max-w-xs', + md: 'max-w-sm', + lg: 'max-w-md', + xl: 'max-w-lg', + }[size] + + return ( +
+ + + {open && ( +
+ {children} +
+ )} +
+ ) +} diff --git a/src/app/components/PrelineScript.tsx b/src/app/components/PrelineScript.tsx new file mode 100644 index 0000000..7daf1bb --- /dev/null +++ b/src/app/components/PrelineScript.tsx @@ -0,0 +1,34 @@ +'use client'; + +import { usePathname } from 'next/navigation'; +import { useEffect } from 'react'; + +// Preline UI +async function loadPreline() { + return import('preline/dist/index.js'); +} + +export default function PrelineScript() { + const path = usePathname(); + + useEffect(() => { + const initPreline = async () => { + await loadPreline(); + }; + + initPreline(); + }, []); + + useEffect(() => { + setTimeout(() => { + if ( + window.HSStaticMethods && + typeof window.HSStaticMethods.autoInit === 'function' + ) { + window.HSStaticMethods.autoInit(); + } + }, 100); + }, [path]); + + return null; +} \ No newline at end of file diff --git a/src/app/components/PrelineScriptWrapper.tsx b/src/app/components/PrelineScriptWrapper.tsx new file mode 100644 index 0000000..764beeb --- /dev/null +++ b/src/app/components/PrelineScriptWrapper.tsx @@ -0,0 +1,11 @@ +'use client'; + +import dynamic from 'next/dynamic'; + +const PrelineScript = dynamic(() => import('./PrelineScript'), { + ssr: false, +}); + +export default function PrelineScriptWrapper() { + return ; +} \ No newline at end of file diff --git a/src/app/components/Profile.tsx b/src/app/components/Profile.tsx new file mode 100644 index 0000000..4b35177 --- /dev/null +++ b/src/app/components/Profile.tsx @@ -0,0 +1,383 @@ +'use client' + +export default function Profile() { + return ( + <> +
+
+ +
+ +
+
+ Hero Image + +
+ +
+
+ +
+

+ James Collins +

+

+ its_james +

+
+
+ +
+
+ +
+ + +
+
+ + + + ) +} diff --git a/src/app/components/Providers.tsx b/src/app/components/Providers.tsx new file mode 100644 index 0000000..b6b5791 --- /dev/null +++ b/src/app/components/Providers.tsx @@ -0,0 +1,13 @@ +// components/Providers.tsx +'use client' + +import { SessionProvider } from 'next-auth/react' + +export function Providers({ children }: { children: React.ReactNode }) { + return ( + + {children} + + ) + +} diff --git a/src/app/components/Select.tsx b/src/app/components/Select.tsx new file mode 100644 index 0000000..fef4d20 --- /dev/null +++ b/src/app/components/Select.tsx @@ -0,0 +1,93 @@ +import { useState, useRef, useEffect } from "react"; + +type Option = { + value: string; + label: string; +}; + +type SelectProps = { + options: Option[]; + placeholder?: string; + value: string; + onChange: (value: string) => void; + dropDirection?: "up" | "down" | "auto"; + className?: string; +}; + +export default function Select({ options, placeholder = "Select option...", value, onChange, dropDirection = "down", className }: SelectProps) { + const [open, setOpen] = useState(false); + const ref = useRef(null); + const [direction, setDirection] = useState<"up" | "down">("down"); + const buttonRef = useRef(null); + + useEffect(() => { + if (open && dropDirection === "auto" && buttonRef.current) { + requestAnimationFrame(() => { + const rect = buttonRef.current!.getBoundingClientRect(); + const dropdownHeight = 200; + const spaceBelow = window.innerHeight - rect.bottom; + const spaceAbove = rect.top; + + if (spaceBelow < dropdownHeight && spaceAbove > dropdownHeight) { + setDirection("up"); + } else { + setDirection("down"); + } + }); + } + }, [open, dropDirection]); + + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if (ref.current && !ref.current.contains(event.target as Node)) { + setOpen(false); + } + }; + document.addEventListener("mousedown", handleClickOutside); + return () => document.removeEventListener("mousedown", handleClickOutside); + }, []); + + const selectedOption = options.find(o => o.value === value); + + return ( +
+ + {open && ( +
    + {options.map((option) => ( +
  • { + onChange(option.value); + setOpen(false); + }} + className={`py-2 px-4 cursor-pointer hover:bg-gray-100 dark:hover:bg-neutral-800 dark:text-neutral-200 ${ + option.value === value ? "bg-gray-100 dark:bg-neutral-800 font-medium" : "" + }`} + > + {option.label} +
  • + ))} +
+ )} +
+ ); +} \ No newline at end of file diff --git a/src/app/components/Sidebar.tsx b/src/app/components/Sidebar.tsx new file mode 100644 index 0000000..67136fe --- /dev/null +++ b/src/app/components/Sidebar.tsx @@ -0,0 +1,209 @@ +'use client' + +import { useState } from "react" +import Link from "next/link" +import SidebarFooter from "./SidebarFooter" +import { usePathname } from 'next/navigation' +import Button from "./Button" + +export default function Sidebar({ children }: { children?: React.ReactNode }) { + const [isOpen, setIsOpen] = useState(false) + const pathname = usePathname() + const toggleSidebar = () => { + setIsOpen(prev => !prev) + } + + return ( + <> + + +
+ + +
+ {children} +
+
+ + ) +} \ No newline at end of file diff --git a/src/app/components/SidebarFooter.tsx b/src/app/components/SidebarFooter.tsx new file mode 100644 index 0000000..9d4aad2 --- /dev/null +++ b/src/app/components/SidebarFooter.tsx @@ -0,0 +1,172 @@ +'use client' + +import { signIn, signOut } from 'next-auth/react' +import { useSteamProfile } from '@/app/hooks/useSteamProfile' +import Link from 'next/link' +import { useEffect, useState } from 'react' +import { AnimatePresence, motion } from 'framer-motion' +import { usePathname } from 'next/navigation' +import Script from "next/script"; +import LoadingSpinner from '@/app/components/LoadingSpinner' +import Image from 'next/image' + +export default function SidebarFooter() { + const { session, steamProfile, status } = useSteamProfile() + const [isOpen, setIsOpen] = useState(false) + const pathname = usePathname() + const [teamName, setTeamName] = useState(null) + + useEffect(() => { + const loadTeamName = async () => { + const teamId = session?.user?.team + if (!teamId) { + setTeamName(null) + return + } + try { + const res = await fetch(`/api/team/${teamId}`) + const data = await res.json() + setTeamName(data?.teamname ?? null) + } catch (err) { + console.error('[SidebarFooter] Team‑Name konnte nicht geladen werden:', err) + setTeamName(null) + } + } + + loadTeamName() + }, [session?.user?.team]) + + if (status === 'loading') return + + if (status === 'unauthenticated') { + return ( + <> + + + ) + } + + const user = session!.user + + const subline = + teamName // 1. Teamname, wenn vorhanden + ?? steamProfile?.steamId // 2. Steam‑ID (wenn bereits vom Hook gemappt) + ?? user.id // 3. Fallback auf JWT‑id + + return ( + <> +
+ {/* Button */} + + + {/* Menü */} + + {isOpen && ( + +
+ + + + + Mein Profil + + + + + + + Einstellungen + + {user?.isAdmin && ( + + + + + Administration + + )} + signOut({ callbackUrl: '/' })} + className={`flex items-center gap-x-3.5 py-2 px-2.5 text-sm rounded-lg transition-colors text-gray-800 hover:bg-red-100 dark:text-neutral-300 dark:hover:bg-red-700`} > + + + + + + Abmelden + +
+
+ )} +
+
+ + ) +} diff --git a/src/app/components/SortableMiniCard.tsx b/src/app/components/SortableMiniCard.tsx new file mode 100644 index 0000000..1b538ad --- /dev/null +++ b/src/app/components/SortableMiniCard.tsx @@ -0,0 +1,71 @@ +'use client' + +import { useSortable, defaultAnimateLayoutChanges } from '@dnd-kit/sortable' +import { CSS } from '@dnd-kit/utilities' +import MiniCard from './MiniCard' +import { Player } from '../types/team' + +type Props = { + player: Player + currentUserSteamId: string + teamLeaderSteamId: string + onKick?: (player: Player) => void + onPromote?: (steamId: string) => void + hideOverlay?: boolean + isDraggingGlobal?: boolean + matchParentBg?: boolean +} + + +export default function SortableMiniCard({ + player, + onKick, + onPromote, + currentUserSteamId, + teamLeaderSteamId, + hideOverlay = false +}: Props) { + const { + attributes, + listeners, + setNodeRef, + transform, + transition, + } = useSortable({ + id: player.steamId, + animateLayoutChanges: defaultAnimateLayoutChanges, + }) + + const style = { + transform: CSS.Transform.toString(transform), + transition, + } + + const isDraggable = currentUserSteamId === teamLeaderSteamId + + return ( +
+ onKick?.(player)} + onPromote={onPromote} + currentUserSteamId={currentUserSteamId} + teamLeaderSteamId={teamLeaderSteamId} + dragListeners={isDraggable ? listeners : undefined} + hoverEffect={isDraggable} + hideOverlay={hideOverlay} + /> +
+ ) +} + diff --git a/src/app/components/Switch.tsx b/src/app/components/Switch.tsx new file mode 100644 index 0000000..f1a148d --- /dev/null +++ b/src/app/components/Switch.tsx @@ -0,0 +1,50 @@ +// components/Switch.tsx +'use client' + +import React from 'react' + +type SwitchProps = { + id: string + checked: boolean + onChange: (checked: boolean) => void + labelLeft?: string + labelRight?: string + className?: string +} + +export default function Switch({ + id, + checked, + onChange, + labelLeft, + labelRight, + className = '', +}: SwitchProps) { + return ( +
+ {labelLeft && ( + + )} + + + + {labelRight && ( + + )} +
+ ) +} diff --git a/src/app/components/Tab.tsx b/src/app/components/Tab.tsx new file mode 100644 index 0000000..1003b41 --- /dev/null +++ b/src/app/components/Tab.tsx @@ -0,0 +1,16 @@ +'use client' + +import Link from 'next/link' + +type TabProps = { + name: string + href: string +} + +export default function Tab({ name, href }: TabProps) { + return ( + + {name} + + ) +} diff --git a/src/app/components/Table.tsx b/src/app/components/Table.tsx new file mode 100644 index 0000000..a42b375 --- /dev/null +++ b/src/app/components/Table.tsx @@ -0,0 +1,70 @@ +// components/ui/Table.tsx +'use client' + +import React, { ReactNode } from 'react' + +type TableProps = { + children: ReactNode +} + +function TableWrapper({ children }: TableProps) { + return ( +
+
+
+
+ + {children} +
+
+
+
+
+ ) +} + +function Head({ children }: { children: ReactNode }) { + return {children} +} + +function Body({ children }: { children: ReactNode }) { + return {children} +} + +function Row({ + children, + hoverable = false, + }: { + children: ReactNode + hoverable?: boolean + }) { + const className = hoverable ? 'hover:bg-gray-100 dark:hover:bg-neutral-700' : '' + return {children} + } + + +function Cell({ + children, + as: Component = 'td', + className = '', +}: { + children?: ReactNode + as?: 'td' | 'th' + className?: string +}) { + const baseClass = + Component === 'th' + ? 'px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase dark:text-neutral-400' + : 'px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-neutral-200' + return {children} +} + +// 📦 Zusammensetzen: +const Table = Object.assign(TableWrapper, { + Head, + Body, + Row, + Cell, +}) + +export default Table diff --git a/src/app/components/Tabs.tsx b/src/app/components/Tabs.tsx new file mode 100644 index 0000000..c2185a5 --- /dev/null +++ b/src/app/components/Tabs.tsx @@ -0,0 +1,46 @@ +'use client' + +import { usePathname } from 'next/navigation' +import Link from 'next/link' +import type { ReactNode, ReactElement } from 'react' + +type TabProps = { + name: string + href: string +} + +export function Tabs({ children }: { children: ReactNode }) { + const pathname = usePathname() + const tabs = Array.isArray(children) ? children : [children] + + return ( + + ) +} diff --git a/src/app/components/TeamCard.tsx b/src/app/components/TeamCard.tsx new file mode 100644 index 0000000..7d19e5d --- /dev/null +++ b/src/app/components/TeamCard.tsx @@ -0,0 +1,103 @@ +// components/TeamCard.tsx +'use client' + +import { useEffect, useState } from 'react' +import Button from './Button' +import { useWebSocketListener } from '@/app/hooks/useWebSocketListener' +import { Team, Player } from '../types/team' +import { useLiveTeam } from '../hooks/useLiveTeam' + +type Props = { + team: Team + currentUserSteamId: string + invitationId?: string + onUpdateInvitation: (teamId: string, newValue: string | null) => void +} + +export default function TeamCard({ team, currentUserSteamId, invitationId, onUpdateInvitation }: Props) { + const [joining, setJoining] = useState(false) + const data = useLiveTeam(team) + + if (!data || !data.players) { + return

Lade Team …

+ } + + + const handleClick = async () => { + if (joining) return + setJoining(true) + + try { + if (invitationId) { + await fetch('/api/user/invitations/reject', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ invitationId }), + }) + onUpdateInvitation(data.id, null) + } else { + const res = await fetch('/api/team/request-join', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ teamId: data.id }), + }) + if (!res.ok) throw new Error() + onUpdateInvitation(data.id, 'dummy-id') // ← bei Bedarf mit realer ID aktualisieren + } + } catch (err) { + console.error('Fehler bei Join/Reject:', err) + } finally { + setJoining(false) + } + } + + const isRequested = !!invitationId + const isDisabled = joining || currentUserSteamId === data.leader + + return ( +
+
+
+ {data.teamname + + {data.teamname ?? 'Team'} + +
+ + +
+ +
+ {data.players.slice(0, 5).map((p) => ( + {p.name} + ))} + {data.players.length > 5 && ( + + +{data.players.length - 5} + + )} +
+
+ ) +} diff --git a/src/app/components/TeamCardComponent.tsx b/src/app/components/TeamCardComponent.tsx new file mode 100644 index 0000000..dcb2b59 --- /dev/null +++ b/src/app/components/TeamCardComponent.tsx @@ -0,0 +1,92 @@ +'use client' + +import { forwardRef, useState } from 'react' +import { useSession } from 'next-auth/react' + +import { useTeamManager } from '../hooks/useTeamManager' +import TeamInvitationView from './TeamInvitationView' +import TeamMemberView from './TeamMemberView' +import NoTeamView from './NoTeamView' +import LoadingSpinner from '@/app/components/LoadingSpinner' +import CreateTeamButton from './CreateTeamButton' + +type Props = { + refetchKey?: string +} + +/* eslint‑disable react/display‑name */ +function TeamCardComponent(props: Props, ref: any) { + const { data: session } = useSession() + const steamId = session?.user?.steamId ?? '' + + const [refetchKey, setRefetchKey] = useState() + + const teamManager = useTeamManager({ ...props, refetchKey }, ref) + + // 1. Loading + if (teamManager.isLoading) return + + // 2. Pending invitation + if ( + !teamManager.team && + teamManager.pendingInvitation && + teamManager.pendingInvitation.type === 'team-invite' + ) { + const notificationId = teamManager.pendingInvitation.id + + return ( + { + if (action === 'accept') { + await teamManager.acceptInvitation(invitationId) + } else { + await teamManager.rejectInvitation(invitationId) + } + await teamManager.markOneAsRead(notificationId) + }} + /> + ) + } + + // 3. Kein Team → Hinweis + CreateTeamButton + if (!teamManager.team) { + return ( +
+ +
+ +
+
+ ) + } + + // 4. Team vorhanden → Member view + return ( +
+
+

+ Teameinstellungen +

+

+ Verwalte dein Team und lade Mitglieder ein +

+
+ +
+ + +
+ +
+ +
+ ) +} + +export default forwardRef(TeamCardComponent) diff --git a/src/app/components/TeamComboBox.tsx b/src/app/components/TeamComboBox.tsx new file mode 100644 index 0000000..a0773ba --- /dev/null +++ b/src/app/components/TeamComboBox.tsx @@ -0,0 +1,66 @@ +'use client' + +import { useEffect, useState } from 'react' +import ComboBox from './ComboBox' + +export default function TeamComboBox() { + const [teams, setTeams] = useState<{ id: string; teamname: string }[]>([]) + const [selectedTeam, setSelectedTeam] = useState('') + + useEffect(() => { + const fetchTeams = async () => { + try { + const res = await fetch('/api/team/list') + const data = await res.json() + setTeams(data.teams || []) + if (data.teams?.[0]) setSelectedTeam(data.teams[0].teamname) + } catch (err) { + console.error('Fehler beim Laden der Teams:', err) + } + } + + fetchTeams() + }, []) + + return ( +
+ + {teams.map((team) => ( +
setSelectedTeam(team.teamname)} + > +
+ + {team.teamname} + + {selectedTeam === team.teamname && ( + + + + + + )} +
+
+ ))} +
+
+ ) +} diff --git a/src/app/components/TeamInvitationView.tsx b/src/app/components/TeamInvitationView.tsx new file mode 100644 index 0000000..303b092 --- /dev/null +++ b/src/app/components/TeamInvitationView.tsx @@ -0,0 +1,60 @@ +'use client' + +import { useState } from 'react' +import Button from './Button' +import { Invitation } from '../hooks/useTeamManager' + +type Props = { + invitation: Invitation + notificationId: string + onAction: (action: 'accept' | 'reject', invitationId: string) => Promise + onMarkAsRead: (id: string) => Promise +} + +export default function TeamInvitationView({ + invitation, + notificationId, + onAction, + onMarkAsRead, +}: Props) { + const [isSubmitting, setIsSubmitting] = useState(false) + + if (!invitation) return null + + const handleRespond = async (action: 'accept' | 'reject') => { + try { + setIsSubmitting(true) + await onAction(action, invitation.id) + await onMarkAsRead(notificationId) + } catch (err) { + console.error(`Fehler beim ${action === 'accept' ? 'Annehmen' : 'Ablehnen'} der Einladung:`, err) + } finally { + setIsSubmitting(false) + } + } + + return ( +
+

+ Du wurdest eingeladen! +

+

{invitation.teamName}

+
+ + +
+
+ ) +} diff --git a/src/app/components/TeamMemberView.tsx b/src/app/components/TeamMemberView.tsx new file mode 100644 index 0000000..369b24f --- /dev/null +++ b/src/app/components/TeamMemberView.tsx @@ -0,0 +1,506 @@ +'use client' + +import { useEffect, useState } from 'react' +import { DndContext, closestCenter, DragOverlay } from '@dnd-kit/core' +import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable' +import { DroppableZone } from './DroppableZone' +import MiniCardDummy from './MiniCardDummy' +import SortableMiniCard from './SortableMiniCard' +import LeaveTeamModal from './LeaveTeamModal' +import InvitePlayersModal from './InvitePlayersModal' +import Modal from './Modal' +import { Player, Team } from '../types/team' +import { useSession } from 'next-auth/react' +import { useWS } from '@/app/lib/wsStore' +import { AnimatePresence, motion } from 'framer-motion' +import { useTeamManager } from '../hooks/useTeamManager' +import Button from './Button' +import Image from 'next/image' + +type Props = { + team: Team | null + activePlayers: Player[] + inactivePlayers: Player[] + activeDragItem: Player | null + isDragging: boolean + showLeaveModal: boolean + showInviteModal: boolean + currentUserSteamId: string + setShowLeaveModal: (v: boolean) => void + setShowInviteModal: (v: boolean) => void + setActiveDragItem: (item: Player | null) => void + setIsDragging: (v: boolean) => void + setactivePlayers: (players: Player[]) => void + setInactivePlayers: (players: Player[]) => void +} + +export default function TeamMemberView({ + team, + activePlayers, + inactivePlayers, + activeDragItem, + isDragging, + showLeaveModal, + showInviteModal, + setShowLeaveModal, + setShowInviteModal, + setActiveDragItem, + setIsDragging, + setactivePlayers, + setInactivePlayers, +}: Props) { + const { data: session } = useSession() + const { socket } = useWS() + const [kickCandidate, setKickCandidate] = useState(null) + const [promoteCandidate, setPromoteCandidate] = useState(null) + + const currentUserSteamId = session?.user?.steamId || '' + const isLeader = currentUserSteamId === team?.leader + const { leaveTeam, reloadTeam, renameTeam, deleteTeam } = useTeamManager({}, null) + const [showRenameModal, setShowRenameModal] = useState(false) + const [showDeleteModal, setShowDeleteModal] = useState(false) + const [isEditingName, setIsEditingName] = useState(false) + const [editedName, setEditedName] = useState(team?.teamname || '') + const [isEditingLogo, setIsEditingLogo] = useState(false) + const [logoPreview, setLogoPreview] = useState(null) + const [logoFile, setLogoFile] = useState(null) + + useEffect(() => { + if (!socket || !team?.id) return + + const handleMessage = (event: MessageEvent) => { + const data = JSON.parse(event.data) + + const relevantTypes = [ + 'team-updated', + 'team-kick', + 'team-kick-other', + 'team-member-joined', + 'team-member-left', + 'team-leader-changed', + 'team-renamed', + 'team-logo-updated', + ] + + if (relevantTypes.includes(data.type) && typeof data.teamId === 'string') { + fetch(`/api/team/${encodeURIComponent(data.teamId)}`) + .then((res) => res.json()) + .then((data) => { + setactivePlayers( + (data.activePlayers ?? []) + .filter((p: Player) => p?.name) + .sort((a: Player, b: Player) => a.name.localeCompare(b.name)) + ); + + setInactivePlayers( + (data.inactivePlayers ?? []) + .filter((p: Player) => p?.name) + .sort((a: Player, b: Player) => a.name.localeCompare(b.name)) + ); + }) + } + } + + socket.addEventListener('message', handleMessage) + return () => socket.removeEventListener('message', handleMessage) +}, [socket, team?.id]) + + + const handleDragStart = (event: any) => { + const id = event.active.id + const item = activePlayers.find(p => p.steamId === id) || inactivePlayers.find(p => p.steamId === id) + if (item) { + setActiveDragItem(item) + setIsDragging(true) + } + } + + const updateTeamMembers = async (teamId: string, active: Player[], inactive: Player[]) => { + try { + await fetch('/api/team/update-players', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + teamId, + activePlayers: active.map(p => p.steamId), + inactivePlayers: inactive.map(p => p.steamId), + }), + }) + } catch (err) { + console.error('Fehler beim Aktualisieren:', err) + } + } + + const handleDragEnd = async (event: any) => { + setActiveDragItem(null) + setIsDragging(false) + + const { active, over } = event + if (!over) return + + const activeId = active.id + const overId = over.id + if (!activeId || !overId) return + + const movingItem = [...activePlayers, ...inactivePlayers].find(p => p.steamId === activeId) + if (!movingItem) return + + const isInActiveZone = activePlayers.some(p => p.steamId === activeId) + const isInInactiveZone = inactivePlayers.some(p => p.steamId === activeId) + + const targetIsActiveZone = overId === 'active' || activePlayers.some(p => p.steamId === overId) + const targetIsInactiveZone = overId === 'inactive' || inactivePlayers.some(p => p.steamId === overId) + + if ((isInActiveZone && targetIsActiveZone) || (isInInactiveZone && targetIsInactiveZone)) return + + let newActive = [...activePlayers] + let newInactive = [...inactivePlayers] + + if (targetIsActiveZone) { + if (newActive.length >= 5) return + newInactive = newInactive.filter(p => p.steamId !== activeId) + if (!newActive.some(p => p.steamId === activeId)) newActive.push(movingItem) + } else { + newActive = newActive.filter(p => p.steamId !== activeId) + if (!newInactive.some(p => p.steamId === activeId)) newInactive.push(movingItem) + } + + newActive.sort((a, b) => a.name.localeCompare(b.name)) + newInactive.sort((a, b) => a.name.localeCompare(b.name)) + + setactivePlayers(newActive) + setInactivePlayers(newInactive) + await updateTeamMembers(team!.id, newActive, newInactive) + } + + const confirmKick = async () => { + if (!kickCandidate) return + + const newActive = activePlayers.filter(p => p.steamId !== kickCandidate.steamId) + const newInactive = inactivePlayers.filter(p => p.steamId !== kickCandidate.steamId) + + setactivePlayers(newActive) + setInactivePlayers(newInactive) + + await fetch('/api/team/kick', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ steamId: kickCandidate.steamId, teamId: team!.id }), + }) + + await updateTeamMembers(team!.id, newActive, newInactive) + setKickCandidate(null) + } + + const promoteToLeader = async (newLeaderId: string) => { + try { + const res = await fetch('/api/team/transfer-leader', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ teamId: team!.id, newLeaderSteamId: newLeaderId }), + }) + + if (!res.ok) { + const data = await res.json() + console.error('Fehler bei Leader-Übertragung:', data.message) + return + } + + await reloadTeam() + } catch (err) { + console.error('Fehler bei Leader-Übertragung:', err) + } + } + + if (!team || !currentUserSteamId) return null + + const renderMemberList = (players: Player[]) => ( + + {players.map(player => ( + + setPromoteCandidate(player)} + currentUserSteamId={currentUserSteamId} + teamLeaderSteamId={team.leader} + isDraggingGlobal={isDragging} + hideOverlay={isDragging} + matchParentBg={true} + /> + + ))} + + ) + + + return ( +
+
+
+ {/* Teamlogo mit Fallback */} +
+
isLeader && document.getElementById('logoUpload')?.click()} + > + Teamlogo + + {/* Overlay beim Hover */} + {isLeader && ( +
+ + + +
+ )} +
+ + {/* Hidden file input */} + {isLeader && ( + { + const file = e.target.files?.[0] + if (!file) return + + const formData = new FormData() + formData.append('logo', file) + formData.append('teamId', team.id) + + const res = await fetch('/api/team/upload-logo', { + method: 'POST', + body: formData, + }) + + if (res.ok) { + await reloadTeam() + } else { + alert('Fehler beim Hochladen des Logos.') + } + }} + /> + )} +
+ + {/* Teamname + Bearbeiten */} +
+ {isEditingName ? ( + <> + setEditedName(e.target.value)} + className="py-1.5 px-3 border rounded-lg text-sm dark:bg-neutral-800 dark:border-neutral-700 dark:text-white" + /> + + {/* ✔ Übernehmen */} + + + {/* ✖ Abbrechen */} + + + ) : ( + <> +

+ {team.teamname ?? 'Team'} +

+ {isLeader && ( + + )} + + )} +
+
+ + {/* Aktionen */} +
+ {isLeader && ( + + )} + +
+
+ + +
+ + p.steamId)} strategy={verticalListSortingStrategy}> + {renderMemberList(activePlayers)} + + + + + p.steamId)} strategy={verticalListSortingStrategy}> + {renderMemberList(inactivePlayers)} + {isLeader && ( + + { + setShowInviteModal(false) + setTimeout(() => setShowInviteModal(true), 0) + }} + > +
+ + + +
+
+
+ )} +
+
+
+ + + {activeDragItem && ( + + )} + +
+ + {isLeader && ( + <> + setShowLeaveModal(false)} onSuccess={() => setShowLeaveModal(false)} team={team} /> + setShowInviteModal(false)} onSuccess={() => {}} team={team} /> + + )} + + {isLeader && promoteCandidate && ( + setPromoteCandidate(null)} + onSave={async () => { + await promoteToLeader(promoteCandidate.steamId) + setPromoteCandidate(null) + }} + closeButtonTitle="Übertragen" + closeButtonColor="blue" + > +

+ Möchtest du {promoteCandidate.name} wirklich zum Teamleader machen? +

+
+ )} + + {isLeader && kickCandidate && ( + setKickCandidate(null)} + onSave={confirmKick} + closeButtonTitle="Entfernen" + closeButtonColor="red" + > +

+ Möchtest du {kickCandidate.name} wirklich aus dem Team entfernen? +

+
+ )} + + {isLeader && ( + setShowDeleteModal(false)} + onSave={async () => { + await fetch('/api/team/delete', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ teamId: team.id }), + }) + setShowDeleteModal(false) + window.location.href = '/' + }} + closeButtonTitle="Löschen" + closeButtonColor="red" + > +

+ Bist du sicher, dass du dieses Team löschen möchtest? Diese Aktion kann nicht rückgängig gemacht werden. +

+
+ )} +
+ ) +} diff --git a/src/app/components/TeamSelector.tsx b/src/app/components/TeamSelector.tsx new file mode 100644 index 0000000..51b85ee --- /dev/null +++ b/src/app/components/TeamSelector.tsx @@ -0,0 +1,31 @@ +'use client' + +import { useEffect, useState } from 'react' +import ComboBox from '@/app/components/ComboBox' + +export default function TeamSelector() { + const [teams, setTeams] = useState([]) + const [selectedTeam, setSelectedTeam] = useState('') + + useEffect(() => { + const fetchTeams = async () => { + try { + const res = await fetch('/api/team/list') + const data = await res.json() + setTeams(data.teams ?? []) // Fallback zu leerem Array + } catch (err) { + console.error('Fehler beim Laden der Teams:', err) + } + } + + fetchTeams() + }, []) + + return ( + + ) +} diff --git a/src/app/components/Tooltip.tsx b/src/app/components/Tooltip.tsx new file mode 100644 index 0000000..92ae39c --- /dev/null +++ b/src/app/components/Tooltip.tsx @@ -0,0 +1,27 @@ +'use client' + +import { ReactNode } from 'react' + +export type TooltipProps = { + content: string + children: ReactNode + placement?: 'top' | 'bottom' | 'left' | 'right' +} + +export default function Tooltip({ content, children, placement = 'top' }: TooltipProps) { + const placementClass = placement === 'top' ? '' : `[--placement:${placement}]` + + return ( +
+ +
+ ) +} diff --git a/src/app/components/WebSocketManager.tsx b/src/app/components/WebSocketManager.tsx new file mode 100644 index 0000000..dd78a4b --- /dev/null +++ b/src/app/components/WebSocketManager.tsx @@ -0,0 +1,83 @@ +'use client' + +import { useSession } from 'next-auth/react' +import { useEffect } from 'react' +import { useWS } from '@/app/lib/wsStore' + +export default function WebSocketManager() { + const { data: session } = useSession() + const connectWS = useWS((s) => s.connect) + const disconnectWS = useWS((s) => s.disconnect) + + useEffect(() => { + if (!session?.user?.steamId) return + + connectWS(session.user.steamId) + + const socket = useWS.getState().socket + if (!socket) return + + socket.onmessage = (event) => { + try { + const data = JSON.parse(event.data) + + // Typbasierter Event-Dispatch + switch (data.type) { + case 'invitation': + window.dispatchEvent(new CustomEvent('ws-invitation')) + break + case 'team-update': + window.dispatchEvent(new CustomEvent('ws-team-update')) + break + case 'team-kick': + window.dispatchEvent(new CustomEvent('ws-team-kick')) + break + case 'team-kick-other': + window.dispatchEvent(new CustomEvent('ws-team-kick-other')) + break + case 'team-joined': + window.dispatchEvent(new CustomEvent('ws-team-joined')) + break + case 'team-member-joined': + window.dispatchEvent(new CustomEvent('ws-team-member-joined')) + break + case 'team-invite': + window.dispatchEvent(new CustomEvent('ws-team-invite')) + break + case 'team-invite-reject': + window.dispatchEvent(new CustomEvent('ws-team-invite-reject')) + break + case 'team-left': + window.dispatchEvent(new CustomEvent('ws-team-left')) + break + case 'team-member-left': + window.dispatchEvent(new CustomEvent('ws-team-member-left')) + break + case 'team-leader-changed': + window.dispatchEvent(new CustomEvent('ws-team-leader-changed')) + break + case 'team-join-request': + window.dispatchEvent(new CustomEvent('ws-team-join-request')) + break + case 'team-renamed': + console.log('[WS] team-renamed', data.teamId) + window.dispatchEvent(new CustomEvent('ws-team-renamed', { + detail: { teamId: data.teamId } + })) + break + case 'team-logo-updated': + window.dispatchEvent(new CustomEvent('ws-team-logo-updated', { detail: { teamId: data.teamId } })) + break + + // Weitere Events hier hinzufügen ... + } + } catch (error) { + console.error('[WebSocket] Ungültige Nachricht:', event.data) + } + } + + return () => disconnectWS() + }, [session?.user?.steamId]) + + return null +} diff --git a/src/app/components/settings/AccountSettings.tsx b/src/app/components/settings/AccountSettings.tsx new file mode 100644 index 0000000..d4ab261 --- /dev/null +++ b/src/app/components/settings/AccountSettings.tsx @@ -0,0 +1,54 @@ +'use client' + +import DeleteAccountSettings from "./account/DeleteAccountSettings" +import AppearanceSettings from "./account/AppearanceSettings" +import AuthCodeSettings from "./account/AuthCodeSettings" +import LatestKnownCodeSettings from "./account/LatestKnownCodeSettings" + +export default function AccountSettings() { + return ( + <>{/* Account Card */} +
+ {/* Title */} +
+

+ Accounteinstellungen +

+

+ Passe das Erscheinungsbild der Webseite an +

+
+ {/* End Title */} + + {/* Form */} +
+ + {/* Auth Code Settings */} + + {/* End Auth Code Settings */} + + {/* Appearance */} + + {/* End Appearance */} + + {/* Appearance */} + + {/* End Appearance */} + + {/* Button Group */} +
+ + +
+ {/* End Button Group */} + + {/* End Form */} +
+ {/* End Account Card */} + + ) +} diff --git a/src/app/components/settings/account/AppearanceSettings.tsx b/src/app/components/settings/account/AppearanceSettings.tsx new file mode 100644 index 0000000..c72d9d7 --- /dev/null +++ b/src/app/components/settings/account/AppearanceSettings.tsx @@ -0,0 +1,84 @@ +'use client' + +import { useTheme } from 'next-themes' +import { useEffect, useState } from 'react' + +export default function AppearanceSettings() { + const { theme, setTheme } = useTheme() + const [mounted, setMounted] = useState(false) + + useEffect(() => { + setMounted(true) + }, []) + + if (!mounted) return null + + const options = [ + { id: 'system', label: 'System', img: 'account-system-image.svg' }, + { id: 'light', label: 'Hell', img: 'account-light-image.svg' }, + { id: 'dark', label: 'Dunkel', img: 'account-dark-image.svg' }, + ] + + return ( +
+
+
+ +
+ +
+

+ Wähle dein bevorzugtes Design. Du kannst einen festen Stil verwenden oder das Systemverhalten übernehmen. +

+ +

+ Theme-Modus +

+ +

+ Die Darstellung passt sich automatisch deinem Gerät an, wenn „System“ gewählt ist. +

+ +
+
+ {options.map(({ id, label, img }) => { + const isChecked = theme === id + + return ( + + ) + })} +
+
+
+
+
+ ) +} diff --git a/src/app/components/settings/account/AuthCodeSettings.tsx b/src/app/components/settings/account/AuthCodeSettings.tsx new file mode 100644 index 0000000..ddc71a2 --- /dev/null +++ b/src/app/components/settings/account/AuthCodeSettings.tsx @@ -0,0 +1,172 @@ +'use client' + +import { useEffect, useState } from 'react' +import { useSession } from 'next-auth/react' +import Link from 'next/link' +import Popover from '../../Popover' +import LatestKnownCodeSettings from './LatestKnownCodeSettings' + +export default function AuthCodeSettings() { + const { data: session } = useSession() + const [userId, setUserId] = useState(null) + + const [authCode, setAuthCode] = useState('') + const [authCodeValid, setAuthCodeValid] = useState(false) + + const [lastKnownShareCode, setLastKnownShareCode] = useState('') + const [lastKnownShareCodeValid, setLastKnownShareCodeValid] = useState(false) + + const [touched, setTouched] = useState(false) + const [isLoading, setIsLoading] = useState(true) + + const formatAuthCode = (value: string) => { + const raw = value.replace(/[^A-Za-z0-9]/g, '').toUpperCase() + const part1 = raw.slice(0, 4) + const part2 = raw.slice(4, 9) + const part3 = raw.slice(9, 13) + return [part1, part2, part3].filter(Boolean).join('-') + } + + const validateAuthCode = (value: string) => + /^[A-Z0-9]{4}-[A-Z0-9]{5}-[A-Z0-9]{4}$/.test(value) + + const validateShareCode = (value: string) => + /^CSGO(-[a-zA-Z0-9]{5}){5}$/.test(value) + + const saveCodes = async (updatedAuthCode = authCode, updatedKnownCode = lastKnownShareCode) => { + if (!validateAuthCode(updatedAuthCode) || !validateShareCode(updatedKnownCode)) return + + try { + await fetch('/api/cs2/sharecode', { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + authCode: updatedAuthCode, + lastKnownShareCode: updatedKnownCode, + }), + }) + } catch (err) { + console.error('Fehler beim Speichern der Codes:', err) + } + } + + const handleAuthCodeChange = async (e: React.ChangeEvent) => { + const formatted = formatAuthCode(e.target.value) + setAuthCode(formatted) + setTouched(true) + + const valid = validateAuthCode(formatted) + setAuthCodeValid(valid) + + if (valid && validateShareCode(lastKnownShareCode)) { + await saveCodes(formatted, lastKnownShareCode) + } + } + + useEffect(() => { + if (session?.user?.id) setUserId(session.user.id) + }, [session]) + + useEffect(() => { + const fetchCodes = async () => { + try { + const res = await fetch('/api/cs2/sharecode') + const data = await res.json() + + if (data?.authCode) { + setAuthCode(data.authCode) + setAuthCodeValid(validateAuthCode(data.authCode)) + } + + if (data?.lastKnownShareCode) { + setLastKnownShareCode(data.lastKnownShareCode) + setLastKnownShareCodeValid(validateShareCode(data.lastKnownShareCode)) + } + + setIsLoading(false) + } catch (err) { + console.error('Fehler beim Laden der Codes:', err) + } + } + + fetchCodes() + }, []) + + return ( +
+
+
+ +
+ +
+ Websites und Anwendungen von Drittanbietern haben mit diesem Authentifizierungscode Zugriff auf deinen Spielverlauf und können dein Gameplay analysieren. +

+ Deinen Code findest du  + + hier + . +

+
+
+
+
+ +
+
+
+ setTouched(true)} + className={`border py-2.5 sm:py-3 px-4 block w-full rounded-lg sm:text-sm + dark:bg-neutral-800 dark:text-neutral-200 dark:border-neutral-700 + ${touched ? (authCodeValid ? 'border-teal-500 focus:border-teal-500 focus:ring-teal-500' : 'border-red-500 focus:border-red-500 focus:ring-red-500') : 'border-gray-200'} + `} + placeholder="XXXX-XXXXX-XXXX" + required + /> + + {touched && authCodeValid && ( +
+ + + +
+ )} +
+
+ + {touched && ( +

+ {authCodeValid ? '✓ Gespeichert!' : 'Ungültiger Authentifizierungscode'} +

+ )} +
+
+ + {!isLoading && (!lastKnownShareCodeValid || !authCodeValid) && ( + { + setLastKnownShareCode(val) + const valid = validateShareCode(val) + setLastKnownShareCodeValid(valid) + if (valid && authCodeValid) { + saveCodes(authCode, val) + } + }} + /> + )} +
+ ) +} diff --git a/src/app/components/settings/account/DeleteAccountSettings.tsx b/src/app/components/settings/account/DeleteAccountSettings.tsx new file mode 100644 index 0000000..99b538d --- /dev/null +++ b/src/app/components/settings/account/DeleteAccountSettings.tsx @@ -0,0 +1,24 @@ +// components/settings/DeleteAccountSettings.tsx +'use client' + +import Link from "next/link" + +export default function DeleteAccountSettings() { + return ( +
+
+
+ +
+ +
+

+ Wenn du deinen Account löschen willst, klicke hier. +

+
+
+
+ ) +} diff --git a/src/app/components/settings/account/LatestKnownCodeSettings.tsx b/src/app/components/settings/account/LatestKnownCodeSettings.tsx new file mode 100644 index 0000000..19dea34 --- /dev/null +++ b/src/app/components/settings/account/LatestKnownCodeSettings.tsx @@ -0,0 +1,87 @@ +'use client' + +import Link from 'next/link' +import Popover from '../../Popover' + +interface Props { + lastKnownShareCode: string + setLastKnownShareCode: (value: string) => void +} + +export default function LatestKnownCodeSettings({ lastKnownShareCode, setLastKnownShareCode }: Props) { + const formatLastKnownShareCode = (value: string) => { + const raw = value.replace(/[^a-zA-Z0-9]/g, '') + const part0 = raw.slice(0, 4) + const part1 = raw.slice(4, 9) + const part2 = raw.slice(9, 14) + const part3 = raw.slice(14, 19) + const part4 = raw.slice(19, 24) + const part5 = raw.slice(24, 29) + return [part0, part1, part2, part3, part4, part5].filter(Boolean).join('-') + } + + const validate = (value: string) => + /^CSGO(-[a-zA-Z0-9]{5}){5}$/.test(value) + + const handleChange = (e: React.ChangeEvent) => { + const formatted = formatLastKnownShareCode(e.target.value) + setLastKnownShareCode(formatted) + } + + const isValid = validate(lastKnownShareCode) + + return ( +
+
+ +
+ +
+ Mit dem Austauschcode können Anwendungen dein letztes offizielles Match finden und analysieren. +

+ Du findest deinen Code  + + hier + . +

+
+
+
+
+ +
+
+ + {isValid && ( +
+ + + +
+ )} + {!isValid && ( +

Ungültiger Austauschcode

+ )} +
+
+
+ ) +} diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx new file mode 100644 index 0000000..5dd220a --- /dev/null +++ b/src/app/dashboard/page.tsx @@ -0,0 +1,76 @@ +'use client' + +import { useEffect, useState } from 'react' +import { useSession } from 'next-auth/react' +import Modal from '@/app/components/Modal' +import Link from 'next/link' +import Button from '../components/Button' +import ComboBox from '../components/ComboBox' + +export default function Dashboard() { + const { data: session, status } = useSession() + const [showTeamModal, setShowTeamModal] = useState(false) + const [teams, setTeams] = useState([]) + const [selectedTeam, setSelectedTeam] = useState('') + + useEffect(() => { + if (status === 'authenticated' && !session?.user?.team) { + setShowTeamModal(true) + } + }, [session, status]) + + useEffect(() => { + if (showTeamModal) { + const open = setTimeout(() => { + const modalEl = document.getElementById('hs-vertically-centered-modal') + if (modalEl && typeof window.HSOverlay?.open === 'function') { + try { + window.HSOverlay.open(modalEl) + } catch (err) { + console.error('Fehler beim Öffnen des Modals:', err) + } + } + }, 300) + + return () => clearTimeout(open) + } + }, [showTeamModal]) + + useEffect(() => { + const fetchTeams = async () => { + try { + const res = await fetch('/api/team/list') + const data = await res.json() + setTeams(data.teams.map((t: { teamname: string }) => t.teamname)) + } catch (error) { + console.error('Fehler beim Laden der Teams:', error) + } + } + fetchTeams() + }, []) + + return ( + <> + {showTeamModal && ( + +

+ Du bist aktuell keinem Team beigetreten. Bitte tritt einem Team bei oder erstelle eines. +

+ + + +
+ )} + +

+ Willkommen im Dashboard! +

+ + ) +} \ No newline at end of file diff --git a/src/app/favicon.ico b/src/app/favicon.ico new file mode 100644 index 0000000..718d6fe Binary files /dev/null and b/src/app/favicon.ico differ diff --git a/src/app/globals.css b/src/app/globals.css new file mode 100644 index 0000000..d1ec196 --- /dev/null +++ b/src/app/globals.css @@ -0,0 +1,57 @@ +@import "tailwindcss"; + +@custom-variant dark (&:where(.dark, .dark *)); + +@import "preline/variants.css"; +@source "../node_modules/preline/dist/*.js"; + +@import 'flag-icons/css/flag-icons.min.css'; + +@keyframes shake { + 0% { transform: rotate(0deg); } + 25% { transform: rotate(10deg); } + 50% { transform: rotate(-10deg); } + 75% { transform: rotate(10deg); } + 100% { transform: rotate(0deg); } +} + +.animate-shake { + animation: shake 0.4s ease-in-out; +} + + +/* Adds pointer cursor to buttons */ +@layer base { + button:not(:disabled), + [role="button"]:not(:disabled) { + cursor: pointer; + } +} + +/* Defaults hover styles on all devices */ +@custom-variant hover (&:hover); + +:root { + --background: #ffffff; + --foreground: #171717; +} + +@theme inline { + --color-background: var(--background); + --color-foreground: var(--foreground); + --font-sans: var(--font-geist-sans); + --font-mono: var(--font-geist-mono); +} + +@media (prefers-color-scheme: dark) { + :root { + --background: #0a0a0a; + --foreground: #ededed; + } +} + +body { + background: var(--background); + color: var(--foreground); + font-family: Arial, Helvetica, sans-serif; +} diff --git a/src/app/hooks/useLiveTeam.tsx b/src/app/hooks/useLiveTeam.tsx new file mode 100644 index 0000000..262625a --- /dev/null +++ b/src/app/hooks/useLiveTeam.tsx @@ -0,0 +1,65 @@ +'use client' + +import { useEffect, useState } from 'react' +import { Team } from '../types/team' + +const relevantEvents = [ + 'ws-team-renamed', + 'ws-team-member-joined', + 'ws-team-member-left', + 'ws-team-kick', + 'ws-team-kick-other', + 'ws-team-leader-changed', + 'ws-team-logo-updated' +] + +export function useLiveTeam(initialTeam: Team) { + const [data, setData] = useState(initialTeam) + + useEffect(() => { + const update = async () => { + try { + const res = await fetch(`/api/team/get?id=${initialTeam.id}`) + if (!res.ok) return + + const json = await res.json() + const updatedTeam = json?.team + if (!updatedTeam) return + + const players = [ + ...(updatedTeam.activePlayers ?? []), + ...(updatedTeam.inactivePlayers ?? []), + ] + + setData({ + id: updatedTeam.id, + teamname: updatedTeam.teamname, + logo: updatedTeam.logo, + leader: updatedTeam.leader, + players, + }) + } catch (err) { + console.error('Fehler beim Nachladen des Teams:', err) + } + } + + const handler = (e: Event) => { + const customEvent = e as CustomEvent + if (customEvent.detail?.teamId === initialTeam.id) { + update() + } + } + + for (const evt of relevantEvents) { + window.addEventListener(evt, handler) + } + + return () => { + for (const evt of relevantEvents) { + window.removeEventListener(evt, handler) + } + } + }, [initialTeam.id]) + + return data +} diff --git a/src/app/hooks/useSteamProfile.tsx b/src/app/hooks/useSteamProfile.tsx new file mode 100644 index 0000000..3f77673 --- /dev/null +++ b/src/app/hooks/useSteamProfile.tsx @@ -0,0 +1,15 @@ +// hooks/useSteamProfile.ts +import { useSession } from 'next-auth/react' +import { SteamProfile } from '../types/steam' + +export const useSteamProfile = () => { + const { data: session, status } = useSession() + + const steamProfile = session?.user as SteamProfile | undefined + + return { + session, + steamProfile, + status, // kann 'loading' | 'authenticated' | 'unauthenticated' sein + } +} diff --git a/src/app/hooks/useTeamManager.tsx b/src/app/hooks/useTeamManager.tsx new file mode 100644 index 0000000..01d09b6 --- /dev/null +++ b/src/app/hooks/useTeamManager.tsx @@ -0,0 +1,268 @@ +import { useEffect, useState, useImperativeHandle } from 'react' +import { Player, Team } from '../types/team' +import { useSession } from 'next-auth/react' +import { useWebSocketListener } from '@/app/hooks/useWebSocketListener' + +export type Invitation = { + id: string + teamId: string + teamName: string + type?: 'team-invite' | 'team-join-request' // 👈 hinzufügen +} + +export function useTeamManager( + props: { refetchKey?: string }, + ref: React.Ref +) { + const [team, setTeam] = useState(null) + const [activePlayers, setactivePlayers] = useState([]) + const [inactivePlayers, setInactivePlayers] = useState([]) + const [showLeaveModal, setShowLeaveModal] = useState(false) + const [showInviteModal, setShowInviteModal] = useState(false) + const [activeDragItem, setActiveDragItem] = useState(null) + const [isDragging, setIsDragging] = useState(false) + const [isLoading, setIsLoading] = useState(true) + const [pendingInvitation, setPendingInvitation] = useState(null) + + const { data: session } = useSession() + + const fetchTeam = async () => { + setIsLoading(true) + try { + const res = await fetch('/api/team') + + if (res.status === 404) { + setTeam(null) + setactivePlayers([]) + setInactivePlayers([]) + return + } + + if (!res.ok) throw new Error('Fehler beim Abrufen des Teams') + + const data = await res.json() + + if (!data.team) { + setTeam(null) + setactivePlayers([]) + setInactivePlayers([]) + return + } + + const newActive = data.team.activePlayers.sort((a: Player, b: Player) => a.name.localeCompare(b.name)) + const newInactive = data.team.inactivePlayers.sort((a: Player, b: Player) => a.name.localeCompare(b.name)) + + setTeam({ + id: data.team.id, + teamname: data.team.teamname, + leader: data.team.leader, + logo: data.team.logo, + players: [...newActive, ...newInactive], + }) + setactivePlayers(newActive) + setInactivePlayers(newInactive) + } catch (error) { + console.error('Fehler beim Laden des Teams:', error) + setTeam(null) + } finally { + setIsLoading(false) + } + } + + const fetchInvitations = async () => { + try { + const res = await fetch('/api/user/invitations') + if (res.ok) { + const data = await res.json() + const invitations = (data.invitations || []) as Invitation[] + + // Nur "team-invite" berücksichtigen + const invite = invitations.find(i => i.type === 'team-invite') + setPendingInvitation(invite || null) + } + } catch (error) { + console.error('Fehler beim Laden der Einladungen:', error) + } + } + + useEffect(() => { + const load = async () => { + await Promise.all([fetchTeam(), fetchInvitations()]) + } + load() + }, [props.refetchKey]) + + useWebSocketListener('ws-invitation', fetchInvitations) + useWebSocketListener('ws-team-invite', fetchInvitations) + useWebSocketListener('ws-team-invite-reject', fetchInvitations) + useWebSocketListener('ws-team-update', fetchTeam) + useWebSocketListener('ws-team-kick', () => { + fetchTeam() + fetchInvitations() + }) + useWebSocketListener('ws-team-kick-other', fetchTeam) + useWebSocketListener('ws-team-joined', fetchTeam) + useWebSocketListener('ws-team-member-joined', fetchTeam) + useWebSocketListener('ws-team-left', () => { + fetchTeam() + fetchInvitations() + }) + useWebSocketListener('ws-team-member-left', fetchTeam) + useWebSocketListener('ws-team-leader-changed', fetchTeam) + useWebSocketListener('ws-team-join-request', fetchInvitations) + useWebSocketListener('ws-team-renamed', fetchTeam) + + + const reloadTeam = async () => { + await fetchTeam() + await fetchInvitations() + } + + useImperativeHandle(ref, () => ({ reloadTeam })) + + const acceptInvitation = async (invitationId?: string) => { + const id = invitationId || pendingInvitation?.id + if (!id) return + try { + await fetch('/api/user/invitations/accept', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ invitationId: id }), + }) + if (pendingInvitation?.id === id) setPendingInvitation(null) + await fetchTeam() + } catch (error) { + console.error('Fehler beim Annehmen der Einladung:', error) + } + } + + const rejectInvitation = async (invitationId?: string) => { + const id = invitationId || pendingInvitation?.id + if (!id) return + try { + await fetch('/api/user/invitations/reject', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ invitationId: id }), + }) + if (pendingInvitation?.id === id) setPendingInvitation(null) + } catch (error) { + console.error('Fehler beim Ablehnen der Einladung:', error) + } + } + + const markAllAsRead = async () => { + try { + await fetch('/api/notifications/mark-all-read', { method: 'POST' }) + } catch (err) { + console.error('Fehler beim Markieren aller Benachrichtigungen:', err) + } + } + + const markOneAsRead = async (id: string) => { + try { + await fetch(`/api/notifications/mark-read/${id}`, { method: 'POST' }) + } catch (err) { + console.error(`Fehler beim Markieren von Benachrichtigung ${id}:`, err) + } + } + + const handleInviteAction = async (action: 'accept' | 'reject', invitationId: string) => { + try { + const res = await fetch(`/api/user/invitations/${action}`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ invitationId }), + }) + + // 💡 Einladung war schon gelöscht + if (res.status === 404 && action === 'accept') { + console.warn('Einladung wurde bereits entfernt.') + setPendingInvitation(null) + await fetchTeam() + return + } + + if (!res.ok) throw new Error('Aktion fehlgeschlagen') + + if (action === 'accept') await fetchTeam() + } catch (err) { + console.error(`[${action}] Fehler beim Ausführen:`, err) + } + } + + + const leaveTeam = async (steamId: string, newLeaderId?: string): Promise => { + try { + const payload = newLeaderId ? { steamId, newLeaderId } : { steamId } + const res = await fetch('/api/team/leave', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(payload), + }) + + if (!res.ok) { + const error = await res.json() + console.error('Fehler beim Verlassen:', error.message) + return false + } + + await fetchTeam() + return true + } catch (err) { + console.error('Fehler beim Verlassen des Teams:', err) + return false + } + } + + const renameTeam = async (teamId: string, newName: string) => { + try { + await fetch('/api/team/rename', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ teamId, newName }), + }) + } catch (err) { + console.error('Fehler beim Umbenennen:', err) + } + } + + const deleteTeam = async (teamId: string) => { + try { + await fetch('/api/team/delete', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ teamId }), + }) + } catch (err) { + console.error('Fehler beim Löschen:', err) + } + } + + return { + team, + activePlayers, + inactivePlayers, + activeDragItem, + isDragging, + isLoading, + showLeaveModal, + showInviteModal, + pendingInvitation, + setShowLeaveModal, + setShowInviteModal, + setActiveDragItem, + setIsDragging, + setactivePlayers, + setInactivePlayers, + acceptInvitation, + rejectInvitation, + markAllAsRead, + markOneAsRead, + handleInviteAction, + leaveTeam, + reloadTeam, + renameTeam, + deleteTeam, + } +} diff --git a/src/app/hooks/useWebSocketListener.ts b/src/app/hooks/useWebSocketListener.ts new file mode 100644 index 0000000..3c70cb2 --- /dev/null +++ b/src/app/hooks/useWebSocketListener.ts @@ -0,0 +1,21 @@ +'use client' + +import { useEffect } from 'react' + +export function useWebSocketListener( + eventName: string, + handler: (data: T) => void +) { + useEffect(() => { + const listener = (event: Event) => { + if (!(event instanceof CustomEvent)) return + handler(event.detail) + } + + window.addEventListener(eventName, listener as EventListener) + + return () => { + window.removeEventListener(eventName, listener as EventListener) + } + }, [eventName, handler]) +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx new file mode 100644 index 0000000..7d256ad --- /dev/null +++ b/src/app/layout.tsx @@ -0,0 +1,56 @@ +import type { Metadata } from "next"; +import { Geist, Geist_Mono } from "next/font/google"; +import "./globals.css"; +import PrelineScriptWrapper from './components/PrelineScriptWrapper'; +import { Providers } from './components/Providers'; +import Sidebar from './components/Sidebar'; +import ThemeProvider from "@/theme/theme-provider"; +import Script from "next/script"; +import NotificationCenter from './components/NotificationCenter' +import Navbar from "./components/Navbar"; +import WebSocketManager from "./components/WebSocketManager"; + +const geistSans = Geist({ + variable: "--font-geist-sans", + subsets: ["latin"], +}); + +const geistMono = Geist_Mono({ + variable: "--font-geist-mono", + subsets: ["latin"], +}); + +export const metadata = { + title: 'Meine App', + description: 'Steam Auth Dashboard', +} + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + + + + + {/* Sidebar und Content direkt nebeneinander */} + + {children} + + + + + + + + ); +} + diff --git a/src/app/lib/auth.ts b/src/app/lib/auth.ts new file mode 100644 index 0000000..a41fe4a --- /dev/null +++ b/src/app/lib/auth.ts @@ -0,0 +1,78 @@ +import type { NextAuthOptions } from 'next-auth' +import { NextRequest } from 'next/server' +import Steam from 'next-auth-steam' +import { prisma } from '@/app/lib/prisma' +import type { SteamProfile } from '@/app/types/steam' + +export const authOptions = (req: NextRequest): NextAuthOptions => ({ + secret: process.env.NEXTAUTH_SECRET, + providers: [ + Steam(req, { + clientSecret: process.env.STEAM_API_KEY!, + }), + ], + callbacks: { + async jwt({ token, account, profile }) { + if (account && profile) { + const steamProfile = profile as SteamProfile + const location = steamProfile.loccountrycode ?? null + + await prisma.user.upsert({ + where: { steamId: steamProfile.steamid }, + update: { + name: steamProfile.personaname, + avatar: steamProfile.avatarfull, + ...(location && { location }), + }, + create: { + steamId: steamProfile.steamid, + name: steamProfile.personaname, + avatar: steamProfile.avatarfull, + location: steamProfile.loccountrycode, + isAdmin: false, + ...(location && { location }), + }, + }) + + token.steamId = steamProfile.steamid + token.name = steamProfile.personaname + token.image = steamProfile.avatarfull + } + + const userInDb = await prisma.user.findUnique({ + where: { steamId: token.steamId || token.sub || '' }, + }) + + if (userInDb) { + token.team = userInDb.teamId ?? null + token.isAdmin = userInDb.isAdmin ?? false + } + + return token + }, + + async session({ session, token }) { + if (!token.steamId) throw new Error('steamId is missing in token') + + session.user = { + ...session.user, + steamId: token.steamId, + name: token.name, + image: token.image, + team: token.team ?? null, + isAdmin: token.isAdmin ?? false, + } + return session + }, + + async redirect({ url, baseUrl }) { + if (url.includes('/api/auth/signout')) { + return `${baseUrl}/` // Zurück zur Startseite + } + return `${baseUrl}/dashboard` + }, + }, +}) + +// ➕ Base config für `getServerSession()` ohne req +export const baseAuthOptions: NextAuthOptions = authOptions({} as NextRequest) diff --git a/src/app/lib/crypto.ts b/src/app/lib/crypto.ts new file mode 100644 index 0000000..5ffe0d2 --- /dev/null +++ b/src/app/lib/crypto.ts @@ -0,0 +1,19 @@ +import crypto from 'crypto' + +const algorithm = 'aes-256-cbc' +const secretKey = process.env.SHARE_CODE_SECRET_KEY as string +const iv = Buffer.from(process.env.SHARE_CODE_IV as string, 'hex') // 16 bytes + +export function encrypt(text: string): string { + const cipher = crypto.createCipheriv(algorithm, Buffer.from(secretKey, 'hex'), iv) + let encrypted = cipher.update(text, 'utf8', 'hex') + encrypted += cipher.final('hex') + return encrypted +} + +export function decrypt(encrypted: string): string { + const decipher = crypto.createDecipheriv(algorithm, Buffer.from(secretKey, 'hex'), iv) + let decrypted = decipher.update(encrypted, 'hex', 'utf8') + decrypted += decipher.final('utf8') + return decrypted +} diff --git a/src/app/lib/prisma.ts b/src/app/lib/prisma.ts new file mode 100644 index 0000000..29ec144 --- /dev/null +++ b/src/app/lib/prisma.ts @@ -0,0 +1,14 @@ +// src/lib/prisma.ts +import { PrismaClient } from '@/generated/prisma' + +const globalForPrisma = globalThis as unknown as { + prisma: PrismaClient | undefined +} + +export const prisma = + globalForPrisma.prisma ?? + new PrismaClient({ + //log: ['query'], + }) + +if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma diff --git a/src/app/lib/removePlayerFromTeam.ts b/src/app/lib/removePlayerFromTeam.ts new file mode 100644 index 0000000..5384cb3 --- /dev/null +++ b/src/app/lib/removePlayerFromTeam.ts @@ -0,0 +1,26 @@ +type TeamData = { + activePlayers: string[] + inactivePlayers: string[] + leader: string | null + } + + /** + * Entfernt einen Spieler aus dem Team. + */ + export function removePlayerFromTeam(team: TeamData, steamId: string) { + const updatedActive = team.activePlayers.filter(id => id !== steamId) + const updatedInactive = team.inactivePlayers.filter(id => id !== steamId) + + let newLeader: string | null = team.leader + + if (team.leader === steamId) { + newLeader = updatedActive[0] ?? updatedInactive[0] ?? null + } + + return { + activePlayers: updatedActive, + inactivePlayers: updatedInactive, + leader: newLeader, + } + } + \ No newline at end of file diff --git a/src/app/lib/websocket-client.ts b/src/app/lib/websocket-client.ts new file mode 100644 index 0000000..340a086 --- /dev/null +++ b/src/app/lib/websocket-client.ts @@ -0,0 +1,54 @@ +export class WebSocketClient { + private ws: WebSocket | null = null + private baseUrl: string + private steamId: string + private listeners: ((data: any) => void)[] = [] + + constructor(baseUrl: string, steamId: string) { + this.baseUrl = baseUrl + this.steamId = steamId + } + + connect() { + if (this.ws && this.ws.readyState === WebSocket.OPEN) return + + const fullUrl = `${this.baseUrl}?steamId=${encodeURIComponent(this.steamId)}` + this.ws = new WebSocket(fullUrl) + + this.ws.onopen = () => { + console.log('[WebSocket] Verbunden mit Server.') + } + + this.ws.onmessage = (event) => { + const data = JSON.parse(event.data) + //console.log('[WebSocket] Nachricht erhalten:', data) + this.listeners.forEach((listener) => listener(data)) + } + + this.ws.onclose = () => { + console.warn('[WebSocket] Verbindung verloren. Reconnect in 3 Sekunden...') + setTimeout(() => this.connect(), 3000) + } + + this.ws.onerror = (error) => { + console.error('[WebSocket] Fehler:', error) + this.ws?.close() + } + } + + onMessage(callback: (data: any) => void) { + this.listeners.push(callback) + } + + send(message: any) { + if (this.ws && this.ws.readyState === WebSocket.OPEN) { + this.ws.send(JSON.stringify(message)) + } else { + console.warn('[WebSocket] Nachricht konnte nicht gesendet werden.') + } + } + + close() { + this.ws?.close() + } +} diff --git a/src/app/lib/websocket-server-client.ts b/src/app/lib/websocket-server-client.ts new file mode 100644 index 0000000..583245d --- /dev/null +++ b/src/app/lib/websocket-server-client.ts @@ -0,0 +1,14 @@ +const host = '10.0.1.25' // oder deine IP wie '10.0.1.25' + +export async function sendServerWebSocketMessage(message: any) { + try { + console.log('[WebSocket Client] Message:', message) + await fetch(`http://${host}:3001/send`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(message) + }) + } catch (error) { + console.error('[WebSocket Client] Fehler beim Senden:', error) + } +} diff --git a/src/app/lib/wsStore.ts b/src/app/lib/wsStore.ts new file mode 100644 index 0000000..eb49c6e --- /dev/null +++ b/src/app/lib/wsStore.ts @@ -0,0 +1,73 @@ +import { create } from 'zustand' + +type WSState = { + socket: WebSocket | null + connect: (steamId: string) => void + disconnect: () => void + isConnected: boolean +} + +export const useWS = create((set, get) => { + let reconnectTimeout: NodeJS.Timeout | null = null + + const connect = (steamId: string) => { + const current = get().socket + if (current && (current.readyState === WebSocket.OPEN || current.readyState === WebSocket.CONNECTING)) { + return + } + + const ws = new WebSocket(`ws://10.0.1.25:3001?steamId=${steamId}`) + + ws.onopen = () => { + set({ socket: ws, isConnected: true }) + } + + ws.onmessage = (event) => { + try { + const data = JSON.parse(event.data) + if (data?.type) { + window.dispatchEvent(new CustomEvent(`ws-${data.type}`, { detail: data })) + } + } catch (err) { + console.error('[WS] Ungültige Nachricht:', event.data) + } + } + + ws.onclose = () => { + console.warn('[WS] Verbindung geschlossen. Versuche Reconnect in 3s...') + set({ socket: null, isConnected: false }) + if (!reconnectTimeout) { + reconnectTimeout = setTimeout(() => { + reconnectTimeout = null + connect(steamId) + }, 3000) + } + } + + ws.onerror = (err) => { + console.error('[WS] Fehler:', err) + ws.close() + } + + set({ socket: ws }) + } + + const disconnect = () => { + const socket = get().socket + if (socket && socket.readyState === WebSocket.OPEN) { + socket.close() + } + if (reconnectTimeout) { + clearTimeout(reconnectTimeout) + reconnectTimeout = null + } + set({ socket: null, isConnected: false }) + } + + return { + socket: null, + isConnected: false, + connect, + disconnect, + } +}) diff --git a/src/app/matches/[matchId]/page.tsx b/src/app/matches/[matchId]/page.tsx new file mode 100644 index 0000000..b4644aa --- /dev/null +++ b/src/app/matches/[matchId]/page.tsx @@ -0,0 +1,11 @@ +'use client' + +import { use } from 'react' +import { notFound } from 'next/navigation' +import MatchDetails from '@/app/components/MatchDetails' + +export default function Page({ params }: { params: Promise<{ matchId: string }> }) { + const { matchId } = use(params) + + return +} diff --git a/src/app/matches/page.tsx b/src/app/matches/page.tsx new file mode 100644 index 0000000..3319520 --- /dev/null +++ b/src/app/matches/page.tsx @@ -0,0 +1,88 @@ +'use client' + +import Link from 'next/link' +import { useEffect, useState } from 'react' +import { useSession } from 'next-auth/react' +import Switch from '@/app/components/Switch' + +type Match = { + id: string + title: string + matchDate: string + teamA: { id: string; teamname: string; logo?: string | null } + teamB: { id: string; teamname: string; logo?: string | null } +} + +export default function MatchesPage() { + const { data: session } = useSession() + const [matches, setMatches] = useState([]) + const [onlyOwnTeam, setOnlyOwnTeam] = useState(false) + + useEffect(() => { + fetch('/api/matches') + .then(res => res.json()) + .then(setMatches) + }, []) + + const filteredMatches = onlyOwnTeam && session?.user?.team + ? matches.filter( + (m) => m.teamA.id === session.user.team || m.teamB.id === session.user.team + ) + : matches + + return ( +
+
+

Geplante Matches

+ + {session?.user?.team && ( + + )} +
+ + {filteredMatches.length === 0 ? ( +

Keine Matches geplant.

+ ) : ( +
    + {filteredMatches.map(match => ( +
  • + +
    + {/* Team A */} +
    +
    + + {match.teamA.teamname} + +
    + + {/* Datum / Zeit */} +
    +
    {new Date(match.matchDate).toLocaleDateString('de-DE')}
    +
    {new Date(match.matchDate).toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' })} Uhr
    +
    + + {/* Team B */} +
    +
    + + {match.teamB.teamname} + +
    +
    + +
  • + ))} +
+ )} +
+ ) +} diff --git a/src/app/page.tsx b/src/app/page.tsx new file mode 100644 index 0000000..f0c0eb8 --- /dev/null +++ b/src/app/page.tsx @@ -0,0 +1,7 @@ +export default function Page() { + return ( + <> +

Home

+ + ); +} diff --git a/src/app/profile/page.tsx b/src/app/profile/page.tsx new file mode 100644 index 0000000..f392c94 --- /dev/null +++ b/src/app/profile/page.tsx @@ -0,0 +1,8 @@ +export default function Profile() { + return ( + <> +

Profil

+ + ) + } + \ No newline at end of file diff --git a/src/app/settings/[tab]/page.tsx b/src/app/settings/[tab]/page.tsx new file mode 100644 index 0000000..9677b63 --- /dev/null +++ b/src/app/settings/[tab]/page.tsx @@ -0,0 +1,43 @@ +'use client' + +import { use, useState } from 'react' +import { notFound } from 'next/navigation' +import Card from '@/app/components/Card' +import CreateTeamButton from '@/app/components/CreateTeamButton' +import TeamCardComponent from '@/app/components/TeamCardComponent' +import AccountSettings from '@/app/components/settings/AccountSettings' + +export default function Page({ params }: { params: Promise<{ tab: string }> }) { + const { tab } = use(params) + + const renderTabContent = () => { + switch (tab) { + case 'account': + return ( + + + + ) + case 'privacy': + return ( + + ) + case 'team': + return ( + + + + ) + case 'matches': + return ( + + + + ) + default: + return notFound() + } + } + + return <>{renderTabContent()} +} diff --git a/src/app/settings/layout.tsx b/src/app/settings/layout.tsx new file mode 100644 index 0000000..455dced --- /dev/null +++ b/src/app/settings/layout.tsx @@ -0,0 +1,18 @@ +import { Tabs } from '@/app/components/Tabs' +import Tab from '@/app/components/Tab' + +export default function SettingsLayout({ children }: { children: React.ReactNode }) { + return ( +
+ + + + + + +
+ {children} +
+
+ ) +} diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx new file mode 100644 index 0000000..acf27cb --- /dev/null +++ b/src/app/settings/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from 'next/navigation' + +export default function Page() { + redirect('/settings/account') +} diff --git a/src/app/types/match.ts b/src/app/types/match.ts new file mode 100644 index 0000000..c84890a --- /dev/null +++ b/src/app/types/match.ts @@ -0,0 +1,23 @@ +import { Player, Team } from "./team" + +export type Match = { + id: string + title: string + description?: string + matchDate: string + map?: string + teamA: Team + teamB: Team + playersA: MatchPlayer[] + playersB: MatchPlayer[] +} + +export type MatchPlayer = { + user: Player, + stats?: { + kills: number + deaths: number + assists: number, + adr: number, + } +} diff --git a/src/app/types/next-auth.d.ts b/src/app/types/next-auth.d.ts new file mode 100644 index 0000000..a0f6380 --- /dev/null +++ b/src/app/types/next-auth.d.ts @@ -0,0 +1,34 @@ +// types/next-auth.d.ts (oder z. B. in src/types/next-auth.d.ts) + +import { DefaultSession, DefaultUser } from 'next-auth' + +declare module 'next-auth' { + interface Session { + user: { + steamId: string + isAdmin: boolean + team: string | null + id?: string + name?: string + image?: string + } + id?: string + } + + interface User extends DefaultUser { + steamId: string + isAdmin: boolean + team?: string | null + } +} + +declare module 'next-auth/jwt' { + interface JWT { + steamId?: string + isAdmin?: boolean + team?: string | null + name?: string + image?: string + id?: string + } +} diff --git a/src/app/types/steam.ts b/src/app/types/steam.ts new file mode 100644 index 0000000..9f530ca --- /dev/null +++ b/src/app/types/steam.ts @@ -0,0 +1,14 @@ +// types/SteamProfile.ts + +export interface SteamProfile { + steamid: string + personaname: string + profileurl: string + avatar: string + avatarmedium: string + avatarfull: string + realname?: string + loccountrycode?: string + [key: string]: any // falls Steam noch mehr zurückgibt + } + \ No newline at end of file diff --git a/src/app/types/team.ts b/src/app/types/team.ts new file mode 100644 index 0000000..d67eda1 --- /dev/null +++ b/src/app/types/team.ts @@ -0,0 +1,14 @@ +export type Player = { + steamId: string + name: string + avatar: string + location?: string + } + +export type Team = { + id: string + teamname: string | null + logo: string | null + leader: string + players?: Player[] +} \ No newline at end of file diff --git a/src/app/utils/parseShareCode.ts b/src/app/utils/parseShareCode.ts new file mode 100644 index 0000000..5647337 --- /dev/null +++ b/src/app/utils/parseShareCode.ts @@ -0,0 +1,15 @@ +export function parseShareCode(code: string) { + try { + const base64 = code.replace(/^CSGO:/, '').replace(/-/g, '+').replace(/_/g, '/') + const buffer = Buffer.from(base64, 'base64') + const matchId = buffer.readUInt64LE(0) + const outcomeId = buffer.readUInt64LE(8) + const tokenId = buffer.readUInt32LE(16) + + return { matchId, outcomeId, tokenId } + } catch (err) { + console.error('Fehler beim Parsen des Share-Codes:', err) + return null + } + } + \ No newline at end of file diff --git a/src/generated/prisma/client.d.ts b/src/generated/prisma/client.d.ts new file mode 100644 index 0000000..bc20c6c --- /dev/null +++ b/src/generated/prisma/client.d.ts @@ -0,0 +1 @@ +export * from "./index" \ No newline at end of file diff --git a/src/generated/prisma/client.js b/src/generated/prisma/client.js new file mode 100644 index 0000000..72afab7 --- /dev/null +++ b/src/generated/prisma/client.js @@ -0,0 +1,4 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ +module.exports = { ...require('.') } \ No newline at end of file diff --git a/src/generated/prisma/default.d.ts b/src/generated/prisma/default.d.ts new file mode 100644 index 0000000..bc20c6c --- /dev/null +++ b/src/generated/prisma/default.d.ts @@ -0,0 +1 @@ +export * from "./index" \ No newline at end of file diff --git a/src/generated/prisma/default.js b/src/generated/prisma/default.js new file mode 100644 index 0000000..72afab7 --- /dev/null +++ b/src/generated/prisma/default.js @@ -0,0 +1,4 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ +module.exports = { ...require('.') } \ No newline at end of file diff --git a/src/generated/prisma/edge.d.ts b/src/generated/prisma/edge.d.ts new file mode 100644 index 0000000..274b8fa --- /dev/null +++ b/src/generated/prisma/edge.d.ts @@ -0,0 +1 @@ +export * from "./default" \ No newline at end of file diff --git a/src/generated/prisma/edge.js b/src/generated/prisma/edge.js new file mode 100644 index 0000000..638c848 --- /dev/null +++ b/src/generated/prisma/edge.js @@ -0,0 +1,333 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ + +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + PrismaClientKnownRequestError, + PrismaClientUnknownRequestError, + PrismaClientRustPanicError, + PrismaClientInitializationError, + PrismaClientValidationError, + getPrismaClient, + sqltag, + empty, + join, + raw, + skip, + Decimal, + Debug, + objectEnumValues, + makeStrictEnum, + Extensions, + warnOnce, + defineDmmfProperty, + Public, + getRuntime, + createParam, +} = require('./runtime/edge.js') + + +const Prisma = {} + +exports.Prisma = Prisma +exports.$Enums = {} + +/** + * Prisma Client JS version: 6.7.0 + * Query Engine version: 3cff47a7f5d65c3ea74883f1d736e41d68ce91ed + */ +Prisma.prismaVersion = { + client: "6.7.0", + engine: "3cff47a7f5d65c3ea74883f1d736e41d68ce91ed" +} + +Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; +Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError +Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError +Prisma.PrismaClientInitializationError = PrismaClientInitializationError +Prisma.PrismaClientValidationError = PrismaClientValidationError +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.UserScalarFieldEnum = { + steamId: 'steamId', + name: 'name', + avatar: 'avatar', + location: 'location', + isAdmin: 'isAdmin', + teamId: 'teamId', + premierRank: 'premierRank', + authCode: 'authCode', + lastKnownShareCode: 'lastKnownShareCode', + lastKnownShareCodeDate: 'lastKnownShareCodeDate', + createdAt: 'createdAt' +}; + +exports.Prisma.TeamScalarFieldEnum = { + id: 'id', + name: 'name', + leaderId: 'leaderId', + logo: 'logo', + createdAt: 'createdAt', + activePlayers: 'activePlayers', + inactivePlayers: 'inactivePlayers' +}; + +exports.Prisma.MatchScalarFieldEnum = { + matchId: 'matchId', + teamAId: 'teamAId', + teamBId: 'teamBId', + matchDate: 'matchDate', + matchType: 'matchType', + map: 'map', + title: 'title', + description: 'description', + demoData: 'demoData', + demoFilePath: 'demoFilePath', + scoreA: 'scoreA', + scoreB: 'scoreB', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.MatchPlayerScalarFieldEnum = { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + teamId: 'teamId', + createdAt: 'createdAt' +}; + +exports.Prisma.MatchPlayerStatsScalarFieldEnum = { + id: 'id', + matchPlayerId: 'matchPlayerId', + kills: 'kills', + assists: 'assists', + deaths: 'deaths', + adr: 'adr', + headshotPct: 'headshotPct', + flashAssists: 'flashAssists', + mvps: 'mvps', + mvpEliminations: 'mvpEliminations', + mvpDefuse: 'mvpDefuse', + mvpPlant: 'mvpPlant', + knifeKills: 'knifeKills', + zeusKills: 'zeusKills', + wallbangKills: 'wallbangKills', + smokeKills: 'smokeKills', + headshots: 'headshots', + noScopes: 'noScopes', + blindKills: 'blindKills', + rankOld: 'rankOld', + rankNew: 'rankNew', + winCount: 'winCount' +}; + +exports.Prisma.DemoFileScalarFieldEnum = { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + fileName: 'fileName', + filePath: 'filePath', + parsed: 'parsed', + createdAt: 'createdAt' +}; + +exports.Prisma.InvitationScalarFieldEnum = { + id: 'id', + userId: 'userId', + teamId: 'teamId', + type: 'type', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationScalarFieldEnum = { + id: 'id', + userId: 'userId', + title: 'title', + message: 'message', + read: 'read', + persistent: 'persistent', + actionType: 'actionType', + actionData: 'actionData', + createdAt: 'createdAt' +}; + +exports.Prisma.CS2MatchRequestScalarFieldEnum = { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + reservationId: 'reservationId', + tvPort: 'tvPort', + processed: 'processed', + createdAt: 'createdAt' +}; + +exports.Prisma.PremierRankHistoryScalarFieldEnum = { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + rankOld: 'rankOld', + rankNew: 'rankNew', + delta: 'delta', + winCount: 'winCount', + createdAt: 'createdAt' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + +exports.Prisma.NullsOrder = { + first: 'first', + last: 'last' +}; + +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + + +exports.Prisma.ModelName = { + User: 'User', + Team: 'Team', + Match: 'Match', + MatchPlayer: 'MatchPlayer', + MatchPlayerStats: 'MatchPlayerStats', + DemoFile: 'DemoFile', + Invitation: 'Invitation', + Notification: 'Notification', + CS2MatchRequest: 'CS2MatchRequest', + PremierRankHistory: 'PremierRankHistory' +}; +/** + * Create the Client + */ +const config = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client-js" + }, + "output": { + "value": "C:\\Users\\Rother\\Desktop\\dev\\ironie\\nextjs\\src\\generated\\prisma", + "fromEnvVar": null + }, + "config": { + "engineType": "library" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "windows", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "C:\\Users\\Rother\\Desktop\\dev\\ironie\\nextjs\\prisma\\schema.prisma", + "isCustomOutput": true + }, + "relativeEnvPaths": { + "rootEnvPath": null, + "schemaEnvPath": "../../../.env" + }, + "relativePath": "../../../prisma", + "clientVersion": "6.7.0", + "engineVersion": "3cff47a7f5d65c3ea74883f1d736e41d68ce91ed", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "postinstall": false, + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../src/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n steamId String @id\n name String?\n avatar String?\n location String?\n isAdmin Boolean @default(false)\n teamId String? @unique\n premierRank Int?\n authCode String?\n lastKnownShareCode String?\n lastKnownShareCodeDate DateTime?\n createdAt DateTime @default(now())\n\n team Team? @relation(\"UserTeam\", fields: [teamId], references: [id])\n ledTeam Team? @relation(\"TeamLeader\")\n invitations Invitation[] @relation(\"UserInvitations\")\n notifications Notification[]\n matchPlayers MatchPlayer[]\n matchRequests CS2MatchRequest[] @relation(\"MatchRequests\")\n rankHistory PremierRankHistory[] @relation(\"UserRankHistory\")\n demoFiles DemoFile[]\n}\n\nmodel Team {\n id String @id @default(cuid())\n name String @unique\n leaderId String? @unique\n logo String?\n createdAt DateTime @default(now())\n activePlayers String[]\n inactivePlayers String[]\n leader User? @relation(\"TeamLeader\", fields: [leaderId], references: [steamId])\n members User[] @relation(\"UserTeam\")\n invitations Invitation[]\n matchPlayers MatchPlayer[]\n matchesAsTeamA Match[] @relation(\"TeamA\")\n matchesAsTeamB Match[] @relation(\"TeamB\")\n}\n\nmodel Match {\n matchId BigInt @id @default(autoincrement())\n teamAId String?\n teamBId String?\n matchDate DateTime\n matchType String @default(\"community\")\n map String?\n title String\n description String?\n demoData Json?\n demoFilePath String?\n scoreA Int?\n scoreB Int?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n teamA Team? @relation(\"TeamA\", fields: [teamAId], references: [id])\n teamB Team? @relation(\"TeamB\", fields: [teamBId], references: [id])\n demoFile DemoFile?\n players MatchPlayer[]\n rankUpdates PremierRankHistory[] @relation(\"MatchRankHistory\")\n}\n\nmodel MatchPlayer {\n id String @id @default(cuid())\n matchId BigInt\n steamId String\n teamId String?\n\n match Match @relation(fields: [matchId], references: [matchId])\n user User @relation(fields: [steamId], references: [steamId])\n team Team? @relation(fields: [teamId], references: [id])\n stats MatchPlayerStats?\n\n createdAt DateTime @default(now())\n\n @@unique([matchId, steamId])\n}\n\nmodel MatchPlayerStats {\n id String @id @default(cuid())\n matchPlayerId String @unique\n kills Int\n assists Int\n deaths Int\n adr Float\n headshotPct Float\n\n flashAssists Int @default(0)\n mvps Int @default(0)\n mvpEliminations Int @default(0)\n mvpDefuse Int @default(0)\n mvpPlant Int @default(0)\n knifeKills Int @default(0)\n zeusKills Int @default(0)\n wallbangKills Int @default(0)\n smokeKills Int @default(0)\n headshots Int @default(0)\n noScopes Int @default(0)\n blindKills Int @default(0)\n\n rankOld Int?\n rankNew Int?\n winCount Int?\n\n matchPlayer MatchPlayer @relation(fields: [matchPlayerId], references: [id])\n}\n\nmodel DemoFile {\n id String @id @default(cuid())\n matchId BigInt @unique\n steamId String\n fileName String @unique\n filePath String\n parsed Boolean @default(false)\n createdAt DateTime @default(now())\n\n match Match @relation(fields: [matchId], references: [matchId])\n user User @relation(fields: [steamId], references: [steamId])\n}\n\nmodel Invitation {\n id String @id @default(cuid())\n userId String\n teamId String\n type String\n createdAt DateTime @default(now())\n\n user User @relation(\"UserInvitations\", fields: [userId], references: [steamId])\n team Team @relation(fields: [teamId], references: [id])\n}\n\nmodel Notification {\n id String @id @default(uuid())\n userId String\n title String?\n message String\n read Boolean @default(false)\n persistent Boolean @default(false)\n actionType String?\n actionData String?\n createdAt DateTime @default(now())\n\n user User @relation(fields: [userId], references: [steamId])\n}\n\nmodel CS2MatchRequest {\n id String @id @default(cuid())\n userId String\n steamId String\n matchId BigInt\n reservationId BigInt\n tvPort BigInt\n processed Boolean @default(false)\n createdAt DateTime @default(now())\n\n user User @relation(\"MatchRequests\", fields: [userId], references: [steamId])\n\n @@unique([steamId, matchId])\n}\n\nmodel PremierRankHistory {\n id String @id @default(cuid())\n userId String\n steamId String\n matchId BigInt?\n\n rankOld Int\n rankNew Int\n delta Int\n winCount Int\n createdAt DateTime @default(now())\n\n user User @relation(\"UserRankHistory\", fields: [userId], references: [steamId])\n match Match? @relation(\"MatchRankHistory\", fields: [matchId], references: [matchId])\n}\n", + "inlineSchemaHash": "cd65d1c6f68a7d7dbc443bd972581fd76a81af776bb6358e75f337a7d4b7fbe6", + "copyEngine": true +} +config.dirname = '/' + +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"avatar\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"location\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isAdmin\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"premierRank\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"authCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastKnownShareCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastKnownShareCodeDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"team\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"UserTeam\",\"relationFromFields\":[\"teamId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledTeam\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"TeamLeader\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"invitations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Invitation\",\"nativeType\":null,\"relationName\":\"UserInvitations\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"nativeType\":null,\"relationName\":\"NotificationToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchPlayers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayer\",\"nativeType\":null,\"relationName\":\"MatchPlayerToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchRequests\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CS2MatchRequest\",\"nativeType\":null,\"relationName\":\"MatchRequests\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankHistory\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PremierRankHistory\",\"nativeType\":null,\"relationName\":\"UserRankHistory\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"demoFiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DemoFile\",\"nativeType\":null,\"relationName\":\"DemoFileToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Team\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"leaderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"logo\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"activePlayers\",\"kind\":\"scalar\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"inactivePlayers\",\"kind\":\"scalar\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"leader\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"TeamLeader\",\"relationFromFields\":[\"leaderId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"members\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"UserTeam\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"invitations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Invitation\",\"nativeType\":null,\"relationName\":\"InvitationToTeam\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchPlayers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayer\",\"nativeType\":null,\"relationName\":\"MatchPlayerToTeam\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchesAsTeamA\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"TeamA\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchesAsTeamB\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"TeamB\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Match\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"BigInt\",\"nativeType\":null,\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamAId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamBId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":\"community\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"map\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"demoData\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"demoFilePath\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scoreA\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scoreB\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"teamA\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"TeamA\",\"relationFromFields\":[\"teamAId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamB\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"TeamB\",\"relationFromFields\":[\"teamBId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"demoFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DemoFile\",\"nativeType\":null,\"relationName\":\"DemoFileToMatch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"players\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayer\",\"nativeType\":null,\"relationName\":\"MatchToMatchPlayer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankUpdates\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PremierRankHistory\",\"nativeType\":null,\"relationName\":\"MatchRankHistory\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"MatchPlayer\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"match\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"MatchToMatchPlayer\",\"relationFromFields\":[\"matchId\"],\"relationToFields\":[\"matchId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"MatchPlayerToUser\",\"relationFromFields\":[\"steamId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"team\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"MatchPlayerToTeam\",\"relationFromFields\":[\"teamId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stats\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayerStats\",\"nativeType\":null,\"relationName\":\"MatchPlayerToMatchPlayerStats\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"matchId\",\"steamId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"matchId\",\"steamId\"]}],\"isGenerated\":false},\"MatchPlayerStats\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchPlayerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"assists\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deaths\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adr\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Float\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"headshotPct\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Float\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"flashAssists\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mvps\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mvpEliminations\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mvpDefuse\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mvpPlant\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"knifeKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zeusKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wallbangKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"smokeKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"headshots\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"noScopes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"blindKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankOld\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankNew\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"winCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchPlayer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayer\",\"nativeType\":null,\"relationName\":\"MatchPlayerToMatchPlayerStats\",\"relationFromFields\":[\"matchPlayerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"DemoFile\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fileName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"filePath\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parsed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"match\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"DemoFileToMatch\",\"relationFromFields\":[\"matchId\"],\"relationToFields\":[\"matchId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"DemoFileToUser\",\"relationFromFields\":[\"steamId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Invitation\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"UserInvitations\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"team\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"InvitationToTeam\",\"relationFromFields\":[\"teamId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Notification\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"uuid\",\"args\":[4]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"message\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"read\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"persistent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actionType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actionData\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"NotificationToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CS2MatchRequest\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"reservationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"tvPort\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"processed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"MatchRequests\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"steamId\",\"matchId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"steamId\",\"matchId\"]}],\"isGenerated\":false},\"PremierRankHistory\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankOld\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankNew\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"delta\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"winCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"UserRankHistory\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"match\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"MatchRankHistory\",\"relationFromFields\":[\"matchId\"],\"relationToFields\":[\"matchId\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") +defineDmmfProperty(exports.Prisma, config.runtimeDataModel) +config.engineWasm = undefined +config.compilerWasm = undefined + +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/src/generated/prisma/index-browser.js b/src/generated/prisma/index-browser.js new file mode 100644 index 0000000..fc7d0bc --- /dev/null +++ b/src/generated/prisma/index-browser.js @@ -0,0 +1,319 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ + +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + Decimal, + objectEnumValues, + makeStrictEnum, + Public, + getRuntime, + skip +} = require('./runtime/index-browser.js') + + +const Prisma = {} + +exports.Prisma = Prisma +exports.$Enums = {} + +/** + * Prisma Client JS version: 6.7.0 + * Query Engine version: 3cff47a7f5d65c3ea74883f1d736e41d68ce91ed + */ +Prisma.prismaVersion = { + client: "6.7.0", + engine: "3cff47a7f5d65c3ea74883f1d736e41d68ce91ed" +} + +Prisma.PrismaClientKnownRequestError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)}; +Prisma.PrismaClientUnknownRequestError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientRustPanicError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientInitializationError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientValidationError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.empty = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.join = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.raw = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.validator = Public.validator + +/** +* Extensions +*/ +Prisma.getExtensionContext = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.defineExtension = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} + +/** + * 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.UserScalarFieldEnum = { + steamId: 'steamId', + name: 'name', + avatar: 'avatar', + location: 'location', + isAdmin: 'isAdmin', + teamId: 'teamId', + premierRank: 'premierRank', + authCode: 'authCode', + lastKnownShareCode: 'lastKnownShareCode', + lastKnownShareCodeDate: 'lastKnownShareCodeDate', + createdAt: 'createdAt' +}; + +exports.Prisma.TeamScalarFieldEnum = { + id: 'id', + name: 'name', + leaderId: 'leaderId', + logo: 'logo', + createdAt: 'createdAt', + activePlayers: 'activePlayers', + inactivePlayers: 'inactivePlayers' +}; + +exports.Prisma.MatchScalarFieldEnum = { + matchId: 'matchId', + teamAId: 'teamAId', + teamBId: 'teamBId', + matchDate: 'matchDate', + matchType: 'matchType', + map: 'map', + title: 'title', + description: 'description', + demoData: 'demoData', + demoFilePath: 'demoFilePath', + scoreA: 'scoreA', + scoreB: 'scoreB', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.MatchPlayerScalarFieldEnum = { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + teamId: 'teamId', + createdAt: 'createdAt' +}; + +exports.Prisma.MatchPlayerStatsScalarFieldEnum = { + id: 'id', + matchPlayerId: 'matchPlayerId', + kills: 'kills', + assists: 'assists', + deaths: 'deaths', + adr: 'adr', + headshotPct: 'headshotPct', + flashAssists: 'flashAssists', + mvps: 'mvps', + mvpEliminations: 'mvpEliminations', + mvpDefuse: 'mvpDefuse', + mvpPlant: 'mvpPlant', + knifeKills: 'knifeKills', + zeusKills: 'zeusKills', + wallbangKills: 'wallbangKills', + smokeKills: 'smokeKills', + headshots: 'headshots', + noScopes: 'noScopes', + blindKills: 'blindKills', + rankOld: 'rankOld', + rankNew: 'rankNew', + winCount: 'winCount' +}; + +exports.Prisma.DemoFileScalarFieldEnum = { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + fileName: 'fileName', + filePath: 'filePath', + parsed: 'parsed', + createdAt: 'createdAt' +}; + +exports.Prisma.InvitationScalarFieldEnum = { + id: 'id', + userId: 'userId', + teamId: 'teamId', + type: 'type', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationScalarFieldEnum = { + id: 'id', + userId: 'userId', + title: 'title', + message: 'message', + read: 'read', + persistent: 'persistent', + actionType: 'actionType', + actionData: 'actionData', + createdAt: 'createdAt' +}; + +exports.Prisma.CS2MatchRequestScalarFieldEnum = { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + reservationId: 'reservationId', + tvPort: 'tvPort', + processed: 'processed', + createdAt: 'createdAt' +}; + +exports.Prisma.PremierRankHistoryScalarFieldEnum = { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + rankOld: 'rankOld', + rankNew: 'rankNew', + delta: 'delta', + winCount: 'winCount', + createdAt: 'createdAt' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + +exports.Prisma.NullsOrder = { + first: 'first', + last: 'last' +}; + +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + + +exports.Prisma.ModelName = { + User: 'User', + Team: 'Team', + Match: 'Match', + MatchPlayer: 'MatchPlayer', + MatchPlayerStats: 'MatchPlayerStats', + DemoFile: 'DemoFile', + Invitation: 'Invitation', + Notification: 'Notification', + CS2MatchRequest: 'CS2MatchRequest', + PremierRankHistory: 'PremierRankHistory' +}; + +/** + * This is a stub Prisma Client that will error at runtime if called. + */ +class PrismaClient { + constructor() { + return new Proxy(this, { + get(target, prop) { + let message + const runtime = getRuntime() + if (runtime.isEdge) { + message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: +- Use Prisma Accelerate: https://pris.ly/d/accelerate +- Use Driver Adapters: https://pris.ly/d/driver-adapters +`; + } else { + message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' + } + + message += ` +If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` + + throw new Error(message) + } + }) + } +} + +exports.PrismaClient = PrismaClient + +Object.assign(exports, Prisma) diff --git a/src/generated/prisma/index.d.ts b/src/generated/prisma/index.d.ts new file mode 100644 index 0000000..301d308 --- /dev/null +++ b/src/generated/prisma/index.d.ts @@ -0,0 +1,21226 @@ + +/** + * Client +**/ + +import * as runtime from './runtime/library.js'; +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 User + * + */ +export type User = $Result.DefaultSelection +/** + * Model Team + * + */ +export type Team = $Result.DefaultSelection +/** + * Model Match + * + */ +export type Match = $Result.DefaultSelection +/** + * Model MatchPlayer + * + */ +export type MatchPlayer = $Result.DefaultSelection +/** + * Model MatchPlayerStats + * + */ +export type MatchPlayerStats = $Result.DefaultSelection +/** + * Model DemoFile + * + */ +export type DemoFile = $Result.DefaultSelection +/** + * Model Invitation + * + */ +export type Invitation = $Result.DefaultSelection +/** + * Model Notification + * + */ +export type Notification = $Result.DefaultSelection +/** + * Model CS2MatchRequest + * + */ +export type CS2MatchRequest = $Result.DefaultSelection +/** + * Model PremierRankHistory + * + */ +export type PremierRankHistory = $Result.DefaultSelection + +/** + * ## Prisma Client ʲˢ + * + * Type-safe database client for TypeScript & Node.js + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export class PrismaClient< + ClientOptions extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + U = 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never, + ExtArgs extends $Extensions.InternalArgs = $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 Users + * const users = await prisma.user.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): PrismaClient; + + /** + * 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, $Utils.Call, { + extArgs: ExtArgs + }>> + + /** + * `prisma.user`: Exposes CRUD operations for the **User** model. + * Example usage: + * ```ts + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + */ + get user(): Prisma.UserDelegate; + + /** + * `prisma.team`: Exposes CRUD operations for the **Team** model. + * Example usage: + * ```ts + * // Fetch zero or more Teams + * const teams = await prisma.team.findMany() + * ``` + */ + get team(): Prisma.TeamDelegate; + + /** + * `prisma.match`: Exposes CRUD operations for the **Match** model. + * Example usage: + * ```ts + * // Fetch zero or more Matches + * const matches = await prisma.match.findMany() + * ``` + */ + get match(): Prisma.MatchDelegate; + + /** + * `prisma.matchPlayer`: Exposes CRUD operations for the **MatchPlayer** model. + * Example usage: + * ```ts + * // Fetch zero or more MatchPlayers + * const matchPlayers = await prisma.matchPlayer.findMany() + * ``` + */ + get matchPlayer(): Prisma.MatchPlayerDelegate; + + /** + * `prisma.matchPlayerStats`: Exposes CRUD operations for the **MatchPlayerStats** model. + * Example usage: + * ```ts + * // Fetch zero or more MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.findMany() + * ``` + */ + get matchPlayerStats(): Prisma.MatchPlayerStatsDelegate; + + /** + * `prisma.demoFile`: Exposes CRUD operations for the **DemoFile** model. + * Example usage: + * ```ts + * // Fetch zero or more DemoFiles + * const demoFiles = await prisma.demoFile.findMany() + * ``` + */ + get demoFile(): Prisma.DemoFileDelegate; + + /** + * `prisma.invitation`: Exposes CRUD operations for the **Invitation** model. + * Example usage: + * ```ts + * // Fetch zero or more Invitations + * const invitations = await prisma.invitation.findMany() + * ``` + */ + get invitation(): Prisma.InvitationDelegate; + + /** + * `prisma.notification`: Exposes CRUD operations for the **Notification** model. + * Example usage: + * ```ts + * // Fetch zero or more Notifications + * const notifications = await prisma.notification.findMany() + * ``` + */ + get notification(): Prisma.NotificationDelegate; + + /** + * `prisma.cS2MatchRequest`: Exposes CRUD operations for the **CS2MatchRequest** model. + * Example usage: + * ```ts + * // Fetch zero or more CS2MatchRequests + * const cS2MatchRequests = await prisma.cS2MatchRequest.findMany() + * ``` + */ + get cS2MatchRequest(): Prisma.CS2MatchRequestDelegate; + + /** + * `prisma.premierRankHistory`: Exposes CRUD operations for the **PremierRankHistory** model. + * Example usage: + * ```ts + * // Fetch zero or more PremierRankHistories + * const premierRankHistories = await prisma.premierRankHistory.findMany() + * ``` + */ + get premierRankHistory(): Prisma.PremierRankHistoryDelegate; +} + +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 + + /** + * 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: 6.7.0 + * Query Engine version: 3cff47a7f5d65c3ea74883f1d736e41d68ce91ed + */ + export type PrismaVersion = { + client: string + } + + export const prismaVersion: PrismaVersion + + /** + * Utility Types + */ + + + export import JsonObject = runtime.JsonObject + export import JsonArray = runtime.JsonArray + export import JsonValue = runtime.JsonValue + export import InputJsonObject = runtime.InputJsonObject + export import InputJsonArray = runtime.InputJsonArray + export import InputJsonValue = runtime.InputJsonValue + + /** + * 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 + } + + type SelectAndOmit = { + select: any + omit: 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`.' + : T extends SelectAndOmit + ? 'Please either choose `select` or `omit`.' + : {}) + + /** + * 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 ? P : 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: { + User: 'User', + Team: 'Team', + Match: 'Match', + MatchPlayer: 'MatchPlayer', + MatchPlayerStats: 'MatchPlayerStats', + DemoFile: 'DemoFile', + Invitation: 'Invitation', + Notification: 'Notification', + CS2MatchRequest: 'CS2MatchRequest', + PremierRankHistory: 'PremierRankHistory' + }; + + export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + export type Datasources = { + db?: Datasource + } + + interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.InternalArgs }, $Utils.Record> { + returns: Prisma.TypeMap + } + + export type TypeMap = { + globalOmitOptions: { + omit: GlobalOmitOptions + } + meta: { + modelProps: "user" | "team" | "match" | "matchPlayer" | "matchPlayerStats" | "demoFile" | "invitation" | "notification" | "cS2MatchRequest" | "premierRankHistory" + txIsolationLevel: Prisma.TransactionIsolationLevel + } + model: { + User: { + payload: Prisma.$UserPayload + fields: Prisma.UserFieldRefs + operations: { + findUnique: { + args: Prisma.UserFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.UserFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.UserCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.UserCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UserCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.UserDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.UserUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.UserUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.UserUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.UserGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.UserCountArgs + result: $Utils.Optional | number + } + } + } + Team: { + payload: Prisma.$TeamPayload + fields: Prisma.TeamFieldRefs + operations: { + findUnique: { + args: Prisma.TeamFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.TeamFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.TeamFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.TeamFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.TeamFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.TeamCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.TeamCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.TeamCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.TeamDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.TeamUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.TeamDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.TeamUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.TeamUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.TeamUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.TeamAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.TeamGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.TeamCountArgs + result: $Utils.Optional | number + } + } + } + Match: { + payload: Prisma.$MatchPayload + fields: Prisma.MatchFieldRefs + operations: { + findUnique: { + args: Prisma.MatchFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.MatchFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.MatchFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.MatchFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.MatchFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.MatchCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.MatchCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.MatchCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.MatchDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.MatchUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.MatchDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.MatchUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.MatchUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.MatchUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.MatchAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.MatchGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.MatchCountArgs + result: $Utils.Optional | number + } + } + } + MatchPlayer: { + payload: Prisma.$MatchPlayerPayload + fields: Prisma.MatchPlayerFieldRefs + operations: { + findUnique: { + args: Prisma.MatchPlayerFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.MatchPlayerFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.MatchPlayerFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.MatchPlayerFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.MatchPlayerFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.MatchPlayerCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.MatchPlayerCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.MatchPlayerCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.MatchPlayerDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.MatchPlayerUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.MatchPlayerDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.MatchPlayerUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.MatchPlayerUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.MatchPlayerUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.MatchPlayerAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.MatchPlayerGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.MatchPlayerCountArgs + result: $Utils.Optional | number + } + } + } + MatchPlayerStats: { + payload: Prisma.$MatchPlayerStatsPayload + fields: Prisma.MatchPlayerStatsFieldRefs + operations: { + findUnique: { + args: Prisma.MatchPlayerStatsFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.MatchPlayerStatsFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.MatchPlayerStatsFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.MatchPlayerStatsFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.MatchPlayerStatsFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.MatchPlayerStatsCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.MatchPlayerStatsCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.MatchPlayerStatsCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.MatchPlayerStatsDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.MatchPlayerStatsUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.MatchPlayerStatsDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.MatchPlayerStatsUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.MatchPlayerStatsUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.MatchPlayerStatsUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.MatchPlayerStatsAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.MatchPlayerStatsGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.MatchPlayerStatsCountArgs + result: $Utils.Optional | number + } + } + } + DemoFile: { + payload: Prisma.$DemoFilePayload + fields: Prisma.DemoFileFieldRefs + operations: { + findUnique: { + args: Prisma.DemoFileFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.DemoFileFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.DemoFileFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.DemoFileFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.DemoFileFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.DemoFileCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.DemoFileCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.DemoFileCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.DemoFileDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.DemoFileUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.DemoFileDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.DemoFileUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.DemoFileUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.DemoFileUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.DemoFileAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.DemoFileGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.DemoFileCountArgs + result: $Utils.Optional | number + } + } + } + Invitation: { + payload: Prisma.$InvitationPayload + fields: Prisma.InvitationFieldRefs + operations: { + findUnique: { + args: Prisma.InvitationFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.InvitationFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.InvitationFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.InvitationFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.InvitationFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.InvitationCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.InvitationCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.InvitationCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.InvitationDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.InvitationUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.InvitationDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.InvitationUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.InvitationUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.InvitationUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.InvitationAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.InvitationGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.InvitationCountArgs + result: $Utils.Optional | number + } + } + } + Notification: { + payload: Prisma.$NotificationPayload + fields: Prisma.NotificationFieldRefs + operations: { + findUnique: { + args: Prisma.NotificationFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.NotificationFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.NotificationFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.NotificationFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.NotificationFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.NotificationCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.NotificationCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.NotificationCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.NotificationDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.NotificationUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.NotificationDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.NotificationUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.NotificationUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.NotificationUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.NotificationAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.NotificationGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.NotificationCountArgs + result: $Utils.Optional | number + } + } + } + CS2MatchRequest: { + payload: Prisma.$CS2MatchRequestPayload + fields: Prisma.CS2MatchRequestFieldRefs + operations: { + findUnique: { + args: Prisma.CS2MatchRequestFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.CS2MatchRequestFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.CS2MatchRequestFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.CS2MatchRequestFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.CS2MatchRequestFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.CS2MatchRequestCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.CS2MatchRequestCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.CS2MatchRequestCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.CS2MatchRequestDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.CS2MatchRequestUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.CS2MatchRequestDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.CS2MatchRequestUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.CS2MatchRequestUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.CS2MatchRequestUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.CS2MatchRequestAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.CS2MatchRequestGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.CS2MatchRequestCountArgs + result: $Utils.Optional | number + } + } + } + PremierRankHistory: { + payload: Prisma.$PremierRankHistoryPayload + fields: Prisma.PremierRankHistoryFieldRefs + operations: { + findUnique: { + args: Prisma.PremierRankHistoryFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PremierRankHistoryFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.PremierRankHistoryFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PremierRankHistoryFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.PremierRankHistoryFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.PremierRankHistoryCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.PremierRankHistoryCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PremierRankHistoryCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.PremierRankHistoryDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.PremierRankHistoryUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PremierRankHistoryDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PremierRankHistoryUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.PremierRankHistoryUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + upsert: { + args: Prisma.PremierRankHistoryUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.PremierRankHistoryAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.PremierRankHistoryGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.PremierRankHistoryCountArgs + result: $Utils.Optional | number + } + } + } + } + } & { + other: { + payload: any + operations: { + $executeRaw: { + args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], + result: any + } + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...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?: (LogLevel | LogDefinition)[] + /** + * The default values for transactionOptions + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: { + maxWait?: number + timeout?: number + isolationLevel?: Prisma.TransactionIsolationLevel + } + /** + * Global configuration for omitting model fields by default. + * + * @example + * ``` + * const prisma = new PrismaClient({ + * omit: { + * user: { + * password: true + * } + * } + * }) + * ``` + */ + omit?: Prisma.GlobalOmitConfig + } + export type GlobalOmitConfig = { + user?: UserOmit + team?: TeamOmit + match?: MatchOmit + matchPlayer?: MatchPlayerOmit + matchPlayerStats?: MatchPlayerStatsOmit + demoFile?: DemoFileOmit + invitation?: InvitationOmit + notification?: NotificationOmit + cS2MatchRequest?: CS2MatchRequestOmit + premierRankHistory?: PremierRankHistoryOmit + } + + /* 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' + | 'createManyAndReturn' + | 'update' + | 'updateMany' + | 'updateManyAndReturn' + | '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 UserCountOutputType + */ + + export type UserCountOutputType = { + invitations: number + notifications: number + matchPlayers: number + matchRequests: number + rankHistory: number + demoFiles: number + } + + export type UserCountOutputTypeSelect = { + invitations?: boolean | UserCountOutputTypeCountInvitationsArgs + notifications?: boolean | UserCountOutputTypeCountNotificationsArgs + matchPlayers?: boolean | UserCountOutputTypeCountMatchPlayersArgs + matchRequests?: boolean | UserCountOutputTypeCountMatchRequestsArgs + rankHistory?: boolean | UserCountOutputTypeCountRankHistoryArgs + demoFiles?: boolean | UserCountOutputTypeCountDemoFilesArgs + } + + // Custom InputTypes + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: UserCountOutputTypeSelect | null + } + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeCountInvitationsArgs = { + where?: InvitationWhereInput + } + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeCountNotificationsArgs = { + where?: NotificationWhereInput + } + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeCountMatchPlayersArgs = { + where?: MatchPlayerWhereInput + } + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeCountMatchRequestsArgs = { + where?: CS2MatchRequestWhereInput + } + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeCountRankHistoryArgs = { + where?: PremierRankHistoryWhereInput + } + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeCountDemoFilesArgs = { + where?: DemoFileWhereInput + } + + + /** + * Count Type TeamCountOutputType + */ + + export type TeamCountOutputType = { + members: number + invitations: number + matchPlayers: number + matchesAsTeamA: number + matchesAsTeamB: number + } + + export type TeamCountOutputTypeSelect = { + members?: boolean | TeamCountOutputTypeCountMembersArgs + invitations?: boolean | TeamCountOutputTypeCountInvitationsArgs + matchPlayers?: boolean | TeamCountOutputTypeCountMatchPlayersArgs + matchesAsTeamA?: boolean | TeamCountOutputTypeCountMatchesAsTeamAArgs + matchesAsTeamB?: boolean | TeamCountOutputTypeCountMatchesAsTeamBArgs + } + + // Custom InputTypes + /** + * TeamCountOutputType without action + */ + export type TeamCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the TeamCountOutputType + */ + select?: TeamCountOutputTypeSelect | null + } + + /** + * TeamCountOutputType without action + */ + export type TeamCountOutputTypeCountMembersArgs = { + where?: UserWhereInput + } + + /** + * TeamCountOutputType without action + */ + export type TeamCountOutputTypeCountInvitationsArgs = { + where?: InvitationWhereInput + } + + /** + * TeamCountOutputType without action + */ + export type TeamCountOutputTypeCountMatchPlayersArgs = { + where?: MatchPlayerWhereInput + } + + /** + * TeamCountOutputType without action + */ + export type TeamCountOutputTypeCountMatchesAsTeamAArgs = { + where?: MatchWhereInput + } + + /** + * TeamCountOutputType without action + */ + export type TeamCountOutputTypeCountMatchesAsTeamBArgs = { + where?: MatchWhereInput + } + + + /** + * Count Type MatchCountOutputType + */ + + export type MatchCountOutputType = { + players: number + rankUpdates: number + } + + export type MatchCountOutputTypeSelect = { + players?: boolean | MatchCountOutputTypeCountPlayersArgs + rankUpdates?: boolean | MatchCountOutputTypeCountRankUpdatesArgs + } + + // Custom InputTypes + /** + * MatchCountOutputType without action + */ + export type MatchCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the MatchCountOutputType + */ + select?: MatchCountOutputTypeSelect | null + } + + /** + * MatchCountOutputType without action + */ + export type MatchCountOutputTypeCountPlayersArgs = { + where?: MatchPlayerWhereInput + } + + /** + * MatchCountOutputType without action + */ + export type MatchCountOutputTypeCountRankUpdatesArgs = { + where?: PremierRankHistoryWhereInput + } + + + /** + * Models + */ + + /** + * Model User + */ + + export type AggregateUser = { + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null + } + + export type UserAvgAggregateOutputType = { + premierRank: number | null + } + + export type UserSumAggregateOutputType = { + premierRank: number | null + } + + export type UserMinAggregateOutputType = { + steamId: string | null + name: string | null + avatar: string | null + location: string | null + isAdmin: boolean | null + teamId: string | null + premierRank: number | null + authCode: string | null + lastKnownShareCode: string | null + lastKnownShareCodeDate: Date | null + createdAt: Date | null + } + + export type UserMaxAggregateOutputType = { + steamId: string | null + name: string | null + avatar: string | null + location: string | null + isAdmin: boolean | null + teamId: string | null + premierRank: number | null + authCode: string | null + lastKnownShareCode: string | null + lastKnownShareCodeDate: Date | null + createdAt: Date | null + } + + export type UserCountAggregateOutputType = { + steamId: number + name: number + avatar: number + location: number + isAdmin: number + teamId: number + premierRank: number + authCode: number + lastKnownShareCode: number + lastKnownShareCodeDate: number + createdAt: number + _all: number + } + + + export type UserAvgAggregateInputType = { + premierRank?: true + } + + export type UserSumAggregateInputType = { + premierRank?: true + } + + export type UserMinAggregateInputType = { + steamId?: true + name?: true + avatar?: true + location?: true + isAdmin?: true + teamId?: true + premierRank?: true + authCode?: true + lastKnownShareCode?: true + lastKnownShareCodeDate?: true + createdAt?: true + } + + export type UserMaxAggregateInputType = { + steamId?: true + name?: true + avatar?: true + location?: true + isAdmin?: true + teamId?: true + premierRank?: true + authCode?: true + lastKnownShareCode?: true + lastKnownShareCodeDate?: true + createdAt?: true + } + + export type UserCountAggregateInputType = { + steamId?: true + name?: true + avatar?: true + location?: true + isAdmin?: true + teamId?: true + premierRank?: true + authCode?: true + lastKnownShareCode?: true + lastKnownShareCodeDate?: true + createdAt?: true + _all?: true + } + + export type UserAggregateArgs = { + /** + * Filter which User to aggregate. + */ + where?: UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Users + **/ + _count?: true | UserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: UserAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: UserSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserMaxAggregateInputType + } + + export type GetUserAggregateType = { + [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type UserGroupByArgs = { + where?: UserWhereInput + orderBy?: UserOrderByWithAggregationInput | UserOrderByWithAggregationInput[] + by: UserScalarFieldEnum[] | UserScalarFieldEnum + having?: UserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserCountAggregateInputType | true + _avg?: UserAvgAggregateInputType + _sum?: UserSumAggregateInputType + _min?: UserMinAggregateInputType + _max?: UserMaxAggregateInputType + } + + export type UserGroupByOutputType = { + steamId: string + name: string | null + avatar: string | null + location: string | null + isAdmin: boolean + teamId: string | null + premierRank: number | null + authCode: string | null + lastKnownShareCode: string | null + lastKnownShareCodeDate: Date | null + createdAt: Date + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null + } + + type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type UserSelect = $Extensions.GetSelect<{ + steamId?: boolean + name?: boolean + avatar?: boolean + location?: boolean + isAdmin?: boolean + teamId?: boolean + premierRank?: boolean + authCode?: boolean + lastKnownShareCode?: boolean + lastKnownShareCodeDate?: boolean + createdAt?: boolean + team?: boolean | User$teamArgs + ledTeam?: boolean | User$ledTeamArgs + invitations?: boolean | User$invitationsArgs + notifications?: boolean | User$notificationsArgs + matchPlayers?: boolean | User$matchPlayersArgs + matchRequests?: boolean | User$matchRequestsArgs + rankHistory?: boolean | User$rankHistoryArgs + demoFiles?: boolean | User$demoFilesArgs + _count?: boolean | UserCountOutputTypeDefaultArgs + }, ExtArgs["result"]["user"]> + + export type UserSelectCreateManyAndReturn = $Extensions.GetSelect<{ + steamId?: boolean + name?: boolean + avatar?: boolean + location?: boolean + isAdmin?: boolean + teamId?: boolean + premierRank?: boolean + authCode?: boolean + lastKnownShareCode?: boolean + lastKnownShareCodeDate?: boolean + createdAt?: boolean + team?: boolean | User$teamArgs + }, ExtArgs["result"]["user"]> + + export type UserSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + steamId?: boolean + name?: boolean + avatar?: boolean + location?: boolean + isAdmin?: boolean + teamId?: boolean + premierRank?: boolean + authCode?: boolean + lastKnownShareCode?: boolean + lastKnownShareCodeDate?: boolean + createdAt?: boolean + team?: boolean | User$teamArgs + }, ExtArgs["result"]["user"]> + + export type UserSelectScalar = { + steamId?: boolean + name?: boolean + avatar?: boolean + location?: boolean + isAdmin?: boolean + teamId?: boolean + premierRank?: boolean + authCode?: boolean + lastKnownShareCode?: boolean + lastKnownShareCodeDate?: boolean + createdAt?: boolean + } + + export type UserOmit = $Extensions.GetOmit<"steamId" | "name" | "avatar" | "location" | "isAdmin" | "teamId" | "premierRank" | "authCode" | "lastKnownShareCode" | "lastKnownShareCodeDate" | "createdAt", ExtArgs["result"]["user"]> + export type UserInclude = { + team?: boolean | User$teamArgs + ledTeam?: boolean | User$ledTeamArgs + invitations?: boolean | User$invitationsArgs + notifications?: boolean | User$notificationsArgs + matchPlayers?: boolean | User$matchPlayersArgs + matchRequests?: boolean | User$matchRequestsArgs + rankHistory?: boolean | User$rankHistoryArgs + demoFiles?: boolean | User$demoFilesArgs + _count?: boolean | UserCountOutputTypeDefaultArgs + } + export type UserIncludeCreateManyAndReturn = { + team?: boolean | User$teamArgs + } + export type UserIncludeUpdateManyAndReturn = { + team?: boolean | User$teamArgs + } + + export type $UserPayload = { + name: "User" + objects: { + team: Prisma.$TeamPayload | null + ledTeam: Prisma.$TeamPayload | null + invitations: Prisma.$InvitationPayload[] + notifications: Prisma.$NotificationPayload[] + matchPlayers: Prisma.$MatchPlayerPayload[] + matchRequests: Prisma.$CS2MatchRequestPayload[] + rankHistory: Prisma.$PremierRankHistoryPayload[] + demoFiles: Prisma.$DemoFilePayload[] + } + scalars: $Extensions.GetPayloadResult<{ + steamId: string + name: string | null + avatar: string | null + location: string | null + isAdmin: boolean + teamId: string | null + premierRank: number | null + authCode: string | null + lastKnownShareCode: string | null + lastKnownShareCodeDate: Date | null + createdAt: Date + }, ExtArgs["result"]["user"]> + composites: {} + } + + type UserGetPayload = $Result.GetResult + + type UserCountArgs = + Omit & { + select?: UserCountAggregateInputType | true + } + + export interface UserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } + /** + * Find zero or one User that matches the filter. + * @param {UserFindUniqueArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one User that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User 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 {UserFindFirstArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User 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 {UserFindFirstOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Users 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 {UserFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Users + * const users = await prisma.user.findMany() + * + * // Get first 10 Users + * const users = await prisma.user.findMany({ take: 10 }) + * + * // Only select the `steamId` + * const userWithSteamIdOnly = await prisma.user.findMany({ select: { steamId: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a User. + * @param {UserCreateArgs} args - Arguments to create a User. + * @example + * // Create one User + * const User = await prisma.user.create({ + * data: { + * // ... data to create a User + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Users. + * @param {UserCreateManyArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Users and returns the data saved in the database. + * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Users and only return the `steamId` + * const userWithSteamIdOnly = await prisma.user.createManyAndReturn({ + * select: { steamId: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a User. + * @param {UserDeleteArgs} args - Arguments to delete one User. + * @example + * // Delete one User + * const User = await prisma.user.delete({ + * where: { + * // ... filter to delete one User + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one User. + * @param {UserUpdateArgs} args - Arguments to update one User. + * @example + * // Update one User + * const user = await prisma.user.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Users. + * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. + * @example + * // Delete a few Users + * const { count } = await prisma.user.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Users + * const user = await prisma.user.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users and returns the data updated in the database. + * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. + * @example + * // Update many Users + * const user = await prisma.user.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Users and only return the `steamId` + * const userWithSteamIdOnly = await prisma.user.updateManyAndReturn({ + * select: { steamId: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one User. + * @param {UserUpsertArgs} args - Arguments to update or create a User. + * @example + * // Update or create a User + * const user = await prisma.user.upsert({ + * create: { + * // ... data to create a User + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the User we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserCountArgs} args - Arguments to filter Users to count. + * @example + * // Count the number of Users + * const count = await prisma.user.count({ + * where: { + * // ... the filter for the Users 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 User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserAggregateArgs} 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 User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserGroupByArgs} 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 UserGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: UserGroupByArgs['orderBy'] } + : { orderBy?: UserGroupByArgs['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 ? GetUserGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the User model + */ + readonly fields: UserFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for User. + * 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__UserClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + team = {}>(args?: Subset>): Prisma__TeamClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + ledTeam = {}>(args?: Subset>): Prisma__TeamClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + invitations = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + notifications = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + matchPlayers = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + matchRequests = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + rankHistory = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + demoFiles = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | 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 User model + */ + interface UserFieldRefs { + readonly steamId: FieldRef<"User", 'String'> + readonly name: FieldRef<"User", 'String'> + readonly avatar: FieldRef<"User", 'String'> + readonly location: FieldRef<"User", 'String'> + readonly isAdmin: FieldRef<"User", 'Boolean'> + readonly teamId: FieldRef<"User", 'String'> + readonly premierRank: FieldRef<"User", 'Int'> + readonly authCode: FieldRef<"User", 'String'> + readonly lastKnownShareCode: FieldRef<"User", 'String'> + readonly lastKnownShareCodeDate: FieldRef<"User", 'DateTime'> + readonly createdAt: FieldRef<"User", 'DateTime'> + } + + + // Custom InputTypes + /** + * User findUnique + */ + export type UserFindUniqueArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * Filter, which User to fetch. + */ + where: UserWhereUniqueInput + } + + /** + * User findUniqueOrThrow + */ + export type UserFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * Filter, which User to fetch. + */ + where: UserWhereUniqueInput + } + + /** + * User findFirst + */ + export type UserFindFirstArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] + } + + /** + * User findFirstOrThrow + */ + export type UserFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] + } + + /** + * User findMany + */ + export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * Filter, which Users to fetch. + */ + where?: UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Users. + */ + cursor?: UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] + } + + /** + * User create + */ + export type UserCreateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * The data needed to create a User. + */ + data: XOR + } + + /** + * User createMany + */ + export type UserCreateManyArgs = { + /** + * The data used to create many Users. + */ + data: UserCreateManyInput | UserCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * User createManyAndReturn + */ + export type UserCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelectCreateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * The data used to create many Users. + */ + data: UserCreateManyInput | UserCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: UserIncludeCreateManyAndReturn | null + } + + /** + * User update + */ + export type UserUpdateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * The data needed to update a User. + */ + data: XOR + /** + * Choose, which User to update. + */ + where: UserWhereUniqueInput + } + + /** + * User updateMany + */ + export type UserUpdateManyArgs = { + /** + * The data used to update Users. + */ + data: XOR + /** + * Filter which Users to update + */ + where?: UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number + } + + /** + * User updateManyAndReturn + */ + export type UserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * The data used to update Users. + */ + data: XOR + /** + * Filter which Users to update + */ + where?: UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: UserIncludeUpdateManyAndReturn | null + } + + /** + * User upsert + */ + export type UserUpsertArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * The filter to search for the User to update in case it exists. + */ + where: UserWhereUniqueInput + /** + * In case the User found by the `where` argument doesn't exist, create a new User with this data. + */ + create: XOR + /** + * In case the User was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * User delete + */ + export type UserDeleteArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + /** + * Filter which User to delete. + */ + where: UserWhereUniqueInput + } + + /** + * User deleteMany + */ + export type UserDeleteManyArgs = { + /** + * Filter which Users to delete + */ + where?: UserWhereInput + /** + * Limit how many Users to delete. + */ + limit?: number + } + + /** + * User.team + */ + export type User$teamArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + where?: TeamWhereInput + } + + /** + * User.ledTeam + */ + export type User$ledTeamArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + where?: TeamWhereInput + } + + /** + * User.invitations + */ + export type User$invitationsArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + where?: InvitationWhereInput + orderBy?: InvitationOrderByWithRelationInput | InvitationOrderByWithRelationInput[] + cursor?: InvitationWhereUniqueInput + take?: number + skip?: number + distinct?: InvitationScalarFieldEnum | InvitationScalarFieldEnum[] + } + + /** + * User.notifications + */ + export type User$notificationsArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + where?: NotificationWhereInput + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + cursor?: NotificationWhereUniqueInput + take?: number + skip?: number + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * User.matchPlayers + */ + export type User$matchPlayersArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + where?: MatchPlayerWhereInput + orderBy?: MatchPlayerOrderByWithRelationInput | MatchPlayerOrderByWithRelationInput[] + cursor?: MatchPlayerWhereUniqueInput + take?: number + skip?: number + distinct?: MatchPlayerScalarFieldEnum | MatchPlayerScalarFieldEnum[] + } + + /** + * User.matchRequests + */ + export type User$matchRequestsArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + where?: CS2MatchRequestWhereInput + orderBy?: CS2MatchRequestOrderByWithRelationInput | CS2MatchRequestOrderByWithRelationInput[] + cursor?: CS2MatchRequestWhereUniqueInput + take?: number + skip?: number + distinct?: CS2MatchRequestScalarFieldEnum | CS2MatchRequestScalarFieldEnum[] + } + + /** + * User.rankHistory + */ + export type User$rankHistoryArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + where?: PremierRankHistoryWhereInput + orderBy?: PremierRankHistoryOrderByWithRelationInput | PremierRankHistoryOrderByWithRelationInput[] + cursor?: PremierRankHistoryWhereUniqueInput + take?: number + skip?: number + distinct?: PremierRankHistoryScalarFieldEnum | PremierRankHistoryScalarFieldEnum[] + } + + /** + * User.demoFiles + */ + export type User$demoFilesArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + where?: DemoFileWhereInput + orderBy?: DemoFileOrderByWithRelationInput | DemoFileOrderByWithRelationInput[] + cursor?: DemoFileWhereUniqueInput + take?: number + skip?: number + distinct?: DemoFileScalarFieldEnum | DemoFileScalarFieldEnum[] + } + + /** + * User without action + */ + export type UserDefaultArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + } + + + /** + * Model Team + */ + + export type AggregateTeam = { + _count: TeamCountAggregateOutputType | null + _min: TeamMinAggregateOutputType | null + _max: TeamMaxAggregateOutputType | null + } + + export type TeamMinAggregateOutputType = { + id: string | null + name: string | null + leaderId: string | null + logo: string | null + createdAt: Date | null + } + + export type TeamMaxAggregateOutputType = { + id: string | null + name: string | null + leaderId: string | null + logo: string | null + createdAt: Date | null + } + + export type TeamCountAggregateOutputType = { + id: number + name: number + leaderId: number + logo: number + createdAt: number + activePlayers: number + inactivePlayers: number + _all: number + } + + + export type TeamMinAggregateInputType = { + id?: true + name?: true + leaderId?: true + logo?: true + createdAt?: true + } + + export type TeamMaxAggregateInputType = { + id?: true + name?: true + leaderId?: true + logo?: true + createdAt?: true + } + + export type TeamCountAggregateInputType = { + id?: true + name?: true + leaderId?: true + logo?: true + createdAt?: true + activePlayers?: true + inactivePlayers?: true + _all?: true + } + + export type TeamAggregateArgs = { + /** + * Filter which Team to aggregate. + */ + where?: TeamWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Teams to fetch. + */ + orderBy?: TeamOrderByWithRelationInput | TeamOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: TeamWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Teams 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` Teams. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Teams + **/ + _count?: true | TeamCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TeamMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TeamMaxAggregateInputType + } + + export type GetTeamAggregateType = { + [P in keyof T & keyof AggregateTeam]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type TeamGroupByArgs = { + where?: TeamWhereInput + orderBy?: TeamOrderByWithAggregationInput | TeamOrderByWithAggregationInput[] + by: TeamScalarFieldEnum[] | TeamScalarFieldEnum + having?: TeamScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TeamCountAggregateInputType | true + _min?: TeamMinAggregateInputType + _max?: TeamMaxAggregateInputType + } + + export type TeamGroupByOutputType = { + id: string + name: string + leaderId: string | null + logo: string | null + createdAt: Date + activePlayers: string[] + inactivePlayers: string[] + _count: TeamCountAggregateOutputType | null + _min: TeamMinAggregateOutputType | null + _max: TeamMaxAggregateOutputType | null + } + + type GetTeamGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof TeamGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type TeamSelect = $Extensions.GetSelect<{ + id?: boolean + name?: boolean + leaderId?: boolean + logo?: boolean + createdAt?: boolean + activePlayers?: boolean + inactivePlayers?: boolean + leader?: boolean | Team$leaderArgs + members?: boolean | Team$membersArgs + invitations?: boolean | Team$invitationsArgs + matchPlayers?: boolean | Team$matchPlayersArgs + matchesAsTeamA?: boolean | Team$matchesAsTeamAArgs + matchesAsTeamB?: boolean | Team$matchesAsTeamBArgs + _count?: boolean | TeamCountOutputTypeDefaultArgs + }, ExtArgs["result"]["team"]> + + export type TeamSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + name?: boolean + leaderId?: boolean + logo?: boolean + createdAt?: boolean + activePlayers?: boolean + inactivePlayers?: boolean + leader?: boolean | Team$leaderArgs + }, ExtArgs["result"]["team"]> + + export type TeamSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + name?: boolean + leaderId?: boolean + logo?: boolean + createdAt?: boolean + activePlayers?: boolean + inactivePlayers?: boolean + leader?: boolean | Team$leaderArgs + }, ExtArgs["result"]["team"]> + + export type TeamSelectScalar = { + id?: boolean + name?: boolean + leaderId?: boolean + logo?: boolean + createdAt?: boolean + activePlayers?: boolean + inactivePlayers?: boolean + } + + export type TeamOmit = $Extensions.GetOmit<"id" | "name" | "leaderId" | "logo" | "createdAt" | "activePlayers" | "inactivePlayers", ExtArgs["result"]["team"]> + export type TeamInclude = { + leader?: boolean | Team$leaderArgs + members?: boolean | Team$membersArgs + invitations?: boolean | Team$invitationsArgs + matchPlayers?: boolean | Team$matchPlayersArgs + matchesAsTeamA?: boolean | Team$matchesAsTeamAArgs + matchesAsTeamB?: boolean | Team$matchesAsTeamBArgs + _count?: boolean | TeamCountOutputTypeDefaultArgs + } + export type TeamIncludeCreateManyAndReturn = { + leader?: boolean | Team$leaderArgs + } + export type TeamIncludeUpdateManyAndReturn = { + leader?: boolean | Team$leaderArgs + } + + export type $TeamPayload = { + name: "Team" + objects: { + leader: Prisma.$UserPayload | null + members: Prisma.$UserPayload[] + invitations: Prisma.$InvitationPayload[] + matchPlayers: Prisma.$MatchPlayerPayload[] + matchesAsTeamA: Prisma.$MatchPayload[] + matchesAsTeamB: Prisma.$MatchPayload[] + } + scalars: $Extensions.GetPayloadResult<{ + id: string + name: string + leaderId: string | null + logo: string | null + createdAt: Date + activePlayers: string[] + inactivePlayers: string[] + }, ExtArgs["result"]["team"]> + composites: {} + } + + type TeamGetPayload = $Result.GetResult + + type TeamCountArgs = + Omit & { + select?: TeamCountAggregateInputType | true + } + + export interface TeamDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Team'], meta: { name: 'Team' } } + /** + * Find zero or one Team that matches the filter. + * @param {TeamFindUniqueArgs} args - Arguments to find a Team + * @example + * // Get one Team + * const team = await prisma.team.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__TeamClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Team that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {TeamFindUniqueOrThrowArgs} args - Arguments to find a Team + * @example + * // Get one Team + * const team = await prisma.team.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__TeamClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Team 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 {TeamFindFirstArgs} args - Arguments to find a Team + * @example + * // Get one Team + * const team = await prisma.team.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__TeamClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Team 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 {TeamFindFirstOrThrowArgs} args - Arguments to find a Team + * @example + * // Get one Team + * const team = await prisma.team.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__TeamClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Teams 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 {TeamFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Teams + * const teams = await prisma.team.findMany() + * + * // Get first 10 Teams + * const teams = await prisma.team.findMany({ take: 10 }) + * + * // Only select the `id` + * const teamWithIdOnly = await prisma.team.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Team. + * @param {TeamCreateArgs} args - Arguments to create a Team. + * @example + * // Create one Team + * const Team = await prisma.team.create({ + * data: { + * // ... data to create a Team + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__TeamClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Teams. + * @param {TeamCreateManyArgs} args - Arguments to create many Teams. + * @example + * // Create many Teams + * const team = await prisma.team.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Teams and returns the data saved in the database. + * @param {TeamCreateManyAndReturnArgs} args - Arguments to create many Teams. + * @example + * // Create many Teams + * const team = await prisma.team.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Teams and only return the `id` + * const teamWithIdOnly = await prisma.team.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Team. + * @param {TeamDeleteArgs} args - Arguments to delete one Team. + * @example + * // Delete one Team + * const Team = await prisma.team.delete({ + * where: { + * // ... filter to delete one Team + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__TeamClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Team. + * @param {TeamUpdateArgs} args - Arguments to update one Team. + * @example + * // Update one Team + * const team = await prisma.team.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__TeamClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Teams. + * @param {TeamDeleteManyArgs} args - Arguments to filter Teams to delete. + * @example + * // Delete a few Teams + * const { count } = await prisma.team.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Teams. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TeamUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Teams + * const team = await prisma.team.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Teams and returns the data updated in the database. + * @param {TeamUpdateManyAndReturnArgs} args - Arguments to update many Teams. + * @example + * // Update many Teams + * const team = await prisma.team.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Teams and only return the `id` + * const teamWithIdOnly = await prisma.team.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Team. + * @param {TeamUpsertArgs} args - Arguments to update or create a Team. + * @example + * // Update or create a Team + * const team = await prisma.team.upsert({ + * create: { + * // ... data to create a Team + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Team we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__TeamClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Teams. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TeamCountArgs} args - Arguments to filter Teams to count. + * @example + * // Count the number of Teams + * const count = await prisma.team.count({ + * where: { + * // ... the filter for the Teams 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 Team. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TeamAggregateArgs} 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 Team. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TeamGroupByArgs} 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 TeamGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: TeamGroupByArgs['orderBy'] } + : { orderBy?: TeamGroupByArgs['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 ? GetTeamGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Team model + */ + readonly fields: TeamFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Team. + * 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__TeamClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + leader = {}>(args?: Subset>): Prisma__UserClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + members = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + invitations = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + matchPlayers = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + matchesAsTeamA = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + matchesAsTeamB = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | 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 Team model + */ + interface TeamFieldRefs { + readonly id: FieldRef<"Team", 'String'> + readonly name: FieldRef<"Team", 'String'> + readonly leaderId: FieldRef<"Team", 'String'> + readonly logo: FieldRef<"Team", 'String'> + readonly createdAt: FieldRef<"Team", 'DateTime'> + readonly activePlayers: FieldRef<"Team", 'String[]'> + readonly inactivePlayers: FieldRef<"Team", 'String[]'> + } + + + // Custom InputTypes + /** + * Team findUnique + */ + export type TeamFindUniqueArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * Filter, which Team to fetch. + */ + where: TeamWhereUniqueInput + } + + /** + * Team findUniqueOrThrow + */ + export type TeamFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * Filter, which Team to fetch. + */ + where: TeamWhereUniqueInput + } + + /** + * Team findFirst + */ + export type TeamFindFirstArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * Filter, which Team to fetch. + */ + where?: TeamWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Teams to fetch. + */ + orderBy?: TeamOrderByWithRelationInput | TeamOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Teams. + */ + cursor?: TeamWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Teams 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` Teams. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Teams. + */ + distinct?: TeamScalarFieldEnum | TeamScalarFieldEnum[] + } + + /** + * Team findFirstOrThrow + */ + export type TeamFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * Filter, which Team to fetch. + */ + where?: TeamWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Teams to fetch. + */ + orderBy?: TeamOrderByWithRelationInput | TeamOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Teams. + */ + cursor?: TeamWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Teams 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` Teams. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Teams. + */ + distinct?: TeamScalarFieldEnum | TeamScalarFieldEnum[] + } + + /** + * Team findMany + */ + export type TeamFindManyArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * Filter, which Teams to fetch. + */ + where?: TeamWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Teams to fetch. + */ + orderBy?: TeamOrderByWithRelationInput | TeamOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Teams. + */ + cursor?: TeamWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Teams 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` Teams. + */ + skip?: number + distinct?: TeamScalarFieldEnum | TeamScalarFieldEnum[] + } + + /** + * Team create + */ + export type TeamCreateArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * The data needed to create a Team. + */ + data: XOR + } + + /** + * Team createMany + */ + export type TeamCreateManyArgs = { + /** + * The data used to create many Teams. + */ + data: TeamCreateManyInput | TeamCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Team createManyAndReturn + */ + export type TeamCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * The data used to create many Teams. + */ + data: TeamCreateManyInput | TeamCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamIncludeCreateManyAndReturn | null + } + + /** + * Team update + */ + export type TeamUpdateArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * The data needed to update a Team. + */ + data: XOR + /** + * Choose, which Team to update. + */ + where: TeamWhereUniqueInput + } + + /** + * Team updateMany + */ + export type TeamUpdateManyArgs = { + /** + * The data used to update Teams. + */ + data: XOR + /** + * Filter which Teams to update + */ + where?: TeamWhereInput + /** + * Limit how many Teams to update. + */ + limit?: number + } + + /** + * Team updateManyAndReturn + */ + export type TeamUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * The data used to update Teams. + */ + data: XOR + /** + * Filter which Teams to update + */ + where?: TeamWhereInput + /** + * Limit how many Teams to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamIncludeUpdateManyAndReturn | null + } + + /** + * Team upsert + */ + export type TeamUpsertArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * The filter to search for the Team to update in case it exists. + */ + where: TeamWhereUniqueInput + /** + * In case the Team found by the `where` argument doesn't exist, create a new Team with this data. + */ + create: XOR + /** + * In case the Team was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Team delete + */ + export type TeamDeleteArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + /** + * Filter which Team to delete. + */ + where: TeamWhereUniqueInput + } + + /** + * Team deleteMany + */ + export type TeamDeleteManyArgs = { + /** + * Filter which Teams to delete + */ + where?: TeamWhereInput + /** + * Limit how many Teams to delete. + */ + limit?: number + } + + /** + * Team.leader + */ + export type Team$leaderArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + where?: UserWhereInput + } + + /** + * Team.members + */ + export type Team$membersArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserInclude | null + where?: UserWhereInput + orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] + cursor?: UserWhereUniqueInput + take?: number + skip?: number + distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] + } + + /** + * Team.invitations + */ + export type Team$invitationsArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + where?: InvitationWhereInput + orderBy?: InvitationOrderByWithRelationInput | InvitationOrderByWithRelationInput[] + cursor?: InvitationWhereUniqueInput + take?: number + skip?: number + distinct?: InvitationScalarFieldEnum | InvitationScalarFieldEnum[] + } + + /** + * Team.matchPlayers + */ + export type Team$matchPlayersArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + where?: MatchPlayerWhereInput + orderBy?: MatchPlayerOrderByWithRelationInput | MatchPlayerOrderByWithRelationInput[] + cursor?: MatchPlayerWhereUniqueInput + take?: number + skip?: number + distinct?: MatchPlayerScalarFieldEnum | MatchPlayerScalarFieldEnum[] + } + + /** + * Team.matchesAsTeamA + */ + export type Team$matchesAsTeamAArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + where?: MatchWhereInput + orderBy?: MatchOrderByWithRelationInput | MatchOrderByWithRelationInput[] + cursor?: MatchWhereUniqueInput + take?: number + skip?: number + distinct?: MatchScalarFieldEnum | MatchScalarFieldEnum[] + } + + /** + * Team.matchesAsTeamB + */ + export type Team$matchesAsTeamBArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + where?: MatchWhereInput + orderBy?: MatchOrderByWithRelationInput | MatchOrderByWithRelationInput[] + cursor?: MatchWhereUniqueInput + take?: number + skip?: number + distinct?: MatchScalarFieldEnum | MatchScalarFieldEnum[] + } + + /** + * Team without action + */ + export type TeamDefaultArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + } + + + /** + * Model Match + */ + + export type AggregateMatch = { + _count: MatchCountAggregateOutputType | null + _avg: MatchAvgAggregateOutputType | null + _sum: MatchSumAggregateOutputType | null + _min: MatchMinAggregateOutputType | null + _max: MatchMaxAggregateOutputType | null + } + + export type MatchAvgAggregateOutputType = { + matchId: number | null + scoreA: number | null + scoreB: number | null + } + + export type MatchSumAggregateOutputType = { + matchId: bigint | null + scoreA: number | null + scoreB: number | null + } + + export type MatchMinAggregateOutputType = { + matchId: bigint | null + teamAId: string | null + teamBId: string | null + matchDate: Date | null + matchType: string | null + map: string | null + title: string | null + description: string | null + demoFilePath: string | null + scoreA: number | null + scoreB: number | null + createdAt: Date | null + updatedAt: Date | null + } + + export type MatchMaxAggregateOutputType = { + matchId: bigint | null + teamAId: string | null + teamBId: string | null + matchDate: Date | null + matchType: string | null + map: string | null + title: string | null + description: string | null + demoFilePath: string | null + scoreA: number | null + scoreB: number | null + createdAt: Date | null + updatedAt: Date | null + } + + export type MatchCountAggregateOutputType = { + matchId: number + teamAId: number + teamBId: number + matchDate: number + matchType: number + map: number + title: number + description: number + demoData: number + demoFilePath: number + scoreA: number + scoreB: number + createdAt: number + updatedAt: number + _all: number + } + + + export type MatchAvgAggregateInputType = { + matchId?: true + scoreA?: true + scoreB?: true + } + + export type MatchSumAggregateInputType = { + matchId?: true + scoreA?: true + scoreB?: true + } + + export type MatchMinAggregateInputType = { + matchId?: true + teamAId?: true + teamBId?: true + matchDate?: true + matchType?: true + map?: true + title?: true + description?: true + demoFilePath?: true + scoreA?: true + scoreB?: true + createdAt?: true + updatedAt?: true + } + + export type MatchMaxAggregateInputType = { + matchId?: true + teamAId?: true + teamBId?: true + matchDate?: true + matchType?: true + map?: true + title?: true + description?: true + demoFilePath?: true + scoreA?: true + scoreB?: true + createdAt?: true + updatedAt?: true + } + + export type MatchCountAggregateInputType = { + matchId?: true + teamAId?: true + teamBId?: true + matchDate?: true + matchType?: true + map?: true + title?: true + description?: true + demoData?: true + demoFilePath?: true + scoreA?: true + scoreB?: true + createdAt?: true + updatedAt?: true + _all?: true + } + + export type MatchAggregateArgs = { + /** + * Filter which Match to aggregate. + */ + where?: MatchWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Matches to fetch. + */ + orderBy?: MatchOrderByWithRelationInput | MatchOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: MatchWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Matches 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` Matches. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Matches + **/ + _count?: true | MatchCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: MatchAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: MatchSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: MatchMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: MatchMaxAggregateInputType + } + + export type GetMatchAggregateType = { + [P in keyof T & keyof AggregateMatch]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type MatchGroupByArgs = { + where?: MatchWhereInput + orderBy?: MatchOrderByWithAggregationInput | MatchOrderByWithAggregationInput[] + by: MatchScalarFieldEnum[] | MatchScalarFieldEnum + having?: MatchScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: MatchCountAggregateInputType | true + _avg?: MatchAvgAggregateInputType + _sum?: MatchSumAggregateInputType + _min?: MatchMinAggregateInputType + _max?: MatchMaxAggregateInputType + } + + export type MatchGroupByOutputType = { + matchId: bigint + teamAId: string | null + teamBId: string | null + matchDate: Date + matchType: string + map: string | null + title: string + description: string | null + demoData: JsonValue | null + demoFilePath: string | null + scoreA: number | null + scoreB: number | null + createdAt: Date + updatedAt: Date + _count: MatchCountAggregateOutputType | null + _avg: MatchAvgAggregateOutputType | null + _sum: MatchSumAggregateOutputType | null + _min: MatchMinAggregateOutputType | null + _max: MatchMaxAggregateOutputType | null + } + + type GetMatchGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof MatchGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type MatchSelect = $Extensions.GetSelect<{ + matchId?: boolean + teamAId?: boolean + teamBId?: boolean + matchDate?: boolean + matchType?: boolean + map?: boolean + title?: boolean + description?: boolean + demoData?: boolean + demoFilePath?: boolean + scoreA?: boolean + scoreB?: boolean + createdAt?: boolean + updatedAt?: boolean + teamA?: boolean | Match$teamAArgs + teamB?: boolean | Match$teamBArgs + demoFile?: boolean | Match$demoFileArgs + players?: boolean | Match$playersArgs + rankUpdates?: boolean | Match$rankUpdatesArgs + _count?: boolean | MatchCountOutputTypeDefaultArgs + }, ExtArgs["result"]["match"]> + + export type MatchSelectCreateManyAndReturn = $Extensions.GetSelect<{ + matchId?: boolean + teamAId?: boolean + teamBId?: boolean + matchDate?: boolean + matchType?: boolean + map?: boolean + title?: boolean + description?: boolean + demoData?: boolean + demoFilePath?: boolean + scoreA?: boolean + scoreB?: boolean + createdAt?: boolean + updatedAt?: boolean + teamA?: boolean | Match$teamAArgs + teamB?: boolean | Match$teamBArgs + }, ExtArgs["result"]["match"]> + + export type MatchSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + matchId?: boolean + teamAId?: boolean + teamBId?: boolean + matchDate?: boolean + matchType?: boolean + map?: boolean + title?: boolean + description?: boolean + demoData?: boolean + demoFilePath?: boolean + scoreA?: boolean + scoreB?: boolean + createdAt?: boolean + updatedAt?: boolean + teamA?: boolean | Match$teamAArgs + teamB?: boolean | Match$teamBArgs + }, ExtArgs["result"]["match"]> + + export type MatchSelectScalar = { + matchId?: boolean + teamAId?: boolean + teamBId?: boolean + matchDate?: boolean + matchType?: boolean + map?: boolean + title?: boolean + description?: boolean + demoData?: boolean + demoFilePath?: boolean + scoreA?: boolean + scoreB?: boolean + createdAt?: boolean + updatedAt?: boolean + } + + export type MatchOmit = $Extensions.GetOmit<"matchId" | "teamAId" | "teamBId" | "matchDate" | "matchType" | "map" | "title" | "description" | "demoData" | "demoFilePath" | "scoreA" | "scoreB" | "createdAt" | "updatedAt", ExtArgs["result"]["match"]> + export type MatchInclude = { + teamA?: boolean | Match$teamAArgs + teamB?: boolean | Match$teamBArgs + demoFile?: boolean | Match$demoFileArgs + players?: boolean | Match$playersArgs + rankUpdates?: boolean | Match$rankUpdatesArgs + _count?: boolean | MatchCountOutputTypeDefaultArgs + } + export type MatchIncludeCreateManyAndReturn = { + teamA?: boolean | Match$teamAArgs + teamB?: boolean | Match$teamBArgs + } + export type MatchIncludeUpdateManyAndReturn = { + teamA?: boolean | Match$teamAArgs + teamB?: boolean | Match$teamBArgs + } + + export type $MatchPayload = { + name: "Match" + objects: { + teamA: Prisma.$TeamPayload | null + teamB: Prisma.$TeamPayload | null + demoFile: Prisma.$DemoFilePayload | null + players: Prisma.$MatchPlayerPayload[] + rankUpdates: Prisma.$PremierRankHistoryPayload[] + } + scalars: $Extensions.GetPayloadResult<{ + matchId: bigint + teamAId: string | null + teamBId: string | null + matchDate: Date + matchType: string + map: string | null + title: string + description: string | null + demoData: Prisma.JsonValue | null + demoFilePath: string | null + scoreA: number | null + scoreB: number | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["match"]> + composites: {} + } + + type MatchGetPayload = $Result.GetResult + + type MatchCountArgs = + Omit & { + select?: MatchCountAggregateInputType | true + } + + export interface MatchDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Match'], meta: { name: 'Match' } } + /** + * Find zero or one Match that matches the filter. + * @param {MatchFindUniqueArgs} args - Arguments to find a Match + * @example + * // Get one Match + * const match = await prisma.match.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__MatchClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Match that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {MatchFindUniqueOrThrowArgs} args - Arguments to find a Match + * @example + * // Get one Match + * const match = await prisma.match.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__MatchClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Match 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 {MatchFindFirstArgs} args - Arguments to find a Match + * @example + * // Get one Match + * const match = await prisma.match.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__MatchClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Match 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 {MatchFindFirstOrThrowArgs} args - Arguments to find a Match + * @example + * // Get one Match + * const match = await prisma.match.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__MatchClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Matches 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 {MatchFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Matches + * const matches = await prisma.match.findMany() + * + * // Get first 10 Matches + * const matches = await prisma.match.findMany({ take: 10 }) + * + * // Only select the `matchId` + * const matchWithMatchIdOnly = await prisma.match.findMany({ select: { matchId: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Match. + * @param {MatchCreateArgs} args - Arguments to create a Match. + * @example + * // Create one Match + * const Match = await prisma.match.create({ + * data: { + * // ... data to create a Match + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__MatchClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Matches. + * @param {MatchCreateManyArgs} args - Arguments to create many Matches. + * @example + * // Create many Matches + * const match = await prisma.match.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Matches and returns the data saved in the database. + * @param {MatchCreateManyAndReturnArgs} args - Arguments to create many Matches. + * @example + * // Create many Matches + * const match = await prisma.match.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Matches and only return the `matchId` + * const matchWithMatchIdOnly = await prisma.match.createManyAndReturn({ + * select: { matchId: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Match. + * @param {MatchDeleteArgs} args - Arguments to delete one Match. + * @example + * // Delete one Match + * const Match = await prisma.match.delete({ + * where: { + * // ... filter to delete one Match + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__MatchClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Match. + * @param {MatchUpdateArgs} args - Arguments to update one Match. + * @example + * // Update one Match + * const match = await prisma.match.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__MatchClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Matches. + * @param {MatchDeleteManyArgs} args - Arguments to filter Matches to delete. + * @example + * // Delete a few Matches + * const { count } = await prisma.match.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Matches. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Matches + * const match = await prisma.match.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Matches and returns the data updated in the database. + * @param {MatchUpdateManyAndReturnArgs} args - Arguments to update many Matches. + * @example + * // Update many Matches + * const match = await prisma.match.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Matches and only return the `matchId` + * const matchWithMatchIdOnly = await prisma.match.updateManyAndReturn({ + * select: { matchId: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Match. + * @param {MatchUpsertArgs} args - Arguments to update or create a Match. + * @example + * // Update or create a Match + * const match = await prisma.match.upsert({ + * create: { + * // ... data to create a Match + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Match we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__MatchClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Matches. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchCountArgs} args - Arguments to filter Matches to count. + * @example + * // Count the number of Matches + * const count = await prisma.match.count({ + * where: { + * // ... the filter for the Matches 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 Match. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchAggregateArgs} 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 Match. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchGroupByArgs} 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 MatchGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: MatchGroupByArgs['orderBy'] } + : { orderBy?: MatchGroupByArgs['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 ? GetMatchGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Match model + */ + readonly fields: MatchFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Match. + * 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__MatchClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + teamA = {}>(args?: Subset>): Prisma__TeamClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + teamB = {}>(args?: Subset>): Prisma__TeamClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + demoFile = {}>(args?: Subset>): Prisma__DemoFileClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + players = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | Null> + rankUpdates = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions> | 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 Match model + */ + interface MatchFieldRefs { + readonly matchId: FieldRef<"Match", 'BigInt'> + readonly teamAId: FieldRef<"Match", 'String'> + readonly teamBId: FieldRef<"Match", 'String'> + readonly matchDate: FieldRef<"Match", 'DateTime'> + readonly matchType: FieldRef<"Match", 'String'> + readonly map: FieldRef<"Match", 'String'> + readonly title: FieldRef<"Match", 'String'> + readonly description: FieldRef<"Match", 'String'> + readonly demoData: FieldRef<"Match", 'Json'> + readonly demoFilePath: FieldRef<"Match", 'String'> + readonly scoreA: FieldRef<"Match", 'Int'> + readonly scoreB: FieldRef<"Match", 'Int'> + readonly createdAt: FieldRef<"Match", 'DateTime'> + readonly updatedAt: FieldRef<"Match", 'DateTime'> + } + + + // Custom InputTypes + /** + * Match findUnique + */ + export type MatchFindUniqueArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * Filter, which Match to fetch. + */ + where: MatchWhereUniqueInput + } + + /** + * Match findUniqueOrThrow + */ + export type MatchFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * Filter, which Match to fetch. + */ + where: MatchWhereUniqueInput + } + + /** + * Match findFirst + */ + export type MatchFindFirstArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * Filter, which Match to fetch. + */ + where?: MatchWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Matches to fetch. + */ + orderBy?: MatchOrderByWithRelationInput | MatchOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Matches. + */ + cursor?: MatchWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Matches 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` Matches. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Matches. + */ + distinct?: MatchScalarFieldEnum | MatchScalarFieldEnum[] + } + + /** + * Match findFirstOrThrow + */ + export type MatchFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * Filter, which Match to fetch. + */ + where?: MatchWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Matches to fetch. + */ + orderBy?: MatchOrderByWithRelationInput | MatchOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Matches. + */ + cursor?: MatchWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Matches 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` Matches. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Matches. + */ + distinct?: MatchScalarFieldEnum | MatchScalarFieldEnum[] + } + + /** + * Match findMany + */ + export type MatchFindManyArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * Filter, which Matches to fetch. + */ + where?: MatchWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Matches to fetch. + */ + orderBy?: MatchOrderByWithRelationInput | MatchOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Matches. + */ + cursor?: MatchWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Matches 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` Matches. + */ + skip?: number + distinct?: MatchScalarFieldEnum | MatchScalarFieldEnum[] + } + + /** + * Match create + */ + export type MatchCreateArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * The data needed to create a Match. + */ + data: XOR + } + + /** + * Match createMany + */ + export type MatchCreateManyArgs = { + /** + * The data used to create many Matches. + */ + data: MatchCreateManyInput | MatchCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Match createManyAndReturn + */ + export type MatchCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * The data used to create many Matches. + */ + data: MatchCreateManyInput | MatchCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchIncludeCreateManyAndReturn | null + } + + /** + * Match update + */ + export type MatchUpdateArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * The data needed to update a Match. + */ + data: XOR + /** + * Choose, which Match to update. + */ + where: MatchWhereUniqueInput + } + + /** + * Match updateMany + */ + export type MatchUpdateManyArgs = { + /** + * The data used to update Matches. + */ + data: XOR + /** + * Filter which Matches to update + */ + where?: MatchWhereInput + /** + * Limit how many Matches to update. + */ + limit?: number + } + + /** + * Match updateManyAndReturn + */ + export type MatchUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * The data used to update Matches. + */ + data: XOR + /** + * Filter which Matches to update + */ + where?: MatchWhereInput + /** + * Limit how many Matches to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchIncludeUpdateManyAndReturn | null + } + + /** + * Match upsert + */ + export type MatchUpsertArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * The filter to search for the Match to update in case it exists. + */ + where: MatchWhereUniqueInput + /** + * In case the Match found by the `where` argument doesn't exist, create a new Match with this data. + */ + create: XOR + /** + * In case the Match was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Match delete + */ + export type MatchDeleteArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + /** + * Filter which Match to delete. + */ + where: MatchWhereUniqueInput + } + + /** + * Match deleteMany + */ + export type MatchDeleteManyArgs = { + /** + * Filter which Matches to delete + */ + where?: MatchWhereInput + /** + * Limit how many Matches to delete. + */ + limit?: number + } + + /** + * Match.teamA + */ + export type Match$teamAArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + where?: TeamWhereInput + } + + /** + * Match.teamB + */ + export type Match$teamBArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + where?: TeamWhereInput + } + + /** + * Match.demoFile + */ + export type Match$demoFileArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + where?: DemoFileWhereInput + } + + /** + * Match.players + */ + export type Match$playersArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + where?: MatchPlayerWhereInput + orderBy?: MatchPlayerOrderByWithRelationInput | MatchPlayerOrderByWithRelationInput[] + cursor?: MatchPlayerWhereUniqueInput + take?: number + skip?: number + distinct?: MatchPlayerScalarFieldEnum | MatchPlayerScalarFieldEnum[] + } + + /** + * Match.rankUpdates + */ + export type Match$rankUpdatesArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + where?: PremierRankHistoryWhereInput + orderBy?: PremierRankHistoryOrderByWithRelationInput | PremierRankHistoryOrderByWithRelationInput[] + cursor?: PremierRankHistoryWhereUniqueInput + take?: number + skip?: number + distinct?: PremierRankHistoryScalarFieldEnum | PremierRankHistoryScalarFieldEnum[] + } + + /** + * Match without action + */ + export type MatchDefaultArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + } + + + /** + * Model MatchPlayer + */ + + export type AggregateMatchPlayer = { + _count: MatchPlayerCountAggregateOutputType | null + _avg: MatchPlayerAvgAggregateOutputType | null + _sum: MatchPlayerSumAggregateOutputType | null + _min: MatchPlayerMinAggregateOutputType | null + _max: MatchPlayerMaxAggregateOutputType | null + } + + export type MatchPlayerAvgAggregateOutputType = { + matchId: number | null + } + + export type MatchPlayerSumAggregateOutputType = { + matchId: bigint | null + } + + export type MatchPlayerMinAggregateOutputType = { + id: string | null + matchId: bigint | null + steamId: string | null + teamId: string | null + createdAt: Date | null + } + + export type MatchPlayerMaxAggregateOutputType = { + id: string | null + matchId: bigint | null + steamId: string | null + teamId: string | null + createdAt: Date | null + } + + export type MatchPlayerCountAggregateOutputType = { + id: number + matchId: number + steamId: number + teamId: number + createdAt: number + _all: number + } + + + export type MatchPlayerAvgAggregateInputType = { + matchId?: true + } + + export type MatchPlayerSumAggregateInputType = { + matchId?: true + } + + export type MatchPlayerMinAggregateInputType = { + id?: true + matchId?: true + steamId?: true + teamId?: true + createdAt?: true + } + + export type MatchPlayerMaxAggregateInputType = { + id?: true + matchId?: true + steamId?: true + teamId?: true + createdAt?: true + } + + export type MatchPlayerCountAggregateInputType = { + id?: true + matchId?: true + steamId?: true + teamId?: true + createdAt?: true + _all?: true + } + + export type MatchPlayerAggregateArgs = { + /** + * Filter which MatchPlayer to aggregate. + */ + where?: MatchPlayerWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MatchPlayers to fetch. + */ + orderBy?: MatchPlayerOrderByWithRelationInput | MatchPlayerOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: MatchPlayerWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MatchPlayers 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` MatchPlayers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned MatchPlayers + **/ + _count?: true | MatchPlayerCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: MatchPlayerAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: MatchPlayerSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: MatchPlayerMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: MatchPlayerMaxAggregateInputType + } + + export type GetMatchPlayerAggregateType = { + [P in keyof T & keyof AggregateMatchPlayer]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type MatchPlayerGroupByArgs = { + where?: MatchPlayerWhereInput + orderBy?: MatchPlayerOrderByWithAggregationInput | MatchPlayerOrderByWithAggregationInput[] + by: MatchPlayerScalarFieldEnum[] | MatchPlayerScalarFieldEnum + having?: MatchPlayerScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: MatchPlayerCountAggregateInputType | true + _avg?: MatchPlayerAvgAggregateInputType + _sum?: MatchPlayerSumAggregateInputType + _min?: MatchPlayerMinAggregateInputType + _max?: MatchPlayerMaxAggregateInputType + } + + export type MatchPlayerGroupByOutputType = { + id: string + matchId: bigint + steamId: string + teamId: string | null + createdAt: Date + _count: MatchPlayerCountAggregateOutputType | null + _avg: MatchPlayerAvgAggregateOutputType | null + _sum: MatchPlayerSumAggregateOutputType | null + _min: MatchPlayerMinAggregateOutputType | null + _max: MatchPlayerMaxAggregateOutputType | null + } + + type GetMatchPlayerGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof MatchPlayerGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type MatchPlayerSelect = $Extensions.GetSelect<{ + id?: boolean + matchId?: boolean + steamId?: boolean + teamId?: boolean + createdAt?: boolean + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + team?: boolean | MatchPlayer$teamArgs + stats?: boolean | MatchPlayer$statsArgs + }, ExtArgs["result"]["matchPlayer"]> + + export type MatchPlayerSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + matchId?: boolean + steamId?: boolean + teamId?: boolean + createdAt?: boolean + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + team?: boolean | MatchPlayer$teamArgs + }, ExtArgs["result"]["matchPlayer"]> + + export type MatchPlayerSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + matchId?: boolean + steamId?: boolean + teamId?: boolean + createdAt?: boolean + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + team?: boolean | MatchPlayer$teamArgs + }, ExtArgs["result"]["matchPlayer"]> + + export type MatchPlayerSelectScalar = { + id?: boolean + matchId?: boolean + steamId?: boolean + teamId?: boolean + createdAt?: boolean + } + + export type MatchPlayerOmit = $Extensions.GetOmit<"id" | "matchId" | "steamId" | "teamId" | "createdAt", ExtArgs["result"]["matchPlayer"]> + export type MatchPlayerInclude = { + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + team?: boolean | MatchPlayer$teamArgs + stats?: boolean | MatchPlayer$statsArgs + } + export type MatchPlayerIncludeCreateManyAndReturn = { + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + team?: boolean | MatchPlayer$teamArgs + } + export type MatchPlayerIncludeUpdateManyAndReturn = { + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + team?: boolean | MatchPlayer$teamArgs + } + + export type $MatchPlayerPayload = { + name: "MatchPlayer" + objects: { + match: Prisma.$MatchPayload + user: Prisma.$UserPayload + team: Prisma.$TeamPayload | null + stats: Prisma.$MatchPlayerStatsPayload | null + } + scalars: $Extensions.GetPayloadResult<{ + id: string + matchId: bigint + steamId: string + teamId: string | null + createdAt: Date + }, ExtArgs["result"]["matchPlayer"]> + composites: {} + } + + type MatchPlayerGetPayload = $Result.GetResult + + type MatchPlayerCountArgs = + Omit & { + select?: MatchPlayerCountAggregateInputType | true + } + + export interface MatchPlayerDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['MatchPlayer'], meta: { name: 'MatchPlayer' } } + /** + * Find zero or one MatchPlayer that matches the filter. + * @param {MatchPlayerFindUniqueArgs} args - Arguments to find a MatchPlayer + * @example + * // Get one MatchPlayer + * const matchPlayer = await prisma.matchPlayer.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one MatchPlayer that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {MatchPlayerFindUniqueOrThrowArgs} args - Arguments to find a MatchPlayer + * @example + * // Get one MatchPlayer + * const matchPlayer = await prisma.matchPlayer.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first MatchPlayer 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 {MatchPlayerFindFirstArgs} args - Arguments to find a MatchPlayer + * @example + * // Get one MatchPlayer + * const matchPlayer = await prisma.matchPlayer.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first MatchPlayer 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 {MatchPlayerFindFirstOrThrowArgs} args - Arguments to find a MatchPlayer + * @example + * // Get one MatchPlayer + * const matchPlayer = await prisma.matchPlayer.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more MatchPlayers 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 {MatchPlayerFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all MatchPlayers + * const matchPlayers = await prisma.matchPlayer.findMany() + * + * // Get first 10 MatchPlayers + * const matchPlayers = await prisma.matchPlayer.findMany({ take: 10 }) + * + * // Only select the `id` + * const matchPlayerWithIdOnly = await prisma.matchPlayer.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a MatchPlayer. + * @param {MatchPlayerCreateArgs} args - Arguments to create a MatchPlayer. + * @example + * // Create one MatchPlayer + * const MatchPlayer = await prisma.matchPlayer.create({ + * data: { + * // ... data to create a MatchPlayer + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many MatchPlayers. + * @param {MatchPlayerCreateManyArgs} args - Arguments to create many MatchPlayers. + * @example + * // Create many MatchPlayers + * const matchPlayer = await prisma.matchPlayer.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many MatchPlayers and returns the data saved in the database. + * @param {MatchPlayerCreateManyAndReturnArgs} args - Arguments to create many MatchPlayers. + * @example + * // Create many MatchPlayers + * const matchPlayer = await prisma.matchPlayer.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many MatchPlayers and only return the `id` + * const matchPlayerWithIdOnly = await prisma.matchPlayer.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a MatchPlayer. + * @param {MatchPlayerDeleteArgs} args - Arguments to delete one MatchPlayer. + * @example + * // Delete one MatchPlayer + * const MatchPlayer = await prisma.matchPlayer.delete({ + * where: { + * // ... filter to delete one MatchPlayer + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one MatchPlayer. + * @param {MatchPlayerUpdateArgs} args - Arguments to update one MatchPlayer. + * @example + * // Update one MatchPlayer + * const matchPlayer = await prisma.matchPlayer.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more MatchPlayers. + * @param {MatchPlayerDeleteManyArgs} args - Arguments to filter MatchPlayers to delete. + * @example + * // Delete a few MatchPlayers + * const { count } = await prisma.matchPlayer.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more MatchPlayers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchPlayerUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many MatchPlayers + * const matchPlayer = await prisma.matchPlayer.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more MatchPlayers and returns the data updated in the database. + * @param {MatchPlayerUpdateManyAndReturnArgs} args - Arguments to update many MatchPlayers. + * @example + * // Update many MatchPlayers + * const matchPlayer = await prisma.matchPlayer.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more MatchPlayers and only return the `id` + * const matchPlayerWithIdOnly = await prisma.matchPlayer.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one MatchPlayer. + * @param {MatchPlayerUpsertArgs} args - Arguments to update or create a MatchPlayer. + * @example + * // Update or create a MatchPlayer + * const matchPlayer = await prisma.matchPlayer.upsert({ + * create: { + * // ... data to create a MatchPlayer + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the MatchPlayer we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of MatchPlayers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchPlayerCountArgs} args - Arguments to filter MatchPlayers to count. + * @example + * // Count the number of MatchPlayers + * const count = await prisma.matchPlayer.count({ + * where: { + * // ... the filter for the MatchPlayers 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 MatchPlayer. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchPlayerAggregateArgs} 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 MatchPlayer. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchPlayerGroupByArgs} 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 MatchPlayerGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: MatchPlayerGroupByArgs['orderBy'] } + : { orderBy?: MatchPlayerGroupByArgs['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 ? GetMatchPlayerGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the MatchPlayer model + */ + readonly fields: MatchPlayerFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for MatchPlayer. + * 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__MatchPlayerClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + match = {}>(args?: Subset>): Prisma__MatchClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + user = {}>(args?: Subset>): Prisma__UserClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + team = {}>(args?: Subset>): Prisma__TeamClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + stats = {}>(args?: Subset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + /** + * 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 MatchPlayer model + */ + interface MatchPlayerFieldRefs { + readonly id: FieldRef<"MatchPlayer", 'String'> + readonly matchId: FieldRef<"MatchPlayer", 'BigInt'> + readonly steamId: FieldRef<"MatchPlayer", 'String'> + readonly teamId: FieldRef<"MatchPlayer", 'String'> + readonly createdAt: FieldRef<"MatchPlayer", 'DateTime'> + } + + + // Custom InputTypes + /** + * MatchPlayer findUnique + */ + export type MatchPlayerFindUniqueArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * Filter, which MatchPlayer to fetch. + */ + where: MatchPlayerWhereUniqueInput + } + + /** + * MatchPlayer findUniqueOrThrow + */ + export type MatchPlayerFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * Filter, which MatchPlayer to fetch. + */ + where: MatchPlayerWhereUniqueInput + } + + /** + * MatchPlayer findFirst + */ + export type MatchPlayerFindFirstArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * Filter, which MatchPlayer to fetch. + */ + where?: MatchPlayerWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MatchPlayers to fetch. + */ + orderBy?: MatchPlayerOrderByWithRelationInput | MatchPlayerOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for MatchPlayers. + */ + cursor?: MatchPlayerWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MatchPlayers 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` MatchPlayers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of MatchPlayers. + */ + distinct?: MatchPlayerScalarFieldEnum | MatchPlayerScalarFieldEnum[] + } + + /** + * MatchPlayer findFirstOrThrow + */ + export type MatchPlayerFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * Filter, which MatchPlayer to fetch. + */ + where?: MatchPlayerWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MatchPlayers to fetch. + */ + orderBy?: MatchPlayerOrderByWithRelationInput | MatchPlayerOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for MatchPlayers. + */ + cursor?: MatchPlayerWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MatchPlayers 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` MatchPlayers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of MatchPlayers. + */ + distinct?: MatchPlayerScalarFieldEnum | MatchPlayerScalarFieldEnum[] + } + + /** + * MatchPlayer findMany + */ + export type MatchPlayerFindManyArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * Filter, which MatchPlayers to fetch. + */ + where?: MatchPlayerWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MatchPlayers to fetch. + */ + orderBy?: MatchPlayerOrderByWithRelationInput | MatchPlayerOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing MatchPlayers. + */ + cursor?: MatchPlayerWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MatchPlayers 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` MatchPlayers. + */ + skip?: number + distinct?: MatchPlayerScalarFieldEnum | MatchPlayerScalarFieldEnum[] + } + + /** + * MatchPlayer create + */ + export type MatchPlayerCreateArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * The data needed to create a MatchPlayer. + */ + data: XOR + } + + /** + * MatchPlayer createMany + */ + export type MatchPlayerCreateManyArgs = { + /** + * The data used to create many MatchPlayers. + */ + data: MatchPlayerCreateManyInput | MatchPlayerCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * MatchPlayer createManyAndReturn + */ + export type MatchPlayerCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelectCreateManyAndReturn | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * The data used to create many MatchPlayers. + */ + data: MatchPlayerCreateManyInput | MatchPlayerCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerIncludeCreateManyAndReturn | null + } + + /** + * MatchPlayer update + */ + export type MatchPlayerUpdateArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * The data needed to update a MatchPlayer. + */ + data: XOR + /** + * Choose, which MatchPlayer to update. + */ + where: MatchPlayerWhereUniqueInput + } + + /** + * MatchPlayer updateMany + */ + export type MatchPlayerUpdateManyArgs = { + /** + * The data used to update MatchPlayers. + */ + data: XOR + /** + * Filter which MatchPlayers to update + */ + where?: MatchPlayerWhereInput + /** + * Limit how many MatchPlayers to update. + */ + limit?: number + } + + /** + * MatchPlayer updateManyAndReturn + */ + export type MatchPlayerUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * The data used to update MatchPlayers. + */ + data: XOR + /** + * Filter which MatchPlayers to update + */ + where?: MatchPlayerWhereInput + /** + * Limit how many MatchPlayers to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerIncludeUpdateManyAndReturn | null + } + + /** + * MatchPlayer upsert + */ + export type MatchPlayerUpsertArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * The filter to search for the MatchPlayer to update in case it exists. + */ + where: MatchPlayerWhereUniqueInput + /** + * In case the MatchPlayer found by the `where` argument doesn't exist, create a new MatchPlayer with this data. + */ + create: XOR + /** + * In case the MatchPlayer was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * MatchPlayer delete + */ + export type MatchPlayerDeleteArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + /** + * Filter which MatchPlayer to delete. + */ + where: MatchPlayerWhereUniqueInput + } + + /** + * MatchPlayer deleteMany + */ + export type MatchPlayerDeleteManyArgs = { + /** + * Filter which MatchPlayers to delete + */ + where?: MatchPlayerWhereInput + /** + * Limit how many MatchPlayers to delete. + */ + limit?: number + } + + /** + * MatchPlayer.team + */ + export type MatchPlayer$teamArgs = { + /** + * Select specific fields to fetch from the Team + */ + select?: TeamSelect | null + /** + * Omit specific fields from the Team + */ + omit?: TeamOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: TeamInclude | null + where?: TeamWhereInput + } + + /** + * MatchPlayer.stats + */ + export type MatchPlayer$statsArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + where?: MatchPlayerStatsWhereInput + } + + /** + * MatchPlayer without action + */ + export type MatchPlayerDefaultArgs = { + /** + * Select specific fields to fetch from the MatchPlayer + */ + select?: MatchPlayerSelect | null + /** + * Omit specific fields from the MatchPlayer + */ + omit?: MatchPlayerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerInclude | null + } + + + /** + * Model MatchPlayerStats + */ + + export type AggregateMatchPlayerStats = { + _count: MatchPlayerStatsCountAggregateOutputType | null + _avg: MatchPlayerStatsAvgAggregateOutputType | null + _sum: MatchPlayerStatsSumAggregateOutputType | null + _min: MatchPlayerStatsMinAggregateOutputType | null + _max: MatchPlayerStatsMaxAggregateOutputType | null + } + + export type MatchPlayerStatsAvgAggregateOutputType = { + kills: number | null + assists: number | null + deaths: number | null + adr: number | null + headshotPct: number | null + flashAssists: number | null + mvps: number | null + mvpEliminations: number | null + mvpDefuse: number | null + mvpPlant: number | null + knifeKills: number | null + zeusKills: number | null + wallbangKills: number | null + smokeKills: number | null + headshots: number | null + noScopes: number | null + blindKills: number | null + rankOld: number | null + rankNew: number | null + winCount: number | null + } + + export type MatchPlayerStatsSumAggregateOutputType = { + kills: number | null + assists: number | null + deaths: number | null + adr: number | null + headshotPct: number | null + flashAssists: number | null + mvps: number | null + mvpEliminations: number | null + mvpDefuse: number | null + mvpPlant: number | null + knifeKills: number | null + zeusKills: number | null + wallbangKills: number | null + smokeKills: number | null + headshots: number | null + noScopes: number | null + blindKills: number | null + rankOld: number | null + rankNew: number | null + winCount: number | null + } + + export type MatchPlayerStatsMinAggregateOutputType = { + id: string | null + matchPlayerId: string | null + kills: number | null + assists: number | null + deaths: number | null + adr: number | null + headshotPct: number | null + flashAssists: number | null + mvps: number | null + mvpEliminations: number | null + mvpDefuse: number | null + mvpPlant: number | null + knifeKills: number | null + zeusKills: number | null + wallbangKills: number | null + smokeKills: number | null + headshots: number | null + noScopes: number | null + blindKills: number | null + rankOld: number | null + rankNew: number | null + winCount: number | null + } + + export type MatchPlayerStatsMaxAggregateOutputType = { + id: string | null + matchPlayerId: string | null + kills: number | null + assists: number | null + deaths: number | null + adr: number | null + headshotPct: number | null + flashAssists: number | null + mvps: number | null + mvpEliminations: number | null + mvpDefuse: number | null + mvpPlant: number | null + knifeKills: number | null + zeusKills: number | null + wallbangKills: number | null + smokeKills: number | null + headshots: number | null + noScopes: number | null + blindKills: number | null + rankOld: number | null + rankNew: number | null + winCount: number | null + } + + export type MatchPlayerStatsCountAggregateOutputType = { + id: number + matchPlayerId: number + kills: number + assists: number + deaths: number + adr: number + headshotPct: number + flashAssists: number + mvps: number + mvpEliminations: number + mvpDefuse: number + mvpPlant: number + knifeKills: number + zeusKills: number + wallbangKills: number + smokeKills: number + headshots: number + noScopes: number + blindKills: number + rankOld: number + rankNew: number + winCount: number + _all: number + } + + + export type MatchPlayerStatsAvgAggregateInputType = { + kills?: true + assists?: true + deaths?: true + adr?: true + headshotPct?: true + flashAssists?: true + mvps?: true + mvpEliminations?: true + mvpDefuse?: true + mvpPlant?: true + knifeKills?: true + zeusKills?: true + wallbangKills?: true + smokeKills?: true + headshots?: true + noScopes?: true + blindKills?: true + rankOld?: true + rankNew?: true + winCount?: true + } + + export type MatchPlayerStatsSumAggregateInputType = { + kills?: true + assists?: true + deaths?: true + adr?: true + headshotPct?: true + flashAssists?: true + mvps?: true + mvpEliminations?: true + mvpDefuse?: true + mvpPlant?: true + knifeKills?: true + zeusKills?: true + wallbangKills?: true + smokeKills?: true + headshots?: true + noScopes?: true + blindKills?: true + rankOld?: true + rankNew?: true + winCount?: true + } + + export type MatchPlayerStatsMinAggregateInputType = { + id?: true + matchPlayerId?: true + kills?: true + assists?: true + deaths?: true + adr?: true + headshotPct?: true + flashAssists?: true + mvps?: true + mvpEliminations?: true + mvpDefuse?: true + mvpPlant?: true + knifeKills?: true + zeusKills?: true + wallbangKills?: true + smokeKills?: true + headshots?: true + noScopes?: true + blindKills?: true + rankOld?: true + rankNew?: true + winCount?: true + } + + export type MatchPlayerStatsMaxAggregateInputType = { + id?: true + matchPlayerId?: true + kills?: true + assists?: true + deaths?: true + adr?: true + headshotPct?: true + flashAssists?: true + mvps?: true + mvpEliminations?: true + mvpDefuse?: true + mvpPlant?: true + knifeKills?: true + zeusKills?: true + wallbangKills?: true + smokeKills?: true + headshots?: true + noScopes?: true + blindKills?: true + rankOld?: true + rankNew?: true + winCount?: true + } + + export type MatchPlayerStatsCountAggregateInputType = { + id?: true + matchPlayerId?: true + kills?: true + assists?: true + deaths?: true + adr?: true + headshotPct?: true + flashAssists?: true + mvps?: true + mvpEliminations?: true + mvpDefuse?: true + mvpPlant?: true + knifeKills?: true + zeusKills?: true + wallbangKills?: true + smokeKills?: true + headshots?: true + noScopes?: true + blindKills?: true + rankOld?: true + rankNew?: true + winCount?: true + _all?: true + } + + export type MatchPlayerStatsAggregateArgs = { + /** + * Filter which MatchPlayerStats to aggregate. + */ + where?: MatchPlayerStatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MatchPlayerStats to fetch. + */ + orderBy?: MatchPlayerStatsOrderByWithRelationInput | MatchPlayerStatsOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: MatchPlayerStatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MatchPlayerStats 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` MatchPlayerStats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned MatchPlayerStats + **/ + _count?: true | MatchPlayerStatsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: MatchPlayerStatsAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: MatchPlayerStatsSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: MatchPlayerStatsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: MatchPlayerStatsMaxAggregateInputType + } + + export type GetMatchPlayerStatsAggregateType = { + [P in keyof T & keyof AggregateMatchPlayerStats]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type MatchPlayerStatsGroupByArgs = { + where?: MatchPlayerStatsWhereInput + orderBy?: MatchPlayerStatsOrderByWithAggregationInput | MatchPlayerStatsOrderByWithAggregationInput[] + by: MatchPlayerStatsScalarFieldEnum[] | MatchPlayerStatsScalarFieldEnum + having?: MatchPlayerStatsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: MatchPlayerStatsCountAggregateInputType | true + _avg?: MatchPlayerStatsAvgAggregateInputType + _sum?: MatchPlayerStatsSumAggregateInputType + _min?: MatchPlayerStatsMinAggregateInputType + _max?: MatchPlayerStatsMaxAggregateInputType + } + + export type MatchPlayerStatsGroupByOutputType = { + id: string + matchPlayerId: string + kills: number + assists: number + deaths: number + adr: number + headshotPct: number + flashAssists: number + mvps: number + mvpEliminations: number + mvpDefuse: number + mvpPlant: number + knifeKills: number + zeusKills: number + wallbangKills: number + smokeKills: number + headshots: number + noScopes: number + blindKills: number + rankOld: number | null + rankNew: number | null + winCount: number | null + _count: MatchPlayerStatsCountAggregateOutputType | null + _avg: MatchPlayerStatsAvgAggregateOutputType | null + _sum: MatchPlayerStatsSumAggregateOutputType | null + _min: MatchPlayerStatsMinAggregateOutputType | null + _max: MatchPlayerStatsMaxAggregateOutputType | null + } + + type GetMatchPlayerStatsGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof MatchPlayerStatsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type MatchPlayerStatsSelect = $Extensions.GetSelect<{ + id?: boolean + matchPlayerId?: boolean + kills?: boolean + assists?: boolean + deaths?: boolean + adr?: boolean + headshotPct?: boolean + flashAssists?: boolean + mvps?: boolean + mvpEliminations?: boolean + mvpDefuse?: boolean + mvpPlant?: boolean + knifeKills?: boolean + zeusKills?: boolean + wallbangKills?: boolean + smokeKills?: boolean + headshots?: boolean + noScopes?: boolean + blindKills?: boolean + rankOld?: boolean + rankNew?: boolean + winCount?: boolean + matchPlayer?: boolean | MatchPlayerDefaultArgs + }, ExtArgs["result"]["matchPlayerStats"]> + + export type MatchPlayerStatsSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + matchPlayerId?: boolean + kills?: boolean + assists?: boolean + deaths?: boolean + adr?: boolean + headshotPct?: boolean + flashAssists?: boolean + mvps?: boolean + mvpEliminations?: boolean + mvpDefuse?: boolean + mvpPlant?: boolean + knifeKills?: boolean + zeusKills?: boolean + wallbangKills?: boolean + smokeKills?: boolean + headshots?: boolean + noScopes?: boolean + blindKills?: boolean + rankOld?: boolean + rankNew?: boolean + winCount?: boolean + matchPlayer?: boolean | MatchPlayerDefaultArgs + }, ExtArgs["result"]["matchPlayerStats"]> + + export type MatchPlayerStatsSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + matchPlayerId?: boolean + kills?: boolean + assists?: boolean + deaths?: boolean + adr?: boolean + headshotPct?: boolean + flashAssists?: boolean + mvps?: boolean + mvpEliminations?: boolean + mvpDefuse?: boolean + mvpPlant?: boolean + knifeKills?: boolean + zeusKills?: boolean + wallbangKills?: boolean + smokeKills?: boolean + headshots?: boolean + noScopes?: boolean + blindKills?: boolean + rankOld?: boolean + rankNew?: boolean + winCount?: boolean + matchPlayer?: boolean | MatchPlayerDefaultArgs + }, ExtArgs["result"]["matchPlayerStats"]> + + export type MatchPlayerStatsSelectScalar = { + id?: boolean + matchPlayerId?: boolean + kills?: boolean + assists?: boolean + deaths?: boolean + adr?: boolean + headshotPct?: boolean + flashAssists?: boolean + mvps?: boolean + mvpEliminations?: boolean + mvpDefuse?: boolean + mvpPlant?: boolean + knifeKills?: boolean + zeusKills?: boolean + wallbangKills?: boolean + smokeKills?: boolean + headshots?: boolean + noScopes?: boolean + blindKills?: boolean + rankOld?: boolean + rankNew?: boolean + winCount?: boolean + } + + export type MatchPlayerStatsOmit = $Extensions.GetOmit<"id" | "matchPlayerId" | "kills" | "assists" | "deaths" | "adr" | "headshotPct" | "flashAssists" | "mvps" | "mvpEliminations" | "mvpDefuse" | "mvpPlant" | "knifeKills" | "zeusKills" | "wallbangKills" | "smokeKills" | "headshots" | "noScopes" | "blindKills" | "rankOld" | "rankNew" | "winCount", ExtArgs["result"]["matchPlayerStats"]> + export type MatchPlayerStatsInclude = { + matchPlayer?: boolean | MatchPlayerDefaultArgs + } + export type MatchPlayerStatsIncludeCreateManyAndReturn = { + matchPlayer?: boolean | MatchPlayerDefaultArgs + } + export type MatchPlayerStatsIncludeUpdateManyAndReturn = { + matchPlayer?: boolean | MatchPlayerDefaultArgs + } + + export type $MatchPlayerStatsPayload = { + name: "MatchPlayerStats" + objects: { + matchPlayer: Prisma.$MatchPlayerPayload + } + scalars: $Extensions.GetPayloadResult<{ + id: string + matchPlayerId: string + kills: number + assists: number + deaths: number + adr: number + headshotPct: number + flashAssists: number + mvps: number + mvpEliminations: number + mvpDefuse: number + mvpPlant: number + knifeKills: number + zeusKills: number + wallbangKills: number + smokeKills: number + headshots: number + noScopes: number + blindKills: number + rankOld: number | null + rankNew: number | null + winCount: number | null + }, ExtArgs["result"]["matchPlayerStats"]> + composites: {} + } + + type MatchPlayerStatsGetPayload = $Result.GetResult + + type MatchPlayerStatsCountArgs = + Omit & { + select?: MatchPlayerStatsCountAggregateInputType | true + } + + export interface MatchPlayerStatsDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['MatchPlayerStats'], meta: { name: 'MatchPlayerStats' } } + /** + * Find zero or one MatchPlayerStats that matches the filter. + * @param {MatchPlayerStatsFindUniqueArgs} args - Arguments to find a MatchPlayerStats + * @example + * // Get one MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one MatchPlayerStats that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {MatchPlayerStatsFindUniqueOrThrowArgs} args - Arguments to find a MatchPlayerStats + * @example + * // Get one MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first MatchPlayerStats 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 {MatchPlayerStatsFindFirstArgs} args - Arguments to find a MatchPlayerStats + * @example + * // Get one MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first MatchPlayerStats 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 {MatchPlayerStatsFindFirstOrThrowArgs} args - Arguments to find a MatchPlayerStats + * @example + * // Get one MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more MatchPlayerStats 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 {MatchPlayerStatsFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.findMany() + * + * // Get first 10 MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.findMany({ take: 10 }) + * + * // Only select the `id` + * const matchPlayerStatsWithIdOnly = await prisma.matchPlayerStats.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a MatchPlayerStats. + * @param {MatchPlayerStatsCreateArgs} args - Arguments to create a MatchPlayerStats. + * @example + * // Create one MatchPlayerStats + * const MatchPlayerStats = await prisma.matchPlayerStats.create({ + * data: { + * // ... data to create a MatchPlayerStats + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many MatchPlayerStats. + * @param {MatchPlayerStatsCreateManyArgs} args - Arguments to create many MatchPlayerStats. + * @example + * // Create many MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many MatchPlayerStats and returns the data saved in the database. + * @param {MatchPlayerStatsCreateManyAndReturnArgs} args - Arguments to create many MatchPlayerStats. + * @example + * // Create many MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many MatchPlayerStats and only return the `id` + * const matchPlayerStatsWithIdOnly = await prisma.matchPlayerStats.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a MatchPlayerStats. + * @param {MatchPlayerStatsDeleteArgs} args - Arguments to delete one MatchPlayerStats. + * @example + * // Delete one MatchPlayerStats + * const MatchPlayerStats = await prisma.matchPlayerStats.delete({ + * where: { + * // ... filter to delete one MatchPlayerStats + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one MatchPlayerStats. + * @param {MatchPlayerStatsUpdateArgs} args - Arguments to update one MatchPlayerStats. + * @example + * // Update one MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more MatchPlayerStats. + * @param {MatchPlayerStatsDeleteManyArgs} args - Arguments to filter MatchPlayerStats to delete. + * @example + * // Delete a few MatchPlayerStats + * const { count } = await prisma.matchPlayerStats.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more MatchPlayerStats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchPlayerStatsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more MatchPlayerStats and returns the data updated in the database. + * @param {MatchPlayerStatsUpdateManyAndReturnArgs} args - Arguments to update many MatchPlayerStats. + * @example + * // Update many MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more MatchPlayerStats and only return the `id` + * const matchPlayerStatsWithIdOnly = await prisma.matchPlayerStats.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one MatchPlayerStats. + * @param {MatchPlayerStatsUpsertArgs} args - Arguments to update or create a MatchPlayerStats. + * @example + * // Update or create a MatchPlayerStats + * const matchPlayerStats = await prisma.matchPlayerStats.upsert({ + * create: { + * // ... data to create a MatchPlayerStats + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the MatchPlayerStats we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__MatchPlayerStatsClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of MatchPlayerStats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchPlayerStatsCountArgs} args - Arguments to filter MatchPlayerStats to count. + * @example + * // Count the number of MatchPlayerStats + * const count = await prisma.matchPlayerStats.count({ + * where: { + * // ... the filter for the MatchPlayerStats 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 MatchPlayerStats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchPlayerStatsAggregateArgs} 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 MatchPlayerStats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {MatchPlayerStatsGroupByArgs} 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 MatchPlayerStatsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: MatchPlayerStatsGroupByArgs['orderBy'] } + : { orderBy?: MatchPlayerStatsGroupByArgs['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 ? GetMatchPlayerStatsGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the MatchPlayerStats model + */ + readonly fields: MatchPlayerStatsFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for MatchPlayerStats. + * 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__MatchPlayerStatsClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + matchPlayer = {}>(args?: Subset>): Prisma__MatchPlayerClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * 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 MatchPlayerStats model + */ + interface MatchPlayerStatsFieldRefs { + readonly id: FieldRef<"MatchPlayerStats", 'String'> + readonly matchPlayerId: FieldRef<"MatchPlayerStats", 'String'> + readonly kills: FieldRef<"MatchPlayerStats", 'Int'> + readonly assists: FieldRef<"MatchPlayerStats", 'Int'> + readonly deaths: FieldRef<"MatchPlayerStats", 'Int'> + readonly adr: FieldRef<"MatchPlayerStats", 'Float'> + readonly headshotPct: FieldRef<"MatchPlayerStats", 'Float'> + readonly flashAssists: FieldRef<"MatchPlayerStats", 'Int'> + readonly mvps: FieldRef<"MatchPlayerStats", 'Int'> + readonly mvpEliminations: FieldRef<"MatchPlayerStats", 'Int'> + readonly mvpDefuse: FieldRef<"MatchPlayerStats", 'Int'> + readonly mvpPlant: FieldRef<"MatchPlayerStats", 'Int'> + readonly knifeKills: FieldRef<"MatchPlayerStats", 'Int'> + readonly zeusKills: FieldRef<"MatchPlayerStats", 'Int'> + readonly wallbangKills: FieldRef<"MatchPlayerStats", 'Int'> + readonly smokeKills: FieldRef<"MatchPlayerStats", 'Int'> + readonly headshots: FieldRef<"MatchPlayerStats", 'Int'> + readonly noScopes: FieldRef<"MatchPlayerStats", 'Int'> + readonly blindKills: FieldRef<"MatchPlayerStats", 'Int'> + readonly rankOld: FieldRef<"MatchPlayerStats", 'Int'> + readonly rankNew: FieldRef<"MatchPlayerStats", 'Int'> + readonly winCount: FieldRef<"MatchPlayerStats", 'Int'> + } + + + // Custom InputTypes + /** + * MatchPlayerStats findUnique + */ + export type MatchPlayerStatsFindUniqueArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * Filter, which MatchPlayerStats to fetch. + */ + where: MatchPlayerStatsWhereUniqueInput + } + + /** + * MatchPlayerStats findUniqueOrThrow + */ + export type MatchPlayerStatsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * Filter, which MatchPlayerStats to fetch. + */ + where: MatchPlayerStatsWhereUniqueInput + } + + /** + * MatchPlayerStats findFirst + */ + export type MatchPlayerStatsFindFirstArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * Filter, which MatchPlayerStats to fetch. + */ + where?: MatchPlayerStatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MatchPlayerStats to fetch. + */ + orderBy?: MatchPlayerStatsOrderByWithRelationInput | MatchPlayerStatsOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for MatchPlayerStats. + */ + cursor?: MatchPlayerStatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MatchPlayerStats 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` MatchPlayerStats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of MatchPlayerStats. + */ + distinct?: MatchPlayerStatsScalarFieldEnum | MatchPlayerStatsScalarFieldEnum[] + } + + /** + * MatchPlayerStats findFirstOrThrow + */ + export type MatchPlayerStatsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * Filter, which MatchPlayerStats to fetch. + */ + where?: MatchPlayerStatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MatchPlayerStats to fetch. + */ + orderBy?: MatchPlayerStatsOrderByWithRelationInput | MatchPlayerStatsOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for MatchPlayerStats. + */ + cursor?: MatchPlayerStatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MatchPlayerStats 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` MatchPlayerStats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of MatchPlayerStats. + */ + distinct?: MatchPlayerStatsScalarFieldEnum | MatchPlayerStatsScalarFieldEnum[] + } + + /** + * MatchPlayerStats findMany + */ + export type MatchPlayerStatsFindManyArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * Filter, which MatchPlayerStats to fetch. + */ + where?: MatchPlayerStatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of MatchPlayerStats to fetch. + */ + orderBy?: MatchPlayerStatsOrderByWithRelationInput | MatchPlayerStatsOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing MatchPlayerStats. + */ + cursor?: MatchPlayerStatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` MatchPlayerStats 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` MatchPlayerStats. + */ + skip?: number + distinct?: MatchPlayerStatsScalarFieldEnum | MatchPlayerStatsScalarFieldEnum[] + } + + /** + * MatchPlayerStats create + */ + export type MatchPlayerStatsCreateArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * The data needed to create a MatchPlayerStats. + */ + data: XOR + } + + /** + * MatchPlayerStats createMany + */ + export type MatchPlayerStatsCreateManyArgs = { + /** + * The data used to create many MatchPlayerStats. + */ + data: MatchPlayerStatsCreateManyInput | MatchPlayerStatsCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * MatchPlayerStats createManyAndReturn + */ + export type MatchPlayerStatsCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelectCreateManyAndReturn | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * The data used to create many MatchPlayerStats. + */ + data: MatchPlayerStatsCreateManyInput | MatchPlayerStatsCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsIncludeCreateManyAndReturn | null + } + + /** + * MatchPlayerStats update + */ + export type MatchPlayerStatsUpdateArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * The data needed to update a MatchPlayerStats. + */ + data: XOR + /** + * Choose, which MatchPlayerStats to update. + */ + where: MatchPlayerStatsWhereUniqueInput + } + + /** + * MatchPlayerStats updateMany + */ + export type MatchPlayerStatsUpdateManyArgs = { + /** + * The data used to update MatchPlayerStats. + */ + data: XOR + /** + * Filter which MatchPlayerStats to update + */ + where?: MatchPlayerStatsWhereInput + /** + * Limit how many MatchPlayerStats to update. + */ + limit?: number + } + + /** + * MatchPlayerStats updateManyAndReturn + */ + export type MatchPlayerStatsUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * The data used to update MatchPlayerStats. + */ + data: XOR + /** + * Filter which MatchPlayerStats to update + */ + where?: MatchPlayerStatsWhereInput + /** + * Limit how many MatchPlayerStats to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsIncludeUpdateManyAndReturn | null + } + + /** + * MatchPlayerStats upsert + */ + export type MatchPlayerStatsUpsertArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * The filter to search for the MatchPlayerStats to update in case it exists. + */ + where: MatchPlayerStatsWhereUniqueInput + /** + * In case the MatchPlayerStats found by the `where` argument doesn't exist, create a new MatchPlayerStats with this data. + */ + create: XOR + /** + * In case the MatchPlayerStats was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * MatchPlayerStats delete + */ + export type MatchPlayerStatsDeleteArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + /** + * Filter which MatchPlayerStats to delete. + */ + where: MatchPlayerStatsWhereUniqueInput + } + + /** + * MatchPlayerStats deleteMany + */ + export type MatchPlayerStatsDeleteManyArgs = { + /** + * Filter which MatchPlayerStats to delete + */ + where?: MatchPlayerStatsWhereInput + /** + * Limit how many MatchPlayerStats to delete. + */ + limit?: number + } + + /** + * MatchPlayerStats without action + */ + export type MatchPlayerStatsDefaultArgs = { + /** + * Select specific fields to fetch from the MatchPlayerStats + */ + select?: MatchPlayerStatsSelect | null + /** + * Omit specific fields from the MatchPlayerStats + */ + omit?: MatchPlayerStatsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchPlayerStatsInclude | null + } + + + /** + * Model DemoFile + */ + + export type AggregateDemoFile = { + _count: DemoFileCountAggregateOutputType | null + _avg: DemoFileAvgAggregateOutputType | null + _sum: DemoFileSumAggregateOutputType | null + _min: DemoFileMinAggregateOutputType | null + _max: DemoFileMaxAggregateOutputType | null + } + + export type DemoFileAvgAggregateOutputType = { + matchId: number | null + } + + export type DemoFileSumAggregateOutputType = { + matchId: bigint | null + } + + export type DemoFileMinAggregateOutputType = { + id: string | null + matchId: bigint | null + steamId: string | null + fileName: string | null + filePath: string | null + parsed: boolean | null + createdAt: Date | null + } + + export type DemoFileMaxAggregateOutputType = { + id: string | null + matchId: bigint | null + steamId: string | null + fileName: string | null + filePath: string | null + parsed: boolean | null + createdAt: Date | null + } + + export type DemoFileCountAggregateOutputType = { + id: number + matchId: number + steamId: number + fileName: number + filePath: number + parsed: number + createdAt: number + _all: number + } + + + export type DemoFileAvgAggregateInputType = { + matchId?: true + } + + export type DemoFileSumAggregateInputType = { + matchId?: true + } + + export type DemoFileMinAggregateInputType = { + id?: true + matchId?: true + steamId?: true + fileName?: true + filePath?: true + parsed?: true + createdAt?: true + } + + export type DemoFileMaxAggregateInputType = { + id?: true + matchId?: true + steamId?: true + fileName?: true + filePath?: true + parsed?: true + createdAt?: true + } + + export type DemoFileCountAggregateInputType = { + id?: true + matchId?: true + steamId?: true + fileName?: true + filePath?: true + parsed?: true + createdAt?: true + _all?: true + } + + export type DemoFileAggregateArgs = { + /** + * Filter which DemoFile to aggregate. + */ + where?: DemoFileWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DemoFiles to fetch. + */ + orderBy?: DemoFileOrderByWithRelationInput | DemoFileOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: DemoFileWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DemoFiles 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` DemoFiles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned DemoFiles + **/ + _count?: true | DemoFileCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: DemoFileAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: DemoFileSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: DemoFileMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: DemoFileMaxAggregateInputType + } + + export type GetDemoFileAggregateType = { + [P in keyof T & keyof AggregateDemoFile]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type DemoFileGroupByArgs = { + where?: DemoFileWhereInput + orderBy?: DemoFileOrderByWithAggregationInput | DemoFileOrderByWithAggregationInput[] + by: DemoFileScalarFieldEnum[] | DemoFileScalarFieldEnum + having?: DemoFileScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: DemoFileCountAggregateInputType | true + _avg?: DemoFileAvgAggregateInputType + _sum?: DemoFileSumAggregateInputType + _min?: DemoFileMinAggregateInputType + _max?: DemoFileMaxAggregateInputType + } + + export type DemoFileGroupByOutputType = { + id: string + matchId: bigint + steamId: string + fileName: string + filePath: string + parsed: boolean + createdAt: Date + _count: DemoFileCountAggregateOutputType | null + _avg: DemoFileAvgAggregateOutputType | null + _sum: DemoFileSumAggregateOutputType | null + _min: DemoFileMinAggregateOutputType | null + _max: DemoFileMaxAggregateOutputType | null + } + + type GetDemoFileGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof DemoFileGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type DemoFileSelect = $Extensions.GetSelect<{ + id?: boolean + matchId?: boolean + steamId?: boolean + fileName?: boolean + filePath?: boolean + parsed?: boolean + createdAt?: boolean + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["demoFile"]> + + export type DemoFileSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + matchId?: boolean + steamId?: boolean + fileName?: boolean + filePath?: boolean + parsed?: boolean + createdAt?: boolean + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["demoFile"]> + + export type DemoFileSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + matchId?: boolean + steamId?: boolean + fileName?: boolean + filePath?: boolean + parsed?: boolean + createdAt?: boolean + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["demoFile"]> + + export type DemoFileSelectScalar = { + id?: boolean + matchId?: boolean + steamId?: boolean + fileName?: boolean + filePath?: boolean + parsed?: boolean + createdAt?: boolean + } + + export type DemoFileOmit = $Extensions.GetOmit<"id" | "matchId" | "steamId" | "fileName" | "filePath" | "parsed" | "createdAt", ExtArgs["result"]["demoFile"]> + export type DemoFileInclude = { + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + } + export type DemoFileIncludeCreateManyAndReturn = { + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + } + export type DemoFileIncludeUpdateManyAndReturn = { + match?: boolean | MatchDefaultArgs + user?: boolean | UserDefaultArgs + } + + export type $DemoFilePayload = { + name: "DemoFile" + objects: { + match: Prisma.$MatchPayload + user: Prisma.$UserPayload + } + scalars: $Extensions.GetPayloadResult<{ + id: string + matchId: bigint + steamId: string + fileName: string + filePath: string + parsed: boolean + createdAt: Date + }, ExtArgs["result"]["demoFile"]> + composites: {} + } + + type DemoFileGetPayload = $Result.GetResult + + type DemoFileCountArgs = + Omit & { + select?: DemoFileCountAggregateInputType | true + } + + export interface DemoFileDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['DemoFile'], meta: { name: 'DemoFile' } } + /** + * Find zero or one DemoFile that matches the filter. + * @param {DemoFileFindUniqueArgs} args - Arguments to find a DemoFile + * @example + * // Get one DemoFile + * const demoFile = await prisma.demoFile.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__DemoFileClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one DemoFile that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {DemoFileFindUniqueOrThrowArgs} args - Arguments to find a DemoFile + * @example + * // Get one DemoFile + * const demoFile = await prisma.demoFile.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__DemoFileClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first DemoFile 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 {DemoFileFindFirstArgs} args - Arguments to find a DemoFile + * @example + * // Get one DemoFile + * const demoFile = await prisma.demoFile.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__DemoFileClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first DemoFile 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 {DemoFileFindFirstOrThrowArgs} args - Arguments to find a DemoFile + * @example + * // Get one DemoFile + * const demoFile = await prisma.demoFile.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__DemoFileClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more DemoFiles 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 {DemoFileFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all DemoFiles + * const demoFiles = await prisma.demoFile.findMany() + * + * // Get first 10 DemoFiles + * const demoFiles = await prisma.demoFile.findMany({ take: 10 }) + * + * // Only select the `id` + * const demoFileWithIdOnly = await prisma.demoFile.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a DemoFile. + * @param {DemoFileCreateArgs} args - Arguments to create a DemoFile. + * @example + * // Create one DemoFile + * const DemoFile = await prisma.demoFile.create({ + * data: { + * // ... data to create a DemoFile + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__DemoFileClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many DemoFiles. + * @param {DemoFileCreateManyArgs} args - Arguments to create many DemoFiles. + * @example + * // Create many DemoFiles + * const demoFile = await prisma.demoFile.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many DemoFiles and returns the data saved in the database. + * @param {DemoFileCreateManyAndReturnArgs} args - Arguments to create many DemoFiles. + * @example + * // Create many DemoFiles + * const demoFile = await prisma.demoFile.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many DemoFiles and only return the `id` + * const demoFileWithIdOnly = await prisma.demoFile.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a DemoFile. + * @param {DemoFileDeleteArgs} args - Arguments to delete one DemoFile. + * @example + * // Delete one DemoFile + * const DemoFile = await prisma.demoFile.delete({ + * where: { + * // ... filter to delete one DemoFile + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__DemoFileClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one DemoFile. + * @param {DemoFileUpdateArgs} args - Arguments to update one DemoFile. + * @example + * // Update one DemoFile + * const demoFile = await prisma.demoFile.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__DemoFileClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more DemoFiles. + * @param {DemoFileDeleteManyArgs} args - Arguments to filter DemoFiles to delete. + * @example + * // Delete a few DemoFiles + * const { count } = await prisma.demoFile.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more DemoFiles. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DemoFileUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many DemoFiles + * const demoFile = await prisma.demoFile.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more DemoFiles and returns the data updated in the database. + * @param {DemoFileUpdateManyAndReturnArgs} args - Arguments to update many DemoFiles. + * @example + * // Update many DemoFiles + * const demoFile = await prisma.demoFile.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more DemoFiles and only return the `id` + * const demoFileWithIdOnly = await prisma.demoFile.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one DemoFile. + * @param {DemoFileUpsertArgs} args - Arguments to update or create a DemoFile. + * @example + * // Update or create a DemoFile + * const demoFile = await prisma.demoFile.upsert({ + * create: { + * // ... data to create a DemoFile + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the DemoFile we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__DemoFileClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of DemoFiles. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DemoFileCountArgs} args - Arguments to filter DemoFiles to count. + * @example + * // Count the number of DemoFiles + * const count = await prisma.demoFile.count({ + * where: { + * // ... the filter for the DemoFiles 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 DemoFile. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DemoFileAggregateArgs} 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 DemoFile. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DemoFileGroupByArgs} 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 DemoFileGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: DemoFileGroupByArgs['orderBy'] } + : { orderBy?: DemoFileGroupByArgs['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 ? GetDemoFileGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the DemoFile model + */ + readonly fields: DemoFileFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for DemoFile. + * 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__DemoFileClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + match = {}>(args?: Subset>): Prisma__MatchClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + user = {}>(args?: Subset>): Prisma__UserClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * 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 DemoFile model + */ + interface DemoFileFieldRefs { + readonly id: FieldRef<"DemoFile", 'String'> + readonly matchId: FieldRef<"DemoFile", 'BigInt'> + readonly steamId: FieldRef<"DemoFile", 'String'> + readonly fileName: FieldRef<"DemoFile", 'String'> + readonly filePath: FieldRef<"DemoFile", 'String'> + readonly parsed: FieldRef<"DemoFile", 'Boolean'> + readonly createdAt: FieldRef<"DemoFile", 'DateTime'> + } + + + // Custom InputTypes + /** + * DemoFile findUnique + */ + export type DemoFileFindUniqueArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * Filter, which DemoFile to fetch. + */ + where: DemoFileWhereUniqueInput + } + + /** + * DemoFile findUniqueOrThrow + */ + export type DemoFileFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * Filter, which DemoFile to fetch. + */ + where: DemoFileWhereUniqueInput + } + + /** + * DemoFile findFirst + */ + export type DemoFileFindFirstArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * Filter, which DemoFile to fetch. + */ + where?: DemoFileWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DemoFiles to fetch. + */ + orderBy?: DemoFileOrderByWithRelationInput | DemoFileOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for DemoFiles. + */ + cursor?: DemoFileWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DemoFiles 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` DemoFiles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DemoFiles. + */ + distinct?: DemoFileScalarFieldEnum | DemoFileScalarFieldEnum[] + } + + /** + * DemoFile findFirstOrThrow + */ + export type DemoFileFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * Filter, which DemoFile to fetch. + */ + where?: DemoFileWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DemoFiles to fetch. + */ + orderBy?: DemoFileOrderByWithRelationInput | DemoFileOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for DemoFiles. + */ + cursor?: DemoFileWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DemoFiles 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` DemoFiles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DemoFiles. + */ + distinct?: DemoFileScalarFieldEnum | DemoFileScalarFieldEnum[] + } + + /** + * DemoFile findMany + */ + export type DemoFileFindManyArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * Filter, which DemoFiles to fetch. + */ + where?: DemoFileWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DemoFiles to fetch. + */ + orderBy?: DemoFileOrderByWithRelationInput | DemoFileOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing DemoFiles. + */ + cursor?: DemoFileWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DemoFiles 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` DemoFiles. + */ + skip?: number + distinct?: DemoFileScalarFieldEnum | DemoFileScalarFieldEnum[] + } + + /** + * DemoFile create + */ + export type DemoFileCreateArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * The data needed to create a DemoFile. + */ + data: XOR + } + + /** + * DemoFile createMany + */ + export type DemoFileCreateManyArgs = { + /** + * The data used to create many DemoFiles. + */ + data: DemoFileCreateManyInput | DemoFileCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * DemoFile createManyAndReturn + */ + export type DemoFileCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelectCreateManyAndReturn | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * The data used to create many DemoFiles. + */ + data: DemoFileCreateManyInput | DemoFileCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileIncludeCreateManyAndReturn | null + } + + /** + * DemoFile update + */ + export type DemoFileUpdateArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * The data needed to update a DemoFile. + */ + data: XOR + /** + * Choose, which DemoFile to update. + */ + where: DemoFileWhereUniqueInput + } + + /** + * DemoFile updateMany + */ + export type DemoFileUpdateManyArgs = { + /** + * The data used to update DemoFiles. + */ + data: XOR + /** + * Filter which DemoFiles to update + */ + where?: DemoFileWhereInput + /** + * Limit how many DemoFiles to update. + */ + limit?: number + } + + /** + * DemoFile updateManyAndReturn + */ + export type DemoFileUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * The data used to update DemoFiles. + */ + data: XOR + /** + * Filter which DemoFiles to update + */ + where?: DemoFileWhereInput + /** + * Limit how many DemoFiles to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileIncludeUpdateManyAndReturn | null + } + + /** + * DemoFile upsert + */ + export type DemoFileUpsertArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * The filter to search for the DemoFile to update in case it exists. + */ + where: DemoFileWhereUniqueInput + /** + * In case the DemoFile found by the `where` argument doesn't exist, create a new DemoFile with this data. + */ + create: XOR + /** + * In case the DemoFile was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * DemoFile delete + */ + export type DemoFileDeleteArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + /** + * Filter which DemoFile to delete. + */ + where: DemoFileWhereUniqueInput + } + + /** + * DemoFile deleteMany + */ + export type DemoFileDeleteManyArgs = { + /** + * Filter which DemoFiles to delete + */ + where?: DemoFileWhereInput + /** + * Limit how many DemoFiles to delete. + */ + limit?: number + } + + /** + * DemoFile without action + */ + export type DemoFileDefaultArgs = { + /** + * Select specific fields to fetch from the DemoFile + */ + select?: DemoFileSelect | null + /** + * Omit specific fields from the DemoFile + */ + omit?: DemoFileOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: DemoFileInclude | null + } + + + /** + * Model Invitation + */ + + export type AggregateInvitation = { + _count: InvitationCountAggregateOutputType | null + _min: InvitationMinAggregateOutputType | null + _max: InvitationMaxAggregateOutputType | null + } + + export type InvitationMinAggregateOutputType = { + id: string | null + userId: string | null + teamId: string | null + type: string | null + createdAt: Date | null + } + + export type InvitationMaxAggregateOutputType = { + id: string | null + userId: string | null + teamId: string | null + type: string | null + createdAt: Date | null + } + + export type InvitationCountAggregateOutputType = { + id: number + userId: number + teamId: number + type: number + createdAt: number + _all: number + } + + + export type InvitationMinAggregateInputType = { + id?: true + userId?: true + teamId?: true + type?: true + createdAt?: true + } + + export type InvitationMaxAggregateInputType = { + id?: true + userId?: true + teamId?: true + type?: true + createdAt?: true + } + + export type InvitationCountAggregateInputType = { + id?: true + userId?: true + teamId?: true + type?: true + createdAt?: true + _all?: true + } + + export type InvitationAggregateArgs = { + /** + * Filter which Invitation to aggregate. + */ + where?: InvitationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Invitations to fetch. + */ + orderBy?: InvitationOrderByWithRelationInput | InvitationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: InvitationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Invitations 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` Invitations. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Invitations + **/ + _count?: true | InvitationCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: InvitationMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: InvitationMaxAggregateInputType + } + + export type GetInvitationAggregateType = { + [P in keyof T & keyof AggregateInvitation]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type InvitationGroupByArgs = { + where?: InvitationWhereInput + orderBy?: InvitationOrderByWithAggregationInput | InvitationOrderByWithAggregationInput[] + by: InvitationScalarFieldEnum[] | InvitationScalarFieldEnum + having?: InvitationScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: InvitationCountAggregateInputType | true + _min?: InvitationMinAggregateInputType + _max?: InvitationMaxAggregateInputType + } + + export type InvitationGroupByOutputType = { + id: string + userId: string + teamId: string + type: string + createdAt: Date + _count: InvitationCountAggregateOutputType | null + _min: InvitationMinAggregateOutputType | null + _max: InvitationMaxAggregateOutputType | null + } + + type GetInvitationGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof InvitationGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type InvitationSelect = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + teamId?: boolean + type?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + team?: boolean | TeamDefaultArgs + }, ExtArgs["result"]["invitation"]> + + export type InvitationSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + teamId?: boolean + type?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + team?: boolean | TeamDefaultArgs + }, ExtArgs["result"]["invitation"]> + + export type InvitationSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + teamId?: boolean + type?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + team?: boolean | TeamDefaultArgs + }, ExtArgs["result"]["invitation"]> + + export type InvitationSelectScalar = { + id?: boolean + userId?: boolean + teamId?: boolean + type?: boolean + createdAt?: boolean + } + + export type InvitationOmit = $Extensions.GetOmit<"id" | "userId" | "teamId" | "type" | "createdAt", ExtArgs["result"]["invitation"]> + export type InvitationInclude = { + user?: boolean | UserDefaultArgs + team?: boolean | TeamDefaultArgs + } + export type InvitationIncludeCreateManyAndReturn = { + user?: boolean | UserDefaultArgs + team?: boolean | TeamDefaultArgs + } + export type InvitationIncludeUpdateManyAndReturn = { + user?: boolean | UserDefaultArgs + team?: boolean | TeamDefaultArgs + } + + export type $InvitationPayload = { + name: "Invitation" + objects: { + user: Prisma.$UserPayload + team: Prisma.$TeamPayload + } + scalars: $Extensions.GetPayloadResult<{ + id: string + userId: string + teamId: string + type: string + createdAt: Date + }, ExtArgs["result"]["invitation"]> + composites: {} + } + + type InvitationGetPayload = $Result.GetResult + + type InvitationCountArgs = + Omit & { + select?: InvitationCountAggregateInputType | true + } + + export interface InvitationDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Invitation'], meta: { name: 'Invitation' } } + /** + * Find zero or one Invitation that matches the filter. + * @param {InvitationFindUniqueArgs} args - Arguments to find a Invitation + * @example + * // Get one Invitation + * const invitation = await prisma.invitation.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__InvitationClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Invitation that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {InvitationFindUniqueOrThrowArgs} args - Arguments to find a Invitation + * @example + * // Get one Invitation + * const invitation = await prisma.invitation.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__InvitationClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Invitation 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 {InvitationFindFirstArgs} args - Arguments to find a Invitation + * @example + * // Get one Invitation + * const invitation = await prisma.invitation.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__InvitationClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Invitation 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 {InvitationFindFirstOrThrowArgs} args - Arguments to find a Invitation + * @example + * // Get one Invitation + * const invitation = await prisma.invitation.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__InvitationClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Invitations 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 {InvitationFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Invitations + * const invitations = await prisma.invitation.findMany() + * + * // Get first 10 Invitations + * const invitations = await prisma.invitation.findMany({ take: 10 }) + * + * // Only select the `id` + * const invitationWithIdOnly = await prisma.invitation.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Invitation. + * @param {InvitationCreateArgs} args - Arguments to create a Invitation. + * @example + * // Create one Invitation + * const Invitation = await prisma.invitation.create({ + * data: { + * // ... data to create a Invitation + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__InvitationClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Invitations. + * @param {InvitationCreateManyArgs} args - Arguments to create many Invitations. + * @example + * // Create many Invitations + * const invitation = await prisma.invitation.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Invitations and returns the data saved in the database. + * @param {InvitationCreateManyAndReturnArgs} args - Arguments to create many Invitations. + * @example + * // Create many Invitations + * const invitation = await prisma.invitation.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Invitations and only return the `id` + * const invitationWithIdOnly = await prisma.invitation.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Invitation. + * @param {InvitationDeleteArgs} args - Arguments to delete one Invitation. + * @example + * // Delete one Invitation + * const Invitation = await prisma.invitation.delete({ + * where: { + * // ... filter to delete one Invitation + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__InvitationClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Invitation. + * @param {InvitationUpdateArgs} args - Arguments to update one Invitation. + * @example + * // Update one Invitation + * const invitation = await prisma.invitation.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__InvitationClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Invitations. + * @param {InvitationDeleteManyArgs} args - Arguments to filter Invitations to delete. + * @example + * // Delete a few Invitations + * const { count } = await prisma.invitation.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Invitations. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InvitationUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Invitations + * const invitation = await prisma.invitation.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Invitations and returns the data updated in the database. + * @param {InvitationUpdateManyAndReturnArgs} args - Arguments to update many Invitations. + * @example + * // Update many Invitations + * const invitation = await prisma.invitation.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Invitations and only return the `id` + * const invitationWithIdOnly = await prisma.invitation.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Invitation. + * @param {InvitationUpsertArgs} args - Arguments to update or create a Invitation. + * @example + * // Update or create a Invitation + * const invitation = await prisma.invitation.upsert({ + * create: { + * // ... data to create a Invitation + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Invitation we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__InvitationClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Invitations. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InvitationCountArgs} args - Arguments to filter Invitations to count. + * @example + * // Count the number of Invitations + * const count = await prisma.invitation.count({ + * where: { + * // ... the filter for the Invitations 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 Invitation. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InvitationAggregateArgs} 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 Invitation. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InvitationGroupByArgs} 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 InvitationGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: InvitationGroupByArgs['orderBy'] } + : { orderBy?: InvitationGroupByArgs['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 ? GetInvitationGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Invitation model + */ + readonly fields: InvitationFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Invitation. + * 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__InvitationClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + user = {}>(args?: Subset>): Prisma__UserClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + team = {}>(args?: Subset>): Prisma__TeamClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * 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 Invitation model + */ + interface InvitationFieldRefs { + readonly id: FieldRef<"Invitation", 'String'> + readonly userId: FieldRef<"Invitation", 'String'> + readonly teamId: FieldRef<"Invitation", 'String'> + readonly type: FieldRef<"Invitation", 'String'> + readonly createdAt: FieldRef<"Invitation", 'DateTime'> + } + + + // Custom InputTypes + /** + * Invitation findUnique + */ + export type InvitationFindUniqueArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * Filter, which Invitation to fetch. + */ + where: InvitationWhereUniqueInput + } + + /** + * Invitation findUniqueOrThrow + */ + export type InvitationFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * Filter, which Invitation to fetch. + */ + where: InvitationWhereUniqueInput + } + + /** + * Invitation findFirst + */ + export type InvitationFindFirstArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * Filter, which Invitation to fetch. + */ + where?: InvitationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Invitations to fetch. + */ + orderBy?: InvitationOrderByWithRelationInput | InvitationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Invitations. + */ + cursor?: InvitationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Invitations 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` Invitations. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Invitations. + */ + distinct?: InvitationScalarFieldEnum | InvitationScalarFieldEnum[] + } + + /** + * Invitation findFirstOrThrow + */ + export type InvitationFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * Filter, which Invitation to fetch. + */ + where?: InvitationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Invitations to fetch. + */ + orderBy?: InvitationOrderByWithRelationInput | InvitationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Invitations. + */ + cursor?: InvitationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Invitations 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` Invitations. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Invitations. + */ + distinct?: InvitationScalarFieldEnum | InvitationScalarFieldEnum[] + } + + /** + * Invitation findMany + */ + export type InvitationFindManyArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * Filter, which Invitations to fetch. + */ + where?: InvitationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Invitations to fetch. + */ + orderBy?: InvitationOrderByWithRelationInput | InvitationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Invitations. + */ + cursor?: InvitationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Invitations 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` Invitations. + */ + skip?: number + distinct?: InvitationScalarFieldEnum | InvitationScalarFieldEnum[] + } + + /** + * Invitation create + */ + export type InvitationCreateArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * The data needed to create a Invitation. + */ + data: XOR + } + + /** + * Invitation createMany + */ + export type InvitationCreateManyArgs = { + /** + * The data used to create many Invitations. + */ + data: InvitationCreateManyInput | InvitationCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Invitation createManyAndReturn + */ + export type InvitationCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * The data used to create many Invitations. + */ + data: InvitationCreateManyInput | InvitationCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationIncludeCreateManyAndReturn | null + } + + /** + * Invitation update + */ + export type InvitationUpdateArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * The data needed to update a Invitation. + */ + data: XOR + /** + * Choose, which Invitation to update. + */ + where: InvitationWhereUniqueInput + } + + /** + * Invitation updateMany + */ + export type InvitationUpdateManyArgs = { + /** + * The data used to update Invitations. + */ + data: XOR + /** + * Filter which Invitations to update + */ + where?: InvitationWhereInput + /** + * Limit how many Invitations to update. + */ + limit?: number + } + + /** + * Invitation updateManyAndReturn + */ + export type InvitationUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * The data used to update Invitations. + */ + data: XOR + /** + * Filter which Invitations to update + */ + where?: InvitationWhereInput + /** + * Limit how many Invitations to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationIncludeUpdateManyAndReturn | null + } + + /** + * Invitation upsert + */ + export type InvitationUpsertArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * The filter to search for the Invitation to update in case it exists. + */ + where: InvitationWhereUniqueInput + /** + * In case the Invitation found by the `where` argument doesn't exist, create a new Invitation with this data. + */ + create: XOR + /** + * In case the Invitation was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Invitation delete + */ + export type InvitationDeleteArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + /** + * Filter which Invitation to delete. + */ + where: InvitationWhereUniqueInput + } + + /** + * Invitation deleteMany + */ + export type InvitationDeleteManyArgs = { + /** + * Filter which Invitations to delete + */ + where?: InvitationWhereInput + /** + * Limit how many Invitations to delete. + */ + limit?: number + } + + /** + * Invitation without action + */ + export type InvitationDefaultArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: InvitationInclude | null + } + + + /** + * Model Notification + */ + + export type AggregateNotification = { + _count: NotificationCountAggregateOutputType | null + _min: NotificationMinAggregateOutputType | null + _max: NotificationMaxAggregateOutputType | null + } + + export type NotificationMinAggregateOutputType = { + id: string | null + userId: string | null + title: string | null + message: string | null + read: boolean | null + persistent: boolean | null + actionType: string | null + actionData: string | null + createdAt: Date | null + } + + export type NotificationMaxAggregateOutputType = { + id: string | null + userId: string | null + title: string | null + message: string | null + read: boolean | null + persistent: boolean | null + actionType: string | null + actionData: string | null + createdAt: Date | null + } + + export type NotificationCountAggregateOutputType = { + id: number + userId: number + title: number + message: number + read: number + persistent: number + actionType: number + actionData: number + createdAt: number + _all: number + } + + + export type NotificationMinAggregateInputType = { + id?: true + userId?: true + title?: true + message?: true + read?: true + persistent?: true + actionType?: true + actionData?: true + createdAt?: true + } + + export type NotificationMaxAggregateInputType = { + id?: true + userId?: true + title?: true + message?: true + read?: true + persistent?: true + actionType?: true + actionData?: true + createdAt?: true + } + + export type NotificationCountAggregateInputType = { + id?: true + userId?: true + title?: true + message?: true + read?: true + persistent?: true + actionType?: true + actionData?: true + createdAt?: true + _all?: true + } + + export type NotificationAggregateArgs = { + /** + * Filter which Notification to aggregate. + */ + where?: NotificationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Notifications to fetch. + */ + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: NotificationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Notifications 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` Notifications. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Notifications + **/ + _count?: true | NotificationCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: NotificationMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: NotificationMaxAggregateInputType + } + + export type GetNotificationAggregateType = { + [P in keyof T & keyof AggregateNotification]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type NotificationGroupByArgs = { + where?: NotificationWhereInput + orderBy?: NotificationOrderByWithAggregationInput | NotificationOrderByWithAggregationInput[] + by: NotificationScalarFieldEnum[] | NotificationScalarFieldEnum + having?: NotificationScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: NotificationCountAggregateInputType | true + _min?: NotificationMinAggregateInputType + _max?: NotificationMaxAggregateInputType + } + + export type NotificationGroupByOutputType = { + id: string + userId: string + title: string | null + message: string + read: boolean + persistent: boolean + actionType: string | null + actionData: string | null + createdAt: Date + _count: NotificationCountAggregateOutputType | null + _min: NotificationMinAggregateOutputType | null + _max: NotificationMaxAggregateOutputType | null + } + + type GetNotificationGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof NotificationGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type NotificationSelect = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + title?: boolean + message?: boolean + read?: boolean + persistent?: boolean + actionType?: boolean + actionData?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["notification"]> + + export type NotificationSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + title?: boolean + message?: boolean + read?: boolean + persistent?: boolean + actionType?: boolean + actionData?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["notification"]> + + export type NotificationSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + title?: boolean + message?: boolean + read?: boolean + persistent?: boolean + actionType?: boolean + actionData?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["notification"]> + + export type NotificationSelectScalar = { + id?: boolean + userId?: boolean + title?: boolean + message?: boolean + read?: boolean + persistent?: boolean + actionType?: boolean + actionData?: boolean + createdAt?: boolean + } + + export type NotificationOmit = $Extensions.GetOmit<"id" | "userId" | "title" | "message" | "read" | "persistent" | "actionType" | "actionData" | "createdAt", ExtArgs["result"]["notification"]> + export type NotificationInclude = { + user?: boolean | UserDefaultArgs + } + export type NotificationIncludeCreateManyAndReturn = { + user?: boolean | UserDefaultArgs + } + export type NotificationIncludeUpdateManyAndReturn = { + user?: boolean | UserDefaultArgs + } + + export type $NotificationPayload = { + name: "Notification" + objects: { + user: Prisma.$UserPayload + } + scalars: $Extensions.GetPayloadResult<{ + id: string + userId: string + title: string | null + message: string + read: boolean + persistent: boolean + actionType: string | null + actionData: string | null + createdAt: Date + }, ExtArgs["result"]["notification"]> + composites: {} + } + + type NotificationGetPayload = $Result.GetResult + + type NotificationCountArgs = + Omit & { + select?: NotificationCountAggregateInputType | true + } + + export interface NotificationDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Notification'], meta: { name: 'Notification' } } + /** + * Find zero or one Notification that matches the filter. + * @param {NotificationFindUniqueArgs} args - Arguments to find a Notification + * @example + * // Get one Notification + * const notification = await prisma.notification.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__NotificationClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Notification that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {NotificationFindUniqueOrThrowArgs} args - Arguments to find a Notification + * @example + * // Get one Notification + * const notification = await prisma.notification.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__NotificationClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Notification 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 {NotificationFindFirstArgs} args - Arguments to find a Notification + * @example + * // Get one Notification + * const notification = await prisma.notification.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__NotificationClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Notification 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 {NotificationFindFirstOrThrowArgs} args - Arguments to find a Notification + * @example + * // Get one Notification + * const notification = await prisma.notification.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__NotificationClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Notifications 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 {NotificationFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Notifications + * const notifications = await prisma.notification.findMany() + * + * // Get first 10 Notifications + * const notifications = await prisma.notification.findMany({ take: 10 }) + * + * // Only select the `id` + * const notificationWithIdOnly = await prisma.notification.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Notification. + * @param {NotificationCreateArgs} args - Arguments to create a Notification. + * @example + * // Create one Notification + * const Notification = await prisma.notification.create({ + * data: { + * // ... data to create a Notification + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__NotificationClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Notifications. + * @param {NotificationCreateManyArgs} args - Arguments to create many Notifications. + * @example + * // Create many Notifications + * const notification = await prisma.notification.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Notifications and returns the data saved in the database. + * @param {NotificationCreateManyAndReturnArgs} args - Arguments to create many Notifications. + * @example + * // Create many Notifications + * const notification = await prisma.notification.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Notifications and only return the `id` + * const notificationWithIdOnly = await prisma.notification.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Notification. + * @param {NotificationDeleteArgs} args - Arguments to delete one Notification. + * @example + * // Delete one Notification + * const Notification = await prisma.notification.delete({ + * where: { + * // ... filter to delete one Notification + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__NotificationClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Notification. + * @param {NotificationUpdateArgs} args - Arguments to update one Notification. + * @example + * // Update one Notification + * const notification = await prisma.notification.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__NotificationClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Notifications. + * @param {NotificationDeleteManyArgs} args - Arguments to filter Notifications to delete. + * @example + * // Delete a few Notifications + * const { count } = await prisma.notification.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Notifications. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Notifications + * const notification = await prisma.notification.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Notifications and returns the data updated in the database. + * @param {NotificationUpdateManyAndReturnArgs} args - Arguments to update many Notifications. + * @example + * // Update many Notifications + * const notification = await prisma.notification.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Notifications and only return the `id` + * const notificationWithIdOnly = await prisma.notification.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Notification. + * @param {NotificationUpsertArgs} args - Arguments to update or create a Notification. + * @example + * // Update or create a Notification + * const notification = await prisma.notification.upsert({ + * create: { + * // ... data to create a Notification + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Notification we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__NotificationClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Notifications. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationCountArgs} args - Arguments to filter Notifications to count. + * @example + * // Count the number of Notifications + * const count = await prisma.notification.count({ + * where: { + * // ... the filter for the Notifications 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 Notification. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationAggregateArgs} 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 Notification. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationGroupByArgs} 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 NotificationGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: NotificationGroupByArgs['orderBy'] } + : { orderBy?: NotificationGroupByArgs['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 ? GetNotificationGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Notification model + */ + readonly fields: NotificationFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Notification. + * 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__NotificationClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + user = {}>(args?: Subset>): Prisma__UserClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * 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 Notification model + */ + interface NotificationFieldRefs { + readonly id: FieldRef<"Notification", 'String'> + readonly userId: FieldRef<"Notification", 'String'> + readonly title: FieldRef<"Notification", 'String'> + readonly message: FieldRef<"Notification", 'String'> + readonly read: FieldRef<"Notification", 'Boolean'> + readonly persistent: FieldRef<"Notification", 'Boolean'> + readonly actionType: FieldRef<"Notification", 'String'> + readonly actionData: FieldRef<"Notification", 'String'> + readonly createdAt: FieldRef<"Notification", 'DateTime'> + } + + + // Custom InputTypes + /** + * Notification findUnique + */ + export type NotificationFindUniqueArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * Filter, which Notification to fetch. + */ + where: NotificationWhereUniqueInput + } + + /** + * Notification findUniqueOrThrow + */ + export type NotificationFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * Filter, which Notification to fetch. + */ + where: NotificationWhereUniqueInput + } + + /** + * Notification findFirst + */ + export type NotificationFindFirstArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * Filter, which Notification to fetch. + */ + where?: NotificationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Notifications to fetch. + */ + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Notifications. + */ + cursor?: NotificationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Notifications 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` Notifications. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Notifications. + */ + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * Notification findFirstOrThrow + */ + export type NotificationFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * Filter, which Notification to fetch. + */ + where?: NotificationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Notifications to fetch. + */ + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Notifications. + */ + cursor?: NotificationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Notifications 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` Notifications. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Notifications. + */ + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * Notification findMany + */ + export type NotificationFindManyArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * Filter, which Notifications to fetch. + */ + where?: NotificationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Notifications to fetch. + */ + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Notifications. + */ + cursor?: NotificationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Notifications 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` Notifications. + */ + skip?: number + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * Notification create + */ + export type NotificationCreateArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * The data needed to create a Notification. + */ + data: XOR + } + + /** + * Notification createMany + */ + export type NotificationCreateManyArgs = { + /** + * The data used to create many Notifications. + */ + data: NotificationCreateManyInput | NotificationCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Notification createManyAndReturn + */ + export type NotificationCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * The data used to create many Notifications. + */ + data: NotificationCreateManyInput | NotificationCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationIncludeCreateManyAndReturn | null + } + + /** + * Notification update + */ + export type NotificationUpdateArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * The data needed to update a Notification. + */ + data: XOR + /** + * Choose, which Notification to update. + */ + where: NotificationWhereUniqueInput + } + + /** + * Notification updateMany + */ + export type NotificationUpdateManyArgs = { + /** + * The data used to update Notifications. + */ + data: XOR + /** + * Filter which Notifications to update + */ + where?: NotificationWhereInput + /** + * Limit how many Notifications to update. + */ + limit?: number + } + + /** + * Notification updateManyAndReturn + */ + export type NotificationUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * The data used to update Notifications. + */ + data: XOR + /** + * Filter which Notifications to update + */ + where?: NotificationWhereInput + /** + * Limit how many Notifications to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationIncludeUpdateManyAndReturn | null + } + + /** + * Notification upsert + */ + export type NotificationUpsertArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * The filter to search for the Notification to update in case it exists. + */ + where: NotificationWhereUniqueInput + /** + * In case the Notification found by the `where` argument doesn't exist, create a new Notification with this data. + */ + create: XOR + /** + * In case the Notification was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Notification delete + */ + export type NotificationDeleteArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + /** + * Filter which Notification to delete. + */ + where: NotificationWhereUniqueInput + } + + /** + * Notification deleteMany + */ + export type NotificationDeleteManyArgs = { + /** + * Filter which Notifications to delete + */ + where?: NotificationWhereInput + /** + * Limit how many Notifications to delete. + */ + limit?: number + } + + /** + * Notification without action + */ + export type NotificationDefaultArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Omit specific fields from the Notification + */ + omit?: NotificationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + } + + + /** + * Model CS2MatchRequest + */ + + export type AggregateCS2MatchRequest = { + _count: CS2MatchRequestCountAggregateOutputType | null + _avg: CS2MatchRequestAvgAggregateOutputType | null + _sum: CS2MatchRequestSumAggregateOutputType | null + _min: CS2MatchRequestMinAggregateOutputType | null + _max: CS2MatchRequestMaxAggregateOutputType | null + } + + export type CS2MatchRequestAvgAggregateOutputType = { + matchId: number | null + reservationId: number | null + tvPort: number | null + } + + export type CS2MatchRequestSumAggregateOutputType = { + matchId: bigint | null + reservationId: bigint | null + tvPort: bigint | null + } + + export type CS2MatchRequestMinAggregateOutputType = { + id: string | null + userId: string | null + steamId: string | null + matchId: bigint | null + reservationId: bigint | null + tvPort: bigint | null + processed: boolean | null + createdAt: Date | null + } + + export type CS2MatchRequestMaxAggregateOutputType = { + id: string | null + userId: string | null + steamId: string | null + matchId: bigint | null + reservationId: bigint | null + tvPort: bigint | null + processed: boolean | null + createdAt: Date | null + } + + export type CS2MatchRequestCountAggregateOutputType = { + id: number + userId: number + steamId: number + matchId: number + reservationId: number + tvPort: number + processed: number + createdAt: number + _all: number + } + + + export type CS2MatchRequestAvgAggregateInputType = { + matchId?: true + reservationId?: true + tvPort?: true + } + + export type CS2MatchRequestSumAggregateInputType = { + matchId?: true + reservationId?: true + tvPort?: true + } + + export type CS2MatchRequestMinAggregateInputType = { + id?: true + userId?: true + steamId?: true + matchId?: true + reservationId?: true + tvPort?: true + processed?: true + createdAt?: true + } + + export type CS2MatchRequestMaxAggregateInputType = { + id?: true + userId?: true + steamId?: true + matchId?: true + reservationId?: true + tvPort?: true + processed?: true + createdAt?: true + } + + export type CS2MatchRequestCountAggregateInputType = { + id?: true + userId?: true + steamId?: true + matchId?: true + reservationId?: true + tvPort?: true + processed?: true + createdAt?: true + _all?: true + } + + export type CS2MatchRequestAggregateArgs = { + /** + * Filter which CS2MatchRequest to aggregate. + */ + where?: CS2MatchRequestWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CS2MatchRequests to fetch. + */ + orderBy?: CS2MatchRequestOrderByWithRelationInput | CS2MatchRequestOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: CS2MatchRequestWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CS2MatchRequests 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` CS2MatchRequests. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned CS2MatchRequests + **/ + _count?: true | CS2MatchRequestCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: CS2MatchRequestAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: CS2MatchRequestSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: CS2MatchRequestMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: CS2MatchRequestMaxAggregateInputType + } + + export type GetCS2MatchRequestAggregateType = { + [P in keyof T & keyof AggregateCS2MatchRequest]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type CS2MatchRequestGroupByArgs = { + where?: CS2MatchRequestWhereInput + orderBy?: CS2MatchRequestOrderByWithAggregationInput | CS2MatchRequestOrderByWithAggregationInput[] + by: CS2MatchRequestScalarFieldEnum[] | CS2MatchRequestScalarFieldEnum + having?: CS2MatchRequestScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: CS2MatchRequestCountAggregateInputType | true + _avg?: CS2MatchRequestAvgAggregateInputType + _sum?: CS2MatchRequestSumAggregateInputType + _min?: CS2MatchRequestMinAggregateInputType + _max?: CS2MatchRequestMaxAggregateInputType + } + + export type CS2MatchRequestGroupByOutputType = { + id: string + userId: string + steamId: string + matchId: bigint + reservationId: bigint + tvPort: bigint + processed: boolean + createdAt: Date + _count: CS2MatchRequestCountAggregateOutputType | null + _avg: CS2MatchRequestAvgAggregateOutputType | null + _sum: CS2MatchRequestSumAggregateOutputType | null + _min: CS2MatchRequestMinAggregateOutputType | null + _max: CS2MatchRequestMaxAggregateOutputType | null + } + + type GetCS2MatchRequestGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof CS2MatchRequestGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type CS2MatchRequestSelect = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + steamId?: boolean + matchId?: boolean + reservationId?: boolean + tvPort?: boolean + processed?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["cS2MatchRequest"]> + + export type CS2MatchRequestSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + steamId?: boolean + matchId?: boolean + reservationId?: boolean + tvPort?: boolean + processed?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["cS2MatchRequest"]> + + export type CS2MatchRequestSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + steamId?: boolean + matchId?: boolean + reservationId?: boolean + tvPort?: boolean + processed?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + }, ExtArgs["result"]["cS2MatchRequest"]> + + export type CS2MatchRequestSelectScalar = { + id?: boolean + userId?: boolean + steamId?: boolean + matchId?: boolean + reservationId?: boolean + tvPort?: boolean + processed?: boolean + createdAt?: boolean + } + + export type CS2MatchRequestOmit = $Extensions.GetOmit<"id" | "userId" | "steamId" | "matchId" | "reservationId" | "tvPort" | "processed" | "createdAt", ExtArgs["result"]["cS2MatchRequest"]> + export type CS2MatchRequestInclude = { + user?: boolean | UserDefaultArgs + } + export type CS2MatchRequestIncludeCreateManyAndReturn = { + user?: boolean | UserDefaultArgs + } + export type CS2MatchRequestIncludeUpdateManyAndReturn = { + user?: boolean | UserDefaultArgs + } + + export type $CS2MatchRequestPayload = { + name: "CS2MatchRequest" + objects: { + user: Prisma.$UserPayload + } + scalars: $Extensions.GetPayloadResult<{ + id: string + userId: string + steamId: string + matchId: bigint + reservationId: bigint + tvPort: bigint + processed: boolean + createdAt: Date + }, ExtArgs["result"]["cS2MatchRequest"]> + composites: {} + } + + type CS2MatchRequestGetPayload = $Result.GetResult + + type CS2MatchRequestCountArgs = + Omit & { + select?: CS2MatchRequestCountAggregateInputType | true + } + + export interface CS2MatchRequestDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['CS2MatchRequest'], meta: { name: 'CS2MatchRequest' } } + /** + * Find zero or one CS2MatchRequest that matches the filter. + * @param {CS2MatchRequestFindUniqueArgs} args - Arguments to find a CS2MatchRequest + * @example + * // Get one CS2MatchRequest + * const cS2MatchRequest = await prisma.cS2MatchRequest.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__CS2MatchRequestClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one CS2MatchRequest that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {CS2MatchRequestFindUniqueOrThrowArgs} args - Arguments to find a CS2MatchRequest + * @example + * // Get one CS2MatchRequest + * const cS2MatchRequest = await prisma.cS2MatchRequest.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__CS2MatchRequestClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first CS2MatchRequest 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 {CS2MatchRequestFindFirstArgs} args - Arguments to find a CS2MatchRequest + * @example + * // Get one CS2MatchRequest + * const cS2MatchRequest = await prisma.cS2MatchRequest.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__CS2MatchRequestClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first CS2MatchRequest 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 {CS2MatchRequestFindFirstOrThrowArgs} args - Arguments to find a CS2MatchRequest + * @example + * // Get one CS2MatchRequest + * const cS2MatchRequest = await prisma.cS2MatchRequest.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__CS2MatchRequestClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more CS2MatchRequests 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 {CS2MatchRequestFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all CS2MatchRequests + * const cS2MatchRequests = await prisma.cS2MatchRequest.findMany() + * + * // Get first 10 CS2MatchRequests + * const cS2MatchRequests = await prisma.cS2MatchRequest.findMany({ take: 10 }) + * + * // Only select the `id` + * const cS2MatchRequestWithIdOnly = await prisma.cS2MatchRequest.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a CS2MatchRequest. + * @param {CS2MatchRequestCreateArgs} args - Arguments to create a CS2MatchRequest. + * @example + * // Create one CS2MatchRequest + * const CS2MatchRequest = await prisma.cS2MatchRequest.create({ + * data: { + * // ... data to create a CS2MatchRequest + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__CS2MatchRequestClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many CS2MatchRequests. + * @param {CS2MatchRequestCreateManyArgs} args - Arguments to create many CS2MatchRequests. + * @example + * // Create many CS2MatchRequests + * const cS2MatchRequest = await prisma.cS2MatchRequest.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many CS2MatchRequests and returns the data saved in the database. + * @param {CS2MatchRequestCreateManyAndReturnArgs} args - Arguments to create many CS2MatchRequests. + * @example + * // Create many CS2MatchRequests + * const cS2MatchRequest = await prisma.cS2MatchRequest.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many CS2MatchRequests and only return the `id` + * const cS2MatchRequestWithIdOnly = await prisma.cS2MatchRequest.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a CS2MatchRequest. + * @param {CS2MatchRequestDeleteArgs} args - Arguments to delete one CS2MatchRequest. + * @example + * // Delete one CS2MatchRequest + * const CS2MatchRequest = await prisma.cS2MatchRequest.delete({ + * where: { + * // ... filter to delete one CS2MatchRequest + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__CS2MatchRequestClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one CS2MatchRequest. + * @param {CS2MatchRequestUpdateArgs} args - Arguments to update one CS2MatchRequest. + * @example + * // Update one CS2MatchRequest + * const cS2MatchRequest = await prisma.cS2MatchRequest.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__CS2MatchRequestClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more CS2MatchRequests. + * @param {CS2MatchRequestDeleteManyArgs} args - Arguments to filter CS2MatchRequests to delete. + * @example + * // Delete a few CS2MatchRequests + * const { count } = await prisma.cS2MatchRequest.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more CS2MatchRequests. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CS2MatchRequestUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many CS2MatchRequests + * const cS2MatchRequest = await prisma.cS2MatchRequest.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more CS2MatchRequests and returns the data updated in the database. + * @param {CS2MatchRequestUpdateManyAndReturnArgs} args - Arguments to update many CS2MatchRequests. + * @example + * // Update many CS2MatchRequests + * const cS2MatchRequest = await prisma.cS2MatchRequest.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more CS2MatchRequests and only return the `id` + * const cS2MatchRequestWithIdOnly = await prisma.cS2MatchRequest.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one CS2MatchRequest. + * @param {CS2MatchRequestUpsertArgs} args - Arguments to update or create a CS2MatchRequest. + * @example + * // Update or create a CS2MatchRequest + * const cS2MatchRequest = await prisma.cS2MatchRequest.upsert({ + * create: { + * // ... data to create a CS2MatchRequest + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the CS2MatchRequest we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__CS2MatchRequestClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of CS2MatchRequests. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CS2MatchRequestCountArgs} args - Arguments to filter CS2MatchRequests to count. + * @example + * // Count the number of CS2MatchRequests + * const count = await prisma.cS2MatchRequest.count({ + * where: { + * // ... the filter for the CS2MatchRequests 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 CS2MatchRequest. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CS2MatchRequestAggregateArgs} 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 CS2MatchRequest. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CS2MatchRequestGroupByArgs} 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 CS2MatchRequestGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: CS2MatchRequestGroupByArgs['orderBy'] } + : { orderBy?: CS2MatchRequestGroupByArgs['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 ? GetCS2MatchRequestGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the CS2MatchRequest model + */ + readonly fields: CS2MatchRequestFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for CS2MatchRequest. + * 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__CS2MatchRequestClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + user = {}>(args?: Subset>): Prisma__UserClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * 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 CS2MatchRequest model + */ + interface CS2MatchRequestFieldRefs { + readonly id: FieldRef<"CS2MatchRequest", 'String'> + readonly userId: FieldRef<"CS2MatchRequest", 'String'> + readonly steamId: FieldRef<"CS2MatchRequest", 'String'> + readonly matchId: FieldRef<"CS2MatchRequest", 'BigInt'> + readonly reservationId: FieldRef<"CS2MatchRequest", 'BigInt'> + readonly tvPort: FieldRef<"CS2MatchRequest", 'BigInt'> + readonly processed: FieldRef<"CS2MatchRequest", 'Boolean'> + readonly createdAt: FieldRef<"CS2MatchRequest", 'DateTime'> + } + + + // Custom InputTypes + /** + * CS2MatchRequest findUnique + */ + export type CS2MatchRequestFindUniqueArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * Filter, which CS2MatchRequest to fetch. + */ + where: CS2MatchRequestWhereUniqueInput + } + + /** + * CS2MatchRequest findUniqueOrThrow + */ + export type CS2MatchRequestFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * Filter, which CS2MatchRequest to fetch. + */ + where: CS2MatchRequestWhereUniqueInput + } + + /** + * CS2MatchRequest findFirst + */ + export type CS2MatchRequestFindFirstArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * Filter, which CS2MatchRequest to fetch. + */ + where?: CS2MatchRequestWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CS2MatchRequests to fetch. + */ + orderBy?: CS2MatchRequestOrderByWithRelationInput | CS2MatchRequestOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CS2MatchRequests. + */ + cursor?: CS2MatchRequestWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CS2MatchRequests 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` CS2MatchRequests. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CS2MatchRequests. + */ + distinct?: CS2MatchRequestScalarFieldEnum | CS2MatchRequestScalarFieldEnum[] + } + + /** + * CS2MatchRequest findFirstOrThrow + */ + export type CS2MatchRequestFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * Filter, which CS2MatchRequest to fetch. + */ + where?: CS2MatchRequestWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CS2MatchRequests to fetch. + */ + orderBy?: CS2MatchRequestOrderByWithRelationInput | CS2MatchRequestOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CS2MatchRequests. + */ + cursor?: CS2MatchRequestWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CS2MatchRequests 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` CS2MatchRequests. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CS2MatchRequests. + */ + distinct?: CS2MatchRequestScalarFieldEnum | CS2MatchRequestScalarFieldEnum[] + } + + /** + * CS2MatchRequest findMany + */ + export type CS2MatchRequestFindManyArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * Filter, which CS2MatchRequests to fetch. + */ + where?: CS2MatchRequestWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CS2MatchRequests to fetch. + */ + orderBy?: CS2MatchRequestOrderByWithRelationInput | CS2MatchRequestOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing CS2MatchRequests. + */ + cursor?: CS2MatchRequestWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CS2MatchRequests 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` CS2MatchRequests. + */ + skip?: number + distinct?: CS2MatchRequestScalarFieldEnum | CS2MatchRequestScalarFieldEnum[] + } + + /** + * CS2MatchRequest create + */ + export type CS2MatchRequestCreateArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * The data needed to create a CS2MatchRequest. + */ + data: XOR + } + + /** + * CS2MatchRequest createMany + */ + export type CS2MatchRequestCreateManyArgs = { + /** + * The data used to create many CS2MatchRequests. + */ + data: CS2MatchRequestCreateManyInput | CS2MatchRequestCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * CS2MatchRequest createManyAndReturn + */ + export type CS2MatchRequestCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelectCreateManyAndReturn | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * The data used to create many CS2MatchRequests. + */ + data: CS2MatchRequestCreateManyInput | CS2MatchRequestCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestIncludeCreateManyAndReturn | null + } + + /** + * CS2MatchRequest update + */ + export type CS2MatchRequestUpdateArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * The data needed to update a CS2MatchRequest. + */ + data: XOR + /** + * Choose, which CS2MatchRequest to update. + */ + where: CS2MatchRequestWhereUniqueInput + } + + /** + * CS2MatchRequest updateMany + */ + export type CS2MatchRequestUpdateManyArgs = { + /** + * The data used to update CS2MatchRequests. + */ + data: XOR + /** + * Filter which CS2MatchRequests to update + */ + where?: CS2MatchRequestWhereInput + /** + * Limit how many CS2MatchRequests to update. + */ + limit?: number + } + + /** + * CS2MatchRequest updateManyAndReturn + */ + export type CS2MatchRequestUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * The data used to update CS2MatchRequests. + */ + data: XOR + /** + * Filter which CS2MatchRequests to update + */ + where?: CS2MatchRequestWhereInput + /** + * Limit how many CS2MatchRequests to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestIncludeUpdateManyAndReturn | null + } + + /** + * CS2MatchRequest upsert + */ + export type CS2MatchRequestUpsertArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * The filter to search for the CS2MatchRequest to update in case it exists. + */ + where: CS2MatchRequestWhereUniqueInput + /** + * In case the CS2MatchRequest found by the `where` argument doesn't exist, create a new CS2MatchRequest with this data. + */ + create: XOR + /** + * In case the CS2MatchRequest was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * CS2MatchRequest delete + */ + export type CS2MatchRequestDeleteArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + /** + * Filter which CS2MatchRequest to delete. + */ + where: CS2MatchRequestWhereUniqueInput + } + + /** + * CS2MatchRequest deleteMany + */ + export type CS2MatchRequestDeleteManyArgs = { + /** + * Filter which CS2MatchRequests to delete + */ + where?: CS2MatchRequestWhereInput + /** + * Limit how many CS2MatchRequests to delete. + */ + limit?: number + } + + /** + * CS2MatchRequest without action + */ + export type CS2MatchRequestDefaultArgs = { + /** + * Select specific fields to fetch from the CS2MatchRequest + */ + select?: CS2MatchRequestSelect | null + /** + * Omit specific fields from the CS2MatchRequest + */ + omit?: CS2MatchRequestOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CS2MatchRequestInclude | null + } + + + /** + * Model PremierRankHistory + */ + + export type AggregatePremierRankHistory = { + _count: PremierRankHistoryCountAggregateOutputType | null + _avg: PremierRankHistoryAvgAggregateOutputType | null + _sum: PremierRankHistorySumAggregateOutputType | null + _min: PremierRankHistoryMinAggregateOutputType | null + _max: PremierRankHistoryMaxAggregateOutputType | null + } + + export type PremierRankHistoryAvgAggregateOutputType = { + matchId: number | null + rankOld: number | null + rankNew: number | null + delta: number | null + winCount: number | null + } + + export type PremierRankHistorySumAggregateOutputType = { + matchId: bigint | null + rankOld: number | null + rankNew: number | null + delta: number | null + winCount: number | null + } + + export type PremierRankHistoryMinAggregateOutputType = { + id: string | null + userId: string | null + steamId: string | null + matchId: bigint | null + rankOld: number | null + rankNew: number | null + delta: number | null + winCount: number | null + createdAt: Date | null + } + + export type PremierRankHistoryMaxAggregateOutputType = { + id: string | null + userId: string | null + steamId: string | null + matchId: bigint | null + rankOld: number | null + rankNew: number | null + delta: number | null + winCount: number | null + createdAt: Date | null + } + + export type PremierRankHistoryCountAggregateOutputType = { + id: number + userId: number + steamId: number + matchId: number + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt: number + _all: number + } + + + export type PremierRankHistoryAvgAggregateInputType = { + matchId?: true + rankOld?: true + rankNew?: true + delta?: true + winCount?: true + } + + export type PremierRankHistorySumAggregateInputType = { + matchId?: true + rankOld?: true + rankNew?: true + delta?: true + winCount?: true + } + + export type PremierRankHistoryMinAggregateInputType = { + id?: true + userId?: true + steamId?: true + matchId?: true + rankOld?: true + rankNew?: true + delta?: true + winCount?: true + createdAt?: true + } + + export type PremierRankHistoryMaxAggregateInputType = { + id?: true + userId?: true + steamId?: true + matchId?: true + rankOld?: true + rankNew?: true + delta?: true + winCount?: true + createdAt?: true + } + + export type PremierRankHistoryCountAggregateInputType = { + id?: true + userId?: true + steamId?: true + matchId?: true + rankOld?: true + rankNew?: true + delta?: true + winCount?: true + createdAt?: true + _all?: true + } + + export type PremierRankHistoryAggregateArgs = { + /** + * Filter which PremierRankHistory to aggregate. + */ + where?: PremierRankHistoryWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PremierRankHistories to fetch. + */ + orderBy?: PremierRankHistoryOrderByWithRelationInput | PremierRankHistoryOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: PremierRankHistoryWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PremierRankHistories 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` PremierRankHistories. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned PremierRankHistories + **/ + _count?: true | PremierRankHistoryCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PremierRankHistoryAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PremierRankHistorySumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PremierRankHistoryMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PremierRankHistoryMaxAggregateInputType + } + + export type GetPremierRankHistoryAggregateType = { + [P in keyof T & keyof AggregatePremierRankHistory]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type PremierRankHistoryGroupByArgs = { + where?: PremierRankHistoryWhereInput + orderBy?: PremierRankHistoryOrderByWithAggregationInput | PremierRankHistoryOrderByWithAggregationInput[] + by: PremierRankHistoryScalarFieldEnum[] | PremierRankHistoryScalarFieldEnum + having?: PremierRankHistoryScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PremierRankHistoryCountAggregateInputType | true + _avg?: PremierRankHistoryAvgAggregateInputType + _sum?: PremierRankHistorySumAggregateInputType + _min?: PremierRankHistoryMinAggregateInputType + _max?: PremierRankHistoryMaxAggregateInputType + } + + export type PremierRankHistoryGroupByOutputType = { + id: string + userId: string + steamId: string + matchId: bigint | null + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt: Date + _count: PremierRankHistoryCountAggregateOutputType | null + _avg: PremierRankHistoryAvgAggregateOutputType | null + _sum: PremierRankHistorySumAggregateOutputType | null + _min: PremierRankHistoryMinAggregateOutputType | null + _max: PremierRankHistoryMaxAggregateOutputType | null + } + + type GetPremierRankHistoryGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof PremierRankHistoryGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type PremierRankHistorySelect = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + steamId?: boolean + matchId?: boolean + rankOld?: boolean + rankNew?: boolean + delta?: boolean + winCount?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + match?: boolean | PremierRankHistory$matchArgs + }, ExtArgs["result"]["premierRankHistory"]> + + export type PremierRankHistorySelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + steamId?: boolean + matchId?: boolean + rankOld?: boolean + rankNew?: boolean + delta?: boolean + winCount?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + match?: boolean | PremierRankHistory$matchArgs + }, ExtArgs["result"]["premierRankHistory"]> + + export type PremierRankHistorySelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + userId?: boolean + steamId?: boolean + matchId?: boolean + rankOld?: boolean + rankNew?: boolean + delta?: boolean + winCount?: boolean + createdAt?: boolean + user?: boolean | UserDefaultArgs + match?: boolean | PremierRankHistory$matchArgs + }, ExtArgs["result"]["premierRankHistory"]> + + export type PremierRankHistorySelectScalar = { + id?: boolean + userId?: boolean + steamId?: boolean + matchId?: boolean + rankOld?: boolean + rankNew?: boolean + delta?: boolean + winCount?: boolean + createdAt?: boolean + } + + export type PremierRankHistoryOmit = $Extensions.GetOmit<"id" | "userId" | "steamId" | "matchId" | "rankOld" | "rankNew" | "delta" | "winCount" | "createdAt", ExtArgs["result"]["premierRankHistory"]> + export type PremierRankHistoryInclude = { + user?: boolean | UserDefaultArgs + match?: boolean | PremierRankHistory$matchArgs + } + export type PremierRankHistoryIncludeCreateManyAndReturn = { + user?: boolean | UserDefaultArgs + match?: boolean | PremierRankHistory$matchArgs + } + export type PremierRankHistoryIncludeUpdateManyAndReturn = { + user?: boolean | UserDefaultArgs + match?: boolean | PremierRankHistory$matchArgs + } + + export type $PremierRankHistoryPayload = { + name: "PremierRankHistory" + objects: { + user: Prisma.$UserPayload + match: Prisma.$MatchPayload | null + } + scalars: $Extensions.GetPayloadResult<{ + id: string + userId: string + steamId: string + matchId: bigint | null + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt: Date + }, ExtArgs["result"]["premierRankHistory"]> + composites: {} + } + + type PremierRankHistoryGetPayload = $Result.GetResult + + type PremierRankHistoryCountArgs = + Omit & { + select?: PremierRankHistoryCountAggregateInputType | true + } + + export interface PremierRankHistoryDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['PremierRankHistory'], meta: { name: 'PremierRankHistory' } } + /** + * Find zero or one PremierRankHistory that matches the filter. + * @param {PremierRankHistoryFindUniqueArgs} args - Arguments to find a PremierRankHistory + * @example + * // Get one PremierRankHistory + * const premierRankHistory = await prisma.premierRankHistory.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__PremierRankHistoryClient<$Result.GetResult, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one PremierRankHistory that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PremierRankHistoryFindUniqueOrThrowArgs} args - Arguments to find a PremierRankHistory + * @example + * // Get one PremierRankHistory + * const premierRankHistory = await prisma.premierRankHistory.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__PremierRankHistoryClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first PremierRankHistory 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 {PremierRankHistoryFindFirstArgs} args - Arguments to find a PremierRankHistory + * @example + * // Get one PremierRankHistory + * const premierRankHistory = await prisma.premierRankHistory.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__PremierRankHistoryClient<$Result.GetResult, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first PremierRankHistory 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 {PremierRankHistoryFindFirstOrThrowArgs} args - Arguments to find a PremierRankHistory + * @example + * // Get one PremierRankHistory + * const premierRankHistory = await prisma.premierRankHistory.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__PremierRankHistoryClient<$Result.GetResult, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more PremierRankHistories 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 {PremierRankHistoryFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all PremierRankHistories + * const premierRankHistories = await prisma.premierRankHistory.findMany() + * + * // Get first 10 PremierRankHistories + * const premierRankHistories = await prisma.premierRankHistory.findMany({ take: 10 }) + * + * // Only select the `id` + * const premierRankHistoryWithIdOnly = await prisma.premierRankHistory.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany", GlobalOmitOptions>> + + /** + * Create a PremierRankHistory. + * @param {PremierRankHistoryCreateArgs} args - Arguments to create a PremierRankHistory. + * @example + * // Create one PremierRankHistory + * const PremierRankHistory = await prisma.premierRankHistory.create({ + * data: { + * // ... data to create a PremierRankHistory + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__PremierRankHistoryClient<$Result.GetResult, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many PremierRankHistories. + * @param {PremierRankHistoryCreateManyArgs} args - Arguments to create many PremierRankHistories. + * @example + * // Create many PremierRankHistories + * const premierRankHistory = await prisma.premierRankHistory.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many PremierRankHistories and returns the data saved in the database. + * @param {PremierRankHistoryCreateManyAndReturnArgs} args - Arguments to create many PremierRankHistories. + * @example + * // Create many PremierRankHistories + * const premierRankHistory = await prisma.premierRankHistory.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many PremierRankHistories and only return the `id` + * const premierRankHistoryWithIdOnly = await prisma.premierRankHistory.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a PremierRankHistory. + * @param {PremierRankHistoryDeleteArgs} args - Arguments to delete one PremierRankHistory. + * @example + * // Delete one PremierRankHistory + * const PremierRankHistory = await prisma.premierRankHistory.delete({ + * where: { + * // ... filter to delete one PremierRankHistory + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__PremierRankHistoryClient<$Result.GetResult, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one PremierRankHistory. + * @param {PremierRankHistoryUpdateArgs} args - Arguments to update one PremierRankHistory. + * @example + * // Update one PremierRankHistory + * const premierRankHistory = await prisma.premierRankHistory.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__PremierRankHistoryClient<$Result.GetResult, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more PremierRankHistories. + * @param {PremierRankHistoryDeleteManyArgs} args - Arguments to filter PremierRankHistories to delete. + * @example + * // Delete a few PremierRankHistories + * const { count } = await prisma.premierRankHistory.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more PremierRankHistories. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PremierRankHistoryUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many PremierRankHistories + * const premierRankHistory = await prisma.premierRankHistory.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more PremierRankHistories and returns the data updated in the database. + * @param {PremierRankHistoryUpdateManyAndReturnArgs} args - Arguments to update many PremierRankHistories. + * @example + * // Update many PremierRankHistories + * const premierRankHistory = await prisma.premierRankHistory.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more PremierRankHistories and only return the `id` + * const premierRankHistoryWithIdOnly = await prisma.premierRankHistory.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one PremierRankHistory. + * @param {PremierRankHistoryUpsertArgs} args - Arguments to update or create a PremierRankHistory. + * @example + * // Update or create a PremierRankHistory + * const premierRankHistory = await prisma.premierRankHistory.upsert({ + * create: { + * // ... data to create a PremierRankHistory + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the PremierRankHistory we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__PremierRankHistoryClient<$Result.GetResult, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of PremierRankHistories. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PremierRankHistoryCountArgs} args - Arguments to filter PremierRankHistories to count. + * @example + * // Count the number of PremierRankHistories + * const count = await prisma.premierRankHistory.count({ + * where: { + * // ... the filter for the PremierRankHistories 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 PremierRankHistory. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PremierRankHistoryAggregateArgs} 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 PremierRankHistory. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PremierRankHistoryGroupByArgs} 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 PremierRankHistoryGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: PremierRankHistoryGroupByArgs['orderBy'] } + : { orderBy?: PremierRankHistoryGroupByArgs['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 ? GetPremierRankHistoryGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the PremierRankHistory model + */ + readonly fields: PremierRankHistoryFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for PremierRankHistory. + * 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__PremierRankHistoryClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + user = {}>(args?: Subset>): Prisma__UserClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + match = {}>(args?: Subset>): Prisma__MatchClient<$Result.GetResult, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + /** + * 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 PremierRankHistory model + */ + interface PremierRankHistoryFieldRefs { + readonly id: FieldRef<"PremierRankHistory", 'String'> + readonly userId: FieldRef<"PremierRankHistory", 'String'> + readonly steamId: FieldRef<"PremierRankHistory", 'String'> + readonly matchId: FieldRef<"PremierRankHistory", 'BigInt'> + readonly rankOld: FieldRef<"PremierRankHistory", 'Int'> + readonly rankNew: FieldRef<"PremierRankHistory", 'Int'> + readonly delta: FieldRef<"PremierRankHistory", 'Int'> + readonly winCount: FieldRef<"PremierRankHistory", 'Int'> + readonly createdAt: FieldRef<"PremierRankHistory", 'DateTime'> + } + + + // Custom InputTypes + /** + * PremierRankHistory findUnique + */ + export type PremierRankHistoryFindUniqueArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * Filter, which PremierRankHistory to fetch. + */ + where: PremierRankHistoryWhereUniqueInput + } + + /** + * PremierRankHistory findUniqueOrThrow + */ + export type PremierRankHistoryFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * Filter, which PremierRankHistory to fetch. + */ + where: PremierRankHistoryWhereUniqueInput + } + + /** + * PremierRankHistory findFirst + */ + export type PremierRankHistoryFindFirstArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * Filter, which PremierRankHistory to fetch. + */ + where?: PremierRankHistoryWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PremierRankHistories to fetch. + */ + orderBy?: PremierRankHistoryOrderByWithRelationInput | PremierRankHistoryOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for PremierRankHistories. + */ + cursor?: PremierRankHistoryWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PremierRankHistories 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` PremierRankHistories. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of PremierRankHistories. + */ + distinct?: PremierRankHistoryScalarFieldEnum | PremierRankHistoryScalarFieldEnum[] + } + + /** + * PremierRankHistory findFirstOrThrow + */ + export type PremierRankHistoryFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * Filter, which PremierRankHistory to fetch. + */ + where?: PremierRankHistoryWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PremierRankHistories to fetch. + */ + orderBy?: PremierRankHistoryOrderByWithRelationInput | PremierRankHistoryOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for PremierRankHistories. + */ + cursor?: PremierRankHistoryWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PremierRankHistories 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` PremierRankHistories. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of PremierRankHistories. + */ + distinct?: PremierRankHistoryScalarFieldEnum | PremierRankHistoryScalarFieldEnum[] + } + + /** + * PremierRankHistory findMany + */ + export type PremierRankHistoryFindManyArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * Filter, which PremierRankHistories to fetch. + */ + where?: PremierRankHistoryWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PremierRankHistories to fetch. + */ + orderBy?: PremierRankHistoryOrderByWithRelationInput | PremierRankHistoryOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing PremierRankHistories. + */ + cursor?: PremierRankHistoryWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PremierRankHistories 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` PremierRankHistories. + */ + skip?: number + distinct?: PremierRankHistoryScalarFieldEnum | PremierRankHistoryScalarFieldEnum[] + } + + /** + * PremierRankHistory create + */ + export type PremierRankHistoryCreateArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * The data needed to create a PremierRankHistory. + */ + data: XOR + } + + /** + * PremierRankHistory createMany + */ + export type PremierRankHistoryCreateManyArgs = { + /** + * The data used to create many PremierRankHistories. + */ + data: PremierRankHistoryCreateManyInput | PremierRankHistoryCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * PremierRankHistory createManyAndReturn + */ + export type PremierRankHistoryCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelectCreateManyAndReturn | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * The data used to create many PremierRankHistories. + */ + data: PremierRankHistoryCreateManyInput | PremierRankHistoryCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryIncludeCreateManyAndReturn | null + } + + /** + * PremierRankHistory update + */ + export type PremierRankHistoryUpdateArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * The data needed to update a PremierRankHistory. + */ + data: XOR + /** + * Choose, which PremierRankHistory to update. + */ + where: PremierRankHistoryWhereUniqueInput + } + + /** + * PremierRankHistory updateMany + */ + export type PremierRankHistoryUpdateManyArgs = { + /** + * The data used to update PremierRankHistories. + */ + data: XOR + /** + * Filter which PremierRankHistories to update + */ + where?: PremierRankHistoryWhereInput + /** + * Limit how many PremierRankHistories to update. + */ + limit?: number + } + + /** + * PremierRankHistory updateManyAndReturn + */ + export type PremierRankHistoryUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelectUpdateManyAndReturn | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * The data used to update PremierRankHistories. + */ + data: XOR + /** + * Filter which PremierRankHistories to update + */ + where?: PremierRankHistoryWhereInput + /** + * Limit how many PremierRankHistories to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryIncludeUpdateManyAndReturn | null + } + + /** + * PremierRankHistory upsert + */ + export type PremierRankHistoryUpsertArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * The filter to search for the PremierRankHistory to update in case it exists. + */ + where: PremierRankHistoryWhereUniqueInput + /** + * In case the PremierRankHistory found by the `where` argument doesn't exist, create a new PremierRankHistory with this data. + */ + create: XOR + /** + * In case the PremierRankHistory was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * PremierRankHistory delete + */ + export type PremierRankHistoryDeleteArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + /** + * Filter which PremierRankHistory to delete. + */ + where: PremierRankHistoryWhereUniqueInput + } + + /** + * PremierRankHistory deleteMany + */ + export type PremierRankHistoryDeleteManyArgs = { + /** + * Filter which PremierRankHistories to delete + */ + where?: PremierRankHistoryWhereInput + /** + * Limit how many PremierRankHistories to delete. + */ + limit?: number + } + + /** + * PremierRankHistory.match + */ + export type PremierRankHistory$matchArgs = { + /** + * Select specific fields to fetch from the Match + */ + select?: MatchSelect | null + /** + * Omit specific fields from the Match + */ + omit?: MatchOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: MatchInclude | null + where?: MatchWhereInput + } + + /** + * PremierRankHistory without action + */ + export type PremierRankHistoryDefaultArgs = { + /** + * Select specific fields to fetch from the PremierRankHistory + */ + select?: PremierRankHistorySelect | null + /** + * Omit specific fields from the PremierRankHistory + */ + omit?: PremierRankHistoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PremierRankHistoryInclude | null + } + + + /** + * Enums + */ + + export const TransactionIsolationLevel: { + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' + }; + + export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + + export const UserScalarFieldEnum: { + steamId: 'steamId', + name: 'name', + avatar: 'avatar', + location: 'location', + isAdmin: 'isAdmin', + teamId: 'teamId', + premierRank: 'premierRank', + authCode: 'authCode', + lastKnownShareCode: 'lastKnownShareCode', + lastKnownShareCodeDate: 'lastKnownShareCodeDate', + createdAt: 'createdAt' + }; + + export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + + export const TeamScalarFieldEnum: { + id: 'id', + name: 'name', + leaderId: 'leaderId', + logo: 'logo', + createdAt: 'createdAt', + activePlayers: 'activePlayers', + inactivePlayers: 'inactivePlayers' + }; + + export type TeamScalarFieldEnum = (typeof TeamScalarFieldEnum)[keyof typeof TeamScalarFieldEnum] + + + export const MatchScalarFieldEnum: { + matchId: 'matchId', + teamAId: 'teamAId', + teamBId: 'teamBId', + matchDate: 'matchDate', + matchType: 'matchType', + map: 'map', + title: 'title', + description: 'description', + demoData: 'demoData', + demoFilePath: 'demoFilePath', + scoreA: 'scoreA', + scoreB: 'scoreB', + createdAt: 'createdAt', + updatedAt: 'updatedAt' + }; + + export type MatchScalarFieldEnum = (typeof MatchScalarFieldEnum)[keyof typeof MatchScalarFieldEnum] + + + export const MatchPlayerScalarFieldEnum: { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + teamId: 'teamId', + createdAt: 'createdAt' + }; + + export type MatchPlayerScalarFieldEnum = (typeof MatchPlayerScalarFieldEnum)[keyof typeof MatchPlayerScalarFieldEnum] + + + export const MatchPlayerStatsScalarFieldEnum: { + id: 'id', + matchPlayerId: 'matchPlayerId', + kills: 'kills', + assists: 'assists', + deaths: 'deaths', + adr: 'adr', + headshotPct: 'headshotPct', + flashAssists: 'flashAssists', + mvps: 'mvps', + mvpEliminations: 'mvpEliminations', + mvpDefuse: 'mvpDefuse', + mvpPlant: 'mvpPlant', + knifeKills: 'knifeKills', + zeusKills: 'zeusKills', + wallbangKills: 'wallbangKills', + smokeKills: 'smokeKills', + headshots: 'headshots', + noScopes: 'noScopes', + blindKills: 'blindKills', + rankOld: 'rankOld', + rankNew: 'rankNew', + winCount: 'winCount' + }; + + export type MatchPlayerStatsScalarFieldEnum = (typeof MatchPlayerStatsScalarFieldEnum)[keyof typeof MatchPlayerStatsScalarFieldEnum] + + + export const DemoFileScalarFieldEnum: { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + fileName: 'fileName', + filePath: 'filePath', + parsed: 'parsed', + createdAt: 'createdAt' + }; + + export type DemoFileScalarFieldEnum = (typeof DemoFileScalarFieldEnum)[keyof typeof DemoFileScalarFieldEnum] + + + export const InvitationScalarFieldEnum: { + id: 'id', + userId: 'userId', + teamId: 'teamId', + type: 'type', + createdAt: 'createdAt' + }; + + export type InvitationScalarFieldEnum = (typeof InvitationScalarFieldEnum)[keyof typeof InvitationScalarFieldEnum] + + + export const NotificationScalarFieldEnum: { + id: 'id', + userId: 'userId', + title: 'title', + message: 'message', + read: 'read', + persistent: 'persistent', + actionType: 'actionType', + actionData: 'actionData', + createdAt: 'createdAt' + }; + + export type NotificationScalarFieldEnum = (typeof NotificationScalarFieldEnum)[keyof typeof NotificationScalarFieldEnum] + + + export const CS2MatchRequestScalarFieldEnum: { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + reservationId: 'reservationId', + tvPort: 'tvPort', + processed: 'processed', + createdAt: 'createdAt' + }; + + export type CS2MatchRequestScalarFieldEnum = (typeof CS2MatchRequestScalarFieldEnum)[keyof typeof CS2MatchRequestScalarFieldEnum] + + + export const PremierRankHistoryScalarFieldEnum: { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + rankOld: 'rankOld', + rankNew: 'rankNew', + delta: 'delta', + winCount: 'winCount', + createdAt: 'createdAt' + }; + + export type PremierRankHistoryScalarFieldEnum = (typeof PremierRankHistoryScalarFieldEnum)[keyof typeof PremierRankHistoryScalarFieldEnum] + + + export const SortOrder: { + asc: 'asc', + desc: 'desc' + }; + + export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + + export const NullableJsonNullValueInput: { + DbNull: typeof DbNull, + JsonNull: typeof JsonNull + }; + + export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] + + + 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] + + + export const JsonNullValueFilter: { + DbNull: typeof DbNull, + JsonNull: typeof JsonNull, + AnyNull: typeof AnyNull + }; + + export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter] + + + /** + * 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 'Boolean' + */ + export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + + /** + * 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[]'> + + + + /** + * 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 'BigInt' + */ + export type BigIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'BigInt'> + + + + /** + * Reference to a field of type 'BigInt[]' + */ + export type ListBigIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'BigInt[]'> + + + + /** + * Reference to a field of type 'Json' + */ + export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'> + + + + /** + * Reference to a field of type 'QueryMode' + */ + export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'> + + + + /** + * Reference to a field of type 'Float' + */ + export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> + + + + /** + * Reference to a field of type 'Float[]' + */ + export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> + + /** + * Deep Input Types + */ + + + export type UserWhereInput = { + AND?: UserWhereInput | UserWhereInput[] + OR?: UserWhereInput[] + NOT?: UserWhereInput | UserWhereInput[] + steamId?: StringFilter<"User"> | string + name?: StringNullableFilter<"User"> | string | null + avatar?: StringNullableFilter<"User"> | string | null + location?: StringNullableFilter<"User"> | string | null + isAdmin?: BoolFilter<"User"> | boolean + teamId?: StringNullableFilter<"User"> | string | null + premierRank?: IntNullableFilter<"User"> | number | null + authCode?: StringNullableFilter<"User"> | string | null + lastKnownShareCode?: StringNullableFilter<"User"> | string | null + lastKnownShareCodeDate?: DateTimeNullableFilter<"User"> | Date | string | null + createdAt?: DateTimeFilter<"User"> | Date | string + team?: XOR | null + ledTeam?: XOR | null + invitations?: InvitationListRelationFilter + notifications?: NotificationListRelationFilter + matchPlayers?: MatchPlayerListRelationFilter + matchRequests?: CS2MatchRequestListRelationFilter + rankHistory?: PremierRankHistoryListRelationFilter + demoFiles?: DemoFileListRelationFilter + } + + export type UserOrderByWithRelationInput = { + steamId?: SortOrder + name?: SortOrderInput | SortOrder + avatar?: SortOrderInput | SortOrder + location?: SortOrderInput | SortOrder + isAdmin?: SortOrder + teamId?: SortOrderInput | SortOrder + premierRank?: SortOrderInput | SortOrder + authCode?: SortOrderInput | SortOrder + lastKnownShareCode?: SortOrderInput | SortOrder + lastKnownShareCodeDate?: SortOrderInput | SortOrder + createdAt?: SortOrder + team?: TeamOrderByWithRelationInput + ledTeam?: TeamOrderByWithRelationInput + invitations?: InvitationOrderByRelationAggregateInput + notifications?: NotificationOrderByRelationAggregateInput + matchPlayers?: MatchPlayerOrderByRelationAggregateInput + matchRequests?: CS2MatchRequestOrderByRelationAggregateInput + rankHistory?: PremierRankHistoryOrderByRelationAggregateInput + demoFiles?: DemoFileOrderByRelationAggregateInput + } + + export type UserWhereUniqueInput = Prisma.AtLeast<{ + steamId?: string + teamId?: string + AND?: UserWhereInput | UserWhereInput[] + OR?: UserWhereInput[] + NOT?: UserWhereInput | UserWhereInput[] + name?: StringNullableFilter<"User"> | string | null + avatar?: StringNullableFilter<"User"> | string | null + location?: StringNullableFilter<"User"> | string | null + isAdmin?: BoolFilter<"User"> | boolean + premierRank?: IntNullableFilter<"User"> | number | null + authCode?: StringNullableFilter<"User"> | string | null + lastKnownShareCode?: StringNullableFilter<"User"> | string | null + lastKnownShareCodeDate?: DateTimeNullableFilter<"User"> | Date | string | null + createdAt?: DateTimeFilter<"User"> | Date | string + team?: XOR | null + ledTeam?: XOR | null + invitations?: InvitationListRelationFilter + notifications?: NotificationListRelationFilter + matchPlayers?: MatchPlayerListRelationFilter + matchRequests?: CS2MatchRequestListRelationFilter + rankHistory?: PremierRankHistoryListRelationFilter + demoFiles?: DemoFileListRelationFilter + }, "steamId" | "teamId"> + + export type UserOrderByWithAggregationInput = { + steamId?: SortOrder + name?: SortOrderInput | SortOrder + avatar?: SortOrderInput | SortOrder + location?: SortOrderInput | SortOrder + isAdmin?: SortOrder + teamId?: SortOrderInput | SortOrder + premierRank?: SortOrderInput | SortOrder + authCode?: SortOrderInput | SortOrder + lastKnownShareCode?: SortOrderInput | SortOrder + lastKnownShareCodeDate?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: UserCountOrderByAggregateInput + _avg?: UserAvgOrderByAggregateInput + _max?: UserMaxOrderByAggregateInput + _min?: UserMinOrderByAggregateInput + _sum?: UserSumOrderByAggregateInput + } + + export type UserScalarWhereWithAggregatesInput = { + AND?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[] + OR?: UserScalarWhereWithAggregatesInput[] + NOT?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[] + steamId?: StringWithAggregatesFilter<"User"> | string + name?: StringNullableWithAggregatesFilter<"User"> | string | null + avatar?: StringNullableWithAggregatesFilter<"User"> | string | null + location?: StringNullableWithAggregatesFilter<"User"> | string | null + isAdmin?: BoolWithAggregatesFilter<"User"> | boolean + teamId?: StringNullableWithAggregatesFilter<"User"> | string | null + premierRank?: IntNullableWithAggregatesFilter<"User"> | number | null + authCode?: StringNullableWithAggregatesFilter<"User"> | string | null + lastKnownShareCode?: StringNullableWithAggregatesFilter<"User"> | string | null + lastKnownShareCodeDate?: DateTimeNullableWithAggregatesFilter<"User"> | Date | string | null + createdAt?: DateTimeWithAggregatesFilter<"User"> | Date | string + } + + export type TeamWhereInput = { + AND?: TeamWhereInput | TeamWhereInput[] + OR?: TeamWhereInput[] + NOT?: TeamWhereInput | TeamWhereInput[] + id?: StringFilter<"Team"> | string + name?: StringFilter<"Team"> | string + leaderId?: StringNullableFilter<"Team"> | string | null + logo?: StringNullableFilter<"Team"> | string | null + createdAt?: DateTimeFilter<"Team"> | Date | string + activePlayers?: StringNullableListFilter<"Team"> + inactivePlayers?: StringNullableListFilter<"Team"> + leader?: XOR | null + members?: UserListRelationFilter + invitations?: InvitationListRelationFilter + matchPlayers?: MatchPlayerListRelationFilter + matchesAsTeamA?: MatchListRelationFilter + matchesAsTeamB?: MatchListRelationFilter + } + + export type TeamOrderByWithRelationInput = { + id?: SortOrder + name?: SortOrder + leaderId?: SortOrderInput | SortOrder + logo?: SortOrderInput | SortOrder + createdAt?: SortOrder + activePlayers?: SortOrder + inactivePlayers?: SortOrder + leader?: UserOrderByWithRelationInput + members?: UserOrderByRelationAggregateInput + invitations?: InvitationOrderByRelationAggregateInput + matchPlayers?: MatchPlayerOrderByRelationAggregateInput + matchesAsTeamA?: MatchOrderByRelationAggregateInput + matchesAsTeamB?: MatchOrderByRelationAggregateInput + } + + export type TeamWhereUniqueInput = Prisma.AtLeast<{ + id?: string + name?: string + leaderId?: string + AND?: TeamWhereInput | TeamWhereInput[] + OR?: TeamWhereInput[] + NOT?: TeamWhereInput | TeamWhereInput[] + logo?: StringNullableFilter<"Team"> | string | null + createdAt?: DateTimeFilter<"Team"> | Date | string + activePlayers?: StringNullableListFilter<"Team"> + inactivePlayers?: StringNullableListFilter<"Team"> + leader?: XOR | null + members?: UserListRelationFilter + invitations?: InvitationListRelationFilter + matchPlayers?: MatchPlayerListRelationFilter + matchesAsTeamA?: MatchListRelationFilter + matchesAsTeamB?: MatchListRelationFilter + }, "id" | "name" | "leaderId"> + + export type TeamOrderByWithAggregationInput = { + id?: SortOrder + name?: SortOrder + leaderId?: SortOrderInput | SortOrder + logo?: SortOrderInput | SortOrder + createdAt?: SortOrder + activePlayers?: SortOrder + inactivePlayers?: SortOrder + _count?: TeamCountOrderByAggregateInput + _max?: TeamMaxOrderByAggregateInput + _min?: TeamMinOrderByAggregateInput + } + + export type TeamScalarWhereWithAggregatesInput = { + AND?: TeamScalarWhereWithAggregatesInput | TeamScalarWhereWithAggregatesInput[] + OR?: TeamScalarWhereWithAggregatesInput[] + NOT?: TeamScalarWhereWithAggregatesInput | TeamScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Team"> | string + name?: StringWithAggregatesFilter<"Team"> | string + leaderId?: StringNullableWithAggregatesFilter<"Team"> | string | null + logo?: StringNullableWithAggregatesFilter<"Team"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"Team"> | Date | string + activePlayers?: StringNullableListFilter<"Team"> + inactivePlayers?: StringNullableListFilter<"Team"> + } + + export type MatchWhereInput = { + AND?: MatchWhereInput | MatchWhereInput[] + OR?: MatchWhereInput[] + NOT?: MatchWhereInput | MatchWhereInput[] + matchId?: BigIntFilter<"Match"> | bigint | number + teamAId?: StringNullableFilter<"Match"> | string | null + teamBId?: StringNullableFilter<"Match"> | string | null + matchDate?: DateTimeFilter<"Match"> | Date | string + matchType?: StringFilter<"Match"> | string + map?: StringNullableFilter<"Match"> | string | null + title?: StringFilter<"Match"> | string + description?: StringNullableFilter<"Match"> | string | null + demoData?: JsonNullableFilter<"Match"> + demoFilePath?: StringNullableFilter<"Match"> | string | null + scoreA?: IntNullableFilter<"Match"> | number | null + scoreB?: IntNullableFilter<"Match"> | number | null + createdAt?: DateTimeFilter<"Match"> | Date | string + updatedAt?: DateTimeFilter<"Match"> | Date | string + teamA?: XOR | null + teamB?: XOR | null + demoFile?: XOR | null + players?: MatchPlayerListRelationFilter + rankUpdates?: PremierRankHistoryListRelationFilter + } + + export type MatchOrderByWithRelationInput = { + matchId?: SortOrder + teamAId?: SortOrderInput | SortOrder + teamBId?: SortOrderInput | SortOrder + matchDate?: SortOrder + matchType?: SortOrder + map?: SortOrderInput | SortOrder + title?: SortOrder + description?: SortOrderInput | SortOrder + demoData?: SortOrderInput | SortOrder + demoFilePath?: SortOrderInput | SortOrder + scoreA?: SortOrderInput | SortOrder + scoreB?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + teamA?: TeamOrderByWithRelationInput + teamB?: TeamOrderByWithRelationInput + demoFile?: DemoFileOrderByWithRelationInput + players?: MatchPlayerOrderByRelationAggregateInput + rankUpdates?: PremierRankHistoryOrderByRelationAggregateInput + } + + export type MatchWhereUniqueInput = Prisma.AtLeast<{ + matchId?: bigint | number + AND?: MatchWhereInput | MatchWhereInput[] + OR?: MatchWhereInput[] + NOT?: MatchWhereInput | MatchWhereInput[] + teamAId?: StringNullableFilter<"Match"> | string | null + teamBId?: StringNullableFilter<"Match"> | string | null + matchDate?: DateTimeFilter<"Match"> | Date | string + matchType?: StringFilter<"Match"> | string + map?: StringNullableFilter<"Match"> | string | null + title?: StringFilter<"Match"> | string + description?: StringNullableFilter<"Match"> | string | null + demoData?: JsonNullableFilter<"Match"> + demoFilePath?: StringNullableFilter<"Match"> | string | null + scoreA?: IntNullableFilter<"Match"> | number | null + scoreB?: IntNullableFilter<"Match"> | number | null + createdAt?: DateTimeFilter<"Match"> | Date | string + updatedAt?: DateTimeFilter<"Match"> | Date | string + teamA?: XOR | null + teamB?: XOR | null + demoFile?: XOR | null + players?: MatchPlayerListRelationFilter + rankUpdates?: PremierRankHistoryListRelationFilter + }, "matchId"> + + export type MatchOrderByWithAggregationInput = { + matchId?: SortOrder + teamAId?: SortOrderInput | SortOrder + teamBId?: SortOrderInput | SortOrder + matchDate?: SortOrder + matchType?: SortOrder + map?: SortOrderInput | SortOrder + title?: SortOrder + description?: SortOrderInput | SortOrder + demoData?: SortOrderInput | SortOrder + demoFilePath?: SortOrderInput | SortOrder + scoreA?: SortOrderInput | SortOrder + scoreB?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + _count?: MatchCountOrderByAggregateInput + _avg?: MatchAvgOrderByAggregateInput + _max?: MatchMaxOrderByAggregateInput + _min?: MatchMinOrderByAggregateInput + _sum?: MatchSumOrderByAggregateInput + } + + export type MatchScalarWhereWithAggregatesInput = { + AND?: MatchScalarWhereWithAggregatesInput | MatchScalarWhereWithAggregatesInput[] + OR?: MatchScalarWhereWithAggregatesInput[] + NOT?: MatchScalarWhereWithAggregatesInput | MatchScalarWhereWithAggregatesInput[] + matchId?: BigIntWithAggregatesFilter<"Match"> | bigint | number + teamAId?: StringNullableWithAggregatesFilter<"Match"> | string | null + teamBId?: StringNullableWithAggregatesFilter<"Match"> | string | null + matchDate?: DateTimeWithAggregatesFilter<"Match"> | Date | string + matchType?: StringWithAggregatesFilter<"Match"> | string + map?: StringNullableWithAggregatesFilter<"Match"> | string | null + title?: StringWithAggregatesFilter<"Match"> | string + description?: StringNullableWithAggregatesFilter<"Match"> | string | null + demoData?: JsonNullableWithAggregatesFilter<"Match"> + demoFilePath?: StringNullableWithAggregatesFilter<"Match"> | string | null + scoreA?: IntNullableWithAggregatesFilter<"Match"> | number | null + scoreB?: IntNullableWithAggregatesFilter<"Match"> | number | null + createdAt?: DateTimeWithAggregatesFilter<"Match"> | Date | string + updatedAt?: DateTimeWithAggregatesFilter<"Match"> | Date | string + } + + export type MatchPlayerWhereInput = { + AND?: MatchPlayerWhereInput | MatchPlayerWhereInput[] + OR?: MatchPlayerWhereInput[] + NOT?: MatchPlayerWhereInput | MatchPlayerWhereInput[] + id?: StringFilter<"MatchPlayer"> | string + matchId?: BigIntFilter<"MatchPlayer"> | bigint | number + steamId?: StringFilter<"MatchPlayer"> | string + teamId?: StringNullableFilter<"MatchPlayer"> | string | null + createdAt?: DateTimeFilter<"MatchPlayer"> | Date | string + match?: XOR + user?: XOR + team?: XOR | null + stats?: XOR | null + } + + export type MatchPlayerOrderByWithRelationInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + teamId?: SortOrderInput | SortOrder + createdAt?: SortOrder + match?: MatchOrderByWithRelationInput + user?: UserOrderByWithRelationInput + team?: TeamOrderByWithRelationInput + stats?: MatchPlayerStatsOrderByWithRelationInput + } + + export type MatchPlayerWhereUniqueInput = Prisma.AtLeast<{ + id?: string + matchId_steamId?: MatchPlayerMatchIdSteamIdCompoundUniqueInput + AND?: MatchPlayerWhereInput | MatchPlayerWhereInput[] + OR?: MatchPlayerWhereInput[] + NOT?: MatchPlayerWhereInput | MatchPlayerWhereInput[] + matchId?: BigIntFilter<"MatchPlayer"> | bigint | number + steamId?: StringFilter<"MatchPlayer"> | string + teamId?: StringNullableFilter<"MatchPlayer"> | string | null + createdAt?: DateTimeFilter<"MatchPlayer"> | Date | string + match?: XOR + user?: XOR + team?: XOR | null + stats?: XOR | null + }, "id" | "matchId_steamId"> + + export type MatchPlayerOrderByWithAggregationInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + teamId?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: MatchPlayerCountOrderByAggregateInput + _avg?: MatchPlayerAvgOrderByAggregateInput + _max?: MatchPlayerMaxOrderByAggregateInput + _min?: MatchPlayerMinOrderByAggregateInput + _sum?: MatchPlayerSumOrderByAggregateInput + } + + export type MatchPlayerScalarWhereWithAggregatesInput = { + AND?: MatchPlayerScalarWhereWithAggregatesInput | MatchPlayerScalarWhereWithAggregatesInput[] + OR?: MatchPlayerScalarWhereWithAggregatesInput[] + NOT?: MatchPlayerScalarWhereWithAggregatesInput | MatchPlayerScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"MatchPlayer"> | string + matchId?: BigIntWithAggregatesFilter<"MatchPlayer"> | bigint | number + steamId?: StringWithAggregatesFilter<"MatchPlayer"> | string + teamId?: StringNullableWithAggregatesFilter<"MatchPlayer"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"MatchPlayer"> | Date | string + } + + export type MatchPlayerStatsWhereInput = { + AND?: MatchPlayerStatsWhereInput | MatchPlayerStatsWhereInput[] + OR?: MatchPlayerStatsWhereInput[] + NOT?: MatchPlayerStatsWhereInput | MatchPlayerStatsWhereInput[] + id?: StringFilter<"MatchPlayerStats"> | string + matchPlayerId?: StringFilter<"MatchPlayerStats"> | string + kills?: IntFilter<"MatchPlayerStats"> | number + assists?: IntFilter<"MatchPlayerStats"> | number + deaths?: IntFilter<"MatchPlayerStats"> | number + adr?: FloatFilter<"MatchPlayerStats"> | number + headshotPct?: FloatFilter<"MatchPlayerStats"> | number + flashAssists?: IntFilter<"MatchPlayerStats"> | number + mvps?: IntFilter<"MatchPlayerStats"> | number + mvpEliminations?: IntFilter<"MatchPlayerStats"> | number + mvpDefuse?: IntFilter<"MatchPlayerStats"> | number + mvpPlant?: IntFilter<"MatchPlayerStats"> | number + knifeKills?: IntFilter<"MatchPlayerStats"> | number + zeusKills?: IntFilter<"MatchPlayerStats"> | number + wallbangKills?: IntFilter<"MatchPlayerStats"> | number + smokeKills?: IntFilter<"MatchPlayerStats"> | number + headshots?: IntFilter<"MatchPlayerStats"> | number + noScopes?: IntFilter<"MatchPlayerStats"> | number + blindKills?: IntFilter<"MatchPlayerStats"> | number + rankOld?: IntNullableFilter<"MatchPlayerStats"> | number | null + rankNew?: IntNullableFilter<"MatchPlayerStats"> | number | null + winCount?: IntNullableFilter<"MatchPlayerStats"> | number | null + matchPlayer?: XOR + } + + export type MatchPlayerStatsOrderByWithRelationInput = { + id?: SortOrder + matchPlayerId?: SortOrder + kills?: SortOrder + assists?: SortOrder + deaths?: SortOrder + adr?: SortOrder + headshotPct?: SortOrder + flashAssists?: SortOrder + mvps?: SortOrder + mvpEliminations?: SortOrder + mvpDefuse?: SortOrder + mvpPlant?: SortOrder + knifeKills?: SortOrder + zeusKills?: SortOrder + wallbangKills?: SortOrder + smokeKills?: SortOrder + headshots?: SortOrder + noScopes?: SortOrder + blindKills?: SortOrder + rankOld?: SortOrderInput | SortOrder + rankNew?: SortOrderInput | SortOrder + winCount?: SortOrderInput | SortOrder + matchPlayer?: MatchPlayerOrderByWithRelationInput + } + + export type MatchPlayerStatsWhereUniqueInput = Prisma.AtLeast<{ + id?: string + matchPlayerId?: string + AND?: MatchPlayerStatsWhereInput | MatchPlayerStatsWhereInput[] + OR?: MatchPlayerStatsWhereInput[] + NOT?: MatchPlayerStatsWhereInput | MatchPlayerStatsWhereInput[] + kills?: IntFilter<"MatchPlayerStats"> | number + assists?: IntFilter<"MatchPlayerStats"> | number + deaths?: IntFilter<"MatchPlayerStats"> | number + adr?: FloatFilter<"MatchPlayerStats"> | number + headshotPct?: FloatFilter<"MatchPlayerStats"> | number + flashAssists?: IntFilter<"MatchPlayerStats"> | number + mvps?: IntFilter<"MatchPlayerStats"> | number + mvpEliminations?: IntFilter<"MatchPlayerStats"> | number + mvpDefuse?: IntFilter<"MatchPlayerStats"> | number + mvpPlant?: IntFilter<"MatchPlayerStats"> | number + knifeKills?: IntFilter<"MatchPlayerStats"> | number + zeusKills?: IntFilter<"MatchPlayerStats"> | number + wallbangKills?: IntFilter<"MatchPlayerStats"> | number + smokeKills?: IntFilter<"MatchPlayerStats"> | number + headshots?: IntFilter<"MatchPlayerStats"> | number + noScopes?: IntFilter<"MatchPlayerStats"> | number + blindKills?: IntFilter<"MatchPlayerStats"> | number + rankOld?: IntNullableFilter<"MatchPlayerStats"> | number | null + rankNew?: IntNullableFilter<"MatchPlayerStats"> | number | null + winCount?: IntNullableFilter<"MatchPlayerStats"> | number | null + matchPlayer?: XOR + }, "id" | "matchPlayerId"> + + export type MatchPlayerStatsOrderByWithAggregationInput = { + id?: SortOrder + matchPlayerId?: SortOrder + kills?: SortOrder + assists?: SortOrder + deaths?: SortOrder + adr?: SortOrder + headshotPct?: SortOrder + flashAssists?: SortOrder + mvps?: SortOrder + mvpEliminations?: SortOrder + mvpDefuse?: SortOrder + mvpPlant?: SortOrder + knifeKills?: SortOrder + zeusKills?: SortOrder + wallbangKills?: SortOrder + smokeKills?: SortOrder + headshots?: SortOrder + noScopes?: SortOrder + blindKills?: SortOrder + rankOld?: SortOrderInput | SortOrder + rankNew?: SortOrderInput | SortOrder + winCount?: SortOrderInput | SortOrder + _count?: MatchPlayerStatsCountOrderByAggregateInput + _avg?: MatchPlayerStatsAvgOrderByAggregateInput + _max?: MatchPlayerStatsMaxOrderByAggregateInput + _min?: MatchPlayerStatsMinOrderByAggregateInput + _sum?: MatchPlayerStatsSumOrderByAggregateInput + } + + export type MatchPlayerStatsScalarWhereWithAggregatesInput = { + AND?: MatchPlayerStatsScalarWhereWithAggregatesInput | MatchPlayerStatsScalarWhereWithAggregatesInput[] + OR?: MatchPlayerStatsScalarWhereWithAggregatesInput[] + NOT?: MatchPlayerStatsScalarWhereWithAggregatesInput | MatchPlayerStatsScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"MatchPlayerStats"> | string + matchPlayerId?: StringWithAggregatesFilter<"MatchPlayerStats"> | string + kills?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + assists?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + deaths?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + adr?: FloatWithAggregatesFilter<"MatchPlayerStats"> | number + headshotPct?: FloatWithAggregatesFilter<"MatchPlayerStats"> | number + flashAssists?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + mvps?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + mvpEliminations?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + mvpDefuse?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + mvpPlant?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + knifeKills?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + zeusKills?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + wallbangKills?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + smokeKills?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + headshots?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + noScopes?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + blindKills?: IntWithAggregatesFilter<"MatchPlayerStats"> | number + rankOld?: IntNullableWithAggregatesFilter<"MatchPlayerStats"> | number | null + rankNew?: IntNullableWithAggregatesFilter<"MatchPlayerStats"> | number | null + winCount?: IntNullableWithAggregatesFilter<"MatchPlayerStats"> | number | null + } + + export type DemoFileWhereInput = { + AND?: DemoFileWhereInput | DemoFileWhereInput[] + OR?: DemoFileWhereInput[] + NOT?: DemoFileWhereInput | DemoFileWhereInput[] + id?: StringFilter<"DemoFile"> | string + matchId?: BigIntFilter<"DemoFile"> | bigint | number + steamId?: StringFilter<"DemoFile"> | string + fileName?: StringFilter<"DemoFile"> | string + filePath?: StringFilter<"DemoFile"> | string + parsed?: BoolFilter<"DemoFile"> | boolean + createdAt?: DateTimeFilter<"DemoFile"> | Date | string + match?: XOR + user?: XOR + } + + export type DemoFileOrderByWithRelationInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + fileName?: SortOrder + filePath?: SortOrder + parsed?: SortOrder + createdAt?: SortOrder + match?: MatchOrderByWithRelationInput + user?: UserOrderByWithRelationInput + } + + export type DemoFileWhereUniqueInput = Prisma.AtLeast<{ + id?: string + matchId?: bigint | number + fileName?: string + AND?: DemoFileWhereInput | DemoFileWhereInput[] + OR?: DemoFileWhereInput[] + NOT?: DemoFileWhereInput | DemoFileWhereInput[] + steamId?: StringFilter<"DemoFile"> | string + filePath?: StringFilter<"DemoFile"> | string + parsed?: BoolFilter<"DemoFile"> | boolean + createdAt?: DateTimeFilter<"DemoFile"> | Date | string + match?: XOR + user?: XOR + }, "id" | "matchId" | "fileName"> + + export type DemoFileOrderByWithAggregationInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + fileName?: SortOrder + filePath?: SortOrder + parsed?: SortOrder + createdAt?: SortOrder + _count?: DemoFileCountOrderByAggregateInput + _avg?: DemoFileAvgOrderByAggregateInput + _max?: DemoFileMaxOrderByAggregateInput + _min?: DemoFileMinOrderByAggregateInput + _sum?: DemoFileSumOrderByAggregateInput + } + + export type DemoFileScalarWhereWithAggregatesInput = { + AND?: DemoFileScalarWhereWithAggregatesInput | DemoFileScalarWhereWithAggregatesInput[] + OR?: DemoFileScalarWhereWithAggregatesInput[] + NOT?: DemoFileScalarWhereWithAggregatesInput | DemoFileScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"DemoFile"> | string + matchId?: BigIntWithAggregatesFilter<"DemoFile"> | bigint | number + steamId?: StringWithAggregatesFilter<"DemoFile"> | string + fileName?: StringWithAggregatesFilter<"DemoFile"> | string + filePath?: StringWithAggregatesFilter<"DemoFile"> | string + parsed?: BoolWithAggregatesFilter<"DemoFile"> | boolean + createdAt?: DateTimeWithAggregatesFilter<"DemoFile"> | Date | string + } + + export type InvitationWhereInput = { + AND?: InvitationWhereInput | InvitationWhereInput[] + OR?: InvitationWhereInput[] + NOT?: InvitationWhereInput | InvitationWhereInput[] + id?: StringFilter<"Invitation"> | string + userId?: StringFilter<"Invitation"> | string + teamId?: StringFilter<"Invitation"> | string + type?: StringFilter<"Invitation"> | string + createdAt?: DateTimeFilter<"Invitation"> | Date | string + user?: XOR + team?: XOR + } + + export type InvitationOrderByWithRelationInput = { + id?: SortOrder + userId?: SortOrder + teamId?: SortOrder + type?: SortOrder + createdAt?: SortOrder + user?: UserOrderByWithRelationInput + team?: TeamOrderByWithRelationInput + } + + export type InvitationWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: InvitationWhereInput | InvitationWhereInput[] + OR?: InvitationWhereInput[] + NOT?: InvitationWhereInput | InvitationWhereInput[] + userId?: StringFilter<"Invitation"> | string + teamId?: StringFilter<"Invitation"> | string + type?: StringFilter<"Invitation"> | string + createdAt?: DateTimeFilter<"Invitation"> | Date | string + user?: XOR + team?: XOR + }, "id"> + + export type InvitationOrderByWithAggregationInput = { + id?: SortOrder + userId?: SortOrder + teamId?: SortOrder + type?: SortOrder + createdAt?: SortOrder + _count?: InvitationCountOrderByAggregateInput + _max?: InvitationMaxOrderByAggregateInput + _min?: InvitationMinOrderByAggregateInput + } + + export type InvitationScalarWhereWithAggregatesInput = { + AND?: InvitationScalarWhereWithAggregatesInput | InvitationScalarWhereWithAggregatesInput[] + OR?: InvitationScalarWhereWithAggregatesInput[] + NOT?: InvitationScalarWhereWithAggregatesInput | InvitationScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Invitation"> | string + userId?: StringWithAggregatesFilter<"Invitation"> | string + teamId?: StringWithAggregatesFilter<"Invitation"> | string + type?: StringWithAggregatesFilter<"Invitation"> | string + createdAt?: DateTimeWithAggregatesFilter<"Invitation"> | Date | string + } + + export type NotificationWhereInput = { + AND?: NotificationWhereInput | NotificationWhereInput[] + OR?: NotificationWhereInput[] + NOT?: NotificationWhereInput | NotificationWhereInput[] + id?: StringFilter<"Notification"> | string + userId?: StringFilter<"Notification"> | string + title?: StringNullableFilter<"Notification"> | string | null + message?: StringFilter<"Notification"> | string + read?: BoolFilter<"Notification"> | boolean + persistent?: BoolFilter<"Notification"> | boolean + actionType?: StringNullableFilter<"Notification"> | string | null + actionData?: StringNullableFilter<"Notification"> | string | null + createdAt?: DateTimeFilter<"Notification"> | Date | string + user?: XOR + } + + export type NotificationOrderByWithRelationInput = { + id?: SortOrder + userId?: SortOrder + title?: SortOrderInput | SortOrder + message?: SortOrder + read?: SortOrder + persistent?: SortOrder + actionType?: SortOrderInput | SortOrder + actionData?: SortOrderInput | SortOrder + createdAt?: SortOrder + user?: UserOrderByWithRelationInput + } + + export type NotificationWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: NotificationWhereInput | NotificationWhereInput[] + OR?: NotificationWhereInput[] + NOT?: NotificationWhereInput | NotificationWhereInput[] + userId?: StringFilter<"Notification"> | string + title?: StringNullableFilter<"Notification"> | string | null + message?: StringFilter<"Notification"> | string + read?: BoolFilter<"Notification"> | boolean + persistent?: BoolFilter<"Notification"> | boolean + actionType?: StringNullableFilter<"Notification"> | string | null + actionData?: StringNullableFilter<"Notification"> | string | null + createdAt?: DateTimeFilter<"Notification"> | Date | string + user?: XOR + }, "id"> + + export type NotificationOrderByWithAggregationInput = { + id?: SortOrder + userId?: SortOrder + title?: SortOrderInput | SortOrder + message?: SortOrder + read?: SortOrder + persistent?: SortOrder + actionType?: SortOrderInput | SortOrder + actionData?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: NotificationCountOrderByAggregateInput + _max?: NotificationMaxOrderByAggregateInput + _min?: NotificationMinOrderByAggregateInput + } + + export type NotificationScalarWhereWithAggregatesInput = { + AND?: NotificationScalarWhereWithAggregatesInput | NotificationScalarWhereWithAggregatesInput[] + OR?: NotificationScalarWhereWithAggregatesInput[] + NOT?: NotificationScalarWhereWithAggregatesInput | NotificationScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Notification"> | string + userId?: StringWithAggregatesFilter<"Notification"> | string + title?: StringNullableWithAggregatesFilter<"Notification"> | string | null + message?: StringWithAggregatesFilter<"Notification"> | string + read?: BoolWithAggregatesFilter<"Notification"> | boolean + persistent?: BoolWithAggregatesFilter<"Notification"> | boolean + actionType?: StringNullableWithAggregatesFilter<"Notification"> | string | null + actionData?: StringNullableWithAggregatesFilter<"Notification"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"Notification"> | Date | string + } + + export type CS2MatchRequestWhereInput = { + AND?: CS2MatchRequestWhereInput | CS2MatchRequestWhereInput[] + OR?: CS2MatchRequestWhereInput[] + NOT?: CS2MatchRequestWhereInput | CS2MatchRequestWhereInput[] + id?: StringFilter<"CS2MatchRequest"> | string + userId?: StringFilter<"CS2MatchRequest"> | string + steamId?: StringFilter<"CS2MatchRequest"> | string + matchId?: BigIntFilter<"CS2MatchRequest"> | bigint | number + reservationId?: BigIntFilter<"CS2MatchRequest"> | bigint | number + tvPort?: BigIntFilter<"CS2MatchRequest"> | bigint | number + processed?: BoolFilter<"CS2MatchRequest"> | boolean + createdAt?: DateTimeFilter<"CS2MatchRequest"> | Date | string + user?: XOR + } + + export type CS2MatchRequestOrderByWithRelationInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrder + reservationId?: SortOrder + tvPort?: SortOrder + processed?: SortOrder + createdAt?: SortOrder + user?: UserOrderByWithRelationInput + } + + export type CS2MatchRequestWhereUniqueInput = Prisma.AtLeast<{ + id?: string + steamId_matchId?: CS2MatchRequestSteamIdMatchIdCompoundUniqueInput + AND?: CS2MatchRequestWhereInput | CS2MatchRequestWhereInput[] + OR?: CS2MatchRequestWhereInput[] + NOT?: CS2MatchRequestWhereInput | CS2MatchRequestWhereInput[] + userId?: StringFilter<"CS2MatchRequest"> | string + steamId?: StringFilter<"CS2MatchRequest"> | string + matchId?: BigIntFilter<"CS2MatchRequest"> | bigint | number + reservationId?: BigIntFilter<"CS2MatchRequest"> | bigint | number + tvPort?: BigIntFilter<"CS2MatchRequest"> | bigint | number + processed?: BoolFilter<"CS2MatchRequest"> | boolean + createdAt?: DateTimeFilter<"CS2MatchRequest"> | Date | string + user?: XOR + }, "id" | "steamId_matchId"> + + export type CS2MatchRequestOrderByWithAggregationInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrder + reservationId?: SortOrder + tvPort?: SortOrder + processed?: SortOrder + createdAt?: SortOrder + _count?: CS2MatchRequestCountOrderByAggregateInput + _avg?: CS2MatchRequestAvgOrderByAggregateInput + _max?: CS2MatchRequestMaxOrderByAggregateInput + _min?: CS2MatchRequestMinOrderByAggregateInput + _sum?: CS2MatchRequestSumOrderByAggregateInput + } + + export type CS2MatchRequestScalarWhereWithAggregatesInput = { + AND?: CS2MatchRequestScalarWhereWithAggregatesInput | CS2MatchRequestScalarWhereWithAggregatesInput[] + OR?: CS2MatchRequestScalarWhereWithAggregatesInput[] + NOT?: CS2MatchRequestScalarWhereWithAggregatesInput | CS2MatchRequestScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"CS2MatchRequest"> | string + userId?: StringWithAggregatesFilter<"CS2MatchRequest"> | string + steamId?: StringWithAggregatesFilter<"CS2MatchRequest"> | string + matchId?: BigIntWithAggregatesFilter<"CS2MatchRequest"> | bigint | number + reservationId?: BigIntWithAggregatesFilter<"CS2MatchRequest"> | bigint | number + tvPort?: BigIntWithAggregatesFilter<"CS2MatchRequest"> | bigint | number + processed?: BoolWithAggregatesFilter<"CS2MatchRequest"> | boolean + createdAt?: DateTimeWithAggregatesFilter<"CS2MatchRequest"> | Date | string + } + + export type PremierRankHistoryWhereInput = { + AND?: PremierRankHistoryWhereInput | PremierRankHistoryWhereInput[] + OR?: PremierRankHistoryWhereInput[] + NOT?: PremierRankHistoryWhereInput | PremierRankHistoryWhereInput[] + id?: StringFilter<"PremierRankHistory"> | string + userId?: StringFilter<"PremierRankHistory"> | string + steamId?: StringFilter<"PremierRankHistory"> | string + matchId?: BigIntNullableFilter<"PremierRankHistory"> | bigint | number | null + rankOld?: IntFilter<"PremierRankHistory"> | number + rankNew?: IntFilter<"PremierRankHistory"> | number + delta?: IntFilter<"PremierRankHistory"> | number + winCount?: IntFilter<"PremierRankHistory"> | number + createdAt?: DateTimeFilter<"PremierRankHistory"> | Date | string + user?: XOR + match?: XOR | null + } + + export type PremierRankHistoryOrderByWithRelationInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrderInput | SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + delta?: SortOrder + winCount?: SortOrder + createdAt?: SortOrder + user?: UserOrderByWithRelationInput + match?: MatchOrderByWithRelationInput + } + + export type PremierRankHistoryWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: PremierRankHistoryWhereInput | PremierRankHistoryWhereInput[] + OR?: PremierRankHistoryWhereInput[] + NOT?: PremierRankHistoryWhereInput | PremierRankHistoryWhereInput[] + userId?: StringFilter<"PremierRankHistory"> | string + steamId?: StringFilter<"PremierRankHistory"> | string + matchId?: BigIntNullableFilter<"PremierRankHistory"> | bigint | number | null + rankOld?: IntFilter<"PremierRankHistory"> | number + rankNew?: IntFilter<"PremierRankHistory"> | number + delta?: IntFilter<"PremierRankHistory"> | number + winCount?: IntFilter<"PremierRankHistory"> | number + createdAt?: DateTimeFilter<"PremierRankHistory"> | Date | string + user?: XOR + match?: XOR | null + }, "id"> + + export type PremierRankHistoryOrderByWithAggregationInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrderInput | SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + delta?: SortOrder + winCount?: SortOrder + createdAt?: SortOrder + _count?: PremierRankHistoryCountOrderByAggregateInput + _avg?: PremierRankHistoryAvgOrderByAggregateInput + _max?: PremierRankHistoryMaxOrderByAggregateInput + _min?: PremierRankHistoryMinOrderByAggregateInput + _sum?: PremierRankHistorySumOrderByAggregateInput + } + + export type PremierRankHistoryScalarWhereWithAggregatesInput = { + AND?: PremierRankHistoryScalarWhereWithAggregatesInput | PremierRankHistoryScalarWhereWithAggregatesInput[] + OR?: PremierRankHistoryScalarWhereWithAggregatesInput[] + NOT?: PremierRankHistoryScalarWhereWithAggregatesInput | PremierRankHistoryScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"PremierRankHistory"> | string + userId?: StringWithAggregatesFilter<"PremierRankHistory"> | string + steamId?: StringWithAggregatesFilter<"PremierRankHistory"> | string + matchId?: BigIntNullableWithAggregatesFilter<"PremierRankHistory"> | bigint | number | null + rankOld?: IntWithAggregatesFilter<"PremierRankHistory"> | number + rankNew?: IntWithAggregatesFilter<"PremierRankHistory"> | number + delta?: IntWithAggregatesFilter<"PremierRankHistory"> | number + winCount?: IntWithAggregatesFilter<"PremierRankHistory"> | number + createdAt?: DateTimeWithAggregatesFilter<"PremierRankHistory"> | Date | string + } + + export type UserCreateInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + team?: TeamCreateNestedOneWithoutMembersInput + ledTeam?: TeamCreateNestedOneWithoutLeaderInput + invitations?: InvitationCreateNestedManyWithoutUserInput + notifications?: NotificationCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryCreateNestedManyWithoutUserInput + demoFiles?: DemoFileCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamUncheckedCreateNestedOneWithoutLeaderInput + invitations?: InvitationUncheckedCreateNestedManyWithoutUserInput + notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput + demoFiles?: DemoFileUncheckedCreateNestedManyWithoutUserInput + } + + export type UserUpdateInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneWithoutMembersNestedInput + ledTeam?: TeamUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUpdateManyWithoutUserNestedInput + notifications?: NotificationUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUncheckedUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutUserNestedInput + notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUncheckedUpdateManyWithoutUserNestedInput + } + + export type UserCreateManyInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + } + + export type UserUpdateManyMutationInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UserUncheckedUpdateManyInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TeamCreateInput = { + id?: string + name: string + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + leader?: UserCreateNestedOneWithoutLedTeamInput + members?: UserCreateNestedManyWithoutTeamInput + invitations?: InvitationCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchCreateNestedManyWithoutTeamBInput + } + + export type TeamUncheckedCreateInput = { + id?: string + name: string + leaderId?: string | null + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + members?: UserUncheckedCreateNestedManyWithoutTeamInput + invitations?: InvitationUncheckedCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchUncheckedCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchUncheckedCreateNestedManyWithoutTeamBInput + } + + export type TeamUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + leader?: UserUpdateOneWithoutLedTeamNestedInput + members?: UserUpdateManyWithoutTeamNestedInput + invitations?: InvitationUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUpdateManyWithoutTeamBNestedInput + } + + export type TeamUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + leaderId?: NullableStringFieldUpdateOperationsInput | string | null + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + members?: UserUncheckedUpdateManyWithoutTeamNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUncheckedUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUncheckedUpdateManyWithoutTeamBNestedInput + } + + export type TeamCreateManyInput = { + id?: string + name: string + leaderId?: string | null + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + } + + export type TeamUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + } + + export type TeamUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + leaderId?: NullableStringFieldUpdateOperationsInput | string | null + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + } + + export type MatchCreateInput = { + matchId?: bigint | number + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + teamA?: TeamCreateNestedOneWithoutMatchesAsTeamAInput + teamB?: TeamCreateNestedOneWithoutMatchesAsTeamBInput + demoFile?: DemoFileCreateNestedOneWithoutMatchInput + players?: MatchPlayerCreateNestedManyWithoutMatchInput + rankUpdates?: PremierRankHistoryCreateNestedManyWithoutMatchInput + } + + export type MatchUncheckedCreateInput = { + matchId?: bigint | number + teamAId?: string | null + teamBId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + demoFile?: DemoFileUncheckedCreateNestedOneWithoutMatchInput + players?: MatchPlayerUncheckedCreateNestedManyWithoutMatchInput + rankUpdates?: PremierRankHistoryUncheckedCreateNestedManyWithoutMatchInput + } + + export type MatchUpdateInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + teamA?: TeamUpdateOneWithoutMatchesAsTeamANestedInput + teamB?: TeamUpdateOneWithoutMatchesAsTeamBNestedInput + demoFile?: DemoFileUpdateOneWithoutMatchNestedInput + players?: MatchPlayerUpdateManyWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUpdateManyWithoutMatchNestedInput + } + + export type MatchUncheckedUpdateInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamAId?: NullableStringFieldUpdateOperationsInput | string | null + teamBId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + demoFile?: DemoFileUncheckedUpdateOneWithoutMatchNestedInput + players?: MatchPlayerUncheckedUpdateManyWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUncheckedUpdateManyWithoutMatchNestedInput + } + + export type MatchCreateManyInput = { + matchId?: bigint | number + teamAId?: string | null + teamBId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type MatchUpdateManyMutationInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchUncheckedUpdateManyInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamAId?: NullableStringFieldUpdateOperationsInput | string | null + teamBId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchPlayerCreateInput = { + id?: string + createdAt?: Date | string + match: MatchCreateNestedOneWithoutPlayersInput + user: UserCreateNestedOneWithoutMatchPlayersInput + team?: TeamCreateNestedOneWithoutMatchPlayersInput + stats?: MatchPlayerStatsCreateNestedOneWithoutMatchPlayerInput + } + + export type MatchPlayerUncheckedCreateInput = { + id?: string + matchId: bigint | number + steamId: string + teamId?: string | null + createdAt?: Date | string + stats?: MatchPlayerStatsUncheckedCreateNestedOneWithoutMatchPlayerInput + } + + export type MatchPlayerUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + match?: MatchUpdateOneRequiredWithoutPlayersNestedInput + user?: UserUpdateOneRequiredWithoutMatchPlayersNestedInput + team?: TeamUpdateOneWithoutMatchPlayersNestedInput + stats?: MatchPlayerStatsUpdateOneWithoutMatchPlayerNestedInput + } + + export type MatchPlayerUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + steamId?: StringFieldUpdateOperationsInput | string + teamId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + stats?: MatchPlayerStatsUncheckedUpdateOneWithoutMatchPlayerNestedInput + } + + export type MatchPlayerCreateManyInput = { + id?: string + matchId: bigint | number + steamId: string + teamId?: string | null + createdAt?: Date | string + } + + export type MatchPlayerUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchPlayerUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + steamId?: StringFieldUpdateOperationsInput | string + teamId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchPlayerStatsCreateInput = { + id?: string + kills: number + assists: number + deaths: number + adr: number + headshotPct: number + flashAssists?: number + mvps?: number + mvpEliminations?: number + mvpDefuse?: number + mvpPlant?: number + knifeKills?: number + zeusKills?: number + wallbangKills?: number + smokeKills?: number + headshots?: number + noScopes?: number + blindKills?: number + rankOld?: number | null + rankNew?: number | null + winCount?: number | null + matchPlayer: MatchPlayerCreateNestedOneWithoutStatsInput + } + + export type MatchPlayerStatsUncheckedCreateInput = { + id?: string + matchPlayerId: string + kills: number + assists: number + deaths: number + adr: number + headshotPct: number + flashAssists?: number + mvps?: number + mvpEliminations?: number + mvpDefuse?: number + mvpPlant?: number + knifeKills?: number + zeusKills?: number + wallbangKills?: number + smokeKills?: number + headshots?: number + noScopes?: number + blindKills?: number + rankOld?: number | null + rankNew?: number | null + winCount?: number | null + } + + export type MatchPlayerStatsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + kills?: IntFieldUpdateOperationsInput | number + assists?: IntFieldUpdateOperationsInput | number + deaths?: IntFieldUpdateOperationsInput | number + adr?: FloatFieldUpdateOperationsInput | number + headshotPct?: FloatFieldUpdateOperationsInput | number + flashAssists?: IntFieldUpdateOperationsInput | number + mvps?: IntFieldUpdateOperationsInput | number + mvpEliminations?: IntFieldUpdateOperationsInput | number + mvpDefuse?: IntFieldUpdateOperationsInput | number + mvpPlant?: IntFieldUpdateOperationsInput | number + knifeKills?: IntFieldUpdateOperationsInput | number + zeusKills?: IntFieldUpdateOperationsInput | number + wallbangKills?: IntFieldUpdateOperationsInput | number + smokeKills?: IntFieldUpdateOperationsInput | number + headshots?: IntFieldUpdateOperationsInput | number + noScopes?: IntFieldUpdateOperationsInput | number + blindKills?: IntFieldUpdateOperationsInput | number + rankOld?: NullableIntFieldUpdateOperationsInput | number | null + rankNew?: NullableIntFieldUpdateOperationsInput | number | null + winCount?: NullableIntFieldUpdateOperationsInput | number | null + matchPlayer?: MatchPlayerUpdateOneRequiredWithoutStatsNestedInput + } + + export type MatchPlayerStatsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + matchPlayerId?: StringFieldUpdateOperationsInput | string + kills?: IntFieldUpdateOperationsInput | number + assists?: IntFieldUpdateOperationsInput | number + deaths?: IntFieldUpdateOperationsInput | number + adr?: FloatFieldUpdateOperationsInput | number + headshotPct?: FloatFieldUpdateOperationsInput | number + flashAssists?: IntFieldUpdateOperationsInput | number + mvps?: IntFieldUpdateOperationsInput | number + mvpEliminations?: IntFieldUpdateOperationsInput | number + mvpDefuse?: IntFieldUpdateOperationsInput | number + mvpPlant?: IntFieldUpdateOperationsInput | number + knifeKills?: IntFieldUpdateOperationsInput | number + zeusKills?: IntFieldUpdateOperationsInput | number + wallbangKills?: IntFieldUpdateOperationsInput | number + smokeKills?: IntFieldUpdateOperationsInput | number + headshots?: IntFieldUpdateOperationsInput | number + noScopes?: IntFieldUpdateOperationsInput | number + blindKills?: IntFieldUpdateOperationsInput | number + rankOld?: NullableIntFieldUpdateOperationsInput | number | null + rankNew?: NullableIntFieldUpdateOperationsInput | number | null + winCount?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type MatchPlayerStatsCreateManyInput = { + id?: string + matchPlayerId: string + kills: number + assists: number + deaths: number + adr: number + headshotPct: number + flashAssists?: number + mvps?: number + mvpEliminations?: number + mvpDefuse?: number + mvpPlant?: number + knifeKills?: number + zeusKills?: number + wallbangKills?: number + smokeKills?: number + headshots?: number + noScopes?: number + blindKills?: number + rankOld?: number | null + rankNew?: number | null + winCount?: number | null + } + + export type MatchPlayerStatsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + kills?: IntFieldUpdateOperationsInput | number + assists?: IntFieldUpdateOperationsInput | number + deaths?: IntFieldUpdateOperationsInput | number + adr?: FloatFieldUpdateOperationsInput | number + headshotPct?: FloatFieldUpdateOperationsInput | number + flashAssists?: IntFieldUpdateOperationsInput | number + mvps?: IntFieldUpdateOperationsInput | number + mvpEliminations?: IntFieldUpdateOperationsInput | number + mvpDefuse?: IntFieldUpdateOperationsInput | number + mvpPlant?: IntFieldUpdateOperationsInput | number + knifeKills?: IntFieldUpdateOperationsInput | number + zeusKills?: IntFieldUpdateOperationsInput | number + wallbangKills?: IntFieldUpdateOperationsInput | number + smokeKills?: IntFieldUpdateOperationsInput | number + headshots?: IntFieldUpdateOperationsInput | number + noScopes?: IntFieldUpdateOperationsInput | number + blindKills?: IntFieldUpdateOperationsInput | number + rankOld?: NullableIntFieldUpdateOperationsInput | number | null + rankNew?: NullableIntFieldUpdateOperationsInput | number | null + winCount?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type MatchPlayerStatsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + matchPlayerId?: StringFieldUpdateOperationsInput | string + kills?: IntFieldUpdateOperationsInput | number + assists?: IntFieldUpdateOperationsInput | number + deaths?: IntFieldUpdateOperationsInput | number + adr?: FloatFieldUpdateOperationsInput | number + headshotPct?: FloatFieldUpdateOperationsInput | number + flashAssists?: IntFieldUpdateOperationsInput | number + mvps?: IntFieldUpdateOperationsInput | number + mvpEliminations?: IntFieldUpdateOperationsInput | number + mvpDefuse?: IntFieldUpdateOperationsInput | number + mvpPlant?: IntFieldUpdateOperationsInput | number + knifeKills?: IntFieldUpdateOperationsInput | number + zeusKills?: IntFieldUpdateOperationsInput | number + wallbangKills?: IntFieldUpdateOperationsInput | number + smokeKills?: IntFieldUpdateOperationsInput | number + headshots?: IntFieldUpdateOperationsInput | number + noScopes?: IntFieldUpdateOperationsInput | number + blindKills?: IntFieldUpdateOperationsInput | number + rankOld?: NullableIntFieldUpdateOperationsInput | number | null + rankNew?: NullableIntFieldUpdateOperationsInput | number | null + winCount?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type DemoFileCreateInput = { + id?: string + fileName: string + filePath: string + parsed?: boolean + createdAt?: Date | string + match: MatchCreateNestedOneWithoutDemoFileInput + user: UserCreateNestedOneWithoutDemoFilesInput + } + + export type DemoFileUncheckedCreateInput = { + id?: string + matchId: bigint | number + steamId: string + fileName: string + filePath: string + parsed?: boolean + createdAt?: Date | string + } + + export type DemoFileUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + match?: MatchUpdateOneRequiredWithoutDemoFileNestedInput + user?: UserUpdateOneRequiredWithoutDemoFilesNestedInput + } + + export type DemoFileUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + steamId?: StringFieldUpdateOperationsInput | string + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DemoFileCreateManyInput = { + id?: string + matchId: bigint | number + steamId: string + fileName: string + filePath: string + parsed?: boolean + createdAt?: Date | string + } + + export type DemoFileUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DemoFileUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + steamId?: StringFieldUpdateOperationsInput | string + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type InvitationCreateInput = { + id?: string + type: string + createdAt?: Date | string + user: UserCreateNestedOneWithoutInvitationsInput + team: TeamCreateNestedOneWithoutInvitationsInput + } + + export type InvitationUncheckedCreateInput = { + id?: string + userId: string + teamId: string + type: string + createdAt?: Date | string + } + + export type InvitationUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutInvitationsNestedInput + team?: TeamUpdateOneRequiredWithoutInvitationsNestedInput + } + + export type InvitationUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + teamId?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type InvitationCreateManyInput = { + id?: string + userId: string + teamId: string + type: string + createdAt?: Date | string + } + + export type InvitationUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type InvitationUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + teamId?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationCreateInput = { + id?: string + title?: string | null + message: string + read?: boolean + persistent?: boolean + actionType?: string | null + actionData?: string | null + createdAt?: Date | string + user: UserCreateNestedOneWithoutNotificationsInput + } + + export type NotificationUncheckedCreateInput = { + id?: string + userId: string + title?: string | null + message: string + read?: boolean + persistent?: boolean + actionType?: string | null + actionData?: string | null + createdAt?: Date | string + } + + export type NotificationUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + title?: NullableStringFieldUpdateOperationsInput | string | null + message?: StringFieldUpdateOperationsInput | string + read?: BoolFieldUpdateOperationsInput | boolean + persistent?: BoolFieldUpdateOperationsInput | boolean + actionType?: NullableStringFieldUpdateOperationsInput | string | null + actionData?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutNotificationsNestedInput + } + + export type NotificationUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + title?: NullableStringFieldUpdateOperationsInput | string | null + message?: StringFieldUpdateOperationsInput | string + read?: BoolFieldUpdateOperationsInput | boolean + persistent?: BoolFieldUpdateOperationsInput | boolean + actionType?: NullableStringFieldUpdateOperationsInput | string | null + actionData?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationCreateManyInput = { + id?: string + userId: string + title?: string | null + message: string + read?: boolean + persistent?: boolean + actionType?: string | null + actionData?: string | null + createdAt?: Date | string + } + + export type NotificationUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + title?: NullableStringFieldUpdateOperationsInput | string | null + message?: StringFieldUpdateOperationsInput | string + read?: BoolFieldUpdateOperationsInput | boolean + persistent?: BoolFieldUpdateOperationsInput | boolean + actionType?: NullableStringFieldUpdateOperationsInput | string | null + actionData?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + title?: NullableStringFieldUpdateOperationsInput | string | null + message?: StringFieldUpdateOperationsInput | string + read?: BoolFieldUpdateOperationsInput | boolean + persistent?: BoolFieldUpdateOperationsInput | boolean + actionType?: NullableStringFieldUpdateOperationsInput | string | null + actionData?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CS2MatchRequestCreateInput = { + id?: string + steamId: string + matchId: bigint | number + reservationId: bigint | number + tvPort: bigint | number + processed?: boolean + createdAt?: Date | string + user: UserCreateNestedOneWithoutMatchRequestsInput + } + + export type CS2MatchRequestUncheckedCreateInput = { + id?: string + userId: string + steamId: string + matchId: bigint | number + reservationId: bigint | number + tvPort: bigint | number + processed?: boolean + createdAt?: Date | string + } + + export type CS2MatchRequestUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + reservationId?: BigIntFieldUpdateOperationsInput | bigint | number + tvPort?: BigIntFieldUpdateOperationsInput | bigint | number + processed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutMatchRequestsNestedInput + } + + export type CS2MatchRequestUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + reservationId?: BigIntFieldUpdateOperationsInput | bigint | number + tvPort?: BigIntFieldUpdateOperationsInput | bigint | number + processed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CS2MatchRequestCreateManyInput = { + id?: string + userId: string + steamId: string + matchId: bigint | number + reservationId: bigint | number + tvPort: bigint | number + processed?: boolean + createdAt?: Date | string + } + + export type CS2MatchRequestUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + reservationId?: BigIntFieldUpdateOperationsInput | bigint | number + tvPort?: BigIntFieldUpdateOperationsInput | bigint | number + processed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CS2MatchRequestUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + reservationId?: BigIntFieldUpdateOperationsInput | bigint | number + tvPort?: BigIntFieldUpdateOperationsInput | bigint | number + processed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PremierRankHistoryCreateInput = { + id?: string + steamId: string + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + user: UserCreateNestedOneWithoutRankHistoryInput + match?: MatchCreateNestedOneWithoutRankUpdatesInput + } + + export type PremierRankHistoryUncheckedCreateInput = { + id?: string + userId: string + steamId: string + matchId?: bigint | number | null + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + } + + export type PremierRankHistoryUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutRankHistoryNestedInput + match?: MatchUpdateOneWithoutRankUpdatesNestedInput + } + + export type PremierRankHistoryUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PremierRankHistoryCreateManyInput = { + id?: string + userId: string + steamId: string + matchId?: bigint | number | null + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + } + + export type PremierRankHistoryUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PremierRankHistoryUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | 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 StringNullableFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> | null + in?: string[] | ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null + 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?: NestedStringNullableFilter<$PrismaModel> | string | null + } + + export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolFilter<$PrismaModel> | boolean + } + + export type IntNullableFilter<$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 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 DateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeFilter<$PrismaModel> | Date | string + } + + export type TeamNullableScalarRelationFilter = { + is?: TeamWhereInput | null + isNot?: TeamWhereInput | null + } + + export type InvitationListRelationFilter = { + every?: InvitationWhereInput + some?: InvitationWhereInput + none?: InvitationWhereInput + } + + export type NotificationListRelationFilter = { + every?: NotificationWhereInput + some?: NotificationWhereInput + none?: NotificationWhereInput + } + + export type MatchPlayerListRelationFilter = { + every?: MatchPlayerWhereInput + some?: MatchPlayerWhereInput + none?: MatchPlayerWhereInput + } + + export type CS2MatchRequestListRelationFilter = { + every?: CS2MatchRequestWhereInput + some?: CS2MatchRequestWhereInput + none?: CS2MatchRequestWhereInput + } + + export type PremierRankHistoryListRelationFilter = { + every?: PremierRankHistoryWhereInput + some?: PremierRankHistoryWhereInput + none?: PremierRankHistoryWhereInput + } + + export type DemoFileListRelationFilter = { + every?: DemoFileWhereInput + some?: DemoFileWhereInput + none?: DemoFileWhereInput + } + + export type SortOrderInput = { + sort: SortOrder + nulls?: NullsOrder + } + + export type InvitationOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type NotificationOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type MatchPlayerOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type CS2MatchRequestOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type PremierRankHistoryOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type DemoFileOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type UserCountOrderByAggregateInput = { + steamId?: SortOrder + name?: SortOrder + avatar?: SortOrder + location?: SortOrder + isAdmin?: SortOrder + teamId?: SortOrder + premierRank?: SortOrder + authCode?: SortOrder + lastKnownShareCode?: SortOrder + lastKnownShareCodeDate?: SortOrder + createdAt?: SortOrder + } + + export type UserAvgOrderByAggregateInput = { + premierRank?: SortOrder + } + + export type UserMaxOrderByAggregateInput = { + steamId?: SortOrder + name?: SortOrder + avatar?: SortOrder + location?: SortOrder + isAdmin?: SortOrder + teamId?: SortOrder + premierRank?: SortOrder + authCode?: SortOrder + lastKnownShareCode?: SortOrder + lastKnownShareCodeDate?: SortOrder + createdAt?: SortOrder + } + + export type UserMinOrderByAggregateInput = { + steamId?: SortOrder + name?: SortOrder + avatar?: SortOrder + location?: SortOrder + isAdmin?: SortOrder + teamId?: SortOrder + premierRank?: SortOrder + authCode?: SortOrder + lastKnownShareCode?: SortOrder + lastKnownShareCodeDate?: SortOrder + createdAt?: SortOrder + } + + export type UserSumOrderByAggregateInput = { + premierRank?: 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 StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> | null + in?: string[] | ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null + 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?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedStringNullableFilter<$PrismaModel> + _max?: NestedStringNullableFilter<$PrismaModel> + } + + export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedBoolFilter<$PrismaModel> + _max?: NestedBoolFilter<$PrismaModel> + } + + export type IntNullableWithAggregatesFilter<$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?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedIntNullableFilter<$PrismaModel> + _max?: NestedIntNullableFilter<$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 DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedDateTimeFilter<$PrismaModel> + _max?: NestedDateTimeFilter<$PrismaModel> + } + + export type StringNullableListFilter<$PrismaModel = never> = { + equals?: string[] | ListStringFieldRefInput<$PrismaModel> | null + has?: string | StringFieldRefInput<$PrismaModel> | null + hasEvery?: string[] | ListStringFieldRefInput<$PrismaModel> + hasSome?: string[] | ListStringFieldRefInput<$PrismaModel> + isEmpty?: boolean + } + + export type UserNullableScalarRelationFilter = { + is?: UserWhereInput | null + isNot?: UserWhereInput | null + } + + export type UserListRelationFilter = { + every?: UserWhereInput + some?: UserWhereInput + none?: UserWhereInput + } + + export type MatchListRelationFilter = { + every?: MatchWhereInput + some?: MatchWhereInput + none?: MatchWhereInput + } + + export type UserOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type MatchOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type TeamCountOrderByAggregateInput = { + id?: SortOrder + name?: SortOrder + leaderId?: SortOrder + logo?: SortOrder + createdAt?: SortOrder + activePlayers?: SortOrder + inactivePlayers?: SortOrder + } + + export type TeamMaxOrderByAggregateInput = { + id?: SortOrder + name?: SortOrder + leaderId?: SortOrder + logo?: SortOrder + createdAt?: SortOrder + } + + export type TeamMinOrderByAggregateInput = { + id?: SortOrder + name?: SortOrder + leaderId?: SortOrder + logo?: SortOrder + createdAt?: SortOrder + } + + export type BigIntFilter<$PrismaModel = never> = { + equals?: bigint | number | BigIntFieldRefInput<$PrismaModel> + in?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> + notIn?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> + lt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + lte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + not?: NestedBigIntFilter<$PrismaModel> | bigint | number + } + export type JsonNullableFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type JsonNullableFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + mode?: QueryMode | EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + } + + export type DemoFileNullableScalarRelationFilter = { + is?: DemoFileWhereInput | null + isNot?: DemoFileWhereInput | null + } + + export type MatchCountOrderByAggregateInput = { + matchId?: SortOrder + teamAId?: SortOrder + teamBId?: SortOrder + matchDate?: SortOrder + matchType?: SortOrder + map?: SortOrder + title?: SortOrder + description?: SortOrder + demoData?: SortOrder + demoFilePath?: SortOrder + scoreA?: SortOrder + scoreB?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type MatchAvgOrderByAggregateInput = { + matchId?: SortOrder + scoreA?: SortOrder + scoreB?: SortOrder + } + + export type MatchMaxOrderByAggregateInput = { + matchId?: SortOrder + teamAId?: SortOrder + teamBId?: SortOrder + matchDate?: SortOrder + matchType?: SortOrder + map?: SortOrder + title?: SortOrder + description?: SortOrder + demoFilePath?: SortOrder + scoreA?: SortOrder + scoreB?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type MatchMinOrderByAggregateInput = { + matchId?: SortOrder + teamAId?: SortOrder + teamBId?: SortOrder + matchDate?: SortOrder + matchType?: SortOrder + map?: SortOrder + title?: SortOrder + description?: SortOrder + demoFilePath?: SortOrder + scoreA?: SortOrder + scoreB?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type MatchSumOrderByAggregateInput = { + matchId?: SortOrder + scoreA?: SortOrder + scoreB?: SortOrder + } + + export type BigIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: bigint | number | BigIntFieldRefInput<$PrismaModel> + in?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> + notIn?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> + lt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + lte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + not?: NestedBigIntWithAggregatesFilter<$PrismaModel> | bigint | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedBigIntFilter<$PrismaModel> + _min?: NestedBigIntFilter<$PrismaModel> + _max?: NestedBigIntFilter<$PrismaModel> + } + export type JsonNullableWithAggregatesFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + mode?: QueryMode | EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedJsonNullableFilter<$PrismaModel> + _max?: NestedJsonNullableFilter<$PrismaModel> + } + + export type MatchScalarRelationFilter = { + is?: MatchWhereInput + isNot?: MatchWhereInput + } + + export type UserScalarRelationFilter = { + is?: UserWhereInput + isNot?: UserWhereInput + } + + export type MatchPlayerStatsNullableScalarRelationFilter = { + is?: MatchPlayerStatsWhereInput | null + isNot?: MatchPlayerStatsWhereInput | null + } + + export type MatchPlayerMatchIdSteamIdCompoundUniqueInput = { + matchId: bigint | number + steamId: string + } + + export type MatchPlayerCountOrderByAggregateInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + teamId?: SortOrder + createdAt?: SortOrder + } + + export type MatchPlayerAvgOrderByAggregateInput = { + matchId?: SortOrder + } + + export type MatchPlayerMaxOrderByAggregateInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + teamId?: SortOrder + createdAt?: SortOrder + } + + export type MatchPlayerMinOrderByAggregateInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + teamId?: SortOrder + createdAt?: SortOrder + } + + export type MatchPlayerSumOrderByAggregateInput = { + matchId?: SortOrder + } + + export type IntFilter<$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 FloatFilter<$PrismaModel = never> = { + equals?: number | FloatFieldRefInput<$PrismaModel> + in?: number[] | ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> + lt?: number | FloatFieldRefInput<$PrismaModel> + lte?: number | FloatFieldRefInput<$PrismaModel> + gt?: number | FloatFieldRefInput<$PrismaModel> + gte?: number | FloatFieldRefInput<$PrismaModel> + not?: NestedFloatFilter<$PrismaModel> | number + } + + export type MatchPlayerScalarRelationFilter = { + is?: MatchPlayerWhereInput + isNot?: MatchPlayerWhereInput + } + + export type MatchPlayerStatsCountOrderByAggregateInput = { + id?: SortOrder + matchPlayerId?: SortOrder + kills?: SortOrder + assists?: SortOrder + deaths?: SortOrder + adr?: SortOrder + headshotPct?: SortOrder + flashAssists?: SortOrder + mvps?: SortOrder + mvpEliminations?: SortOrder + mvpDefuse?: SortOrder + mvpPlant?: SortOrder + knifeKills?: SortOrder + zeusKills?: SortOrder + wallbangKills?: SortOrder + smokeKills?: SortOrder + headshots?: SortOrder + noScopes?: SortOrder + blindKills?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + winCount?: SortOrder + } + + export type MatchPlayerStatsAvgOrderByAggregateInput = { + kills?: SortOrder + assists?: SortOrder + deaths?: SortOrder + adr?: SortOrder + headshotPct?: SortOrder + flashAssists?: SortOrder + mvps?: SortOrder + mvpEliminations?: SortOrder + mvpDefuse?: SortOrder + mvpPlant?: SortOrder + knifeKills?: SortOrder + zeusKills?: SortOrder + wallbangKills?: SortOrder + smokeKills?: SortOrder + headshots?: SortOrder + noScopes?: SortOrder + blindKills?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + winCount?: SortOrder + } + + export type MatchPlayerStatsMaxOrderByAggregateInput = { + id?: SortOrder + matchPlayerId?: SortOrder + kills?: SortOrder + assists?: SortOrder + deaths?: SortOrder + adr?: SortOrder + headshotPct?: SortOrder + flashAssists?: SortOrder + mvps?: SortOrder + mvpEliminations?: SortOrder + mvpDefuse?: SortOrder + mvpPlant?: SortOrder + knifeKills?: SortOrder + zeusKills?: SortOrder + wallbangKills?: SortOrder + smokeKills?: SortOrder + headshots?: SortOrder + noScopes?: SortOrder + blindKills?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + winCount?: SortOrder + } + + export type MatchPlayerStatsMinOrderByAggregateInput = { + id?: SortOrder + matchPlayerId?: SortOrder + kills?: SortOrder + assists?: SortOrder + deaths?: SortOrder + adr?: SortOrder + headshotPct?: SortOrder + flashAssists?: SortOrder + mvps?: SortOrder + mvpEliminations?: SortOrder + mvpDefuse?: SortOrder + mvpPlant?: SortOrder + knifeKills?: SortOrder + zeusKills?: SortOrder + wallbangKills?: SortOrder + smokeKills?: SortOrder + headshots?: SortOrder + noScopes?: SortOrder + blindKills?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + winCount?: SortOrder + } + + export type MatchPlayerStatsSumOrderByAggregateInput = { + kills?: SortOrder + assists?: SortOrder + deaths?: SortOrder + adr?: SortOrder + headshotPct?: SortOrder + flashAssists?: SortOrder + mvps?: SortOrder + mvpEliminations?: SortOrder + mvpDefuse?: SortOrder + mvpPlant?: SortOrder + knifeKills?: SortOrder + zeusKills?: SortOrder + wallbangKills?: SortOrder + smokeKills?: SortOrder + headshots?: SortOrder + noScopes?: SortOrder + blindKills?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + winCount?: SortOrder + } + + export type IntWithAggregatesFilter<$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?: NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedIntFilter<$PrismaModel> + _min?: NestedIntFilter<$PrismaModel> + _max?: NestedIntFilter<$PrismaModel> + } + + export type FloatWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | FloatFieldRefInput<$PrismaModel> + in?: number[] | ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> + lt?: number | FloatFieldRefInput<$PrismaModel> + lte?: number | FloatFieldRefInput<$PrismaModel> + gt?: number | FloatFieldRefInput<$PrismaModel> + gte?: number | FloatFieldRefInput<$PrismaModel> + not?: NestedFloatWithAggregatesFilter<$PrismaModel> | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedFloatFilter<$PrismaModel> + _min?: NestedFloatFilter<$PrismaModel> + _max?: NestedFloatFilter<$PrismaModel> + } + + export type DemoFileCountOrderByAggregateInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + fileName?: SortOrder + filePath?: SortOrder + parsed?: SortOrder + createdAt?: SortOrder + } + + export type DemoFileAvgOrderByAggregateInput = { + matchId?: SortOrder + } + + export type DemoFileMaxOrderByAggregateInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + fileName?: SortOrder + filePath?: SortOrder + parsed?: SortOrder + createdAt?: SortOrder + } + + export type DemoFileMinOrderByAggregateInput = { + id?: SortOrder + matchId?: SortOrder + steamId?: SortOrder + fileName?: SortOrder + filePath?: SortOrder + parsed?: SortOrder + createdAt?: SortOrder + } + + export type DemoFileSumOrderByAggregateInput = { + matchId?: SortOrder + } + + export type TeamScalarRelationFilter = { + is?: TeamWhereInput + isNot?: TeamWhereInput + } + + export type InvitationCountOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + teamId?: SortOrder + type?: SortOrder + createdAt?: SortOrder + } + + export type InvitationMaxOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + teamId?: SortOrder + type?: SortOrder + createdAt?: SortOrder + } + + export type InvitationMinOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + teamId?: SortOrder + type?: SortOrder + createdAt?: SortOrder + } + + export type NotificationCountOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + title?: SortOrder + message?: SortOrder + read?: SortOrder + persistent?: SortOrder + actionType?: SortOrder + actionData?: SortOrder + createdAt?: SortOrder + } + + export type NotificationMaxOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + title?: SortOrder + message?: SortOrder + read?: SortOrder + persistent?: SortOrder + actionType?: SortOrder + actionData?: SortOrder + createdAt?: SortOrder + } + + export type NotificationMinOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + title?: SortOrder + message?: SortOrder + read?: SortOrder + persistent?: SortOrder + actionType?: SortOrder + actionData?: SortOrder + createdAt?: SortOrder + } + + export type CS2MatchRequestSteamIdMatchIdCompoundUniqueInput = { + steamId: string + matchId: bigint | number + } + + export type CS2MatchRequestCountOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrder + reservationId?: SortOrder + tvPort?: SortOrder + processed?: SortOrder + createdAt?: SortOrder + } + + export type CS2MatchRequestAvgOrderByAggregateInput = { + matchId?: SortOrder + reservationId?: SortOrder + tvPort?: SortOrder + } + + export type CS2MatchRequestMaxOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrder + reservationId?: SortOrder + tvPort?: SortOrder + processed?: SortOrder + createdAt?: SortOrder + } + + export type CS2MatchRequestMinOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrder + reservationId?: SortOrder + tvPort?: SortOrder + processed?: SortOrder + createdAt?: SortOrder + } + + export type CS2MatchRequestSumOrderByAggregateInput = { + matchId?: SortOrder + reservationId?: SortOrder + tvPort?: SortOrder + } + + export type BigIntNullableFilter<$PrismaModel = never> = { + equals?: bigint | number | BigIntFieldRefInput<$PrismaModel> | null + in?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> | null + notIn?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> | null + lt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + lte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + not?: NestedBigIntNullableFilter<$PrismaModel> | bigint | number | null + } + + export type MatchNullableScalarRelationFilter = { + is?: MatchWhereInput | null + isNot?: MatchWhereInput | null + } + + export type PremierRankHistoryCountOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + delta?: SortOrder + winCount?: SortOrder + createdAt?: SortOrder + } + + export type PremierRankHistoryAvgOrderByAggregateInput = { + matchId?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + delta?: SortOrder + winCount?: SortOrder + } + + export type PremierRankHistoryMaxOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + delta?: SortOrder + winCount?: SortOrder + createdAt?: SortOrder + } + + export type PremierRankHistoryMinOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + steamId?: SortOrder + matchId?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + delta?: SortOrder + winCount?: SortOrder + createdAt?: SortOrder + } + + export type PremierRankHistorySumOrderByAggregateInput = { + matchId?: SortOrder + rankOld?: SortOrder + rankNew?: SortOrder + delta?: SortOrder + winCount?: SortOrder + } + + export type BigIntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: bigint | number | BigIntFieldRefInput<$PrismaModel> | null + in?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> | null + notIn?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> | null + lt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + lte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + not?: NestedBigIntNullableWithAggregatesFilter<$PrismaModel> | bigint | number | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedBigIntNullableFilter<$PrismaModel> + _min?: NestedBigIntNullableFilter<$PrismaModel> + _max?: NestedBigIntNullableFilter<$PrismaModel> + } + + export type TeamCreateNestedOneWithoutMembersInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutMembersInput + connect?: TeamWhereUniqueInput + } + + export type TeamCreateNestedOneWithoutLeaderInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutLeaderInput + connect?: TeamWhereUniqueInput + } + + export type InvitationCreateNestedManyWithoutUserInput = { + create?: XOR | InvitationCreateWithoutUserInput[] | InvitationUncheckedCreateWithoutUserInput[] + connectOrCreate?: InvitationCreateOrConnectWithoutUserInput | InvitationCreateOrConnectWithoutUserInput[] + createMany?: InvitationCreateManyUserInputEnvelope + connect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + } + + export type NotificationCreateNestedManyWithoutUserInput = { + create?: XOR | NotificationCreateWithoutUserInput[] | NotificationUncheckedCreateWithoutUserInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutUserInput | NotificationCreateOrConnectWithoutUserInput[] + createMany?: NotificationCreateManyUserInputEnvelope + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + } + + export type MatchPlayerCreateNestedManyWithoutUserInput = { + create?: XOR | MatchPlayerCreateWithoutUserInput[] | MatchPlayerUncheckedCreateWithoutUserInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutUserInput | MatchPlayerCreateOrConnectWithoutUserInput[] + createMany?: MatchPlayerCreateManyUserInputEnvelope + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + } + + export type CS2MatchRequestCreateNestedManyWithoutUserInput = { + create?: XOR | CS2MatchRequestCreateWithoutUserInput[] | CS2MatchRequestUncheckedCreateWithoutUserInput[] + connectOrCreate?: CS2MatchRequestCreateOrConnectWithoutUserInput | CS2MatchRequestCreateOrConnectWithoutUserInput[] + createMany?: CS2MatchRequestCreateManyUserInputEnvelope + connect?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + } + + export type PremierRankHistoryCreateNestedManyWithoutUserInput = { + create?: XOR | PremierRankHistoryCreateWithoutUserInput[] | PremierRankHistoryUncheckedCreateWithoutUserInput[] + connectOrCreate?: PremierRankHistoryCreateOrConnectWithoutUserInput | PremierRankHistoryCreateOrConnectWithoutUserInput[] + createMany?: PremierRankHistoryCreateManyUserInputEnvelope + connect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + } + + export type DemoFileCreateNestedManyWithoutUserInput = { + create?: XOR | DemoFileCreateWithoutUserInput[] | DemoFileUncheckedCreateWithoutUserInput[] + connectOrCreate?: DemoFileCreateOrConnectWithoutUserInput | DemoFileCreateOrConnectWithoutUserInput[] + createMany?: DemoFileCreateManyUserInputEnvelope + connect?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + } + + export type TeamUncheckedCreateNestedOneWithoutLeaderInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutLeaderInput + connect?: TeamWhereUniqueInput + } + + export type InvitationUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR | InvitationCreateWithoutUserInput[] | InvitationUncheckedCreateWithoutUserInput[] + connectOrCreate?: InvitationCreateOrConnectWithoutUserInput | InvitationCreateOrConnectWithoutUserInput[] + createMany?: InvitationCreateManyUserInputEnvelope + connect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + } + + export type NotificationUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR | NotificationCreateWithoutUserInput[] | NotificationUncheckedCreateWithoutUserInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutUserInput | NotificationCreateOrConnectWithoutUserInput[] + createMany?: NotificationCreateManyUserInputEnvelope + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + } + + export type MatchPlayerUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR | MatchPlayerCreateWithoutUserInput[] | MatchPlayerUncheckedCreateWithoutUserInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutUserInput | MatchPlayerCreateOrConnectWithoutUserInput[] + createMany?: MatchPlayerCreateManyUserInputEnvelope + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + } + + export type CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR | CS2MatchRequestCreateWithoutUserInput[] | CS2MatchRequestUncheckedCreateWithoutUserInput[] + connectOrCreate?: CS2MatchRequestCreateOrConnectWithoutUserInput | CS2MatchRequestCreateOrConnectWithoutUserInput[] + createMany?: CS2MatchRequestCreateManyUserInputEnvelope + connect?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + } + + export type PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR | PremierRankHistoryCreateWithoutUserInput[] | PremierRankHistoryUncheckedCreateWithoutUserInput[] + connectOrCreate?: PremierRankHistoryCreateOrConnectWithoutUserInput | PremierRankHistoryCreateOrConnectWithoutUserInput[] + createMany?: PremierRankHistoryCreateManyUserInputEnvelope + connect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + } + + export type DemoFileUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR | DemoFileCreateWithoutUserInput[] | DemoFileUncheckedCreateWithoutUserInput[] + connectOrCreate?: DemoFileCreateOrConnectWithoutUserInput | DemoFileCreateOrConnectWithoutUserInput[] + createMany?: DemoFileCreateManyUserInputEnvelope + connect?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + } + + export type StringFieldUpdateOperationsInput = { + set?: string + } + + export type NullableStringFieldUpdateOperationsInput = { + set?: string | null + } + + export type BoolFieldUpdateOperationsInput = { + set?: boolean + } + + export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type NullableDateTimeFieldUpdateOperationsInput = { + set?: Date | string | null + } + + export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string + } + + export type TeamUpdateOneWithoutMembersNestedInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutMembersInput + upsert?: TeamUpsertWithoutMembersInput + disconnect?: TeamWhereInput | boolean + delete?: TeamWhereInput | boolean + connect?: TeamWhereUniqueInput + update?: XOR, TeamUncheckedUpdateWithoutMembersInput> + } + + export type TeamUpdateOneWithoutLeaderNestedInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutLeaderInput + upsert?: TeamUpsertWithoutLeaderInput + disconnect?: TeamWhereInput | boolean + delete?: TeamWhereInput | boolean + connect?: TeamWhereUniqueInput + update?: XOR, TeamUncheckedUpdateWithoutLeaderInput> + } + + export type InvitationUpdateManyWithoutUserNestedInput = { + create?: XOR | InvitationCreateWithoutUserInput[] | InvitationUncheckedCreateWithoutUserInput[] + connectOrCreate?: InvitationCreateOrConnectWithoutUserInput | InvitationCreateOrConnectWithoutUserInput[] + upsert?: InvitationUpsertWithWhereUniqueWithoutUserInput | InvitationUpsertWithWhereUniqueWithoutUserInput[] + createMany?: InvitationCreateManyUserInputEnvelope + set?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + disconnect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + delete?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + connect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + update?: InvitationUpdateWithWhereUniqueWithoutUserInput | InvitationUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: InvitationUpdateManyWithWhereWithoutUserInput | InvitationUpdateManyWithWhereWithoutUserInput[] + deleteMany?: InvitationScalarWhereInput | InvitationScalarWhereInput[] + } + + export type NotificationUpdateManyWithoutUserNestedInput = { + create?: XOR | NotificationCreateWithoutUserInput[] | NotificationUncheckedCreateWithoutUserInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutUserInput | NotificationCreateOrConnectWithoutUserInput[] + upsert?: NotificationUpsertWithWhereUniqueWithoutUserInput | NotificationUpsertWithWhereUniqueWithoutUserInput[] + createMany?: NotificationCreateManyUserInputEnvelope + set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + update?: NotificationUpdateWithWhereUniqueWithoutUserInput | NotificationUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: NotificationUpdateManyWithWhereWithoutUserInput | NotificationUpdateManyWithWhereWithoutUserInput[] + deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + } + + export type MatchPlayerUpdateManyWithoutUserNestedInput = { + create?: XOR | MatchPlayerCreateWithoutUserInput[] | MatchPlayerUncheckedCreateWithoutUserInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutUserInput | MatchPlayerCreateOrConnectWithoutUserInput[] + upsert?: MatchPlayerUpsertWithWhereUniqueWithoutUserInput | MatchPlayerUpsertWithWhereUniqueWithoutUserInput[] + createMany?: MatchPlayerCreateManyUserInputEnvelope + set?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + disconnect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + delete?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + update?: MatchPlayerUpdateWithWhereUniqueWithoutUserInput | MatchPlayerUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: MatchPlayerUpdateManyWithWhereWithoutUserInput | MatchPlayerUpdateManyWithWhereWithoutUserInput[] + deleteMany?: MatchPlayerScalarWhereInput | MatchPlayerScalarWhereInput[] + } + + export type CS2MatchRequestUpdateManyWithoutUserNestedInput = { + create?: XOR | CS2MatchRequestCreateWithoutUserInput[] | CS2MatchRequestUncheckedCreateWithoutUserInput[] + connectOrCreate?: CS2MatchRequestCreateOrConnectWithoutUserInput | CS2MatchRequestCreateOrConnectWithoutUserInput[] + upsert?: CS2MatchRequestUpsertWithWhereUniqueWithoutUserInput | CS2MatchRequestUpsertWithWhereUniqueWithoutUserInput[] + createMany?: CS2MatchRequestCreateManyUserInputEnvelope + set?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + disconnect?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + delete?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + connect?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + update?: CS2MatchRequestUpdateWithWhereUniqueWithoutUserInput | CS2MatchRequestUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: CS2MatchRequestUpdateManyWithWhereWithoutUserInput | CS2MatchRequestUpdateManyWithWhereWithoutUserInput[] + deleteMany?: CS2MatchRequestScalarWhereInput | CS2MatchRequestScalarWhereInput[] + } + + export type PremierRankHistoryUpdateManyWithoutUserNestedInput = { + create?: XOR | PremierRankHistoryCreateWithoutUserInput[] | PremierRankHistoryUncheckedCreateWithoutUserInput[] + connectOrCreate?: PremierRankHistoryCreateOrConnectWithoutUserInput | PremierRankHistoryCreateOrConnectWithoutUserInput[] + upsert?: PremierRankHistoryUpsertWithWhereUniqueWithoutUserInput | PremierRankHistoryUpsertWithWhereUniqueWithoutUserInput[] + createMany?: PremierRankHistoryCreateManyUserInputEnvelope + set?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + disconnect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + delete?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + connect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + update?: PremierRankHistoryUpdateWithWhereUniqueWithoutUserInput | PremierRankHistoryUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: PremierRankHistoryUpdateManyWithWhereWithoutUserInput | PremierRankHistoryUpdateManyWithWhereWithoutUserInput[] + deleteMany?: PremierRankHistoryScalarWhereInput | PremierRankHistoryScalarWhereInput[] + } + + export type DemoFileUpdateManyWithoutUserNestedInput = { + create?: XOR | DemoFileCreateWithoutUserInput[] | DemoFileUncheckedCreateWithoutUserInput[] + connectOrCreate?: DemoFileCreateOrConnectWithoutUserInput | DemoFileCreateOrConnectWithoutUserInput[] + upsert?: DemoFileUpsertWithWhereUniqueWithoutUserInput | DemoFileUpsertWithWhereUniqueWithoutUserInput[] + createMany?: DemoFileCreateManyUserInputEnvelope + set?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + disconnect?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + delete?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + connect?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + update?: DemoFileUpdateWithWhereUniqueWithoutUserInput | DemoFileUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: DemoFileUpdateManyWithWhereWithoutUserInput | DemoFileUpdateManyWithWhereWithoutUserInput[] + deleteMany?: DemoFileScalarWhereInput | DemoFileScalarWhereInput[] + } + + export type TeamUncheckedUpdateOneWithoutLeaderNestedInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutLeaderInput + upsert?: TeamUpsertWithoutLeaderInput + disconnect?: TeamWhereInput | boolean + delete?: TeamWhereInput | boolean + connect?: TeamWhereUniqueInput + update?: XOR, TeamUncheckedUpdateWithoutLeaderInput> + } + + export type InvitationUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR | InvitationCreateWithoutUserInput[] | InvitationUncheckedCreateWithoutUserInput[] + connectOrCreate?: InvitationCreateOrConnectWithoutUserInput | InvitationCreateOrConnectWithoutUserInput[] + upsert?: InvitationUpsertWithWhereUniqueWithoutUserInput | InvitationUpsertWithWhereUniqueWithoutUserInput[] + createMany?: InvitationCreateManyUserInputEnvelope + set?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + disconnect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + delete?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + connect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + update?: InvitationUpdateWithWhereUniqueWithoutUserInput | InvitationUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: InvitationUpdateManyWithWhereWithoutUserInput | InvitationUpdateManyWithWhereWithoutUserInput[] + deleteMany?: InvitationScalarWhereInput | InvitationScalarWhereInput[] + } + + export type NotificationUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR | NotificationCreateWithoutUserInput[] | NotificationUncheckedCreateWithoutUserInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutUserInput | NotificationCreateOrConnectWithoutUserInput[] + upsert?: NotificationUpsertWithWhereUniqueWithoutUserInput | NotificationUpsertWithWhereUniqueWithoutUserInput[] + createMany?: NotificationCreateManyUserInputEnvelope + set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + update?: NotificationUpdateWithWhereUniqueWithoutUserInput | NotificationUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: NotificationUpdateManyWithWhereWithoutUserInput | NotificationUpdateManyWithWhereWithoutUserInput[] + deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + } + + export type MatchPlayerUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR | MatchPlayerCreateWithoutUserInput[] | MatchPlayerUncheckedCreateWithoutUserInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutUserInput | MatchPlayerCreateOrConnectWithoutUserInput[] + upsert?: MatchPlayerUpsertWithWhereUniqueWithoutUserInput | MatchPlayerUpsertWithWhereUniqueWithoutUserInput[] + createMany?: MatchPlayerCreateManyUserInputEnvelope + set?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + disconnect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + delete?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + update?: MatchPlayerUpdateWithWhereUniqueWithoutUserInput | MatchPlayerUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: MatchPlayerUpdateManyWithWhereWithoutUserInput | MatchPlayerUpdateManyWithWhereWithoutUserInput[] + deleteMany?: MatchPlayerScalarWhereInput | MatchPlayerScalarWhereInput[] + } + + export type CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR | CS2MatchRequestCreateWithoutUserInput[] | CS2MatchRequestUncheckedCreateWithoutUserInput[] + connectOrCreate?: CS2MatchRequestCreateOrConnectWithoutUserInput | CS2MatchRequestCreateOrConnectWithoutUserInput[] + upsert?: CS2MatchRequestUpsertWithWhereUniqueWithoutUserInput | CS2MatchRequestUpsertWithWhereUniqueWithoutUserInput[] + createMany?: CS2MatchRequestCreateManyUserInputEnvelope + set?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + disconnect?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + delete?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + connect?: CS2MatchRequestWhereUniqueInput | CS2MatchRequestWhereUniqueInput[] + update?: CS2MatchRequestUpdateWithWhereUniqueWithoutUserInput | CS2MatchRequestUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: CS2MatchRequestUpdateManyWithWhereWithoutUserInput | CS2MatchRequestUpdateManyWithWhereWithoutUserInput[] + deleteMany?: CS2MatchRequestScalarWhereInput | CS2MatchRequestScalarWhereInput[] + } + + export type PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR | PremierRankHistoryCreateWithoutUserInput[] | PremierRankHistoryUncheckedCreateWithoutUserInput[] + connectOrCreate?: PremierRankHistoryCreateOrConnectWithoutUserInput | PremierRankHistoryCreateOrConnectWithoutUserInput[] + upsert?: PremierRankHistoryUpsertWithWhereUniqueWithoutUserInput | PremierRankHistoryUpsertWithWhereUniqueWithoutUserInput[] + createMany?: PremierRankHistoryCreateManyUserInputEnvelope + set?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + disconnect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + delete?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + connect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + update?: PremierRankHistoryUpdateWithWhereUniqueWithoutUserInput | PremierRankHistoryUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: PremierRankHistoryUpdateManyWithWhereWithoutUserInput | PremierRankHistoryUpdateManyWithWhereWithoutUserInput[] + deleteMany?: PremierRankHistoryScalarWhereInput | PremierRankHistoryScalarWhereInput[] + } + + export type DemoFileUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR | DemoFileCreateWithoutUserInput[] | DemoFileUncheckedCreateWithoutUserInput[] + connectOrCreate?: DemoFileCreateOrConnectWithoutUserInput | DemoFileCreateOrConnectWithoutUserInput[] + upsert?: DemoFileUpsertWithWhereUniqueWithoutUserInput | DemoFileUpsertWithWhereUniqueWithoutUserInput[] + createMany?: DemoFileCreateManyUserInputEnvelope + set?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + disconnect?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + delete?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + connect?: DemoFileWhereUniqueInput | DemoFileWhereUniqueInput[] + update?: DemoFileUpdateWithWhereUniqueWithoutUserInput | DemoFileUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: DemoFileUpdateManyWithWhereWithoutUserInput | DemoFileUpdateManyWithWhereWithoutUserInput[] + deleteMany?: DemoFileScalarWhereInput | DemoFileScalarWhereInput[] + } + + export type TeamCreateactivePlayersInput = { + set: string[] + } + + export type TeamCreateinactivePlayersInput = { + set: string[] + } + + export type UserCreateNestedOneWithoutLedTeamInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutLedTeamInput + connect?: UserWhereUniqueInput + } + + export type UserCreateNestedManyWithoutTeamInput = { + create?: XOR | UserCreateWithoutTeamInput[] | UserUncheckedCreateWithoutTeamInput[] + connectOrCreate?: UserCreateOrConnectWithoutTeamInput | UserCreateOrConnectWithoutTeamInput[] + createMany?: UserCreateManyTeamInputEnvelope + connect?: UserWhereUniqueInput | UserWhereUniqueInput[] + } + + export type InvitationCreateNestedManyWithoutTeamInput = { + create?: XOR | InvitationCreateWithoutTeamInput[] | InvitationUncheckedCreateWithoutTeamInput[] + connectOrCreate?: InvitationCreateOrConnectWithoutTeamInput | InvitationCreateOrConnectWithoutTeamInput[] + createMany?: InvitationCreateManyTeamInputEnvelope + connect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + } + + export type MatchPlayerCreateNestedManyWithoutTeamInput = { + create?: XOR | MatchPlayerCreateWithoutTeamInput[] | MatchPlayerUncheckedCreateWithoutTeamInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutTeamInput | MatchPlayerCreateOrConnectWithoutTeamInput[] + createMany?: MatchPlayerCreateManyTeamInputEnvelope + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + } + + export type MatchCreateNestedManyWithoutTeamAInput = { + create?: XOR | MatchCreateWithoutTeamAInput[] | MatchUncheckedCreateWithoutTeamAInput[] + connectOrCreate?: MatchCreateOrConnectWithoutTeamAInput | MatchCreateOrConnectWithoutTeamAInput[] + createMany?: MatchCreateManyTeamAInputEnvelope + connect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + } + + export type MatchCreateNestedManyWithoutTeamBInput = { + create?: XOR | MatchCreateWithoutTeamBInput[] | MatchUncheckedCreateWithoutTeamBInput[] + connectOrCreate?: MatchCreateOrConnectWithoutTeamBInput | MatchCreateOrConnectWithoutTeamBInput[] + createMany?: MatchCreateManyTeamBInputEnvelope + connect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + } + + export type UserUncheckedCreateNestedManyWithoutTeamInput = { + create?: XOR | UserCreateWithoutTeamInput[] | UserUncheckedCreateWithoutTeamInput[] + connectOrCreate?: UserCreateOrConnectWithoutTeamInput | UserCreateOrConnectWithoutTeamInput[] + createMany?: UserCreateManyTeamInputEnvelope + connect?: UserWhereUniqueInput | UserWhereUniqueInput[] + } + + export type InvitationUncheckedCreateNestedManyWithoutTeamInput = { + create?: XOR | InvitationCreateWithoutTeamInput[] | InvitationUncheckedCreateWithoutTeamInput[] + connectOrCreate?: InvitationCreateOrConnectWithoutTeamInput | InvitationCreateOrConnectWithoutTeamInput[] + createMany?: InvitationCreateManyTeamInputEnvelope + connect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + } + + export type MatchPlayerUncheckedCreateNestedManyWithoutTeamInput = { + create?: XOR | MatchPlayerCreateWithoutTeamInput[] | MatchPlayerUncheckedCreateWithoutTeamInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutTeamInput | MatchPlayerCreateOrConnectWithoutTeamInput[] + createMany?: MatchPlayerCreateManyTeamInputEnvelope + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + } + + export type MatchUncheckedCreateNestedManyWithoutTeamAInput = { + create?: XOR | MatchCreateWithoutTeamAInput[] | MatchUncheckedCreateWithoutTeamAInput[] + connectOrCreate?: MatchCreateOrConnectWithoutTeamAInput | MatchCreateOrConnectWithoutTeamAInput[] + createMany?: MatchCreateManyTeamAInputEnvelope + connect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + } + + export type MatchUncheckedCreateNestedManyWithoutTeamBInput = { + create?: XOR | MatchCreateWithoutTeamBInput[] | MatchUncheckedCreateWithoutTeamBInput[] + connectOrCreate?: MatchCreateOrConnectWithoutTeamBInput | MatchCreateOrConnectWithoutTeamBInput[] + createMany?: MatchCreateManyTeamBInputEnvelope + connect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + } + + export type TeamUpdateactivePlayersInput = { + set?: string[] + push?: string | string[] + } + + export type TeamUpdateinactivePlayersInput = { + set?: string[] + push?: string | string[] + } + + export type UserUpdateOneWithoutLedTeamNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutLedTeamInput + upsert?: UserUpsertWithoutLedTeamInput + disconnect?: UserWhereInput | boolean + delete?: UserWhereInput | boolean + connect?: UserWhereUniqueInput + update?: XOR, UserUncheckedUpdateWithoutLedTeamInput> + } + + export type UserUpdateManyWithoutTeamNestedInput = { + create?: XOR | UserCreateWithoutTeamInput[] | UserUncheckedCreateWithoutTeamInput[] + connectOrCreate?: UserCreateOrConnectWithoutTeamInput | UserCreateOrConnectWithoutTeamInput[] + upsert?: UserUpsertWithWhereUniqueWithoutTeamInput | UserUpsertWithWhereUniqueWithoutTeamInput[] + createMany?: UserCreateManyTeamInputEnvelope + set?: UserWhereUniqueInput | UserWhereUniqueInput[] + disconnect?: UserWhereUniqueInput | UserWhereUniqueInput[] + delete?: UserWhereUniqueInput | UserWhereUniqueInput[] + connect?: UserWhereUniqueInput | UserWhereUniqueInput[] + update?: UserUpdateWithWhereUniqueWithoutTeamInput | UserUpdateWithWhereUniqueWithoutTeamInput[] + updateMany?: UserUpdateManyWithWhereWithoutTeamInput | UserUpdateManyWithWhereWithoutTeamInput[] + deleteMany?: UserScalarWhereInput | UserScalarWhereInput[] + } + + export type InvitationUpdateManyWithoutTeamNestedInput = { + create?: XOR | InvitationCreateWithoutTeamInput[] | InvitationUncheckedCreateWithoutTeamInput[] + connectOrCreate?: InvitationCreateOrConnectWithoutTeamInput | InvitationCreateOrConnectWithoutTeamInput[] + upsert?: InvitationUpsertWithWhereUniqueWithoutTeamInput | InvitationUpsertWithWhereUniqueWithoutTeamInput[] + createMany?: InvitationCreateManyTeamInputEnvelope + set?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + disconnect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + delete?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + connect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + update?: InvitationUpdateWithWhereUniqueWithoutTeamInput | InvitationUpdateWithWhereUniqueWithoutTeamInput[] + updateMany?: InvitationUpdateManyWithWhereWithoutTeamInput | InvitationUpdateManyWithWhereWithoutTeamInput[] + deleteMany?: InvitationScalarWhereInput | InvitationScalarWhereInput[] + } + + export type MatchPlayerUpdateManyWithoutTeamNestedInput = { + create?: XOR | MatchPlayerCreateWithoutTeamInput[] | MatchPlayerUncheckedCreateWithoutTeamInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutTeamInput | MatchPlayerCreateOrConnectWithoutTeamInput[] + upsert?: MatchPlayerUpsertWithWhereUniqueWithoutTeamInput | MatchPlayerUpsertWithWhereUniqueWithoutTeamInput[] + createMany?: MatchPlayerCreateManyTeamInputEnvelope + set?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + disconnect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + delete?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + update?: MatchPlayerUpdateWithWhereUniqueWithoutTeamInput | MatchPlayerUpdateWithWhereUniqueWithoutTeamInput[] + updateMany?: MatchPlayerUpdateManyWithWhereWithoutTeamInput | MatchPlayerUpdateManyWithWhereWithoutTeamInput[] + deleteMany?: MatchPlayerScalarWhereInput | MatchPlayerScalarWhereInput[] + } + + export type MatchUpdateManyWithoutTeamANestedInput = { + create?: XOR | MatchCreateWithoutTeamAInput[] | MatchUncheckedCreateWithoutTeamAInput[] + connectOrCreate?: MatchCreateOrConnectWithoutTeamAInput | MatchCreateOrConnectWithoutTeamAInput[] + upsert?: MatchUpsertWithWhereUniqueWithoutTeamAInput | MatchUpsertWithWhereUniqueWithoutTeamAInput[] + createMany?: MatchCreateManyTeamAInputEnvelope + set?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + disconnect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + delete?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + connect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + update?: MatchUpdateWithWhereUniqueWithoutTeamAInput | MatchUpdateWithWhereUniqueWithoutTeamAInput[] + updateMany?: MatchUpdateManyWithWhereWithoutTeamAInput | MatchUpdateManyWithWhereWithoutTeamAInput[] + deleteMany?: MatchScalarWhereInput | MatchScalarWhereInput[] + } + + export type MatchUpdateManyWithoutTeamBNestedInput = { + create?: XOR | MatchCreateWithoutTeamBInput[] | MatchUncheckedCreateWithoutTeamBInput[] + connectOrCreate?: MatchCreateOrConnectWithoutTeamBInput | MatchCreateOrConnectWithoutTeamBInput[] + upsert?: MatchUpsertWithWhereUniqueWithoutTeamBInput | MatchUpsertWithWhereUniqueWithoutTeamBInput[] + createMany?: MatchCreateManyTeamBInputEnvelope + set?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + disconnect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + delete?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + connect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + update?: MatchUpdateWithWhereUniqueWithoutTeamBInput | MatchUpdateWithWhereUniqueWithoutTeamBInput[] + updateMany?: MatchUpdateManyWithWhereWithoutTeamBInput | MatchUpdateManyWithWhereWithoutTeamBInput[] + deleteMany?: MatchScalarWhereInput | MatchScalarWhereInput[] + } + + export type UserUncheckedUpdateManyWithoutTeamNestedInput = { + create?: XOR | UserCreateWithoutTeamInput[] | UserUncheckedCreateWithoutTeamInput[] + connectOrCreate?: UserCreateOrConnectWithoutTeamInput | UserCreateOrConnectWithoutTeamInput[] + upsert?: UserUpsertWithWhereUniqueWithoutTeamInput | UserUpsertWithWhereUniqueWithoutTeamInput[] + createMany?: UserCreateManyTeamInputEnvelope + set?: UserWhereUniqueInput | UserWhereUniqueInput[] + disconnect?: UserWhereUniqueInput | UserWhereUniqueInput[] + delete?: UserWhereUniqueInput | UserWhereUniqueInput[] + connect?: UserWhereUniqueInput | UserWhereUniqueInput[] + update?: UserUpdateWithWhereUniqueWithoutTeamInput | UserUpdateWithWhereUniqueWithoutTeamInput[] + updateMany?: UserUpdateManyWithWhereWithoutTeamInput | UserUpdateManyWithWhereWithoutTeamInput[] + deleteMany?: UserScalarWhereInput | UserScalarWhereInput[] + } + + export type InvitationUncheckedUpdateManyWithoutTeamNestedInput = { + create?: XOR | InvitationCreateWithoutTeamInput[] | InvitationUncheckedCreateWithoutTeamInput[] + connectOrCreate?: InvitationCreateOrConnectWithoutTeamInput | InvitationCreateOrConnectWithoutTeamInput[] + upsert?: InvitationUpsertWithWhereUniqueWithoutTeamInput | InvitationUpsertWithWhereUniqueWithoutTeamInput[] + createMany?: InvitationCreateManyTeamInputEnvelope + set?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + disconnect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + delete?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + connect?: InvitationWhereUniqueInput | InvitationWhereUniqueInput[] + update?: InvitationUpdateWithWhereUniqueWithoutTeamInput | InvitationUpdateWithWhereUniqueWithoutTeamInput[] + updateMany?: InvitationUpdateManyWithWhereWithoutTeamInput | InvitationUpdateManyWithWhereWithoutTeamInput[] + deleteMany?: InvitationScalarWhereInput | InvitationScalarWhereInput[] + } + + export type MatchPlayerUncheckedUpdateManyWithoutTeamNestedInput = { + create?: XOR | MatchPlayerCreateWithoutTeamInput[] | MatchPlayerUncheckedCreateWithoutTeamInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutTeamInput | MatchPlayerCreateOrConnectWithoutTeamInput[] + upsert?: MatchPlayerUpsertWithWhereUniqueWithoutTeamInput | MatchPlayerUpsertWithWhereUniqueWithoutTeamInput[] + createMany?: MatchPlayerCreateManyTeamInputEnvelope + set?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + disconnect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + delete?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + update?: MatchPlayerUpdateWithWhereUniqueWithoutTeamInput | MatchPlayerUpdateWithWhereUniqueWithoutTeamInput[] + updateMany?: MatchPlayerUpdateManyWithWhereWithoutTeamInput | MatchPlayerUpdateManyWithWhereWithoutTeamInput[] + deleteMany?: MatchPlayerScalarWhereInput | MatchPlayerScalarWhereInput[] + } + + export type MatchUncheckedUpdateManyWithoutTeamANestedInput = { + create?: XOR | MatchCreateWithoutTeamAInput[] | MatchUncheckedCreateWithoutTeamAInput[] + connectOrCreate?: MatchCreateOrConnectWithoutTeamAInput | MatchCreateOrConnectWithoutTeamAInput[] + upsert?: MatchUpsertWithWhereUniqueWithoutTeamAInput | MatchUpsertWithWhereUniqueWithoutTeamAInput[] + createMany?: MatchCreateManyTeamAInputEnvelope + set?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + disconnect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + delete?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + connect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + update?: MatchUpdateWithWhereUniqueWithoutTeamAInput | MatchUpdateWithWhereUniqueWithoutTeamAInput[] + updateMany?: MatchUpdateManyWithWhereWithoutTeamAInput | MatchUpdateManyWithWhereWithoutTeamAInput[] + deleteMany?: MatchScalarWhereInput | MatchScalarWhereInput[] + } + + export type MatchUncheckedUpdateManyWithoutTeamBNestedInput = { + create?: XOR | MatchCreateWithoutTeamBInput[] | MatchUncheckedCreateWithoutTeamBInput[] + connectOrCreate?: MatchCreateOrConnectWithoutTeamBInput | MatchCreateOrConnectWithoutTeamBInput[] + upsert?: MatchUpsertWithWhereUniqueWithoutTeamBInput | MatchUpsertWithWhereUniqueWithoutTeamBInput[] + createMany?: MatchCreateManyTeamBInputEnvelope + set?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + disconnect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + delete?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + connect?: MatchWhereUniqueInput | MatchWhereUniqueInput[] + update?: MatchUpdateWithWhereUniqueWithoutTeamBInput | MatchUpdateWithWhereUniqueWithoutTeamBInput[] + updateMany?: MatchUpdateManyWithWhereWithoutTeamBInput | MatchUpdateManyWithWhereWithoutTeamBInput[] + deleteMany?: MatchScalarWhereInput | MatchScalarWhereInput[] + } + + export type TeamCreateNestedOneWithoutMatchesAsTeamAInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutMatchesAsTeamAInput + connect?: TeamWhereUniqueInput + } + + export type TeamCreateNestedOneWithoutMatchesAsTeamBInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutMatchesAsTeamBInput + connect?: TeamWhereUniqueInput + } + + export type DemoFileCreateNestedOneWithoutMatchInput = { + create?: XOR + connectOrCreate?: DemoFileCreateOrConnectWithoutMatchInput + connect?: DemoFileWhereUniqueInput + } + + export type MatchPlayerCreateNestedManyWithoutMatchInput = { + create?: XOR | MatchPlayerCreateWithoutMatchInput[] | MatchPlayerUncheckedCreateWithoutMatchInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutMatchInput | MatchPlayerCreateOrConnectWithoutMatchInput[] + createMany?: MatchPlayerCreateManyMatchInputEnvelope + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + } + + export type PremierRankHistoryCreateNestedManyWithoutMatchInput = { + create?: XOR | PremierRankHistoryCreateWithoutMatchInput[] | PremierRankHistoryUncheckedCreateWithoutMatchInput[] + connectOrCreate?: PremierRankHistoryCreateOrConnectWithoutMatchInput | PremierRankHistoryCreateOrConnectWithoutMatchInput[] + createMany?: PremierRankHistoryCreateManyMatchInputEnvelope + connect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + } + + export type DemoFileUncheckedCreateNestedOneWithoutMatchInput = { + create?: XOR + connectOrCreate?: DemoFileCreateOrConnectWithoutMatchInput + connect?: DemoFileWhereUniqueInput + } + + export type MatchPlayerUncheckedCreateNestedManyWithoutMatchInput = { + create?: XOR | MatchPlayerCreateWithoutMatchInput[] | MatchPlayerUncheckedCreateWithoutMatchInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutMatchInput | MatchPlayerCreateOrConnectWithoutMatchInput[] + createMany?: MatchPlayerCreateManyMatchInputEnvelope + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + } + + export type PremierRankHistoryUncheckedCreateNestedManyWithoutMatchInput = { + create?: XOR | PremierRankHistoryCreateWithoutMatchInput[] | PremierRankHistoryUncheckedCreateWithoutMatchInput[] + connectOrCreate?: PremierRankHistoryCreateOrConnectWithoutMatchInput | PremierRankHistoryCreateOrConnectWithoutMatchInput[] + createMany?: PremierRankHistoryCreateManyMatchInputEnvelope + connect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + } + + export type BigIntFieldUpdateOperationsInput = { + set?: bigint | number + increment?: bigint | number + decrement?: bigint | number + multiply?: bigint | number + divide?: bigint | number + } + + export type TeamUpdateOneWithoutMatchesAsTeamANestedInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutMatchesAsTeamAInput + upsert?: TeamUpsertWithoutMatchesAsTeamAInput + disconnect?: TeamWhereInput | boolean + delete?: TeamWhereInput | boolean + connect?: TeamWhereUniqueInput + update?: XOR, TeamUncheckedUpdateWithoutMatchesAsTeamAInput> + } + + export type TeamUpdateOneWithoutMatchesAsTeamBNestedInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutMatchesAsTeamBInput + upsert?: TeamUpsertWithoutMatchesAsTeamBInput + disconnect?: TeamWhereInput | boolean + delete?: TeamWhereInput | boolean + connect?: TeamWhereUniqueInput + update?: XOR, TeamUncheckedUpdateWithoutMatchesAsTeamBInput> + } + + export type DemoFileUpdateOneWithoutMatchNestedInput = { + create?: XOR + connectOrCreate?: DemoFileCreateOrConnectWithoutMatchInput + upsert?: DemoFileUpsertWithoutMatchInput + disconnect?: DemoFileWhereInput | boolean + delete?: DemoFileWhereInput | boolean + connect?: DemoFileWhereUniqueInput + update?: XOR, DemoFileUncheckedUpdateWithoutMatchInput> + } + + export type MatchPlayerUpdateManyWithoutMatchNestedInput = { + create?: XOR | MatchPlayerCreateWithoutMatchInput[] | MatchPlayerUncheckedCreateWithoutMatchInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutMatchInput | MatchPlayerCreateOrConnectWithoutMatchInput[] + upsert?: MatchPlayerUpsertWithWhereUniqueWithoutMatchInput | MatchPlayerUpsertWithWhereUniqueWithoutMatchInput[] + createMany?: MatchPlayerCreateManyMatchInputEnvelope + set?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + disconnect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + delete?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + update?: MatchPlayerUpdateWithWhereUniqueWithoutMatchInput | MatchPlayerUpdateWithWhereUniqueWithoutMatchInput[] + updateMany?: MatchPlayerUpdateManyWithWhereWithoutMatchInput | MatchPlayerUpdateManyWithWhereWithoutMatchInput[] + deleteMany?: MatchPlayerScalarWhereInput | MatchPlayerScalarWhereInput[] + } + + export type PremierRankHistoryUpdateManyWithoutMatchNestedInput = { + create?: XOR | PremierRankHistoryCreateWithoutMatchInput[] | PremierRankHistoryUncheckedCreateWithoutMatchInput[] + connectOrCreate?: PremierRankHistoryCreateOrConnectWithoutMatchInput | PremierRankHistoryCreateOrConnectWithoutMatchInput[] + upsert?: PremierRankHistoryUpsertWithWhereUniqueWithoutMatchInput | PremierRankHistoryUpsertWithWhereUniqueWithoutMatchInput[] + createMany?: PremierRankHistoryCreateManyMatchInputEnvelope + set?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + disconnect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + delete?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + connect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + update?: PremierRankHistoryUpdateWithWhereUniqueWithoutMatchInput | PremierRankHistoryUpdateWithWhereUniqueWithoutMatchInput[] + updateMany?: PremierRankHistoryUpdateManyWithWhereWithoutMatchInput | PremierRankHistoryUpdateManyWithWhereWithoutMatchInput[] + deleteMany?: PremierRankHistoryScalarWhereInput | PremierRankHistoryScalarWhereInput[] + } + + export type DemoFileUncheckedUpdateOneWithoutMatchNestedInput = { + create?: XOR + connectOrCreate?: DemoFileCreateOrConnectWithoutMatchInput + upsert?: DemoFileUpsertWithoutMatchInput + disconnect?: DemoFileWhereInput | boolean + delete?: DemoFileWhereInput | boolean + connect?: DemoFileWhereUniqueInput + update?: XOR, DemoFileUncheckedUpdateWithoutMatchInput> + } + + export type MatchPlayerUncheckedUpdateManyWithoutMatchNestedInput = { + create?: XOR | MatchPlayerCreateWithoutMatchInput[] | MatchPlayerUncheckedCreateWithoutMatchInput[] + connectOrCreate?: MatchPlayerCreateOrConnectWithoutMatchInput | MatchPlayerCreateOrConnectWithoutMatchInput[] + upsert?: MatchPlayerUpsertWithWhereUniqueWithoutMatchInput | MatchPlayerUpsertWithWhereUniqueWithoutMatchInput[] + createMany?: MatchPlayerCreateManyMatchInputEnvelope + set?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + disconnect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + delete?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + connect?: MatchPlayerWhereUniqueInput | MatchPlayerWhereUniqueInput[] + update?: MatchPlayerUpdateWithWhereUniqueWithoutMatchInput | MatchPlayerUpdateWithWhereUniqueWithoutMatchInput[] + updateMany?: MatchPlayerUpdateManyWithWhereWithoutMatchInput | MatchPlayerUpdateManyWithWhereWithoutMatchInput[] + deleteMany?: MatchPlayerScalarWhereInput | MatchPlayerScalarWhereInput[] + } + + export type PremierRankHistoryUncheckedUpdateManyWithoutMatchNestedInput = { + create?: XOR | PremierRankHistoryCreateWithoutMatchInput[] | PremierRankHistoryUncheckedCreateWithoutMatchInput[] + connectOrCreate?: PremierRankHistoryCreateOrConnectWithoutMatchInput | PremierRankHistoryCreateOrConnectWithoutMatchInput[] + upsert?: PremierRankHistoryUpsertWithWhereUniqueWithoutMatchInput | PremierRankHistoryUpsertWithWhereUniqueWithoutMatchInput[] + createMany?: PremierRankHistoryCreateManyMatchInputEnvelope + set?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + disconnect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + delete?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + connect?: PremierRankHistoryWhereUniqueInput | PremierRankHistoryWhereUniqueInput[] + update?: PremierRankHistoryUpdateWithWhereUniqueWithoutMatchInput | PremierRankHistoryUpdateWithWhereUniqueWithoutMatchInput[] + updateMany?: PremierRankHistoryUpdateManyWithWhereWithoutMatchInput | PremierRankHistoryUpdateManyWithWhereWithoutMatchInput[] + deleteMany?: PremierRankHistoryScalarWhereInput | PremierRankHistoryScalarWhereInput[] + } + + export type MatchCreateNestedOneWithoutPlayersInput = { + create?: XOR + connectOrCreate?: MatchCreateOrConnectWithoutPlayersInput + connect?: MatchWhereUniqueInput + } + + export type UserCreateNestedOneWithoutMatchPlayersInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutMatchPlayersInput + connect?: UserWhereUniqueInput + } + + export type TeamCreateNestedOneWithoutMatchPlayersInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutMatchPlayersInput + connect?: TeamWhereUniqueInput + } + + export type MatchPlayerStatsCreateNestedOneWithoutMatchPlayerInput = { + create?: XOR + connectOrCreate?: MatchPlayerStatsCreateOrConnectWithoutMatchPlayerInput + connect?: MatchPlayerStatsWhereUniqueInput + } + + export type MatchPlayerStatsUncheckedCreateNestedOneWithoutMatchPlayerInput = { + create?: XOR + connectOrCreate?: MatchPlayerStatsCreateOrConnectWithoutMatchPlayerInput + connect?: MatchPlayerStatsWhereUniqueInput + } + + export type MatchUpdateOneRequiredWithoutPlayersNestedInput = { + create?: XOR + connectOrCreate?: MatchCreateOrConnectWithoutPlayersInput + upsert?: MatchUpsertWithoutPlayersInput + connect?: MatchWhereUniqueInput + update?: XOR, MatchUncheckedUpdateWithoutPlayersInput> + } + + export type UserUpdateOneRequiredWithoutMatchPlayersNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutMatchPlayersInput + upsert?: UserUpsertWithoutMatchPlayersInput + connect?: UserWhereUniqueInput + update?: XOR, UserUncheckedUpdateWithoutMatchPlayersInput> + } + + export type TeamUpdateOneWithoutMatchPlayersNestedInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutMatchPlayersInput + upsert?: TeamUpsertWithoutMatchPlayersInput + disconnect?: TeamWhereInput | boolean + delete?: TeamWhereInput | boolean + connect?: TeamWhereUniqueInput + update?: XOR, TeamUncheckedUpdateWithoutMatchPlayersInput> + } + + export type MatchPlayerStatsUpdateOneWithoutMatchPlayerNestedInput = { + create?: XOR + connectOrCreate?: MatchPlayerStatsCreateOrConnectWithoutMatchPlayerInput + upsert?: MatchPlayerStatsUpsertWithoutMatchPlayerInput + disconnect?: MatchPlayerStatsWhereInput | boolean + delete?: MatchPlayerStatsWhereInput | boolean + connect?: MatchPlayerStatsWhereUniqueInput + update?: XOR, MatchPlayerStatsUncheckedUpdateWithoutMatchPlayerInput> + } + + export type MatchPlayerStatsUncheckedUpdateOneWithoutMatchPlayerNestedInput = { + create?: XOR + connectOrCreate?: MatchPlayerStatsCreateOrConnectWithoutMatchPlayerInput + upsert?: MatchPlayerStatsUpsertWithoutMatchPlayerInput + disconnect?: MatchPlayerStatsWhereInput | boolean + delete?: MatchPlayerStatsWhereInput | boolean + connect?: MatchPlayerStatsWhereUniqueInput + update?: XOR, MatchPlayerStatsUncheckedUpdateWithoutMatchPlayerInput> + } + + export type MatchPlayerCreateNestedOneWithoutStatsInput = { + create?: XOR + connectOrCreate?: MatchPlayerCreateOrConnectWithoutStatsInput + connect?: MatchPlayerWhereUniqueInput + } + + export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type FloatFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type MatchPlayerUpdateOneRequiredWithoutStatsNestedInput = { + create?: XOR + connectOrCreate?: MatchPlayerCreateOrConnectWithoutStatsInput + upsert?: MatchPlayerUpsertWithoutStatsInput + connect?: MatchPlayerWhereUniqueInput + update?: XOR, MatchPlayerUncheckedUpdateWithoutStatsInput> + } + + export type MatchCreateNestedOneWithoutDemoFileInput = { + create?: XOR + connectOrCreate?: MatchCreateOrConnectWithoutDemoFileInput + connect?: MatchWhereUniqueInput + } + + export type UserCreateNestedOneWithoutDemoFilesInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutDemoFilesInput + connect?: UserWhereUniqueInput + } + + export type MatchUpdateOneRequiredWithoutDemoFileNestedInput = { + create?: XOR + connectOrCreate?: MatchCreateOrConnectWithoutDemoFileInput + upsert?: MatchUpsertWithoutDemoFileInput + connect?: MatchWhereUniqueInput + update?: XOR, MatchUncheckedUpdateWithoutDemoFileInput> + } + + export type UserUpdateOneRequiredWithoutDemoFilesNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutDemoFilesInput + upsert?: UserUpsertWithoutDemoFilesInput + connect?: UserWhereUniqueInput + update?: XOR, UserUncheckedUpdateWithoutDemoFilesInput> + } + + export type UserCreateNestedOneWithoutInvitationsInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutInvitationsInput + connect?: UserWhereUniqueInput + } + + export type TeamCreateNestedOneWithoutInvitationsInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutInvitationsInput + connect?: TeamWhereUniqueInput + } + + export type UserUpdateOneRequiredWithoutInvitationsNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutInvitationsInput + upsert?: UserUpsertWithoutInvitationsInput + connect?: UserWhereUniqueInput + update?: XOR, UserUncheckedUpdateWithoutInvitationsInput> + } + + export type TeamUpdateOneRequiredWithoutInvitationsNestedInput = { + create?: XOR + connectOrCreate?: TeamCreateOrConnectWithoutInvitationsInput + upsert?: TeamUpsertWithoutInvitationsInput + connect?: TeamWhereUniqueInput + update?: XOR, TeamUncheckedUpdateWithoutInvitationsInput> + } + + export type UserCreateNestedOneWithoutNotificationsInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutNotificationsInput + connect?: UserWhereUniqueInput + } + + export type UserUpdateOneRequiredWithoutNotificationsNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutNotificationsInput + upsert?: UserUpsertWithoutNotificationsInput + connect?: UserWhereUniqueInput + update?: XOR, UserUncheckedUpdateWithoutNotificationsInput> + } + + export type UserCreateNestedOneWithoutMatchRequestsInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutMatchRequestsInput + connect?: UserWhereUniqueInput + } + + export type UserUpdateOneRequiredWithoutMatchRequestsNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutMatchRequestsInput + upsert?: UserUpsertWithoutMatchRequestsInput + connect?: UserWhereUniqueInput + update?: XOR, UserUncheckedUpdateWithoutMatchRequestsInput> + } + + export type UserCreateNestedOneWithoutRankHistoryInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutRankHistoryInput + connect?: UserWhereUniqueInput + } + + export type MatchCreateNestedOneWithoutRankUpdatesInput = { + create?: XOR + connectOrCreate?: MatchCreateOrConnectWithoutRankUpdatesInput + connect?: MatchWhereUniqueInput + } + + export type UserUpdateOneRequiredWithoutRankHistoryNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutRankHistoryInput + upsert?: UserUpsertWithoutRankHistoryInput + connect?: UserWhereUniqueInput + update?: XOR, UserUncheckedUpdateWithoutRankHistoryInput> + } + + export type MatchUpdateOneWithoutRankUpdatesNestedInput = { + create?: XOR + connectOrCreate?: MatchCreateOrConnectWithoutRankUpdatesInput + upsert?: MatchUpsertWithoutRankUpdatesInput + disconnect?: MatchWhereInput | boolean + delete?: MatchWhereInput | boolean + connect?: MatchWhereUniqueInput + update?: XOR, MatchUncheckedUpdateWithoutRankUpdatesInput> + } + + export type NullableBigIntFieldUpdateOperationsInput = { + set?: bigint | number | null + increment?: bigint | number + decrement?: bigint | number + multiply?: bigint | number + divide?: bigint | number + } + + 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 NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> | null + in?: string[] | ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null + 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?: NestedStringNullableFilter<$PrismaModel> | string | null + } + + export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolFilter<$PrismaModel> | boolean + } + + 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 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 NestedDateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeFilter<$PrismaModel> | Date | string + } + + 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 NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | StringFieldRefInput<$PrismaModel> | null + in?: string[] | ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null + 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?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedStringNullableFilter<$PrismaModel> + _max?: NestedStringNullableFilter<$PrismaModel> + } + + export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedBoolFilter<$PrismaModel> + _max?: NestedBoolFilter<$PrismaModel> + } + + export type NestedIntNullableWithAggregatesFilter<$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?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedIntNullableFilter<$PrismaModel> + _max?: NestedIntNullableFilter<$PrismaModel> + } + + export type NestedFloatNullableFilter<$PrismaModel = never> = { + equals?: number | FloatFieldRefInput<$PrismaModel> | null + in?: number[] | ListFloatFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> | null + lt?: number | FloatFieldRefInput<$PrismaModel> + lte?: number | FloatFieldRefInput<$PrismaModel> + gt?: number | FloatFieldRefInput<$PrismaModel> + gte?: number | FloatFieldRefInput<$PrismaModel> + not?: NestedFloatNullableFilter<$PrismaModel> | number | null + } + + 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 NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedDateTimeFilter<$PrismaModel> + _max?: NestedDateTimeFilter<$PrismaModel> + } + + export type NestedBigIntFilter<$PrismaModel = never> = { + equals?: bigint | number | BigIntFieldRefInput<$PrismaModel> + in?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> + notIn?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> + lt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + lte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + not?: NestedBigIntFilter<$PrismaModel> | bigint | number + } + + export type NestedBigIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: bigint | number | BigIntFieldRefInput<$PrismaModel> + in?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> + notIn?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> + lt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + lte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + not?: NestedBigIntWithAggregatesFilter<$PrismaModel> | bigint | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedBigIntFilter<$PrismaModel> + _min?: NestedBigIntFilter<$PrismaModel> + _max?: NestedBigIntFilter<$PrismaModel> + } + + export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | FloatFieldRefInput<$PrismaModel> + in?: number[] | ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> + lt?: number | FloatFieldRefInput<$PrismaModel> + lte?: number | FloatFieldRefInput<$PrismaModel> + gt?: number | FloatFieldRefInput<$PrismaModel> + gte?: number | FloatFieldRefInput<$PrismaModel> + not?: NestedFloatFilter<$PrismaModel> | number + } + export type NestedJsonNullableFilter<$PrismaModel = never> = + | PatchUndefined< + Either>, Exclude>, 'path'>>, + Required> + > + | OptionalFlat>, 'path'>> + + export type NestedJsonNullableFilterBase<$PrismaModel = never> = { + equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + path?: string[] + mode?: QueryMode | EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | StringFieldRefInput<$PrismaModel> + string_starts_with?: string | StringFieldRefInput<$PrismaModel> + string_ends_with?: string | StringFieldRefInput<$PrismaModel> + array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null + lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel> + not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter + } + + export type NestedIntWithAggregatesFilter<$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?: NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedIntFilter<$PrismaModel> + _min?: NestedIntFilter<$PrismaModel> + _max?: NestedIntFilter<$PrismaModel> + } + + export type NestedFloatWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | FloatFieldRefInput<$PrismaModel> + in?: number[] | ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> + lt?: number | FloatFieldRefInput<$PrismaModel> + lte?: number | FloatFieldRefInput<$PrismaModel> + gt?: number | FloatFieldRefInput<$PrismaModel> + gte?: number | FloatFieldRefInput<$PrismaModel> + not?: NestedFloatWithAggregatesFilter<$PrismaModel> | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedFloatFilter<$PrismaModel> + _min?: NestedFloatFilter<$PrismaModel> + _max?: NestedFloatFilter<$PrismaModel> + } + + export type NestedBigIntNullableFilter<$PrismaModel = never> = { + equals?: bigint | number | BigIntFieldRefInput<$PrismaModel> | null + in?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> | null + notIn?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> | null + lt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + lte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + not?: NestedBigIntNullableFilter<$PrismaModel> | bigint | number | null + } + + export type NestedBigIntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: bigint | number | BigIntFieldRefInput<$PrismaModel> | null + in?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> | null + notIn?: bigint[] | number[] | ListBigIntFieldRefInput<$PrismaModel> | null + lt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + lte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gt?: bigint | number | BigIntFieldRefInput<$PrismaModel> + gte?: bigint | number | BigIntFieldRefInput<$PrismaModel> + not?: NestedBigIntNullableWithAggregatesFilter<$PrismaModel> | bigint | number | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedBigIntNullableFilter<$PrismaModel> + _min?: NestedBigIntNullableFilter<$PrismaModel> + _max?: NestedBigIntNullableFilter<$PrismaModel> + } + + export type TeamCreateWithoutMembersInput = { + id?: string + name: string + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + leader?: UserCreateNestedOneWithoutLedTeamInput + invitations?: InvitationCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchCreateNestedManyWithoutTeamBInput + } + + export type TeamUncheckedCreateWithoutMembersInput = { + id?: string + name: string + leaderId?: string | null + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + invitations?: InvitationUncheckedCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchUncheckedCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchUncheckedCreateNestedManyWithoutTeamBInput + } + + export type TeamCreateOrConnectWithoutMembersInput = { + where: TeamWhereUniqueInput + create: XOR + } + + export type TeamCreateWithoutLeaderInput = { + id?: string + name: string + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + members?: UserCreateNestedManyWithoutTeamInput + invitations?: InvitationCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchCreateNestedManyWithoutTeamBInput + } + + export type TeamUncheckedCreateWithoutLeaderInput = { + id?: string + name: string + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + members?: UserUncheckedCreateNestedManyWithoutTeamInput + invitations?: InvitationUncheckedCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchUncheckedCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchUncheckedCreateNestedManyWithoutTeamBInput + } + + export type TeamCreateOrConnectWithoutLeaderInput = { + where: TeamWhereUniqueInput + create: XOR + } + + export type InvitationCreateWithoutUserInput = { + id?: string + type: string + createdAt?: Date | string + team: TeamCreateNestedOneWithoutInvitationsInput + } + + export type InvitationUncheckedCreateWithoutUserInput = { + id?: string + teamId: string + type: string + createdAt?: Date | string + } + + export type InvitationCreateOrConnectWithoutUserInput = { + where: InvitationWhereUniqueInput + create: XOR + } + + export type InvitationCreateManyUserInputEnvelope = { + data: InvitationCreateManyUserInput | InvitationCreateManyUserInput[] + skipDuplicates?: boolean + } + + export type NotificationCreateWithoutUserInput = { + id?: string + title?: string | null + message: string + read?: boolean + persistent?: boolean + actionType?: string | null + actionData?: string | null + createdAt?: Date | string + } + + export type NotificationUncheckedCreateWithoutUserInput = { + id?: string + title?: string | null + message: string + read?: boolean + persistent?: boolean + actionType?: string | null + actionData?: string | null + createdAt?: Date | string + } + + export type NotificationCreateOrConnectWithoutUserInput = { + where: NotificationWhereUniqueInput + create: XOR + } + + export type NotificationCreateManyUserInputEnvelope = { + data: NotificationCreateManyUserInput | NotificationCreateManyUserInput[] + skipDuplicates?: boolean + } + + export type MatchPlayerCreateWithoutUserInput = { + id?: string + createdAt?: Date | string + match: MatchCreateNestedOneWithoutPlayersInput + team?: TeamCreateNestedOneWithoutMatchPlayersInput + stats?: MatchPlayerStatsCreateNestedOneWithoutMatchPlayerInput + } + + export type MatchPlayerUncheckedCreateWithoutUserInput = { + id?: string + matchId: bigint | number + teamId?: string | null + createdAt?: Date | string + stats?: MatchPlayerStatsUncheckedCreateNestedOneWithoutMatchPlayerInput + } + + export type MatchPlayerCreateOrConnectWithoutUserInput = { + where: MatchPlayerWhereUniqueInput + create: XOR + } + + export type MatchPlayerCreateManyUserInputEnvelope = { + data: MatchPlayerCreateManyUserInput | MatchPlayerCreateManyUserInput[] + skipDuplicates?: boolean + } + + export type CS2MatchRequestCreateWithoutUserInput = { + id?: string + steamId: string + matchId: bigint | number + reservationId: bigint | number + tvPort: bigint | number + processed?: boolean + createdAt?: Date | string + } + + export type CS2MatchRequestUncheckedCreateWithoutUserInput = { + id?: string + steamId: string + matchId: bigint | number + reservationId: bigint | number + tvPort: bigint | number + processed?: boolean + createdAt?: Date | string + } + + export type CS2MatchRequestCreateOrConnectWithoutUserInput = { + where: CS2MatchRequestWhereUniqueInput + create: XOR + } + + export type CS2MatchRequestCreateManyUserInputEnvelope = { + data: CS2MatchRequestCreateManyUserInput | CS2MatchRequestCreateManyUserInput[] + skipDuplicates?: boolean + } + + export type PremierRankHistoryCreateWithoutUserInput = { + id?: string + steamId: string + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + match?: MatchCreateNestedOneWithoutRankUpdatesInput + } + + export type PremierRankHistoryUncheckedCreateWithoutUserInput = { + id?: string + steamId: string + matchId?: bigint | number | null + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + } + + export type PremierRankHistoryCreateOrConnectWithoutUserInput = { + where: PremierRankHistoryWhereUniqueInput + create: XOR + } + + export type PremierRankHistoryCreateManyUserInputEnvelope = { + data: PremierRankHistoryCreateManyUserInput | PremierRankHistoryCreateManyUserInput[] + skipDuplicates?: boolean + } + + export type DemoFileCreateWithoutUserInput = { + id?: string + fileName: string + filePath: string + parsed?: boolean + createdAt?: Date | string + match: MatchCreateNestedOneWithoutDemoFileInput + } + + export type DemoFileUncheckedCreateWithoutUserInput = { + id?: string + matchId: bigint | number + fileName: string + filePath: string + parsed?: boolean + createdAt?: Date | string + } + + export type DemoFileCreateOrConnectWithoutUserInput = { + where: DemoFileWhereUniqueInput + create: XOR + } + + export type DemoFileCreateManyUserInputEnvelope = { + data: DemoFileCreateManyUserInput | DemoFileCreateManyUserInput[] + skipDuplicates?: boolean + } + + export type TeamUpsertWithoutMembersInput = { + update: XOR + create: XOR + where?: TeamWhereInput + } + + export type TeamUpdateToOneWithWhereWithoutMembersInput = { + where?: TeamWhereInput + data: XOR + } + + export type TeamUpdateWithoutMembersInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + leader?: UserUpdateOneWithoutLedTeamNestedInput + invitations?: InvitationUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUpdateManyWithoutTeamBNestedInput + } + + export type TeamUncheckedUpdateWithoutMembersInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + leaderId?: NullableStringFieldUpdateOperationsInput | string | null + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + invitations?: InvitationUncheckedUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUncheckedUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUncheckedUpdateManyWithoutTeamBNestedInput + } + + export type TeamUpsertWithoutLeaderInput = { + update: XOR + create: XOR + where?: TeamWhereInput + } + + export type TeamUpdateToOneWithWhereWithoutLeaderInput = { + where?: TeamWhereInput + data: XOR + } + + export type TeamUpdateWithoutLeaderInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + members?: UserUpdateManyWithoutTeamNestedInput + invitations?: InvitationUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUpdateManyWithoutTeamBNestedInput + } + + export type TeamUncheckedUpdateWithoutLeaderInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + members?: UserUncheckedUpdateManyWithoutTeamNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUncheckedUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUncheckedUpdateManyWithoutTeamBNestedInput + } + + export type InvitationUpsertWithWhereUniqueWithoutUserInput = { + where: InvitationWhereUniqueInput + update: XOR + create: XOR + } + + export type InvitationUpdateWithWhereUniqueWithoutUserInput = { + where: InvitationWhereUniqueInput + data: XOR + } + + export type InvitationUpdateManyWithWhereWithoutUserInput = { + where: InvitationScalarWhereInput + data: XOR + } + + export type InvitationScalarWhereInput = { + AND?: InvitationScalarWhereInput | InvitationScalarWhereInput[] + OR?: InvitationScalarWhereInput[] + NOT?: InvitationScalarWhereInput | InvitationScalarWhereInput[] + id?: StringFilter<"Invitation"> | string + userId?: StringFilter<"Invitation"> | string + teamId?: StringFilter<"Invitation"> | string + type?: StringFilter<"Invitation"> | string + createdAt?: DateTimeFilter<"Invitation"> | Date | string + } + + export type NotificationUpsertWithWhereUniqueWithoutUserInput = { + where: NotificationWhereUniqueInput + update: XOR + create: XOR + } + + export type NotificationUpdateWithWhereUniqueWithoutUserInput = { + where: NotificationWhereUniqueInput + data: XOR + } + + export type NotificationUpdateManyWithWhereWithoutUserInput = { + where: NotificationScalarWhereInput + data: XOR + } + + export type NotificationScalarWhereInput = { + AND?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + OR?: NotificationScalarWhereInput[] + NOT?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + id?: StringFilter<"Notification"> | string + userId?: StringFilter<"Notification"> | string + title?: StringNullableFilter<"Notification"> | string | null + message?: StringFilter<"Notification"> | string + read?: BoolFilter<"Notification"> | boolean + persistent?: BoolFilter<"Notification"> | boolean + actionType?: StringNullableFilter<"Notification"> | string | null + actionData?: StringNullableFilter<"Notification"> | string | null + createdAt?: DateTimeFilter<"Notification"> | Date | string + } + + export type MatchPlayerUpsertWithWhereUniqueWithoutUserInput = { + where: MatchPlayerWhereUniqueInput + update: XOR + create: XOR + } + + export type MatchPlayerUpdateWithWhereUniqueWithoutUserInput = { + where: MatchPlayerWhereUniqueInput + data: XOR + } + + export type MatchPlayerUpdateManyWithWhereWithoutUserInput = { + where: MatchPlayerScalarWhereInput + data: XOR + } + + export type MatchPlayerScalarWhereInput = { + AND?: MatchPlayerScalarWhereInput | MatchPlayerScalarWhereInput[] + OR?: MatchPlayerScalarWhereInput[] + NOT?: MatchPlayerScalarWhereInput | MatchPlayerScalarWhereInput[] + id?: StringFilter<"MatchPlayer"> | string + matchId?: BigIntFilter<"MatchPlayer"> | bigint | number + steamId?: StringFilter<"MatchPlayer"> | string + teamId?: StringNullableFilter<"MatchPlayer"> | string | null + createdAt?: DateTimeFilter<"MatchPlayer"> | Date | string + } + + export type CS2MatchRequestUpsertWithWhereUniqueWithoutUserInput = { + where: CS2MatchRequestWhereUniqueInput + update: XOR + create: XOR + } + + export type CS2MatchRequestUpdateWithWhereUniqueWithoutUserInput = { + where: CS2MatchRequestWhereUniqueInput + data: XOR + } + + export type CS2MatchRequestUpdateManyWithWhereWithoutUserInput = { + where: CS2MatchRequestScalarWhereInput + data: XOR + } + + export type CS2MatchRequestScalarWhereInput = { + AND?: CS2MatchRequestScalarWhereInput | CS2MatchRequestScalarWhereInput[] + OR?: CS2MatchRequestScalarWhereInput[] + NOT?: CS2MatchRequestScalarWhereInput | CS2MatchRequestScalarWhereInput[] + id?: StringFilter<"CS2MatchRequest"> | string + userId?: StringFilter<"CS2MatchRequest"> | string + steamId?: StringFilter<"CS2MatchRequest"> | string + matchId?: BigIntFilter<"CS2MatchRequest"> | bigint | number + reservationId?: BigIntFilter<"CS2MatchRequest"> | bigint | number + tvPort?: BigIntFilter<"CS2MatchRequest"> | bigint | number + processed?: BoolFilter<"CS2MatchRequest"> | boolean + createdAt?: DateTimeFilter<"CS2MatchRequest"> | Date | string + } + + export type PremierRankHistoryUpsertWithWhereUniqueWithoutUserInput = { + where: PremierRankHistoryWhereUniqueInput + update: XOR + create: XOR + } + + export type PremierRankHistoryUpdateWithWhereUniqueWithoutUserInput = { + where: PremierRankHistoryWhereUniqueInput + data: XOR + } + + export type PremierRankHistoryUpdateManyWithWhereWithoutUserInput = { + where: PremierRankHistoryScalarWhereInput + data: XOR + } + + export type PremierRankHistoryScalarWhereInput = { + AND?: PremierRankHistoryScalarWhereInput | PremierRankHistoryScalarWhereInput[] + OR?: PremierRankHistoryScalarWhereInput[] + NOT?: PremierRankHistoryScalarWhereInput | PremierRankHistoryScalarWhereInput[] + id?: StringFilter<"PremierRankHistory"> | string + userId?: StringFilter<"PremierRankHistory"> | string + steamId?: StringFilter<"PremierRankHistory"> | string + matchId?: BigIntNullableFilter<"PremierRankHistory"> | bigint | number | null + rankOld?: IntFilter<"PremierRankHistory"> | number + rankNew?: IntFilter<"PremierRankHistory"> | number + delta?: IntFilter<"PremierRankHistory"> | number + winCount?: IntFilter<"PremierRankHistory"> | number + createdAt?: DateTimeFilter<"PremierRankHistory"> | Date | string + } + + export type DemoFileUpsertWithWhereUniqueWithoutUserInput = { + where: DemoFileWhereUniqueInput + update: XOR + create: XOR + } + + export type DemoFileUpdateWithWhereUniqueWithoutUserInput = { + where: DemoFileWhereUniqueInput + data: XOR + } + + export type DemoFileUpdateManyWithWhereWithoutUserInput = { + where: DemoFileScalarWhereInput + data: XOR + } + + export type DemoFileScalarWhereInput = { + AND?: DemoFileScalarWhereInput | DemoFileScalarWhereInput[] + OR?: DemoFileScalarWhereInput[] + NOT?: DemoFileScalarWhereInput | DemoFileScalarWhereInput[] + id?: StringFilter<"DemoFile"> | string + matchId?: BigIntFilter<"DemoFile"> | bigint | number + steamId?: StringFilter<"DemoFile"> | string + fileName?: StringFilter<"DemoFile"> | string + filePath?: StringFilter<"DemoFile"> | string + parsed?: BoolFilter<"DemoFile"> | boolean + createdAt?: DateTimeFilter<"DemoFile"> | Date | string + } + + export type UserCreateWithoutLedTeamInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + team?: TeamCreateNestedOneWithoutMembersInput + invitations?: InvitationCreateNestedManyWithoutUserInput + notifications?: NotificationCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryCreateNestedManyWithoutUserInput + demoFiles?: DemoFileCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateWithoutLedTeamInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + invitations?: InvitationUncheckedCreateNestedManyWithoutUserInput + notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput + demoFiles?: DemoFileUncheckedCreateNestedManyWithoutUserInput + } + + export type UserCreateOrConnectWithoutLedTeamInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type UserCreateWithoutTeamInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamCreateNestedOneWithoutLeaderInput + invitations?: InvitationCreateNestedManyWithoutUserInput + notifications?: NotificationCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryCreateNestedManyWithoutUserInput + demoFiles?: DemoFileCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateWithoutTeamInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamUncheckedCreateNestedOneWithoutLeaderInput + invitations?: InvitationUncheckedCreateNestedManyWithoutUserInput + notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput + demoFiles?: DemoFileUncheckedCreateNestedManyWithoutUserInput + } + + export type UserCreateOrConnectWithoutTeamInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type UserCreateManyTeamInputEnvelope = { + data: UserCreateManyTeamInput | UserCreateManyTeamInput[] + skipDuplicates?: boolean + } + + export type InvitationCreateWithoutTeamInput = { + id?: string + type: string + createdAt?: Date | string + user: UserCreateNestedOneWithoutInvitationsInput + } + + export type InvitationUncheckedCreateWithoutTeamInput = { + id?: string + userId: string + type: string + createdAt?: Date | string + } + + export type InvitationCreateOrConnectWithoutTeamInput = { + where: InvitationWhereUniqueInput + create: XOR + } + + export type InvitationCreateManyTeamInputEnvelope = { + data: InvitationCreateManyTeamInput | InvitationCreateManyTeamInput[] + skipDuplicates?: boolean + } + + export type MatchPlayerCreateWithoutTeamInput = { + id?: string + createdAt?: Date | string + match: MatchCreateNestedOneWithoutPlayersInput + user: UserCreateNestedOneWithoutMatchPlayersInput + stats?: MatchPlayerStatsCreateNestedOneWithoutMatchPlayerInput + } + + export type MatchPlayerUncheckedCreateWithoutTeamInput = { + id?: string + matchId: bigint | number + steamId: string + createdAt?: Date | string + stats?: MatchPlayerStatsUncheckedCreateNestedOneWithoutMatchPlayerInput + } + + export type MatchPlayerCreateOrConnectWithoutTeamInput = { + where: MatchPlayerWhereUniqueInput + create: XOR + } + + export type MatchPlayerCreateManyTeamInputEnvelope = { + data: MatchPlayerCreateManyTeamInput | MatchPlayerCreateManyTeamInput[] + skipDuplicates?: boolean + } + + export type MatchCreateWithoutTeamAInput = { + matchId?: bigint | number + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + teamB?: TeamCreateNestedOneWithoutMatchesAsTeamBInput + demoFile?: DemoFileCreateNestedOneWithoutMatchInput + players?: MatchPlayerCreateNestedManyWithoutMatchInput + rankUpdates?: PremierRankHistoryCreateNestedManyWithoutMatchInput + } + + export type MatchUncheckedCreateWithoutTeamAInput = { + matchId?: bigint | number + teamBId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + demoFile?: DemoFileUncheckedCreateNestedOneWithoutMatchInput + players?: MatchPlayerUncheckedCreateNestedManyWithoutMatchInput + rankUpdates?: PremierRankHistoryUncheckedCreateNestedManyWithoutMatchInput + } + + export type MatchCreateOrConnectWithoutTeamAInput = { + where: MatchWhereUniqueInput + create: XOR + } + + export type MatchCreateManyTeamAInputEnvelope = { + data: MatchCreateManyTeamAInput | MatchCreateManyTeamAInput[] + skipDuplicates?: boolean + } + + export type MatchCreateWithoutTeamBInput = { + matchId?: bigint | number + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + teamA?: TeamCreateNestedOneWithoutMatchesAsTeamAInput + demoFile?: DemoFileCreateNestedOneWithoutMatchInput + players?: MatchPlayerCreateNestedManyWithoutMatchInput + rankUpdates?: PremierRankHistoryCreateNestedManyWithoutMatchInput + } + + export type MatchUncheckedCreateWithoutTeamBInput = { + matchId?: bigint | number + teamAId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + demoFile?: DemoFileUncheckedCreateNestedOneWithoutMatchInput + players?: MatchPlayerUncheckedCreateNestedManyWithoutMatchInput + rankUpdates?: PremierRankHistoryUncheckedCreateNestedManyWithoutMatchInput + } + + export type MatchCreateOrConnectWithoutTeamBInput = { + where: MatchWhereUniqueInput + create: XOR + } + + export type MatchCreateManyTeamBInputEnvelope = { + data: MatchCreateManyTeamBInput | MatchCreateManyTeamBInput[] + skipDuplicates?: boolean + } + + export type UserUpsertWithoutLedTeamInput = { + update: XOR + create: XOR + where?: UserWhereInput + } + + export type UserUpdateToOneWithWhereWithoutLedTeamInput = { + where?: UserWhereInput + data: XOR + } + + export type UserUpdateWithoutLedTeamInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneWithoutMembersNestedInput + invitations?: InvitationUpdateManyWithoutUserNestedInput + notifications?: NotificationUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateWithoutLedTeamInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + invitations?: InvitationUncheckedUpdateManyWithoutUserNestedInput + notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUncheckedUpdateManyWithoutUserNestedInput + } + + export type UserUpsertWithWhereUniqueWithoutTeamInput = { + where: UserWhereUniqueInput + update: XOR + create: XOR + } + + export type UserUpdateWithWhereUniqueWithoutTeamInput = { + where: UserWhereUniqueInput + data: XOR + } + + export type UserUpdateManyWithWhereWithoutTeamInput = { + where: UserScalarWhereInput + data: XOR + } + + export type UserScalarWhereInput = { + AND?: UserScalarWhereInput | UserScalarWhereInput[] + OR?: UserScalarWhereInput[] + NOT?: UserScalarWhereInput | UserScalarWhereInput[] + steamId?: StringFilter<"User"> | string + name?: StringNullableFilter<"User"> | string | null + avatar?: StringNullableFilter<"User"> | string | null + location?: StringNullableFilter<"User"> | string | null + isAdmin?: BoolFilter<"User"> | boolean + teamId?: StringNullableFilter<"User"> | string | null + premierRank?: IntNullableFilter<"User"> | number | null + authCode?: StringNullableFilter<"User"> | string | null + lastKnownShareCode?: StringNullableFilter<"User"> | string | null + lastKnownShareCodeDate?: DateTimeNullableFilter<"User"> | Date | string | null + createdAt?: DateTimeFilter<"User"> | Date | string + } + + export type InvitationUpsertWithWhereUniqueWithoutTeamInput = { + where: InvitationWhereUniqueInput + update: XOR + create: XOR + } + + export type InvitationUpdateWithWhereUniqueWithoutTeamInput = { + where: InvitationWhereUniqueInput + data: XOR + } + + export type InvitationUpdateManyWithWhereWithoutTeamInput = { + where: InvitationScalarWhereInput + data: XOR + } + + export type MatchPlayerUpsertWithWhereUniqueWithoutTeamInput = { + where: MatchPlayerWhereUniqueInput + update: XOR + create: XOR + } + + export type MatchPlayerUpdateWithWhereUniqueWithoutTeamInput = { + where: MatchPlayerWhereUniqueInput + data: XOR + } + + export type MatchPlayerUpdateManyWithWhereWithoutTeamInput = { + where: MatchPlayerScalarWhereInput + data: XOR + } + + export type MatchUpsertWithWhereUniqueWithoutTeamAInput = { + where: MatchWhereUniqueInput + update: XOR + create: XOR + } + + export type MatchUpdateWithWhereUniqueWithoutTeamAInput = { + where: MatchWhereUniqueInput + data: XOR + } + + export type MatchUpdateManyWithWhereWithoutTeamAInput = { + where: MatchScalarWhereInput + data: XOR + } + + export type MatchScalarWhereInput = { + AND?: MatchScalarWhereInput | MatchScalarWhereInput[] + OR?: MatchScalarWhereInput[] + NOT?: MatchScalarWhereInput | MatchScalarWhereInput[] + matchId?: BigIntFilter<"Match"> | bigint | number + teamAId?: StringNullableFilter<"Match"> | string | null + teamBId?: StringNullableFilter<"Match"> | string | null + matchDate?: DateTimeFilter<"Match"> | Date | string + matchType?: StringFilter<"Match"> | string + map?: StringNullableFilter<"Match"> | string | null + title?: StringFilter<"Match"> | string + description?: StringNullableFilter<"Match"> | string | null + demoData?: JsonNullableFilter<"Match"> + demoFilePath?: StringNullableFilter<"Match"> | string | null + scoreA?: IntNullableFilter<"Match"> | number | null + scoreB?: IntNullableFilter<"Match"> | number | null + createdAt?: DateTimeFilter<"Match"> | Date | string + updatedAt?: DateTimeFilter<"Match"> | Date | string + } + + export type MatchUpsertWithWhereUniqueWithoutTeamBInput = { + where: MatchWhereUniqueInput + update: XOR + create: XOR + } + + export type MatchUpdateWithWhereUniqueWithoutTeamBInput = { + where: MatchWhereUniqueInput + data: XOR + } + + export type MatchUpdateManyWithWhereWithoutTeamBInput = { + where: MatchScalarWhereInput + data: XOR + } + + export type TeamCreateWithoutMatchesAsTeamAInput = { + id?: string + name: string + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + leader?: UserCreateNestedOneWithoutLedTeamInput + members?: UserCreateNestedManyWithoutTeamInput + invitations?: InvitationCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutTeamInput + matchesAsTeamB?: MatchCreateNestedManyWithoutTeamBInput + } + + export type TeamUncheckedCreateWithoutMatchesAsTeamAInput = { + id?: string + name: string + leaderId?: string | null + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + members?: UserUncheckedCreateNestedManyWithoutTeamInput + invitations?: InvitationUncheckedCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutTeamInput + matchesAsTeamB?: MatchUncheckedCreateNestedManyWithoutTeamBInput + } + + export type TeamCreateOrConnectWithoutMatchesAsTeamAInput = { + where: TeamWhereUniqueInput + create: XOR + } + + export type TeamCreateWithoutMatchesAsTeamBInput = { + id?: string + name: string + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + leader?: UserCreateNestedOneWithoutLedTeamInput + members?: UserCreateNestedManyWithoutTeamInput + invitations?: InvitationCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchCreateNestedManyWithoutTeamAInput + } + + export type TeamUncheckedCreateWithoutMatchesAsTeamBInput = { + id?: string + name: string + leaderId?: string | null + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + members?: UserUncheckedCreateNestedManyWithoutTeamInput + invitations?: InvitationUncheckedCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchUncheckedCreateNestedManyWithoutTeamAInput + } + + export type TeamCreateOrConnectWithoutMatchesAsTeamBInput = { + where: TeamWhereUniqueInput + create: XOR + } + + export type DemoFileCreateWithoutMatchInput = { + id?: string + fileName: string + filePath: string + parsed?: boolean + createdAt?: Date | string + user: UserCreateNestedOneWithoutDemoFilesInput + } + + export type DemoFileUncheckedCreateWithoutMatchInput = { + id?: string + steamId: string + fileName: string + filePath: string + parsed?: boolean + createdAt?: Date | string + } + + export type DemoFileCreateOrConnectWithoutMatchInput = { + where: DemoFileWhereUniqueInput + create: XOR + } + + export type MatchPlayerCreateWithoutMatchInput = { + id?: string + createdAt?: Date | string + user: UserCreateNestedOneWithoutMatchPlayersInput + team?: TeamCreateNestedOneWithoutMatchPlayersInput + stats?: MatchPlayerStatsCreateNestedOneWithoutMatchPlayerInput + } + + export type MatchPlayerUncheckedCreateWithoutMatchInput = { + id?: string + steamId: string + teamId?: string | null + createdAt?: Date | string + stats?: MatchPlayerStatsUncheckedCreateNestedOneWithoutMatchPlayerInput + } + + export type MatchPlayerCreateOrConnectWithoutMatchInput = { + where: MatchPlayerWhereUniqueInput + create: XOR + } + + export type MatchPlayerCreateManyMatchInputEnvelope = { + data: MatchPlayerCreateManyMatchInput | MatchPlayerCreateManyMatchInput[] + skipDuplicates?: boolean + } + + export type PremierRankHistoryCreateWithoutMatchInput = { + id?: string + steamId: string + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + user: UserCreateNestedOneWithoutRankHistoryInput + } + + export type PremierRankHistoryUncheckedCreateWithoutMatchInput = { + id?: string + userId: string + steamId: string + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + } + + export type PremierRankHistoryCreateOrConnectWithoutMatchInput = { + where: PremierRankHistoryWhereUniqueInput + create: XOR + } + + export type PremierRankHistoryCreateManyMatchInputEnvelope = { + data: PremierRankHistoryCreateManyMatchInput | PremierRankHistoryCreateManyMatchInput[] + skipDuplicates?: boolean + } + + export type TeamUpsertWithoutMatchesAsTeamAInput = { + update: XOR + create: XOR + where?: TeamWhereInput + } + + export type TeamUpdateToOneWithWhereWithoutMatchesAsTeamAInput = { + where?: TeamWhereInput + data: XOR + } + + export type TeamUpdateWithoutMatchesAsTeamAInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + leader?: UserUpdateOneWithoutLedTeamNestedInput + members?: UserUpdateManyWithoutTeamNestedInput + invitations?: InvitationUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutTeamNestedInput + matchesAsTeamB?: MatchUpdateManyWithoutTeamBNestedInput + } + + export type TeamUncheckedUpdateWithoutMatchesAsTeamAInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + leaderId?: NullableStringFieldUpdateOperationsInput | string | null + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + members?: UserUncheckedUpdateManyWithoutTeamNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutTeamNestedInput + matchesAsTeamB?: MatchUncheckedUpdateManyWithoutTeamBNestedInput + } + + export type TeamUpsertWithoutMatchesAsTeamBInput = { + update: XOR + create: XOR + where?: TeamWhereInput + } + + export type TeamUpdateToOneWithWhereWithoutMatchesAsTeamBInput = { + where?: TeamWhereInput + data: XOR + } + + export type TeamUpdateWithoutMatchesAsTeamBInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + leader?: UserUpdateOneWithoutLedTeamNestedInput + members?: UserUpdateManyWithoutTeamNestedInput + invitations?: InvitationUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUpdateManyWithoutTeamANestedInput + } + + export type TeamUncheckedUpdateWithoutMatchesAsTeamBInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + leaderId?: NullableStringFieldUpdateOperationsInput | string | null + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + members?: UserUncheckedUpdateManyWithoutTeamNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUncheckedUpdateManyWithoutTeamANestedInput + } + + export type DemoFileUpsertWithoutMatchInput = { + update: XOR + create: XOR + where?: DemoFileWhereInput + } + + export type DemoFileUpdateToOneWithWhereWithoutMatchInput = { + where?: DemoFileWhereInput + data: XOR + } + + export type DemoFileUpdateWithoutMatchInput = { + id?: StringFieldUpdateOperationsInput | string + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutDemoFilesNestedInput + } + + export type DemoFileUncheckedUpdateWithoutMatchInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchPlayerUpsertWithWhereUniqueWithoutMatchInput = { + where: MatchPlayerWhereUniqueInput + update: XOR + create: XOR + } + + export type MatchPlayerUpdateWithWhereUniqueWithoutMatchInput = { + where: MatchPlayerWhereUniqueInput + data: XOR + } + + export type MatchPlayerUpdateManyWithWhereWithoutMatchInput = { + where: MatchPlayerScalarWhereInput + data: XOR + } + + export type PremierRankHistoryUpsertWithWhereUniqueWithoutMatchInput = { + where: PremierRankHistoryWhereUniqueInput + update: XOR + create: XOR + } + + export type PremierRankHistoryUpdateWithWhereUniqueWithoutMatchInput = { + where: PremierRankHistoryWhereUniqueInput + data: XOR + } + + export type PremierRankHistoryUpdateManyWithWhereWithoutMatchInput = { + where: PremierRankHistoryScalarWhereInput + data: XOR + } + + export type MatchCreateWithoutPlayersInput = { + matchId?: bigint | number + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + teamA?: TeamCreateNestedOneWithoutMatchesAsTeamAInput + teamB?: TeamCreateNestedOneWithoutMatchesAsTeamBInput + demoFile?: DemoFileCreateNestedOneWithoutMatchInput + rankUpdates?: PremierRankHistoryCreateNestedManyWithoutMatchInput + } + + export type MatchUncheckedCreateWithoutPlayersInput = { + matchId?: bigint | number + teamAId?: string | null + teamBId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + demoFile?: DemoFileUncheckedCreateNestedOneWithoutMatchInput + rankUpdates?: PremierRankHistoryUncheckedCreateNestedManyWithoutMatchInput + } + + export type MatchCreateOrConnectWithoutPlayersInput = { + where: MatchWhereUniqueInput + create: XOR + } + + export type UserCreateWithoutMatchPlayersInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + team?: TeamCreateNestedOneWithoutMembersInput + ledTeam?: TeamCreateNestedOneWithoutLeaderInput + invitations?: InvitationCreateNestedManyWithoutUserInput + notifications?: NotificationCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryCreateNestedManyWithoutUserInput + demoFiles?: DemoFileCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateWithoutMatchPlayersInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamUncheckedCreateNestedOneWithoutLeaderInput + invitations?: InvitationUncheckedCreateNestedManyWithoutUserInput + notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput + demoFiles?: DemoFileUncheckedCreateNestedManyWithoutUserInput + } + + export type UserCreateOrConnectWithoutMatchPlayersInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type TeamCreateWithoutMatchPlayersInput = { + id?: string + name: string + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + leader?: UserCreateNestedOneWithoutLedTeamInput + members?: UserCreateNestedManyWithoutTeamInput + invitations?: InvitationCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchCreateNestedManyWithoutTeamBInput + } + + export type TeamUncheckedCreateWithoutMatchPlayersInput = { + id?: string + name: string + leaderId?: string | null + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + members?: UserUncheckedCreateNestedManyWithoutTeamInput + invitations?: InvitationUncheckedCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchUncheckedCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchUncheckedCreateNestedManyWithoutTeamBInput + } + + export type TeamCreateOrConnectWithoutMatchPlayersInput = { + where: TeamWhereUniqueInput + create: XOR + } + + export type MatchPlayerStatsCreateWithoutMatchPlayerInput = { + id?: string + kills: number + assists: number + deaths: number + adr: number + headshotPct: number + flashAssists?: number + mvps?: number + mvpEliminations?: number + mvpDefuse?: number + mvpPlant?: number + knifeKills?: number + zeusKills?: number + wallbangKills?: number + smokeKills?: number + headshots?: number + noScopes?: number + blindKills?: number + rankOld?: number | null + rankNew?: number | null + winCount?: number | null + } + + export type MatchPlayerStatsUncheckedCreateWithoutMatchPlayerInput = { + id?: string + kills: number + assists: number + deaths: number + adr: number + headshotPct: number + flashAssists?: number + mvps?: number + mvpEliminations?: number + mvpDefuse?: number + mvpPlant?: number + knifeKills?: number + zeusKills?: number + wallbangKills?: number + smokeKills?: number + headshots?: number + noScopes?: number + blindKills?: number + rankOld?: number | null + rankNew?: number | null + winCount?: number | null + } + + export type MatchPlayerStatsCreateOrConnectWithoutMatchPlayerInput = { + where: MatchPlayerStatsWhereUniqueInput + create: XOR + } + + export type MatchUpsertWithoutPlayersInput = { + update: XOR + create: XOR + where?: MatchWhereInput + } + + export type MatchUpdateToOneWithWhereWithoutPlayersInput = { + where?: MatchWhereInput + data: XOR + } + + export type MatchUpdateWithoutPlayersInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + teamA?: TeamUpdateOneWithoutMatchesAsTeamANestedInput + teamB?: TeamUpdateOneWithoutMatchesAsTeamBNestedInput + demoFile?: DemoFileUpdateOneWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUpdateManyWithoutMatchNestedInput + } + + export type MatchUncheckedUpdateWithoutPlayersInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamAId?: NullableStringFieldUpdateOperationsInput | string | null + teamBId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + demoFile?: DemoFileUncheckedUpdateOneWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUncheckedUpdateManyWithoutMatchNestedInput + } + + export type UserUpsertWithoutMatchPlayersInput = { + update: XOR + create: XOR + where?: UserWhereInput + } + + export type UserUpdateToOneWithWhereWithoutMatchPlayersInput = { + where?: UserWhereInput + data: XOR + } + + export type UserUpdateWithoutMatchPlayersInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneWithoutMembersNestedInput + ledTeam?: TeamUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUpdateManyWithoutUserNestedInput + notifications?: NotificationUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateWithoutMatchPlayersInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUncheckedUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutUserNestedInput + notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUncheckedUpdateManyWithoutUserNestedInput + } + + export type TeamUpsertWithoutMatchPlayersInput = { + update: XOR + create: XOR + where?: TeamWhereInput + } + + export type TeamUpdateToOneWithWhereWithoutMatchPlayersInput = { + where?: TeamWhereInput + data: XOR + } + + export type TeamUpdateWithoutMatchPlayersInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + leader?: UserUpdateOneWithoutLedTeamNestedInput + members?: UserUpdateManyWithoutTeamNestedInput + invitations?: InvitationUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUpdateManyWithoutTeamBNestedInput + } + + export type TeamUncheckedUpdateWithoutMatchPlayersInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + leaderId?: NullableStringFieldUpdateOperationsInput | string | null + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + members?: UserUncheckedUpdateManyWithoutTeamNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUncheckedUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUncheckedUpdateManyWithoutTeamBNestedInput + } + + export type MatchPlayerStatsUpsertWithoutMatchPlayerInput = { + update: XOR + create: XOR + where?: MatchPlayerStatsWhereInput + } + + export type MatchPlayerStatsUpdateToOneWithWhereWithoutMatchPlayerInput = { + where?: MatchPlayerStatsWhereInput + data: XOR + } + + export type MatchPlayerStatsUpdateWithoutMatchPlayerInput = { + id?: StringFieldUpdateOperationsInput | string + kills?: IntFieldUpdateOperationsInput | number + assists?: IntFieldUpdateOperationsInput | number + deaths?: IntFieldUpdateOperationsInput | number + adr?: FloatFieldUpdateOperationsInput | number + headshotPct?: FloatFieldUpdateOperationsInput | number + flashAssists?: IntFieldUpdateOperationsInput | number + mvps?: IntFieldUpdateOperationsInput | number + mvpEliminations?: IntFieldUpdateOperationsInput | number + mvpDefuse?: IntFieldUpdateOperationsInput | number + mvpPlant?: IntFieldUpdateOperationsInput | number + knifeKills?: IntFieldUpdateOperationsInput | number + zeusKills?: IntFieldUpdateOperationsInput | number + wallbangKills?: IntFieldUpdateOperationsInput | number + smokeKills?: IntFieldUpdateOperationsInput | number + headshots?: IntFieldUpdateOperationsInput | number + noScopes?: IntFieldUpdateOperationsInput | number + blindKills?: IntFieldUpdateOperationsInput | number + rankOld?: NullableIntFieldUpdateOperationsInput | number | null + rankNew?: NullableIntFieldUpdateOperationsInput | number | null + winCount?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type MatchPlayerStatsUncheckedUpdateWithoutMatchPlayerInput = { + id?: StringFieldUpdateOperationsInput | string + kills?: IntFieldUpdateOperationsInput | number + assists?: IntFieldUpdateOperationsInput | number + deaths?: IntFieldUpdateOperationsInput | number + adr?: FloatFieldUpdateOperationsInput | number + headshotPct?: FloatFieldUpdateOperationsInput | number + flashAssists?: IntFieldUpdateOperationsInput | number + mvps?: IntFieldUpdateOperationsInput | number + mvpEliminations?: IntFieldUpdateOperationsInput | number + mvpDefuse?: IntFieldUpdateOperationsInput | number + mvpPlant?: IntFieldUpdateOperationsInput | number + knifeKills?: IntFieldUpdateOperationsInput | number + zeusKills?: IntFieldUpdateOperationsInput | number + wallbangKills?: IntFieldUpdateOperationsInput | number + smokeKills?: IntFieldUpdateOperationsInput | number + headshots?: IntFieldUpdateOperationsInput | number + noScopes?: IntFieldUpdateOperationsInput | number + blindKills?: IntFieldUpdateOperationsInput | number + rankOld?: NullableIntFieldUpdateOperationsInput | number | null + rankNew?: NullableIntFieldUpdateOperationsInput | number | null + winCount?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type MatchPlayerCreateWithoutStatsInput = { + id?: string + createdAt?: Date | string + match: MatchCreateNestedOneWithoutPlayersInput + user: UserCreateNestedOneWithoutMatchPlayersInput + team?: TeamCreateNestedOneWithoutMatchPlayersInput + } + + export type MatchPlayerUncheckedCreateWithoutStatsInput = { + id?: string + matchId: bigint | number + steamId: string + teamId?: string | null + createdAt?: Date | string + } + + export type MatchPlayerCreateOrConnectWithoutStatsInput = { + where: MatchPlayerWhereUniqueInput + create: XOR + } + + export type MatchPlayerUpsertWithoutStatsInput = { + update: XOR + create: XOR + where?: MatchPlayerWhereInput + } + + export type MatchPlayerUpdateToOneWithWhereWithoutStatsInput = { + where?: MatchPlayerWhereInput + data: XOR + } + + export type MatchPlayerUpdateWithoutStatsInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + match?: MatchUpdateOneRequiredWithoutPlayersNestedInput + user?: UserUpdateOneRequiredWithoutMatchPlayersNestedInput + team?: TeamUpdateOneWithoutMatchPlayersNestedInput + } + + export type MatchPlayerUncheckedUpdateWithoutStatsInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + steamId?: StringFieldUpdateOperationsInput | string + teamId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchCreateWithoutDemoFileInput = { + matchId?: bigint | number + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + teamA?: TeamCreateNestedOneWithoutMatchesAsTeamAInput + teamB?: TeamCreateNestedOneWithoutMatchesAsTeamBInput + players?: MatchPlayerCreateNestedManyWithoutMatchInput + rankUpdates?: PremierRankHistoryCreateNestedManyWithoutMatchInput + } + + export type MatchUncheckedCreateWithoutDemoFileInput = { + matchId?: bigint | number + teamAId?: string | null + teamBId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + players?: MatchPlayerUncheckedCreateNestedManyWithoutMatchInput + rankUpdates?: PremierRankHistoryUncheckedCreateNestedManyWithoutMatchInput + } + + export type MatchCreateOrConnectWithoutDemoFileInput = { + where: MatchWhereUniqueInput + create: XOR + } + + export type UserCreateWithoutDemoFilesInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + team?: TeamCreateNestedOneWithoutMembersInput + ledTeam?: TeamCreateNestedOneWithoutLeaderInput + invitations?: InvitationCreateNestedManyWithoutUserInput + notifications?: NotificationCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateWithoutDemoFilesInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamUncheckedCreateNestedOneWithoutLeaderInput + invitations?: InvitationUncheckedCreateNestedManyWithoutUserInput + notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput + } + + export type UserCreateOrConnectWithoutDemoFilesInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type MatchUpsertWithoutDemoFileInput = { + update: XOR + create: XOR + where?: MatchWhereInput + } + + export type MatchUpdateToOneWithWhereWithoutDemoFileInput = { + where?: MatchWhereInput + data: XOR + } + + export type MatchUpdateWithoutDemoFileInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + teamA?: TeamUpdateOneWithoutMatchesAsTeamANestedInput + teamB?: TeamUpdateOneWithoutMatchesAsTeamBNestedInput + players?: MatchPlayerUpdateManyWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUpdateManyWithoutMatchNestedInput + } + + export type MatchUncheckedUpdateWithoutDemoFileInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamAId?: NullableStringFieldUpdateOperationsInput | string | null + teamBId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + players?: MatchPlayerUncheckedUpdateManyWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUncheckedUpdateManyWithoutMatchNestedInput + } + + export type UserUpsertWithoutDemoFilesInput = { + update: XOR + create: XOR + where?: UserWhereInput + } + + export type UserUpdateToOneWithWhereWithoutDemoFilesInput = { + where?: UserWhereInput + data: XOR + } + + export type UserUpdateWithoutDemoFilesInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneWithoutMembersNestedInput + ledTeam?: TeamUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUpdateManyWithoutUserNestedInput + notifications?: NotificationUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateWithoutDemoFilesInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUncheckedUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutUserNestedInput + notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput + } + + export type UserCreateWithoutInvitationsInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + team?: TeamCreateNestedOneWithoutMembersInput + ledTeam?: TeamCreateNestedOneWithoutLeaderInput + notifications?: NotificationCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryCreateNestedManyWithoutUserInput + demoFiles?: DemoFileCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateWithoutInvitationsInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamUncheckedCreateNestedOneWithoutLeaderInput + notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput + demoFiles?: DemoFileUncheckedCreateNestedManyWithoutUserInput + } + + export type UserCreateOrConnectWithoutInvitationsInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type TeamCreateWithoutInvitationsInput = { + id?: string + name: string + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + leader?: UserCreateNestedOneWithoutLedTeamInput + members?: UserCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchCreateNestedManyWithoutTeamBInput + } + + export type TeamUncheckedCreateWithoutInvitationsInput = { + id?: string + name: string + leaderId?: string | null + logo?: string | null + createdAt?: Date | string + activePlayers?: TeamCreateactivePlayersInput | string[] + inactivePlayers?: TeamCreateinactivePlayersInput | string[] + members?: UserUncheckedCreateNestedManyWithoutTeamInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutTeamInput + matchesAsTeamA?: MatchUncheckedCreateNestedManyWithoutTeamAInput + matchesAsTeamB?: MatchUncheckedCreateNestedManyWithoutTeamBInput + } + + export type TeamCreateOrConnectWithoutInvitationsInput = { + where: TeamWhereUniqueInput + create: XOR + } + + export type UserUpsertWithoutInvitationsInput = { + update: XOR + create: XOR + where?: UserWhereInput + } + + export type UserUpdateToOneWithWhereWithoutInvitationsInput = { + where?: UserWhereInput + data: XOR + } + + export type UserUpdateWithoutInvitationsInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneWithoutMembersNestedInput + ledTeam?: TeamUpdateOneWithoutLeaderNestedInput + notifications?: NotificationUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateWithoutInvitationsInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUncheckedUpdateOneWithoutLeaderNestedInput + notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUncheckedUpdateManyWithoutUserNestedInput + } + + export type TeamUpsertWithoutInvitationsInput = { + update: XOR + create: XOR + where?: TeamWhereInput + } + + export type TeamUpdateToOneWithWhereWithoutInvitationsInput = { + where?: TeamWhereInput + data: XOR + } + + export type TeamUpdateWithoutInvitationsInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + leader?: UserUpdateOneWithoutLedTeamNestedInput + members?: UserUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUpdateManyWithoutTeamBNestedInput + } + + export type TeamUncheckedUpdateWithoutInvitationsInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + leaderId?: NullableStringFieldUpdateOperationsInput | string | null + logo?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + activePlayers?: TeamUpdateactivePlayersInput | string[] + inactivePlayers?: TeamUpdateinactivePlayersInput | string[] + members?: UserUncheckedUpdateManyWithoutTeamNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutTeamNestedInput + matchesAsTeamA?: MatchUncheckedUpdateManyWithoutTeamANestedInput + matchesAsTeamB?: MatchUncheckedUpdateManyWithoutTeamBNestedInput + } + + export type UserCreateWithoutNotificationsInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + team?: TeamCreateNestedOneWithoutMembersInput + ledTeam?: TeamCreateNestedOneWithoutLeaderInput + invitations?: InvitationCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryCreateNestedManyWithoutUserInput + demoFiles?: DemoFileCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateWithoutNotificationsInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamUncheckedCreateNestedOneWithoutLeaderInput + invitations?: InvitationUncheckedCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput + demoFiles?: DemoFileUncheckedCreateNestedManyWithoutUserInput + } + + export type UserCreateOrConnectWithoutNotificationsInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type UserUpsertWithoutNotificationsInput = { + update: XOR + create: XOR + where?: UserWhereInput + } + + export type UserUpdateToOneWithWhereWithoutNotificationsInput = { + where?: UserWhereInput + data: XOR + } + + export type UserUpdateWithoutNotificationsInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneWithoutMembersNestedInput + ledTeam?: TeamUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateWithoutNotificationsInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUncheckedUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUncheckedUpdateManyWithoutUserNestedInput + } + + export type UserCreateWithoutMatchRequestsInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + team?: TeamCreateNestedOneWithoutMembersInput + ledTeam?: TeamCreateNestedOneWithoutLeaderInput + invitations?: InvitationCreateNestedManyWithoutUserInput + notifications?: NotificationCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryCreateNestedManyWithoutUserInput + demoFiles?: DemoFileCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateWithoutMatchRequestsInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamUncheckedCreateNestedOneWithoutLeaderInput + invitations?: InvitationUncheckedCreateNestedManyWithoutUserInput + notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutUserInput + rankHistory?: PremierRankHistoryUncheckedCreateNestedManyWithoutUserInput + demoFiles?: DemoFileUncheckedCreateNestedManyWithoutUserInput + } + + export type UserCreateOrConnectWithoutMatchRequestsInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type UserUpsertWithoutMatchRequestsInput = { + update: XOR + create: XOR + where?: UserWhereInput + } + + export type UserUpdateToOneWithWhereWithoutMatchRequestsInput = { + where?: UserWhereInput + data: XOR + } + + export type UserUpdateWithoutMatchRequestsInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneWithoutMembersNestedInput + ledTeam?: TeamUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUpdateManyWithoutUserNestedInput + notifications?: NotificationUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateWithoutMatchRequestsInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUncheckedUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutUserNestedInput + notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUncheckedUpdateManyWithoutUserNestedInput + } + + export type UserCreateWithoutRankHistoryInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + team?: TeamCreateNestedOneWithoutMembersInput + ledTeam?: TeamCreateNestedOneWithoutLeaderInput + invitations?: InvitationCreateNestedManyWithoutUserInput + notifications?: NotificationCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestCreateNestedManyWithoutUserInput + demoFiles?: DemoFileCreateNestedManyWithoutUserInput + } + + export type UserUncheckedCreateWithoutRankHistoryInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + teamId?: string | null + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + ledTeam?: TeamUncheckedCreateNestedOneWithoutLeaderInput + invitations?: InvitationUncheckedCreateNestedManyWithoutUserInput + notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput + matchPlayers?: MatchPlayerUncheckedCreateNestedManyWithoutUserInput + matchRequests?: CS2MatchRequestUncheckedCreateNestedManyWithoutUserInput + demoFiles?: DemoFileUncheckedCreateNestedManyWithoutUserInput + } + + export type UserCreateOrConnectWithoutRankHistoryInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type MatchCreateWithoutRankUpdatesInput = { + matchId?: bigint | number + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + teamA?: TeamCreateNestedOneWithoutMatchesAsTeamAInput + teamB?: TeamCreateNestedOneWithoutMatchesAsTeamBInput + demoFile?: DemoFileCreateNestedOneWithoutMatchInput + players?: MatchPlayerCreateNestedManyWithoutMatchInput + } + + export type MatchUncheckedCreateWithoutRankUpdatesInput = { + matchId?: bigint | number + teamAId?: string | null + teamBId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + demoFile?: DemoFileUncheckedCreateNestedOneWithoutMatchInput + players?: MatchPlayerUncheckedCreateNestedManyWithoutMatchInput + } + + export type MatchCreateOrConnectWithoutRankUpdatesInput = { + where: MatchWhereUniqueInput + create: XOR + } + + export type UserUpsertWithoutRankHistoryInput = { + update: XOR + create: XOR + where?: UserWhereInput + } + + export type UserUpdateToOneWithWhereWithoutRankHistoryInput = { + where?: UserWhereInput + data: XOR + } + + export type UserUpdateWithoutRankHistoryInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneWithoutMembersNestedInput + ledTeam?: TeamUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUpdateManyWithoutUserNestedInput + notifications?: NotificationUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateWithoutRankHistoryInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + teamId?: NullableStringFieldUpdateOperationsInput | string | null + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUncheckedUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutUserNestedInput + notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUncheckedUpdateManyWithoutUserNestedInput + } + + export type MatchUpsertWithoutRankUpdatesInput = { + update: XOR + create: XOR + where?: MatchWhereInput + } + + export type MatchUpdateToOneWithWhereWithoutRankUpdatesInput = { + where?: MatchWhereInput + data: XOR + } + + export type MatchUpdateWithoutRankUpdatesInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + teamA?: TeamUpdateOneWithoutMatchesAsTeamANestedInput + teamB?: TeamUpdateOneWithoutMatchesAsTeamBNestedInput + demoFile?: DemoFileUpdateOneWithoutMatchNestedInput + players?: MatchPlayerUpdateManyWithoutMatchNestedInput + } + + export type MatchUncheckedUpdateWithoutRankUpdatesInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamAId?: NullableStringFieldUpdateOperationsInput | string | null + teamBId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + demoFile?: DemoFileUncheckedUpdateOneWithoutMatchNestedInput + players?: MatchPlayerUncheckedUpdateManyWithoutMatchNestedInput + } + + export type InvitationCreateManyUserInput = { + id?: string + teamId: string + type: string + createdAt?: Date | string + } + + export type NotificationCreateManyUserInput = { + id?: string + title?: string | null + message: string + read?: boolean + persistent?: boolean + actionType?: string | null + actionData?: string | null + createdAt?: Date | string + } + + export type MatchPlayerCreateManyUserInput = { + id?: string + matchId: bigint | number + teamId?: string | null + createdAt?: Date | string + } + + export type CS2MatchRequestCreateManyUserInput = { + id?: string + steamId: string + matchId: bigint | number + reservationId: bigint | number + tvPort: bigint | number + processed?: boolean + createdAt?: Date | string + } + + export type PremierRankHistoryCreateManyUserInput = { + id?: string + steamId: string + matchId?: bigint | number | null + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + } + + export type DemoFileCreateManyUserInput = { + id?: string + matchId: bigint | number + fileName: string + filePath: string + parsed?: boolean + createdAt?: Date | string + } + + export type InvitationUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + team?: TeamUpdateOneRequiredWithoutInvitationsNestedInput + } + + export type InvitationUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + teamId?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type InvitationUncheckedUpdateManyWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + teamId?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + title?: NullableStringFieldUpdateOperationsInput | string | null + message?: StringFieldUpdateOperationsInput | string + read?: BoolFieldUpdateOperationsInput | boolean + persistent?: BoolFieldUpdateOperationsInput | boolean + actionType?: NullableStringFieldUpdateOperationsInput | string | null + actionData?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + title?: NullableStringFieldUpdateOperationsInput | string | null + message?: StringFieldUpdateOperationsInput | string + read?: BoolFieldUpdateOperationsInput | boolean + persistent?: BoolFieldUpdateOperationsInput | boolean + actionType?: NullableStringFieldUpdateOperationsInput | string | null + actionData?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationUncheckedUpdateManyWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + title?: NullableStringFieldUpdateOperationsInput | string | null + message?: StringFieldUpdateOperationsInput | string + read?: BoolFieldUpdateOperationsInput | boolean + persistent?: BoolFieldUpdateOperationsInput | boolean + actionType?: NullableStringFieldUpdateOperationsInput | string | null + actionData?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchPlayerUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + match?: MatchUpdateOneRequiredWithoutPlayersNestedInput + team?: TeamUpdateOneWithoutMatchPlayersNestedInput + stats?: MatchPlayerStatsUpdateOneWithoutMatchPlayerNestedInput + } + + export type MatchPlayerUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + stats?: MatchPlayerStatsUncheckedUpdateOneWithoutMatchPlayerNestedInput + } + + export type MatchPlayerUncheckedUpdateManyWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CS2MatchRequestUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + reservationId?: BigIntFieldUpdateOperationsInput | bigint | number + tvPort?: BigIntFieldUpdateOperationsInput | bigint | number + processed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CS2MatchRequestUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + reservationId?: BigIntFieldUpdateOperationsInput | bigint | number + tvPort?: BigIntFieldUpdateOperationsInput | bigint | number + processed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CS2MatchRequestUncheckedUpdateManyWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + reservationId?: BigIntFieldUpdateOperationsInput | bigint | number + tvPort?: BigIntFieldUpdateOperationsInput | bigint | number + processed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PremierRankHistoryUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + match?: MatchUpdateOneWithoutRankUpdatesNestedInput + } + + export type PremierRankHistoryUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PremierRankHistoryUncheckedUpdateManyWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + matchId?: NullableBigIntFieldUpdateOperationsInput | bigint | number | null + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DemoFileUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + match?: MatchUpdateOneRequiredWithoutDemoFileNestedInput + } + + export type DemoFileUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DemoFileUncheckedUpdateManyWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + fileName?: StringFieldUpdateOperationsInput | string + filePath?: StringFieldUpdateOperationsInput | string + parsed?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UserCreateManyTeamInput = { + steamId: string + name?: string | null + avatar?: string | null + location?: string | null + isAdmin?: boolean + premierRank?: number | null + authCode?: string | null + lastKnownShareCode?: string | null + lastKnownShareCodeDate?: Date | string | null + createdAt?: Date | string + } + + export type InvitationCreateManyTeamInput = { + id?: string + userId: string + type: string + createdAt?: Date | string + } + + export type MatchPlayerCreateManyTeamInput = { + id?: string + matchId: bigint | number + steamId: string + createdAt?: Date | string + } + + export type MatchCreateManyTeamAInput = { + matchId?: bigint | number + teamBId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type MatchCreateManyTeamBInput = { + matchId?: bigint | number + teamAId?: string | null + matchDate: Date | string + matchType?: string + map?: string | null + title: string + description?: string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: string | null + scoreA?: number | null + scoreB?: number | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type UserUpdateWithoutTeamInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUpdateManyWithoutUserNestedInput + notifications?: NotificationUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateWithoutTeamInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + ledTeam?: TeamUncheckedUpdateOneWithoutLeaderNestedInput + invitations?: InvitationUncheckedUpdateManyWithoutUserNestedInput + notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput + matchPlayers?: MatchPlayerUncheckedUpdateManyWithoutUserNestedInput + matchRequests?: CS2MatchRequestUncheckedUpdateManyWithoutUserNestedInput + rankHistory?: PremierRankHistoryUncheckedUpdateManyWithoutUserNestedInput + demoFiles?: DemoFileUncheckedUpdateManyWithoutUserNestedInput + } + + export type UserUncheckedUpdateManyWithoutTeamInput = { + steamId?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + avatar?: NullableStringFieldUpdateOperationsInput | string | null + location?: NullableStringFieldUpdateOperationsInput | string | null + isAdmin?: BoolFieldUpdateOperationsInput | boolean + premierRank?: NullableIntFieldUpdateOperationsInput | number | null + authCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCode?: NullableStringFieldUpdateOperationsInput | string | null + lastKnownShareCodeDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type InvitationUpdateWithoutTeamInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutInvitationsNestedInput + } + + export type InvitationUncheckedUpdateWithoutTeamInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type InvitationUncheckedUpdateManyWithoutTeamInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchPlayerUpdateWithoutTeamInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + match?: MatchUpdateOneRequiredWithoutPlayersNestedInput + user?: UserUpdateOneRequiredWithoutMatchPlayersNestedInput + stats?: MatchPlayerStatsUpdateOneWithoutMatchPlayerNestedInput + } + + export type MatchPlayerUncheckedUpdateWithoutTeamInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + steamId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + stats?: MatchPlayerStatsUncheckedUpdateOneWithoutMatchPlayerNestedInput + } + + export type MatchPlayerUncheckedUpdateManyWithoutTeamInput = { + id?: StringFieldUpdateOperationsInput | string + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + steamId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchUpdateWithoutTeamAInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + teamB?: TeamUpdateOneWithoutMatchesAsTeamBNestedInput + demoFile?: DemoFileUpdateOneWithoutMatchNestedInput + players?: MatchPlayerUpdateManyWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUpdateManyWithoutMatchNestedInput + } + + export type MatchUncheckedUpdateWithoutTeamAInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamBId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + demoFile?: DemoFileUncheckedUpdateOneWithoutMatchNestedInput + players?: MatchPlayerUncheckedUpdateManyWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUncheckedUpdateManyWithoutMatchNestedInput + } + + export type MatchUncheckedUpdateManyWithoutTeamAInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamBId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchUpdateWithoutTeamBInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + teamA?: TeamUpdateOneWithoutMatchesAsTeamANestedInput + demoFile?: DemoFileUpdateOneWithoutMatchNestedInput + players?: MatchPlayerUpdateManyWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUpdateManyWithoutMatchNestedInput + } + + export type MatchUncheckedUpdateWithoutTeamBInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamAId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + demoFile?: DemoFileUncheckedUpdateOneWithoutMatchNestedInput + players?: MatchPlayerUncheckedUpdateManyWithoutMatchNestedInput + rankUpdates?: PremierRankHistoryUncheckedUpdateManyWithoutMatchNestedInput + } + + export type MatchUncheckedUpdateManyWithoutTeamBInput = { + matchId?: BigIntFieldUpdateOperationsInput | bigint | number + teamAId?: NullableStringFieldUpdateOperationsInput | string | null + matchDate?: DateTimeFieldUpdateOperationsInput | Date | string + matchType?: StringFieldUpdateOperationsInput | string + map?: NullableStringFieldUpdateOperationsInput | string | null + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + demoData?: NullableJsonNullValueInput | InputJsonValue + demoFilePath?: NullableStringFieldUpdateOperationsInput | string | null + scoreA?: NullableIntFieldUpdateOperationsInput | number | null + scoreB?: NullableIntFieldUpdateOperationsInput | number | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type MatchPlayerCreateManyMatchInput = { + id?: string + steamId: string + teamId?: string | null + createdAt?: Date | string + } + + export type PremierRankHistoryCreateManyMatchInput = { + id?: string + userId: string + steamId: string + rankOld: number + rankNew: number + delta: number + winCount: number + createdAt?: Date | string + } + + export type MatchPlayerUpdateWithoutMatchInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutMatchPlayersNestedInput + team?: TeamUpdateOneWithoutMatchPlayersNestedInput + stats?: MatchPlayerStatsUpdateOneWithoutMatchPlayerNestedInput + } + + export type MatchPlayerUncheckedUpdateWithoutMatchInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + teamId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + stats?: MatchPlayerStatsUncheckedUpdateOneWithoutMatchPlayerNestedInput + } + + export type MatchPlayerUncheckedUpdateManyWithoutMatchInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + teamId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PremierRankHistoryUpdateWithoutMatchInput = { + id?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutRankHistoryNestedInput + } + + export type PremierRankHistoryUncheckedUpdateWithoutMatchInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PremierRankHistoryUncheckedUpdateManyWithoutMatchInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + steamId?: StringFieldUpdateOperationsInput | string + rankOld?: IntFieldUpdateOperationsInput | number + rankNew?: IntFieldUpdateOperationsInput | number + delta?: IntFieldUpdateOperationsInput | number + winCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + + + /** + * 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/src/generated/prisma/index.js b/src/generated/prisma/index.js new file mode 100644 index 0000000..a3e95c8 --- /dev/null +++ b/src/generated/prisma/index.js @@ -0,0 +1,354 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ + +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + PrismaClientKnownRequestError, + PrismaClientUnknownRequestError, + PrismaClientRustPanicError, + PrismaClientInitializationError, + PrismaClientValidationError, + getPrismaClient, + sqltag, + empty, + join, + raw, + skip, + Decimal, + Debug, + objectEnumValues, + makeStrictEnum, + Extensions, + warnOnce, + defineDmmfProperty, + Public, + getRuntime, + createParam, +} = require('./runtime/library.js') + + +const Prisma = {} + +exports.Prisma = Prisma +exports.$Enums = {} + +/** + * Prisma Client JS version: 6.7.0 + * Query Engine version: 3cff47a7f5d65c3ea74883f1d736e41d68ce91ed + */ +Prisma.prismaVersion = { + client: "6.7.0", + engine: "3cff47a7f5d65c3ea74883f1d736e41d68ce91ed" +} + +Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; +Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError +Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError +Prisma.PrismaClientInitializationError = PrismaClientInitializationError +Prisma.PrismaClientValidationError = PrismaClientValidationError +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.UserScalarFieldEnum = { + steamId: 'steamId', + name: 'name', + avatar: 'avatar', + location: 'location', + isAdmin: 'isAdmin', + teamId: 'teamId', + premierRank: 'premierRank', + authCode: 'authCode', + lastKnownShareCode: 'lastKnownShareCode', + lastKnownShareCodeDate: 'lastKnownShareCodeDate', + createdAt: 'createdAt' +}; + +exports.Prisma.TeamScalarFieldEnum = { + id: 'id', + name: 'name', + leaderId: 'leaderId', + logo: 'logo', + createdAt: 'createdAt', + activePlayers: 'activePlayers', + inactivePlayers: 'inactivePlayers' +}; + +exports.Prisma.MatchScalarFieldEnum = { + matchId: 'matchId', + teamAId: 'teamAId', + teamBId: 'teamBId', + matchDate: 'matchDate', + matchType: 'matchType', + map: 'map', + title: 'title', + description: 'description', + demoData: 'demoData', + demoFilePath: 'demoFilePath', + scoreA: 'scoreA', + scoreB: 'scoreB', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.MatchPlayerScalarFieldEnum = { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + teamId: 'teamId', + createdAt: 'createdAt' +}; + +exports.Prisma.MatchPlayerStatsScalarFieldEnum = { + id: 'id', + matchPlayerId: 'matchPlayerId', + kills: 'kills', + assists: 'assists', + deaths: 'deaths', + adr: 'adr', + headshotPct: 'headshotPct', + flashAssists: 'flashAssists', + mvps: 'mvps', + mvpEliminations: 'mvpEliminations', + mvpDefuse: 'mvpDefuse', + mvpPlant: 'mvpPlant', + knifeKills: 'knifeKills', + zeusKills: 'zeusKills', + wallbangKills: 'wallbangKills', + smokeKills: 'smokeKills', + headshots: 'headshots', + noScopes: 'noScopes', + blindKills: 'blindKills', + rankOld: 'rankOld', + rankNew: 'rankNew', + winCount: 'winCount' +}; + +exports.Prisma.DemoFileScalarFieldEnum = { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + fileName: 'fileName', + filePath: 'filePath', + parsed: 'parsed', + createdAt: 'createdAt' +}; + +exports.Prisma.InvitationScalarFieldEnum = { + id: 'id', + userId: 'userId', + teamId: 'teamId', + type: 'type', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationScalarFieldEnum = { + id: 'id', + userId: 'userId', + title: 'title', + message: 'message', + read: 'read', + persistent: 'persistent', + actionType: 'actionType', + actionData: 'actionData', + createdAt: 'createdAt' +}; + +exports.Prisma.CS2MatchRequestScalarFieldEnum = { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + reservationId: 'reservationId', + tvPort: 'tvPort', + processed: 'processed', + createdAt: 'createdAt' +}; + +exports.Prisma.PremierRankHistoryScalarFieldEnum = { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + rankOld: 'rankOld', + rankNew: 'rankNew', + delta: 'delta', + winCount: 'winCount', + createdAt: 'createdAt' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + +exports.Prisma.NullsOrder = { + first: 'first', + last: 'last' +}; + +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + + +exports.Prisma.ModelName = { + User: 'User', + Team: 'Team', + Match: 'Match', + MatchPlayer: 'MatchPlayer', + MatchPlayerStats: 'MatchPlayerStats', + DemoFile: 'DemoFile', + Invitation: 'Invitation', + Notification: 'Notification', + CS2MatchRequest: 'CS2MatchRequest', + PremierRankHistory: 'PremierRankHistory' +}; +/** + * Create the Client + */ +const config = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client-js" + }, + "output": { + "value": "C:\\Users\\Rother\\Desktop\\dev\\ironie\\nextjs\\src\\generated\\prisma", + "fromEnvVar": null + }, + "config": { + "engineType": "library" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "windows", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "C:\\Users\\Rother\\Desktop\\dev\\ironie\\nextjs\\prisma\\schema.prisma", + "isCustomOutput": true + }, + "relativeEnvPaths": { + "rootEnvPath": null, + "schemaEnvPath": "../../../.env" + }, + "relativePath": "../../../prisma", + "clientVersion": "6.7.0", + "engineVersion": "3cff47a7f5d65c3ea74883f1d736e41d68ce91ed", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "postinstall": false, + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../src/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n steamId String @id\n name String?\n avatar String?\n location String?\n isAdmin Boolean @default(false)\n teamId String? @unique\n premierRank Int?\n authCode String?\n lastKnownShareCode String?\n lastKnownShareCodeDate DateTime?\n createdAt DateTime @default(now())\n\n team Team? @relation(\"UserTeam\", fields: [teamId], references: [id])\n ledTeam Team? @relation(\"TeamLeader\")\n invitations Invitation[] @relation(\"UserInvitations\")\n notifications Notification[]\n matchPlayers MatchPlayer[]\n matchRequests CS2MatchRequest[] @relation(\"MatchRequests\")\n rankHistory PremierRankHistory[] @relation(\"UserRankHistory\")\n demoFiles DemoFile[]\n}\n\nmodel Team {\n id String @id @default(cuid())\n name String @unique\n leaderId String? @unique\n logo String?\n createdAt DateTime @default(now())\n activePlayers String[]\n inactivePlayers String[]\n leader User? @relation(\"TeamLeader\", fields: [leaderId], references: [steamId])\n members User[] @relation(\"UserTeam\")\n invitations Invitation[]\n matchPlayers MatchPlayer[]\n matchesAsTeamA Match[] @relation(\"TeamA\")\n matchesAsTeamB Match[] @relation(\"TeamB\")\n}\n\nmodel Match {\n matchId BigInt @id @default(autoincrement())\n teamAId String?\n teamBId String?\n matchDate DateTime\n matchType String @default(\"community\")\n map String?\n title String\n description String?\n demoData Json?\n demoFilePath String?\n scoreA Int?\n scoreB Int?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n teamA Team? @relation(\"TeamA\", fields: [teamAId], references: [id])\n teamB Team? @relation(\"TeamB\", fields: [teamBId], references: [id])\n demoFile DemoFile?\n players MatchPlayer[]\n rankUpdates PremierRankHistory[] @relation(\"MatchRankHistory\")\n}\n\nmodel MatchPlayer {\n id String @id @default(cuid())\n matchId BigInt\n steamId String\n teamId String?\n\n match Match @relation(fields: [matchId], references: [matchId])\n user User @relation(fields: [steamId], references: [steamId])\n team Team? @relation(fields: [teamId], references: [id])\n stats MatchPlayerStats?\n\n createdAt DateTime @default(now())\n\n @@unique([matchId, steamId])\n}\n\nmodel MatchPlayerStats {\n id String @id @default(cuid())\n matchPlayerId String @unique\n kills Int\n assists Int\n deaths Int\n adr Float\n headshotPct Float\n\n flashAssists Int @default(0)\n mvps Int @default(0)\n mvpEliminations Int @default(0)\n mvpDefuse Int @default(0)\n mvpPlant Int @default(0)\n knifeKills Int @default(0)\n zeusKills Int @default(0)\n wallbangKills Int @default(0)\n smokeKills Int @default(0)\n headshots Int @default(0)\n noScopes Int @default(0)\n blindKills Int @default(0)\n\n rankOld Int?\n rankNew Int?\n winCount Int?\n\n matchPlayer MatchPlayer @relation(fields: [matchPlayerId], references: [id])\n}\n\nmodel DemoFile {\n id String @id @default(cuid())\n matchId BigInt @unique\n steamId String\n fileName String @unique\n filePath String\n parsed Boolean @default(false)\n createdAt DateTime @default(now())\n\n match Match @relation(fields: [matchId], references: [matchId])\n user User @relation(fields: [steamId], references: [steamId])\n}\n\nmodel Invitation {\n id String @id @default(cuid())\n userId String\n teamId String\n type String\n createdAt DateTime @default(now())\n\n user User @relation(\"UserInvitations\", fields: [userId], references: [steamId])\n team Team @relation(fields: [teamId], references: [id])\n}\n\nmodel Notification {\n id String @id @default(uuid())\n userId String\n title String?\n message String\n read Boolean @default(false)\n persistent Boolean @default(false)\n actionType String?\n actionData String?\n createdAt DateTime @default(now())\n\n user User @relation(fields: [userId], references: [steamId])\n}\n\nmodel CS2MatchRequest {\n id String @id @default(cuid())\n userId String\n steamId String\n matchId BigInt\n reservationId BigInt\n tvPort BigInt\n processed Boolean @default(false)\n createdAt DateTime @default(now())\n\n user User @relation(\"MatchRequests\", fields: [userId], references: [steamId])\n\n @@unique([steamId, matchId])\n}\n\nmodel PremierRankHistory {\n id String @id @default(cuid())\n userId String\n steamId String\n matchId BigInt?\n\n rankOld Int\n rankNew Int\n delta Int\n winCount Int\n createdAt DateTime @default(now())\n\n user User @relation(\"UserRankHistory\", fields: [userId], references: [steamId])\n match Match? @relation(\"MatchRankHistory\", fields: [matchId], references: [matchId])\n}\n", + "inlineSchemaHash": "cd65d1c6f68a7d7dbc443bd972581fd76a81af776bb6358e75f337a7d4b7fbe6", + "copyEngine": true +} + +const fs = require('fs') + +config.dirname = __dirname +if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { + const alternativePaths = [ + "src/generated/prisma", + "generated/prisma", + ] + + 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\":{\"User\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"avatar\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"location\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isAdmin\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"premierRank\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"authCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastKnownShareCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastKnownShareCodeDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"team\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"UserTeam\",\"relationFromFields\":[\"teamId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledTeam\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"TeamLeader\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"invitations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Invitation\",\"nativeType\":null,\"relationName\":\"UserInvitations\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"nativeType\":null,\"relationName\":\"NotificationToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchPlayers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayer\",\"nativeType\":null,\"relationName\":\"MatchPlayerToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchRequests\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CS2MatchRequest\",\"nativeType\":null,\"relationName\":\"MatchRequests\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankHistory\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PremierRankHistory\",\"nativeType\":null,\"relationName\":\"UserRankHistory\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"demoFiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DemoFile\",\"nativeType\":null,\"relationName\":\"DemoFileToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Team\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"leaderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"logo\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"activePlayers\",\"kind\":\"scalar\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"inactivePlayers\",\"kind\":\"scalar\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"leader\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"TeamLeader\",\"relationFromFields\":[\"leaderId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"members\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"UserTeam\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"invitations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Invitation\",\"nativeType\":null,\"relationName\":\"InvitationToTeam\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchPlayers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayer\",\"nativeType\":null,\"relationName\":\"MatchPlayerToTeam\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchesAsTeamA\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"TeamA\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchesAsTeamB\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"TeamB\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Match\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"BigInt\",\"nativeType\":null,\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamAId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamBId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":\"community\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"map\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"demoData\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"demoFilePath\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scoreA\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scoreB\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"teamA\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"TeamA\",\"relationFromFields\":[\"teamAId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamB\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"TeamB\",\"relationFromFields\":[\"teamBId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"demoFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DemoFile\",\"nativeType\":null,\"relationName\":\"DemoFileToMatch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"players\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayer\",\"nativeType\":null,\"relationName\":\"MatchToMatchPlayer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankUpdates\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PremierRankHistory\",\"nativeType\":null,\"relationName\":\"MatchRankHistory\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"MatchPlayer\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"match\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"MatchToMatchPlayer\",\"relationFromFields\":[\"matchId\"],\"relationToFields\":[\"matchId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"MatchPlayerToUser\",\"relationFromFields\":[\"steamId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"team\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"MatchPlayerToTeam\",\"relationFromFields\":[\"teamId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stats\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayerStats\",\"nativeType\":null,\"relationName\":\"MatchPlayerToMatchPlayerStats\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"matchId\",\"steamId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"matchId\",\"steamId\"]}],\"isGenerated\":false},\"MatchPlayerStats\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchPlayerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"assists\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deaths\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adr\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Float\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"headshotPct\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Float\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"flashAssists\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mvps\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mvpEliminations\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mvpDefuse\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mvpPlant\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"knifeKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zeusKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wallbangKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"smokeKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"headshots\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"noScopes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"blindKills\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"nativeType\":null,\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankOld\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankNew\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"winCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchPlayer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MatchPlayer\",\"nativeType\":null,\"relationName\":\"MatchPlayerToMatchPlayerStats\",\"relationFromFields\":[\"matchPlayerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"DemoFile\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fileName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"filePath\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parsed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"match\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"DemoFileToMatch\",\"relationFromFields\":[\"matchId\"],\"relationToFields\":[\"matchId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"DemoFileToUser\",\"relationFromFields\":[\"steamId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Invitation\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"teamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"UserInvitations\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"team\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Team\",\"nativeType\":null,\"relationName\":\"InvitationToTeam\",\"relationFromFields\":[\"teamId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Notification\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"uuid\",\"args\":[4]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"message\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"read\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"persistent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actionType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actionData\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"NotificationToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CS2MatchRequest\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"reservationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"tvPort\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"processed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"MatchRequests\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"steamId\",\"matchId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"steamId\",\"matchId\"]}],\"isGenerated\":false},\"PremierRankHistory\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"steamId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"matchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"BigInt\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankOld\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rankNew\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"delta\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"winCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"nativeType\":null,\"relationName\":\"UserRankHistory\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"steamId\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"match\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Match\",\"nativeType\":null,\"relationName\":\"MatchRankHistory\",\"relationFromFields\":[\"matchId\"],\"relationToFields\":[\"matchId\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") +defineDmmfProperty(exports.Prisma, config.runtimeDataModel) +config.engineWasm = undefined +config.compilerWasm = undefined + + +const { warnEnvConflicts } = require('./runtime/library.js') + +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, "query_engine-windows.dll.node"); +path.join(process.cwd(), "src/generated/prisma/query_engine-windows.dll.node") +// file annotations for bundling tools to include these files +path.join(__dirname, "schema.prisma"); +path.join(process.cwd(), "src/generated/prisma/schema.prisma") diff --git a/src/generated/prisma/package.json b/src/generated/prisma/package.json new file mode 100644 index 0000000..adb9444 --- /dev/null +++ b/src/generated/prisma/package.json @@ -0,0 +1,140 @@ +{ + "name": "prisma-client-e738cc370bf095ce801f97ff86cc5e77ac9a34cd0d0b04f968607628b9755dee", + "main": "index.js", + "types": "index.d.ts", + "browser": "index-browser.js", + "exports": { + "./client": { + "require": { + "node": "./index.js", + "edge-light": "./wasm.js", + "workerd": "./wasm.js", + "worker": "./wasm.js", + "browser": "./index-browser.js", + "default": "./index.js" + }, + "import": { + "node": "./index.js", + "edge-light": "./wasm.js", + "workerd": "./wasm.js", + "worker": "./wasm.js", + "browser": "./index-browser.js", + "default": "./index.js" + }, + "default": "./index.js" + }, + "./package.json": "./package.json", + ".": { + "require": { + "node": "./index.js", + "edge-light": "./wasm.js", + "workerd": "./wasm.js", + "worker": "./wasm.js", + "browser": "./index-browser.js", + "default": "./index.js" + }, + "import": { + "node": "./index.js", + "edge-light": "./wasm.js", + "workerd": "./wasm.js", + "worker": "./wasm.js", + "browser": "./index-browser.js", + "default": "./index.js" + }, + "default": "./index.js" + }, + "./edge": { + "types": "./edge.d.ts", + "require": "./edge.js", + "import": "./edge.js", + "default": "./edge.js" + }, + "./react-native": { + "types": "./react-native.d.ts", + "require": "./react-native.js", + "import": "./react-native.js", + "default": "./react-native.js" + }, + "./extension": { + "types": "./extension.d.ts", + "require": "./extension.js", + "import": "./extension.js", + "default": "./extension.js" + }, + "./index-browser": { + "types": "./index.d.ts", + "require": "./index-browser.js", + "import": "./index-browser.js", + "default": "./index-browser.js" + }, + "./index": { + "types": "./index.d.ts", + "require": "./index.js", + "import": "./index.js", + "default": "./index.js" + }, + "./wasm": { + "types": "./wasm.d.ts", + "require": "./wasm.js", + "import": "./wasm.mjs", + "default": "./wasm.mjs" + }, + "./runtime/client": { + "types": "./runtime/client.d.ts", + "require": "./runtime/client.js", + "import": "./runtime/client.mjs", + "default": "./runtime/client.mjs" + }, + "./runtime/library": { + "types": "./runtime/library.d.ts", + "require": "./runtime/library.js", + "import": "./runtime/library.mjs", + "default": "./runtime/library.mjs" + }, + "./runtime/binary": { + "types": "./runtime/binary.d.ts", + "require": "./runtime/binary.js", + "import": "./runtime/binary.mjs", + "default": "./runtime/binary.mjs" + }, + "./runtime/wasm": { + "types": "./runtime/wasm.d.ts", + "require": "./runtime/wasm.js", + "import": "./runtime/wasm.mjs", + "default": "./runtime/wasm.mjs" + }, + "./runtime/edge": { + "types": "./runtime/edge.d.ts", + "require": "./runtime/edge.js", + "import": "./runtime/edge-esm.js", + "default": "./runtime/edge-esm.js" + }, + "./runtime/react-native": { + "types": "./runtime/react-native.d.ts", + "require": "./runtime/react-native.js", + "import": "./runtime/react-native.js", + "default": "./runtime/react-native.js" + }, + "./generator-build": { + "require": "./generator-build/index.js", + "import": "./generator-build/index.js", + "default": "./generator-build/index.js" + }, + "./sql": { + "require": { + "types": "./sql.d.ts", + "node": "./sql.js", + "default": "./sql.js" + }, + "import": { + "types": "./sql.d.ts", + "node": "./sql.mjs", + "default": "./sql.mjs" + }, + "default": "./sql.js" + }, + "./*": "./*" + }, + "version": "6.7.0", + "sideEffects": false +} \ No newline at end of file diff --git a/src/generated/prisma/query_engine-windows.dll.node b/src/generated/prisma/query_engine-windows.dll.node new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node differ diff --git a/src/generated/prisma/query_engine-windows.dll.node.tmp19380 b/src/generated/prisma/query_engine-windows.dll.node.tmp19380 new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node.tmp19380 differ diff --git a/src/generated/prisma/query_engine-windows.dll.node.tmp21388 b/src/generated/prisma/query_engine-windows.dll.node.tmp21388 new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node.tmp21388 differ diff --git a/src/generated/prisma/query_engine-windows.dll.node.tmp23344 b/src/generated/prisma/query_engine-windows.dll.node.tmp23344 new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node.tmp23344 differ diff --git a/src/generated/prisma/query_engine-windows.dll.node.tmp31176 b/src/generated/prisma/query_engine-windows.dll.node.tmp31176 new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node.tmp31176 differ diff --git a/src/generated/prisma/query_engine-windows.dll.node.tmp31184 b/src/generated/prisma/query_engine-windows.dll.node.tmp31184 new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node.tmp31184 differ diff --git a/src/generated/prisma/query_engine-windows.dll.node.tmp32132 b/src/generated/prisma/query_engine-windows.dll.node.tmp32132 new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node.tmp32132 differ diff --git a/src/generated/prisma/query_engine-windows.dll.node.tmp3536 b/src/generated/prisma/query_engine-windows.dll.node.tmp3536 new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node.tmp3536 differ diff --git a/src/generated/prisma/query_engine-windows.dll.node.tmp6368 b/src/generated/prisma/query_engine-windows.dll.node.tmp6368 new file mode 100644 index 0000000..f5716ca Binary files /dev/null and b/src/generated/prisma/query_engine-windows.dll.node.tmp6368 differ diff --git a/src/generated/prisma/runtime/edge-esm.js b/src/generated/prisma/runtime/edge-esm.js new file mode 100644 index 0000000..d9df6c4 --- /dev/null +++ b/src/generated/prisma/runtime/edge-esm.js @@ -0,0 +1,34 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ +var sa=Object.create;var en=Object.defineProperty;var aa=Object.getOwnPropertyDescriptor;var la=Object.getOwnPropertyNames;var ua=Object.getPrototypeOf,ca=Object.prototype.hasOwnProperty;var me=(e,t)=>()=>(e&&(t=e(e=0)),t);var Fe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ir=(e,t)=>{for(var r in t)en(e,r,{get:t[r],enumerable:!0})},pa=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of la(t))!ca.call(e,i)&&i!==r&&en(e,i,{get:()=>t[i],enumerable:!(n=aa(t,i))||n.enumerable});return e};var Qe=(e,t,r)=>(r=e!=null?sa(ua(e)):{},pa(t||!e||!e.__esModule?en(r,"default",{value:e,enumerable:!0}):r,e));var y,u=me(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var b,c=me(()=>{"use strict";b=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,p=me(()=>{"use strict";E=()=>{};E.prototype=E});var m=me(()=>{"use strict"});var Ei=Fe(Ke=>{"use strict";f();u();c();p();m();var oi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ma=oi(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var D=A.indexOf("=");D===-1&&(D=R);var M=D===R?0:4-D%4;return[D,M]}function l(A){var R=a(A),D=R[0],M=R[1];return(D+M)*3/4-M}function d(A,R,D){return(R+D)*3/4-D}function g(A){var R,D=a(A),M=D[0],B=D[1],k=new n(d(A,M,B)),F=0,ie=B>0?M-4:M,G;for(G=0;G>16&255,k[F++]=R>>8&255,k[F++]=R&255;return B===2&&(R=r[A.charCodeAt(G)]<<2|r[A.charCodeAt(G+1)]>>4,k[F++]=R&255),B===1&&(R=r[A.charCodeAt(G)]<<10|r[A.charCodeAt(G+1)]<<4|r[A.charCodeAt(G+2)]>>2,k[F++]=R>>8&255,k[F++]=R&255),k}function h(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function v(A,R,D){for(var M,B=[],k=R;kie?ie:F+k));return M===1?(R=A[D-1],B.push(t[R>>2]+t[R<<4&63]+"==")):M===2&&(R=(A[D-2]<<8)+A[D-1],B.push(t[R>>10]+t[R>>4&63]+t[R<<2&63]+"=")),B.join("")}}),fa=oi(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,d=(1<>1,h=-7,v=n?o-1:0,S=n?-1:1,A=t[r+v];for(v+=S,s=A&(1<<-h)-1,A>>=-h,h+=l;h>0;s=s*256+t[r+v],v+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+v],v+=S,h-=8);if(s===0)s=1-g;else{if(s===d)return a?NaN:(A?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(A?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,d,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:s-1,R=i?1:-1,D=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+v>=1?r+=S/d:r+=S*Math.pow(2,1-v),r*d>=2&&(a++,d/=2),a+v>=h?(l=0,a=h):a+v>=1?(l=(r*d-1)*Math.pow(2,o),a=a+v):(l=r*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;t[n+A]=l&255,A+=R,l/=256,o-=8);for(a=a<0;t[n+A]=a&255,A+=R,a/=256,g-=8);t[n+A-R]|=D*128}}),tn=ma(),We=fa(),ti=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=T;Ke.SlowBuffer=Ea;Ke.INSPECT_MAX_BYTES=50;var or=2147483647;Ke.kMaxLength=or;T.TYPED_ARRAY_SUPPORT=da();!T.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 da(){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{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function be(e){if(e>or)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(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 on(e)}return si(e,t,r)}T.poolSize=8192;function si(e,t,r){if(typeof e=="string")return ha(e,t);if(ArrayBuffer.isView(e))return ya(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(fe(e,ArrayBuffer)||e&&fe(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(e,SharedArrayBuffer)||e&&fe(e.buffer,SharedArrayBuffer)))return li(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 T.from(n,t,r);let i=wa(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.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)}T.from=function(e,t,r){return si(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ai(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 ga(e,t,r){return ai(e),e<=0?be(e):t!==void 0?typeof r=="string"?be(e).fill(t,r):be(e).fill(t):be(e)}T.alloc=function(e,t,r){return ga(e,t,r)};function on(e){return ai(e),be(e<0?0:sn(e)|0)}T.allocUnsafe=function(e){return on(e)};T.allocUnsafeSlow=function(e){return on(e)};function ha(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=ui(e,t)|0,n=be(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function rn(e){let t=e.length<0?0:sn(e.length)|0,r=be(t);for(let n=0;n=or)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+or.toString(16)+" bytes");return e|0}function Ea(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(fe(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),fe(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.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 i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function ui(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||fe(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 i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return nn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return wi(e).length;default:if(i)return n?-1:nn(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=ui;function ba(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 Ia(this,t,r);case"utf8":case"utf-8":return pi(this,t,r);case"ascii":return Sa(this,t,r);case"latin1":case"binary":return ka(this,t,r);case"base64":return Aa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oa(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Le(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.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+=" ... "),""};ti&&(T.prototype[ti]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(fe(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.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),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),d=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ln(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:ri(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ri(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ri(e,t,r,n,i){let o=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;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let d;if(i){let g=-1;for(d=r;ds&&(r=s-a),d=r;d>=0;d--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/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 i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return xa(this,e,t,r);case"utf8":case"utf-8":return Pa(this,e,t,r);case"ascii":case"latin1":case"binary":return va(this,e,t,r);case"base64":return Ta(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ca(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Aa(e,t,r){return t===0&&r===e.length?tn.fromByteArray(e):tn.fromByteArray(e.slice(t,r))}function pi(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,d,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],d=e[i+2],(l&192)===128&&(d&192)===128&&(h=(o&15)<<12|(l&63)<<6|d&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],d=e[i+2],g=e[i+3],(l&192)===128&&(d&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(d&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ra(n)}var ni=4096;function Ra(e){let t=e.length;if(t<=ni)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Ae(function(e){e=e>>>0,He(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&bt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,He(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&bt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Ae(function(e){e=e>>>0,He(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&bt(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,He(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&bt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),We.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),We.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),We.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),We.read(this,e,!1,52,8)};function te(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.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;te(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;te(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||te(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};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||te(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 mi(e,t,r,n,i){yi(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;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,i){yi(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;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}T.prototype.writeBigUInt64LE=Ae(function(e,t=0){return mi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Ae(function(e,t=0){return fi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);te(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);te(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||te(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};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||te(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};T.prototype.writeBigInt64LE=Ae(function(e,t=0){return mi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Ae(function(e,t=0){return fi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function di(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function gi(e,t,r,n,i){return t=+t,r=r>>>0,i||di(e,t,r,4,34028234663852886e22,-34028234663852886e22),We.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return gi(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return gi(this,e,t,!1,r)};function hi(e,t,r,n,i){return t=+t,r=r>>>0,i||di(e,t,r,8,17976931348623157e292,-17976931348623157e292),We.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return hi(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return hi(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.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 i;if(typeof e=="number")for(i=t;i2**32?i=ii(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=ii(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function ii(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 Da(e,t,r){He(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&bt(t,e.length-(r+1))}function yi(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Je.ERR_OUT_OF_RANGE("value",a,e)}Da(n,i,o)}function He(e,t){if(typeof e!="number")throw new Je.ERR_INVALID_ARG_TYPE(t,"number",e)}function bt(e,t,r){throw Math.floor(e)!==e?(He(e,r),new Je.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Je.ERR_BUFFER_OUT_OF_BOUNDS:new Je.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Ma=/[^+/0-9A-Za-z-_]/g;function _a(e){if(e=e.split("=")[0],e=e.trim().replace(Ma,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function nn(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Na(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function wi(e){return tn.toByteArray(_a(e))}function sr(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function fe(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function ln(e){return e!==e}var La=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Ae(e){return typeof BigInt>"u"?Ba:e}function Ba(){throw new Error("BigInt not supported")}});var w,f=me(()=>{"use strict";w=Qe(Ei())});function Ga(){return!1}function Bi(){return{dev:0,ino:0,mode:0,nlink:0,uid:0,gid:0,rdev:0,size:0,blksize:0,blocks:0,atimeMs:0,mtimeMs:0,ctimeMs:0,birthtimeMs:0,atime:new Date,mtime:new Date,ctime:new Date,birthtime:new Date}}function Qa(){return Bi()}function Ja(){return[]}function Wa(e){e(null,[])}function Ha(){return""}function Ka(){return""}function za(){}function Ya(){}function Za(){}function Xa(){}function el(){}function tl(){}var rl,nl,qi,Ui=me(()=>{"use strict";f();u();c();p();m();rl={},nl={existsSync:Ga,lstatSync:Bi,statSync:Qa,readdirSync:Ja,readdir:Wa,readlinkSync:Ha,realpathSync:Ka,chmodSync:za,renameSync:Ya,mkdirSync:Za,rmdirSync:Xa,rmSync:el,unlinkSync:tl,promises:rl},qi=nl});function il(...e){return e.join("/")}function ol(...e){return e.join("/")}function sl(e){let t=$i(e),r=ji(e),[n,i]=t.split(".");return{root:"/",dir:r,base:t,ext:i,name:n}}function $i(e){let t=e.split("/");return t[t.length-1]}function ji(e){return e.split("/").slice(0,-1).join("/")}var Vi,al,ll,cr,Gi=me(()=>{"use strict";f();u();c();p();m();Vi="/",al={sep:Vi},ll={basename:$i,dirname:ji,join:ol,parse:sl,posix:al,resolve:il,sep:Vi},cr=ll});var Qi=Fe((af,ul)=>{ul.exports={name:"@prisma/internals",version:"6.7.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek ",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-engine-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Hi=Fe((Af,Wi)=>{"use strict";f();u();c();p();m();Wi.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 Yi=Fe((Bf,zi)=>{"use strict";f();u();c();p();m();zi.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 Xi=Fe((Gf,Zi)=>{"use strict";f();u();c();p();m();var yl=Yi();Zi.exports=e=>typeof e=="string"?e.replace(yl(),""):e});var Pn=Fe((Dy,wo)=>{"use strict";f();u();c();p();m();wo.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;s{"use strict";f();u();c();p();m()});var To=me(()=>{"use strict";f();u();c();p();m()});var Qo=Fe((e1,ac)=>{ac.exports={name:"@prisma/engines-version",version:"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"3cff47a7f5d65c3ea74883f1d736e41d68ce91ed"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Lr,Jo=me(()=>{"use strict";f();u();c();p();m();Lr=class{events={};on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});f();u();c();p();m();var Pi={};ir(Pi,{defineExtension:()=>bi,getExtensionContext:()=>xi});f();u();c();p();m();f();u();c();p();m();function bi(e){return typeof e=="function"?e:t=>t.$extends(e)}f();u();c();p();m();function xi(e){return e}var Ti={};ir(Ti,{validator:()=>vi});f();u();c();p();m();f();u();c();p();m();function vi(...e){return t=>t}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();var un,Ci,Ai,Ri,Si=!0;typeof y<"u"&&({FORCE_COLOR:un,NODE_DISABLE_COLORS:Ci,NO_COLOR:Ai,TERM:Ri}=y.env||{},Si=y.stdout&&y.stdout.isTTY);var qa={enabled:!Ci&&Ai==null&&Ri!=="dumb"&&(un!=null&&un!=="0"||Si)};function j(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!qa.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var um=j(0,0),ar=j(1,22),lr=j(2,22),cm=j(3,23),ki=j(4,24),pm=j(7,27),mm=j(8,28),fm=j(9,29),dm=j(30,39),ze=j(31,39),Ii=j(32,39),Oi=j(33,39),Di=j(34,39),gm=j(35,39),Mi=j(36,39),hm=j(37,39),_i=j(90,39),ym=j(90,39),wm=j(40,49),Em=j(41,49),bm=j(42,49),xm=j(43,49),Pm=j(44,49),vm=j(45,49),Tm=j(46,49),Cm=j(47,49);f();u();c();p();m();var Ua=100,Ni=["green","yellow","blue","magenta","cyan","red"],ur=[],Fi=Date.now(),$a=0,cn=typeof y<"u"?y.env:{};globalThis.DEBUG??=cn.DEBUG??"";globalThis.DEBUG_COLORS??=cn.DEBUG_COLORS?cn.DEBUG_COLORS==="true":!0;var xt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function ja(e){let t={color:Ni[$a++%Ni.length],enabled:xt.enabled(e),namespace:e,log:xt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&ur.push([o,...n]),ur.length>Ua&&ur.shift(),xt.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:Va(g)),d=`+${Date.now()-Fi}ms`;Fi=Date.now(),a(o,...l,d)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Y=new Proxy(ja,{get:(e,t)=>xt[t],set:(e,t,r)=>xt[t]=r});function Va(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Li(){ur.length=0}f();u();c();p();m();f();u();c();p();m();var cl=Qi(),pn=cl.version;f();u();c();p();m();function Ye(e){let t=pl();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":ml(e))}function pl(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function ml(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}f();u();c();p();m();var Ji="prisma+postgres",pr=`${Ji}:`;function mn(e){return e?.startsWith(`${pr}//`)??!1}var vt={};ir(vt,{error:()=>gl,info:()=>dl,log:()=>fl,query:()=>hl,should:()=>Ki,tags:()=>Pt,warn:()=>fn});f();u();c();p();m();var Pt={error:ze("prisma:error"),warn:Oi("prisma:warn"),info:Mi("prisma:info"),query:Di("prisma:query")},Ki={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function fl(...e){console.log(...e)}function fn(e,...t){Ki.warn()&&console.warn(`${Pt.warn} ${e}`,...t)}function dl(e,...t){console.info(`${Pt.info} ${e}`,...t)}function gl(e,...t){console.error(`${Pt.error} ${e}`,...t)}function hl(e,...t){console.log(`${Pt.query} ${e}`,...t)}f();u();c();p();m();function xe(e,t){throw new Error(t)}f();u();c();p();m();function dn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}f();u();c();p();m();function Ze(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}f();u();c();p();m();function gn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{eo.has(e)||(eo.add(e),fn(t,...r))};var Q=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};N(Q,"PrismaClientInitializationError");f();u();c();p();m();var oe=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};N(oe,"PrismaClientKnownRequestError");f();u();c();p();m();var Re=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};N(Re,"PrismaClientRustPanicError");f();u();c();p();m();var se=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};N(se,"PrismaClientUnknownRequestError");f();u();c();p();m();var X=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};N(X,"PrismaClientValidationError");f();u();c();p();m();f();u();c();p();m();var Xe=9e15,Oe=1e9,hn="0123456789abcdef",gr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",hr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",yn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Xe,maxE:Xe,crypto:!1},oo,Pe,_=!0,wr="[DecimalError] ",Ie=wr+"Invalid argument: ",so=wr+"Precision limit exceeded",ao=wr+"crypto unavailable",lo="[object Decimal]",Z=Math.floor,J=Math.pow,wl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,El=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,bl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,uo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ce=1e7,O=7,xl=9007199254740991,Pl=gr.length-1,wn=hr.length-1,C={toStringTag:lo};C.absoluteValue=C.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),I(e)};C.ceil=function(){return I(new this.constructor(this),this.e+1,2)};C.clampedTo=C.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(Ie+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};C.comparedTo=C.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,d=e.s;if(!s||!a)return!l||!d?NaN:l!==d?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-d:0;if(l!==d)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};C.cosine=C.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())+O,n.rounding=1,r=vl(n,go(n,r)),n.precision=e,n.rounding=t,I(Pe==2||Pe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};C.cubeRoot=C.cbrt=function(){var e,t,r,n,i,o,s,a,l,d,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(_=!1,o=g.s*J(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=K(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=J(r,1/3),e=Z((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 h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),d=l.plus(g),n=U(d.plus(g).times(a),d.plus(l),s+2,1),K(a.d).slice(0,s)===(r=K(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(I(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(I(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return _=!0,I(n,e,h.rounding,t)};C.decimalPlaces=C.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Z(this.e/O))*O,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};C.dividedBy=C.div=function(e){return U(this,new this.constructor(e))};C.dividedToIntegerBy=C.divToInt=function(e){var t=this,r=t.constructor;return I(U(t,new r(e),0,1,1),r.precision,r.rounding)};C.equals=C.eq=function(e){return this.cmp(e)===0};C.floor=function(){return I(new this.constructor(this),this.e+1,3)};C.greaterThan=C.gt=function(e){return this.cmp(e)>0};C.greaterThanOrEqualTo=C.gte=function(e){var t=this.cmp(e);return t==1||t===0};C.hyperbolicCosine=C.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/br(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=et(s,1,o.times(t),new s(1),!0);for(var l,d=e,g=new s(8);d--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return I(o,s.precision=r,s.rounding=n,!0)};C.hyperbolicSine=C.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=et(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/br(5,e)),i=et(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),d=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(d))))}return o.precision=t,o.rounding=r,I(i,t,r,!0)};C.hyperbolicTangent=C.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,U(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};C.inverseCosine=C.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?de(t,n,i):new t(0):new t(NaN):e.isZero()?de(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};C.inverseHyperbolicCosine=C.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,_=!1,r=r.times(r).minus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};C.inverseHyperbolicSine=C.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,_=!1,r=r.times(r).plus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln())};C.inverseHyperbolicTangent=C.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?I(new o(i),e,t,!0):(o.precision=r=n-i.e,i=U(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)};C.inverseSine=C.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=de(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)))};C.inverseTangent=C.atan=function(){var e,t,r,n,i,o,s,a,l,d=this,g=d.constructor,h=g.precision,v=g.rounding;if(d.isFinite()){if(d.isZero())return new g(d);if(d.abs().eq(1)&&h+4<=wn)return s=de(g,h+4,v).times(.25),s.s=d.s,s}else{if(!d.s)return new g(NaN);if(h+4<=wn)return s=de(g,h+4,v).times(.5),s.s=d.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/O+2|0),e=r;e;--e)d=d.div(d.times(d).plus(1).sqrt().plus(1));for(_=!1,t=Math.ceil(a/O),n=1,l=d.times(d),s=new g(d),i=d;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};C.isNaN=function(){return!this.s};C.isNegative=C.isNeg=function(){return this.s<0};C.isPositive=C.isPos=function(){return this.s>0};C.isZero=function(){return!!this.d&&this.d[0]===0};C.lessThan=C.lt=function(e){return this.cmp(e)<0};C.lessThanOrEqualTo=C.lte=function(e){return this.cmp(e)<1};C.logarithm=C.log=function(e){var t,r,n,i,o,s,a,l,d=this,g=d.constructor,h=g.precision,v=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=d.d,d.s<0||!r||!r[0]||d.eq(1))return new g(r&&!r[0]?-1/0:d.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(_=!1,a=h+S,s=ke(d,a),n=t?yr(g,a+10):ke(e,a),l=U(s,n,a,1),Tt(l.d,i=h,v))do if(a+=10,s=ke(d,a),n=t?yr(g,a+10):ke(e,a),l=U(s,n,a,1),!o){+K(l.d).slice(i+1,i+15)+1==1e14&&(l=I(l,h+1,0));break}while(Tt(l.d,i+=10,v));return _=!0,I(l,h,v)};C.minus=C.sub=function(e){var t,r,n,i,o,s,a,l,d,g,h,v,S=this,A=S.constructor;if(e=new A(e),!S.d||!e.d)return!S.s||!e.s?e=new A(NaN):S.d?e.s=-e.s:e=new A(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(d=S.d,v=e.d,a=A.precision,l=A.rounding,!d[0]||!v[0]){if(v[0])e.s=-e.s;else if(d[0])e=new A(S);else return new A(l===3?-0:0);return _?I(e,a,l):e}if(r=Z(e.e/O),g=Z(S.e/O),d=d.slice(),o=g-r,o){for(h=o<0,h?(t=d,o=-o,s=v.length):(t=v,r=g,s=d.length),n=Math.max(Math.ceil(a/O),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=d.length,s=v.length,h=n0;--n)d[s++]=0;for(n=v.length;n>o;){if(d[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=d.length,i=g.length,s-i<0&&(i=s,r=g,g=d,d=r),t=0;i;)t=(d[--i]=d[i]+g[i]+t)/ce|0,d[i]%=ce;for(t&&(d.unshift(t),++n),s=d.length;d[--s]==0;)d.pop();return e.d=d,e.e=Er(d,n),_?I(e,a,l):e};C.precision=C.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ie+e);return r.d?(t=co(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};C.round=function(){var e=this,t=e.constructor;return I(new t(e),e.e+1,t.rounding)};C.sine=C.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())+O,n.rounding=1,r=Cl(n,go(n,r)),n.precision=e,n.rounding=t,I(Pe>2?r.neg():r,e,t,!0)):new n(NaN)};C.squareRoot=C.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,d=s.s,g=s.constructor;if(d!==1||!a||!a[0])return new g(!d||d<0&&(!a||a[0])?NaN:a?s:1/0);for(_=!1,d=Math.sqrt(+s),d==0||d==1/0?(t=K(a),(t.length+l)%2==0&&(t+="0"),d=Math.sqrt(t),l=Z((l+1)/2)-(l<0||l%2),d==1/0?t="5e"+l:(t=d.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new g(t)):n=new g(d.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus(U(s,o,r+2,1)).times(.5),K(o.d).slice(0,r)===(t=K(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(I(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")&&(I(n,l+1,1),e=!n.times(n).eq(s));break}return _=!0,I(n,l,g.rounding,e)};C.tangent=C.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=U(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,I(Pe==2||Pe==4?r.neg():r,e,t,!0)):new n(NaN)};C.times=C.mul=function(e){var t,r,n,i,o,s,a,l,d,g=this,h=g.constructor,v=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!v||!v[0]||!S||!S[0])return new h(!e.s||v&&!v[0]&&!S||S&&!S[0]&&!v?NaN:!v||!S?e.s/0:e.s*0);for(r=Z(g.e/O)+Z(e.e/O),l=v.length,d=S.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+S[n]*v[i-n-1]+t,o[i--]=a%ce|0,t=a/ce|0;o[i]=(o[i]+t)%ce|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Er(o,r),_?I(e,h.precision,h.rounding):e};C.toBinary=function(e,t){return bn(this,2,e,t)};C.toDecimalPlaces=C.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(re(e,0,Oe),t===void 0?t=n.rounding:re(t,0,8),I(r,e+r.e+1,t))};C.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ge(n,!0):(re(e,0,Oe),t===void 0?t=i.rounding:re(t,0,8),n=I(new i(n),e+1,t),r=ge(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=ge(i):(re(e,0,Oe),t===void 0?t=o.rounding:re(t,0,8),n=I(new o(i),e+i.e+1,t),r=ge(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};C.toFraction=function(e){var t,r,n,i,o,s,a,l,d,g,h,v,S=this,A=S.d,R=S.constructor;if(!A)return new R(S);if(d=r=new R(1),n=l=new R(0),t=new R(n),o=t.e=co(A)-S.e-1,s=o%O,t.d[0]=J(10,s<0?O+s:s),e==null)e=o>0?t:d;else{if(a=new R(e),!a.isInt()||a.lt(d))throw Error(Ie+a);e=a.gt(t)?o>0?t:d:a}for(_=!1,a=new R(K(A)),g=R.precision,R.precision=o=A.length*O*2;h=U(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=d,d=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=U(e.minus(r),n,0,1,1),l=l.plus(i.times(d)),r=r.plus(i.times(n)),l.s=d.s=S.s,v=U(d,n,o,1).minus(S).abs().cmp(U(l,r,o,1).minus(S).abs())<1?[d,n]:[l,r],R.precision=g,_=!0,v};C.toHexadecimal=C.toHex=function(e,t){return bn(this,16,e,t)};C.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:re(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]?(_=!1,r=U(r,e,0,t,1).times(e),_=!0,I(r)):(e.s=r.s,r=e),r};C.toNumber=function(){return+this};C.toOctal=function(e,t){return bn(this,8,e,t)};C.toPower=C.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,d=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(J(+a,d));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return I(a,n,o);if(t=Z(e.e/O),t>=e.d.length-1&&(r=d<0?-d:d)<=xl)return i=po(l,a,r,n),e.s<0?new l(1).div(i):I(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(_=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=En(e.times(ke(a,n+r)),n),i.d&&(i=I(i,n+5,1),Tt(i.d,n,o)&&(t=n+10,i=I(En(e.times(ke(a,t+r)),t),t+5,1),+K(i.d).slice(n+1,n+15)+1==1e14&&(i=I(i,n+1,0)))),i.s=s,_=!0,l.rounding=o,I(i,n,o))};C.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ge(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(re(e,1,Oe),t===void 0?t=i.rounding:re(t,0,8),n=I(new i(n),e,t),r=ge(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toSignificantDigits=C.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(re(e,1,Oe),t===void 0?t=n.rounding:re(t,0,8)),I(new n(r),e,t)};C.toString=function(){var e=this,t=e.constructor,r=ge(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};C.truncated=C.trunc=function(){return I(new this.constructor(this),this.e+1,1)};C.valueOf=C.toJSON=function(){var e=this,t=e.constructor,r=ge(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function K(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Ie+e)}function Tt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=O,i=0):(i=Math.ceil((t+1)/O),t%=O),o=J(10,O-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 fr(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 vl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/br(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=et(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 U=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 d,g,h,v,S,A,R,D,M,B,k,F,ie,G,Yr,tr,Et,Zr,ue,rr,nr=n.constructor,Xr=n.s==i.s?1:-1,z=n.d,$=i.d;if(!z||!z[0]||!$||!$[0])return new nr(!n.s||!i.s||(z?$&&z[0]==$[0]:!$)?NaN:z&&z[0]==0||!$?Xr*0:Xr/0);for(l?(S=1,g=n.e-i.e):(l=ce,S=O,g=Z(n.e/S)-Z(i.e/S)),ue=$.length,Et=z.length,M=new nr(Xr),B=M.d=[],h=0;$[h]==(z[h]||0);h++);if($[h]>(z[h]||0)&&g--,o==null?(G=o=nr.precision,s=nr.rounding):a?G=o+(n.e-i.e)+1:G=o,G<0)B.push(1),A=!0;else{if(G=G/S+2|0,h=0,ue==1){for(v=0,$=$[0],G++;(h1&&($=e($,v,l),z=e(z,v,l),ue=$.length,Et=z.length),tr=ue,k=z.slice(0,ue),F=k.length;F=l/2&&++Zr;do v=0,d=t($,k,ue,F),d<0?(ie=k[0],ue!=F&&(ie=ie*l+(k[1]||0)),v=ie/Zr|0,v>1?(v>=l&&(v=l-1),R=e($,v,l),D=R.length,F=k.length,d=t(R,k,D,F),d==1&&(v--,r(R,ue=10;v/=10)h++;M.e=h+g*S-1,I(M,a?o+M.e+1:o,s,A)}return M}}();function I(e,t,r,n){var i,o,s,a,l,d,g,h,v,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=O,s=t,g=h[v=0],l=g/J(10,i-s-1)%10|0;else if(v=Math.ceil((o+1)/O),a=h.length,v>=a)if(n){for(;a++<=v;)h.push(0);g=l=0,i=1,o%=O,s=o-O+1}else break e;else{for(g=a=h[v],i=1;a>=10;a/=10)i++;o%=O,s=o-O+i,l=s<0?0:g/J(10,i-s-1)%10|0}if(n=n||t<0||h[v+1]!==void 0||(s<0?g:g%J(10,i-s-1)),d=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?g/J(10,i-s):0:h[v-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,d?(t-=e.e+1,h[0]=J(10,(O-t%O)%O),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=v,a=1,v--):(h.length=v+1,a=J(10,O-o),h[v]=s>0?(g/J(10,i-s)%J(10,s)|0)*a:0),d)for(;;)if(v==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==ce&&(h[0]=1));break}else{if(h[v]+=a,h[v]!=ce)break;h[v--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return _&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Se(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Se(-i-1)+o,r&&(n=r-s)>0&&(o+=Se(n))):i>=s?(o+=Se(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Se(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Se(n))),o}function Er(e,t){var r=e[0];for(t*=O;r>=10;r/=10)t++;return t}function yr(e,t,r){if(t>Pl)throw _=!0,r&&(e.precision=r),Error(so);return I(new e(gr),t,1,!0)}function de(e,t,r){if(t>wn)throw Error(so);return I(new e(hr),t,r,!0)}function co(e){var t=e.length-1,r=t*O+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 Se(e){for(var t="";e--;)t+="0";return t}function po(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/O+4);for(_=!1;;){if(r%2&&(o=o.times(t),no(o.d,s)&&(i=!0)),r=Z(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),no(t.d,s)}return _=!0,o}function ro(e){return e.d[e.d.length-1]&1}function mo(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s17)return new v(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(_=!1,l=A):l=t,a=new v(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(J(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new v(1),v.precision=l;;){if(o=I(o.times(e),l,1),r=r.times(++g),a=s.plus(U(o,r,l,1)),K(a.d).slice(0,l)===K(s.d).slice(0,l)){for(i=h;i--;)s=I(s.times(s),l,1);if(t==null)if(d<3&&Tt(s.d,l-n,S,d))v.precision=l+=10,r=o=a=new v(1),g=0,d++;else return I(s,v.precision=A,S,_=!0);else return v.precision=A,s}s=a}}function ke(e,t){var r,n,i,o,s,a,l,d,g,h,v,S=1,A=10,R=e,D=R.d,M=R.constructor,B=M.rounding,k=M.precision;if(R.s<0||!D||!D[0]||!R.e&&D[0]==1&&D.length==1)return new M(D&&!D[0]?-1/0:R.s!=1?NaN:D?0:R);if(t==null?(_=!1,g=k):g=t,M.precision=g+=A,r=K(D),n=r.charAt(0),Math.abs(o=R.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)R=R.times(e),r=K(R.d),n=r.charAt(0),S++;o=R.e,n>1?(R=new M("0."+r),o++):R=new M(n+"."+r.slice(1))}else return d=yr(M,g+2,k).times(o+""),R=ke(new M(n+"."+r.slice(1)),g-A).plus(d),M.precision=k,t==null?I(R,k,B,_=!0):R;for(h=R,l=s=R=U(R.minus(1),R.plus(1),g,1),v=I(R.times(R),g,1),i=3;;){if(s=I(s.times(v),g,1),d=l.plus(U(s,new M(i),g,1)),K(d.d).slice(0,g)===K(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(yr(M,g+2,k).times(o+""))),l=U(l,new M(S),g,1),t==null)if(Tt(l.d,g-A,B,a))M.precision=g+=A,d=s=R=U(h.minus(1),h.plus(1),g,1),v=I(R.times(R),g,1),i=a=1;else return I(l,M.precision=k,B,_=!0);else return M.precision=k,l;l=d,i+=2}}function fo(e){return String(e.s*e.s/0)}function dr(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)%O,r<0&&(n+=O),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),uo.test(t))return dr(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(El.test(t))r=16,t=t.toLowerCase();else if(wl.test(t))r=2;else if(bl.test(t))r=8;else throw Error(Ie+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=po(n,new n(r),o,o*2)),d=fr(t,r,ce),g=d.length-1,o=g;d[o]===0;--o)d.pop();return o<0?new n(e.s*0):(e.e=Er(d,g),e.d=d,_=!1,s&&(e=U(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?J(2,l):Be.pow(2,l))),_=!0,e)}function Cl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:et(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/br(5,r)),t=et(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 et(e,t,r,n,i){var o,s,a,l,d=1,g=e.precision,h=Math.ceil(g/O);for(_=!1,l=r.times(r),a=new e(n);;){if(s=U(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=U(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,d++}return _=!0,s.d.length=h+1,s}function br(e,t){for(var r=e;--t;)r*=e;return r}function go(e,t){var r,n=t.s<0,i=de(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Pe=n?4:1,t;if(r=t.divToInt(i),r.isZero())Pe=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Pe=ro(r)?n?2:3:n?4:1,t;Pe=ro(r)?n?1:4:n?3:2}return t.minus(i).abs()}function bn(e,t,r,n){var i,o,s,a,l,d,g,h,v,S=e.constructor,A=r!==void 0;if(A?(re(r,1,Oe),n===void 0?n=S.rounding:re(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=fo(e);else{for(g=ge(e),s=g.indexOf("."),A?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),v=new S(1),v.e=g.length-s,v.d=fr(ge(v),10,i),v.e=v.d.length),h=fr(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=A?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=U(e,v,r,n,0,i),h=e.d,o=e.e,d=oo),s=h[r],a=i/2,d=d||h[r+1]!==void 0,d=n<4?(s!==void 0||d)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||d||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,d)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=fr(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function Al(e){return new this(e).abs()}function Rl(e){return new this(e).acos()}function Sl(e){return new this(e).acosh()}function kl(e,t){return new this(e).plus(t)}function Il(e){return new this(e).asin()}function Ol(e){return new this(e).asinh()}function Dl(e){return new this(e).atan()}function Ml(e){return new this(e).atanh()}function _l(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=de(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?de(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=de(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(U(e,t,o,1)),t=de(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(U(e,t,o,1)),r}function Nl(e){return new this(e).cbrt()}function Fl(e){return I(e=new this(e),e.e+1,2)}function Ll(e,t,r){return new this(e).clamp(t,r)}function Bl(e){if(!e||typeof e!="object")throw Error(wr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Oe,"rounding",0,8,"toExpNeg",-Xe,0,"toExpPos",0,Xe,"maxE",0,Xe,"minE",-Xe,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ie+r+": "+n);if(r="crypto",i&&(this[r]=yn[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(ao);else this[r]=!1;else throw Error(Ie+r+": "+n);return this}function ql(e){return new this(e).cos()}function Ul(e){return new this(e).cosh()}function ho(e){var t,r,n;function i(o){var s,a,l,d=this;if(!(d instanceof i))return new i(o);if(d.constructor=i,io(o)){d.s=o.s,_?!o.d||o.e>i.maxE?(d.e=NaN,d.d=null):o.e=10;a/=10)s++;_?s>i.maxE?(d.e=NaN,d.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(ao);else for(;o=10;i/=10)n++;nRt,datamodelEnumToSchemaEnum:()=>du});f();u();c();p();m();f();u();c();p();m();function du(e){return{name:e.name,values:e.values.map(t=>t.name)}}f();u();c();p();m();var Rt=(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.updateManyAndReturn="updateManyAndReturn",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw",k))(Rt||{});var gu=Qe(Hi());var hu={red:ze,gray:_i,dim:lr,bold:ar,underline:ki,highlightSource:e=>e.highlight()},yu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function wu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Eu({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(bu(t))),i){a.push("");let d=[i.toString()];o&&(d.push(o),d.push(s.dim(")"))),a.push(d.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` +`)}function bu(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function vr(e){let t=e.showColors?hu:yu,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=wu(e),Eu(r,t)}f();u();c();p();m();var Ao=Qe(Pn());f();u();c();p();m();function xo(e,t,r){let n=Po(e),i=xu(n),o=vu(i);o?Tr(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Po(e){return e.errors.flatMap(t=>t.kind==="Union"?Po(t):[t])}function xu(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:Pu(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Pu(e,t){return[...new Set(e.concat(t))]}function vu(e){return gn(e,(t,r)=>{let n=Eo(t),i=Eo(r);return n!==i?n-i:bo(t)-bo(r)})}function Eo(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function bo(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}f();u();c();p();m();var ae=class{constructor(t,r){this.name=t;this.value=r}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)}};f();u();c();p();m();f();u();c();p();m();To();f();u();c();p();m();var nt=class{constructor(t=0,r){this.context=r;this.currentIndent=t}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=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}};vo();f();u();c();p();m();f();u();c();p();m();var Cr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};f();u();c();p();m();var Ar=e=>e,Rr={bold:Ar,red:Ar,green:Ar,dim:Ar,enabled:!1},Co={bold:ar,red:ze,green:Ii,dim:lr,enabled:!0},it={write(e){e.writeLine(",")}};f();u();c();p();m();var ye=class{constructor(t){this.contents=t}isUnderlined=!1;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)))})}};f();u();c();p();m();var Me=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var ot=class extends Me{items=[];addItem(t){return this.items.push(new Cr(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new ye("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(it,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var st=class e extends Me{fields={};suggestions=[];addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof e?a=o.value.getField(s):o.value instanceof ot&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let o=n.value.getFieldValue(i);if(!o||!(o instanceof e))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new ye("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(it,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};f();u();c();p();m();var H=class extends Me{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new ye(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};f();u();c();p();m();var St=class{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(it,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Tr(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Tu(e,t);break;case"IncludeOnScalar":Cu(e,t);break;case"EmptySelection":Au(e,t,r);break;case"UnknownSelectionField":Iu(e,t);break;case"InvalidSelectionValue":Ou(e,t);break;case"UnknownArgument":Du(e,t);break;case"UnknownInputField":Mu(e,t);break;case"RequiredArgumentMissing":_u(e,t);break;case"InvalidArgumentType":Nu(e,t);break;case"InvalidArgumentValue":Fu(e,t);break;case"ValueTooLarge":Lu(e,t);break;case"SomeFieldsMissing":Bu(e,t);break;case"TooManyFieldsGiven":qu(e,t);break;case"Union":xo(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Tu(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Cu(e,t){let[r,n]=kt(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 ae(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)}. ${It(s)}`:a+=".",a+=` +Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Au(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Ru(e,t,i);return}if(n.hasField("select")){Su(e,t);return}}if(r?.[De(e.outputType.name)]){ku(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Ru(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new ae(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Su(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ko(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${It(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function ku(e,t){let r=new St;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new ae("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=kt(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new st;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function Iu(e,t){let r=Io(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":ko(n,e.outputType);break;case"include":Uu(n,e.outputType);break;case"omit":$u(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(It(n)),i.join(" ")})}function Ou(e,t){let r=Io(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function Du(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),ju(n,e.arguments)),t.addErrorMessage(i=>Ro(i,r,e.arguments.map(o=>o.name)))}function Mu(e,t){let[r,n]=kt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&Oo(o,e.inputType)}t.addErrorMessage(o=>Ro(o,n,e.inputType.fields.map(s=>s.name)))}function Ro(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Gu(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(It(e)),n.join(" ")}function _u(e,t){let r;t.addErrorMessage(l=>r?.value instanceof H&&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)?.asObject();if(!n)return;let[i,o]=kt(e.argumentPath),s=new St,a=n.getDeepFieldValue(i)?.asObject();if(a)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 ae(o,s).makeRequired())}else{let l=e.inputTypes.map(So).join(" | ");a.addSuggestion(new ae(o,l).makeRequired())}}function So(e){return e.kind==="list"?`${So(e.elementType)}[]`:e.name}function Nu(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Sr("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 Fu(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&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=Sr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Lu(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof H&&(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 Bu(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&Oo(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")} ${Sr("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(It(i)),o.join(" ")})}function qu(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(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 ${Sr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function ko(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ae(r.name,"true"))}function Uu(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new ae(r.name,"true"))}function $u(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new ae(r.name,"true"))}function ju(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new ae(r.name,r.typeNames.join(" | ")))}function Io(e,t){let[r,n]=kt(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function Oo(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ae(r.name,r.typeNames.join(" | ")))}function kt(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function It({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Sr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Vu=3;function Gu(e,t){let r=1/0,n;for(let i of t){let o=(0,Ao.default)(e,i);o>Vu||o`}};function at(e){return e instanceof Ot}f();u();c();p();m();var kr=Symbol(),Tn=new WeakMap,Te=class{constructor(t){t===kr?Tn.set(this,`Prisma.${this._getName()}`):Tn.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Tn.get(this)}},Dt=class extends Te{_getNamespace(){return"NullTypes"}},Mt=class extends Dt{#e};An(Mt,"DbNull");var _t=class extends Dt{#e};An(_t,"JsonNull");var Nt=class extends Dt{#e};An(Nt,"AnyNull");var Cn={classes:{DbNull:Mt,JsonNull:_t,AnyNull:Nt},instances:{DbNull:new Mt(kr),JsonNull:new _t(kr),AnyNull:new Nt(kr)}};function An(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}f();u();c();p();m();var Do=": ",Ir=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Do.length}write(t){let r=new ye(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Do).write(this.value)}};var Rn=class{arguments;errorMessages=[];constructor(t){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 lt(e){return new Rn(Mo(e))}function Mo(e){let t=new st;for(let[r,n]of Object.entries(e)){let i=new Ir(r,_o(n));t.addField(i)}return t}function _o(e){if(typeof e=="string")return new H(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new H(String(e));if(typeof e=="bigint")return new H(`${e}n`);if(e===null)return new H("null");if(e===void 0)return new H("undefined");if(rt(e))return new H(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new H(`Buffer.alloc(${e.byteLength})`):new H(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=xr(e)?e.toISOString():"Invalid Date";return new H(`new Date("${t}")`)}return e instanceof Te?new H(`Prisma.${e._getName()}`):at(e)?new H(`prisma.${De(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Qu(e):typeof e=="object"?Mo(e):new H(Object.prototype.toString.call(e))}function Qu(e){let t=new ot;for(let r of e)t.addItem(_o(r));return t}function Or(e,t){let r=t==="pretty"?Co:Rr,n=e.renderAllMessages(r),i=new nt(0,{colors:r}).write(e).toString();return{message:n,args:i}}function Dr({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=lt(e);for(let h of t)Tr(h,a,s);let{message:l,args:d}=Or(a,r),g=vr({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:d});throw new X(g,{clientVersion:o})}f();u();c();p();m();f();u();c();p();m();function we(e){return e.replace(/^./,t=>t.toLowerCase())}f();u();c();p();m();function Fo(e,t,r){let n=we(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ju({...e,...No(t.name,e,t.result.$allModels),...No(t.name,e,t.result[n])})}function Ju(e){let t=new he,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 Ze(e,n=>({...n,needs:r(n.name,new Set)}))}function No(e,t,r){return r?Ze(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Wu(t,o,i)})):{}}function Wu(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Lo(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}function Bo(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)delete r[i];return r}var Mr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new he;modelExtensionsCache=new he;queryCallbacksCache=new he;clientExtensions=At(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=At(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Fo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=we(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()}},ut=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Mr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Mr(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()??[]}};f();u();c();p();m();var _r=class{constructor(t){this.name=t}};function qo(e){return e instanceof _r}function Hu(e){return new _r(e)}f();u();c();p();m();f();u();c();p();m();var Uo=Symbol(),Ft=class{constructor(t){if(t!==Uo)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Sn:t}},Sn=new Ft(Uo);function Ee(e){return e instanceof Ft}var Ku={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},$o="explicitly `undefined` values are not allowed";function In({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=ut.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:d,globalOmit:g}){let h=new kn({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:d,globalOmit:g});return{modelName:e,action:Ku[t],query:Lt(r,h)}}function Lt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Vo(r,n),selection:zu(e,t,i,n)}}function zu(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),ec(e,n)):Yu(n,t,r)}function Yu(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&Zu(n,t,e),Xu(n,r,e),n}function Zu(e,t,r){for(let[n,i]of Object.entries(t)){if(Ee(i))continue;let o=r.nestSelection(n);if(On(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){e[n]=Lt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=Lt(i,o)}}function Xu(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=Bo(i,n);for(let[s,a]of Object.entries(o)){if(Ee(a))continue;On(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function ec(e,t){let r={},n=t.getComputedFields(),i=Lo(e,n);for(let[o,s]of Object.entries(i)){if(Ee(s))continue;let a=t.nestSelection(o);On(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||Ee(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=Lt({},a):r[o]=!0;continue}r[o]=Lt(s,a)}}return r}function jo(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(tt(e)){if(xr(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(qo(e))return{$type:"Param",value:e.name};if(at(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return tc(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:w.Buffer.from(r,n,i).toString("base64")}}if(rc(e))return e.values;if(rt(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Te){if(e!==Cn.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(nc(e))return e.toJSON();if(typeof e=="object")return Vo(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function Vo(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);Ee(i)||(i!==void 0?r[n]=jo(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:$o}))}return r}function tc(e,t){let r=[];for(let n=0;n({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.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)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[De(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:xe(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};f();u();c();p();m();function Go(e){if(!e._hasPreviewFlag("metrics"))throw new X("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var Bt=class{_client;constructor(t){this._client=t}prometheus(t){return Go(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return Go(this._client),this._client._engine.metrics({format:"json",...t})}};f();u();c();p();m();function ic(e,t){let r=At(()=>oc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function oc(e){return{datamodel:{models:Dn(e.models),enums:Dn(e.enums),types:Dn(e.types)}}}function Dn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}f();u();c();p();m();var Mn=new WeakMap,Nr="$$PrismaTypedSql",qt=class{constructor(t,r){Mn.set(this,{sql:t,values:r}),Object.defineProperty(this,Nr,{value:Nr})}get sql(){return Mn.get(this).sql}get values(){return Mn.get(this).values}};function sc(e){return(...t)=>new qt(e,t)}function Fr(e){return e!=null&&e[Nr]===Nr}f();u();c();p();m();var oa=Qe(Qo());f();u();c();p();m();Jo();Ui();Gi();f();u();c();p();m();var le=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)}}}f();u();c();p();m();f();u();c();p();m();var Br={enumerable:!0,configurable:!0,writable:!0};function qr(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>Br,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Ko=Symbol.for("nodejs.util.inspect.custom");function pe(e,t){let r=cc(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=zo(Reflect.ownKeys(o),r),a=zo(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?{...Br,...l?.getPropertyDescriptor(s)}:Br:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[Ko]=function(){let o={...this};return delete o[Ko],o},i}function cc(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 zo(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}f();u();c();p();m();function ct(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}f();u();c();p();m();function Ur(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}f();u();c();p();m();function Yo(e){if(e===void 0)return"";let t=lt(e);return new nt(0,{colors:Rr}).write(t).toString()}f();u();c();p();m();var pc="P2037";function $r({error:e,user_facing_error:t},r,n){return t.error_code?new oe(mc(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new se(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function mc(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===pc&&(r+=` +Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();var _n=class{getLocation(){return null}};function _e(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new _n}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();var Zo={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function pt(e={}){let t=dc(e);return Object.entries(t).reduce((n,[i,o])=>(Zo[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function dc(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function jr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Xo(e,t){let r=jr(e);return t({action:"aggregate",unpacker:r,argsMapper:pt})(e)}f();u();c();p();m();function gc(e={}){let{select:t,...r}=e;return typeof t=="object"?pt({...r,_count:t}):pt({...r,_count:{_all:!0}})}function hc(e={}){return typeof e.select=="object"?t=>jr(e)(t)._count:t=>jr(e)(t)._count._all}function es(e,t){return t({action:"count",unpacker:hc(e),argsMapper:gc})(e)}f();u();c();p();m();function yc(e={}){let t=pt(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 wc(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ts(e,t){return t({action:"groupBy",unpacker:wc(e),argsMapper:yc})(e)}function rs(e,t,r){if(t==="aggregate")return n=>Xo(n,r);if(t==="count")return n=>es(n,r);if(t==="groupBy")return n=>ts(n,r)}f();u();c();p();m();function ns(e,t){let r=t.fields.filter(i=>!i.relationName),n=yo(r,"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 Ot(e,o,s.type,s.isList,s.kind==="enum")},...qr(Object.keys(n))})}f();u();c();p();m();f();u();c();p();m();var is=e=>Array.isArray(e)?e:e.split("."),Nn=(e,t)=>is(t).reduce((r,n)=>r&&r[n],e),os=(e,t,r)=>is(t).reduceRight((n,i,o,s)=>Object.assign({},Nn(e,s.slice(0,o)),{[i]:n}),r);function Ec(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function bc(e,t,r){return t===void 0?e??{}:os(t,r,e||!0)}function Fn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,d)=>({...l,[d.name]:d}),{});return l=>{let d=_e(e._errorFormat),g=Ec(n,i),h=bc(l,o,g),v=r({dataPath:g,callsite:d})(h),S=xc(e,t);return new Proxy(v,{get(A,R){if(!S.includes(R))return A[R];let M=[a[R].type,r,R],B=[g,h];return Fn(e,...M,...B)},...qr([...S,...Object.getOwnPropertyNames(v)])})}}function xc(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Pc=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],vc=["aggregate","count","groupBy"];function Ln(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Tc(e,t),Ac(e,t),Ut(r),ee("name",()=>t),ee("$name",()=>t),ee("$parent",()=>e._appliedParent)];return pe({},n)}function Tc(e,t){let r=we(t),n=Object.keys(Rt).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let d=_e(e._errorFormat);return e._createPrismaPromise(g=>{let h={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:g,callsite:d};return e._request({...h,...a})},{action:o,args:l,model:t})};return Pc.includes(o)?Fn(e,t,s):Cc(i)?rs(e,i,s):s({})}}}function Cc(e){return vc.includes(e)}function Ac(e,t){return qe(ee("fields",()=>{let r=e._runtimeDataModel.models[t];return ns(t,r)}))}f();u();c();p();m();function ss(e){return e.replace(/^./,t=>t.toUpperCase())}var Bn=Symbol();function $t(e){let t=[Rc(e),Sc(e),ee(Bn,()=>e),ee("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Ut(r)),pe(e,t)}function Rc(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Sc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(we),n=[...new Set(t.concat(r))];return qe({getKeys(){return n},getPropertyValue(i){let o=ss(i);if(e._runtimeDataModel.models[o]!==void 0)return Ln(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Ln(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function as(e){return e[Bn]?e[Bn]:e}function ls(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return $t(t)}f();u();c();p();m();f();u();c();p();m();function us({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let d=l.needs.filter(g=>n[g]);d.length>0&&a.push(ct(d))}else if(r){if(!r[l.name])continue;let d=l.needs.filter(g=>!r[g]);d.length>0&&a.push(ct(d))}kc(e,l.needs)&&s.push(Ic(l,pe(e,s)))}return s.length>0||a.length>0?pe(e,[...s,...a]):e}function kc(e,t){return t.every(r=>dn(e,r))}function Ic(e,t){return qe(ee(e.name,()=>e.compute(t)))}f();u();c();p();m();function Vr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let d=typeof s=="object"?s:{};t[o]=Vr({visitor:i,result:t[o],args:d,modelName:l.type,runtimeDataModel:n})}}function ps({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Vr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,d)=>{let g=we(l);return us({result:a,modelName:g,select:d.select,omit:d.select?void 0:{...o?.[g],...d.omit},extensions:n})}})}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();var Oc=["$connect","$disconnect","$on","$transaction","$use","$extends"],ms=Oc;function fs(e){if(e instanceof le)return Dc(e);if(Fr(e))return Mc(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:fs(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Es(o,l),a.args=s,gs(e,a,r,n+1)}})})}function hs(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 gs(e,t,s)}function ys(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?ws(r,n,0,e):e(r)}}function ws(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=Es(i,l),ws(a,t,r+1,n)}})}var ds=e=>e;function Es(e=ds,t=ds){return r=>e(t(r))}f();u();c();p();m();var bs=Y("prisma:client"),xs={Vercel:"vercel","Netlify CI":"netlify"};function Ps({postinstall:e,ciName:t,clientVersion:r}){if(bs("checkPlatformCaching:postinstall",e),bs("checkPlatformCaching:ciName",t),e===!0&&t&&t in xs){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/${xs[t]}-build`;throw console.error(n),new Q(n,r)}}f();u();c();p();m();function vs(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}f();u();c();p();m();f();u();c();p();m();var _c=()=>globalThis.process?.release?.name==="node",Nc=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Fc=()=>!!globalThis.Deno,Lc=()=>typeof globalThis.Netlify=="object",Bc=()=>typeof globalThis.EdgeRuntime=="object",qc=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Uc(){return[[Lc,"netlify"],[Bc,"edge-light"],[qc,"workerd"],[Fc,"deno"],[Nc,"bun"],[_c,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var $c={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function qn(){let e=Uc();return{id:e,prettyName:$c[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();function mt({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 qn().id==="workerd"?new Q(`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 Q(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new Q("error: Missing URL environment variable, value, or override.",n);return i}f();u();c();p();m();f();u();c();p();m();var Gr=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ne=class extends Gr{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};f();u();c();p();m();f();u();c();p();m();function L(e,t){return{...e,isRetryable:t}}var ft=class extends ne{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",L(t,!0))}};N(ft,"ForcedRetryError");f();u();c();p();m();var Ue=class extends ne{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,L(r,!1))}};N(Ue,"InvalidDatasourceError");f();u();c();p();m();var $e=class extends ne{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,L(r,!1))}};N($e,"NotImplementedYetError");f();u();c();p();m();f();u();c();p();m();var V=class extends ne{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var je=class extends V{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",L(t,!0))}};N(je,"SchemaMissingError");f();u();c();p();m();f();u();c();p();m();var Un="This request could not be understood by the server",Vt=class extends V{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||Un,L(t,!1)),n&&(this.code=n)}};N(Vt,"BadRequestError");f();u();c();p();m();var Gt=class extends V{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",L(t,!0)),this.logs=r}};N(Gt,"HealthcheckTimeoutError");f();u();c();p();m();var Qt=class extends V{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,L(t,!0)),this.logs=n}};N(Qt,"EngineStartupError");f();u();c();p();m();var Jt=class extends V{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",L(t,!1))}};N(Jt,"EngineVersionNotSupportedError");f();u();c();p();m();var $n="Request timed out",Wt=class extends V{name="GatewayTimeoutError";code="P5009";constructor(t,r=$n){super(r,L(t,!1))}};N(Wt,"GatewayTimeoutError");f();u();c();p();m();var jc="Interactive transaction error",Ht=class extends V{name="InteractiveTransactionError";code="P5015";constructor(t,r=jc){super(r,L(t,!1))}};N(Ht,"InteractiveTransactionError");f();u();c();p();m();var Vc="Request parameters are invalid",Kt=class extends V{name="InvalidRequestError";code="P5011";constructor(t,r=Vc){super(r,L(t,!1))}};N(Kt,"InvalidRequestError");f();u();c();p();m();var jn="Requested resource does not exist",zt=class extends V{name="NotFoundError";code="P5003";constructor(t,r=jn){super(r,L(t,!1))}};N(zt,"NotFoundError");f();u();c();p();m();var Vn="Unknown server error",dt=class extends V{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||Vn,L(t,!0)),this.logs=n}};N(dt,"ServerError");f();u();c();p();m();var Gn="Unauthorized, check your connection string",Yt=class extends V{name="UnauthorizedError";code="P5007";constructor(t,r=Gn){super(r,L(t,!1))}};N(Yt,"UnauthorizedError");f();u();c();p();m();var Qn="Usage exceeded, retry again later",Zt=class extends V{name="UsageExceededError";code="P5008";constructor(t,r=Qn){super(r,L(t,!0))}};N(Zt,"UsageExceededError");async function Gc(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 Xt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Gc(e);if(n.type==="QueryEngineError")throw new oe(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new dt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new je(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Jt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Qt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new Q(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Gt(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 Ht(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Kt(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Yt(r,gt(Gn,n));if(e.status===404)return new zt(r,gt(jn,n));if(e.status===429)throw new Zt(r,gt(Qn,n));if(e.status===504)throw new Wt(r,gt($n,n));if(e.status>=500)throw new dt(r,gt(Vn,n));if(e.status>=400)throw new Vt(r,gt(Un,n))}function gt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}f();u();c();p();m();function Ts(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))}f();u();c();p();m();var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Cs(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,d,g;for(let h=0;h>18,a=(g&258048)>>12,l=(g&4032)>>6,d=g&63,r+=Ce[s]+Ce[a]+Ce[l]+Ce[d];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Ce[s]+Ce[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,l=(g&15)<<2,r+=Ce[s]+Ce[a]+Ce[l]+"="),r}f();u();c();p();m();function As(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new Q("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)}f();u();c();p();m();function Qc(e){return e[0]*1e3+e[1]/1e6}function Jn(e){return new Date(Qc(e))}f();u();c();p();m();var Rs={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};f();u();c();p();m();f();u();c();p();m();var er=class extends ne{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service: +${t}`,L(r,!0))}};N(er,"RequestError");async function Ve(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new er(a,{clientVersion:n,cause:s})}}var Wc=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Ss=Y("prisma:client:dataproxyEngine");async function Hc(e,t){let r=Rs["@prisma/engines-version"],n=t.clientVersion??"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[i,o]=n?.split("-")??[];if(o===void 0&&Wc.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,d]=s.split("."),g=Kc(`<=${a}.${l}.${d}`),h=await Ve(g,{clientVersion:n});if(!h.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${h.status} ${h.statusText}, response body: ${await h.text()||""}`);let v=await h.text();Ss("length of body fetched from unpkg.com",v.length);let S;try{S=JSON.parse(v)}catch(A){throw console.error("JSON.parse error: body fetched from unpkg.com: ",v),A}return S.version}throw new $e("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function ks(e,t){let r=await Hc(e,t);return Ss("version",r),r}function Kc(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Is=3,Qr=Y("prisma:client:dataproxyEngine"),Wn=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};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}},ht=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;constructor(t){As(t),this.config=t,this.env={...t.env,...typeof y<"u"?y.env:{}},this.inlineSchema=Cs(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new Wn({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await ks(t,this.config),Qr("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":Qr(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:Jn(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:Jn(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await Ve(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Qr("schema response status",r.status);let n=await Xt(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Ur(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await Ve(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Qr("graphql response status",a.status),await this.handleError(await Xt(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await Ve(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Xt(l,this.clientVersion));let d=await l.json(),{extensions:g}=d;g&&this.propagateResponseExtensions(g);let h=d.id,v=d["data-proxy"].endpoint;return{id:h,payload:{endpoint:v}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await Ve(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Xt(a,this.clientVersion));let l=await a.json(),{extensions:d}=l;d&&this.propagateResponseExtensions(d);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=mt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new Ue(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!==pr)throw new Ue(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let l=a.get("api_key");if(l===null||l.length<1)throw new Ue(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,l]}metrics(){throw new $e("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof ne)||!i.isRetryable)throw i;if(r>=Is)throw i instanceof ft?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${Is} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await Ts(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof je)throw await this.uploadSchema(),new ft({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?$r(t[0],this.config.clientVersion,this.config.activeProvider):new se(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Os({copyEngine:e=!0},t){let r;try{r=mt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||mn(r));e&&n&&mr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Ye(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",d=i==="client";if(o&&s||s){let g;throw g=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new X(g.join(` +`),{clientVersion:t.clientVersion})}return o?new ht(t):new ht(t)}f();u();c();p();m();function Jr({generator:e}){return e?.previewFeatures??[]}f();u();c();p();m();var Ds=e=>({command:e});f();u();c();p();m();f();u();c();p();m();var Ms=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);f();u();c();p();m();function yt(e){try{return _s(e,"fast")}catch{return _s(e,"slow")}}function _s(e,t){return JSON.stringify(e.map(r=>Fs(r,t)))}function Fs(e,t){if(Array.isArray(e))return e.map(r=>Fs(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(tt(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(ve.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(w.Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(zc(e))return{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:w.Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?Ls(e):e}function zc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Ls(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ns);let t={};for(let r of Object.keys(e))t[r]=Ns(e[r]);return t}function Ns(e){return typeof e=="bigint"?e.toString():Ls(e)}var Yc=/^(\s*alter\s)/i,Bs=Y("prisma:client");function Hn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Yc.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 Kn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Fr(r))n=r.sql,i={values:yt(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:yt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Ms(r),i={values:yt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Bs(`prisma.${e}(${n}, ${i.values})`):Bs(`prisma.${e}(${n})`),{query:n,parameters:i}},qs={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new le(t,r)}},Us={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};f();u();c();p();m();function zn(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=$s(r(s)):$s(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function $s(e){return typeof e.then=="function"?e:Promise.resolve(e)}f();u();c();p();m();var Zc=pn.split(".")[0],Xc={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Yn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${Zc}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??Xc}};function js(){return new Yn}f();u();c();p();m();function Vs(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}f();u();c();p();m();function Gs(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)}f();u();c();p();m();var Wr=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};f();u();c();p();m();var Js=Qe(Xi());f();u();c();p();m();function Hr(e){return typeof e.batchRequestIdx=="number"}f();u();c();p();m();function Qs(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Zn(e.query.arguments)),t.push(Zn(e.query.selection)),t.join("")}function Zn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Zn(n)})`:r}).join(" ")})`}f();u();c();p();m();var ep={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!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,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function Xn(e){return ep[e]}f();u();c();p();m();var Kr=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;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,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;iGe("bigint",r));case"bytes-array":return t.map(r=>Ge("bytes",r));case"decimal-array":return t.map(r=>Ge("decimal",r));case"datetime-array":return t.map(r=>Ge("datetime",r));case"date-array":return t.map(r=>Ge("date",r));case"time-array":return t.map(r=>Ge("time",r));default:return t}}function ei(e){let t=[],r=tp(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),d=n.some(h=>Xn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:np(o),containsWrite:d,customDataProxyFetch:i})).map((h,v)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[v],h)}catch(S){return S}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ws(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Xn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Qs(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,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}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,modelName:s,globalOmit:a}){if(rp(t),ip(t,i))throw t;if(t instanceof oe&&op(t)){let d=Hs(t.meta);Dr({args:o,errors:[d],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=vr({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let d=s?{modelName:s,...t.meta}:t.meta;throw new oe(l,{code:t.code,clientVersion:this.client._clientVersion,meta:d,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new Re(l,this.client._clientVersion);if(t instanceof se)throw new se(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof Q)throw new Q(l,this.client._clientVersion);if(t instanceof Re)throw new Re(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Js.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(d=>d!=="select"&&d!=="include"),a=Nn(o,s),l=i==="queryRaw"?ei(a):Ct(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function np(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ws(e)};xe(e,"Unknown transaction kind")}}function Ws(e){return{id:e.id,payload:e.payload}}function ip(e,t){return Hr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function op(e){return e.code==="P2009"||e.code==="P2012"}function Hs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Hs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}f();u();c();p();m();var Ks="6.7.0";var zs=Ks;f();u();c();p();m();var ta=Qe(Pn());f();u();c();p();m();var q=class extends Error{constructor(t){super(t+` +Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};N(q,"PrismaClientConstructorValidationError");var Ys=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Zs=["pretty","colorless","minimal"],Xs=["info","query","warn","error"],ap={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`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=wt(r,t)||` Available datasources: ${t.join(", ")}`;throw new q(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`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 q(`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 q(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&Ye(t.generator)==="client")throw new q('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Jr(t).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ye(t.generator)==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`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 q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Zs.includes(e)){let t=wt(e,Zs);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Xs.includes(r)){let n=wt(r,Xs);throw new q(`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=wt(i,o);throw new q(`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 q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new q('"omit" option is expected to be an object.');if(e===null)throw new q('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=up(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(d=>d.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new q(cp(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=wt(r,t);throw new q(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ra(e,t){for(let[r,n]of Object.entries(e)){if(!Ys.includes(r)){let i=wt(r,Ys);throw new q(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}ap[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function wt(e,t){if(t.length===0||typeof e!="string")return"";let r=lp(e,t);return r?` Did you mean "${r}"?`:""}function lp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ta.default)(e,i)}));r.sort((i,o)=>i.distanceDe(n)===t);if(r)return e[r]}function cp(e,t){let r=lt(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Or(r,"colorless");return`Error validating "omit" option: + +${i} + +${n}`}f();u();c();p();m();function na(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{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=d=>{o||(o=!0,r(d))};for(let d=0;d{n[d]=g,a()},g=>{if(!Hr(g)){l(g);return}g.batchRequestIdx===d?l(g):(i||(i=g),a())})})}var Ne=Y("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var pp={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},mp=Symbol.for("prisma.client.transaction.id"),fp={id:0,nextId(){return++this.id}};function dp(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Wr;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=zn();constructor(n){e=n?.__internal?.configOverride?.(e)??e,Ps(e),n&&ra(n,e);let i=new Lr().on("error",()=>{});this._extensions=ut.empty(),this._previewFeatures=Jr(e),this._clientVersion=e.clientVersion??zs,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=js();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&cr.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&cr.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new Q(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new Q("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let l=n??{},d=l.__internal??{},g=d.debug===!0;g&&Y.enable("prisma:client");let h=cr.resolve(e.dirname,e.relativePath);qi.existsSync(h)||(h=e.dirname),Ne("dirname",e.dirname),Ne("relativePath",e.relativePath),Ne("cwd",h);let v=d.engine||{};if(l.errorFormat?this._errorFormat=l.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:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:v.allowTriggerPanic,prismaPath:v.binaryPath??void 0,engineEndpoint:v.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Gs(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(S=>typeof S=="string"?S==="query":S.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:vs(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:mt,getBatchRequestPayload:Ur,prismaGraphQLToJSError:$r,PrismaClientUnknownRequestError:se,PrismaClientInitializationError:Q,PrismaClientKnownRequestError:oe,debug:Y("prisma:client:accelerateEngine"),engineVersion:oa.version,clientVersion:e.clientVersion}},Ne("clientVersion",e.clientVersion),this._engine=Os(e,this._engineConfig),this._requestHandler=new zr(this,i),l.log)for(let S of l.log){let A=typeof S=="string"?S:S.emit==="stdout"?S.level:null;A&&this.$on(A,R=>{vt.log(`${vt.tags[A]??""}`,R.message||R.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=$t(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$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{Li()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Kn({clientMethod:i,activeProvider:a}),callsite:_e(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ia(n,i);return Hn(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=>(Hn(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:Ds,callsite:_e(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Kn({clientMethod:i,activeProvider:a}),callsite:_e(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ia(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})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new X("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=fp.nextId(),s=Vs(n.length),a=n.map((l,d)=>{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 g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:d,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return na(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let d={kind:"itx",...a};l=await n(this._createItxClient(d)),await this._engine.transaction("commit",o,a)}catch(d){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),d}return l}_createItxClient(n){return pe($t(pe(as(this),[ee("_appliedParent",()=>this._appliedParent._createItxClient(n)),ee("_createPrismaPromise",()=>zn(n)),ee(mp,()=>n.id)])),[ct(ms)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}: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??pp,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 d=>{let g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,D=>g(d,M=>(D?.end(),l(M))));let{runInTransaction:h,args:v,...S}=d,A={...n,...S};v&&(A.args=i.middlewareArgsToRequestArgs(v)),n.transaction!==void 0&&h===!1&&delete A.transaction;let R=await hs(this,A);return A.model?ps({result:R,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):R};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:d,transaction:g,unpacker:h,otelParentCtx:v,customDataProxyFetch:S}){try{n=d?d(n):n;let A={name:"serialize"},R=this._tracingHelper.runInChildSpan(A,()=>In({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return Y.enabled("prisma:client")&&(Ne("Prisma Client call:"),Ne(`prisma.${i}(${Yo(n)})`),Ne("Generated request:"),Ne(JSON.stringify(R,null,2)+` +`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:R,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:v,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:S})}catch(A){throw A.clientVersion=this._clientVersion,A}}$metrics=new Bt(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=ls}return t}function ia(e,t){return gp(e)?[new le(e,t),qs]:[e,Us]}function gp(e){return Array.isArray(e)&&Array.isArray(e.raw)}f();u();c();p();m();var hp=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function yp(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!hp.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}f();u();c();p();m();var export_warnEnvConflicts=void 0;export{Pr as DMMF,Y as Debug,ve as Decimal,Pi as Extensions,Bt as MetricsClient,Q as PrismaClientInitializationError,oe as PrismaClientKnownRequestError,Re as PrismaClientRustPanicError,se as PrismaClientUnknownRequestError,X as PrismaClientValidationError,Ti as Public,le as Sql,Hu as createParam,ic as defineDmmfProperty,Ct as deserializeJsonResponse,ei as deserializeRawResult,fu as dmmfToRuntimeDataModel,uc as empty,dp as getPrismaClient,qn as getRuntime,lc as join,yp as makeStrictEnum,sc as makeTypedQueryFactory,Cn as objectEnumValues,Wo as raw,In as serializeJsonQuery,Sn as skip,Ho as sqltag,export_warnEnvConflicts as warnEnvConflicts,mr as warnOnce}; +//# sourceMappingURL=edge-esm.js.map diff --git a/src/generated/prisma/runtime/edge.js b/src/generated/prisma/runtime/edge.js new file mode 100644 index 0000000..ea23f7f --- /dev/null +++ b/src/generated/prisma/runtime/edge.js @@ -0,0 +1,34 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ +"use strict";var ha=Object.create;var ar=Object.defineProperty;var ya=Object.getOwnPropertyDescriptor;var wa=Object.getOwnPropertyNames;var Ea=Object.getPrototypeOf,ba=Object.prototype.hasOwnProperty;var me=(e,t)=>()=>(e&&(t=e(e=0)),t);var Fe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pt=(e,t)=>{for(var r in t)ar(e,r,{get:t[r],enumerable:!0})},oi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wa(t))!ba.call(e,i)&&i!==r&&ar(e,i,{get:()=>t[i],enumerable:!(n=ya(t,i))||n.enumerable});return e};var Qe=(e,t,r)=>(r=e!=null?ha(Ea(e)):{},oi(t||!e||!e.__esModule?ar(r,"default",{value:e,enumerable:!0}):r,e)),xa=e=>oi(ar({},"__esModule",{value:!0}),e);var y,u=me(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var b,c=me(()=>{"use strict";b=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,p=me(()=>{"use strict";E=()=>{};E.prototype=E});var m=me(()=>{"use strict"});var Ti=Fe(Ke=>{"use strict";f();u();c();p();m();var ci=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pa=ci(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var D=A.indexOf("=");D===-1&&(D=R);var M=D===R?0:4-D%4;return[D,M]}function l(A){var R=a(A),D=R[0],M=R[1];return(D+M)*3/4-M}function d(A,R,D){return(R+D)*3/4-D}function g(A){var R,D=a(A),M=D[0],B=D[1],k=new n(d(A,M,B)),F=0,ae=B>0?M-4:M,G;for(G=0;G>16&255,k[F++]=R>>8&255,k[F++]=R&255;return B===2&&(R=r[A.charCodeAt(G)]<<2|r[A.charCodeAt(G+1)]>>4,k[F++]=R&255),B===1&&(R=r[A.charCodeAt(G)]<<10|r[A.charCodeAt(G+1)]<<4|r[A.charCodeAt(G+2)]>>2,k[F++]=R>>8&255,k[F++]=R&255),k}function h(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function v(A,R,D){for(var M,B=[],k=R;kae?ae:F+k));return M===1?(R=A[D-1],B.push(t[R>>2]+t[R<<4&63]+"==")):M===2&&(R=(A[D-2]<<8)+A[D-1],B.push(t[R>>10]+t[R>>4&63]+t[R<<2&63]+"=")),B.join("")}}),va=ci(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,d=(1<>1,h=-7,v=n?o-1:0,S=n?-1:1,A=t[r+v];for(v+=S,s=A&(1<<-h)-1,A>>=-h,h+=l;h>0;s=s*256+t[r+v],v+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+v],v+=S,h-=8);if(s===0)s=1-g;else{if(s===d)return a?NaN:(A?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(A?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,d,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:s-1,R=i?1:-1,D=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+v>=1?r+=S/d:r+=S*Math.pow(2,1-v),r*d>=2&&(a++,d/=2),a+v>=h?(l=0,a=h):a+v>=1?(l=(r*d-1)*Math.pow(2,o),a=a+v):(l=r*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;t[n+A]=l&255,A+=R,l/=256,o-=8);for(a=a<0;t[n+A]=a&255,A+=R,a/=256,g-=8);t[n+A-R]|=D*128}}),an=Pa(),We=va(),si=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=T;Ke.SlowBuffer=ka;Ke.INSPECT_MAX_BYTES=50;var lr=2147483647;Ke.kMaxLength=lr;T.TYPED_ARRAY_SUPPORT=Ta();!T.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 Ta(){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{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function xe(e){if(e>lr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(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 cn(e)}return pi(e,t,r)}T.poolSize=8192;function pi(e,t,r){if(typeof e=="string")return Aa(e,t);if(ArrayBuffer.isView(e))return Ra(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(fe(e,ArrayBuffer)||e&&fe(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(e,SharedArrayBuffer)||e&&fe(e.buffer,SharedArrayBuffer)))return fi(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 T.from(n,t,r);let i=Sa(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.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)}T.from=function(e,t,r){return pi(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function mi(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 Ca(e,t,r){return mi(e),e<=0?xe(e):t!==void 0?typeof r=="string"?xe(e).fill(t,r):xe(e).fill(t):xe(e)}T.alloc=function(e,t,r){return Ca(e,t,r)};function cn(e){return mi(e),xe(e<0?0:pn(e)|0)}T.allocUnsafe=function(e){return cn(e)};T.allocUnsafeSlow=function(e){return cn(e)};function Aa(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=di(e,t)|0,n=xe(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function ln(e){let t=e.length<0?0:pn(e.length)|0,r=xe(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 ka(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(fe(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),fe(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.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 i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function di(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||fe(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 i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return un(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return vi(e).length;default:if(i)return n?-1:un(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=di;function Ia(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 Ua(this,t,r);case"utf8":case"utf-8":return hi(this,t,r);case"ascii":return Ba(this,t,r);case"latin1":case"binary":return qa(this,t,r);case"base64":return Fa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $a(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Le(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.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+=" ... "),""};si&&(T.prototype[si]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(fe(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.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),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),d=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,fn(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:ai(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ai(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ai(e,t,r,n,i){let o=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;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let d;if(i){let g=-1;for(d=r;ds&&(r=s-a),d=r;d>=0;d--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/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 i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return Oa(this,e,t,r);case"utf8":case"utf-8":return Da(this,e,t,r);case"ascii":case"latin1":case"binary":return Ma(this,e,t,r);case"base64":return _a(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Na(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fa(e,t,r){return t===0&&r===e.length?an.fromByteArray(e):an.fromByteArray(e.slice(t,r))}function hi(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,d,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],d=e[i+2],(l&192)===128&&(d&192)===128&&(h=(o&15)<<12|(l&63)<<6|d&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],d=e[i+2],g=e[i+3],(l&192)===128&&(d&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(d&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return La(n)}var li=4096;function La(e){let t=e.length;if(t<=li)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Re(function(e){e=e>>>0,He(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,He(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Re(function(e){e=e>>>0,He(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(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,He(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),We.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),We.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),We.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),We.read(this,e,!1,52,8)};function te(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.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;te(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;te(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||te(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};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||te(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 yi(e,t,r,n,i){Pi(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;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 wi(e,t,r,n,i){Pi(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;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}T.prototype.writeBigUInt64LE=Re(function(e,t=0){return yi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Re(function(e,t=0){return wi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);te(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);te(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||te(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||te(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};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||te(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};T.prototype.writeBigInt64LE=Re(function(e,t=0){return yi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Re(function(e,t=0){return wi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ei(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function bi(e,t,r,n,i){return t=+t,r=r>>>0,i||Ei(e,t,r,4,34028234663852886e22,-34028234663852886e22),We.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return bi(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return bi(this,e,t,!1,r)};function xi(e,t,r,n,i){return t=+t,r=r>>>0,i||Ei(e,t,r,8,17976931348623157e292,-17976931348623157e292),We.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return xi(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return xi(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.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 i;if(typeof e=="number")for(i=t;i2**32?i=ui(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=ui(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function ui(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 ja(e,t,r){He(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&vt(t,e.length-(r+1))}function Pi(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Je.ERR_OUT_OF_RANGE("value",a,e)}ja(n,i,o)}function He(e,t){if(typeof e!="number")throw new Je.ERR_INVALID_ARG_TYPE(t,"number",e)}function vt(e,t,r){throw Math.floor(e)!==e?(He(e,r),new Je.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Je.ERR_BUFFER_OUT_OF_BOUNDS:new Je.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Va=/[^+/0-9A-Za-z-_]/g;function Ga(e){if(e=e.split("=")[0],e=e.trim().replace(Va,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function un(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Qa(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function vi(e){return an.toByteArray(Ga(e))}function ur(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function fe(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function fn(e){return e!==e}var Wa=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Re(e){return typeof BigInt>"u"?Ha:e}function Ha(){throw new Error("BigInt not supported")}});var w,f=me(()=>{"use strict";w=Qe(Ti())});function el(){return!1}function $i(){return{dev:0,ino:0,mode:0,nlink:0,uid:0,gid:0,rdev:0,size:0,blksize:0,blocks:0,atimeMs:0,mtimeMs:0,ctimeMs:0,birthtimeMs:0,atime:new Date,mtime:new Date,ctime:new Date,birthtime:new Date}}function tl(){return $i()}function rl(){return[]}function nl(e){e(null,[])}function il(){return""}function ol(){return""}function sl(){}function al(){}function ll(){}function ul(){}function cl(){}function pl(){}var ml,fl,ji,Vi=me(()=>{"use strict";f();u();c();p();m();ml={},fl={existsSync:el,lstatSync:$i,statSync:tl,readdirSync:rl,readdir:nl,readlinkSync:il,realpathSync:ol,chmodSync:sl,renameSync:al,mkdirSync:ll,rmdirSync:ul,rmSync:cl,unlinkSync:pl,promises:ml},ji=fl});function dl(...e){return e.join("/")}function gl(...e){return e.join("/")}function hl(e){let t=Gi(e),r=Qi(e),[n,i]=t.split(".");return{root:"/",dir:r,base:t,ext:i,name:n}}function Gi(e){let t=e.split("/");return t[t.length-1]}function Qi(e){return e.split("/").slice(0,-1).join("/")}var Ji,yl,wl,fr,Wi=me(()=>{"use strict";f();u();c();p();m();Ji="/",yl={sep:Ji},wl={basename:Gi,dirname:Qi,join:gl,parse:hl,posix:yl,resolve:dl,sep:Ji},fr=wl});var Hi=Fe((uf,El)=>{El.exports={name:"@prisma/internals",version:"6.7.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek ",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-engine-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Yi=Fe((Sf,zi)=>{"use strict";f();u();c();p();m();zi.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 eo=Fe((Uf,Xi)=>{"use strict";f();u();c();p();m();Xi.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 ro=Fe((Jf,to)=>{"use strict";f();u();c();p();m();var Rl=eo();to.exports=e=>typeof e=="string"?e.replace(Rl(),""):e});var kn=Fe((_y,Po)=>{"use strict";f();u();c();p();m();Po.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;s{"use strict";f();u();c();p();m()});var So=me(()=>{"use strict";f();u();c();p();m()});var Zo=Fe((r1,fc)=>{fc.exports={name:"@prisma/engines-version",version:"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"3cff47a7f5d65c3ea74883f1d736e41d68ce91ed"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var $r,Xo=me(()=>{"use strict";f();u();c();p();m();$r=class{events={};on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var bp={};Pt(bp,{DMMF:()=>Ot,Debug:()=>K,Decimal:()=>he,Extensions:()=>dn,MetricsClient:()=>pt,PrismaClientInitializationError:()=>Q,PrismaClientKnownRequestError:()=>re,PrismaClientRustPanicError:()=>ve,PrismaClientUnknownRequestError:()=>ne,PrismaClientValidationError:()=>Z,Public:()=>gn,Sql:()=>oe,createParam:()=>Go,defineDmmfProperty:()=>zo,deserializeJsonResponse:()=>tt,deserializeRawResult:()=>tn,dmmfToRuntimeDataModel:()=>xo,empty:()=>ts,getPrismaClient:()=>fa,getRuntime:()=>Hr,join:()=>es,makeStrictEnum:()=>da,makeTypedQueryFactory:()=>Yo,objectEnumValues:()=>Or,raw:()=>Bn,serializeJsonQuery:()=>Br,skip:()=>Lr,sqltag:()=>qn,warnEnvConflicts:()=>void 0,warnOnce:()=>Rt});module.exports=xa(bp);f();u();c();p();m();var dn={};Pt(dn,{defineExtension:()=>Ci,getExtensionContext:()=>Ai});f();u();c();p();m();f();u();c();p();m();function Ci(e){return typeof e=="function"?e:t=>t.$extends(e)}f();u();c();p();m();function Ai(e){return e}var gn={};Pt(gn,{validator:()=>Ri});f();u();c();p();m();f();u();c();p();m();function Ri(...e){return t=>t}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();var hn,Si,ki,Ii,Oi=!0;typeof y<"u"&&({FORCE_COLOR:hn,NODE_DISABLE_COLORS:Si,NO_COLOR:ki,TERM:Ii}=y.env||{},Oi=y.stdout&&y.stdout.isTTY);var Ka={enabled:!Si&&ki==null&&Ii!=="dumb"&&(hn!=null&&hn!=="0"||Oi)};function j(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ka.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var pm=j(0,0),cr=j(1,22),pr=j(2,22),mm=j(3,23),Di=j(4,24),fm=j(7,27),dm=j(8,28),gm=j(9,29),hm=j(30,39),ze=j(31,39),Mi=j(32,39),_i=j(33,39),Ni=j(34,39),ym=j(35,39),Fi=j(36,39),wm=j(37,39),Li=j(90,39),Em=j(90,39),bm=j(40,49),xm=j(41,49),Pm=j(42,49),vm=j(43,49),Tm=j(44,49),Cm=j(45,49),Am=j(46,49),Rm=j(47,49);f();u();c();p();m();var za=100,Bi=["green","yellow","blue","magenta","cyan","red"],mr=[],qi=Date.now(),Ya=0,yn=typeof y<"u"?y.env:{};globalThis.DEBUG??=yn.DEBUG??"";globalThis.DEBUG_COLORS??=yn.DEBUG_COLORS?yn.DEBUG_COLORS==="true":!0;var Tt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function Za(e){let t={color:Bi[Ya++%Bi.length],enabled:Tt.enabled(e),namespace:e,log:Tt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&mr.push([o,...n]),mr.length>za&&mr.shift(),Tt.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:Xa(g)),d=`+${Date.now()-qi}ms`;qi=Date.now(),a(o,...l,d)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var K=new Proxy(Za,{get:(e,t)=>Tt[t],set:(e,t,r)=>Tt[t]=r});function Xa(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Ui(){mr.length=0}f();u();c();p();m();f();u();c();p();m();var bl=Hi(),wn=bl.version;f();u();c();p();m();function Ye(e){let t=xl();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":Pl(e))}function xl(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function Pl(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}f();u();c();p();m();var Ki="prisma+postgres",dr=`${Ki}:`;function En(e){return e?.startsWith(`${dr}//`)??!1}var At={};Pt(At,{error:()=>Cl,info:()=>Tl,log:()=>vl,query:()=>Al,should:()=>Zi,tags:()=>Ct,warn:()=>bn});f();u();c();p();m();var Ct={error:ze("prisma:error"),warn:_i("prisma:warn"),info:Fi("prisma:info"),query:Ni("prisma:query")},Zi={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function vl(...e){console.log(...e)}function bn(e,...t){Zi.warn()&&console.warn(`${Ct.warn} ${e}`,...t)}function Tl(e,...t){console.info(`${Ct.info} ${e}`,...t)}function Cl(e,...t){console.error(`${Ct.error} ${e}`,...t)}function Al(e,...t){console.log(`${Ct.query} ${e}`,...t)}f();u();c();p();m();function Pe(e,t){throw new Error(t)}f();u();c();p();m();function xn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}f();u();c();p();m();function Ze(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}f();u();c();p();m();function Pn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{no.has(e)||(no.add(e),bn(t,...r))};var Q=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};N(Q,"PrismaClientInitializationError");f();u();c();p();m();var re=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};N(re,"PrismaClientKnownRequestError");f();u();c();p();m();var ve=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};N(ve,"PrismaClientRustPanicError");f();u();c();p();m();var ne=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};N(ne,"PrismaClientUnknownRequestError");f();u();c();p();m();var Z=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};N(Z,"PrismaClientValidationError");f();u();c();p();m();f();u();c();p();m();var Xe=9e15,Oe=1e9,vn="0123456789abcdef",yr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",wr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Tn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Xe,maxE:Xe,crypto:!1},lo,Te,_=!0,br="[DecimalError] ",Ie=br+"Invalid argument: ",uo=br+"Precision limit exceeded",co=br+"crypto unavailable",po="[object Decimal]",X=Math.floor,J=Math.pow,Sl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,kl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Il=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,mo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ce=1e7,O=7,Ol=9007199254740991,Dl=yr.length-1,Cn=wr.length-1,C={toStringTag:po};C.absoluteValue=C.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),I(e)};C.ceil=function(){return I(new this.constructor(this),this.e+1,2)};C.clampedTo=C.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(Ie+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};C.comparedTo=C.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,d=e.s;if(!s||!a)return!l||!d?NaN:l!==d?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-d:0;if(l!==d)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};C.cosine=C.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())+O,n.rounding=1,r=Ml(n,wo(n,r)),n.precision=e,n.rounding=t,I(Te==2||Te==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};C.cubeRoot=C.cbrt=function(){var e,t,r,n,i,o,s,a,l,d,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(_=!1,o=g.s*J(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=z(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=J(r,1/3),e=X((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 h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),d=l.plus(g),n=U(d.plus(g).times(a),d.plus(l),s+2,1),z(a.d).slice(0,s)===(r=z(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(I(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(I(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return _=!0,I(n,e,h.rounding,t)};C.decimalPlaces=C.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-X(this.e/O))*O,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};C.dividedBy=C.div=function(e){return U(this,new this.constructor(e))};C.dividedToIntegerBy=C.divToInt=function(e){var t=this,r=t.constructor;return I(U(t,new r(e),0,1,1),r.precision,r.rounding)};C.equals=C.eq=function(e){return this.cmp(e)===0};C.floor=function(){return I(new this.constructor(this),this.e+1,3)};C.greaterThan=C.gt=function(e){return this.cmp(e)>0};C.greaterThanOrEqualTo=C.gte=function(e){var t=this.cmp(e);return t==1||t===0};C.hyperbolicCosine=C.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/Pr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=et(s,1,o.times(t),new s(1),!0);for(var l,d=e,g=new s(8);d--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return I(o,s.precision=r,s.rounding=n,!0)};C.hyperbolicSine=C.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=et(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Pr(5,e)),i=et(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),d=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(d))))}return o.precision=t,o.rounding=r,I(i,t,r,!0)};C.hyperbolicTangent=C.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,U(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};C.inverseCosine=C.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?de(t,n,i):new t(0):new t(NaN):e.isZero()?de(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};C.inverseHyperbolicCosine=C.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,_=!1,r=r.times(r).minus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};C.inverseHyperbolicSine=C.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,_=!1,r=r.times(r).plus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln())};C.inverseHyperbolicTangent=C.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?I(new o(i),e,t,!0):(o.precision=r=n-i.e,i=U(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)};C.inverseSine=C.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=de(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)))};C.inverseTangent=C.atan=function(){var e,t,r,n,i,o,s,a,l,d=this,g=d.constructor,h=g.precision,v=g.rounding;if(d.isFinite()){if(d.isZero())return new g(d);if(d.abs().eq(1)&&h+4<=Cn)return s=de(g,h+4,v).times(.25),s.s=d.s,s}else{if(!d.s)return new g(NaN);if(h+4<=Cn)return s=de(g,h+4,v).times(.5),s.s=d.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/O+2|0),e=r;e;--e)d=d.div(d.times(d).plus(1).sqrt().plus(1));for(_=!1,t=Math.ceil(a/O),n=1,l=d.times(d),s=new g(d),i=d;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};C.isNaN=function(){return!this.s};C.isNegative=C.isNeg=function(){return this.s<0};C.isPositive=C.isPos=function(){return this.s>0};C.isZero=function(){return!!this.d&&this.d[0]===0};C.lessThan=C.lt=function(e){return this.cmp(e)<0};C.lessThanOrEqualTo=C.lte=function(e){return this.cmp(e)<1};C.logarithm=C.log=function(e){var t,r,n,i,o,s,a,l,d=this,g=d.constructor,h=g.precision,v=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=d.d,d.s<0||!r||!r[0]||d.eq(1))return new g(r&&!r[0]?-1/0:d.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(_=!1,a=h+S,s=ke(d,a),n=t?Er(g,a+10):ke(e,a),l=U(s,n,a,1),St(l.d,i=h,v))do if(a+=10,s=ke(d,a),n=t?Er(g,a+10):ke(e,a),l=U(s,n,a,1),!o){+z(l.d).slice(i+1,i+15)+1==1e14&&(l=I(l,h+1,0));break}while(St(l.d,i+=10,v));return _=!0,I(l,h,v)};C.minus=C.sub=function(e){var t,r,n,i,o,s,a,l,d,g,h,v,S=this,A=S.constructor;if(e=new A(e),!S.d||!e.d)return!S.s||!e.s?e=new A(NaN):S.d?e.s=-e.s:e=new A(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(d=S.d,v=e.d,a=A.precision,l=A.rounding,!d[0]||!v[0]){if(v[0])e.s=-e.s;else if(d[0])e=new A(S);else return new A(l===3?-0:0);return _?I(e,a,l):e}if(r=X(e.e/O),g=X(S.e/O),d=d.slice(),o=g-r,o){for(h=o<0,h?(t=d,o=-o,s=v.length):(t=v,r=g,s=d.length),n=Math.max(Math.ceil(a/O),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=d.length,s=v.length,h=n0;--n)d[s++]=0;for(n=v.length;n>o;){if(d[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=d.length,i=g.length,s-i<0&&(i=s,r=g,g=d,d=r),t=0;i;)t=(d[--i]=d[i]+g[i]+t)/ce|0,d[i]%=ce;for(t&&(d.unshift(t),++n),s=d.length;d[--s]==0;)d.pop();return e.d=d,e.e=xr(d,n),_?I(e,a,l):e};C.precision=C.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ie+e);return r.d?(t=fo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};C.round=function(){var e=this,t=e.constructor;return I(new t(e),e.e+1,t.rounding)};C.sine=C.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())+O,n.rounding=1,r=Nl(n,wo(n,r)),n.precision=e,n.rounding=t,I(Te>2?r.neg():r,e,t,!0)):new n(NaN)};C.squareRoot=C.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,d=s.s,g=s.constructor;if(d!==1||!a||!a[0])return new g(!d||d<0&&(!a||a[0])?NaN:a?s:1/0);for(_=!1,d=Math.sqrt(+s),d==0||d==1/0?(t=z(a),(t.length+l)%2==0&&(t+="0"),d=Math.sqrt(t),l=X((l+1)/2)-(l<0||l%2),d==1/0?t="5e"+l:(t=d.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new g(t)):n=new g(d.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus(U(s,o,r+2,1)).times(.5),z(o.d).slice(0,r)===(t=z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(I(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")&&(I(n,l+1,1),e=!n.times(n).eq(s));break}return _=!0,I(n,l,g.rounding,e)};C.tangent=C.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=U(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,I(Te==2||Te==4?r.neg():r,e,t,!0)):new n(NaN)};C.times=C.mul=function(e){var t,r,n,i,o,s,a,l,d,g=this,h=g.constructor,v=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!v||!v[0]||!S||!S[0])return new h(!e.s||v&&!v[0]&&!S||S&&!S[0]&&!v?NaN:!v||!S?e.s/0:e.s*0);for(r=X(g.e/O)+X(e.e/O),l=v.length,d=S.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+S[n]*v[i-n-1]+t,o[i--]=a%ce|0,t=a/ce|0;o[i]=(o[i]+t)%ce|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=xr(o,r),_?I(e,h.precision,h.rounding):e};C.toBinary=function(e,t){return Rn(this,2,e,t)};C.toDecimalPlaces=C.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ie(e,0,Oe),t===void 0?t=n.rounding:ie(t,0,8),I(r,e+r.e+1,t))};C.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ge(n,!0):(ie(e,0,Oe),t===void 0?t=i.rounding:ie(t,0,8),n=I(new i(n),e+1,t),r=ge(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=ge(i):(ie(e,0,Oe),t===void 0?t=o.rounding:ie(t,0,8),n=I(new o(i),e+i.e+1,t),r=ge(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};C.toFraction=function(e){var t,r,n,i,o,s,a,l,d,g,h,v,S=this,A=S.d,R=S.constructor;if(!A)return new R(S);if(d=r=new R(1),n=l=new R(0),t=new R(n),o=t.e=fo(A)-S.e-1,s=o%O,t.d[0]=J(10,s<0?O+s:s),e==null)e=o>0?t:d;else{if(a=new R(e),!a.isInt()||a.lt(d))throw Error(Ie+a);e=a.gt(t)?o>0?t:d:a}for(_=!1,a=new R(z(A)),g=R.precision,R.precision=o=A.length*O*2;h=U(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=d,d=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=U(e.minus(r),n,0,1,1),l=l.plus(i.times(d)),r=r.plus(i.times(n)),l.s=d.s=S.s,v=U(d,n,o,1).minus(S).abs().cmp(U(l,r,o,1).minus(S).abs())<1?[d,n]:[l,r],R.precision=g,_=!0,v};C.toHexadecimal=C.toHex=function(e,t){return Rn(this,16,e,t)};C.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:ie(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]?(_=!1,r=U(r,e,0,t,1).times(e),_=!0,I(r)):(e.s=r.s,r=e),r};C.toNumber=function(){return+this};C.toOctal=function(e,t){return Rn(this,8,e,t)};C.toPower=C.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,d=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(J(+a,d));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return I(a,n,o);if(t=X(e.e/O),t>=e.d.length-1&&(r=d<0?-d:d)<=Ol)return i=go(l,a,r,n),e.s<0?new l(1).div(i):I(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(_=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=An(e.times(ke(a,n+r)),n),i.d&&(i=I(i,n+5,1),St(i.d,n,o)&&(t=n+10,i=I(An(e.times(ke(a,t+r)),t),t+5,1),+z(i.d).slice(n+1,n+15)+1==1e14&&(i=I(i,n+1,0)))),i.s=s,_=!0,l.rounding=o,I(i,n,o))};C.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ge(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ie(e,1,Oe),t===void 0?t=i.rounding:ie(t,0,8),n=I(new i(n),e,t),r=ge(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toSignificantDigits=C.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ie(e,1,Oe),t===void 0?t=n.rounding:ie(t,0,8)),I(new n(r),e,t)};C.toString=function(){var e=this,t=e.constructor,r=ge(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};C.truncated=C.trunc=function(){return I(new this.constructor(this),this.e+1,1)};C.valueOf=C.toJSON=function(){var e=this,t=e.constructor,r=ge(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Ie+e)}function St(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=O,i=0):(i=Math.ceil((t+1)/O),t%=O),o=J(10,O-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 gr(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 Ml(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Pr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=et(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 U=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 d,g,h,v,S,A,R,D,M,B,k,F,ae,G,nn,ir,xt,on,ue,or,sr=n.constructor,sn=n.s==i.s?1:-1,Y=n.d,$=i.d;if(!Y||!Y[0]||!$||!$[0])return new sr(!n.s||!i.s||(Y?$&&Y[0]==$[0]:!$)?NaN:Y&&Y[0]==0||!$?sn*0:sn/0);for(l?(S=1,g=n.e-i.e):(l=ce,S=O,g=X(n.e/S)-X(i.e/S)),ue=$.length,xt=Y.length,M=new sr(sn),B=M.d=[],h=0;$[h]==(Y[h]||0);h++);if($[h]>(Y[h]||0)&&g--,o==null?(G=o=sr.precision,s=sr.rounding):a?G=o+(n.e-i.e)+1:G=o,G<0)B.push(1),A=!0;else{if(G=G/S+2|0,h=0,ue==1){for(v=0,$=$[0],G++;(h1&&($=e($,v,l),Y=e(Y,v,l),ue=$.length,xt=Y.length),ir=ue,k=Y.slice(0,ue),F=k.length;F=l/2&&++on;do v=0,d=t($,k,ue,F),d<0?(ae=k[0],ue!=F&&(ae=ae*l+(k[1]||0)),v=ae/on|0,v>1?(v>=l&&(v=l-1),R=e($,v,l),D=R.length,F=k.length,d=t(R,k,D,F),d==1&&(v--,r(R,ue=10;v/=10)h++;M.e=h+g*S-1,I(M,a?o+M.e+1:o,s,A)}return M}}();function I(e,t,r,n){var i,o,s,a,l,d,g,h,v,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=O,s=t,g=h[v=0],l=g/J(10,i-s-1)%10|0;else if(v=Math.ceil((o+1)/O),a=h.length,v>=a)if(n){for(;a++<=v;)h.push(0);g=l=0,i=1,o%=O,s=o-O+1}else break e;else{for(g=a=h[v],i=1;a>=10;a/=10)i++;o%=O,s=o-O+i,l=s<0?0:g/J(10,i-s-1)%10|0}if(n=n||t<0||h[v+1]!==void 0||(s<0?g:g%J(10,i-s-1)),d=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?g/J(10,i-s):0:h[v-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,d?(t-=e.e+1,h[0]=J(10,(O-t%O)%O),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=v,a=1,v--):(h.length=v+1,a=J(10,O-o),h[v]=s>0?(g/J(10,i-s)%J(10,s)|0)*a:0),d)for(;;)if(v==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==ce&&(h[0]=1));break}else{if(h[v]+=a,h[v]!=ce)break;h[v--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return _&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Se(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Se(-i-1)+o,r&&(n=r-s)>0&&(o+=Se(n))):i>=s?(o+=Se(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Se(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Se(n))),o}function xr(e,t){var r=e[0];for(t*=O;r>=10;r/=10)t++;return t}function Er(e,t,r){if(t>Dl)throw _=!0,r&&(e.precision=r),Error(uo);return I(new e(yr),t,1,!0)}function de(e,t,r){if(t>Cn)throw Error(uo);return I(new e(wr),t,r,!0)}function fo(e){var t=e.length-1,r=t*O+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 Se(e){for(var t="";e--;)t+="0";return t}function go(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/O+4);for(_=!1;;){if(r%2&&(o=o.times(t),so(o.d,s)&&(i=!0)),r=X(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),so(t.d,s)}return _=!0,o}function oo(e){return e.d[e.d.length-1]&1}function ho(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s17)return new v(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(_=!1,l=A):l=t,a=new v(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(J(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new v(1),v.precision=l;;){if(o=I(o.times(e),l,1),r=r.times(++g),a=s.plus(U(o,r,l,1)),z(a.d).slice(0,l)===z(s.d).slice(0,l)){for(i=h;i--;)s=I(s.times(s),l,1);if(t==null)if(d<3&&St(s.d,l-n,S,d))v.precision=l+=10,r=o=a=new v(1),g=0,d++;else return I(s,v.precision=A,S,_=!0);else return v.precision=A,s}s=a}}function ke(e,t){var r,n,i,o,s,a,l,d,g,h,v,S=1,A=10,R=e,D=R.d,M=R.constructor,B=M.rounding,k=M.precision;if(R.s<0||!D||!D[0]||!R.e&&D[0]==1&&D.length==1)return new M(D&&!D[0]?-1/0:R.s!=1?NaN:D?0:R);if(t==null?(_=!1,g=k):g=t,M.precision=g+=A,r=z(D),n=r.charAt(0),Math.abs(o=R.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)R=R.times(e),r=z(R.d),n=r.charAt(0),S++;o=R.e,n>1?(R=new M("0."+r),o++):R=new M(n+"."+r.slice(1))}else return d=Er(M,g+2,k).times(o+""),R=ke(new M(n+"."+r.slice(1)),g-A).plus(d),M.precision=k,t==null?I(R,k,B,_=!0):R;for(h=R,l=s=R=U(R.minus(1),R.plus(1),g,1),v=I(R.times(R),g,1),i=3;;){if(s=I(s.times(v),g,1),d=l.plus(U(s,new M(i),g,1)),z(d.d).slice(0,g)===z(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(Er(M,g+2,k).times(o+""))),l=U(l,new M(S),g,1),t==null)if(St(l.d,g-A,B,a))M.precision=g+=A,d=s=R=U(h.minus(1),h.plus(1),g,1),v=I(R.times(R),g,1),i=a=1;else return I(l,M.precision=k,B,_=!0);else return M.precision=k,l;l=d,i+=2}}function yo(e){return String(e.s*e.s/0)}function hr(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)%O,r<0&&(n+=O),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),mo.test(t))return hr(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(kl.test(t))r=16,t=t.toLowerCase();else if(Sl.test(t))r=2;else if(Il.test(t))r=8;else throw Error(Ie+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=go(n,new n(r),o,o*2)),d=gr(t,r,ce),g=d.length-1,o=g;d[o]===0;--o)d.pop();return o<0?new n(e.s*0):(e.e=xr(d,g),e.d=d,_=!1,s&&(e=U(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?J(2,l):Be.pow(2,l))),_=!0,e)}function Nl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:et(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Pr(5,r)),t=et(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 et(e,t,r,n,i){var o,s,a,l,d=1,g=e.precision,h=Math.ceil(g/O);for(_=!1,l=r.times(r),a=new e(n);;){if(s=U(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=U(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,d++}return _=!0,s.d.length=h+1,s}function Pr(e,t){for(var r=e;--t;)r*=e;return r}function wo(e,t){var r,n=t.s<0,i=de(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Te=n?4:1,t;if(r=t.divToInt(i),r.isZero())Te=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Te=oo(r)?n?2:3:n?4:1,t;Te=oo(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Rn(e,t,r,n){var i,o,s,a,l,d,g,h,v,S=e.constructor,A=r!==void 0;if(A?(ie(r,1,Oe),n===void 0?n=S.rounding:ie(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=yo(e);else{for(g=ge(e),s=g.indexOf("."),A?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),v=new S(1),v.e=g.length-s,v.d=gr(ge(v),10,i),v.e=v.d.length),h=gr(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=A?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=U(e,v,r,n,0,i),h=e.d,o=e.e,d=lo),s=h[r],a=i/2,d=d||h[r+1]!==void 0,d=n<4?(s!==void 0||d)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||d||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,d)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=gr(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function Fl(e){return new this(e).abs()}function Ll(e){return new this(e).acos()}function Bl(e){return new this(e).acosh()}function ql(e,t){return new this(e).plus(t)}function Ul(e){return new this(e).asin()}function $l(e){return new this(e).asinh()}function jl(e){return new this(e).atan()}function Vl(e){return new this(e).atanh()}function Gl(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=de(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?de(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=de(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(U(e,t,o,1)),t=de(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(U(e,t,o,1)),r}function Ql(e){return new this(e).cbrt()}function Jl(e){return I(e=new this(e),e.e+1,2)}function Wl(e,t,r){return new this(e).clamp(t,r)}function Hl(e){if(!e||typeof e!="object")throw Error(br+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Oe,"rounding",0,8,"toExpNeg",-Xe,0,"toExpPos",0,Xe,"maxE",0,Xe,"minE",-Xe,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ie+r+": "+n);if(r="crypto",i&&(this[r]=Tn[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(co);else this[r]=!1;else throw Error(Ie+r+": "+n);return this}function Kl(e){return new this(e).cos()}function zl(e){return new this(e).cosh()}function Eo(e){var t,r,n;function i(o){var s,a,l,d=this;if(!(d instanceof i))return new i(o);if(d.constructor=i,ao(o)){d.s=o.s,_?!o.d||o.e>i.maxE?(d.e=NaN,d.d=null):o.e=10;a/=10)s++;_?s>i.maxE?(d.e=NaN,d.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(co);else for(;o=10;i/=10)n++;nIt,datamodelEnumToSchemaEnum:()=>vu});f();u();c();p();m();f();u();c();p();m();function vu(e){return{name:e.name,values:e.values.map(t=>t.name)}}f();u();c();p();m();var It=(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.updateManyAndReturn="updateManyAndReturn",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw",k))(It||{});var Tu=Qe(Yi());var Cu={red:ze,gray:Li,dim:pr,bold:cr,underline:Di,highlightSource:e=>e.highlight()},Au={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ru({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Su({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(ku(t))),i){a.push("");let d=[i.toString()];o&&(d.push(o),d.push(s.dim(")"))),a.push(d.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` +`)}function ku(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Tr(e){let t=e.showColors?Cu:Au,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Ru(e),Su(r,t)}f();u();c();p();m();var Io=Qe(kn());f();u();c();p();m();function Co(e,t,r){let n=Ao(e),i=Iu(n),o=Du(i);o?Cr(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Ao(e){return e.errors.flatMap(t=>t.kind==="Union"?Ao(t):[t])}function Iu(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:Ou(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Ou(e,t){return[...new Set(e.concat(t))]}function Du(e){return Pn(e,(t,r)=>{let n=vo(t),i=vo(r);return n!==i?n-i:To(t)-To(r)})}function vo(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function To(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}f();u();c();p();m();var le=class{constructor(t,r){this.name=t;this.value=r}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)}};f();u();c();p();m();f();u();c();p();m();So();f();u();c();p();m();var it=class{constructor(t=0,r){this.context=r;this.currentIndent=t}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=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}};Ro();f();u();c();p();m();f();u();c();p();m();var Ar=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};f();u();c();p();m();var Rr=e=>e,Sr={bold:Rr,red:Rr,green:Rr,dim:Rr,enabled:!1},ko={bold:cr,red:ze,green:Mi,dim:pr,enabled:!0},ot={write(e){e.writeLine(",")}};f();u();c();p();m();var we=class{constructor(t){this.contents=t}isUnderlined=!1;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)))})}};f();u();c();p();m();var Me=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var st=class extends Me{items=[];addItem(t){return this.items.push(new Ar(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new we("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(ot,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var at=class e extends Me{fields={};suggestions=[];addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof e?a=o.value.getField(s):o.value instanceof st&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let o=n.value.getFieldValue(i);if(!o||!(o instanceof e))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new we("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(ot,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};f();u();c();p();m();var H=class extends Me{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new we(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};f();u();c();p();m();var Dt=class{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(ot,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Cr(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Mu(e,t);break;case"IncludeOnScalar":_u(e,t);break;case"EmptySelection":Nu(e,t,r);break;case"UnknownSelectionField":qu(e,t);break;case"InvalidSelectionValue":Uu(e,t);break;case"UnknownArgument":$u(e,t);break;case"UnknownInputField":ju(e,t);break;case"RequiredArgumentMissing":Vu(e,t);break;case"InvalidArgumentType":Gu(e,t);break;case"InvalidArgumentValue":Qu(e,t);break;case"ValueTooLarge":Ju(e,t);break;case"SomeFieldsMissing":Wu(e,t);break;case"TooManyFieldsGiven":Hu(e,t);break;case"Union":Co(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Mu(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function _u(e,t){let[r,n]=Mt(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 le(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)}. ${_t(s)}`:a+=".",a+=` +Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Nu(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Fu(e,t,i);return}if(n.hasField("select")){Lu(e,t);return}}if(r?.[De(e.outputType.name)]){Bu(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Fu(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Lu(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Mo(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${_t(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Bu(e,t){let r=new Dt;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new le("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=Mt(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new at;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function qu(e,t){let r=_o(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":Mo(n,e.outputType);break;case"include":Ku(n,e.outputType);break;case"omit":zu(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(_t(n)),i.join(" ")})}function Uu(e,t){let r=_o(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function $u(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Yu(n,e.arguments)),t.addErrorMessage(i=>Oo(i,r,e.arguments.map(o=>o.name)))}function ju(e,t){let[r,n]=Mt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&No(o,e.inputType)}t.addErrorMessage(o=>Oo(o,n,e.inputType.fields.map(s=>s.name)))}function Oo(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Xu(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(_t(e)),n.join(" ")}function Vu(e,t){let r;t.addErrorMessage(l=>r?.value instanceof H&&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)?.asObject();if(!n)return;let[i,o]=Mt(e.argumentPath),s=new Dt,a=n.getDeepFieldValue(i)?.asObject();if(a)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 le(o,s).makeRequired())}else{let l=e.inputTypes.map(Do).join(" | ");a.addSuggestion(new le(o,l).makeRequired())}}function Do(e){return e.kind==="list"?`${Do(e.elementType)}[]`:e.name}function Gu(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=kr("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 Qu(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&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=kr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Ju(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof H&&(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 Wu(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&No(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")} ${kr("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(_t(i)),o.join(" ")})}function Hu(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(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 ${kr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Mo(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function Ku(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function zu(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function Yu(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function _o(e,t){let[r,n]=Mt(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function No(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Mt(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function _t({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function kr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Zu=3;function Xu(e,t){let r=1/0,n;for(let i of t){let o=(0,Io.default)(e,i);o>Zu||o`}};function lt(e){return e instanceof Nt}f();u();c();p();m();var Ir=Symbol(),On=new WeakMap,Ce=class{constructor(t){t===Ir?On.set(this,`Prisma.${this._getName()}`):On.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return On.get(this)}},Ft=class extends Ce{_getNamespace(){return"NullTypes"}},Lt=class extends Ft{#e};Dn(Lt,"DbNull");var Bt=class extends Ft{#e};Dn(Bt,"JsonNull");var qt=class extends Ft{#e};Dn(qt,"AnyNull");var Or={classes:{DbNull:Lt,JsonNull:Bt,AnyNull:qt},instances:{DbNull:new Lt(Ir),JsonNull:new Bt(Ir),AnyNull:new qt(Ir)}};function Dn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}f();u();c();p();m();var Fo=": ",Dr=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Fo.length}write(t){let r=new we(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Fo).write(this.value)}};var Mn=class{arguments;errorMessages=[];constructor(t){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 ut(e){return new Mn(Lo(e))}function Lo(e){let t=new at;for(let[r,n]of Object.entries(e)){let i=new Dr(r,Bo(n));t.addField(i)}return t}function Bo(e){if(typeof e=="string")return new H(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new H(String(e));if(typeof e=="bigint")return new H(`${e}n`);if(e===null)return new H("null");if(e===void 0)return new H("undefined");if(nt(e))return new H(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new H(`Buffer.alloc(${e.byteLength})`):new H(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=vr(e)?e.toISOString():"Invalid Date";return new H(`new Date("${t}")`)}return e instanceof Ce?new H(`Prisma.${e._getName()}`):lt(e)?new H(`prisma.${De(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?ec(e):typeof e=="object"?Lo(e):new H(Object.prototype.toString.call(e))}function ec(e){let t=new st;for(let r of e)t.addItem(Bo(r));return t}function Mr(e,t){let r=t==="pretty"?ko:Sr,n=e.renderAllMessages(r),i=new it(0,{colors:r}).write(e).toString();return{message:n,args:i}}function _r({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=ut(e);for(let h of t)Cr(h,a,s);let{message:l,args:d}=Mr(a,r),g=Tr({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:d});throw new Z(g,{clientVersion:o})}f();u();c();p();m();f();u();c();p();m();function Ee(e){return e.replace(/^./,t=>t.toLowerCase())}f();u();c();p();m();function Uo(e,t,r){let n=Ee(r);return!t.result||!(t.result.$allModels||t.result[n])?e:tc({...e,...qo(t.name,e,t.result.$allModels),...qo(t.name,e,t.result[n])})}function tc(e){let t=new ye,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 Ze(e,n=>({...n,needs:r(n.name,new Set)}))}function qo(e,t,r){return r?Ze(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:rc(t,o,i)})):{}}function rc(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function $o(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}function jo(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)delete r[i];return r}var Nr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new ye;modelExtensionsCache=new ye;queryCallbacksCache=new ye;clientExtensions=kt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=kt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Uo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Ee(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()}},ct=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Nr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Nr(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()??[]}};f();u();c();p();m();var Fr=class{constructor(t){this.name=t}};function Vo(e){return e instanceof Fr}function Go(e){return new Fr(e)}f();u();c();p();m();f();u();c();p();m();var Qo=Symbol(),Ut=class{constructor(t){if(t!==Qo)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Lr:t}},Lr=new Ut(Qo);function be(e){return e instanceof Ut}var nc={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},Jo="explicitly `undefined` values are not allowed";function Br({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=ct.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:d,globalOmit:g}){let h=new _n({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:d,globalOmit:g});return{modelName:e,action:nc[t],query:$t(r,h)}}function $t({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Ho(r,n),selection:ic(e,t,i,n)}}function ic(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),lc(e,n)):oc(n,t,r)}function oc(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&sc(n,t,e),ac(n,r,e),n}function sc(e,t,r){for(let[n,i]of Object.entries(t)){if(be(i))continue;let o=r.nestSelection(n);if(Nn(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){e[n]=$t(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=$t(i,o)}}function ac(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=jo(i,n);for(let[s,a]of Object.entries(o)){if(be(a))continue;Nn(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function lc(e,t){let r={},n=t.getComputedFields(),i=$o(e,n);for(let[o,s]of Object.entries(i)){if(be(s))continue;let a=t.nestSelection(o);Nn(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||be(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=$t({},a):r[o]=!0;continue}r[o]=$t(s,a)}}return r}function Wo(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(rt(e)){if(vr(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(Vo(e))return{$type:"Param",value:e.name};if(lt(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return uc(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:w.Buffer.from(r,n,i).toString("base64")}}if(cc(e))return e.values;if(nt(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Ce){if(e!==Or.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(pc(e))return e.toJSON();if(typeof e=="object")return Ho(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function Ho(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);be(i)||(i!==void 0?r[n]=Wo(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:Jo}))}return r}function uc(e,t){let r=[];for(let n=0;n({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.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)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[De(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:Pe(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};f();u();c();p();m();function Ko(e){if(!e._hasPreviewFlag("metrics"))throw new Z("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var pt=class{_client;constructor(t){this._client=t}prometheus(t){return Ko(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return Ko(this._client),this._client._engine.metrics({format:"json",...t})}};f();u();c();p();m();function zo(e,t){let r=kt(()=>mc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function mc(e){return{datamodel:{models:Fn(e.models),enums:Fn(e.enums),types:Fn(e.types)}}}function Fn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}f();u();c();p();m();var Ln=new WeakMap,qr="$$PrismaTypedSql",jt=class{constructor(t,r){Ln.set(this,{sql:t,values:r}),Object.defineProperty(this,qr,{value:qr})}get sql(){return Ln.get(this).sql}get values(){return Ln.get(this).values}};function Yo(e){return(...t)=>new jt(e,t)}function Ur(e){return e!=null&&e[qr]===qr}f();u();c();p();m();var ma=Qe(Zo());f();u();c();p();m();Xo();Vi();Wi();f();u();c();p();m();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)}}}f();u();c();p();m();f();u();c();p();m();var jr={enumerable:!0,configurable:!0,writable:!0};function Vr(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>jr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var rs=Symbol.for("nodejs.util.inspect.custom");function pe(e,t){let r=dc(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=ns(Reflect.ownKeys(o),r),a=ns(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?{...jr,...l?.getPropertyDescriptor(s)}:jr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[rs]=function(){let o={...this};return delete o[rs],o},i}function dc(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 ns(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}f();u();c();p();m();function mt(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}f();u();c();p();m();function Gr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}f();u();c();p();m();function is(e){if(e===void 0)return"";let t=ut(e);return new it(0,{colors:Sr}).write(t).toString()}f();u();c();p();m();var gc="P2037";function Qr({error:e,user_facing_error:t},r,n){return t.error_code?new re(hc(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new ne(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function hc(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===gc&&(r+=` +Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();var Un=class{getLocation(){return null}};function _e(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Un}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();var os={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function ft(e={}){let t=wc(e);return Object.entries(t).reduce((n,[i,o])=>(os[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function wc(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Jr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ss(e,t){let r=Jr(e);return t({action:"aggregate",unpacker:r,argsMapper:ft})(e)}f();u();c();p();m();function Ec(e={}){let{select:t,...r}=e;return typeof t=="object"?ft({...r,_count:t}):ft({...r,_count:{_all:!0}})}function bc(e={}){return typeof e.select=="object"?t=>Jr(e)(t)._count:t=>Jr(e)(t)._count._all}function as(e,t){return t({action:"count",unpacker:bc(e),argsMapper:Ec})(e)}f();u();c();p();m();function xc(e={}){let t=ft(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 Pc(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ls(e,t){return t({action:"groupBy",unpacker:Pc(e),argsMapper:xc})(e)}function us(e,t,r){if(t==="aggregate")return n=>ss(n,r);if(t==="count")return n=>as(n,r);if(t==="groupBy")return n=>ls(n,r)}f();u();c();p();m();function cs(e,t){let r=t.fields.filter(i=>!i.relationName),n=bo(r,"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 Nt(e,o,s.type,s.isList,s.kind==="enum")},...Vr(Object.keys(n))})}f();u();c();p();m();f();u();c();p();m();var ps=e=>Array.isArray(e)?e:e.split("."),$n=(e,t)=>ps(t).reduce((r,n)=>r&&r[n],e),ms=(e,t,r)=>ps(t).reduceRight((n,i,o,s)=>Object.assign({},$n(e,s.slice(0,o)),{[i]:n}),r);function vc(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Tc(e,t,r){return t===void 0?e??{}:ms(t,r,e||!0)}function jn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,d)=>({...l,[d.name]:d}),{});return l=>{let d=_e(e._errorFormat),g=vc(n,i),h=Tc(l,o,g),v=r({dataPath:g,callsite:d})(h),S=Cc(e,t);return new Proxy(v,{get(A,R){if(!S.includes(R))return A[R];let M=[a[R].type,r,R],B=[g,h];return jn(e,...M,...B)},...Vr([...S,...Object.getOwnPropertyNames(v)])})}}function Cc(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Ac=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Rc=["aggregate","count","groupBy"];function Vn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Sc(e,t),Ic(e,t),Vt(r),ee("name",()=>t),ee("$name",()=>t),ee("$parent",()=>e._appliedParent)];return pe({},n)}function Sc(e,t){let r=Ee(t),n=Object.keys(It).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let d=_e(e._errorFormat);return e._createPrismaPromise(g=>{let h={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:g,callsite:d};return e._request({...h,...a})},{action:o,args:l,model:t})};return Ac.includes(o)?jn(e,t,s):kc(i)?us(e,i,s):s({})}}}function kc(e){return Rc.includes(e)}function Ic(e,t){return qe(ee("fields",()=>{let r=e._runtimeDataModel.models[t];return cs(t,r)}))}f();u();c();p();m();function fs(e){return e.replace(/^./,t=>t.toUpperCase())}var Gn=Symbol();function Gt(e){let t=[Oc(e),Dc(e),ee(Gn,()=>e),ee("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Vt(r)),pe(e,t)}function Oc(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Dc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Ee),n=[...new Set(t.concat(r))];return qe({getKeys(){return n},getPropertyValue(i){let o=fs(i);if(e._runtimeDataModel.models[o]!==void 0)return Vn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Vn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function ds(e){return e[Gn]?e[Gn]:e}function gs(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Gt(t)}f();u();c();p();m();f();u();c();p();m();function hs({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let d=l.needs.filter(g=>n[g]);d.length>0&&a.push(mt(d))}else if(r){if(!r[l.name])continue;let d=l.needs.filter(g=>!r[g]);d.length>0&&a.push(mt(d))}Mc(e,l.needs)&&s.push(_c(l,pe(e,s)))}return s.length>0||a.length>0?pe(e,[...s,...a]):e}function Mc(e,t){return t.every(r=>xn(e,r))}function _c(e,t){return qe(ee(e.name,()=>e.compute(t)))}f();u();c();p();m();function Wr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let d=typeof s=="object"?s:{};t[o]=Wr({visitor:i,result:t[o],args:d,modelName:l.type,runtimeDataModel:n})}}function ws({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Wr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,d)=>{let g=Ee(l);return hs({result:a,modelName:g,select:d.select,omit:d.select?void 0:{...o?.[g],...d.omit},extensions:n})}})}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();var Nc=["$connect","$disconnect","$on","$transaction","$use","$extends"],Es=Nc;function bs(e){if(e instanceof oe)return Fc(e);if(Ur(e))return Lc(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:bs(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=As(o,l),a.args=s,Ps(e,a,r,n+1)}})})}function vs(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 Ps(e,t,s)}function Ts(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Cs(r,n,0,e):e(r)}}function Cs(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=As(i,l),Cs(a,t,r+1,n)}})}var xs=e=>e;function As(e=xs,t=xs){return r=>e(t(r))}f();u();c();p();m();var Rs=K("prisma:client"),Ss={Vercel:"vercel","Netlify CI":"netlify"};function ks({postinstall:e,ciName:t,clientVersion:r}){if(Rs("checkPlatformCaching:postinstall",e),Rs("checkPlatformCaching:ciName",t),e===!0&&t&&t in Ss){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/${Ss[t]}-build`;throw console.error(n),new Q(n,r)}}f();u();c();p();m();function Is(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}f();u();c();p();m();f();u();c();p();m();var Bc=()=>globalThis.process?.release?.name==="node",qc=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Uc=()=>!!globalThis.Deno,$c=()=>typeof globalThis.Netlify=="object",jc=()=>typeof globalThis.EdgeRuntime=="object",Vc=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Gc(){return[[$c,"netlify"],[jc,"edge-light"],[Vc,"workerd"],[Uc,"deno"],[qc,"bun"],[Bc,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var Qc={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Hr(){let e=Gc();return{id:e,prettyName:Qc[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}f();u();c();p();m();f();u();c();p();m();f();u();c();p();m();function dt({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 Hr().id==="workerd"?new Q(`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 Q(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new Q("error: Missing URL environment variable, value, or override.",n);return i}f();u();c();p();m();f();u();c();p();m();var Kr=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends Kr{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};f();u();c();p();m();f();u();c();p();m();function L(e,t){return{...e,isRetryable:t}}var gt=class extends se{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",L(t,!0))}};N(gt,"ForcedRetryError");f();u();c();p();m();var Ue=class extends se{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,L(r,!1))}};N(Ue,"InvalidDatasourceError");f();u();c();p();m();var $e=class extends se{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,L(r,!1))}};N($e,"NotImplementedYetError");f();u();c();p();m();f();u();c();p();m();var V=class extends se{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var je=class extends V{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",L(t,!0))}};N(je,"SchemaMissingError");f();u();c();p();m();f();u();c();p();m();var Qn="This request could not be understood by the server",Jt=class extends V{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||Qn,L(t,!1)),n&&(this.code=n)}};N(Jt,"BadRequestError");f();u();c();p();m();var Wt=class extends V{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",L(t,!0)),this.logs=r}};N(Wt,"HealthcheckTimeoutError");f();u();c();p();m();var Ht=class extends V{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,L(t,!0)),this.logs=n}};N(Ht,"EngineStartupError");f();u();c();p();m();var Kt=class extends V{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",L(t,!1))}};N(Kt,"EngineVersionNotSupportedError");f();u();c();p();m();var Jn="Request timed out",zt=class extends V{name="GatewayTimeoutError";code="P5009";constructor(t,r=Jn){super(r,L(t,!1))}};N(zt,"GatewayTimeoutError");f();u();c();p();m();var Jc="Interactive transaction error",Yt=class extends V{name="InteractiveTransactionError";code="P5015";constructor(t,r=Jc){super(r,L(t,!1))}};N(Yt,"InteractiveTransactionError");f();u();c();p();m();var Wc="Request parameters are invalid",Zt=class extends V{name="InvalidRequestError";code="P5011";constructor(t,r=Wc){super(r,L(t,!1))}};N(Zt,"InvalidRequestError");f();u();c();p();m();var Wn="Requested resource does not exist",Xt=class extends V{name="NotFoundError";code="P5003";constructor(t,r=Wn){super(r,L(t,!1))}};N(Xt,"NotFoundError");f();u();c();p();m();var Hn="Unknown server error",ht=class extends V{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||Hn,L(t,!0)),this.logs=n}};N(ht,"ServerError");f();u();c();p();m();var Kn="Unauthorized, check your connection string",er=class extends V{name="UnauthorizedError";code="P5007";constructor(t,r=Kn){super(r,L(t,!1))}};N(er,"UnauthorizedError");f();u();c();p();m();var zn="Usage exceeded, retry again later",tr=class extends V{name="UsageExceededError";code="P5008";constructor(t,r=zn){super(r,L(t,!0))}};N(tr,"UsageExceededError");async function Hc(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 rr(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Hc(e);if(n.type==="QueryEngineError")throw new re(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new ht(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new je(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Kt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Ht(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new Q(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Wt(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 Yt(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Zt(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new er(r,yt(Kn,n));if(e.status===404)return new Xt(r,yt(Wn,n));if(e.status===429)throw new tr(r,yt(zn,n));if(e.status===504)throw new zt(r,yt(Jn,n));if(e.status>=500)throw new ht(r,yt(Hn,n));if(e.status>=400)throw new Jt(r,yt(Qn,n))}function yt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}f();u();c();p();m();function Os(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))}f();u();c();p();m();var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Ds(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,d,g;for(let h=0;h>18,a=(g&258048)>>12,l=(g&4032)>>6,d=g&63,r+=Ae[s]+Ae[a]+Ae[l]+Ae[d];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Ae[s]+Ae[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,l=(g&15)<<2,r+=Ae[s]+Ae[a]+Ae[l]+"="),r}f();u();c();p();m();function Ms(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new Q("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)}f();u();c();p();m();function Kc(e){return e[0]*1e3+e[1]/1e6}function Yn(e){return new Date(Kc(e))}f();u();c();p();m();var _s={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};f();u();c();p();m();f();u();c();p();m();var nr=class extends se{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service: +${t}`,L(r,!0))}};N(nr,"RequestError");async function Ve(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new nr(a,{clientVersion:n,cause:s})}}var Yc=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Ns=K("prisma:client:dataproxyEngine");async function Zc(e,t){let r=_s["@prisma/engines-version"],n=t.clientVersion??"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[i,o]=n?.split("-")??[];if(o===void 0&&Yc.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,d]=s.split("."),g=Xc(`<=${a}.${l}.${d}`),h=await Ve(g,{clientVersion:n});if(!h.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${h.status} ${h.statusText}, response body: ${await h.text()||""}`);let v=await h.text();Ns("length of body fetched from unpkg.com",v.length);let S;try{S=JSON.parse(v)}catch(A){throw console.error("JSON.parse error: body fetched from unpkg.com: ",v),A}return S.version}throw new $e("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Fs(e,t){let r=await Zc(e,t);return Ns("version",r),r}function Xc(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Ls=3,zr=K("prisma:client:dataproxyEngine"),Zn=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};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}},wt=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;constructor(t){Ms(t),this.config=t,this.env={...t.env,...typeof y<"u"?y.env:{}},this.inlineSchema=Ds(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new Zn({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await Fs(t,this.config),zr("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":zr(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:Yn(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:Yn(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await Ve(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||zr("schema response status",r.status);let n=await rr(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Gr(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await Ve(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||zr("graphql response status",a.status),await this.handleError(await rr(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await Ve(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await rr(l,this.clientVersion));let d=await l.json(),{extensions:g}=d;g&&this.propagateResponseExtensions(g);let h=d.id,v=d["data-proxy"].endpoint;return{id:h,payload:{endpoint:v}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await Ve(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await rr(a,this.clientVersion));let l=await a.json(),{extensions:d}=l;d&&this.propagateResponseExtensions(d);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=dt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new Ue(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!==dr)throw new Ue(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let l=a.get("api_key");if(l===null||l.length<1)throw new Ue(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,l]}metrics(){throw new $e("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof se)||!i.isRetryable)throw i;if(r>=Ls)throw i instanceof gt?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${Ls} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await Os(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof je)throw await this.uploadSchema(),new gt({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?Qr(t[0],this.config.clientVersion,this.config.activeProvider):new ne(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Bs({copyEngine:e=!0},t){let r;try{r=dt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||En(r));e&&n&&Rt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Ye(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",d=i==="client";if(o&&s||s){let g;throw g=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new Z(g.join(` +`),{clientVersion:t.clientVersion})}return o?new wt(t):new wt(t)}f();u();c();p();m();function Yr({generator:e}){return e?.previewFeatures??[]}f();u();c();p();m();var qs=e=>({command:e});f();u();c();p();m();f();u();c();p();m();var Us=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);f();u();c();p();m();function Et(e){try{return $s(e,"fast")}catch{return $s(e,"slow")}}function $s(e,t){return JSON.stringify(e.map(r=>Vs(r,t)))}function Vs(e,t){if(Array.isArray(e))return e.map(r=>Vs(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(rt(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(he.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(w.Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(ep(e))return{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:w.Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?Gs(e):e}function ep(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Gs(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(js);let t={};for(let r of Object.keys(e))t[r]=js(e[r]);return t}function js(e){return typeof e=="bigint"?e.toString():Gs(e)}var tp=/^(\s*alter\s)/i,Qs=K("prisma:client");function Xn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&tp.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 ei=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Ur(r))n=r.sql,i={values:Et(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Et(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Et(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Et(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Us(r),i={values:Et(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Qs(`prisma.${e}(${n}, ${i.values})`):Qs(`prisma.${e}(${n})`),{query:n,parameters:i}},Js={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new oe(t,r)}},Ws={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};f();u();c();p();m();function ti(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Hs(r(s)):Hs(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Hs(e){return typeof e.then=="function"?e:Promise.resolve(e)}f();u();c();p();m();var rp=wn.split(".")[0],np={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},ri=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${rp}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??np}};function Ks(){return new ri}f();u();c();p();m();function zs(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}f();u();c();p();m();function Ys(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)}f();u();c();p();m();var Zr=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};f();u();c();p();m();var Xs=Qe(ro());f();u();c();p();m();function Xr(e){return typeof e.batchRequestIdx=="number"}f();u();c();p();m();function Zs(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(ni(e.query.arguments)),t.push(ni(e.query.selection)),t.join("")}function ni(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${ni(n)})`:r}).join(" ")})`}f();u();c();p();m();var ip={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!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,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function ii(e){return ip[e]}f();u();c();p();m();var en=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;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,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;iGe("bigint",r));case"bytes-array":return t.map(r=>Ge("bytes",r));case"decimal-array":return t.map(r=>Ge("decimal",r));case"datetime-array":return t.map(r=>Ge("datetime",r));case"date-array":return t.map(r=>Ge("date",r));case"time-array":return t.map(r=>Ge("time",r));default:return t}}function tn(e){let t=[],r=op(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),d=n.some(h=>ii(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:ap(o),containsWrite:d,customDataProxyFetch:i})).map((h,v)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[v],h)}catch(S){return S}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?ea(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:ii(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Zs(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,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}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,modelName:s,globalOmit:a}){if(sp(t),lp(t,i))throw t;if(t instanceof re&&up(t)){let d=ta(t.meta);_r({args:o,errors:[d],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=Tr({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let d=s?{modelName:s,...t.meta}:t.meta;throw new re(l,{code:t.code,clientVersion:this.client._clientVersion,meta:d,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ve(l,this.client._clientVersion);if(t instanceof ne)throw new ne(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof Q)throw new Q(l,this.client._clientVersion);if(t instanceof ve)throw new ve(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Xs.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(d=>d!=="select"&&d!=="include"),a=$n(o,s),l=i==="queryRaw"?tn(a):tt(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function ap(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:ea(e)};Pe(e,"Unknown transaction kind")}}function ea(e){return{id:e.id,payload:e.payload}}function lp(e,t){return Xr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function up(e){return e.code==="P2009"||e.code==="P2012"}function ta(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(ta)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}f();u();c();p();m();var ra="6.7.0";var na=ra;f();u();c();p();m();var la=Qe(kn());f();u();c();p();m();var q=class extends Error{constructor(t){super(t+` +Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};N(q,"PrismaClientConstructorValidationError");var ia=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],oa=["pretty","colorless","minimal"],sa=["info","query","warn","error"],pp={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`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=bt(r,t)||` Available datasources: ${t.join(", ")}`;throw new q(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`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 q(`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 q(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&Ye(t.generator)==="client")throw new q('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Yr(t).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ye(t.generator)==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`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 q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!oa.includes(e)){let t=bt(e,oa);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!sa.includes(r)){let n=bt(r,sa);throw new q(`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=bt(i,o);throw new q(`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 q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new q('"omit" option is expected to be an object.');if(e===null)throw new q('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=fp(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(d=>d.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new q(dp(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=bt(r,t);throw new q(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ua(e,t){for(let[r,n]of Object.entries(e)){if(!ia.includes(r)){let i=bt(r,ia);throw new q(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}pp[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function bt(e,t){if(t.length===0||typeof e!="string")return"";let r=mp(e,t);return r?` Did you mean "${r}"?`:""}function mp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,la.default)(e,i)}));r.sort((i,o)=>i.distanceDe(n)===t);if(r)return e[r]}function dp(e,t){let r=ut(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Mr(r,"colorless");return`Error validating "omit" option: + +${i} + +${n}`}f();u();c();p();m();function ca(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{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=d=>{o||(o=!0,r(d))};for(let d=0;d{n[d]=g,a()},g=>{if(!Xr(g)){l(g);return}g.batchRequestIdx===d?l(g):(i||(i=g),a())})})}var Ne=K("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var gp={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},hp=Symbol.for("prisma.client.transaction.id"),yp={id:0,nextId(){return++this.id}};function fa(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Zr;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=ti();constructor(n){e=n?.__internal?.configOverride?.(e)??e,ks(e),n&&ua(n,e);let i=new $r().on("error",()=>{});this._extensions=ct.empty(),this._previewFeatures=Yr(e),this._clientVersion=e.clientVersion??na,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Ks();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&fr.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&fr.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new Q(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new Q("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let l=n??{},d=l.__internal??{},g=d.debug===!0;g&&K.enable("prisma:client");let h=fr.resolve(e.dirname,e.relativePath);ji.existsSync(h)||(h=e.dirname),Ne("dirname",e.dirname),Ne("relativePath",e.relativePath),Ne("cwd",h);let v=d.engine||{};if(l.errorFormat?this._errorFormat=l.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:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:v.allowTriggerPanic,prismaPath:v.binaryPath??void 0,engineEndpoint:v.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Ys(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(S=>typeof S=="string"?S==="query":S.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Is(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:dt,getBatchRequestPayload:Gr,prismaGraphQLToJSError:Qr,PrismaClientUnknownRequestError:ne,PrismaClientInitializationError:Q,PrismaClientKnownRequestError:re,debug:K("prisma:client:accelerateEngine"),engineVersion:ma.version,clientVersion:e.clientVersion}},Ne("clientVersion",e.clientVersion),this._engine=Bs(e,this._engineConfig),this._requestHandler=new rn(this,i),l.log)for(let S of l.log){let A=typeof S=="string"?S:S.emit==="stdout"?S.level:null;A&&this.$on(A,R=>{At.log(`${At.tags[A]??""}`,R.message||R.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Gt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$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{Ui()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:ei({clientMethod:i,activeProvider:a}),callsite:_e(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=pa(n,i);return Xn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Z("`$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=>(Xn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Z(`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:qs,callsite:_e(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:ei({clientMethod:i,activeProvider:a}),callsite:_e(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...pa(n,i));throw new Z("`$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})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new Z("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=yp.nextId(),s=zs(n.length),a=n.map((l,d)=>{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 g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:d,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return ca(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let d={kind:"itx",...a};l=await n(this._createItxClient(d)),await this._engine.transaction("commit",o,a)}catch(d){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),d}return l}_createItxClient(n){return pe(Gt(pe(ds(this),[ee("_appliedParent",()=>this._appliedParent._createItxClient(n)),ee("_createPrismaPromise",()=>ti(n)),ee(hp,()=>n.id)])),[mt(Es)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}: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??gp,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 d=>{let g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,D=>g(d,M=>(D?.end(),l(M))));let{runInTransaction:h,args:v,...S}=d,A={...n,...S};v&&(A.args=i.middlewareArgsToRequestArgs(v)),n.transaction!==void 0&&h===!1&&delete A.transaction;let R=await vs(this,A);return A.model?ws({result:R,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):R};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:d,transaction:g,unpacker:h,otelParentCtx:v,customDataProxyFetch:S}){try{n=d?d(n):n;let A={name:"serialize"},R=this._tracingHelper.runInChildSpan(A,()=>Br({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return K.enabled("prisma:client")&&(Ne("Prisma Client call:"),Ne(`prisma.${i}(${is(n)})`),Ne("Generated request:"),Ne(JSON.stringify(R,null,2)+` +`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:R,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:v,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:S})}catch(A){throw A.clientVersion=this._clientVersion,A}}$metrics=new pt(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=gs}return t}function pa(e,t){return wp(e)?[new oe(e,t),Js]:[e,Ws]}function wp(e){return Array.isArray(e)&&Array.isArray(e.raw)}f();u();c();p();m();var Ep=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function da(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Ep.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}f();u();c();p();m();0&&(module.exports={DMMF,Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce}); +//# sourceMappingURL=edge.js.map diff --git a/src/generated/prisma/runtime/index-browser.d.ts b/src/generated/prisma/runtime/index-browser.d.ts new file mode 100644 index 0000000..d11f410 --- /dev/null +++ b/src/generated/prisma/runtime/index-browser.d.ts @@ -0,0 +1,370 @@ +declare class AnyNull extends NullTypesEnumValue { + #private; +} + +declare type Args = T extends { + [K: symbol]: { + types: { + operations: { + [K in F]: { + args: any; + }; + }; + }; + }; +} ? T[symbol]['types']['operations'][F]['args'] : any; + +declare class DbNull extends NullTypesEnumValue { + #private; +} + +export declare function Decimal(n: Decimal.Value): Decimal; + +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; +} + +declare type Exact = (A extends unknown ? (W extends A ? { + [K in keyof A]: Exact; +} : W) : never) | (A extends Narrowable ? A : never); + +export declare function getRuntime(): GetRuntimeOutput; + +declare type GetRuntimeOutput = { + id: RuntimeName; + prettyName: string; + isEdge: boolean; +}; + +declare class JsonNull extends NullTypesEnumValue { + #private; +} + +/** + * 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; + +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; + }; +}; + +declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; + +declare namespace Public { + export { + validator + } +} +export { Public } + +declare type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | ''; + +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/src/generated/prisma/runtime/index-browser.js b/src/generated/prisma/runtime/index-browser.js new file mode 100644 index 0000000..373ada9 --- /dev/null +++ b/src/generated/prisma/runtime/index-browser.js @@ -0,0 +1,16 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ +"use strict";var pe=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Qe=Object.prototype.hasOwnProperty;var Ye=e=>{throw TypeError(e)};var Oe=(e,n)=>{for(var i in n)pe(e,i,{get:n[i],enumerable:!0})},xe=(e,n,i,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ke(n))!Qe.call(e,r)&&r!==i&&pe(e,r,{get:()=>n[r],enumerable:!(t=Xe(n,r))||t.enumerable});return e};var ze=e=>xe(pe({},"__esModule",{value:!0}),e);var ne=(e,n,i)=>n.has(e)?Ye("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i);var ii={};Oe(ii,{Decimal:()=>Je,Public:()=>ge,getRuntime:()=>_e,makeStrictEnum:()=>qe,objectEnumValues:()=>Ae});module.exports=ze(ii);var ge={};Oe(ge,{validator:()=>Re});function Re(...e){return n=>n}var ie=Symbol(),me=new WeakMap,we=class{constructor(n){n===ie?me.set(this,"Prisma.".concat(this._getName())):me.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return me.get(this)}},G=class extends we{_getNamespace(){return"NullTypes"}},Ne,J=class extends G{constructor(){super(...arguments);ne(this,Ne)}};Ne=new WeakMap;ke(J,"DbNull");var ve,X=class extends G{constructor(){super(...arguments);ne(this,ve)}};ve=new WeakMap;ke(X,"JsonNull");var Ee,K=class extends G{constructor(){super(...arguments);ne(this,Ee)}};Ee=new WeakMap;ke(K,"AnyNull");var Ae={classes:{DbNull:J,JsonNull:X,AnyNull:K},instances:{DbNull:new J(ie),JsonNull:new X(ie),AnyNull:new K(ie)}};function ke(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0})}var ye=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function qe(e){return new Proxy(e,{get(n,i){if(i in n)return n[i];if(!ye.has(i))throw new TypeError("Invalid enum value: ".concat(String(i)))}})}var en=()=>{var e,n;return((n=(e=globalThis.process)==null?void 0:e.release)==null?void 0:n.name)==="node"},nn=()=>{var e,n;return!!globalThis.Bun||!!((n=(e=globalThis.process)==null?void 0:e.versions)!=null&&n.bun)},tn=()=>!!globalThis.Deno,rn=()=>typeof globalThis.Netlify=="object",sn=()=>typeof globalThis.EdgeRuntime=="object",on=()=>{var e;return((e=globalThis.navigator)==null?void 0:e.userAgent)==="Cloudflare-Workers"};function un(){var i;return(i=[[rn,"netlify"],[sn,"edge-light"],[on,"workerd"],[tn,"deno"],[nn,"bun"],[en,"node"]].flatMap(t=>t[0]()?[t[1]]:[]).at(0))!=null?i:""}var fn={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function _e(){let e=un();return{id:e,prettyName:fn[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var V=9e15,H=1e9,Se="0123456789abcdef",se="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",oe="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Me={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-V,maxE:V,crypto:!1},Le,Z,w=!0,fe="[DecimalError] ",$=fe+"Invalid argument: ",Ie=fe+"Precision limit exceeded",Ze=fe+"crypto unavailable",Ue="[object Decimal]",R=Math.floor,C=Math.pow,cn=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ln=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,an=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Be=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,D=1e7,m=7,dn=9007199254740991,hn=se.length-1,Ce=oe.length-1,h={toStringTag:Ue};h.absoluteValue=h.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),p(e)};h.ceil=function(){return p(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(e,n){var i,t=this,r=t.constructor;if(e=new r(e),n=new r(n),!e.s||!n.s)return new r(NaN);if(e.gt(n))throw Error($+n);return i=t.cmp(e),i<0?e:t.cmp(n)>0?n:new r(t)};h.comparedTo=h.cmp=function(e){var n,i,t,r,s=this,o=s.d,u=(e=new s.constructor(e)).d,c=s.s,f=e.s;if(!o||!u)return!c||!f?NaN:c!==f?c:o===u?0:!o^c<0?1:-1;if(!o[0]||!u[0])return o[0]?c:u[0]?-f:0;if(c!==f)return c;if(s.e!==e.e)return s.e>e.e^c<0?1:-1;for(t=o.length,r=u.length,n=0,i=tu[n]^c<0?1:-1;return t===r?0:t>r^c<0?1:-1};h.cosine=h.cos=function(){var e,n,i=this,t=i.constructor;return i.d?i.d[0]?(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=pn(t,We(t,i)),t.precision=e,t.rounding=n,p(Z==2||Z==3?i.neg():i,e,n,!0)):new t(1):new t(NaN)};h.cubeRoot=h.cbrt=function(){var e,n,i,t,r,s,o,u,c,f,l=this,a=l.constructor;if(!l.isFinite()||l.isZero())return new a(l);for(w=!1,s=l.s*C(l.s*l,1/3),!s||Math.abs(s)==1/0?(i=b(l.d),e=l.e,(s=(e-i.length+1)%3)&&(i+=s==1||s==-2?"0":"00"),s=C(i,1/3),e=R((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),t=new a(i),t.s=l.s):t=new a(s.toString()),o=(e=a.precision)+3;;)if(u=t,c=u.times(u).times(u),f=c.plus(l),t=k(f.plus(l).times(u),f.plus(c),o+2,1),b(u.d).slice(0,o)===(i=b(t.d)).slice(0,o))if(i=i.slice(o-3,o+1),i=="9999"||!r&&i=="4999"){if(!r&&(p(u,e+1,0),u.times(u).times(u).eq(l))){t=u;break}o+=4,r=1}else{(!+i||!+i.slice(1)&&i.charAt(0)=="5")&&(p(t,e+1,1),n=!t.times(t).times(t).eq(l));break}return w=!0,p(t,e,a.rounding,n)};h.decimalPlaces=h.dp=function(){var e,n=this.d,i=NaN;if(n){if(e=n.length-1,i=(e-R(this.e/m))*m,e=n[e],e)for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i};h.dividedBy=h.div=function(e){return k(this,new this.constructor(e))};h.dividedToIntegerBy=h.divToInt=function(e){var n=this,i=n.constructor;return p(k(n,new i(e),0,1,1),i.precision,i.rounding)};h.equals=h.eq=function(e){return this.cmp(e)===0};h.floor=function(){return p(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(e){return this.cmp(e)>0};h.greaterThanOrEqualTo=h.gte=function(e){var n=this.cmp(e);return n==1||n===0};h.hyperbolicCosine=h.cosh=function(){var e,n,i,t,r,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,t=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),n=(1/le(4,e)).toString()):(e=16,n="2.3283064365386962890625e-10"),s=j(o,1,s.times(n),new o(1),!0);for(var c,f=e,l=new o(8);f--;)c=s.times(s),s=u.minus(c.times(l.minus(c.times(l))));return p(s,o.precision=i,o.rounding=t,!0)};h.hyperbolicSine=h.sinh=function(){var e,n,i,t,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(n=s.precision,i=s.rounding,s.precision=n+Math.max(r.e,r.sd())+4,s.rounding=1,t=r.d.length,t<3)r=j(s,2,r,r,!0);else{e=1.4*Math.sqrt(t),e=e>16?16:e|0,r=r.times(1/le(5,e)),r=j(s,2,r,r,!0);for(var o,u=new s(5),c=new s(16),f=new s(20);e--;)o=r.times(r),r=r.times(u.plus(o.times(c.times(o).plus(f))))}return s.precision=n,s.rounding=i,p(r,n,i,!0)};h.hyperbolicTangent=h.tanh=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+7,t.rounding=1,k(i.sinh(),i.cosh(),t.precision=e,t.rounding=n)):new t(i.s)};h.inverseCosine=h.acos=function(){var e=this,n=e.constructor,i=e.abs().cmp(1),t=n.precision,r=n.rounding;return i!==-1?i===0?e.isNeg()?F(n,t,r):new n(0):new n(NaN):e.isZero()?F(n,t+4,r).times(.5):(n.precision=t+6,n.rounding=1,e=new n(1).minus(e).div(e.plus(1)).sqrt().atan(),n.precision=t,n.rounding=r,e.times(2))};h.inverseHyperbolicCosine=h.acosh=function(){var e,n,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(e=t.precision,n=t.rounding,t.precision=e+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,w=!1,i=i.times(i).minus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln()):new t(i)};h.inverseHyperbolicSine=h.asinh=function(){var e,n,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,w=!1,i=i.times(i).plus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var e,n,i,t,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,n=s.rounding,t=r.sd(),Math.max(t,e)<2*-r.e-1?p(new s(r),e,n,!0):(s.precision=i=t-r.e,r=k(r.plus(1),new s(1).minus(r),i+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=n,r.times(.5))):new s(NaN)};h.inverseSine=h.asin=function(){var e,n,i,t,r=this,s=r.constructor;return r.isZero()?new s(r):(n=r.abs().cmp(1),i=s.precision,t=s.rounding,n!==-1?n===0?(e=F(s,i+4,t).times(.5),e.s=r.s,e):new s(NaN):(s.precision=i+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=t,r.times(2)))};h.inverseTangent=h.atan=function(){var e,n,i,t,r,s,o,u,c,f=this,l=f.constructor,a=l.precision,d=l.rounding;if(f.isFinite()){if(f.isZero())return new l(f);if(f.abs().eq(1)&&a+4<=Ce)return o=F(l,a+4,d).times(.25),o.s=f.s,o}else{if(!f.s)return new l(NaN);if(a+4<=Ce)return o=F(l,a+4,d).times(.5),o.s=f.s,o}for(l.precision=u=a+10,l.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),t=1,c=f.times(f),o=new l(f),r=f;e!==-1;)if(r=r.times(c),s=o.minus(r.div(t+=2)),r=r.times(c),o=s.plus(r.div(t+=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};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(e){return this.cmp(e)<0};h.lessThanOrEqualTo=h.lte=function(e){return this.cmp(e)<1};h.logarithm=h.log=function(e){var n,i,t,r,s,o,u,c,f=this,l=f.constructor,a=l.precision,d=l.rounding,g=5;if(e==null)e=new l(10),n=!0;else{if(e=new l(e),i=e.d,e.s<0||!i||!i[0]||e.eq(1))return new l(NaN);n=e.eq(10)}if(i=f.d,f.s<0||!i||!i[0]||f.eq(1))return new l(i&&!i[0]?-1/0:f.s!=1?NaN:i?0:1/0);if(n)if(i.length>1)s=!0;else{for(r=i[0];r%10===0;)r/=10;s=r!==1}if(w=!1,u=a+g,o=B(f,u),t=n?ue(l,u+10):B(e,u),c=k(o,t,u,1),Q(c.d,r=a,d))do if(u+=10,o=B(f,u),t=n?ue(l,u+10):B(e,u),c=k(o,t,u,1),!s){+b(c.d).slice(r+1,r+15)+1==1e14&&(c=p(c,a+1,0));break}while(Q(c.d,r+=10,d));return w=!0,p(c,a,d)};h.minus=h.sub=function(e){var n,i,t,r,s,o,u,c,f,l,a,d,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,d=e.d,u=v.precision,c=v.rounding,!f[0]||!d[0]){if(d[0])e.s=-e.s;else if(f[0])e=new v(g);else return new v(c===3?-0:0);return w?p(e,u,c):e}if(i=R(e.e/m),l=R(g.e/m),f=f.slice(),s=l-i,s){for(a=s<0,a?(n=f,s=-s,o=d.length):(n=d,i=l,o=f.length),t=Math.max(Math.ceil(u/m),o)+2,s>t&&(s=t,n.length=1),n.reverse(),t=s;t--;)n.push(0);n.reverse()}else{for(t=f.length,o=d.length,a=t0;--t)f[o++]=0;for(t=d.length;t>s;){if(f[--t]o?s+1:o+1,r>o&&(r=o,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for(o=f.length,r=l.length,o-r<0&&(r=o,i=l,l=f,f=i),n=0;r;)n=(f[--r]=f[r]+l[r]+n)/D|0,f[r]%=D;for(n&&(f.unshift(n),++t),o=f.length;f[--o]==0;)f.pop();return e.d=f,e.e=ce(f,t),w?p(e,u,c):e};h.precision=h.sd=function(e){var n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error($+e);return i.d?(n=$e(i.d),e&&i.e+1>n&&(n=i.e+1)):n=NaN,n};h.round=function(){var e=this,n=e.constructor;return p(new n(e),e.e+1,n.rounding)};h.sine=h.sin=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=mn(t,We(t,i)),t.precision=e,t.rounding=n,p(Z>2?i.neg():i,e,n,!0)):new t(NaN)};h.squareRoot=h.sqrt=function(){var e,n,i,t,r,s,o=this,u=o.d,c=o.e,f=o.s,l=o.constructor;if(f!==1||!u||!u[0])return new l(!f||f<0&&(!u||u[0])?NaN:u?o:1/0);for(w=!1,f=Math.sqrt(+o),f==0||f==1/0?(n=b(u),(n.length+c)%2==0&&(n+="0"),f=Math.sqrt(n),c=R((c+1)/2)-(c<0||c%2),f==1/0?n="5e"+c:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+c),t=new l(n)):t=new l(f.toString()),i=(c=l.precision)+3;;)if(s=t,t=s.plus(k(o,s,i+2,1)).times(.5),b(s.d).slice(0,i)===(n=b(t.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!r&&n=="4999"){if(!r&&(p(s,c+1,0),s.times(s).eq(o))){t=s;break}i+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(p(t,c+1,1),e=!t.times(t).eq(o));break}return w=!0,p(t,c,l.rounding,e)};h.tangent=h.tan=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+10,t.rounding=1,i=i.sin(),i.s=1,i=k(i,new t(1).minus(i.times(i)).sqrt(),e+10,0),t.precision=e,t.rounding=n,p(Z==2||Z==4?i.neg():i,e,n,!0)):new t(NaN)};h.times=h.mul=function(e){var n,i,t,r,s,o,u,c,f,l=this,a=l.constructor,d=l.d,g=(e=new a(e)).d;if(e.s*=l.s,!d||!d[0]||!g||!g[0])return new a(!e.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?e.s/0:e.s*0);for(i=R(l.e/m)+R(e.e/m),c=d.length,f=g.length,c=0;){for(n=0,r=c+t;r>t;)u=s[r]+g[t]*d[r-t-1]+n,s[r--]=u%D|0,n=u/D|0;s[r]=(s[r]+n)%D|0}for(;!s[--o];)s.pop();return n?++i:s.shift(),e.d=s,e.e=ce(s,i),w?p(e,a.precision,a.rounding):e};h.toBinary=function(e,n){return Pe(this,2,e,n)};h.toDecimalPlaces=h.toDP=function(e,n){var i=this,t=i.constructor;return i=new t(i),e===void 0?i:(q(e,0,H),n===void 0?n=t.rounding:q(n,0,8),p(i,e+i.e+1,n))};h.toExponential=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=L(t,!0):(q(e,0,H),n===void 0?n=r.rounding:q(n,0,8),t=p(new r(t),e+1,n),i=L(t,!0,e+1)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toFixed=function(e,n){var i,t,r=this,s=r.constructor;return e===void 0?i=L(r):(q(e,0,H),n===void 0?n=s.rounding:q(n,0,8),t=p(new s(r),e+r.e+1,n),i=L(t,!1,e+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i};h.toFraction=function(e){var n,i,t,r,s,o,u,c,f,l,a,d,g=this,v=g.d,N=g.constructor;if(!v)return new N(g);if(f=i=new N(1),t=c=new N(0),n=new N(t),s=n.e=$e(v)-g.e-1,o=s%m,n.d[0]=C(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(b(v)),l=N.precision,N.precision=s=v.length*m*2;a=k(u,n,0,1,1),r=i.plus(a.times(t)),r.cmp(e)!=1;)i=t,t=r,r=f,f=c.plus(a.times(r)),c=r,r=n,n=u.minus(a.times(r)),u=r;return r=k(e.minus(i),t,0,1,1),c=c.plus(r.times(f)),i=i.plus(r.times(t)),c.s=f.s=g.s,d=k(f,t,s,1).minus(g).abs().cmp(k(c,i,s,1).minus(g).abs())<1?[f,t]:[c,i],N.precision=l,w=!0,d};h.toHexadecimal=h.toHex=function(e,n){return Pe(this,16,e,n)};h.toNearest=function(e,n){var i=this,t=i.constructor;if(i=new t(i),e==null){if(!i.d)return i;e=new t(1),n=t.rounding}else{if(e=new t(e),n===void 0?n=t.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=k(i,e,0,n,1).times(e),w=!0,p(i)):(e.s=i.s,i=e),i};h.toNumber=function(){return+this};h.toOctal=function(e,n){return Pe(this,8,e,n)};h.toPower=h.pow=function(e){var n,i,t,r,s,o,u=this,c=u.constructor,f=+(e=new c(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new c(C(+u,f));if(u=new c(u),u.eq(1))return u;if(t=c.precision,s=c.rounding,e.eq(1))return p(u,t,s);if(n=R(e.e/m),n>=e.d.length-1&&(i=f<0?-f:f)<=dn)return r=He(c,u,i,t),e.s<0?new c(1).div(r):p(r,t,s);if(o=u.s,o<0){if(nc.maxE+1||n0?o/0:0):(w=!1,c.rounding=u.s=1,i=Math.min(12,(n+"").length),r=be(e.times(B(u,t+i)),t),r.d&&(r=p(r,t+5,1),Q(r.d,t,s)&&(n=t+10,r=p(be(e.times(B(u,n+i)),n),n+5,1),+b(r.d).slice(t+1,t+15)+1==1e14&&(r=p(r,t+1,0)))),r.s=o,w=!0,c.rounding=s,p(r,t,s))};h.toPrecision=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=L(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):(q(e,1,H),n===void 0?n=r.rounding:q(n,0,8),t=p(new r(t),e,n),i=L(t,e<=t.e||t.e<=r.toExpNeg,e)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toSignificantDigits=h.toSD=function(e,n){var i=this,t=i.constructor;return e===void 0?(e=t.precision,n=t.rounding):(q(e,1,H),n===void 0?n=t.rounding:q(n,0,8)),p(new t(i),e,n)};h.toString=function(){var e=this,n=e.constructor,i=L(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i};h.truncated=h.trunc=function(){return p(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var e=this,n=e.constructor,i=L(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()?"-"+i:i};function b(e){var n,i,t,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,n=1;ni)throw Error($+e)}function Q(e,n,i,t){var r,s,o,u;for(s=e[0];s>=10;s/=10)--n;return--n<0?(n+=m,r=0):(r=Math.ceil((n+1)/m),n%=m),s=C(10,m-n),u=e[r]%s|0,t==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[r+1]/s/100|0)==C(10,n-2)-1||(u==s/2||u==0)&&(e[r+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=(t||i<4)&&u==9999||!t&&i>3&&u==4999):o=((t||i<4)&&u+1==s||!t&&i>3&&u+1==s/2)&&(e[r+1]/s/1e3|0)==C(10,n-3)-1,o}function te(e,n,i){for(var t,r=[0],s,o=0,u=e.length;oi-1&&(r[t+1]===void 0&&(r[t+1]=0),r[t+1]+=r[t]/i|0,r[t]%=i)}return r.reverse()}function pn(e,n){var i,t,r;if(n.isZero())return n;t=n.d.length,t<32?(i=Math.ceil(t/3),r=(1/le(4,i)).toString()):(i=16,r="2.3283064365386962890625e-10"),e.precision+=i,n=j(e,1,n.times(r),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 k=function(){function e(t,r,s){var o,u=0,c=t.length;for(t=t.slice();c--;)o=t[c]*r+u,t[c]=o%s|0,u=o/s|0;return u&&t.unshift(u),t}function n(t,r,s,o){var u,c;if(s!=o)c=s>o?1:-1;else for(u=c=0;ur[u]?1:-1;break}return c}function i(t,r,s,o){for(var u=0;s--;)t[s]-=u,u=t[s]1;)t.shift()}return function(t,r,s,o,u,c){var f,l,a,d,g,v,N,A,M,_,E,P,x,I,ae,z,W,de,T,y,ee=t.constructor,he=t.s==r.s?1:-1,O=t.d,S=r.d;if(!O||!O[0]||!S||!S[0])return new ee(!t.s||!r.s||(O?S&&O[0]==S[0]:!S)?NaN:O&&O[0]==0||!S?he*0:he/0);for(c?(g=1,l=t.e-r.e):(c=D,g=m,l=R(t.e/g)-R(r.e/g)),T=S.length,W=O.length,M=new ee(he),_=M.d=[],a=0;S[a]==(O[a]||0);a++);if(S[a]>(O[a]||0)&&l--,s==null?(I=s=ee.precision,o=ee.rounding):u?I=s+(t.e-r.e)+1:I=s,I<0)_.push(1),v=!0;else{if(I=I/g+2|0,a=0,T==1){for(d=0,S=S[0],I++;(a1&&(S=e(S,d,c),O=e(O,d,c),T=S.length,W=O.length),z=T,E=O.slice(0,T),P=E.length;P=c/2&&++de;do d=0,f=n(S,E,T,P),f<0?(x=E[0],T!=P&&(x=x*c+(E[1]||0)),d=x/de|0,d>1?(d>=c&&(d=c-1),N=e(S,d,c),A=N.length,P=E.length,f=n(N,E,A,P),f==1&&(d--,i(N,T=10;d/=10)a++;M.e=a+l*g-1,p(M,u?s+M.e+1:s,o,v)}return M}}();function p(e,n,i,t){var r,s,o,u,c,f,l,a,d,g=e.constructor;e:if(n!=null){if(a=e.d,!a)return e;for(r=1,u=a[0];u>=10;u/=10)r++;if(s=n-r,s<0)s+=m,o=n,l=a[d=0],c=l/C(10,r-o-1)%10|0;else if(d=Math.ceil((s+1)/m),u=a.length,d>=u)if(t){for(;u++<=d;)a.push(0);l=c=0,r=1,s%=m,o=s-m+1}else break e;else{for(l=u=a[d],r=1;u>=10;u/=10)r++;s%=m,o=s-m+r,c=o<0?0:l/C(10,r-o-1)%10|0}if(t=t||n<0||a[d+1]!==void 0||(o<0?l:l%C(10,r-o-1)),f=i<4?(c||t)&&(i==0||i==(e.s<0?3:2)):c>5||c==5&&(i==4||t||i==6&&(s>0?o>0?l/C(10,r-o):0:a[d-1])%10&1||i==(e.s<0?8:7)),n<1||!a[0])return a.length=0,f?(n-=e.e+1,a[0]=C(10,(m-n%m)%m),e.e=-n||0):a[0]=e.e=0,e;if(s==0?(a.length=d,u=1,d--):(a.length=d+1,u=C(10,m-s),a[d]=o>0?(l/C(10,r-o)%C(10,o)|0)*u:0),f)for(;;)if(d==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]==D&&(a[0]=1));break}else{if(a[d]+=u,a[d]!=D)break;a[d--]=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(t):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+U(-r-1)+s,i&&(t=i-o)>0&&(s+=U(t))):r>=o?(s+=U(r+1-o),i&&(t=i-r-1)>0&&(s=s+"."+U(t))):((t=r+1)0&&(r+1===o&&(s+="."),s+=U(t))),s}function ce(e,n){var i=e[0];for(n*=m;i>=10;i/=10)n++;return n}function ue(e,n,i){if(n>hn)throw w=!0,i&&(e.precision=i),Error(Ie);return p(new e(se),n,1,!0)}function F(e,n,i){if(n>Ce)throw Error(Ie);return p(new e(oe),n,i,!0)}function $e(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 He(e,n,i,t){var r,s=new e(1),o=Math.ceil(t/m+4);for(w=!1;;){if(i%2&&(s=s.times(n),De(s.d,o)&&(r=!0)),i=R(i/2),i===0){i=s.d.length-1,r&&s.d[i]===0&&++s.d[i];break}n=n.times(n),De(n.d,o)}return w=!0,s}function Te(e){return e.d[e.d.length-1]&1}function Ve(e,n,i){for(var t,r,s=new e(n[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:NaN);for(n==null?(w=!1,c=v):c=n,u=new d(.03125);e.e>-2;)e=e.times(u),a+=5;for(t=Math.log(C(2,a))/Math.LN10*2+5|0,c+=t,i=s=o=new d(1),d.precision=c;;){if(s=p(s.times(e),c,1),i=i.times(++l),u=o.plus(k(s,i,c,1)),b(u.d).slice(0,c)===b(o.d).slice(0,c)){for(r=a;r--;)o=p(o.times(o),c,1);if(n==null)if(f<3&&Q(o.d,c-t,g,f))d.precision=c+=10,i=s=u=new d(1),l=0,f++;else return p(o,d.precision=v,g,w=!0);else return d.precision=v,o}o=u}}function B(e,n){var i,t,r,s,o,u,c,f,l,a,d,g=1,v=10,N=e,A=N.d,M=N.constructor,_=M.rounding,E=M.precision;if(N.s<0||!A||!A[0]||!N.e&&A[0]==1&&A.length==1)return new M(A&&!A[0]?-1/0:N.s!=1?NaN:A?0:N);if(n==null?(w=!1,l=E):l=n,M.precision=l+=v,i=b(A),t=i.charAt(0),Math.abs(s=N.e)<15e14){for(;t<7&&t!=1||t==1&&i.charAt(1)>3;)N=N.times(e),i=b(N.d),t=i.charAt(0),g++;s=N.e,t>1?(N=new M("0."+i),s++):N=new M(t+"."+i.slice(1))}else return f=ue(M,l+2,E).times(s+""),N=B(new M(t+"."+i.slice(1)),l-v).plus(f),M.precision=E,n==null?p(N,E,_,w=!0):N;for(a=N,c=o=N=k(N.minus(1),N.plus(1),l,1),d=p(N.times(N),l,1),r=3;;){if(o=p(o.times(d),l,1),f=c.plus(k(o,new M(r),l,1)),b(f.d).slice(0,l)===b(c.d).slice(0,l))if(c=c.times(2),s!==0&&(c=c.plus(ue(M,l+2,E).times(s+""))),c=k(c,new M(g),l,1),n==null)if(Q(c.d,l-v,_,u))M.precision=l+=v,f=o=N=k(a.minus(1),a.plus(1),l,1),d=p(N.times(N),l,1),r=u=1;else return p(c,M.precision=E,_,w=!0);else return M.precision=E,c;c=f,r+=2}}function je(e){return String(e.s*e.s/0)}function re(e,n){var i,t,r;for((i=n.indexOf("."))>-1&&(n=n.replace(".","")),(t=n.search(/e/i))>0?(i<0&&(i=t),i+=+n.slice(t+1),n=n.substring(0,t)):i<0&&(i=n.length),t=0;n.charCodeAt(t)===48;t++);for(r=n.length;n.charCodeAt(r-1)===48;--r);if(n=n.slice(t,r),n){if(r-=t,e.e=i=i-t-1,e.d=[],t=(i+1)%m,i<0&&(t+=m),te.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Be.test(n))return re(e,n)}else if(n==="Infinity"||n==="NaN")return+n||(e.s=NaN),e.e=NaN,e.d=null,e;if(ln.test(n))i=16,n=n.toLowerCase();else if(cn.test(n))i=2;else if(an.test(n))i=8;else throw Error($+n);for(s=n.search(/p/i),s>0?(c=+n.slice(s+1),n=n.substring(2,s)):n=n.slice(2),s=n.indexOf("."),o=s>=0,t=e.constructor,o&&(n=n.replace(".",""),u=n.length,s=u-s,r=He(t,new t(i),s,s*2)),f=te(n,i,D),l=f.length-1,s=l;f[s]===0;--s)f.pop();return s<0?new t(e.s*0):(e.e=ce(f,l),e.d=f,w=!1,o&&(e=k(e,r,u*4)),c&&(e=e.times(Math.abs(c)<54?C(2,c):Y.pow(2,c))),w=!0,e)}function mn(e,n){var i,t=n.d.length;if(t<3)return n.isZero()?n:j(e,2,n,n);i=1.4*Math.sqrt(t),i=i>16?16:i|0,n=n.times(1/le(5,i)),n=j(e,2,n,n);for(var r,s=new e(5),o=new e(16),u=new e(20);i--;)r=n.times(n),n=n.times(s.plus(r.times(o.times(r).minus(u))));return n}function j(e,n,i,t,r){var s,o,u,c,f=1,l=e.precision,a=Math.ceil(l/m);for(w=!1,c=i.times(i),u=new e(t);;){if(o=k(u.times(c),new e(n++*n++),l,1),u=r?t.plus(o):t.minus(o),t=k(o.times(c),new e(n++*n++),l,1),o=u.plus(t),o.d[a]!==void 0){for(s=a;o.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=t,t=o,o=s,f++}return w=!0,o.d.length=a+1,o}function le(e,n){for(var i=e;--n;)i*=e;return i}function We(e,n){var i,t=n.s<0,r=F(e,e.precision,1),s=r.times(.5);if(n=n.abs(),n.lte(s))return Z=t?4:1,n;if(i=n.divToInt(r),i.isZero())Z=t?3:2;else{if(n=n.minus(i.times(r)),n.lte(s))return Z=Te(i)?t?2:3:t?4:1,n;Z=Te(i)?t?1:4:t?3:2}return n.minus(r).abs()}function Pe(e,n,i,t){var r,s,o,u,c,f,l,a,d,g=e.constructor,v=i!==void 0;if(v?(q(i,1,H),t===void 0?t=g.rounding:q(t,0,8)):(i=g.precision,t=g.rounding),!e.isFinite())l=je(e);else{for(l=L(e),o=l.indexOf("."),v?(r=2,n==16?i=i*4-3:n==8&&(i=i*3-2)):r=n,o>=0&&(l=l.replace(".",""),d=new g(1),d.e=l.length-o,d.d=te(L(d),10,r),d.e=d.d.length),a=te(l,10,r),s=c=a.length;a[--c]==0;)a.pop();if(!a[0])l=v?"0p+0":"0";else{if(o<0?s--:(e=new g(e),e.d=a,e.e=s,e=k(e,d,i,t,0,r),a=e.d,s=e.e,f=Le),o=a[i],u=r/2,f=f||a[i+1]!==void 0,f=t<4?(o!==void 0||f)&&(t===0||t===(e.s<0?3:2)):o>u||o===u&&(t===4||f||t===6&&a[i-1]&1||t===(e.s<0?8:7)),a.length=i,f)for(;++a[--i]>r-1;)a[i]=0,i||(++s,a.unshift(1));for(c=a.length;!a[c-1];--c);for(o=0,l="";o1)if(n==16||n==8){for(o=n==16?4:3,--c;c%o;c++)l+="0";for(a=te(l,r,n),c=a.length;!a[c-1];--c);for(o=1,l="1.";oc)for(s-=c;s--;)l+="0";else sn)return e.length=n,!0}function wn(e){return new this(e).abs()}function Nn(e){return new this(e).acos()}function vn(e){return new this(e).acosh()}function En(e,n){return new this(e).plus(n)}function kn(e){return new this(e).asin()}function Sn(e){return new this(e).asinh()}function Mn(e){return new this(e).atan()}function Cn(e){return new this(e).atanh()}function bn(e,n){e=new this(e),n=new this(n);var i,t=this.precision,r=this.rounding,s=t+4;return!e.s||!n.s?i=new this(NaN):!e.d&&!n.d?(i=F(this,s,1).times(n.s>0?.25:.75),i.s=e.s):!n.d||e.isZero()?(i=n.s<0?F(this,t,r):new this(0),i.s=e.s):!e.d||n.isZero()?(i=F(this,s,1).times(.5),i.s=e.s):n.s<0?(this.precision=s,this.rounding=1,i=this.atan(k(e,n,s,1)),n=F(this,s,1),this.precision=t,this.rounding=r,i=e.s<0?i.minus(n):i.plus(n)):i=this.atan(k(e,n,s,1)),i}function Pn(e){return new this(e).cbrt()}function On(e){return p(e=new this(e),e.e+1,2)}function Rn(e,n,i){return new this(e).clamp(n,i)}function An(e){if(!e||typeof e!="object")throw Error(fe+"Object expected");var n,i,t,r=e.defaults===!0,s=["precision",1,H,"rounding",0,8,"toExpNeg",-V,0,"toExpPos",0,V,"maxE",0,V,"minE",-V,0,"modulo",0,9];for(n=0;n=s[n+1]&&t<=s[n+2])this[i]=t;else throw Error($+i+": "+t);if(i="crypto",r&&(this[i]=Me[i]),(t=e[i])!==void 0)if(t===!0||t===!1||t===0||t===1)if(t)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[i]=!0;else throw Error(Ze);else this[i]=!1;else throw Error($+i+": "+t);return this}function qn(e){return new this(e).cos()}function _n(e){return new this(e).cosh()}function Ge(e){var n,i,t;function r(s){var o,u,c,f=this;if(!(f instanceof r))return new r(s);if(f.constructor=r,Fe(s)){f.s=s.s,w?!s.d||s.e>r.maxE?(f.e=NaN,f.d=null):s.e=10;u/=10)o++;w?o>r.maxE?(f.e=NaN,f.d=null):o=429e7?n[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=r%1e7;else if(crypto.randomBytes){for(n=crypto.randomBytes(t*=4);s=214e7?crypto.randomBytes(4).copy(n,s):(u.push(r%1e7),s+=4);s=t/4}else throw Error(Ze);else for(;s=10;r/=10)t++;t + * MIT Licence + *) +*/ +//# sourceMappingURL=index-browser.js.map diff --git a/src/generated/prisma/runtime/library.d.ts b/src/generated/prisma/runtime/library.d.ts new file mode 100644 index 0000000..4910818 --- /dev/null +++ b/src/generated/prisma/runtime/library.d.ts @@ -0,0 +1,3647 @@ +/** + * @param this + */ +declare function $extends(this: Client, extension: ExtensionArgs | ((client: Client) => Client)): Client; + +declare type AccelerateEngineConfig = { + inlineSchema: EngineConfig['inlineSchema']; + inlineSchemaHash: EngineConfig['inlineSchemaHash']; + env: EngineConfig['env']; + generator?: { + previewFeatures: string[]; + }; + inlineDatasources: EngineConfig['inlineDatasources']; + overrideDatasources: EngineConfig['overrideDatasources']; + clientVersion: EngineConfig['clientVersion']; + engineVersion: EngineConfig['engineVersion']; + logEmitter: EngineConfig['logEmitter']; + logQueries?: EngineConfig['logQueries']; + logLevel?: EngineConfig['logLevel']; + tracingHelper: EngineConfig['tracingHelper']; + accelerateUtils?: AccelerateUtils; +}; + +declare type AccelerateUtils = EngineConfig['accelerateUtils']; + +export declare type Action = keyof typeof DMMF_2.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; + +declare type ActiveConnectorType = Exclude; + +/** + * An interface that exposes some basic information about the + * adapter like its name and provider type. + */ +declare interface AdapterInfo { + readonly provider: Provider; + readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {}); +} + +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 { + #private; +} + +export declare type ApplyOmit = Compute<{ + [K in keyof T as OmitValue extends true ? never : K]: T[K]; +}>; + +export declare type Args = T extends { + [K: symbol]: { + types: { + operations: { + [K in F]: { + args: any; + }; + }; + }; + }; +} ? T[symbol]['types']['operations'][F]['args'] : any; + +export declare type Args_3 = Args; + +/** + * Original `quaint::ValueType` enum tag from Prisma's `quaint`. + * Query arguments marked with this type are sanitized before being sent to the database. + * Notice while a query argument may be `null`, `ArgType` is guaranteed to be defined. + */ +declare type ArgType = 'Int32' | 'Int64' | 'Float' | 'Double' | 'Text' | 'Enum' | 'EnumArray' | 'Bytes' | 'Boolean' | 'Char' | 'Array' | 'Numeric' | 'Json' | 'Xml' | 'Uuid' | 'DateTime' | 'Date' | 'Time'; + +/** + * Attributes is a map from string to attribute values. + * + * Note: only the own enumerable keys are counted as valid attribute keys. + */ +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. + */ +declare type AttributeValue = string | number | boolean | Array | Array | Array; + +export declare type BaseDMMF = { + readonly datamodel: Omit; +}; + +declare type BatchArgs = { + queries: BatchQuery[]; + transaction?: { + isolationLevel?: IsolationLevel; + }; +}; + +declare type BatchInternalParams = { + requests: RequestParams[]; + customDataProxyFetch?: CustomDataProxyFetch; +}; + +declare type BatchQuery = { + model: string | undefined; + operation: string; + args: JsArgs | RawQueryArgs; +}; + +declare type BatchQueryEngineResult = QueryEngineResultData | Error; + +declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise; + +declare type BatchQueryOptionsCbArgs = { + args: BatchArgs; + query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise; + __internalParams: BatchInternalParams; +}; + +declare type BatchResponse = MultiBatchResponse | CompactedBatchResponse; + +declare type BatchTransactionOptions = { + isolationLevel?: IsolationLevel; +}; + +declare interface BinaryTargetsEnvValue { + fromEnvVar: string | null; + value: string; + native?: boolean; +} + +export declare type Call = (F & { + params: P; +})['returns']; + +declare interface CallSite { + getLocation(): LocationInFile | null; +} + +export declare type Cast = A extends W ? A : W; + +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 ClientOptionDef = undefined | { + [K in string]: any; +}; + +export declare type ClientOtherOps = { + $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise; + $queryRawTyped(query: TypedSql): PrismaPromise; + $queryRawUnsafe(query: string, ...values: any[]): PrismaPromise; + $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise; + $executeRawUnsafe(query: string, ...values: any[]): PrismaPromise; + $runCommandRaw(command: InputJsonObject): PrismaPromise; +}; + +declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum]; + +declare const ColumnTypeEnum: { + readonly Int32: 0; + readonly Int64: 1; + readonly Float: 2; + readonly Double: 3; + readonly Numeric: 4; + readonly Boolean: 5; + readonly Character: 6; + readonly Text: 7; + readonly Date: 8; + readonly Time: 9; + readonly DateTime: 10; + readonly Json: 11; + readonly Enum: 12; + readonly Bytes: 13; + readonly Set: 14; + readonly Uuid: 15; + readonly Int32Array: 64; + readonly Int64Array: 65; + readonly FloatArray: 66; + readonly DoubleArray: 67; + readonly NumericArray: 68; + readonly BooleanArray: 69; + readonly CharacterArray: 70; + readonly TextArray: 71; + readonly DateArray: 72; + readonly TimeArray: 73; + readonly DateTimeArray: 74; + readonly JsonArray: 75; + readonly EnumArray: 76; + readonly BytesArray: 77; + readonly UuidArray: 78; + readonly UnknownNumber: 128; +}; + +declare type CompactedBatchResponse = { + type: 'compacted'; + plan: object; + arguments: Record[]; + nestedSelection: string[]; + keys: string[]; + expectNonEmpty: boolean; +}; + +declare type CompilerWasmLoadingConfig = { + /** + * WASM-bindgen runtime for corresponding module + */ + getRuntime: () => Promise<{ + __wbg_set_wasm(exports: unknown): void; + QueryCompiler: QueryCompilerConstructor; + }>; + /** + * Loads the raw wasm module for the wasm compiler engine. This configuration is + * generated specifically for each type of client, eg. Node.js client and Edge + * clients will have different implementations. + * @remarks this is a callback on purpose, we only load the wasm if needed. + * @remarks only used by ClientEngine + */ + getQueryCompilerWasmModule: () => Promise; +}; + +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; + +declare type ComputedField = { + name: string; + needs: string[]; + compute: ResultArgsFieldCompute; +}; + +declare type ComputedFieldsMap = { + [fieldName: string]: ComputedField; +}; + +declare type ConnectionInfo = { + schemaName?: string; + maxBindValues?: number; +}; + +declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'postgres' | 'prisma+postgres' | 'sqlserver' | 'cockroachdb'; + +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; +} + +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 function createParam(name: string): Param; + +/** + * Custom fetch function for `DataProxyEngine`. + * + * We can't use the actual type of `globalThis.fetch` because this will result + * in API Extractor referencing Node.js type definitions in the `.d.ts` bundle + * for the client runtime. We can only use such types in internal types that + * don't end up exported anywhere. + + * It's also not possible to write a definition of `fetch` that would accept the + * actual `fetch` function from different environments such as Node.js and + * Cloudflare Workers (with their extensions to `RequestInit` and `Response`). + * `fetch` is used in both covariant and contravariant positions in + * `CustomDataProxyFetch`, making it invariant, so we need the exact same type. + * Even if we removed the argument and left `fetch` in covariant position only, + * then for an extension-supplied function to be assignable to `customDataProxyFetch`, + * the platform-specific (or custom) `fetch` function needs to be assignable + * to our `fetch` definition. This, in turn, requires the third-party `Response` + * to be a subtype of our `Response` (which is not a problem, we could declare + * a minimal `Response` type that only includes what we use) *and* requires the + * third-party `RequestInit` to be a supertype of our `RequestInit` (i.e. we + * have to declare all properties any `RequestInit` implementation in existence + * could possibly have), which is not possible. + * + * Since `@prisma/extension-accelerate` redefines the type of + * `__internalParams.customDataProxyFetch` to its own type anyway (probably for + * exactly this reason), our definition is never actually used and is completely + * ignored, so it doesn't matter, and we can just use `unknown` as the type of + * `fetch` here. + */ +declare type CustomDataProxyFetch = (fetch: unknown) => unknown; + +declare class DataLoader { + private options; + batches: { + [key: string]: Job[]; + }; + private tickActive; + constructor(options: DataLoaderOptions); + request(request: T): Promise; + private dispatchBatches; + get [Symbol.toStringTag](): string; +} + +declare type DataLoaderOptions = { + singleLoader: (request: T) => Promise; + batchLoader: (request: T[]) => Promise; + batchBy: (request: T) => string | undefined; + batchOrder: (requestA: T, requestB: T) => number; +}; + +declare type Datamodel = ReadonlyDeep_2<{ + models: Model[]; + enums: DatamodelEnum[]; + types: Model[]; + indexes: Index[]; +}>; + +declare type DatamodelEnum = ReadonlyDeep_2<{ + name: string; + values: EnumValue[]; + dbName?: string | null; + documentation?: string; +}>; + +declare function datamodelEnumToSchemaEnum(datamodelEnum: DatamodelEnum): SchemaEnum; + +declare type Datasource = { + url?: string; +}; + +declare type Datasources = { + [name in string]: Datasource; +}; + +declare class DbNull extends NullTypesEnumValue { + #private; +} + +export declare const Debug: typeof debugCreate & { + enable(namespace: any): void; + disable(): any; + enabled(namespace: string): boolean; + log: (...args: string[]) => void; + formatters: {}; +}; + +/** + * Create a new debug instance with the given namespace. + * + * @example + * ```ts + * import Debug from '@prisma/debug' + * const debug = Debug('prisma:client') + * debug('Hello World') + * ``` + */ +declare function debugCreate(namespace: string): ((...args: any[]) => void) & { + color: string; + enabled: boolean; + namespace: string; + log: (...args: string[]) => void; + extend: () => void; +}; + +export declare function Decimal(n: Decimal.Value): Decimal; + +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 = Args extends { + omit: infer LocalOmit; +} ? ApplyOmit['default'], PatchFlat>>> : ApplyOmit['default'], ExtractGlobalOmit>>; + +export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; + +declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Client)): (client: Client) => Client; + +declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"]; + +declare type Deprecation = ReadonlyDeep_2<{ + sinceVersion: string; + reason: string; + plannedRemovalVersion?: string; +}>; + +declare type DeserializedResponse = Array>; + +export declare function deserializeJsonResponse(result: unknown): unknown; + +export declare function deserializeRawResult(response: RawResponse): DeserializedResponse; + +export declare type DevTypeMapDef = { + meta: { + modelProps: string; + }; + model: { + [Model in PropertyKey]: { + [Operation in PropertyKey]: DevTypeMapFnDef; + }; + }; + other: { + [Operation in PropertyKey]: DevTypeMapFnDef; + }; +}; + +export declare type DevTypeMapFnDef = { + args: any; + result: any; + payload: OperationPayload; +}; + +export declare namespace DMMF { + export { + datamodelEnumToSchemaEnum, + Document_2 as Document, + Mappings, + OtherOperationMappings, + DatamodelEnum, + SchemaEnum, + EnumValue, + Datamodel, + uniqueIndex, + PrimaryKey, + Model, + FieldKind, + FieldNamespace, + FieldLocation, + Field, + FieldDefault, + FieldDefaultScalar, + Index, + IndexType, + IndexField, + SortOrder, + Schema, + Query, + QueryOutput, + TypeRef, + InputTypeRef, + SchemaArg, + OutputType, + SchemaField, + OutputTypeRef, + Deprecation, + InputType, + FieldRefType, + FieldRefAllowType, + ModelMapping, + ModelAction + } +} + +declare namespace DMMF_2 { + export { + datamodelEnumToSchemaEnum, + Document_2 as Document, + Mappings, + OtherOperationMappings, + DatamodelEnum, + SchemaEnum, + EnumValue, + Datamodel, + uniqueIndex, + PrimaryKey, + Model, + FieldKind, + FieldNamespace, + FieldLocation, + Field, + FieldDefault, + FieldDefaultScalar, + Index, + IndexType, + IndexField, + SortOrder, + Schema, + Query, + QueryOutput, + TypeRef, + InputTypeRef, + SchemaArg, + OutputType, + SchemaField, + OutputTypeRef, + Deprecation, + InputType, + FieldRefType, + FieldRefAllowType, + ModelMapping, + ModelAction + } +} + +export declare function dmmfToRuntimeDataModel(dmmfDataModel: DMMF_2.Datamodel): RuntimeDataModel; + +declare type Document_2 = ReadonlyDeep_2<{ + datamodel: Datamodel; + schema: Schema; + mappings: Mappings; +}>; + +/** + * A generic driver adapter factory that allows the user to instantiate a + * driver adapter. The query and result types are specific to the adapter. + */ +declare interface DriverAdapterFactory extends AdapterInfo { + /** + * Instantiate a driver adapter. + */ + connect(): Promise>; +} + +/** 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]: P extends keyof ClientOtherOps ? ClientOtherOps[P] : never; +} & { + [P in Exclude]: DynamicClientExtensionThisBuiltin[P]; +} & { + [K: symbol]: { + types: TypeMap['other']; + }; +}; + +export declare type DynamicClientExtensionThisBuiltin> = { + $extends: ExtendsHook<'extends', TypeMapCb, ExtArgs, Call>; + $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, [K]> | Null> & DynamicModelExtensionFluentApi>; +}; + +export declare type DynamicModelExtensionFnResult = P extends FluentOperation ? DynamicModelExtensionFluentApi & PrismaPromise | Null> : PrismaPromise>; + +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; + }) => 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; +} : never : never) & { + query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise; +}; + +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 interface Engine { + /** The name of the engine. This is meant to be consumed externally */ + readonly name: string; + onBeforeExit(callback: () => Promise): void; + start(): Promise; + stop(): Promise; + version(forceRun?: boolean): Promise | string; + request(query: JsonQuery, options: RequestOptions): Promise>; + requestBatch(queries: JsonQuery[], options: RequestBatchOptions): Promise[]>; + transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise>; + transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; + transaction(action: 'rollback', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; + metrics(options: MetricsOptionsJson): Promise; + metrics(options: MetricsOptionsPrometheus): Promise; + applyPendingMigrations(): Promise; +} + +declare interface EngineConfig { + cwd: string; + dirname: string; + enableDebugLogs?: boolean; + allowTriggerPanic?: boolean; + prismaPath?: string; + generator?: GeneratorConfig; + /** + * @remarks this field is used internally by Policy, do not rename or remove + */ + overrideDatasources: Datasources; + showColors?: boolean; + logQueries?: boolean; + logLevel?: 'info' | 'warn'; + env: Record; + flags?: string[]; + clientVersion: string; + engineVersion: string; + previewFeatures?: string[]; + engineEndpoint?: string; + activeProvider?: string; + logEmitter: LogEmitter; + transactionOptions: Transaction_2.Options; + /** + * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`. + * If set, this is only used in the library engine, and all queries would be performed through it, + * rather than Prisma's Rust drivers. + * @remarks only used by LibraryEngine.ts + */ + adapter?: SqlDriverAdapterFactory; + /** + * The contents of the schema encoded into a string + */ + inlineSchema: string; + /** + * The contents of the datasource url saved in a string + * @remarks only used by DataProxyEngine.ts + * @remarks this field is used internally by Policy, do not rename or remove + */ + inlineDatasources: GetPrismaClientConfig['inlineDatasources']; + /** + * The string hash that was produced for a given schema + * @remarks only used by DataProxyEngine.ts + */ + 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; + /** + * Web Assembly module loading configuration + */ + engineWasm?: EngineWasmLoadingConfig; + compilerWasm?: CompilerWasmLoadingConfig; + /** + * Allows Accelerate to use runtime utilities from the client. These are + * necessary for the AccelerateEngine to function correctly. + */ + accelerateUtils?: { + resolveDatasourceUrl: typeof resolveDatasourceUrl; + getBatchRequestPayload: typeof getBatchRequestPayload; + prismaGraphQLToJSError: typeof prismaGraphQLToJSError; + PrismaClientUnknownRequestError: typeof PrismaClientUnknownRequestError; + PrismaClientInitializationError: typeof PrismaClientInitializationError; + PrismaClientKnownRequestError: typeof PrismaClientKnownRequestError; + debug: (...args: any[]) => void; + engineVersion: string; + clientVersion: string; + }; +} + +declare type EngineEvent = E extends QueryEventType ? QueryEvent : LogEvent; + +declare type EngineEventType = QueryEventType | LogEventType; + +declare type EngineSpan = { + id: EngineSpanId; + parentId: string | null; + name: string; + startTime: HrTime; + endTime: HrTime; + kind: EngineSpanKind; + attributes?: Record; + links?: EngineSpanId[]; +}; + +declare type EngineSpanId = string; + +declare type EngineSpanKind = 'client' | 'internal'; + +declare type EngineWasmLoadingConfig = { + /** + * WASM-bindgen runtime for corresponding module + */ + getRuntime: () => Promise<{ + __wbg_set_wasm(exports: unknown): void; + QueryEngine: QueryEngineConstructor; + }>; + /** + * Loads the raw wasm module for the wasm query engine. This configuration is + * generated specifically for each type of client, eg. Node.js client and Edge + * clients will have different implementations. + * @remarks this is a callback on purpose, we only load the wasm if needed. + * @remarks only used by LibraryEngine + */ + getQueryEngineWasmModule: () => Promise; +}; + +declare type EnumValue = ReadonlyDeep_2<{ + name: string; + dbName: string | null; +}>; + +declare type EnvPaths = { + rootEnvPath: string | null; + schemaEnvPath: string | undefined; +}; + +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; + +declare type Error_2 = { + kind: 'GenericJs'; + id: number; +} | { + kind: 'UnsupportedNativeDataType'; + type: string; +} | { + kind: 'InvalidIsolationLevel'; + level: string; +} | { + kind: 'LengthMismatch'; + column?: string; +} | { + kind: 'UniqueConstraintViolation'; + fields: string[]; +} | { + kind: 'NullConstraintViolation'; + fields: string[]; +} | { + kind: 'ForeignKeyConstraintViolation'; + constraint?: { + fields: string[]; + } | { + index: string; + } | { + foreignKey: {}; + }; +} | { + kind: 'DatabaseDoesNotExist'; + db?: string; +} | { + kind: 'DatabaseAlreadyExists'; + db?: string; +} | { + kind: 'DatabaseAccessDenied'; + db?: string; +} | { + kind: 'AuthenticationFailed'; + user?: string; +} | { + kind: 'TransactionWriteConflict'; +} | { + kind: 'TableDoesNotExist'; + table?: string; +} | { + kind: 'ColumnNotFound'; + column?: string; +} | { + kind: 'TooManyConnections'; + cause: string; +} | { + kind: 'SocketTimeout'; +} | { + kind: 'postgres'; + code: string; + severity: string; + message: string; + detail: string | undefined; + column: string | undefined; + hint: string | undefined; +} | { + kind: 'mysql'; + code: number; + message: string; + state: string; +} | { + kind: 'sqlite'; + /** + * Sqlite extended error code: https://www.sqlite.org/rescode.html + */ + extendedCode: number; + message: string; +}; + +declare type ErrorCapturingFunction = T extends (...args: infer A) => Promise ? (...args: A) => Promise>> : T extends (...args: infer A) => infer R ? (...args: A) => Result_4> : T; + +declare type ErrorCapturingInterface = { + [K in keyof T]: ErrorCapturingFunction; +}; + +declare interface ErrorCapturingSqlDriverAdapter extends ErrorCapturingInterface { + readonly errorRegistry: ErrorRegistry; +} + +declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; + +declare type ErrorRecord = { + error: unknown; +}; + +declare interface ErrorRegistry { + consumeError(id: number): ErrorRecord | undefined; +} + +declare interface ErrorWithBatchIndex { + batchRequestIdx?: number; +} + +declare type EventCallback = [E] extends ['beforeExit'] ? () => Promise : [E] extends [LogLevel] ? (event: EngineEvent) => void : never; + +export declare type Exact = (A extends unknown ? (W extends A ? { + [K in keyof A]: Exact; +} : W) : never) | (A extends Narrowable ? A : never); + +/** + * Defines Exception. + * + * string or an object with one of (message or name or code) and optional stack + */ +declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; + +declare interface ExceptionWithCode { + code: string | number; + name?: string; + message?: string; + stack?: string; +} + +declare interface ExceptionWithMessage { + code?: string | number; + message: string; + name?: string; + stack?: string; +} + +declare interface ExceptionWithName { + code?: string | number; + message?: string; + name: string; + stack?: string; +} + +declare type ExtendedEventType = LogLevel | 'beforeExit'; + +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]; +} + +export declare type ExtensionArgs = Optional; + +declare namespace Extensions { + export { + defineExtension, + getExtensionContext + } +} +export { Extensions } + +declare namespace Extensions_2 { + export { + InternalArgs, + DefaultArgs, + GetPayloadResultExtensionKeys, + GetPayloadResultExtensionObject, + GetPayloadResult, + GetSelect, + GetOmit, + DynamicQueryExtensionArgs, + DynamicQueryExtensionCb, + DynamicQueryExtensionCbArgs, + DynamicQueryExtensionCbArgsArgs, + DynamicResultExtensionArgs, + DynamicResultExtensionNeeds, + DynamicResultExtensionData, + DynamicModelExtensionArgs, + DynamicModelExtensionThis, + DynamicModelExtensionOperationFn, + DynamicModelExtensionFnResult, + DynamicModelExtensionFnResultBase, + DynamicModelExtensionFluentApi, + DynamicModelExtensionFnResultNull, + DynamicClientExtensionArgs, + DynamicClientExtensionThis, + ClientBuiltInProp, + DynamicClientExtensionThisBuiltin, + ExtendsHook, + MergeExtArgs, + AllModelsToStringIndex, + TypeMapDef, + DevTypeMapDef, + DevTypeMapFnDef, + ClientOptionDef, + ClientOtherOps, + TypeMapCbDef, + ModelKey, + RequiredExtensionArgs as UserArgs + } +} + +export declare type ExtractGlobalOmit = Options extends { + omit: { + [K in ModelName]: infer GlobalOmit; + }; +} ? GlobalOmit : {}; + +declare type Field = ReadonlyDeep_2<{ + 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; + /** + * Native database type, if specified. + * For example, `@db.VarChar(191)` is encoded as `['VarChar', ['191']]`, + * `@db.Text` is encoded as `['Text', []]`. + */ + nativeType?: [string, string[]] | null; + dbName?: string | null; + hasDefaultValue: boolean; + default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; + relationFromFields?: string[]; + relationToFields?: string[]; + relationOnDelete?: string; + relationOnUpdate?: string; + relationName?: string; + documentation?: string; +}>; + +declare type FieldDefault = ReadonlyDeep_2<{ + name: string; + args: Array; +}>; + +declare type FieldDefaultScalar = string | boolean | number; + +declare type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; + +declare type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; + +declare type FieldNamespace = 'model' | 'prisma'; + +/** + * 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; +} + +declare type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>; + +declare type FieldRefType = ReadonlyDeep_2<{ + name: string; + allowTypes: FieldRefAllowType[]; + fields: SchemaArg[]; +}>; + +declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete'; + +export declare interface Fn { + params: Params; + returns: Returns; +} + +declare interface GeneratorConfig { + name: string; + output: EnvValue | null; + isCustomOutput?: boolean; + provider: EnvValue; + config: { + /** `output` is a reserved name and will only be available directly at `generator.output` */ + output?: never; + /** `provider` is a reserved name and will only be available directly at `generator.provider` */ + provider?: never; + /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */ + binaryTargets?: never; + /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */ + previewFeatures?: never; + } & { + [key: string]: string | string[] | undefined; + }; + binaryTargets: BinaryTargetsEnvValue[]; + previewFeatures: string[]; + envPaths?: EnvPaths; + sourceFilePath: 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; + }; +}; + +declare function getBatchRequestPayload(batch: JsonQuery[], transaction?: TransactionOptions_3): QueryEngineBatchRequest; + +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 | Skip | null ? never : K]: (S & I)[K] extends object ? P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult | SelectField & null : never : K extends '_count' ? Count> : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? 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]; +}> : {}[]; + +export declare type GetOmit = { + [K in (string extends keyof R ? never : keyof R) | BaseKeys]?: boolean | ExtraType; +}; + +export declare type GetPayloadResult, R extends InternalArgs['result'][string]> = Omit> & GetPayloadResultExtensionObject; + +export declare type GetPayloadResultExtensionKeys = KR; + +export declare type GetPayloadResultExtensionObject = { + [K in GetPayloadResultExtensionKeys]: R[K] extends () => { + compute: (...args: any) => infer C; + } ? C : never; +}; + +export declare function getPrismaClient(config: GetPrismaClientConfig): { + new (optionsArg?: PrismaClientOptions): { + _originalClient: any; + _runtimeDataModel: RuntimeDataModel; + _requestHandler: RequestHandler; + _connectionPromise?: Promise | undefined; + _disconnectionPromise?: Promise | undefined; + _engineConfig: EngineConfig; + _accelerateEngineConfig: AccelerateEngineConfig; + _clientVersion: string; + _errorFormat: ErrorFormat; + _tracingHelper: TracingHelper; + _middlewares: MiddlewareHandler; + _previewFeatures: string[]; + _activeProvider: string; + _globalOmit?: GlobalOmitOptions | undefined; + _extensions: MergedExtensionsList; + /** + * @remarks This is used internally by Policy, do not rename or remove + */ + _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: E, callback: EventCallback): any; + $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_2; + /** + * 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_2; + /** + * Executes a raw command only for MongoDB + * + * @param command + * @returns + */ + $runCommandRaw(command: Record): PrismaPromise_2; + /** + * 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_2; + /** + * Counterpart to $queryRaw, that returns strongly typed results + * @param typedSql + */ + $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2; + /** + * 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_2; + /** + * Execute a batch of requests in a transaction + * @param requests + * @param options + */ + _transactionWithArray({ promises, options, }: { + promises: Array>; + options?: BatchTransactionOptions; + }): Promise; + /** + * Perform a long-running transaction + * @param callback + * @param options + * @returns + */ + _transactionWithCallback({ callback, options, }: { + callback: (client: Client) => Promise; + options?: TransactionOptions_2; + }): 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; + $metrics: MetricsClient; + /** + * Shortcut for checking a preview flag + * @param feature preview flag + * @returns + */ + _hasPreviewFlag(feature: string): boolean; + $applyPendingMigrations(): Promise; + $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; + clientVersion: string; + engineVersion: string; + datasourceNames: string[]; + activeProvider: ActiveConnectorType; + /** + * 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 `false` when the client was generated with --no-engine. At + * runtime, this means the client will be bound to be using the Data Proxy. + */ + copyEngine?: boolean; + /** + * Optional wasm loading configuration + */ + engineWasm?: EngineWasmLoadingConfig; + compilerWasm?: CompilerWasmLoadingConfig; +}; + +export declare type GetResult = { + findUnique: GetFindResult | null; + findUniqueOrThrow: GetFindResult; + findFirst: GetFindResult | null; + findFirstOrThrow: GetFindResult; + findMany: GetFindResult[]; + create: GetFindResult; + createMany: GetBatchResult; + createManyAndReturn: GetFindResult[]; + update: GetFindResult; + updateMany: GetBatchResult; + updateManyAndReturn: GetFindResult[]; + upsert: GetFindResult; + delete: GetFindResult; + deleteMany: GetBatchResult; + aggregate: GetAggregateResult; + count: GetCountResult; + groupBy: GetGroupByResult; + $queryRaw: unknown; + $queryRawTyped: unknown; + $executeRaw: number; + $queryRawUnsafe: unknown; + $executeRawUnsafe: number; + $runCommandRaw: JsonObject; + findRaw: JsonObject; + aggregateRaw: JsonObject; +}[OperationName]; + +export declare function getRuntime(): GetRuntimeOutput; + +declare type GetRuntimeOutput = { + id: RuntimeName; + prettyName: string; + isEdge: boolean; +}; + +export declare type GetSelect, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { + [K in KR | keyof Base]?: K extends KR ? boolean : Base[K]; +}; + +declare type GlobalOmitOptions = { + [modelName: string]: { + [fieldName: string]: boolean; + }; +}; + +declare type HandleErrorParams = { + args: JsArgs; + error: any; + clientMethod: string; + callsite?: CallSite; + transaction?: PrismaPromiseTransaction; + modelName?: string; + globalOmit?: GlobalOmitOptions; +}; + +declare type HrTime = [number, number]; + +/** + * 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]. + */ +declare type HrTime_2 = [number, number]; + +declare type Index = ReadonlyDeep_2<{ + model: string; + type: IndexType; + isDefinedOnField: boolean; + name?: string; + dbName?: string; + algorithm?: string; + clustered?: boolean; + fields: IndexField[]; +}>; + +declare type IndexField = ReadonlyDeep_2<{ + name: string; + sortOrder?: SortOrder; + length?: number; + operatorClass?: string; +}>; + +declare type IndexType = 'id' | 'normal' | 'unique' | 'fulltext'; + +/** + * Matches a JSON array. + * Unlike \`JsonArray\`, readonly arrays are assignable to this type. + */ +export declare interface InputJsonArray extends ReadonlyArray { +} + +/** + * Matches a JSON object. + * Unlike \`JsonObject\`, this type allows undefined and read-only properties. + */ +export declare type InputJsonObject = { + readonly [Key in string]?: InputJsonValue | null; +}; + +/** + * 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 declare type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { + toJSON(): unknown; +}; + +declare type InputType = ReadonlyDeep_2<{ + name: string; + constraints: { + maxNumFields: number | null; + minNumFields: number | null; + fields?: string[]; + }; + meta?: { + source?: string; + grouping?: string; + }; + fields: SchemaArg[]; +}>; + +declare type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>; + +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; +}; + +declare type InteractiveTransactionOptions = Transaction_2.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]; + }; +}; + +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_2) => UserArgs_2; + /** Used to convert args for middleware and back */ + middlewareArgsMapper?: MiddlewareArgsMapper; + /** Used for Accelerate client extension via Data Proxy */ + customDataProxyFetch?: CustomDataProxyFetch; +} & Omit; + +declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE'; + +declare function isSkip(value: unknown): value is Skip; + +export declare function isTypedSql(value: unknown): value is UnknownTypedSql; + +export declare type ITXClientDenyList = (typeof denylist)[number]; + +export declare const itxClientDenyList: readonly (string | symbol)[]; + +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: readonly RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; + +export declare type JsArgs = { + select?: Selection_2; + include?: Selection_2; + omit?: Omission; + [argName: string]: JsInputValue; +}; + +export declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | JsonConvertible | FieldRef | JsInputValue[] | Skip | { + [key: string]: JsInputValue; +}; + +declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | { + [key: string]: JsonArgumentValue; +}; + +/** + * From https://github.com/sindresorhus/type-fest/ + * Matches a JSON array. + */ +export declare interface JsonArray extends Array { +} + +export declare type JsonBatchQuery = { + batch: JsonQuery[]; + transaction?: { + isolationLevel?: IsolationLevel; + }; +}; + +export declare interface JsonConvertible { + toJSON(): unknown; +} + +declare type JsonFieldSelection = { + arguments?: Record | RawTaggedValue; + selection: JsonSelectionSet; +}; + +declare class JsonNull extends NullTypesEnumValue { + #private; +} + +/** + * 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 declare type JsonObject = { + [Key in string]?: JsonValue; +}; + +export declare type JsonQuery = { + modelName?: string; + action: JsonQueryAction; + query: JsonFieldSelection; +}; + +declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'updateManyAndReturn' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw'; + +declare type JsonSelectionSet = { + $scalars?: boolean; + $composites?: boolean; +} & { + [fieldName: string]: boolean | JsonFieldSelection; +}; + +/** + * From https://github.com/sindresorhus/type-fest/ + * Matches any valid JSON value. + */ +export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null; + +export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | { + [key: string]: JsOutputValue; +}; + +export declare type JsPromise = Promise & {}; + +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. + */ +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; +} + +declare type LoadedEnv = { + message?: string; + parsed: { + [x: string]: string; + }; +} | undefined; + +declare type LocationInFile = { + fileName: string; + lineNumber: number | null; + columnNumber: number | null; +}; + +declare type LogDefinition = { + level: LogLevel; + emit: 'stdout' | 'event'; +}; + +/** + * Typings for the events we emit. + * + * @remarks + * If this is updated, our edge runtime shim needs to be updated as well. + */ +declare type LogEmitter = { + on(event: E, listener: (event: EngineEvent) => void): LogEmitter; + emit(event: QueryEventType, payload: QueryEvent): boolean; + emit(event: LogEventType, payload: LogEvent): boolean; +}; + +declare type LogEvent = { + timestamp: Date; + message: string; + target: string; +}; + +declare type LogEventType = 'info' | 'warn' | 'error'; + +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; + +export declare function makeTypedQueryFactory(sql: string): (...values: any[]) => TypedSql; + +declare type Mappings = ReadonlyDeep_2<{ + modelOperations: ModelMapping[]; + otherOperations: { + read: string[]; + write: string[]; + }; +}>; + +/** + * 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: ExtensionArgs): MergedExtensionsList; + isEmpty(): boolean; + append(extension: ExtensionArgs): 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 _client; + constructor(client: Client); + /** + * 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; +} + +declare type MetricsOptions = { + /** + * Labels to add to every metrics in key-value format + */ + globalLabels?: Record; +}; + +declare type MetricsOptionsCommon = { + globalLabels?: Record; +}; + +declare type MetricsOptionsJson = { + format: 'json'; +} & MetricsOptionsCommon; + +declare type MetricsOptionsPrometheus = { + format: 'prometheus'; +} & MetricsOptionsCommon; + +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; +} + +declare type Model = ReadonlyDeep_2<{ + name: string; + dbName: string | null; + schema: string | null; + fields: Field[]; + uniqueFields: string[][]; + uniqueIndexes: uniqueIndex[]; + documentation?: string; + primaryKey: PrimaryKey | null; + isGenerated?: boolean; +}>; + +declare enum ModelAction { + findUnique = "findUnique", + findUniqueOrThrow = "findUniqueOrThrow", + findFirst = "findFirst", + findFirstOrThrow = "findFirstOrThrow", + findMany = "findMany", + create = "create", + createMany = "createMany", + createManyAndReturn = "createManyAndReturn", + update = "update", + updateMany = "updateMany", + updateManyAndReturn = "updateManyAndReturn", + upsert = "upsert", + delete = "delete", + deleteMany = "deleteMany", + groupBy = "groupBy", + count = "count",// TODO: count does not actually exist in DMMF + aggregate = "aggregate", + findRaw = "findRaw", + aggregateRaw = "aggregateRaw" +} + +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; + +declare type ModelMapping = ReadonlyDeep_2<{ + 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; + createManyAndReturn?: string | null; + update?: string | null; + updateMany?: string | null; + updateManyAndReturn?: 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 declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise; + +export declare type ModelQueryOptionsCbArgs = { + model: string; + operation: string; + args: JsArgs; + query: (args: JsArgs) => Promise; +}; + +declare type MultiBatchResponse = { + type: 'multi'; + plans: object[]; +}; + +export declare type NameArgs = { + name?: string; +}; + +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; + +declare class NullTypesEnumValue extends ObjectEnumValue { + _getNamespace(): string; +} + +/** + * Base class for unique values of object-valued enums. + */ +export 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; + }; +}; + +declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"]; + +export declare type Omission = Record; + +declare type Omit_2 = { + [P in keyof T as P extends K ? never : P]: T[P]; +}; +export { Omit_2 as Omit } + +export declare type OmitValue = Key extends keyof Omit ? Omit[Key] : false; + +export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; + +export declare type OperationPayload = { + name: string; + scalars: { + [ScalarName in string]: unknown; + }; + objects: { + [ObjectName in string]: unknown; + }; + composites: { + [CompositeName in string]: unknown; + }; +}; + +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]; + +declare type Options = { + clientVersion: string; +}; + +export declare type Or = { + 0: { + 0: 0; + 1: 1; + }; + 1: { + 0: 1; + 1: 1; + }; +}[A][B]; + +declare type OtherOperationMappings = ReadonlyDeep_2<{ + read: string[]; + write: string[]; +}>; + +declare type OutputType = ReadonlyDeep_2<{ + name: string; + fields: SchemaField[]; +}>; + +declare type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>; + +export declare function Param<$Type, $Value extends string>(name: $Value): Param<$Type, $Value>; + +export declare type Param = { + readonly name: $Value; +}; + +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 = T extends { + [K: symbol]: { + types: { + payload: any; + }; + }; +} ? T[symbol]['types']['payload'] : any; + +export declare type PayloadToResult = RenameAndNestPayloadKeys

> = { + [K in keyof O]?: O[K][K] extends any[] ? PayloadToResult[] : O[K][K] extends object ? PayloadToResult : O[K][K]; +}; + +declare type Pick_2 = { + [P in keyof T as P extends K ? P : never]: T[P]; +}; +export { Pick_2 as Pick } + +declare type PrimaryKey = ReadonlyDeep_2<{ + name: string | null; + fields: string[]; +}>; + +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; + /** + * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale. + */ + adapter?: SqlDriverAdapterFactory | null; + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources; + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat; + /** + * The default values for Transaction options + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: Transaction_2.Options; + /** + * @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; + omit?: GlobalOmitOptions; + /** + * @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; + }; + /** This can be used for testing purposes */ + configOverride?: (config: GetPrismaClientConfig) => GetPrismaClientConfig; + }; +}; + +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; +} + +declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError; + +declare type PrismaOperationSpec = { + args: TArgs; + action: TAction; + model: string; +}; + +export declare interface PrismaPromise extends Promise { + [Symbol.toStringTag]: 'PrismaPromise'; +} + +/** + * 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]] + */ +declare interface PrismaPromise_2 = any> extends Promise { + get spec(): TSpec; + /** + * 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: TResult) => 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; +} + +declare type PrismaPromiseBatchTransaction = { + kind: 'batch'; + id: number; + isolationLevel?: IsolationLevel; + index: number; + lock: PromiseLike; +}; + +declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => Promise; + +/** + * 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 + */ +declare type PrismaPromiseFactory = >(callback: PrismaPromiseCallback, op?: T) => PrismaPromise_2; + +declare type PrismaPromiseInteractiveTransaction = { + kind: 'itx'; + id: string; + payload: PayloadType; +}; + +declare type PrismaPromiseTransaction = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction; + +export declare const PrivateResultType: unique symbol; + +declare type Provider = 'mysql' | 'postgres' | 'sqlite'; + +declare namespace Public { + export { + validator + } +} +export { Public } + +declare namespace Public_2 { + export { + Args, + Result, + Payload, + PrismaPromise, + Operation, + Exact + } +} + +declare type Query = ReadonlyDeep_2<{ + name: string; + args: SchemaArg[]; + output: QueryOutput; +}>; + +declare interface Queryable extends AdapterInfo { + /** + * Execute a query and return its result. + */ + queryRaw(params: Query): Promise; + /** + * Execute a query and return the number of affected rows. + */ + executeRaw(params: Query): Promise; +} + +declare type QueryCompiler = { + compile(request: string): string; + compileBatch(batchRequest: string): BatchResponse; +}; + +declare interface QueryCompilerConstructor { + new (options: QueryCompilerOptions): QueryCompiler; +} + +declare type QueryCompilerOptions = { + datamodel: string; + provider: Provider; + connectionInfo: ConnectionInfo; +}; + +declare type QueryEngineBatchGraphQLRequest = { + batch: QueryEngineRequest[]; + transaction?: boolean; + isolationLevel?: IsolationLevel; +}; + +declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery; + +declare type QueryEngineConfig = { + datamodel: string; + configDir: string; + logQueries: boolean; + ignoreEnvVarErrors: boolean; + datasourceOverrides: Record; + env: Record; + logLevel: QueryEngineLogLevel; + engineProtocol: QueryEngineProtocol; + enableTracing: boolean; +}; + +declare interface QueryEngineConstructor { + new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingSqlDriverAdapter): QueryEngineInstance; +} + +declare type QueryEngineInstance = { + connect(headers: string, requestId: string): Promise; + disconnect(headers: string, requestId: string): Promise; + /** + * @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest` + * @param headersStr JSON.stringified `QueryEngineRequestHeaders` + */ + query(requestStr: string, headersStr: string, transactionId: string | undefined, requestId: string): Promise; + sdlSchema?(): Promise; + startTransaction(options: string, traceHeaders: string, requestId: string): Promise; + commitTransaction(id: string, traceHeaders: string, requestId: string): Promise; + rollbackTransaction(id: string, traceHeaders: string, requestId: string): Promise; + metrics?(options: string): Promise; + applyPendingMigrations?(): Promise; + trace(requestId: string): Promise; +}; + +declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off'; + +declare type QueryEngineProtocol = 'graphql' | 'json'; + +declare type QueryEngineRequest = { + query: string; + variables: Object; +}; + +declare type QueryEngineResultData = { + data: T; +}; + +declare type QueryEvent = { + timestamp: Date; + query: string; + params: string; + duration: number; + target: string; +}; + +declare type QueryEventType = 'query'; + +declare type QueryIntrospectionBuiltinType = 'int' | 'bigint' | 'float' | 'double' | 'string' | 'enum' | 'bytes' | 'bool' | 'char' | 'decimal' | 'json' | 'xml' | 'uuid' | 'datetime' | 'date' | 'time' | 'int-array' | 'bigint-array' | 'float-array' | 'double-array' | 'string-array' | 'char-array' | 'bytes-array' | 'bool-array' | 'decimal-array' | 'json-array' | 'xml-array' | 'uuid-array' | 'datetime-array' | 'date-array' | 'time-array' | 'null' | 'unknown'; + +declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise) => Promise; + +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_2; +}; + +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; +}; + +declare type QueryOutput = ReadonlyDeep_2<{ + name: string; + isRequired: boolean; + isList: boolean; +}>; + +/** + * Create raw SQL statement. + */ +export declare function raw(value: string): Sql; + +export declare type RawParameters = { + __prismaRawParameters__: true; + values: string; +}; + +export declare type RawQueryArgs = Sql | UnknownTypedSql | [query: string, ...values: RawValue[]]; + +declare type RawResponse = { + columns: string[]; + types: QueryIntrospectionBuiltinType[]; + rows: unknown[][]; +}; + +declare type RawTaggedValue = { + $type: 'Raw'; + value: unknown; +}; + +/** + * Supported value or SQL instance. + */ +export declare type RawValue = Value | Sql; + +export declare type ReadonlyDeep = { + readonly [K in keyof T]: ReadonlyDeep; +}; + +declare type ReadonlyDeep_2 = { + +readonly [K in keyof O]: ReadonlyDeep_2; +}; + +declare type Record_2 = { + [P in T]: U; +}; +export { Record_2 as Record } + +export declare type RenameAndNestPayloadKeys

= { + [K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K]; +}; + +declare type RequestBatchOptions = { + transaction?: TransactionOptions_3; + traceparent?: string; + numTry?: number; + containsWrite: boolean; + customDataProxyFetch?: CustomDataProxyFetch; +}; + +declare interface RequestError { + error: string; + user_facing_error: { + is_panic: boolean; + message: string; + meta?: Record; + error_code?: string; + batch_request_idx?: number; + }; +} + +declare class RequestHandler { + client: Client; + dataloader: DataLoader; + private logEmitter?; + constructor(client: Client, logEmitter?: LogEmitter); + request(params: RequestParams): Promise; + mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResultData): 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, modelName, globalOmit, }: HandleErrorParams): never; + sanitizeMessage(message: any): any; + unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any; + get [Symbol.toStringTag](): string; +} + +declare type RequestOptions = { + traceparent?: string; + numTry?: number; + interactiveTransaction?: InteractiveTransactionOptions; + isWrite: boolean; + customDataProxyFetch?: CustomDataProxyFetch; +}; + +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; + globalOmit?: GlobalOmitOptions; + customDataProxyFetch?: CustomDataProxyFetch; +}; + +declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; +export { RequiredExtensionArgs } +export { RequiredExtensionArgs as UserArgs } + +export declare type RequiredKeys = { + [K in keyof O]-?: {} extends Pick_2 ? never : K; +}[keyof O]; + +declare function resolveDatasourceUrl({ inlineDatasources, overrideDatasources, env, clientVersion, }: { + inlineDatasources: GetPrismaClientConfig['inlineDatasources']; + overrideDatasources: Datasources; + env: Record; + clientVersion: string; +}): string; + +export declare type Result = T extends { + [K: symbol]: { + types: { + payload: any; + }; + }; +} ? GetResult : GetResult<{ + composites: {}; + objects: {}; + scalars: {}; + name: ''; +}, {}, F>; + +export declare type Result_2 = Result; + +declare namespace Result_3 { + export { + Count, + GetFindResult, + SelectablePayloadFields, + SelectField, + DefaultSelection, + UnwrapPayload, + ApplyOmit, + OmitValue, + GetCountResult, + Aggregate, + GetAggregateResult, + GetBatchResult, + GetGroupByResult, + GetResult, + ExtractGlobalOmit + } +} + +declare type Result_4 = { + map(fn: (value: T) => U): Result_4; + flatMap(fn: (value: T) => Result_4): Result_4; +} & ({ + readonly ok: true; + readonly value: T; +} | { + readonly ok: false; + readonly error: Error_2; +}); + +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; +}; + +declare type RuntimeEnum = Omit; + +declare type RuntimeModel = Omit; + +declare type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | ''; + +declare type Schema = ReadonlyDeep_2<{ + rootQueryType?: string; + rootMutationType?: string; + inputObjectTypes: { + model?: InputType[]; + prisma: InputType[]; + }; + outputObjectTypes: { + model: OutputType[]; + prisma: OutputType[]; + }; + enumTypes: { + model?: SchemaEnum[]; + prisma: SchemaEnum[]; + }; + fieldRefTypes: { + prisma?: FieldRefType[]; + }; +}>; + +declare type SchemaArg = ReadonlyDeep_2<{ + name: string; + comment?: string; + isNullable: boolean; + isRequired: boolean; + inputTypes: InputTypeRef[]; + deprecation?: Deprecation; +}>; + +declare type SchemaEnum = ReadonlyDeep_2<{ + name: string; + values: string[]; +}>; + +declare type SchemaField = ReadonlyDeep_2<{ + name: string; + isNullable?: boolean; + outputType: OutputTypeRef; + args: SchemaArg[]; + deprecation?: Deprecation; + documentation?: string; +}>; + +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; + +declare type Selection_2 = Record; +export { Selection_2 as Selection } + +export declare function serializeJsonQuery({ modelName, action, args, runtimeDataModel, extensions, callsite, clientMethod, errorFormat, clientVersion, previewFeatures, globalOmit, }: SerializeParams): JsonQuery; + +declare type SerializeParams = { + runtimeDataModel: RuntimeDataModel; + modelName?: string; + action: Action; + args?: JsArgs; + extensions?: MergedExtensionsList; + callsite?: CallSite; + clientMethod: string; + clientVersion: string; + errorFormat: ErrorFormat; + previewFeatures: string[]; + globalOmit?: GlobalOmitOptions; +}; + +declare class Skip { + constructor(param?: symbol); + ifUndefined(value: T | undefined): T | Skip; +} + +export declare const skip: Skip; + +declare type SortOrder = 'asc' | 'desc'; + +/** + * 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. + */ +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; + /** + * Adds a single link to the span. + * + * Links added after the creation will not affect the sampling decision. + * It is preferred span links be added at span creation. + * + * @param link the link to add. + */ + addLink(link: Link): this; + /** + * Adds multiple links to the span. + * + * Links added after the creation will not affect the sampling decision. + * It is preferred span links be added at span creation. + * + * @param links the links to add. + */ + addLinks(links: Link[]): 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} + */ +declare type SpanAttributes = Attributes; + +/** + * @deprecated please use {@link AttributeValue} + */ +declare type SpanAttributeValue = AttributeValue; + +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}. + */ +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 + */ +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; +} + +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 { + readonly values: Value[]; + readonly strings: string[]; + constructor(rawStrings: readonly string[], rawValues: readonly RawValue[]); + get sql(): string; + get statement(): string; + get text(): string; + inspect(): { + sql: string; + statement: string; + text: string; + values: unknown[]; + }; +} + +declare interface SqlDriverAdapter extends SqlQueryable { + /** + * Execute multiple SQL statements separated by semicolon. + */ + executeScript(script: string): Promise; + /** + * Start new transaction. + */ + startTransaction(isolationLevel?: IsolationLevel): Promise; + /** + * Optional method that returns extra connection info + */ + getConnectionInfo?(): ConnectionInfo; + /** + * Dispose of the connection and release any resources. + */ + dispose(): Promise; +} + +export declare interface SqlDriverAdapterFactory extends DriverAdapterFactory { + connect(): Promise; +} + +declare type SqlQuery = { + sql: string; + args: Array; + argTypes: Array; +}; + +declare interface SqlQueryable extends Queryable { +} + +declare interface SqlResultSet { + /** + * List of column types appearing in a database query, in the same order as `columnNames`. + * They are used within the Query Engine to convert values from JS to Quaint values. + */ + columnTypes: Array; + /** + * List of column names appearing in a database query, in the same order as `columnTypes`. + */ + columnNames: Array; + /** + * List of rows retrieved from a database query. + * Each row is a list of values, whose length matches `columnNames` and `columnTypes`. + */ + rows: Array>; + /** + * The last ID of an `INSERT` statement, if any. + * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite. + */ + lastInsertId?: string; +} + +/** + * Create a SQL object from a template string. + */ +export declare function sqltag(strings: readonly string[], ...values: readonly RawValue[]): Sql; + +/** + * Defines TimeInput. + * + * hrtime, epoch milliseconds, performance.now() or Date + */ +declare type TimeInput = HrTime_2 | number | Date; + +export declare type ToTuple = T extends any[] ? T : [T]; + +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; +} + +declare interface TracingHelper { + isEnabled(): boolean; + getTraceParent(context?: Context): string; + dispatchEngineSpans(spans: EngineSpan[]): void; + getActiveContext(): Context | undefined; + runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; +} + +declare interface Transaction extends AdapterInfo, SqlQueryable { + /** + * Transaction options. + */ + readonly options: TransactionOptions; + /** + * Commit the transaction. + */ + commit(): Promise; + /** + * Roll back the transaction. + */ + rollback(): Promise; +} + +declare namespace Transaction_2 { + export { + TransactionOptions_2 as Options, + InteractiveTransactionInfo, + TransactionHeaders + } +} + +declare type TransactionHeaders = { + traceparent?: string; +}; + +declare type TransactionOptions = { + usePhantomQuery: boolean; +}; + +declare type TransactionOptions_2 = { + maxWait?: number; + timeout?: number; + isolationLevel?: IsolationLevel; +}; + +declare type TransactionOptions_3 = { + kind: 'itx'; + options: InteractiveTransactionOptions; +} | { + kind: 'batch'; + options: BatchTransactionOptions; +}; + +export declare class TypedSql { + [PrivateResultType]: Result; + constructor(sql: string, values: Values); + get sql(): string; + get values(): Values; +} + +export declare type TypeMapCbDef = Fn<{ + extArgs: InternalArgs; +}, TypeMapDef>; + +/** Shared */ +export declare type TypeMapDef = Record; + +declare type TypeRef = { + isList: boolean; + type: string; + location: AllowedLocations; + namespace?: FieldNamespace; +}; + +declare namespace Types { + export { + Result_3 as Result, + Extensions_2 as Extensions, + Utils, + Public_2 as Public, + isSkip, + Skip, + skip, + UnknownTypedSql, + OperationPayload as Payload + } +} +export { Types } + +declare type uniqueIndex = ReadonlyDeep_2<{ + name: string; + fields: string[]; +}>; + +declare type UnknownErrorParams = { + clientVersion: string; + batchRequestIdx?: number; +}; + +export declare type UnknownTypedSql = TypedSql; + +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. + */ +declare type UserArgs_2 = any; + +declare namespace Utils { + export { + EmptyToUnknown, + NeverToUnknown, + PatchFlat, + Omit_2 as Omit, + Pick_2 as Pick, + ComputeDeep, + Compute, + OptionalFlat, + ReadonlyDeep, + Narrowable, + Narrow, + Exact, + Cast, + Record_2 as Record, + UnwrapPromise, + 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>(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/src/generated/prisma/runtime/library.js b/src/generated/prisma/runtime/library.js new file mode 100644 index 0000000..9de3763 --- /dev/null +++ b/src/generated/prisma/runtime/library.js @@ -0,0 +1,146 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ +"use strict";var yu=Object.create;var qt=Object.defineProperty;var bu=Object.getOwnPropertyDescriptor;var Eu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,xu=Object.prototype.hasOwnProperty;var Do=(e,r)=>()=>(e&&(r=e(e=0)),r);var ne=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),tr=(e,r)=>{for(var t in r)qt(e,t,{get:r[t],enumerable:!0})},_o=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Eu(r))!xu.call(e,i)&&i!==t&&qt(e,i,{get:()=>r[i],enumerable:!(n=bu(r,i))||n.enumerable});return e};var k=(e,r,t)=>(t=e!=null?yu(wu(e)):{},_o(r||!e||!e.__esModule?qt(t,"default",{value:e,enumerable:!0}):t,e)),vu=e=>_o(qt({},"__esModule",{value:!0}),e);var mi=ne((_g,ss)=>{"use strict";ss.exports=(e,r=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n{"use strict";var Lc=require("node:os"),as=require("node:tty"),de=mi(),{env:Q}=process,Ge;de("no-color")||de("no-colors")||de("color=false")||de("color=never")?Ge=0:(de("color")||de("colors")||de("color=true")||de("color=always"))&&(Ge=1);"FORCE_COLOR"in Q&&(Q.FORCE_COLOR==="true"?Ge=1:Q.FORCE_COLOR==="false"?Ge=0:Ge=Q.FORCE_COLOR.length===0?1:Math.min(parseInt(Q.FORCE_COLOR,10),3));function fi(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function gi(e,r){if(Ge===0)return 0;if(de("color=16m")||de("color=full")||de("color=truecolor"))return 3;if(de("color=256"))return 2;if(e&&!r&&Ge===void 0)return 0;let t=Ge||0;if(Q.TERM==="dumb")return t;if(process.platform==="win32"){let n=Lc.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Q)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Q)||Q.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Q)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Q.TEAMCITY_VERSION)?1:0;if(Q.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Q){let n=parseInt((Q.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Q.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Q.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Q.TERM)||"COLORTERM"in Q?1:t}function Mc(e){let r=gi(e,e&&e.isTTY);return fi(r)}ls.exports={supportsColor:Mc,stdout:fi(gi(!0,as.isatty(1))),stderr:fi(gi(!0,as.isatty(2)))}});var ds=ne((Fg,ps)=>{"use strict";var $c=us(),br=mi();function cs(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e)||[];return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let r=(e||"").split(".").map(t=>parseInt(t,10));return{major:r[0],minor:r[1],patch:r[2]}}function hi(e){let{CI:r,FORCE_HYPERLINK:t,NETLIFY:n,TEAMCITY_VERSION:i,TERM_PROGRAM:o,TERM_PROGRAM_VERSION:s,VTE_VERSION:a,TERM:l}=process.env;if(t)return!(t.length>0&&parseInt(t,10)===0);if(br("no-hyperlink")||br("no-hyperlinks")||br("hyperlink=false")||br("hyperlink=never"))return!1;if(br("hyperlink=true")||br("hyperlink=always")||n)return!0;if(!$c.supportsColor(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||r||i)return!1;if(o){let u=cs(s||"");switch(o){case"iTerm.app":return u.major===3?u.minor>=1:u.major>3;case"WezTerm":return u.major>=20200620;case"vscode":return u.major>1||u.major===1&&u.minor>=72;case"ghostty":return!0}}if(a){if(a==="0.50.0")return!1;let u=cs(a);return u.major>0||u.minor>=50}switch(l){case"alacritty":return!0}return!1}ps.exports={supportsHyperlink:hi,stdout:hi(process.stdout),stderr:hi(process.stderr)}});var ms=ne((Hg,qc)=>{qc.exports={name:"@prisma/internals",version:"6.7.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek ",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-engine-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Ei=ne((zg,Uc)=>{Uc.exports={name:"@prisma/engines-version",version:"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"3cff47a7f5d65c3ea74883f1d736e41d68ce91ed"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var wi=ne(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.enginesVersion=void 0;Xt.enginesVersion=Ei().prisma.enginesVersion});var ys=ne((hh,hs)=>{"use strict";hs.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var Ri=ne((Eh,ws)=>{"use strict";ws.exports=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof r!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(r===0)return e;let n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))}});var Ts=ne((vh,Ps)=>{"use strict";Ps.exports=({onlyFirst:e=!1}={})=>{let r=["[\\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(r,e?void 0:"g")}});var ki=ne((Ph,Ss)=>{"use strict";var Xc=Ts();Ss.exports=e=>typeof e=="string"?e.replace(Xc(),""):e});var Rs=ne((Ch,ep)=>{ep.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var ks=ne((Ah,Ne)=>{"use strict";var Di=require("node:fs"),_i=require("node:path"),rp=require("node:os"),tp=require("node:crypto"),np=Rs(),Ni=np.version,ip=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function op(e){let r={},t=e.toString();t=t.replace(/\r\n?/mg,` +`);let n;for(;(n=ip.exec(t))!=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")),r[i]=o}return r}function sp(e){let r=Is(e),t=B.configDotenv({path:r});if(!t.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=As(e).split(","),i=n.length,o;for(let s=0;s=i)throw a}return B.parse(o)}function ap(e){console.log(`[dotenv@${Ni}][INFO] ${e}`)}function lp(e){console.log(`[dotenv@${Ni}][WARN] ${e}`)}function tn(e){console.log(`[dotenv@${Ni}][DEBUG] ${e}`)}function As(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function up(e,r){let t;try{t=new URL(r)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=t.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=t.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function Is(e){let r=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let t of e.path)Di.existsSync(t)&&(r=t.endsWith(".vault")?t:`${t}.vault`);else r=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else r=_i.resolve(process.cwd(),".env.vault");return Di.existsSync(r)?r:null}function Cs(e){return e[0]==="~"?_i.join(rp.homedir(),e.slice(1)):e}function cp(e){ap("Loading env from encrypted .env.vault");let r=B._parseVault(e),t=process.env;return e&&e.processEnv!=null&&(t=e.processEnv),B.populate(t,r,e),{parsed:r}}function pp(e){let r=_i.resolve(process.cwd(),".env"),t="utf8",n=!!(e&&e.debug);e&&e.encoding?t=e.encoding:n&&tn("No encoding is specified. UTF-8 is used by default");let i=[r];if(e&&e.path)if(!Array.isArray(e.path))i=[Cs(e.path)];else{i=[];for(let l of e.path)i.push(Cs(l))}let o,s={};for(let l of i)try{let u=B.parse(Di.readFileSync(l,{encoding:t}));B.populate(s,u,e)}catch(u){n&&tn(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),B.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function dp(e){if(As(e).length===0)return B.configDotenv(e);let r=Is(e);return r?B._configVault(e):(lp(`You set DOTENV_KEY but you are missing a .env.vault file at ${r}. Did you forget to build it?`),B.configDotenv(e))}function mp(e,r){let t=Buffer.from(r.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=tp.createDecipheriv("aes-256-gcm",t,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function fp(e,r,t={}){let n=!!(t&&t.debug),i=!!(t&&t.override);if(typeof r!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(r))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=r[o]),n&&tn(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=r[o]}var B={configDotenv:pp,_configVault:cp,_parseVault:sp,config:dp,decrypt:mp,parse:op,populate:fp};Ne.exports.configDotenv=B.configDotenv;Ne.exports._configVault=B._configVault;Ne.exports._parseVault=B._parseVault;Ne.exports.config=B.config;Ne.exports.decrypt=B.decrypt;Ne.exports.parse=B.parse;Ne.exports.populate=B.populate;Ne.exports=B});var Ns=ne((Nh,on)=>{"use strict";on.exports=(e={})=>{let r;if(e.repoUrl)r=e.repoUrl;else if(e.user&&e.repo)r=`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 t=new URL(`${r}/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(",")}t.searchParams.set(i,o)}}return t.toString()};on.exports.default=on.exports});var Gi=ne((pb,na)=>{"use strict";na.exports=function(){function e(r,t,n,i,o){return rn?n+1:r+1:i===o?t:t+1}return function(r,t){if(r===t)return 0;if(r.length>t.length){var n=r;r=t,t=n}for(var i=r.length,o=t.length;i>0&&r.charCodeAt(i-1)===t.charCodeAt(o-1);)i--,o--;for(var s=0;s{"use strict"});var ua=Do(()=>{"use strict"});var Vf={};tr(Vf,{DMMF:()=>lt,Debug:()=>N,Decimal:()=>ve,Extensions:()=>ei,MetricsClient:()=>Fr,PrismaClientInitializationError:()=>T,PrismaClientKnownRequestError:()=>z,PrismaClientRustPanicError:()=>le,PrismaClientUnknownRequestError:()=>j,PrismaClientValidationError:()=>Z,Public:()=>ri,Sql:()=>oe,createParam:()=>Sa,defineDmmfProperty:()=>Oa,deserializeJsonResponse:()=>Tr,deserializeRawResult:()=>Yn,dmmfToRuntimeDataModel:()=>zs,empty:()=>Na,getPrismaClient:()=>fu,getRuntime:()=>qn,join:()=>_a,makeStrictEnum:()=>gu,makeTypedQueryFactory:()=>Da,objectEnumValues:()=>Sn,raw:()=>eo,serializeJsonQuery:()=>Dn,skip:()=>On,sqltag:()=>ro,warnEnvConflicts:()=>hu,warnOnce:()=>ot});module.exports=vu(Vf);var ei={};tr(ei,{defineExtension:()=>No,getExtensionContext:()=>Fo});function No(e){return typeof e=="function"?e:r=>r.$extends(e)}function Fo(e){return e}var ri={};tr(ri,{validator:()=>Lo});function Lo(...e){return r=>r}var jt={};tr(jt,{$:()=>Vo,bgBlack:()=>Du,bgBlue:()=>Lu,bgCyan:()=>$u,bgGreen:()=>Nu,bgMagenta:()=>Mu,bgRed:()=>_u,bgWhite:()=>qu,bgYellow:()=>Fu,black:()=>Au,blue:()=>nr,bold:()=>W,cyan:()=>Oe,dim:()=>Ie,gray:()=>Hr,green:()=>qe,grey:()=>Ou,hidden:()=>Ru,inverse:()=>Su,italic:()=>Tu,magenta:()=>Iu,red:()=>ce,reset:()=>Pu,strikethrough:()=>Cu,underline:()=>Y,white:()=>ku,yellow:()=>ke});var ti,Mo,$o,qo,jo=!0;typeof process<"u"&&({FORCE_COLOR:ti,NODE_DISABLE_COLORS:Mo,NO_COLOR:$o,TERM:qo}=process.env||{},jo=process.stdout&&process.stdout.isTTY);var Vo={enabled:!Mo&&$o==null&&qo!=="dumb"&&(ti!=null&&ti!=="0"||jo)};function L(e,r){let t=new RegExp(`\\x1b\\[${r}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${r}m`;return function(o){return!Vo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(t,i+n):o)+i}}var Pu=L(0,0),W=L(1,22),Ie=L(2,22),Tu=L(3,23),Y=L(4,24),Su=L(7,27),Ru=L(8,28),Cu=L(9,29),Au=L(30,39),ce=L(31,39),qe=L(32,39),ke=L(33,39),nr=L(34,39),Iu=L(35,39),Oe=L(36,39),ku=L(37,39),Hr=L(90,39),Ou=L(90,39),Du=L(40,49),_u=L(41,49),Nu=L(42,49),Fu=L(43,49),Lu=L(44,49),Mu=L(45,49),$u=L(46,49),qu=L(47,49);var ju=100,Bo=["green","yellow","blue","magenta","cyan","red"],Kr=[],Uo=Date.now(),Vu=0,ni=typeof process<"u"?process.env:{};globalThis.DEBUG??=ni.DEBUG??"";globalThis.DEBUG_COLORS??=ni.DEBUG_COLORS?ni.DEBUG_COLORS==="true":!0;var Yr={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let r=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),t=r.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=r.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return t&&!n},log:(...e)=>{let[r,t,...n]=e;(console.warn??console.log)(`${r} ${t}`,...n)},formatters:{}};function Bu(e){let r={color:Bo[Vu++%Bo.length],enabled:Yr.enabled(e),namespace:e,log:Yr.log,extend:()=>{}},t=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=r;if(n.length!==0&&Kr.push([o,...n]),Kr.length>ju&&Kr.shift(),Yr.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Uu(c)),u=`+${Date.now()-Uo}ms`;Uo=Date.now(),globalThis.DEBUG_COLORS?a(jt[s](W(o)),...l,jt[s](u)):a(o,...l,u)}};return new Proxy(t,{get:(n,i)=>r[i],set:(n,i,o)=>r[i]=o})}var N=new Proxy(Bu,{get:(e,r)=>Yr[r],set:(e,r,t)=>Yr[r]=t});function Uu(e,r=2){let t=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(t.has(i))return"[Circular *]";t.add(i)}else if(typeof i=="bigint")return i.toString();return i},r)}function Qo(e=7500){let r=Kr.map(([t,...n])=>`${t} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` +`);return r.length!!(e&&typeof e=="object"),Ut=e=>e&&!!e[De],Ee=(e,r,t)=>{if(Ut(e)){let n=e[De](),{matched:i,selections:o}=n.match(r);return i&&o&&Object.keys(o).forEach(s=>t(s,o[s])),i}if(si(e)){if(!si(r))return!1;if(Array.isArray(e)){if(!Array.isArray(r))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];Ut(a)&&a[Qu]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(r.lengthEe(u,s[c],t))&&i.every((u,c)=>Ee(u,a[c],t))&&(o.length===0||Ee(o[0],l,t))}return e.length===r.length&&e.every((s,a)=>Ee(s,r[a],t))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in r||Ut(o=i)&&o[De]().matcherType==="optional")&&Ee(i,r[n],t);var o})}return Object.is(r,e)},Qe=e=>{var r,t,n;return si(e)?Ut(e)?(r=(t=(n=e[De]()).getSelectionKeys)==null?void 0:t.call(n))!=null?r:[]:Array.isArray(e)?zr(e,Qe):zr(Object.values(e),Qe):[]},zr=(e,r)=>e.reduce((t,n)=>t.concat(r(n)),[]);function pe(e){return Object.assign(e,{optional:()=>Gu(e),and:r=>q(e,r),or:r=>Wu(e,r),select:r=>r===void 0?Jo(e):Jo(r,e)})}function Gu(e){return pe({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return r===void 0?(Qe(e).forEach(i=>n(i,void 0)),{matched:!0,selections:t}):{matched:Ee(e,r,n),selections:t}},getSelectionKeys:()=>Qe(e),matcherType:"optional"})})}function q(...e){return pe({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return{matched:e.every(i=>Ee(i,r,n)),selections:t}},getSelectionKeys:()=>zr(e,Qe),matcherType:"and"})})}function Wu(...e){return pe({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return zr(e,Qe).forEach(i=>n(i,void 0)),{matched:e.some(i=>Ee(i,r,n)),selections:t}},getSelectionKeys:()=>zr(e,Qe),matcherType:"or"})})}function C(e){return{[De]:()=>({match:r=>({matched:!!e(r)})})}}function Jo(...e){let r=typeof e[0]=="string"?e[0]:void 0,t=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return pe({[De]:()=>({match:n=>{let i={[r??Qt]:n};return{matched:t===void 0||Ee(t,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[r??Qt].concat(t===void 0?[]:Qe(t))})})}function ye(e){return typeof e=="number"}function je(e){return typeof e=="string"}function Ve(e){return typeof e=="bigint"}var eg=pe(C(function(e){return!0}));var Be=e=>Object.assign(pe(e),{startsWith:r=>{return Be(q(e,(t=r,C(n=>je(n)&&n.startsWith(t)))));var t},endsWith:r=>{return Be(q(e,(t=r,C(n=>je(n)&&n.endsWith(t)))));var t},minLength:r=>Be(q(e,(t=>C(n=>je(n)&&n.length>=t))(r))),length:r=>Be(q(e,(t=>C(n=>je(n)&&n.length===t))(r))),maxLength:r=>Be(q(e,(t=>C(n=>je(n)&&n.length<=t))(r))),includes:r=>{return Be(q(e,(t=r,C(n=>je(n)&&n.includes(t)))));var t},regex:r=>{return Be(q(e,(t=r,C(n=>je(n)&&!!n.match(t)))));var t}}),rg=Be(C(je)),be=e=>Object.assign(pe(e),{between:(r,t)=>be(q(e,((n,i)=>C(o=>ye(o)&&n<=o&&i>=o))(r,t))),lt:r=>be(q(e,(t=>C(n=>ye(n)&&nbe(q(e,(t=>C(n=>ye(n)&&n>t))(r))),lte:r=>be(q(e,(t=>C(n=>ye(n)&&n<=t))(r))),gte:r=>be(q(e,(t=>C(n=>ye(n)&&n>=t))(r))),int:()=>be(q(e,C(r=>ye(r)&&Number.isInteger(r)))),finite:()=>be(q(e,C(r=>ye(r)&&Number.isFinite(r)))),positive:()=>be(q(e,C(r=>ye(r)&&r>0))),negative:()=>be(q(e,C(r=>ye(r)&&r<0)))}),tg=be(C(ye)),Ue=e=>Object.assign(pe(e),{between:(r,t)=>Ue(q(e,((n,i)=>C(o=>Ve(o)&&n<=o&&i>=o))(r,t))),lt:r=>Ue(q(e,(t=>C(n=>Ve(n)&&nUe(q(e,(t=>C(n=>Ve(n)&&n>t))(r))),lte:r=>Ue(q(e,(t=>C(n=>Ve(n)&&n<=t))(r))),gte:r=>Ue(q(e,(t=>C(n=>Ve(n)&&n>=t))(r))),positive:()=>Ue(q(e,C(r=>Ve(r)&&r>0))),negative:()=>Ue(q(e,C(r=>Ve(r)&&r<0)))}),ng=Ue(C(Ve)),ig=pe(C(function(e){return typeof e=="boolean"})),og=pe(C(function(e){return typeof e=="symbol"})),sg=pe(C(function(e){return e==null})),ag=pe(C(function(e){return e!=null}));var ai=class extends Error{constructor(r){let t;try{t=JSON.stringify(r)}catch{t=r}super(`Pattern matching error: no pattern matches value ${t}`),this.input=void 0,this.input=r}},li={matched:!1,value:void 0};function hr(e){return new ui(e,li)}var ui=class e{constructor(r,t){this.input=void 0,this.state=void 0,this.input=r,this.state=t}with(...r){if(this.state.matched)return this;let t=r[r.length-1],n=[r[0]],i;r.length===3&&typeof r[1]=="function"?i=r[1]:r.length>2&&n.push(...r.slice(1,r.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>Ee(u,this.input,a))||i&&!i(this.input)?li:{matched:!0,value:t(o?Qt in s?s[Qt]:s:this.input,this.input)};return new e(this.input,l)}when(r,t){if(this.state.matched)return this;let n=!!r(this.input);return new e(this.input,n?{matched:!0,value:t(this.input,this.input)}:li)}otherwise(r){return this.state.matched?this.state.value:r(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ai(this.input)}run(){return this.exhaustive()}returnType(){return this}};var zo=require("node:util");var Ju={warn:ke("prisma:warn")},Hu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Gt(e,...r){Hu.warn()&&console.warn(`${Ju.warn} ${e}`,...r)}var Ku=(0,zo.promisify)(Yo.default.exec),ee=gr("prisma:get-platform"),Yu=["1.0.x","1.1.x","3.0.x"];async function Zo(){let e=Jt.default.platform(),r=process.arch;if(e==="freebsd"){let s=await Ht("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:r}}}if(e!=="linux")return{platform:e,arch:r};let t=await Zu(),n=await sc(),i=ec({arch:r,archFromUname:n,familyDistro:t.familyDistro}),{libssl:o}=await rc(i);return{platform:"linux",libssl:o,arch:r,archFromUname:n,...t}}function zu(e){let r=/^ID="?([^"\n]*)"?$/im,t=/^ID_LIKE="?([^"\n]*)"?$/im,n=r.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=t.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=hr({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 ee(`Found distro info: +${JSON.stringify(a,null,2)}`),a}async function Zu(){let e="/etc/os-release";try{let r=await ci.default.readFile(e,{encoding:"utf-8"});return zu(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function Xu(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let t=`${r[1]}.x`;return Xo(t)}}function Ho(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let t=`${r[1]}${r[2]??".0"}.x`;return Xo(t)}}function Xo(e){let r=(()=>{if(rs(e))return e;let t=e.split(".");return t[1]="0",t.join(".")})();if(Yu.includes(r))return r}function ec(e){return hr(e).with({familyDistro:"musl"},()=>(ee('Trying platform-specific paths for "alpine"'),["/lib","/usr/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(ee('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(ee('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:t,archFromUname:n})=>(ee(`Don't know any platform-specific paths for "${r}" on ${t} (${n})`),[]))}async function rc(e){let r='grep -v "libssl.so.0"',t=await Ko(e);if(t){ee(`Found libssl.so file using platform-specific paths: ${t}`);let o=Ho(t);if(ee(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}ee('Falling back to "ldconfig" and other generic paths');let n=await Ht(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(n||(n=await Ko(["/lib64","/usr/lib64","/lib","/usr/lib"])),n){ee(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=Ho(n);if(ee(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Ht("openssl version -v");if(i){ee(`Found openssl binary with version: ${i}`);let o=Xu(i);if(ee(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return ee("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Ko(e){for(let r of e){let t=await tc(r);if(t)return t}}async function tc(e){try{return(await ci.default.readdir(e)).find(t=>t.startsWith("libssl.so.")&&!t.startsWith("libssl.so.0"))}catch(r){if(r.code==="ENOENT")return;throw r}}async function ir(){let{binaryTarget:e}=await es();return e}function nc(e){return e.binaryTarget!==void 0}async function pi(){let{memoized:e,...r}=await es();return r}var Wt={};async function es(){if(nc(Wt))return Promise.resolve({...Wt,memoized:!0});let e=await Zo(),r=ic(e);return Wt={...e,binaryTarget:r},{...Wt,memoized:!1}}function ic(e){let{platform:r,arch:t,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;r==="linux"&&!["x64","arm64"].includes(t)&&Gt(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${t}" instead). 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(r==="linux"&&i===void 0){let c=hr({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.");Gt(`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(r==="linux"&&o===void 0&&ee(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),r==="darwin"&&t==="arm64")return"darwin-arm64";if(r==="darwin")return"darwin";if(r==="win32")return"windows";if(r==="freebsd")return o;if(r==="openbsd")return"openbsd";if(r==="netbsd")return"netbsd";if(r==="linux"&&o==="nixos")return"linux-nixos";if(r==="linux"&&t==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(r==="linux"&&t==="arm")return`linux-arm-openssl-${i||l}`;if(r==="linux"&&o==="musl"){let c="linux-musl";return!i||rs(i)?c:`${c}-openssl-${i}`}return r==="linux"&&o&&i?`${o}-openssl-${i}`:(r!=="linux"&&Gt(`Prisma detected unknown OS "${r}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function oc(e){try{return await e()}catch{return}}function Ht(e){return oc(async()=>{let r=await Ku(e);return ee(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function sc(){return typeof Jt.default.machine=="function"?Jt.default.machine():(await Ht("uname -m"))?.trim()}function rs(e){return e.startsWith("1.")}var zt={};tr(zt,{beep:()=>Dc,clearScreen:()=>Ac,clearTerminal:()=>Ic,cursorBackward:()=>mc,cursorDown:()=>pc,cursorForward:()=>dc,cursorGetPosition:()=>hc,cursorHide:()=>Ec,cursorLeft:()=>is,cursorMove:()=>cc,cursorNextLine:()=>yc,cursorPrevLine:()=>bc,cursorRestorePosition:()=>gc,cursorSavePosition:()=>fc,cursorShow:()=>wc,cursorTo:()=>uc,cursorUp:()=>ns,enterAlternativeScreen:()=>kc,eraseDown:()=>Tc,eraseEndLine:()=>vc,eraseLine:()=>os,eraseLines:()=>xc,eraseScreen:()=>di,eraseStartLine:()=>Pc,eraseUp:()=>Sc,exitAlternativeScreen:()=>Oc,iTerm:()=>Fc,image:()=>Nc,link:()=>_c,scrollDown:()=>Cc,scrollUp:()=>Rc});var Yt=k(require("node:process"),1);var Kt=globalThis.window?.document!==void 0,gg=globalThis.process?.versions?.node!==void 0,hg=globalThis.process?.versions?.bun!==void 0,yg=globalThis.Deno?.version?.deno!==void 0,bg=globalThis.process?.versions?.electron!==void 0,Eg=globalThis.navigator?.userAgent?.includes("jsdom")===!0,wg=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,xg=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,vg=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,Pg=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,Zr=globalThis.navigator?.userAgentData?.platform,Tg=Zr==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",Sg=Zr==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",Rg=Zr==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",Cg=Zr==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),Ag=Zr==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var A="\x1B[",et="\x1B]",yr="\x07",Xr=";",ts=!Kt&&Yt.default.env.TERM_PROGRAM==="Apple_Terminal",ac=!Kt&&Yt.default.platform==="win32",lc=Kt?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:Yt.default.cwd,uc=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?A+(e+1)+"G":A+(r+1)+Xr+(e+1)+"H"},cc=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let t="";return e<0?t+=A+-e+"D":e>0&&(t+=A+e+"C"),r<0?t+=A+-r+"A":r>0&&(t+=A+r+"B"),t},ns=(e=1)=>A+e+"A",pc=(e=1)=>A+e+"B",dc=(e=1)=>A+e+"C",mc=(e=1)=>A+e+"D",is=A+"G",fc=ts?"\x1B7":A+"s",gc=ts?"\x1B8":A+"u",hc=A+"6n",yc=A+"E",bc=A+"F",Ec=A+"?25l",wc=A+"?25h",xc=e=>{let r="";for(let t=0;t[et,"8",Xr,Xr,r,yr,e,et,"8",Xr,Xr,yr].join(""),Nc=(e,r={})=>{let t=`${et}1337;File=inline=1`;return r.width&&(t+=`;width=${r.width}`),r.height&&(t+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0"),t+":"+Buffer.from(e).toString("base64")+yr},Fc={setCwd:(e=lc())=>`${et}50;CurrentDir=${e}${yr}`,annotation(e,r={}){let t=`${et}1337;`,n=r.x!==void 0,i=r.y!==void 0;if((n||i)&&!(n&&i&&r.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replaceAll("|",""),t+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?t+=(n?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):t+=e,t+yr}};var Zt=k(ds(),1);function or(e,r,{target:t="stdout",...n}={}){return Zt.default[t]?zt.link(e,r):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,r):`${e} (\u200B${r}\u200B)`}or.isSupported=Zt.default.stdout;or.stderr=(e,r,t={})=>or(e,r,{target:"stderr",...t});or.stderr.isSupported=Zt.default.stderr;function yi(e){return or(e,e,{fallback:Y})}var jc=ms(),bi=jc.version;function Er(e){let r=Vc();return r||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":Bc(e))}function Vc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function Bc(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}var Qc=k(wi());var M=k(require("node:path")),Gc=k(wi()),ah=N("prisma:engines");function fs(){return M.default.join(__dirname,"../")}var lh="libquery-engine";M.default.join(__dirname,"../query-engine-darwin");M.default.join(__dirname,"../query-engine-darwin-arm64");M.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");M.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");M.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");M.default.join(__dirname,"../query-engine-linux-static-x64");M.default.join(__dirname,"../query-engine-linux-static-arm64");M.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");M.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");M.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");M.default.join(__dirname,"../libquery_engine-darwin.dylib.node");M.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-musl.so.node");M.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");M.default.join(__dirname,"../query_engine-windows.dll.node");var xi=k(require("node:fs")),gs=gr("chmodPlusX");function vi(e){if(process.platform==="win32")return;let r=xi.default.statSync(e),t=r.mode|64|8|1;if(r.mode===t){gs(`Execution permissions of ${e} are fine`);return}let n=t.toString(8).slice(-3);gs(`Have to call chmodPlusX on ${e}`),xi.default.chmodSync(e,n)}function Pi(e){let r=e.e,t=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=r.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${yi("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${Ie(e.id)}\`).`,s=hr({message:r.message,code:r.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${t("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${t("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`${t("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: ${r.message}`}var bs=k(ys(),1);function Ti(e){let r=(0,bs.default)(e);if(r===0)return e;let t=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(t,"")}var Es="prisma+postgres",en=`${Es}:`;function Si(e){return e?.startsWith(`${en}//`)??!1}var xs=k(Ri());function Ai(e){return String(new Ci(e))}var Ci=class{constructor(r){this.config=r}toString(){let{config:r}=this,t=r.provider.fromEnvVar?`env("${r.provider.fromEnvVar}")`:r.provider.value,n=JSON.parse(JSON.stringify({provider:t,binaryTargets:Wc(r.binaryTargets)}));return`generator ${r.name} { +${(0,xs.default)(Jc(n),2)} +}`}};function Wc(e){let r;if(e.length>0){let t=e.find(n=>n.fromEnvVar!==null);t?r=`env("${t.fromEnvVar}")`:r=e.map(n=>n.native?"native":n.value)}else r=void 0;return r}function Jc(e){let r=Object.keys(e).reduce((t,n)=>Math.max(t,n.length),0);return Object.entries(e).map(([t,n])=>`${t.padEnd(r)} = ${Hc(n)}`).join(` +`)}function Hc(e){return JSON.parse(JSON.stringify(e,(r,t)=>Array.isArray(t)?`[${t.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(t)))}var tt={};tr(tt,{error:()=>zc,info:()=>Yc,log:()=>Kc,query:()=>Zc,should:()=>vs,tags:()=>rt,warn:()=>Ii});var rt={error:ce("prisma:error"),warn:ke("prisma:warn"),info:Oe("prisma:info"),query:nr("prisma:query")},vs={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Kc(...e){console.log(...e)}function Ii(e,...r){vs.warn()&&console.warn(`${rt.warn} ${e}`,...r)}function Yc(e,...r){console.info(`${rt.info} ${e}`,...r)}function zc(e,...r){console.error(`${rt.error} ${e}`,...r)}function Zc(e,...r){console.log(`${rt.query} ${e}`,...r)}function rn(e,r){if(!e)throw new Error(`${r}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function _e(e,r){throw new Error(r)}var nt=k(require("node:path"));function Oi(e){return nt.default.sep===nt.default.posix.sep?e:e.split(nt.default.sep).join(nt.default.posix.sep)}var Li=k(ks()),nn=k(require("node:fs"));var wr=k(require("node:path"));function Os(e){let r=e.ignoreProcessEnv?{}:process.env,t=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(r,p)?r[p]:e.parsed[p]||"",u=t(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(r,n)?r[n]:e.parsed[n];e.parsed[n]=t(i)}for(let n in e.parsed)r[n]=e.parsed[n];return e}var Fi=gr("prisma:tryLoadEnv");function it({rootEnvPath:e,schemaEnvPath:r},t={conflictCheck:"none"}){let n=Ds(e);t.conflictCheck!=="none"&&gp(n,r,t.conflictCheck);let i=null;return _s(n?.path,r)||(i=Ds(r)),!n&&!i&&Fi("No Environment variables loaded"),i?.dotenvResult.error?console.error(ce(W("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` +`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function gp(e,r,t){let n=e?.dotenvResult.parsed,i=!_s(e?.path,r);if(n&&r&&i&&nn.default.existsSync(r)){let o=Li.default.parse(nn.default.readFileSync(r)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=wr.default.relative(process.cwd(),e.path),l=wr.default.relative(process.cwd(),r);if(t==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${Y(a)} and ${Y(l)} +Conflicting env vars: +${s.map(c=>` ${W(c)}`).join(` +`)} + +We suggest to move the contents of ${Y(l)} to ${Y(a)} to consolidate your env vars. +`;throw new Error(u)}else if(t==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>W(c)).join(", ")} in ${Y(a)} and ${Y(l)} +Env vars from ${Y(l)} overwrite the ones from ${Y(a)} + `;console.warn(`${ke("warn(prisma)")} ${u}`)}}}}function Ds(e){if(hp(e)){Fi(`Environment variables loaded from ${e}`);let r=Li.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Os(r),message:Ie(`Environment variables loaded from ${wr.default.relative(process.cwd(),e)}`),path:e}}else Fi(`Environment variables not found at ${e}`);return null}function _s(e,r){return e&&r&&wr.default.resolve(e)===wr.default.resolve(r)}function hp(e){return!!(e&&nn.default.existsSync(e))}function Mi(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function xr(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function $i(e,r){if(e.length===0)return;let t=e[0];for(let n=1;n{Fs.has(e)||(Fs.add(e),Ii(r,...t))};var T=class e extends Error{clientVersion;errorCode;retryable;constructor(r,t,n){super(r),this.name="PrismaClientInitializationError",this.clientVersion=t,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};x(T,"PrismaClientInitializationError");var z=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(r,{code:t,clientVersion:n,meta:i,batchRequestIdx:o}){super(r),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};x(z,"PrismaClientKnownRequestError");var le=class extends Error{clientVersion;constructor(r,t){super(r),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};x(le,"PrismaClientRustPanicError");var j=class extends Error{clientVersion;batchRequestIdx;constructor(r,{clientVersion:t,batchRequestIdx:n}){super(r),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};x(j,"PrismaClientUnknownRequestError");var Z=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(r,{clientVersion:t}){super(r),this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};x(Z,"PrismaClientValidationError");var vr=9e15,Ke=1e9,qi="0123456789abcdef",un="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",cn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ji={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-vr,maxE:vr,crypto:!1},qs,Fe,w=!0,dn="[DecimalError] ",He=dn+"Invalid argument: ",js=dn+"Precision limit exceeded",Vs=dn+"crypto unavailable",Bs="[object Decimal]",X=Math.floor,U=Math.pow,yp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,bp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ep=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Us=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe=1e7,E=7,wp=9007199254740991,xp=un.length-1,Vi=cn.length-1,m={toStringTag:Bs};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};m.ceil=function(){return y(new this.constructor(this),this.e+1,2)};m.clampedTo=m.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(He+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};m.comparedTo=m.cmp=function(e){var r,t,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,r=0,t=na[r]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};m.cosine=m.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+E,n.rounding=1,t=vp(n,Hs(n,t)),n.precision=e,n.rounding=r,y(Fe==2||Fe==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};m.cubeRoot=m.cbrt=function(){var e,r,t,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*U(c.s*c,1/3),!o||Math.abs(o)==1/0?(t=J(c.d),e=c.e,(o=(e-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=U(t,1/3),e=X((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),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=F(u.plus(c).times(a),u.plus(l),s+2,1),J(a.d).slice(0,s)===(t=J(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,e+1,1),r=!n.times(n).times(n).eq(c));break}return w=!0,y(n,e,p.rounding,r)};m.decimalPlaces=m.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-X(this.e/E))*E,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};m.dividedBy=m.div=function(e){return F(this,new this.constructor(e))};m.dividedToIntegerBy=m.divToInt=function(e){var r=this,t=r.constructor;return y(F(r,new t(e),0,1,1),t.precision,t.rounding)};m.equals=m.eq=function(e){return this.cmp(e)===0};m.floor=function(){return y(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 r=this.cmp(e);return r==1||r===0};m.hyperbolicCosine=m.cosh=function(){var e,r,t,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;t=s.precision,n=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),r=(1/fn(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),o=Pr(s,1,o.times(r),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 y(o,s.precision=t,s.rounding=n,!0)};m.hyperbolicSine=m.sinh=function(){var e,r,t,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(r=o.precision,t=o.rounding,o.precision=r+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=Pr(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/fn(5,e)),i=Pr(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=r,o.rounding=t,y(i,r,t,!0)};m.hyperbolicTangent=m.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,F(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};m.inverseCosine=m.acos=function(){var e=this,r=e.constructor,t=e.abs().cmp(1),n=r.precision,i=r.rounding;return t!==-1?t===0?e.isNeg()?we(r,n,i):new r(0):new r(NaN):e.isZero()?we(r,n+4,i).times(.5):(r.precision=n+6,r.rounding=1,e=new r(1).minus(e).div(e.plus(1)).sqrt().atan(),r.precision=n,r.rounding=i,e.times(2))};m.inverseHyperbolicCosine=m.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,w=!1,t=t.times(t).minus(1).sqrt().plus(t),w=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};m.inverseHyperbolicSine=m.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,w=!1,t=t.times(t).plus(1).sqrt().plus(t),w=!0,n.precision=e,n.rounding=r,t.ln())};m.inverseHyperbolicTangent=m.atanh=function(){var e,r,t,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,r=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,r,!0):(o.precision=t=n-i.e,i=F(i.plus(1),new o(1).minus(i),t+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=r,i.times(.5))):new o(NaN)};m.inverseSine=m.asin=function(){var e,r,t,n,i=this,o=i.constructor;return i.isZero()?new o(i):(r=i.abs().cmp(1),t=o.precision,n=o.rounding,r!==-1?r===0?(e=we(o,t+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=t+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,i.times(2)))};m.inverseTangent=m.atan=function(){var e,r,t,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<=Vi)return s=we(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Vi)return s=we(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,t=Math.min(28,a/E+2|0),e=t;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(w=!1,r=Math.ceil(a/E),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[r]!==void 0)for(e=r;s.d[e]===o.d[e]&&e--;);return t&&(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 r,t,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),r=!0;else{if(e=new c(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new c(NaN);r=e.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new c(t&&!t[0]?-1/0:u.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)o=!0;else{for(i=t[0];i%10===0;)i/=10;o=i!==1}if(w=!1,a=p+f,s=Je(u,a),n=r?pn(c,a+10):Je(e,a),l=F(s,n,a,1),st(l.d,i=p,d))do if(a+=10,s=Je(u,a),n=r?pn(c,a+10):Je(e,a),l=F(s,n,a,1),!o){+J(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(st(l.d,i+=10,d));return w=!0,y(l,p,d)};m.minus=m.sub=function(e){var r,t,n,i,o,s,a,l,u,c,p,d,f=this,g=f.constructor;if(e=new g(e),!f.d||!e.d)return!f.s||!e.s?e=new g(NaN):f.d?e.s=-e.s:e=new g(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=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(f);else return new g(l===3?-0:0);return w?y(e,a,l):e}if(t=X(e.e/E),c=X(f.e/E),u=u.slice(),o=c-t,o){for(p=o<0,p?(r=u,o=-o,s=d.length):(r=d,t=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,r.length=1),r.reverse(),n=o;n--;)r.push(0);r.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,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,t=c,c=u,u=t),r=0;i;)r=(u[--i]=u[i]+c[i]+r)/fe|0,u[i]%=fe;for(r&&(u.unshift(r),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=mn(u,n),w?y(e,a,l):e};m.precision=m.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(He+e);return t.d?(r=Qs(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};m.round=function(){var e=this,r=e.constructor;return y(new r(e),e.e+1,r.rounding)};m.sine=m.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+E,n.rounding=1,t=Tp(n,Hs(n,t)),n.precision=e,n.rounding=r,y(Fe>2?t.neg():t,e,r,!0)):new n(NaN)};m.squareRoot=m.sqrt=function(){var e,r,t,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?(r=J(a),(r.length+l)%2==0&&(r+="0"),u=Math.sqrt(r),l=X((l+1)/2)-(l<0||l%2),u==1/0?r="5e"+l:(r=u.toExponential(),r=r.slice(0,r.indexOf("e")+1)+l),n=new c(r)):n=new c(u.toString()),t=(l=c.precision)+3;;)if(o=n,n=o.plus(F(s,o,t+2,1)).times(.5),J(o.d).slice(0,t)===(r=J(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return w=!0,y(n,l,c.rounding,e)};m.tangent=m.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=F(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,y(Fe==2||Fe==4?t.neg():t,e,r,!0)):new n(NaN)};m.times=m.mul=function(e){var r,t,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(t=X(c.e/E)+X(e.e/E),l=d.length,u=f.length,l=0;){for(r=0,i=l+n;i>n;)a=o[i]+f[n]*d[i-n-1]+r,o[i--]=a%fe|0,r=a/fe|0;o[i]=(o[i]+r)%fe|0}for(;!o[--s];)o.pop();return r?++t:o.shift(),e.d=o,e.e=mn(o,t),w?y(e,p.precision,p.rounding):e};m.toBinary=function(e,r){return Ui(this,2,e,r)};m.toDecimalPlaces=m.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(ie(e,0,Ke),r===void 0?r=n.rounding:ie(r,0,8),y(t,e+t.e+1,r))};m.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=xe(n,!0):(ie(e,0,Ke),r===void 0?r=i.rounding:ie(r,0,8),n=y(new i(n),e+1,r),t=xe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};m.toFixed=function(e,r){var t,n,i=this,o=i.constructor;return e===void 0?t=xe(i):(ie(e,0,Ke),r===void 0?r=o.rounding:ie(r,0,8),n=y(new o(i),e+i.e+1,r),t=xe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};m.toFraction=function(e){var r,t,n,i,o,s,a,l,u,c,p,d,f=this,g=f.d,h=f.constructor;if(!g)return new h(f);if(u=t=new h(1),n=l=new h(0),r=new h(n),o=r.e=Qs(g)-f.e-1,s=o%E,r.d[0]=U(10,s<0?E+s:s),e==null)e=o>0?r:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(He+a);e=a.gt(r)?o>0?r:u:a}for(w=!1,a=new h(J(g)),c=h.precision,h.precision=o=g.length*E*2;p=F(a,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=r,r=a.minus(p.times(i)),a=i;return i=F(e.minus(t),n,0,1,1),l=l.plus(i.times(u)),t=t.plus(i.times(n)),l.s=u.s=f.s,d=F(u,n,o,1).minus(f).abs().cmp(F(l,t,o,1).minus(f).abs())<1?[u,n]:[l,t],h.precision=c,w=!0,d};m.toHexadecimal=m.toHex=function(e,r){return Ui(this,16,e,r)};m.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:ie(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(w=!1,t=F(t,e,0,r,1).times(e),w=!0,y(t)):(e.s=t.s,t=e),t};m.toNumber=function(){return+this};m.toOctal=function(e,r){return Ui(this,8,e,r)};m.toPower=m.pow=function(e){var r,t,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(U(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(r=X(e.e/E),r>=e.d.length-1&&(t=u<0?-u:u)<=wp)return i=Gs(l,a,t,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(rl.maxE+1||r0?s/0:0):(w=!1,l.rounding=a.s=1,t=Math.min(12,(r+"").length),i=Bi(e.times(Je(a,n+t)),n),i.d&&(i=y(i,n+5,1),st(i.d,n,o)&&(r=n+10,i=y(Bi(e.times(Je(a,r+t)),r),r+5,1),+J(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,w=!0,l.rounding=o,y(i,n,o))};m.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=xe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ie(e,1,Ke),r===void 0?r=i.rounding:ie(r,0,8),n=y(new i(n),e,r),t=xe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};m.toSignificantDigits=m.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(ie(e,1,Ke),r===void 0?r=n.rounding:ie(r,0,8)),y(new n(t),e,r)};m.toString=function(){var e=this,r=e.constructor,t=xe(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};m.truncated=m.trunc=function(){return y(new this.constructor(this),this.e+1,1)};m.valueOf=m.toJSON=function(){var e=this,r=e.constructor,t=xe(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function J(e){var r,t,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,r=1;rt)throw Error(He+e)}function st(e,r,t,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--r;return--r<0?(r+=E,i=0):(i=Math.ceil((r+1)/E),r%=E),o=U(10,E-r),a=e[i]%o|0,n==null?r<3?(r==0?a=a/100|0:r==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==o||t>3&&a+1==o/2)&&(e[i+1]/o/100|0)==U(10,r-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:r<4?(r==0?a=a/1e3|0:r==1?a=a/100|0:r==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==o||!n&&t>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==U(10,r-3)-1,s}function an(e,r,t){for(var n,i=[0],o,s=0,a=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function vp(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/fn(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=Pr(e,1,r.times(i),new e(1));for(var o=t;o--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var F=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 r(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 t(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,g,h,I,P,S,b,O,me,ae,Jr,V,te,Ae,H,fr,$t=n.constructor,Xn=n.s==i.s?1:-1,K=n.d,_=i.d;if(!K||!K[0]||!_||!_[0])return new $t(!n.s||!i.s||(K?_&&K[0]==_[0]:!_)?NaN:K&&K[0]==0||!_?Xn*0:Xn/0);for(l?(f=1,c=n.e-i.e):(l=fe,f=E,c=X(n.e/f)-X(i.e/f)),H=_.length,te=K.length,P=new $t(Xn),S=P.d=[],p=0;_[p]==(K[p]||0);p++);if(_[p]>(K[p]||0)&&c--,o==null?(ae=o=$t.precision,s=$t.rounding):a?ae=o+(n.e-i.e)+1:ae=o,ae<0)S.push(1),g=!0;else{if(ae=ae/f+2|0,p=0,H==1){for(d=0,_=_[0],ae++;(p1&&(_=e(_,d,l),K=e(K,d,l),H=_.length,te=K.length),V=H,b=K.slice(0,H),O=b.length;O=l/2&&++Ae;do d=0,u=r(_,b,H,O),u<0?(me=b[0],H!=O&&(me=me*l+(b[1]||0)),d=me/Ae|0,d>1?(d>=l&&(d=l-1),h=e(_,d,l),I=h.length,O=b.length,u=r(h,b,I,O),u==1&&(d--,t(h,H=10;d/=10)p++;P.e=p+c*f-1,y(P,a?o+P.e+1:o,s,g)}return P}}();function y(e,r,t,n){var i,o,s,a,l,u,c,p,d,f=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=r-i,o<0)o+=E,s=r,c=p[d=0],l=c/U(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/E),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=E,s=o-E+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=E,s=o-E+i,l=s<0?0:c/U(10,i-s-1)%10|0}if(n=n||r<0||p[d+1]!==void 0||(s<0?c:c%U(10,i-s-1)),u=t<4?(l||n)&&(t==0||t==(e.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(o>0?s>0?c/U(10,i-s):0:p[d-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,u?(r-=e.e+1,p[0]=U(10,(E-r%E)%E),e.e=-r||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=U(10,E-o),p[d]=s>0?(c/U(10,i-s)%U(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]==fe&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=fe)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)+We(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+We(-i-1)+o,t&&(n=t-s)>0&&(o+=We(n))):i>=s?(o+=We(i+1-s),t&&(n=t-i-1)>0&&(o=o+"."+We(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=We(n))),o}function mn(e,r){var t=e[0];for(r*=E;t>=10;t/=10)r++;return r}function pn(e,r,t){if(r>xp)throw w=!0,t&&(e.precision=t),Error(js);return y(new e(un),r,1,!0)}function we(e,r,t){if(r>Vi)throw Error(js);return y(new e(cn),r,t,!0)}function Qs(e){var r=e.length-1,t=r*E+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function We(e){for(var r="";e--;)r+="0";return r}function Gs(e,r,t,n){var i,o=new e(1),s=Math.ceil(n/E+4);for(w=!1;;){if(t%2&&(o=o.times(r),Ms(o.d,s)&&(i=!0)),t=X(t/2),t===0){t=o.d.length-1,i&&o.d[t]===0&&++o.d[t];break}r=r.times(r),Ms(r.d,s)}return w=!0,o}function Ls(e){return e.d[e.d.length-1]&1}function Ws(e,r,t){for(var n,i,o=new e(r[0]),s=0;++s17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(r==null?(w=!1,l=g):l=r,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(U(2,p))/Math.LN10*2+5|0,l+=n,t=o=s=new d(1),d.precision=l;;){if(o=y(o.times(e),l,1),t=t.times(++c),a=s.plus(F(o,t,l,1)),J(a.d).slice(0,l)===J(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(r==null)if(u<3&&st(s.d,l-n,f,u))d.precision=l+=10,t=o=a=new d(1),c=0,u++;else return y(s,d.precision=g,f,w=!0);else return d.precision=g,s}s=a}}function Je(e,r){var t,n,i,o,s,a,l,u,c,p,d,f=1,g=10,h=e,I=h.d,P=h.constructor,S=P.rounding,b=P.precision;if(h.s<0||!I||!I[0]||!h.e&&I[0]==1&&I.length==1)return new P(I&&!I[0]?-1/0:h.s!=1?NaN:I?0:h);if(r==null?(w=!1,c=b):c=r,P.precision=c+=g,t=J(I),n=t.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)h=h.times(e),t=J(h.d),n=t.charAt(0),f++;o=h.e,n>1?(h=new P("0."+t),o++):h=new P(n+"."+t.slice(1))}else return u=pn(P,c+2,b).times(o+""),h=Je(new P(n+"."+t.slice(1)),c-g).plus(u),P.precision=b,r==null?y(h,b,S,w=!0):h;for(p=h,l=s=h=F(h.minus(1),h.plus(1),c,1),d=y(h.times(h),c,1),i=3;;){if(s=y(s.times(d),c,1),u=l.plus(F(s,new P(i),c,1)),J(u.d).slice(0,c)===J(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(pn(P,c+2,b).times(o+""))),l=F(l,new P(f),c,1),r==null)if(st(l.d,c-g,S,a))P.precision=c+=g,u=s=h=F(p.minus(1),p.plus(1),c,1),d=y(h.times(h),c,1),i=a=1;else return y(l,P.precision=b,S,w=!0);else return P.precision=b,l;l=u,i+=2}}function Js(e){return String(e.s*e.s/0)}function ln(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%E,t<0&&(n+=E),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),Us.test(r))return ln(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(bp.test(r))t=16,r=r.toLowerCase();else if(yp.test(r))t=2;else if(Ep.test(r))t=8;else throw Error(He+r);for(o=r.search(/p/i),o>0?(l=+r.slice(o+1),r=r.substring(2,o)):r=r.slice(2),o=r.indexOf("."),s=o>=0,n=e.constructor,s&&(r=r.replace(".",""),a=r.length,o=a-o,i=Gs(n,new n(t),o,o*2)),u=an(r,t,fe),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=mn(u,c),e.d=u,w=!1,s&&(e=F(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?U(2,l):sr.pow(2,l))),w=!0,e)}function Tp(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:Pr(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/fn(5,t)),r=Pr(e,2,r,r);for(var i,o=new e(5),s=new e(16),a=new e(20);t--;)i=r.times(r),r=r.times(o.plus(i.times(s.times(i).minus(a))));return r}function Pr(e,r,t,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/E);for(w=!1,l=t.times(t),a=new e(n);;){if(s=F(a.times(l),new e(r++*r++),c,1),a=i?n.plus(s):n.minus(s),n=F(s.times(l),new e(r++*r++),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 fn(e,r){for(var t=e;--r;)t*=e;return t}function Hs(e,r){var t,n=r.s<0,i=we(e,e.precision,1),o=i.times(.5);if(r=r.abs(),r.lte(o))return Fe=n?4:1,r;if(t=r.divToInt(i),t.isZero())Fe=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(o))return Fe=Ls(t)?n?2:3:n?4:1,r;Fe=Ls(t)?n?1:4:n?3:2}return r.minus(i).abs()}function Ui(e,r,t,n){var i,o,s,a,l,u,c,p,d,f=e.constructor,g=t!==void 0;if(g?(ie(t,1,Ke),n===void 0?n=f.rounding:ie(n,0,8)):(t=f.precision,n=f.rounding),!e.isFinite())c=Js(e);else{for(c=xe(e),s=c.indexOf("."),g?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(c=c.replace(".",""),d=new f(1),d.e=c.length-s,d.d=an(xe(d),10,i),d.e=d.d.length),p=an(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=F(e,d,t,n,0,i),p=e.d,o=e.e,u=qs),s=p[t],a=i/2,u=u||p[t+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[t-1]&1||n===(e.s<0?8:7)),p.length=t,u)for(;++p[--t]>i-1;)p[t]=0,t||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s1)if(r==16||r==8){for(s=r==16?4:3,--l;l%s;l++)c+="0";for(p=an(c,i,r),l=p.length;!p[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else or)return e.length=r,!0}function Sp(e){return new this(e).abs()}function Rp(e){return new this(e).acos()}function Cp(e){return new this(e).acosh()}function Ap(e,r){return new this(e).plus(r)}function Ip(e){return new this(e).asin()}function kp(e){return new this(e).asinh()}function Op(e){return new this(e).atan()}function Dp(e){return new this(e).atanh()}function _p(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,o=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=we(this,o,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?we(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=we(this,o,1).times(.5),t.s=e.s):r.s<0?(this.precision=o,this.rounding=1,t=this.atan(F(e,r,o,1)),r=we(this,o,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(F(e,r,o,1)),t}function Np(e){return new this(e).cbrt()}function Fp(e){return y(e=new this(e),e.e+1,2)}function Lp(e,r,t){return new this(e).clamp(r,t)}function Mp(e){if(!e||typeof e!="object")throw Error(dn+"Object expected");var r,t,n,i=e.defaults===!0,o=["precision",1,Ke,"rounding",0,8,"toExpNeg",-vr,0,"toExpPos",0,vr,"maxE",0,vr,"minE",-vr,0,"modulo",0,9];for(r=0;r=o[r+1]&&n<=o[r+2])this[t]=n;else throw Error(He+t+": "+n);if(t="crypto",i&&(this[t]=ji[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Vs);else this[t]=!1;else throw Error(He+t+": "+n);return this}function $p(e){return new this(e).cos()}function qp(e){return new this(e).cosh()}function Ks(e){var r,t,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,$s(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?r[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(r,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Vs);else for(;o=10;i/=10)n++;nCr,datamodelEnumToSchemaEnum:()=>dd});function dd(e){return{name:e.name,values:e.values.map(r=>r.name)}}var Cr=(b=>(b.findUnique="findUnique",b.findUniqueOrThrow="findUniqueOrThrow",b.findFirst="findFirst",b.findFirstOrThrow="findFirstOrThrow",b.findMany="findMany",b.create="create",b.createMany="createMany",b.createManyAndReturn="createManyAndReturn",b.update="update",b.updateMany="updateMany",b.updateManyAndReturn="updateManyAndReturn",b.upsert="upsert",b.delete="delete",b.deleteMany="deleteMany",b.groupBy="groupBy",b.count="count",b.aggregate="aggregate",b.findRaw="findRaw",b.aggregateRaw="aggregateRaw",b))(Cr||{});var ta=k(Ri());var ra=k(require("node:fs"));var Zs={keyword:Oe,entity:Oe,value:e=>W(nr(e)),punctuation:nr,directive:Oe,function:Oe,variable:e=>W(nr(e)),string:e=>W(qe(e)),boolean:ke,number:Oe,comment:Hr};var md=e=>e,hn={},fd=0,v={manual:hn.Prism&&hn.Prism.manual,disableWorkerMessageHandler:hn.Prism&&hn.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof ge){let r=e;return new ge(r.type,v.util.encode(r.content),r.alias)}else return Array.isArray(e)?e.map(v.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ae instanceof ge)continue;if(me&&V!=r.length-1){S.lastIndex=te;var p=S.exec(e);if(!p)break;var c=p.index+(O?p[1].length:0),d=p.index+p[0].length,a=V,l=te;for(let _=r.length;a<_&&(l=l&&(++V,te=l);if(r[V]instanceof ge)continue;u=a-V,Ae=e.slice(te,l),p.index-=te}else{S.lastIndex=0;var p=S.exec(Ae),u=1}if(!p){if(o)break;continue}O&&(ae=p[1]?p[1].length:0);var c=p.index+ae,p=p[0].slice(ae),d=c+p.length,f=Ae.slice(0,c),g=Ae.slice(d);let H=[V,u];f&&(++V,te+=f.length,H.push(f));let fr=new ge(h,b?v.tokenize(p,b):p,Jr,p,me);if(H.push(fr),g&&H.push(g),Array.prototype.splice.apply(r,H),u!=1&&v.matchGrammar(e,r,t,V,te,!0,h),o)break}}}},tokenize:function(e,r){let t=[e],n=r.rest;if(n){for(let i in n)r[i]=n[i];delete r.rest}return v.matchGrammar(e,t,r,0,0,!1),t},hooks:{all:{},add:function(e,r){let t=v.hooks.all;t[e]=t[e]||[],t[e].push(r)},run:function(e,r){let t=v.hooks.all[e];if(!(!t||!t.length))for(var n=0,i;i=t[n++];)i(r)}},Token:ge};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 ge(e,r,t,n,i){this.type=e,this.content=r,this.alias=t,this.length=(n||"").length|0,this.greedy=!!i}ge.stringify=function(e,r){return typeof e=="string"?e:Array.isArray(e)?e.map(function(t){return ge.stringify(t,r)}).join(""):gd(e.type)(e.content)};function gd(e){return Zs[e]||md}function Xs(e){return hd(e,v.languages.javascript)}function hd(e,r){return v.tokenize(e,r).map(n=>ge.stringify(n)).join("")}function ea(e){return Ti(e)}var yn=class e{firstLineNumber;lines;static read(r){let t;try{t=ra.default.readFileSync(r,"utf-8")}catch{return null}return e.fromContent(t)}static fromContent(r){let t=r.split(/\r?\n/);return new e(1,t)}constructor(r,t){this.firstLineNumber=r,this.lines=t}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(r,t){if(rthis.lines.length+this.firstLineNumber)return this;let n=r-this.firstLineNumber,i=[...this.lines];return i[n]=t(i[n]),new e(this.firstLineNumber,i)}mapLines(r){return new e(this.firstLineNumber,this.lines.map((t,n)=>r(t,this.firstLineNumber+n)))}lineAt(r){return this.lines[r-this.firstLineNumber]}prependSymbolAt(r,t){return this.mapLines((n,i)=>i===r?`${t} ${n}`:` ${n}`)}slice(r,t){let n=this.lines.slice(r-1,t).join(` +`);return new e(r,ea(n).split(` +`))}highlight(){let r=Xs(this.toString());return new e(this.firstLineNumber,r.split(` +`))}toString(){return this.lines.join(` +`)}};var yd={red:ce,gray:Hr,dim:Ie,bold:W,underline:Y,highlightSource:e=>e.highlight()},bd={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ed({message:e,originalMethod:r,isPanic:t,callArguments:n}){return{functionName:`prisma.${r}()`,message:e,isPanic:t??!1,callArguments:n}}function wd({callsite:e,message:r,originalMethod:t,isPanic:n,callArguments:i},o){let s=Ed({message:r,originalMethod:t,isPanic:n,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=yn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=vd(c),d=xd(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(f))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+f+1;g+=2,s.callArguments=(0,ta.default)(i,g).slice(g)}}return s}function xd(e){let r=Object.keys(Cr).join("|"),n=new RegExp(String.raw`\.(${r})\(`).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 vd(e){let r=0;for(let t=0;t"Unknown error")}function aa(e){return e.errors.flatMap(r=>r.kind==="Union"?aa(r):[r])}function Sd(e){let r=new Map,t=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){t.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=r.get(i);o?r.set(i,{...n,argument:{...n.argument,typeNames:Rd(o.argument.typeNames,n.argument.typeNames)}}):r.set(i,n)}return t.push(...r.values()),t}function Rd(e,r){return[...new Set(e.concat(r))]}function Cd(e){return $i(e,(r,t)=>{let n=ia(r),i=ia(t);return n!==i?n-i:oa(r)-oa(t)})}function ia(e){let r=0;return Array.isArray(e.selectionPath)&&(r+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(r+=e.argumentPath.length),r}function oa(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var ue=class{constructor(r,t){this.name=r;this.value=t}isRequired=!1;makeRequired(){return this.isRequired=!0,this}write(r){let{colors:{green:t}}=r.context;r.addMarginSymbol(t(this.isRequired?"+":"?")),r.write(t(this.name)),this.isRequired||r.write(t("?")),r.write(t(": ")),typeof this.value=="string"?r.write(t(this.value)):r.write(this.value)}};ua();var Ar=class{constructor(r=0,t){this.context=t;this.currentIndent=r}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(r){return typeof r=="string"?this.currentLine+=r:r.write(this),this}writeJoined(r,t,n=(i,o)=>o.write(i)){let i=t.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(r){return this.marginSymbol=r,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` +`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let r=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+r.slice(1):r}};la();var wn=class{constructor(r){this.value=r}write(r){r.write(this.value)}markAsError(){this.value.markAsError()}};var xn=e=>e,vn={bold:xn,red:xn,green:xn,dim:xn,enabled:!1},ca={bold:W,red:ce,green:qe,dim:Ie,enabled:!0},Ir={write(e){e.writeLine(",")}};var Te=class{constructor(r){this.contents=r}isUnderlined=!1;color=r=>r;underline(){return this.isUnderlined=!0,this}setColor(r){return this.color=r,this}write(r){let t=r.getCurrentLineLength();r.write(this.color(this.contents)),this.isUnderlined&&r.afterNextNewline(()=>{r.write(" ".repeat(t)).writeLine(this.color("~".repeat(this.contents.length)))})}};var ze=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var kr=class extends ze{items=[];addItem(r){return this.items.push(new wn(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(t=>t.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let t=new Te("[]");this.hasError&&t.setColor(r.context.colors.red).underline(),r.write(t)}writeWithItems(r){let{colors:t}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Ir,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(t.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Or=class e extends ze{fields={};suggestions=[];addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[t,...n]=r,i=this.getField(t);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof e?a=o.value.getField(s):o.value instanceof kr&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}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 t=this;for(let n of r){if(!(t instanceof e))return;let i=t.getSubSelectionValue(n);if(!i)return;t=i}return t}getDeepSelectionParent(r){let t=this.getSelectionParent();if(!t)return;let n=t;for(let i of r){let o=n.value.getFieldValue(i);if(!o||!(o instanceof e))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let t=this.getField("include")?.value.asObject();if(t)return{kind:"include",value:t}}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(n=>n.getPrintWidth()))+2}write(r){let t=Object.values(this.fields);if(t.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,t)}asObject(){return this}writeEmpty(r){let t=new Te("{}");this.hasError&&t.setColor(r.context.colors.red).underline(),r.write(t)}writeWithContents(r,t){r.writeLine("{").withIndent(()=>{r.writeJoined(Ir,[...t,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};var G=class extends ze{constructor(t){super();this.text=t}getPrintWidth(){return this.text.length}write(t){let n=new Te(this.text);this.hasError&&n.underline().setColor(t.context.colors.red),t.write(n)}asObject(){}};var ut=class{fields=[];addField(r,t){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${r}: ${t}`))).addMarginSymbol(i(o("+")))}}),this}write(r){let{colors:{green:t}}=r.context;r.writeLine(t("{")).withIndent(()=>{r.writeJoined(Ir,this.fields).newLine()}).write(t("}")).addMarginSymbol(t("+"))}};function En(e,r,t){switch(e.kind){case"MutuallyExclusiveFields":Ad(e,r);break;case"IncludeOnScalar":Id(e,r);break;case"EmptySelection":kd(e,r,t);break;case"UnknownSelectionField":Nd(e,r);break;case"InvalidSelectionValue":Fd(e,r);break;case"UnknownArgument":Ld(e,r);break;case"UnknownInputField":Md(e,r);break;case"RequiredArgumentMissing":$d(e,r);break;case"InvalidArgumentType":qd(e,r);break;case"InvalidArgumentValue":jd(e,r);break;case"ValueTooLarge":Vd(e,r);break;case"SomeFieldsMissing":Bd(e,r);break;case"TooManyFieldsGiven":Ud(e,r);break;case"Union":sa(e,r,t);break;default:throw new Error("not implemented: "+e.kind)}}function Ad(e,r){let t=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();t&&(t.getField(e.firstField)?.markAsError(),t.getField(e.secondField)?.markAsError()),r.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Id(e,r){let[t,n]=ct(e.selectionPath),i=e.outputType,o=r.arguments.getDeepSelectionParent(t)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new ue(s.name,"true"));r.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${pt(s)}`:a+=".",a+=` +Note that ${s.bold("include")} statements only accept relation fields.`,a})}function kd(e,r,t){let n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Od(e,r,i);return}if(n.hasField("select")){Dd(e,r);return}}if(t?.[Ye(e.outputType.name)]){_d(e,r);return}r.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Od(e,r,t){t.removeAllFields();for(let n of e.outputType.fields)t.addSuggestion(new ue(n.name,"false"));r.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Dd(e,r){let t=e.outputType,n=r.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),fa(n,t)),r.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(t.name)} must not be empty. ${pt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(t.name)} needs ${o.bold("at least one truthy value")}.`)}function _d(e,r){let t=new ut;for(let i of e.outputType.fields)i.isRelation||t.addField(i.name,"false");let n=new ue("omit",t).makeRequired();if(e.selectionPath.length===0)r.arguments.addSuggestion(n);else{let[i,o]=ct(e.selectionPath),a=r.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Or;l.addSuggestion(n),a.value=l}}r.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function Nd(e,r){let t=ga(e.selectionPath,r);if(t.parentKind!=="unknown"){t.field.markAsError();let n=t.parent;switch(t.parentKind){case"select":fa(n,e.outputType);break;case"include":Qd(n,e.outputType);break;case"omit":Gd(n,e.outputType);break}}r.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${t.fieldName}\``)}`];return t.parentKind!=="unknown"&&i.push(`for ${n.bold(t.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(pt(n)),i.join(" ")})}function Fd(e,r){let t=ga(e.selectionPath,r);t.parentKind!=="unknown"&&t.field.value.markAsError(),r.addErrorMessage(n=>`Invalid value for selection field \`${n.red(t.fieldName)}\`: ${e.underlyingError}`)}function Ld(e,r){let t=e.argumentPath[0],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(t)?.markAsError(),Wd(n,e.arguments)),r.addErrorMessage(i=>da(i,t,e.arguments.map(o=>o.name)))}function Md(e,r){let[t,n]=ct(e.argumentPath),i=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(t)?.asObject();o&&ha(o,e.inputType)}r.addErrorMessage(o=>da(o,n,e.inputType.fields.map(s=>s.name)))}function da(e,r,t){let n=[`Unknown argument \`${e.red(r)}\`.`],i=Hd(r,t);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),t.length>0&&n.push(pt(e)),n.join(" ")}function $d(e,r){let t;r.addErrorMessage(l=>t?.value instanceof G&&t.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=ct(e.argumentPath),s=new ut,a=n.getDeepFieldValue(i)?.asObject();if(a)if(t=a.getField(o),t&&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 ue(o,s).makeRequired())}else{let l=e.inputTypes.map(ma).join(" | ");a.addSuggestion(new ue(o,l).makeRequired())}}function ma(e){return e.kind==="list"?`${ma(e.elementType)}[]`:e.name}function qd(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=Pn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(t)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function jd(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(t)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Pn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Vd(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof G&&(i=s.text)}r.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(t)}\``),s.join(" ")})}function Bd(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&ha(i,e.inputType)}r.addErrorMessage(i=>{let o=[`Argument \`${i.bold(t)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Pn("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(pt(i)),o.join(" ")})}function Ud(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}r.addErrorMessage(o=>{let s=[`Argument \`${o.bold(t)}\` 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 ${Pn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function fa(e,r){for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new ue(t.name,"true"))}function Qd(e,r){for(let t of r.fields)t.isRelation&&!e.hasField(t.name)&&e.addSuggestion(new ue(t.name,"true"))}function Gd(e,r){for(let t of r.fields)!e.hasField(t.name)&&!t.isRelation&&e.addSuggestion(new ue(t.name,"true"))}function Wd(e,r){for(let t of r)e.hasField(t.name)||e.addSuggestion(new ue(t.name,t.typeNames.join(" | ")))}function ga(e,r){let[t,n]=ct(e),i=r.arguments.getDeepSubSelectionValue(t)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function ha(e,r){if(r.kind==="object")for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new ue(t.name,t.typeNames.join(" | ")))}function ct(e){let r=[...e],t=r.pop();if(!t)throw new Error("unexpected empty path");return[r,t]}function pt({green:e,enabled:r}){return"Available options are "+(r?`listed in ${e("green")}`:"marked with ?")+"."}function Pn(e,r){if(r.length===1)return r[0];let t=[...r],n=t.pop();return`${t.join(", ")} ${e} ${n}`}var Jd=3;function Hd(e,r){let t=1/0,n;for(let i of r){let o=(0,pa.default)(e,i);o>Jd||o`}};function Dr(e){return e instanceof dt}var Tn=Symbol(),Ji=new WeakMap,Le=class{constructor(r){r===Tn?Ji.set(this,`Prisma.${this._getName()}`):Ji.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Ji.get(this)}},mt=class extends Le{_getNamespace(){return"NullTypes"}},ft=class extends mt{#e};Hi(ft,"DbNull");var gt=class extends mt{#e};Hi(gt,"JsonNull");var ht=class extends mt{#e};Hi(ht,"AnyNull");var Sn={classes:{DbNull:ft,JsonNull:gt,AnyNull:ht},instances:{DbNull:new ft(Tn),JsonNull:new gt(Tn),AnyNull:new ht(Tn)}};function Hi(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}var ya=": ",Rn=class{constructor(r,t){this.name=r;this.value=t}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+ya.length}write(r){let t=new Te(this.name);this.hasError&&t.underline().setColor(r.context.colors.red),r.write(t).write(ya).write(this.value)}};var Ki=class{arguments;errorMessages=[];constructor(r){this.arguments=r}write(r){r.write(this.arguments)}addErrorMessage(r){this.errorMessages.push(r)}renderAllMessages(r){return this.errorMessages.map(t=>t(r)).join(` +`)}};function _r(e){return new Ki(ba(e))}function ba(e){let r=new Or;for(let[t,n]of Object.entries(e)){let i=new Rn(t,Ea(n));r.addField(i)}return r}function Ea(e){if(typeof e=="string")return new G(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new G(String(e));if(typeof e=="bigint")return new G(`${e}n`);if(e===null)return new G("null");if(e===void 0)return new G("undefined");if(Rr(e))return new G(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new G(`Buffer.alloc(${e.byteLength})`):new G(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let r=gn(e)?e.toISOString():"Invalid Date";return new G(`new Date("${r}")`)}return e instanceof Le?new G(`Prisma.${e._getName()}`):Dr(e)?new G(`prisma.${Ye(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Kd(e):typeof e=="object"?ba(e):new G(Object.prototype.toString.call(e))}function Kd(e){let r=new kr;for(let t of e)r.addItem(Ea(t));return r}function Cn(e,r){let t=r==="pretty"?ca:vn,n=e.renderAllMessages(t),i=new Ar(0,{colors:t}).write(e).toString();return{message:n,args:i}}function An({args:e,errors:r,errorFormat:t,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=_r(e);for(let p of r)En(p,a,s);let{message:l,args:u}=Cn(a,t),c=bn({message:l,callsite:n,originalMethod:i,showColors:t==="pretty",callArguments:u});throw new Z(c,{clientVersion:o})}function Se(e){return e.replace(/^./,r=>r.toLowerCase())}function xa(e,r,t){let n=Se(t);return!r.result||!(r.result.$allModels||r.result[n])?e:Yd({...e,...wa(r.name,e,r.result.$allModels),...wa(r.name,e,r.result[n])})}function Yd(e){let r=new Pe,t=(n,i)=>r.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>t(o,i)):[n]));return xr(e,n=>({...n,needs:t(n.name,new Set)}))}function wa(e,r,t){return t?xr(t,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:zd(r,o,i)})):{}}function zd(e,r,t){let n=e?.[r]?.compute;return n?i=>t({...i,[r]:n(i)}):t}function va(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(e[n.name])for(let i of n.needs)t[i]=!0;return t}function Pa(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(!e[n.name])for(let i of n.needs)delete t[i];return t}var In=class{constructor(r,t){this.extension=r;this.previous=t}computedFieldsCache=new Pe;modelExtensionsCache=new Pe;queryCallbacksCache=new Pe;clientExtensions=at(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=at(()=>{let r=this.previous?.getAllBatchQueryCallbacks()??[],t=this.extension.query?.$__internalBatch;return t?r.concat(t):r});getAllComputedFields(r){return this.computedFieldsCache.getOrCreate(r,()=>xa(this.previous?.getAllComputedFields(r),this.extension,r))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(r){return this.modelExtensionsCache.getOrCreate(r,()=>{let t=Se(r);return!this.extension.model||!(this.extension.model[t]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(r):{...this.previous?.getAllModelExtensions(r),...this.extension.model.$allModels,...this.extension.model[t]}})}getAllQueryCallbacks(r,t){return this.queryCallbacksCache.getOrCreate(`${r}:${t}`,()=>{let n=this.previous?.getAllQueryCallbacks(r,t)??[],i=[],o=this.extension.query;return!o||!(o[r]||o.$allModels||o[t]||o.$allOperations)?n:(o[r]!==void 0&&(o[r][t]!==void 0&&i.push(o[r][t]),o[r].$allOperations!==void 0&&i.push(o[r].$allOperations)),r!=="$none"&&o.$allModels!==void 0&&(o.$allModels[t]!==void 0&&i.push(o.$allModels[t]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[t]!==void 0&&i.push(o[t]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Nr=class e{constructor(r){this.head=r}static empty(){return new e}static single(r){return new e(new In(r))}isEmpty(){return this.head===void 0}append(r){return new e(new In(r,this.head))}getAllComputedFields(r){return this.head?.getAllComputedFields(r)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(r){return this.head?.getAllModelExtensions(r)}getAllQueryCallbacks(r,t){return this.head?.getAllQueryCallbacks(r,t)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var kn=class{constructor(r){this.name=r}};function Ta(e){return e instanceof kn}function Sa(e){return new kn(e)}var Ra=Symbol(),yt=class{constructor(r){if(r!==Ra)throw new Error("Skip instance can not be constructed directly")}ifUndefined(r){return r===void 0?On:r}},On=new yt(Ra);function Re(e){return e instanceof yt}var Zd={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},Ca="explicitly `undefined` values are not allowed";function Dn({modelName:e,action:r,args:t,runtimeDataModel:n,extensions:i=Nr.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new Yi({runtimeDataModel:n,modelName:e,action:r,rootArgs:t,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c});return{modelName:e,action:Zd[r],query:bt(t,p)}}function bt({select:e,include:r,...t}={},n){let i=t.omit;return delete t.omit,{arguments:Ia(t,n),selection:Xd(e,r,i,n)}}function Xd(e,r,t,n){return e?(r?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):t&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),nm(e,n)):em(n,r,t)}function em(e,r,t){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),r&&rm(n,r,e),tm(n,t,e),n}function rm(e,r,t){for(let[n,i]of Object.entries(r)){if(Re(i))continue;let o=t.nestSelection(n);if(zi(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=t.findField(n);if(s&&s.kind!=="object"&&t.throwValidationError({kind:"IncludeOnScalar",selectionPath:t.getSelectionPath().concat(n),outputType:t.getOutputTypeDescription()}),s){e[n]=bt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=bt(i,o)}}function tm(e,r,t){let n=t.getComputedFields(),i={...t.getGlobalOmit(),...r},o=Pa(i,n);for(let[s,a]of Object.entries(o)){if(Re(a))continue;zi(a,t.nestSelection(s));let l=t.findField(s);n?.[s]&&!l||(e[s]=!a)}}function nm(e,r){let t={},n=r.getComputedFields(),i=va(e,n);for(let[o,s]of Object.entries(i)){if(Re(s))continue;let a=r.nestSelection(o);zi(s,a);let l=r.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||Re(s)){t[o]=!1;continue}if(s===!0){l?.kind==="object"?t[o]=bt({},a):t[o]=!0;continue}t[o]=bt(s,a)}}return t}function Aa(e,r){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(Sr(e)){if(gn(e))return{$type:"DateTime",value:e.toISOString()};r.throwValidationError({kind:"InvalidArgumentValue",selectionPath:r.getSelectionPath(),argumentPath:r.getArgumentPath(),argument:{name:r.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(Ta(e))return{$type:"Param",value:e.name};if(Dr(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return im(e,r);if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:Buffer.from(t,n,i).toString("base64")}}if(om(e))return e.values;if(Rr(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Le){if(e!==Sn.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(sm(e))return e.toJSON();if(typeof e=="object")return Ia(e,r);r.throwValidationError({kind:"InvalidArgumentValue",selectionPath:r.getSelectionPath(),argumentPath:r.getArgumentPath(),argument:{name:r.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function Ia(e,r){if(e.$type)return{$type:"Raw",value:e};let t={};for(let n in e){let i=e[n],o=r.nestArgument(n);Re(i)||(i!==void 0?t[n]=Aa(i,o):r.isPreviewFeatureOn("strictUndefinedChecks")&&r.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:r.getSelectionPath(),argument:{name:r.getArgumentName(),typeNames:[]},underlyingError:Ca}))}return t}function im(e,r){let t=[];for(let n=0;n({name:r.name,typeName:"boolean",isRelation:r.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(r){return this.params.previewFeatures.includes(r)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(r){return this.modelOrType?.fields.find(t=>t.name===r)}nestSelection(r){let t=this.findField(r),n=t?.kind==="object"?t.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(r)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[Ye(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:_e(this.params.action,"Unknown action")}}nestArgument(r){return new e({...this.params,argumentPath:this.params.argumentPath.concat(r)})}};function ka(e){if(!e._hasPreviewFlag("metrics"))throw new Z("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var Fr=class{_client;constructor(r){this._client=r}prometheus(r){return ka(this._client),this._client._engine.metrics({format:"prometheus",...r})}json(r){return ka(this._client),this._client._engine.metrics({format:"json",...r})}};function Oa(e,r){let t=at(()=>am(r));Object.defineProperty(e,"dmmf",{get:()=>t.get()})}function am(e){return{datamodel:{models:Zi(e.models),enums:Zi(e.enums),types:Zi(e.types)}}}function Zi(e){return Object.entries(e).map(([r,t])=>({name:r,...t}))}var Xi=new WeakMap,_n="$$PrismaTypedSql",Et=class{constructor(r,t){Xi.set(this,{sql:r,values:t}),Object.defineProperty(this,_n,{value:_n})}get sql(){return Xi.get(this).sql}get values(){return Xi.get(this).values}};function Da(e){return(...r)=>new Et(e,r)}function Nn(e){return e!=null&&e[_n]===_n}var cu=k(Ei());var pu=require("node:async_hooks"),du=require("node:events"),mu=k(require("node:fs")),Zn=k(require("node:path"));var oe=class e{constructor(r,t){if(r.length-1!==t.length)throw r.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${r.length} strings to have ${r.length-1} values`);let n=t.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]=r[0];let i=0,o=0;for(;ie.getPropertyValue(t))},getPropertyDescriptor(t){return e.getPropertyDescriptor?.(t)}}}var Fn={enumerable:!0,configurable:!0,writable:!0};function Ln(e){let r=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>Fn,has:(t,n)=>r.has(n),set:(t,n,i)=>r.add(n)&&Reflect.set(t,n,i),ownKeys:()=>[...r]}}var Fa=Symbol.for("nodejs.util.inspect.custom");function he(e,r){let t=lm(r),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=t.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=t.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=La(Reflect.ownKeys(o),t),a=La(Array.from(t.keys()),t);return[...new Set([...s,...a,...n])]},set(o,s,a){return t.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=t.get(s);return l?l.getPropertyDescriptor?{...Fn,...l?.getPropertyDescriptor(s)}:Fn:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[Fa]=function(){let o={...this};return delete o[Fa],o},i}function lm(e){let r=new Map;for(let t of e){let n=t.getKeys();for(let i of n)r.set(i,t)}return r}function La(e,r){return e.filter(t=>r.get(t)?.has?.(t)??!0)}function Lr(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Mr(e,r){return{batch:e,transaction:r?.kind==="batch"?{isolationLevel:r.options.isolationLevel}:void 0}}function Ma(e){if(e===void 0)return"";let r=_r(e);return new Ar(0,{colors:vn}).write(r).toString()}var um="P2037";function $r({error:e,user_facing_error:r},t,n){return r.error_code?new z(cm(r,n),{code:r.error_code,clientVersion:t,meta:r.meta,batchRequestIdx:r.batch_request_idx}):new j(e,{clientVersion:t,batchRequestIdx:r.batch_request_idx})}function cm(e,r){let t=e.message;return(r==="postgresql"||r==="postgres"||r==="mysql")&&e.error_code===um&&(t+=` +Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),t}var xt="";function $a(e){var r=e.split(` +`);return r.reduce(function(t,n){var i=mm(n)||gm(n)||bm(n)||vm(n)||wm(n);return i&&t.push(i),t},[])}var pm=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,dm=/\((\S*)(?::(\d+))(?::(\d+))\)/;function mm(e){var r=pm.exec(e);if(!r)return null;var t=r[2]&&r[2].indexOf("native")===0,n=r[2]&&r[2].indexOf("eval")===0,i=dm.exec(r[2]);return n&&i!=null&&(r[2]=i[1],r[3]=i[2],r[4]=i[3]),{file:t?null:r[2],methodName:r[1]||xt,arguments:t?[r[2]]:[],lineNumber:r[3]?+r[3]:null,column:r[4]?+r[4]:null}}var fm=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function gm(e){var r=fm.exec(e);return r?{file:r[2],methodName:r[1]||xt,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var hm=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ym=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function bm(e){var r=hm.exec(e);if(!r)return null;var t=r[3]&&r[3].indexOf(" > eval")>-1,n=ym.exec(r[3]);return t&&n!=null&&(r[3]=n[1],r[4]=n[2],r[5]=null),{file:r[3],methodName:r[1]||xt,arguments:r[2]?r[2].split(","):[],lineNumber:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}var Em=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function wm(e){var r=Em.exec(e);return r?{file:r[3],methodName:r[1]||xt,arguments:[],lineNumber:+r[4],column:r[5]?+r[5]:null}:null}var xm=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function vm(e){var r=xm.exec(e);return r?{file:r[2],methodName:r[1]||xt,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var to=class{getLocation(){return null}},no=class{_error;constructor(){this._error=new Error}getLocation(){let r=this._error.stack;if(!r)return null;let n=$a(r).find(i=>{if(!i.file)return!1;let o=Oi(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 Ze(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new to:new no}var qa={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function qr(e={}){let r=Tm(e);return Object.entries(r).reduce((n,[i,o])=>(qa[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Tm(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Mn(e={}){return r=>(typeof e._count=="boolean"&&(r._count=r._count._all),r)}function ja(e,r){let t=Mn(e);return r({action:"aggregate",unpacker:t,argsMapper:qr})(e)}function Sm(e={}){let{select:r,...t}=e;return typeof r=="object"?qr({...t,_count:r}):qr({...t,_count:{_all:!0}})}function Rm(e={}){return typeof e.select=="object"?r=>Mn(e)(r)._count:r=>Mn(e)(r)._count._all}function Va(e,r){return r({action:"count",unpacker:Rm(e),argsMapper:Sm})(e)}function Cm(e={}){let r=qr(e);if(Array.isArray(r.by))for(let t of r.by)typeof t=="string"&&(r.select[t]=!0);else typeof r.by=="string"&&(r.select[r.by]=!0);return r}function Am(e={}){return r=>(typeof e?._count=="boolean"&&r.forEach(t=>{t._count=t._count._all}),r)}function Ba(e,r){return r({action:"groupBy",unpacker:Am(e),argsMapper:Cm})(e)}function Ua(e,r,t){if(r==="aggregate")return n=>ja(n,t);if(r==="count")return n=>Va(n,t);if(r==="groupBy")return n=>Ba(n,t)}function Qa(e,r){let t=r.fields.filter(i=>!i.relationName),n=Ys(t,"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 dt(e,o,s.type,s.isList,s.kind==="enum")},...Ln(Object.keys(n))})}var Ga=e=>Array.isArray(e)?e:e.split("."),io=(e,r)=>Ga(r).reduce((t,n)=>t&&t[n],e),Wa=(e,r,t)=>Ga(r).reduceRight((n,i,o,s)=>Object.assign({},io(e,s.slice(0,o)),{[i]:n}),t);function Im(e,r){return e===void 0||r===void 0?[]:[...r,"select",e]}function km(e,r,t){return r===void 0?e??{}:Wa(r,t,e||!0)}function oo(e,r,t,n,i,o){let a=e._runtimeDataModel.models[r].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Ze(e._errorFormat),c=Im(n,i),p=km(l,o,c),d=t({dataPath:c,callsite:u})(p),f=Om(e,r);return new Proxy(d,{get(g,h){if(!f.includes(h))return g[h];let P=[a[h].type,t,h],S=[c,p];return oo(e,...P,...S)},...Ln([...f,...Object.getOwnPropertyNames(d)])})}}function Om(e,r){return e._runtimeDataModel.models[r].fields.filter(t=>t.kind==="object").map(t=>t.name)}var Dm=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],_m=["aggregate","count","groupBy"];function so(e,r){let t=e._extensions.getAllModelExtensions(r)??{},n=[Nm(e,r),Lm(e,r),wt(t),re("name",()=>r),re("$name",()=>r),re("$parent",()=>e._appliedParent)];return he({},n)}function Nm(e,r){let t=Se(r),n=Object.keys(Cr).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=Ze(e._errorFormat);return e._createPrismaPromise(c=>{let p={args:l,dataPath:[],action:o,model:r,clientMethod:`${t}.${i}`,jsModelName:t,transaction:c,callsite:u};return e._request({...p,...a})},{action:o,args:l,model:r})};return Dm.includes(o)?oo(e,r,s):Fm(i)?Ua(e,i,s):s({})}}}function Fm(e){return _m.includes(e)}function Lm(e,r){return ar(re("fields",()=>{let t=e._runtimeDataModel.models[r];return Qa(r,t)}))}function Ja(e){return e.replace(/^./,r=>r.toUpperCase())}var ao=Symbol();function vt(e){let r=[Mm(e),$m(e),re(ao,()=>e),re("$parent",()=>e._appliedParent)],t=e._extensions.getAllClientExtensions();return t&&r.push(wt(t)),he(e,r)}function Mm(e){let r=Object.getPrototypeOf(e._originalClient),t=[...new Set(Object.getOwnPropertyNames(r))];return{getKeys(){return t},getPropertyValue(n){return e[n]}}}function $m(e){let r=Object.keys(e._runtimeDataModel.models),t=r.map(Se),n=[...new Set(r.concat(t))];return ar({getKeys(){return n},getPropertyValue(i){let o=Ja(i);if(e._runtimeDataModel.models[o]!==void 0)return so(e,o);if(e._runtimeDataModel.models[i]!==void 0)return so(e,i)},getPropertyDescriptor(i){if(!t.includes(i))return{enumerable:!1}}})}function Ha(e){return e[ao]?e[ao]:e}function Ka(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let t=e.client.__AccelerateEngine;this._originalClient._engine=new t(this._originalClient._accelerateEngineConfig)}let r=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return vt(r)}function Ya({result:e,modelName:r,select:t,omit:n,extensions:i}){let o=i.getAllComputedFields(r);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(Lr(u))}else if(t){if(!t[l.name])continue;let u=l.needs.filter(c=>!t[c]);u.length>0&&a.push(Lr(u))}qm(e,l.needs)&&s.push(jm(l,he(e,s)))}return s.length>0||a.length>0?he(e,[...s,...a]):e}function qm(e,r){return r.every(t=>Mi(e,t))}function jm(e,r){return ar(re(e.name,()=>e.compute(r)))}function $n({visitor:e,result:r,args:t,runtimeDataModel:n,modelName:i}){if(Array.isArray(r)){for(let s=0;sc.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};r[o]=$n({visitor:i,result:r[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Za({result:e,modelName:r,args:t,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[r]?e:$n({result:e,args:t??{},modelName:r,runtimeDataModel:i,visitor:(a,l,u)=>{let c=Se(l);return Ya({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var Vm=["$connect","$disconnect","$on","$transaction","$use","$extends"],Xa=Vm;function el(e){if(e instanceof oe)return Bm(e);if(Nn(e))return Um(e);if(Array.isArray(e)){let t=[e[0]];for(let n=1;n{let o=r.customDataProxyFetch;return"transaction"in r&&i!==void 0&&(r.transaction?.kind==="batch"&&r.transaction.lock.then(),r.transaction=i),n===t.length?e._executeRequest(r):t[n]({model:r.model,operation:r.model?r.action:r.clientMethod,args:el(r.args??{}),__internalParams:r,query:(s,a=r)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=sl(o,l),a.args=s,tl(e,a,t,n+1)}})})}function nl(e,r){let{jsModelName:t,action:n,clientMethod:i}=r,o=t?n:i;if(e._extensions.isEmpty())return e._executeRequest(r);let s=e._extensions.getAllQueryCallbacks(t??"$none",o);return tl(e,r,s)}function il(e){return r=>{let t={requests:r},n=r[0].extensions.getAllBatchQueryCallbacks();return n.length?ol(t,n,0,e):e(t)}}function ol(e,r,t,n){if(t===r.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return r[t]({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=sl(i,l),ol(a,r,t+1,n)}})}var rl=e=>e;function sl(e=rl,r=rl){return t=>e(r(t))}var al=N("prisma:client"),ll={Vercel:"vercel","Netlify CI":"netlify"};function ul({postinstall:e,ciName:r,clientVersion:t}){if(al("checkPlatformCaching:postinstall",e),al("checkPlatformCaching:ciName",r),e===!0&&r&&r in ll){let n=`Prisma has detected that this project was built on ${r}, 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/${ll[r]}-build`;throw console.error(n),new T(n,t)}}function cl(e,r){return e?e.datasources?e.datasources:e.datasourceUrl?{[r[0]]:{url:e.datasourceUrl}}:{}:{}}var Qm=()=>globalThis.process?.release?.name==="node",Gm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Wm=()=>!!globalThis.Deno,Jm=()=>typeof globalThis.Netlify=="object",Hm=()=>typeof globalThis.EdgeRuntime=="object",Km=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Ym(){return[[Jm,"netlify"],[Hm,"edge-light"],[Km,"workerd"],[Wm,"deno"],[Gm,"bun"],[Qm,"node"]].flatMap(t=>t[0]()?[t[1]]:[]).at(0)??""}var zm={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function qn(){let e=Ym();return{id:e,prettyName:zm[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var gl=k(require("node:fs")),Tt=k(require("node:path"));function jn(e){let{runtimeBinaryTarget:r}=e;return`Add "${r}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: + +${Zm(e)}`}function Zm(e){let{generator:r,generatorBinaryTargets:t,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...t,i];return Ai({...r,binaryTargets:o})}function Xe(e){let{runtimeBinaryTarget:r}=e;return`Prisma Client could not locate the Query Engine for runtime "${r}".`}function er(e){let{searchedLocations:r}=e;return`The following locations have been searched: +${[...new Set(r)].map(i=>` ${i}`).join(` +`)}`}function pl(e){let{runtimeBinaryTarget:r}=e;return`${Xe(e)} + +This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${r}". +${jn(e)} + +${er(e)}`}function Vn(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 Bn(e){let{errorStack:r}=e;return r?.match(/\/\.next|\/next@|\/next\//)?` + +We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function dl(e){let{queryEngineName:r}=e;return`${Xe(e)}${Bn(e)} + +This is likely caused by a bundler that has not copied "${r}" next to the resulting bundle. +Ensure that "${r}" has been copied next to the bundle or in "${e.expectedLocation}". + +${Vn("engine-not-found-bundler-investigation")} + +${er(e)}`}function ml(e){let{runtimeBinaryTarget:r,generatorBinaryTargets:t}=e,n=t.find(i=>i.native);return`${Xe(e)} + +This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${r}". +${jn(e)} + +${er(e)}`}function fl(e){let{queryEngineName:r}=e;return`${Xe(e)}${Bn(e)} + +This is likely caused by tooling that has not copied "${r}" to the deployment folder. +Ensure that you ran \`prisma generate\` and that "${r}" has been copied to "${e.expectedLocation}". + +${Vn("engine-not-found-tooling-investigation")} + +${er(e)}`}var Xm=N("prisma:client:engines:resolveEnginePath"),ef=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function hl(e,r){let t={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??r.prismaPath;if(t!==void 0)return t;let{enginePath:n,searchedLocations:i}=await rf(e,r);if(Xm("enginePath",n),n!==void 0&&e==="binary"&&vi(n),n!==void 0)return r.prismaPath=n;let o=await ir(),s=r.generator?.binaryTargets??[],a=s.some(d=>d.native),l=!s.some(d=>d.value===o),u=__filename.match(ef())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:r.generator,runtimeBinaryTarget:o,queryEngineName:yl(e,o),expectedLocation:Tt.default.relative(process.cwd(),r.dirname),errorStack:new Error().stack},p;throw a&&l?p=ml(c):l?p=pl(c):u?p=dl(c):p=fl(c),new T(p,r.clientVersion)}async function rf(e,r){let t=await ir(),n=[],i=[r.dirname,Tt.default.resolve(__dirname,".."),r.generator?.output?.value??__dirname,Tt.default.resolve(__dirname,"../../../.prisma/client"),"/tmp/prisma-engines",r.cwd];__filename.includes("resolveEnginePath")&&i.push(fs());for(let o of i){let s=yl(e,t),a=Tt.default.join(o,s);if(n.push(o),gl.default.existsSync(a))return{enginePath:a,searchedLocations:n}}return{enginePath:void 0,searchedLocations:n}}function yl(e,r){return e==="library"?Bt(r,"fs"):`query-engine-${r}${r==="windows"?".exe":""}`}var lo=k(ki());function bl(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,r=>`${r[0]}5`):""}function El(e){return e.split(` +`).map(r=>r.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 wl=k(Ns());function xl({title:e,user:r="prisma",repo:t="prisma",template:n="bug_report.yml",body:i}){return(0,wl.default)({user:r,repo:t,template:n,title:e,body:i})}function vl({version:e,binaryTarget:r,title:t,description:n,engineVersion:i,database:o,query:s}){let a=Qo(6e3-(s?.length??0)),l=El((0,lo.default)(a)),u=n?`# Description +\`\`\` +${n} +\`\`\``:"",c=(0,lo.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: +## Versions + +| Name | Version | +|-----------------|--------------------| +| Node | ${process.version?.padEnd(19)}| +| OS | ${r?.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?bl(s):""} +\`\`\` +`),p=xl({title:t,body:c});return`${t} + +This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. + +${Y(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 uo(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function Un(e){return{ok:!0,value:e,map(r){return Un(r(e))},flatMap(r){return r(e)}}}function lr(e){return{ok:!1,error:e,map(){return lr(e)},flatMap(){return lr(e)}}}var Pl=N("driver-adapter-utils"),co=class{registeredErrors=[];consumeError(r){return this.registeredErrors[r]}registerNewError(r){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:r},t}};var po=(e,r=new co)=>{let t={adapterName:e.adapterName,errorRegistry:r,queryRaw:Me(r,e.queryRaw.bind(e)),executeRaw:Me(r,e.executeRaw.bind(e)),executeScript:Me(r,e.executeScript.bind(e)),dispose:Me(r,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await Me(r,e.startTransaction.bind(e))(...n)).map(o=>tf(r,o))};return e.getConnectionInfo&&(t.getConnectionInfo=nf(r,e.getConnectionInfo.bind(e))),t},tf=(e,r)=>({adapterName:r.adapterName,provider:r.provider,options:r.options,queryRaw:Me(e,r.queryRaw.bind(r)),executeRaw:Me(e,r.executeRaw.bind(r)),commit:Me(e,r.commit.bind(r)),rollback:Me(e,r.rollback.bind(r))});function Me(e,r){return async(...t)=>{try{return Un(await r(...t))}catch(n){if(Pl("[error@wrapAsync]",n),uo(n))return lr(n.cause);let i=e.registerNewError(n);return lr({kind:"GenericJs",id:i})}}}function nf(e,r){return(...t)=>{try{return Un(r(...t))}catch(n){if(Pl("[error@wrapSync]",n),uo(n))return lr(n.cause);let i=e.registerNewError(n);return lr({kind:"GenericJs",id:i})}}}function jr({inlineDatasources:e,overrideDatasources:r,env:t,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=r[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=t[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new T(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new T("error: Missing URL environment variable, value, or override.",n);return i}var Qn=class extends Error{clientVersion;cause;constructor(r,t){super(r),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends Qn{isRetryable;constructor(r,t){super(r,t),this.isRetryable=t.isRetryable??!0}};function R(e,r){return{...e,isRetryable:r}}var Vr=class extends se{name="ForcedRetryError";code="P5001";constructor(r){super("This request must be retried",R(r,!0))}};x(Vr,"ForcedRetryError");var ur=class extends se{name="InvalidDatasourceError";code="P6001";constructor(r,t){super(r,R(t,!1))}};x(ur,"InvalidDatasourceError");var cr=class extends se{name="NotImplementedYetError";code="P5004";constructor(r,t){super(r,R(t,!1))}};x(cr,"NotImplementedYetError");var $=class extends se{response;constructor(r,t){super(r,t),this.response=t.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var pr=class extends ${name="SchemaMissingError";code="P5005";constructor(r){super("Schema needs to be uploaded",R(r,!0))}};x(pr,"SchemaMissingError");var mo="This request could not be understood by the server",St=class extends ${name="BadRequestError";code="P5000";constructor(r,t,n){super(t||mo,R(r,!1)),n&&(this.code=n)}};x(St,"BadRequestError");var Rt=class extends ${name="HealthcheckTimeoutError";code="P5013";logs;constructor(r,t){super("Engine not started: healthcheck timeout",R(r,!0)),this.logs=t}};x(Rt,"HealthcheckTimeoutError");var Ct=class extends ${name="EngineStartupError";code="P5014";logs;constructor(r,t,n){super(t,R(r,!0)),this.logs=n}};x(Ct,"EngineStartupError");var At=class extends ${name="EngineVersionNotSupportedError";code="P5012";constructor(r){super("Engine version is not supported",R(r,!1))}};x(At,"EngineVersionNotSupportedError");var fo="Request timed out",It=class extends ${name="GatewayTimeoutError";code="P5009";constructor(r,t=fo){super(t,R(r,!1))}};x(It,"GatewayTimeoutError");var of="Interactive transaction error",kt=class extends ${name="InteractiveTransactionError";code="P5015";constructor(r,t=of){super(t,R(r,!1))}};x(kt,"InteractiveTransactionError");var sf="Request parameters are invalid",Ot=class extends ${name="InvalidRequestError";code="P5011";constructor(r,t=sf){super(t,R(r,!1))}};x(Ot,"InvalidRequestError");var go="Requested resource does not exist",Dt=class extends ${name="NotFoundError";code="P5003";constructor(r,t=go){super(t,R(r,!1))}};x(Dt,"NotFoundError");var ho="Unknown server error",Br=class extends ${name="ServerError";code="P5006";logs;constructor(r,t,n){super(t||ho,R(r,!0)),this.logs=n}};x(Br,"ServerError");var yo="Unauthorized, check your connection string",_t=class extends ${name="UnauthorizedError";code="P5007";constructor(r,t=yo){super(t,R(r,!1))}};x(_t,"UnauthorizedError");var bo="Usage exceeded, retry again later",Nt=class extends ${name="UsageExceededError";code="P5008";constructor(r,t=bo){super(t,R(r,!0))}};x(Nt,"UsageExceededError");async function af(e){let r;try{r=await e.text()}catch{return{type:"EmptyError"}}try{let t=JSON.parse(r);if(typeof t=="string")switch(t){case"InternalDataProxyError":return{type:"DataProxyError",body:t};default:return{type:"UnknownTextError",body:t}}if(typeof t=="object"&&t!==null){if("is_panic"in t&&"message"in t&&"error_code"in t)return{type:"QueryEngineError",body:t};if("EngineNotStarted"in t||"InteractiveTransactionMisrouted"in t||"InvalidRequestError"in t){let n=Object.values(t)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:t}:{type:"DataProxyError",body:t}}}return{type:"UnknownJsonError",body:t}}catch{return r===""?{type:"EmptyError"}:{type:"UnknownTextError",body:r}}}async function Ft(e,r){if(e.ok)return;let t={clientVersion:r,response:e},n=await af(e);if(n.type==="QueryEngineError")throw new z(n.body.message,{code:n.body.error_code,clientVersion:r});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Br(t,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new pr(t);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new At(t);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Ct(t,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new T(i,r,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Rt(t,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 kt(t,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ot(t,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new _t(t,Ur(yo,n));if(e.status===404)return new Dt(t,Ur(go,n));if(e.status===429)throw new Nt(t,Ur(bo,n));if(e.status===504)throw new It(t,Ur(fo,n));if(e.status>=500)throw new Br(t,Ur(ho,n));if(e.status>=400)throw new St(t,Ur(mo,n))}function Ur(e,r){return r.type==="EmptyError"?e:`${e}: ${JSON.stringify(r)}`}function Tl(e){let r=Math.pow(2,e)*50,t=Math.ceil(Math.random()*r)-Math.ceil(r/2),n=r+t;return new Promise(i=>setTimeout(()=>i(n),n))}var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Sl(e){let r=new TextEncoder().encode(e),t="",n=r.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,t+=$e[s]+$e[a]+$e[l]+$e[u];return i==1?(c=r[o],s=(c&252)>>2,a=(c&3)<<4,t+=$e[s]+$e[a]+"=="):i==2&&(c=r[o]<<8|r[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,t+=$e[s]+$e[a]+$e[l]+"="),t}function Rl(e){if(!!e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new T("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)}function lf(e){return e[0]*1e3+e[1]/1e6}function Eo(e){return new Date(lf(e))}var Cl={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Lt=class extends se{name="RequestError";code="P5010";constructor(r,t){super(`Cannot fetch data from service: +${r}`,R(t,!0))}};x(Lt,"RequestError");async function dr(e,r,t=n=>n){let{clientVersion:n,...i}=r,o=t(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new Lt(a,{clientVersion:n,cause:s})}}var cf=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Al=N("prisma:client:dataproxyEngine");async function pf(e,r){let t=Cl["@prisma/engines-version"],n=r.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&&cf.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]=t.split("-")??[],[a,l,u]=s.split("."),c=df(`<=${a}.${l}.${u}`),p=await dr(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();Al("length of body fetched from unpkg.com",d.length);let f;try{f=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return f.version}throw new cr("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Il(e,r){let t=await pf(e,r);return Al("version",t),t}function df(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var kl=3,Gn=N("prisma:client:dataproxyEngine"),wo=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:r,tracingHelper:t,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=r,this.tracingHelper=t,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:r,interactiveTransaction:t}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=r??this.tracingHelper.getTraceParent()),t&&(n["X-transaction-id"]=t.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let r=[];return this.tracingHelper.isEnabled()&&r.push("tracing"),this.logLevel&&r.push(this.logLevel),this.logQueries&&r.push("query"),r}},Mt=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;constructor(r){Rl(r),this.config=r,this.env={...r.env,...typeof process<"u"?process.env:{}},this.inlineSchema=Sl(r.inlineSchema),this.inlineDatasources=r.inlineDatasources,this.inlineSchemaHash=r.inlineSchemaHash,this.clientVersion=r.clientVersion,this.engineHash=r.engineVersion,this.logEmitter=r.logEmitter,this.tracingHelper=r.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[r,t]=this.extractHostAndApiKey();this.host=r,this.headerBuilder=new wo({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await Il(r,this.config),Gn("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){r?.logs?.length&&r.logs.forEach(t=>{switch(t.level){case"debug":case"trace":Gn(t);break;case"error":case"warn":case"info":{this.logEmitter.emit(t.level,{timestamp:Eo(t.timestamp),message:t.attributes.message??"",target:t.target});break}case"query":{this.logEmitter.emit("query",{query:t.attributes.query??"",timestamp:Eo(t.timestamp),duration:t.attributes.duration_ms??0,params:t.attributes.params??"",target:t.target});break}default:t.level}}),r?.traces?.length&&this.tracingHelper.dispatchEngineSpans(r.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}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 t=await dr(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});t.ok||Gn("schema response status",t.status);let n=await Ft(t,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(r,{traceparent:t,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:r,traceparent:t,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(r,{traceparent:t,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Mr(r,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:t})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:r,traceparent:t,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await dr(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t,interactiveTransaction:i}),body:JSON.stringify(r),clientVersion:this.clientVersion},n);a.ok||Gn("graphql response status",a.status),await this.handleError(await Ft(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(r,t,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[r]} transaction`,callback:async({logHttpCall:o})=>{if(r==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await dr(a,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Ft(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${r}`;o(s);let a=await dr(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Ft(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let r={clientVersion:this.clientVersion},t=Object.keys(this.inlineDatasources)[0],n=jr({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new ur(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!==en)throw new ur(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r);let l=a.get("api_key");if(l===null||l.length<1)throw new ur(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,r);return[s,l]}metrics(){throw new cr("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){for(let t=0;;t++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${t})`,timestamp:new Date,target:""})};try{return await r.callback({logHttpCall:n})}catch(i){if(!(i instanceof se)||!i.isRetryable)throw i;if(t>=kl)throw i instanceof Vr?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${t+1}/${kl} failed for ${r.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await Tl(t);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(r){if(r instanceof pr)throw await this.uploadSchema(),new Vr({clientVersion:this.clientVersion,cause:r});if(r)throw r}convertProtocolErrorsToClientError(r){return r.length===1?$r(r[0],this.config.clientVersion,this.config.activeProvider):new j(JSON.stringify(r),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Ol(e){if(e?.kind==="itx")return e.options.id}var vo=k(require("node:os")),Dl=k(require("node:path"));var xo=Symbol("PrismaLibraryEngineCache");function mf(){let e=globalThis;return e[xo]===void 0&&(e[xo]={}),e[xo]}function ff(e){let r=mf();if(r[e]!==void 0)return r[e];let t=Dl.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=vo.default.constants.dlopen.RTLD_LAZY|vo.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,t,i),r[e]=n.exports,n.exports}var _l={async loadLibrary(e){let r=await pi(),t=await hl("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>ff(t))}catch(n){let i=Pi({e:n,platformInfo:r,id:t});throw new T(i,e.clientVersion)}}};var Po,Nl={async loadLibrary(e){let{clientVersion:r,adapter:t,engineWasm:n}=e;if(t===void 0)throw new T(`The \`adapter\` option for \`PrismaClient\` is required in this context (${qn().prettyName})`,r);if(n===void 0)throw new T("WASM engine was unexpectedly `undefined`",r);Po===void 0&&(Po=(async()=>{let o=await n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new T("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",r);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a),u=l.exports.__wbindgen_start;return o.__wbg_set_wasm(l.exports),u(),o.QueryEngine})());let i=await Po;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var gf="P2036",Ce=N("prisma:client:libraryEngine");function hf(e){return e.item_type==="query"&&"query"in e}function yf(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var Fl=[...oi,"native"],bf=0xffffffffffffffffn,To=1n;function Ef(){let e=To++;return To>bf&&(To=1n),e}var Qr=class{name="LibraryEngine";engine;libraryInstantiationPromise;libraryStartingPromise;libraryStoppingPromise;libraryStarted;executingQueryPromise;config;QueryEngineConstructor;libraryLoader;library;logEmitter;libQueryEnginePath;binaryTarget;datasourceOverrides;datamodel;logQueries;logLevel;lastQuery;loggerRustPanic;tracingHelper;adapterPromise;versionInfo;constructor(r,t){this.libraryLoader=t??_l,r.engineWasm!==void 0&&(this.libraryLoader=t??Nl),this.config=r,this.libraryStarted=!1,this.logQueries=r.logQueries??!1,this.logLevel=r.logLevel??"error",this.logEmitter=r.logEmitter,this.datamodel=r.inlineSchema,this.tracingHelper=r.tracingHelper,r.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(r.overrideDatasources)[0],i=r.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(r){return{applyPendingMigrations:r.applyPendingMigrations?.bind(r),commitTransaction:this.withRequestId(r.commitTransaction.bind(r)),connect:this.withRequestId(r.connect.bind(r)),disconnect:this.withRequestId(r.disconnect.bind(r)),metrics:r.metrics?.bind(r),query:this.withRequestId(r.query.bind(r)),rollbackTransaction:this.withRequestId(r.rollbackTransaction.bind(r)),sdlSchema:r.sdlSchema?.bind(r),startTransaction:this.withRequestId(r.startTransaction.bind(r)),trace:r.trace.bind(r)}}withRequestId(r){return async(...t)=>{let n=Ef().toString();try{return await r(...t,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(r,t,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(t),s;if(r==="start"){let l=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(l,o)}else r==="commit"?s=await this.engine?.commitTransaction(n.id,o):r==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if(wf(a)){let l=this.getExternalAdapterError(a,i?.errorRegistry);throw l?l.error:new z(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new j(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(Ce("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;ii(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let r=await this.tracingHelper.runInChildSpan("detect_platform",()=>ir());if(!Fl.includes(r))throw new T(`Unknown ${ce("PRISMA_QUERY_ENGINE_LIBRARY")} ${ce(W(r))}. Possible binaryTargets: ${qe(Fl.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 j("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new j("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.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let r=new WeakRef(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(po));let t=await this.adapterPromise;t&&Ce("Using driver adapter: %O",t),this.engine=this.wrapEngine(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",enableTracing:this.tracingHelper.isEnabled()},n=>{r.deref()?.logger(n)},t))}catch(r){let t=r,n=this.parseInitError(t.message);throw typeof n=="string"?t:new T(n.message,this.config.clientVersion,n.error_code)}}}logger(r){let t=this.parseEngineResponse(r);t&&(t.level=t?.level.toLowerCase()??"unknown",hf(t)?this.logEmitter.emit("query",{timestamp:new Date,query:t.query,params:t.params,duration:Number(t.duration_ms),target:t.module_path}):yf(t)?this.loggerRustPanic=new le(So(this,`${t.message}: ${t.reason} in ${t.file}:${t.line}:${t.column}`),this.config.clientVersion):this.logEmitter.emit(t.level,{timestamp:new Date,message:t.message,target:t.module_path}))}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}onBeforeExit(){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.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Ce(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{Ce("library starting");try{let t={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(t)),this.libraryStarted=!0,Ce("library started")}catch(t){let n=this.parseInitError(t.message);throw typeof n=="string"?t:new T(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryInstantiationPromise,await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Ce("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(n=>setTimeout(n,5)),Ce("library stopping");let t={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(t)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0,Ce("library stopped")};return this.libraryStoppingPromise=this.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:t,interactiveTransaction:n}){Ce(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:t}),o=JSON.stringify(r);try{await this.start();let s=await this.adapterPromise;this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],s?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof T)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new le(So(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new j(`${a.message} +${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:t,traceparent:n}){Ce("requestBatch");let i=Mr(r,t);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Ol(t));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],o?.errorRegistry):new j(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],o?.errorRegistry):{data:c});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(r,t){if(r.user_facing_error.is_panic)return new le(So(this,r.user_facing_error.message),this.config.clientVersion);let n=this.getExternalAdapterError(r.user_facing_error,t);return n?n.error:$r(r,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(r,t){if(r.error_code===gf&&t){let n=r.meta?.id;rn(typeof n=="number","Malformed external JS error received from the engine");let i=t.consumeError(n);return rn(i,"External error with reported id was not registered"),i}}async metrics(r){await this.start();let t=await this.engine.metrics(JSON.stringify(r));return r.format==="prometheus"?t:this.parseEngineResponse(t)}};function wf(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function So(e,r){return vl({binaryTarget:e.binaryTarget,title:r,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Ll({copyEngine:e=!0},r){let t;try{t=jr({inlineDatasources:r.inlineDatasources,overrideDatasources:r.overrideDatasources,env:{...r.env,...process.env},clientVersion:r.clientVersion})}catch{}let n=!!(t?.startsWith("prisma://")||Si(t));e&&n&&ot("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Er(r.generator),o=n||!e,s=!!r.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let c;throw e?t?.startsWith("prisma://")?c=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new Z(c.join(` +`),{clientVersion:r.clientVersion})}return o?new Mt(r):a?new Qr(r):new Qr(r)}function Wn({generator:e}){return e?.previewFeatures??[]}var Ml=e=>({command:e});var $l=e=>e.strings.reduce((r,t,n)=>`${r}@P${n}${t}`);function Gr(e){try{return ql(e,"fast")}catch{return ql(e,"slow")}}function ql(e,r){return JSON.stringify(e.map(t=>Vl(t,r)))}function Vl(e,r){if(Array.isArray(e))return e.map(t=>Vl(t,r));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(Sr(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(ve.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(xf(e))return{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:Buffer.from(t,n,i).toString("base64")}}return typeof e=="object"&&r==="slow"?Bl(e):e}function xf(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Bl(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(jl);let r={};for(let t of Object.keys(e))r[t]=jl(e[t]);return r}function jl(e){return typeof e=="bigint"?e.toString():Bl(e)}var vf=/^(\s*alter\s)/i,Ul=N("prisma:client");function Ro(e,r,t,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&t.length>0&&vf.exec(r))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 Co=({clientMethod:e,activeProvider:r})=>t=>{let n="",i;if(Nn(t))n=t.sql,i={values:Gr(t.values),__prismaRawParameters__:!0};else if(Array.isArray(t)){let[o,...s]=t;n=o,i={values:Gr(s||[]),__prismaRawParameters__:!0}}else switch(r){case"sqlite":case"mysql":{n=t.sql,i={values:Gr(t.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=t.text,i={values:Gr(t.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=$l(t),i={values:Gr(t.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${r} provider does not support ${e}`)}return i?.values?Ul(`prisma.${e}(${n}, ${i.values})`):Ul(`prisma.${e}(${n})`),{query:n,parameters:i}},Ql={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[r,...t]=e;return new oe(r,t)}},Gl={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Ao(e){return function(t,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Wl(t(s)):Wl(t(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Wl(e){return typeof e.then=="function"?e:Promise.resolve(e)}var Pf=bi.split(".")[0],Tf={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,r){return r()}},Io=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(r){return this.getGlobalTracingHelper().getTraceParent(r)}dispatchEngineSpans(r){return this.getGlobalTracingHelper().dispatchEngineSpans(r)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(r,t){return this.getGlobalTracingHelper().runInChildSpan(r,t)}getGlobalTracingHelper(){let r=globalThis[`V${Pf}_PRISMA_INSTRUMENTATION`],t=globalThis.PRISMA_INSTRUMENTATION;return r?.helper??t?.helper??Tf}};function Jl(){return new Io}function Hl(e,r=()=>{}){let t,n=new Promise(i=>t=i);return{then(i){return--e===0&&t(r()),i?.(n)}}}function Kl(e){return typeof e=="string"?e:e.reduce((r,t)=>{let n=typeof t=="string"?t:t.level;return n==="query"?r:r&&(t==="info"||r==="info")?"info":n},void 0)}var Jn=class{_middlewares=[];use(r){this._middlewares.push(r)}get(r){return this._middlewares[r]}has(r){return!!this._middlewares[r]}length(){return this._middlewares.length}};var zl=k(ki());function Hn(e){return typeof e.batchRequestIdx=="number"}function Yl(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let r=[];return e.modelName&&r.push(e.modelName),e.query.arguments&&r.push(ko(e.query.arguments)),r.push(ko(e.query.selection)),r.join("")}function ko(e){return`(${Object.keys(e).sort().map(t=>{let n=e[t];return typeof n=="object"&&n!==null?`(${t} ${ko(n)})`:t}).join(" ")})`}var Sf={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!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,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function Oo(e){return Sf[e]}var Kn=class{constructor(r){this.options=r;this.batches={}}batches;tickActive=!1;request(r){let t=this.options.batchBy(r);return t?(this.batches[t]||(this.batches[t]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[t].push({request:r,resolve:n,reject:i})})):this.options.singleLoader(r)}dispatchBatches(){for(let r in this.batches){let t=this.batches[r];delete this.batches[r],t.length===1?this.options.singleLoader(t[0].request).then(n=>{n instanceof Error?t[0].reject(n):t[0].resolve(n)}).catch(n=>{t[0].reject(n)}):(t.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(t.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;imr("bigint",t));case"bytes-array":return r.map(t=>mr("bytes",t));case"decimal-array":return r.map(t=>mr("decimal",t));case"datetime-array":return r.map(t=>mr("datetime",t));case"date-array":return r.map(t=>mr("date",t));case"time-array":return r.map(t=>mr("time",t));default:return r}}function Yn(e){let r=[],t=Rf(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>Oo(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Af(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"?Zl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Oo(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Yl(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(r){try{return await this.dataloader.request(r)}catch(t){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=r;this.handleAndLogRequestError({error:t,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:r.globalOmit})}}mapQueryEngineResult({dataPath:r,unpacker:t},n){let i=n?.data,o=this.unpack(i,r,t);return process.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(r){try{this.handleRequestError(r)}catch(t){throw this.logEmitter&&this.logEmitter.emit("error",{message:t.message,target:r.clientMethod,timestamp:new Date}),t}}handleRequestError({error:r,clientMethod:t,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(Cf(r),If(r,i))throw r;if(r instanceof z&&kf(r)){let u=Xl(r.meta);An({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:t,clientVersion:this.client._clientVersion,globalOmit:a})}let l=r.message;if(n&&(l=bn({callsite:n,originalMethod:t,isPanic:r.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),r.code){let u=s?{modelName:s,...r.meta}:r.meta;throw new z(l,{code:r.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:r.batchRequestIdx})}else{if(r.isPanic)throw new le(l,this.client._clientVersion);if(r instanceof j)throw new j(l,{clientVersion:this.client._clientVersion,batchRequestIdx:r.batchRequestIdx});if(r instanceof T)throw new T(l,this.client._clientVersion);if(r instanceof le)throw new le(l,this.client._clientVersion)}throw r.clientVersion=this.client._clientVersion,r}sanitizeMessage(r){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,zl.default)(r):r}unpack(r,t,n){if(!r||(r.data&&(r=r.data),!r))return r;let i=Object.keys(r)[0],o=Object.values(r)[0],s=t.filter(u=>u!=="select"&&u!=="include"),a=io(o,s),l=i==="queryRaw"?Yn(a):Tr(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Af(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Zl(e)};_e(e,"Unknown transaction kind")}}function Zl(e){return{id:e.id,payload:e.payload}}function If(e,r){return Hn(e)&&r?.kind==="batch"&&e.batchRequestIdx!==r.index}function kf(e){return e.code==="P2009"||e.code==="P2012"}function Xl(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Xl)};if(Array.isArray(e.selectionPath)){let[,...r]=e.selectionPath;return{...e,selectionPath:r}}return e}var eu="6.7.0";var ru=eu;var su=k(Gi());var D=class extends Error{constructor(r){super(r+` +Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};x(D,"PrismaClientConstructorValidationError");var tu=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],nu=["pretty","colorless","minimal"],iu=["info","query","warn","error"],Df={datasources:(e,{datasourceNames:r})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[t,n]of Object.entries(e)){if(!r.includes(t)){let i=Wr(t,r)||` Available datasources: ${r.join(", ")}`;throw new D(`Unknown datasource ${t} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${t}" 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 D(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new D(`Invalid value ${JSON.stringify(o)} for datasource "${t}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,r)=>{if(!e&&Er(r.generator)==="client")throw new D('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new D('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Wn(r).includes("driverAdapters"))throw new D('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Er(r.generator)==="binary")throw new D('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new D(`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 D(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!nu.includes(e)){let r=Wr(e,nu);throw new D(`Invalid errorFormat ${e} provided to PrismaClient constructor.${r}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function r(t){if(typeof t=="string"&&!iu.includes(t)){let n=Wr(t,iu);throw new D(`Invalid log level "${t}" provided to PrismaClient constructor.${n}`)}}for(let t of e){r(t);let n={level:r,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Wr(i,o);throw new D(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(t&&typeof t=="object")for(let[i,o]of Object.entries(t))if(n[i])n[i](o);else throw new D(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let r=e.maxWait;if(r!=null&&r<=0)throw new D(`Invalid value ${r} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let t=e.timeout;if(t!=null&&t<=0)throw new D(`Invalid value ${t} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,r)=>{if(typeof e!="object")throw new D('"omit" option is expected to be an object.');if(e===null)throw new D('"omit" option can not be `null`');let t=[];for(let[n,i]of Object.entries(e)){let o=Nf(n,r.runtimeDataModel);if(!o){t.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){t.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){t.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&t.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(t.length>0)throw new D(Ff(e,t))},__internal:e=>{if(!e)return;let r=["debug","engine","configOverride"];if(typeof e!="object")throw new D(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[t]of Object.entries(e))if(!r.includes(t)){let n=Wr(t,r);throw new D(`Invalid property ${JSON.stringify(t)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function au(e,r){for(let[t,n]of Object.entries(e)){if(!tu.includes(t)){let i=Wr(t,tu);throw new D(`Unknown property ${t} provided to PrismaClient constructor.${i}`)}Df[t](n,r)}if(e.datasourceUrl&&e.datasources)throw new D('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Wr(e,r){if(r.length===0||typeof e!="string")return"";let t=_f(e,r);return t?` Did you mean "${t}"?`:""}function _f(e,r){if(r.length===0)return null;let t=r.map(i=>({value:i,distance:(0,su.default)(e,i)}));t.sort((i,o)=>i.distanceYe(n)===r);if(t)return e[t]}function Ff(e,r){let t=_r(e);for(let o of r)switch(o.kind){case"UnknownModel":t.arguments.getField(o.modelKey)?.markAsError(),t.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":t.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),t.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":t.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),t.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":t.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),t.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Cn(t,"colorless");return`Error validating "omit" option: + +${i} + +${n}`}function lu(e){return e.length===0?Promise.resolve([]):new Promise((r,t)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?t(i):r(n)))},l=u=>{o||(o=!0,t(u))};for(let u=0;u{n[u]=c,a()},c=>{if(!Hn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var rr=N("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Lf={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Mf=Symbol.for("prisma.client.transaction.id"),$f={id:0,nextId(){return++this.id}};function fu(e){class r{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Jn;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=Ao();constructor(n){e=n?.__internal?.configOverride?.(e)??e,ul(e),n&&au(n,e);let i=new du.EventEmitter().on("error",()=>{});this._extensions=Nr.empty(),this._previewFeatures=Wn(e),this._clientVersion=e.clientVersion??ru,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Jl();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Zn.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Zn.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new T(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new T("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=!s&&o&&it(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&N.enable("prisma:client");let p=Zn.default.resolve(e.dirname,e.relativePath);mu.default.existsSync(p)||(p=e.dirname),rr("dirname",e.dirname),rr("relativePath",e.relativePath),rr("cwd",p);let d=u.engine||{};if(l.errorFormat?this._errorFormat=l.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:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:d.allowTriggerPanic,prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Kl(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:cl(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:jr,getBatchRequestPayload:Mr,prismaGraphQLToJSError:$r,PrismaClientUnknownRequestError:j,PrismaClientInitializationError:T,PrismaClientKnownRequestError:z,debug:N("prisma:client:accelerateEngine"),engineVersion:cu.version,clientVersion:e.clientVersion}},rr("clientVersion",e.clientVersion),this._engine=Ll(e,this._engineConfig),this._requestHandler=new zn(this,i),l.log)for(let f of l.log){let g=typeof f=="string"?f:f.emit==="stdout"?f.level:null;g&&this.$on(g,h=>{tt.log(`${tt.tags[g]??""}`,h.message||h.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=vt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$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{Go()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Co({clientMethod:i,activeProvider:a}),callsite:Ze(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=uu(n,i);return Ro(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Z("`$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=>(Ro(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Z(`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:Ml,callsite:Ze(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Co({clientMethod:i,activeProvider:a}),callsite:Ze(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...uu(n,i));throw new Z("`$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})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new Z("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=$f.nextId(),s=Hl(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??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return lu(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return he(vt(he(Ha(this),[re("_appliedParent",()=>this._appliedParent._createItxClient(n)),re("_createPrismaPromise",()=>Ao(n)),re(Mf,()=>n.id)])),[Lr(Xa)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}: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??Lf,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,I=>c(u,P=>(I?.end(),l(P))));let{runInTransaction:p,args:d,...f}=u,g={...n,...f};d&&(g.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await nl(this,g);return g.model?Za({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new pu.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 g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>Dn({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return N.enabled("prisma:client")&&(rr("Prisma Client call:"),rr(`prisma.${i}(${Ma(n)})`),rr("Generated request:"),rr(JSON.stringify(h,null,2)+` +`)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,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(),globalOmit:this._globalOmit,customDataProxyFetch:f})}catch(g){throw g.clientVersion=this._clientVersion,g}}$metrics=new Fr(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=Ka}return r}function uu(e,r){return qf(e)?[new oe(e,r),Ql]:[e,Gl]}function qf(e){return Array.isArray(e)&&Array.isArray(e.raw)}var jf=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function gu(e){return new Proxy(e,{get(r,t){if(t in r)return r[t];if(!jf.has(t))throw new TypeError(`Invalid enum value: ${String(t)}`)}})}function hu(e){it(e,{conflictCheck:"warn"})}0&&(module.exports={DMMF,Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce}); +/*! Bundled license information: + +decimal.js/decimal.mjs: + (*! + * decimal.js v10.5.0 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2025 Michael Mclaughlin + * MIT Licence + *) +*/ +//# sourceMappingURL=library.js.map diff --git a/src/generated/prisma/runtime/react-native.js b/src/generated/prisma/runtime/react-native.js new file mode 100644 index 0000000..23cd2fa --- /dev/null +++ b/src/generated/prisma/runtime/react-native.js @@ -0,0 +1,83 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ +"use strict";var wa=Object.create;var tr=Object.defineProperty;var ba=Object.getOwnPropertyDescriptor;var Ea=Object.getOwnPropertyNames;var xa=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var ge=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ze=(e,t)=>{for(var r in t)tr(e,r,{get:t[r],enumerable:!0})},ni=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ea(t))!Pa.call(e,i)&&i!==r&&tr(e,i,{get:()=>t[i],enumerable:!(n=ba(t,i))||n.enumerable});return e};var Se=(e,t,r)=>(r=e!=null?wa(xa(e)):{},ni(t||!e||!e.__esModule?tr(r,"default",{value:e,enumerable:!0}):r,e)),va=e=>ni(tr({},"__esModule",{value:!0}),e);var y,c=ge(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var x,p=ge(()=>{"use strict";x=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,d=ge(()=>{"use strict";E=()=>{};E.prototype=E});var b,f=ge(()=>{"use strict";b=class{value;constructor(t){this.value=t}deref(){return this.value}}});var Pi=Ae(rt=>{"use strict";m();c();p();d();f();var li=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ta=li(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=R;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var M=C.indexOf("=");M===-1&&(M=A);var I=M===A?0:4-M%4;return[M,I]}function l(C){var A=a(C),M=A[0],I=A[1];return(M+I)*3/4-I}function u(C,A,M){return(A+M)*3/4-M}function g(C){var A,M=a(C),I=M[0],L=M[1],k=new n(u(C,I,L)),D=0,z=L>0?I-4:I,B;for(B=0;B>16&255,k[D++]=A>>8&255,k[D++]=A&255;return L===2&&(A=r[C.charCodeAt(B)]<<2|r[C.charCodeAt(B+1)]>>4,k[D++]=A&255),L===1&&(A=r[C.charCodeAt(B)]<<10|r[C.charCodeAt(B+1)]<<4|r[C.charCodeAt(B+2)]>>2,k[D++]=A>>8&255,k[D++]=A&255),k}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function v(C,A,M){for(var I,L=[],k=A;kz?z:D+k));return I===1?(A=C[M-1],L.push(t[A>>2]+t[A<<4&63]+"==")):I===2&&(A=(C[M-2]<<8)+C[M-1],L.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),L.join("")}}),Ca=li(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,u=(1<>1,h=-7,v=n?o-1:0,R=n?-1:1,C=t[r+v];for(v+=R,s=C&(1<<-h)-1,C>>=-h,h+=l;h>0;s=s*256+t[r+v],v+=R,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+v],v+=R,h-=8);if(s===0)s=1-g;else{if(s===u)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,u,g=s*8-o-1,h=(1<>1,R=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,M=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+v>=1?r+=R/u:r+=R*Math.pow(2,1-v),r*u>=2&&(a++,u/=2),a+v>=h?(l=0,a=h):a+v>=1?(l=(r*u-1)*Math.pow(2,o),a=a+v):(l=r*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=l&255,C+=A,l/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=M*128}}),Zr=Ta(),et=Ca(),ii=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rt.Buffer=T;rt.SlowBuffer=Ma;rt.INSPECT_MAX_BYTES=50;var rr=2147483647;rt.kMaxLength=rr;T.TYPED_ARRAY_SUPPORT=Aa();!T.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 Aa(){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{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function Re(e){if(e>rr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(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 tn(e)}return ui(e,t,r)}T.poolSize=8192;function ui(e,t,r){if(typeof e=="string")return Ra(e,t);if(ArrayBuffer.isView(e))return ka(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(he(e,ArrayBuffer)||e&&he(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(he(e,SharedArrayBuffer)||e&&he(e.buffer,SharedArrayBuffer)))return pi(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 T.from(n,t,r);let i=Oa(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.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)}T.from=function(e,t,r){return ui(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ci(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 Sa(e,t,r){return ci(e),e<=0?Re(e):t!==void 0?typeof r=="string"?Re(e).fill(t,r):Re(e).fill(t):Re(e)}T.alloc=function(e,t,r){return Sa(e,t,r)};function tn(e){return ci(e),Re(e<0?0:rn(e)|0)}T.allocUnsafe=function(e){return tn(e)};T.allocUnsafeSlow=function(e){return tn(e)};function Ra(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=di(e,t)|0,n=Re(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Xr(e){let t=e.length<0?0:rn(e.length)|0,r=Re(t);for(let n=0;n=rr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rr.toString(16)+" bytes");return e|0}function Ma(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(he(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),he(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.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 i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function di(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||he(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 i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return en(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return xi(e).length;default:if(i)return n?-1:en(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=di;function Fa(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 Ua(this,t,r);case"utf8":case"utf-8":return mi(this,t,r);case"ascii":return ja(this,t,r);case"latin1":case"binary":return Ba(this,t,r);case"base64":return qa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Va(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Qe(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.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+=" ... "),""};ii&&(T.prototype[ii]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(he(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.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),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,on(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:oi(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):oi(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function oi(e,t,r,n,i){let o=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;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let u;if(i){let g=-1;for(u=r;us&&(r=s-a),u=r;u>=0;u--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/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 i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return Ia(this,e,t,r);case"utf8":case"utf-8":return _a(this,e,t,r);case"ascii":case"latin1":case"binary":return La(this,e,t,r);case"base64":return Na(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Da(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qa(e,t,r){return t===0&&r===e.length?Zr.fromByteArray(e):Zr.fromByteArray(e.slice(t,r))}function mi(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,u,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(h=(o&15)<<12|(l&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],u=e[i+2],g=e[i+3],(l&192)===128&&(u&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(u&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return $a(n)}var si=4096;function $a(e){let t=e.length;if(t<=si)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Le(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Le(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(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,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),et.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),et.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!1,52,8)};function ie(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.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;ie(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(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};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(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 gi(e,t,r,n,i){Ei(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;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 hi(e,t,r,n,i){Ei(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;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}T.prototype.writeBigUInt64LE=Le(function(e,t=0){return gi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Le(function(e,t=0){return hi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(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};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(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};T.prototype.writeBigInt64LE=Le(function(e,t=0){return gi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Le(function(e,t=0){return hi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function yi(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function wi(e,t,r,n,i){return t=+t,r=r>>>0,i||yi(e,t,r,4,34028234663852886e22,-34028234663852886e22),et.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return wi(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return wi(this,e,t,!1,r)};function bi(e,t,r,n,i){return t=+t,r=r>>>0,i||yi(e,t,r,8,17976931348623157e292,-17976931348623157e292),et.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return bi(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return bi(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.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 i;if(typeof e=="number")for(i=t;i2**32?i=ai(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=ai(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function ai(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 Qa(e,t,r){tt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Tt(t,e.length-(r+1))}function Ei(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Xe.ERR_OUT_OF_RANGE("value",a,e)}Qa(n,i,o)}function tt(e,t){if(typeof e!="number")throw new Xe.ERR_INVALID_ARG_TYPE(t,"number",e)}function Tt(e,t,r){throw Math.floor(e)!==e?(tt(e,r),new Xe.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Xe.ERR_BUFFER_OUT_OF_BOUNDS:new Xe.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Ga=/[^+/0-9A-Za-z-_]/g;function Ja(e){if(e=e.split("=")[0],e=e.trim().replace(Ga,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function en(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Wa(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function xi(e){return Zr.toByteArray(Ja(e))}function nr(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function he(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function on(e){return e!==e}var Ha=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Le(e){return typeof BigInt>"u"?za:e}function za(){throw new Error("BigInt not supported")}});var w,m=ge(()=>{"use strict";w=Se(Pi())});function wl(){return!1}function Li(){return{dev:0,ino:0,mode:0,nlink:0,uid:0,gid:0,rdev:0,size:0,blksize:0,blocks:0,atimeMs:0,mtimeMs:0,ctimeMs:0,birthtimeMs:0,atime:new Date,mtime:new Date,ctime:new Date,birthtime:new Date}}function bl(){return Li()}function El(){return[]}function xl(e){e(null,[])}function Pl(){return""}function vl(){return""}function Tl(){}function Cl(){}function Al(){}function Sl(){}function Rl(){}function kl(){}var Ol,Ml,or,cn=ge(()=>{"use strict";m();c();p();d();f();Ol={},Ml={existsSync:wl,lstatSync:Li,statSync:bl,readdirSync:El,readdir:xl,readlinkSync:Pl,realpathSync:vl,chmodSync:Tl,renameSync:Cl,mkdirSync:Al,rmdirSync:Sl,rmSync:Rl,unlinkSync:kl,promises:Ol},or=Ml});function Fl(...e){return e.join("/")}function Il(...e){return e.join("/")}function _l(e){let t=Ni(e),r=Di(e),[n,i]=t.split(".");return{root:"/",dir:r,base:t,ext:i,name:n}}function Ni(e){let t=e.split("/");return t[t.length-1]}function Di(e){return e.split("/").slice(0,-1).join("/")}var qi,Ll,Nl,Oe,dn=ge(()=>{"use strict";m();c();p();d();f();qi="/",Ll={sep:qi},Nl={basename:Ni,dirname:Di,join:Il,parse:_l,posix:Ll,resolve:Fl,sep:qi},Oe=Nl});var $i=Ae((Ff,Dl)=>{Dl.exports={name:"@prisma/internals",version:"6.7.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek ",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-engine-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Bi=Ae((Gf,ji)=>{"use strict";m();c();p();d();f();ji.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Ji=Ae((um,Gi)=>{"use strict";m();c();p();d();f();Gi.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 Hi=Ae((xm,Ki)=>{"use strict";m();c();p();d();f();Ki.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 yn=Ae((Sm,zi)=>{"use strict";m();c();p();d();f();var Gl=Hi();zi.exports=e=>typeof e=="string"?e.replace(Gl(),""):e});var Yi=Ae((Zm,ar)=>{"use strict";m();c();p();d();f();ar.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()};ar.exports.default=ar.exports});var Sn=Ae((xb,xo)=>{"use strict";m();c();p();d();f();xo.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;s{"use strict";m();c();p();d();f()});var So=ge(()=>{"use strict";m();c();p();d();f()});var Yo=Ae((VP,Dc)=>{Dc.exports={name:"@prisma/engines-version",version:"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"3cff47a7f5d65c3ea74883f1d736e41d68ce91ed"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Nr,Zo=ge(()=>{"use strict";m();c();p();d();f();Nr=class{events={};on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var rd={};Ze(rd,{DMMF:()=>Dt,Debug:()=>K,Decimal:()=>be,Extensions:()=>sn,MetricsClient:()=>wt,PrismaClientInitializationError:()=>V,PrismaClientKnownRequestError:()=>oe,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>G,PrismaClientValidationError:()=>ee,Public:()=>an,Sql:()=>ae,createParam:()=>Vo,defineDmmfProperty:()=>Ho,deserializeJsonResponse:()=>at,deserializeRawResult:()=>Hr,dmmfToRuntimeDataModel:()=>ho,empty:()=>es,getPrismaClient:()=>ga,getRuntime:()=>Ms,join:()=>Xo,makeStrictEnum:()=>ha,makeTypedQueryFactory:()=>zo,objectEnumValues:()=>Ar,raw:()=>Nn,serializeJsonQuery:()=>Ir,skip:()=>Fr,sqltag:()=>Dn,warnEnvConflicts:()=>void 0,warnOnce:()=>_t});module.exports=va(rd);m();c();p();d();f();var sn={};Ze(sn,{defineExtension:()=>vi,getExtensionContext:()=>Ti});m();c();p();d();f();m();c();p();d();f();function vi(e){return typeof e=="function"?e:t=>t.$extends(e)}m();c();p();d();f();function Ti(e){return e}var an={};Ze(an,{validator:()=>Ci});m();c();p();d();f();m();c();p();d();f();function Ci(...e){return t=>t}m();c();p();d();f();m();c();p();d();f();var ir={};Ze(ir,{$:()=>Oi,bgBlack:()=>sl,bgBlue:()=>cl,bgCyan:()=>dl,bgGreen:()=>ll,bgMagenta:()=>pl,bgRed:()=>al,bgWhite:()=>fl,bgYellow:()=>ul,black:()=>rl,blue:()=>Je,bold:()=>pe,cyan:()=>ke,dim:()=>Ct,gray:()=>kt,green:()=>St,grey:()=>ol,hidden:()=>el,inverse:()=>Xa,italic:()=>Za,magenta:()=>nl,red:()=>Ge,reset:()=>Ya,strikethrough:()=>tl,underline:()=>At,white:()=>il,yellow:()=>Rt});m();c();p();d();f();var ln,Ai,Si,Ri,ki=!0;typeof y<"u"&&({FORCE_COLOR:ln,NODE_DISABLE_COLORS:Ai,NO_COLOR:Si,TERM:Ri}=y.env||{},ki=y.stdout&&y.stdout.isTTY);var Oi={enabled:!Ai&&Si==null&&Ri!=="dumb"&&(ln!=null&&ln!=="0"||ki)};function U(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Oi.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ya=U(0,0),pe=U(1,22),Ct=U(2,22),Za=U(3,23),At=U(4,24),Xa=U(7,27),el=U(8,28),tl=U(9,29),rl=U(30,39),Ge=U(31,39),St=U(32,39),Rt=U(33,39),Je=U(34,39),nl=U(35,39),ke=U(36,39),il=U(37,39),kt=U(90,39),ol=U(90,39),sl=U(40,49),al=U(41,49),ll=U(42,49),ul=U(43,49),cl=U(44,49),pl=U(45,49),dl=U(46,49),fl=U(47,49);m();c();p();d();f();var ml=100,Mi=["green","yellow","blue","magenta","cyan","red"],Ot=[],Fi=Date.now(),gl=0,un=typeof y<"u"?y.env:{};globalThis.DEBUG??=un.DEBUG??"";globalThis.DEBUG_COLORS??=un.DEBUG_COLORS?un.DEBUG_COLORS==="true":!0;var Mt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function hl(e){let t={color:Mi[gl++%Mi.length],enabled:Mt.enabled(e),namespace:e,log:Mt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Ot.push([o,...n]),Ot.length>ml&&Ot.shift(),Mt.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:yl(g)),u=`+${Date.now()-Fi}ms`;Fi=Date.now(),globalThis.DEBUG_COLORS?a(ir[s](pe(o)),...l,ir[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var K=new Proxy(hl,{get:(e,t)=>Mt[t],set:(e,t,r)=>Mt[t]=r});function yl(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Ii(e=7500){let t=Ot.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` +`);return t.lengthVl,info:()=>Ul,log:()=>Bl,query:()=>Ql,should:()=>Wi,tags:()=>Ft,warn:()=>hn});m();c();p();d();f();var Ft={error:Ge("prisma:error"),warn:Rt("prisma:warn"),info:ke("prisma:info"),query:Je("prisma:query")},Wi={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function Bl(...e){console.log(...e)}function hn(e,...t){Wi.warn()&&console.warn(`${Ft.warn} ${e}`,...t)}function Ul(e,...t){console.info(`${Ft.info} ${e}`,...t)}function Vl(e,...t){console.error(`${Ft.error} ${e}`,...t)}function Ql(e,...t){console.log(`${Ft.query} ${e}`,...t)}m();c();p();d();f();function sr(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}m();c();p();d();f();function Me(e,t){throw new Error(t)}m();c();p();d();f();dn();function wn(e){return Oe.sep===Oe.posix.sep?e:e.split(Oe.sep).join(Oe.posix.sep)}m();c();p();d();f();function bn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}m();c();p();d();f();function it(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}m();c();p();d();f();function En(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{Zi.has(e)||(Zi.add(e),hn(t,...r))};var V=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};le(V,"PrismaClientInitializationError");m();c();p();d();f();var oe=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};le(oe,"PrismaClientKnownRequestError");m();c();p();d();f();var ue=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};le(ue,"PrismaClientRustPanicError");m();c();p();d();f();var G=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};le(G,"PrismaClientUnknownRequestError");m();c();p();d();f();var ee=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};le(ee,"PrismaClientValidationError");m();c();p();d();f();m();c();p();d();f();var ot=9e15,$e=1e9,xn="0123456789abcdef",cr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",pr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Pn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ot,maxE:ot,crypto:!1},no,Fe,_=!0,fr="[DecimalError] ",qe=fr+"Invalid argument: ",io=fr+"Precision limit exceeded",oo=fr+"crypto unavailable",so="[object Decimal]",te=Math.floor,J=Math.pow,Jl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Wl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Kl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ao=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de=1e7,F=7,Hl=9007199254740991,zl=cr.length-1,vn=pr.length-1,S={toStringTag:so};S.absoluteValue=S.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O(e)};S.ceil=function(){return O(new this.constructor(this),this.e+1,2)};S.clampedTo=S.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(qe+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};S.comparedTo=S.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};S.cosine=S.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())+F,n.rounding=1,r=Yl(n,fo(n,r)),n.precision=e,n.rounding=t,O(Fe==2||Fe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};S.cubeRoot=S.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(_=!1,o=g.s*J(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Y(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=J(r,1/3),e=te((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 h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(g),n=j(u.plus(g).times(a),u.plus(l),s+2,1),Y(a.d).slice(0,s)===(r=Y(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(O(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(O(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return _=!0,O(n,e,h.rounding,t)};S.decimalPlaces=S.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/F))*F,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};S.dividedBy=S.div=function(e){return j(this,new this.constructor(e))};S.dividedToIntegerBy=S.divToInt=function(e){var t=this,r=t.constructor;return O(j(t,new r(e),0,1,1),r.precision,r.rounding)};S.equals=S.eq=function(e){return this.cmp(e)===0};S.floor=function(){return O(new this.constructor(this),this.e+1,3)};S.greaterThan=S.gt=function(e){return this.cmp(e)>0};S.greaterThanOrEqualTo=S.gte=function(e){var t=this.cmp(e);return t==1||t===0};S.hyperbolicCosine=S.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/gr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=st(s,1,o.times(t),new s(1),!0);for(var l,u=e,g=new s(8);u--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return O(o,s.precision=r,s.rounding=n,!0)};S.hyperbolicSine=S.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=st(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/gr(5,e)),i=st(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,O(i,t,r,!0)};S.hyperbolicTangent=S.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,j(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};S.inverseCosine=S.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?ye(t,n,i):new t(0):new t(NaN):e.isZero()?ye(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};S.inverseHyperbolicCosine=S.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,_=!1,r=r.times(r).minus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};S.inverseHyperbolicSine=S.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,_=!1,r=r.times(r).plus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln())};S.inverseHyperbolicTangent=S.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?O(new o(i),e,t,!0):(o.precision=r=n-i.e,i=j(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)};S.inverseSine=S.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=ye(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)))};S.inverseTangent=S.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding;if(u.isFinite()){if(u.isZero())return new g(u);if(u.abs().eq(1)&&h+4<=vn)return s=ye(g,h+4,v).times(.25),s.s=u.s,s}else{if(!u.s)return new g(NaN);if(h+4<=vn)return s=ye(g,h+4,v).times(.5),s.s=u.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/F+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(_=!1,t=Math.ceil(a/F),n=1,l=u.times(u),s=new g(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};S.isNaN=function(){return!this.s};S.isNegative=S.isNeg=function(){return this.s<0};S.isPositive=S.isPos=function(){return this.s>0};S.isZero=function(){return!!this.d&&this.d[0]===0};S.lessThan=S.lt=function(e){return this.cmp(e)<0};S.lessThanOrEqualTo=S.lte=function(e){return this.cmp(e)<1};S.logarithm=S.log=function(e){var t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding,R=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new g(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(_=!1,a=h+R,s=De(u,a),n=t?dr(g,a+10):De(e,a),l=j(s,n,a,1),Lt(l.d,i=h,v))do if(a+=10,s=De(u,a),n=t?dr(g,a+10):De(e,a),l=j(s,n,a,1),!o){+Y(l.d).slice(i+1,i+15)+1==1e14&&(l=O(l,h+1,0));break}while(Lt(l.d,i+=10,v));return _=!0,O(l,h,v)};S.minus=S.sub=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,R=this,C=R.constructor;if(e=new C(e),!R.d||!e.d)return!R.s||!e.s?e=new C(NaN):R.d?e.s=-e.s:e=new C(e.d||R.s!==e.s?R:NaN),e;if(R.s!=e.s)return e.s=-e.s,R.plus(e);if(u=R.d,v=e.d,a=C.precision,l=C.rounding,!u[0]||!v[0]){if(v[0])e.s=-e.s;else if(u[0])e=new C(R);else return new C(l===3?-0:0);return _?O(e,a,l):e}if(r=te(e.e/F),g=te(R.e/F),u=u.slice(),o=g-r,o){for(h=o<0,h?(t=u,o=-o,s=v.length):(t=v,r=g,s=u.length),n=Math.max(Math.ceil(a/F),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=v.length,h=n0;--n)u[s++]=0;for(n=v.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=g.length,s-i<0&&(i=s,r=g,g=u,u=r),t=0;i;)t=(u[--i]=u[i]+g[i]+t)/de|0,u[i]%=de;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=mr(u,n),_?O(e,a,l):e};S.precision=S.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qe+e);return r.d?(t=lo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};S.round=function(){var e=this,t=e.constructor;return O(new t(e),e.e+1,t.rounding)};S.sine=S.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())+F,n.rounding=1,r=Xl(n,fo(n,r)),n.precision=e,n.rounding=t,O(Fe>2?r.neg():r,e,t,!0)):new n(NaN)};S.squareRoot=S.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,g=s.constructor;if(u!==1||!a||!a[0])return new g(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(_=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=Y(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=te((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 g(t)):n=new g(u.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus(j(s,o,r+2,1)).times(.5),Y(o.d).slice(0,r)===(t=Y(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(O(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")&&(O(n,l+1,1),e=!n.times(n).eq(s));break}return _=!0,O(n,l,g.rounding,e)};S.tangent=S.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=j(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,O(Fe==2||Fe==4?r.neg():r,e,t,!0)):new n(NaN)};S.times=S.mul=function(e){var t,r,n,i,o,s,a,l,u,g=this,h=g.constructor,v=g.d,R=(e=new h(e)).d;if(e.s*=g.s,!v||!v[0]||!R||!R[0])return new h(!e.s||v&&!v[0]&&!R||R&&!R[0]&&!v?NaN:!v||!R?e.s/0:e.s*0);for(r=te(g.e/F)+te(e.e/F),l=v.length,u=R.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+R[n]*v[i-n-1]+t,o[i--]=a%de|0,t=a/de|0;o[i]=(o[i]+t)%de|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=mr(o,r),_?O(e,h.precision,h.rounding):e};S.toBinary=function(e,t){return Cn(this,2,e,t)};S.toDecimalPlaces=S.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(se(e,0,$e),t===void 0?t=n.rounding:se(t,0,8),O(r,e+r.e+1,t))};S.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=we(n,!0):(se(e,0,$e),t===void 0?t=i.rounding:se(t,0,8),n=O(new i(n),e+1,t),r=we(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};S.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=we(i):(se(e,0,$e),t===void 0?t=o.rounding:se(t,0,8),n=O(new o(i),e+i.e+1,t),r=we(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};S.toFraction=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,R=this,C=R.d,A=R.constructor;if(!C)return new A(R);if(u=r=new A(1),n=l=new A(0),t=new A(n),o=t.e=lo(C)-R.e-1,s=o%F,t.d[0]=J(10,s<0?F+s:s),e==null)e=o>0?t:u;else{if(a=new A(e),!a.isInt()||a.lt(u))throw Error(qe+a);e=a.gt(t)?o>0?t:u:a}for(_=!1,a=new A(Y(C)),g=A.precision,A.precision=o=C.length*F*2;h=j(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=j(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=R.s,v=j(u,n,o,1).minus(R).abs().cmp(j(l,r,o,1).minus(R).abs())<1?[u,n]:[l,r],A.precision=g,_=!0,v};S.toHexadecimal=S.toHex=function(e,t){return Cn(this,16,e,t)};S.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]?(_=!1,r=j(r,e,0,t,1).times(e),_=!0,O(r)):(e.s=r.s,r=e),r};S.toNumber=function(){return+this};S.toOctal=function(e,t){return Cn(this,8,e,t)};S.toPower=S.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 O(a,n,o);if(t=te(e.e/F),t>=e.d.length-1&&(r=u<0?-u:u)<=Hl)return i=uo(l,a,r,n),e.s<0?new l(1).div(i):O(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(_=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Tn(e.times(De(a,n+r)),n),i.d&&(i=O(i,n+5,1),Lt(i.d,n,o)&&(t=n+10,i=O(Tn(e.times(De(a,t+r)),t),t+5,1),+Y(i.d).slice(n+1,n+15)+1==1e14&&(i=O(i,n+1,0)))),i.s=s,_=!0,l.rounding=o,O(i,n,o))};S.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=we(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(se(e,1,$e),t===void 0?t=i.rounding:se(t,0,8),n=O(new i(n),e,t),r=we(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};S.toSignificantDigits=S.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(se(e,1,$e),t===void 0?t=n.rounding:se(t,0,8)),O(new n(r),e,t)};S.toString=function(){var e=this,t=e.constructor,r=we(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};S.truncated=S.trunc=function(){return O(new this.constructor(this),this.e+1,1)};S.valueOf=S.toJSON=function(){var e=this,t=e.constructor,r=we(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Y(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(qe+e)}function Lt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=F,i=0):(i=Math.ceil((t+1)/F),t%=F),o=J(10,F-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 lr(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 Yl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/gr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=st(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 j=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,g,h,v,R,C,A,M,I,L,k,D,z,B,vt,Q,ne,Ce,Z,Ye,er=n.constructor,Yr=n.s==i.s?1:-1,X=n.d,$=i.d;if(!X||!X[0]||!$||!$[0])return new er(!n.s||!i.s||(X?$&&X[0]==$[0]:!$)?NaN:X&&X[0]==0||!$?Yr*0:Yr/0);for(l?(R=1,g=n.e-i.e):(l=de,R=F,g=te(n.e/R)-te(i.e/R)),Z=$.length,ne=X.length,I=new er(Yr),L=I.d=[],h=0;$[h]==(X[h]||0);h++);if($[h]>(X[h]||0)&&g--,o==null?(B=o=er.precision,s=er.rounding):a?B=o+(n.e-i.e)+1:B=o,B<0)L.push(1),C=!0;else{if(B=B/R+2|0,h=0,Z==1){for(v=0,$=$[0],B++;(h1&&($=e($,v,l),X=e(X,v,l),Z=$.length,ne=X.length),Q=Z,k=X.slice(0,Z),D=k.length;D=l/2&&++Ce;do v=0,u=t($,k,Z,D),u<0?(z=k[0],Z!=D&&(z=z*l+(k[1]||0)),v=z/Ce|0,v>1?(v>=l&&(v=l-1),A=e($,v,l),M=A.length,D=k.length,u=t(A,k,M,D),u==1&&(v--,r(A,Z=10;v/=10)h++;I.e=h+g*R-1,O(I,a?o+I.e+1:o,s,C)}return I}}();function O(e,t,r,n){var i,o,s,a,l,u,g,h,v,R=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=F,s=t,g=h[v=0],l=g/J(10,i-s-1)%10|0;else if(v=Math.ceil((o+1)/F),a=h.length,v>=a)if(n){for(;a++<=v;)h.push(0);g=l=0,i=1,o%=F,s=o-F+1}else break e;else{for(g=a=h[v],i=1;a>=10;a/=10)i++;o%=F,s=o-F+i,l=s<0?0:g/J(10,i-s-1)%10|0}if(n=n||t<0||h[v+1]!==void 0||(s<0?g:g%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?g/J(10,i-s):0:h[v-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=J(10,(F-t%F)%F),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=v,a=1,v--):(h.length=v+1,a=J(10,F-o),h[v]=s>0?(g/J(10,i-s)%J(10,s)|0)*a:0),u)for(;;)if(v==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==de&&(h[0]=1));break}else{if(h[v]+=a,h[v]!=de)break;h[v--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return _&&(e.e>R.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Ne(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Ne(-i-1)+o,r&&(n=r-s)>0&&(o+=Ne(n))):i>=s?(o+=Ne(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Ne(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Ne(n))),o}function mr(e,t){var r=e[0];for(t*=F;r>=10;r/=10)t++;return t}function dr(e,t,r){if(t>zl)throw _=!0,r&&(e.precision=r),Error(io);return O(new e(cr),t,1,!0)}function ye(e,t,r){if(t>vn)throw Error(io);return O(new e(pr),t,r,!0)}function lo(e){var t=e.length-1,r=t*F+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 Ne(e){for(var t="";e--;)t+="0";return t}function uo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/F+4);for(_=!1;;){if(r%2&&(o=o.times(t),to(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),to(t.d,s)}return _=!0,o}function eo(e){return e.d[e.d.length-1]&1}function co(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s17)return new v(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(_=!1,l=C):l=t,a=new v(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(J(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new v(1),v.precision=l;;){if(o=O(o.times(e),l,1),r=r.times(++g),a=s.plus(j(o,r,l,1)),Y(a.d).slice(0,l)===Y(s.d).slice(0,l)){for(i=h;i--;)s=O(s.times(s),l,1);if(t==null)if(u<3&&Lt(s.d,l-n,R,u))v.precision=l+=10,r=o=a=new v(1),g=0,u++;else return O(s,v.precision=C,R,_=!0);else return v.precision=C,s}s=a}}function De(e,t){var r,n,i,o,s,a,l,u,g,h,v,R=1,C=10,A=e,M=A.d,I=A.constructor,L=I.rounding,k=I.precision;if(A.s<0||!M||!M[0]||!A.e&&M[0]==1&&M.length==1)return new I(M&&!M[0]?-1/0:A.s!=1?NaN:M?0:A);if(t==null?(_=!1,g=k):g=t,I.precision=g+=C,r=Y(M),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Y(A.d),n=r.charAt(0),R++;o=A.e,n>1?(A=new I("0."+r),o++):A=new I(n+"."+r.slice(1))}else return u=dr(I,g+2,k).times(o+""),A=De(new I(n+"."+r.slice(1)),g-C).plus(u),I.precision=k,t==null?O(A,k,L,_=!0):A;for(h=A,l=s=A=j(A.minus(1),A.plus(1),g,1),v=O(A.times(A),g,1),i=3;;){if(s=O(s.times(v),g,1),u=l.plus(j(s,new I(i),g,1)),Y(u.d).slice(0,g)===Y(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(dr(I,g+2,k).times(o+""))),l=j(l,new I(R),g,1),t==null)if(Lt(l.d,g-C,L,a))I.precision=g+=C,u=s=A=j(h.minus(1),h.plus(1),g,1),v=O(A.times(A),g,1),i=a=1;else return O(l,I.precision=k,L,_=!0);else return I.precision=k,l;l=u,i+=2}}function po(e){return String(e.s*e.s/0)}function ur(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)%F,r<0&&(n+=F),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ao.test(t))return ur(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Wl.test(t))r=16,t=t.toLowerCase();else if(Jl.test(t))r=2;else if(Kl.test(t))r=8;else throw Error(qe+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=uo(n,new n(r),o,o*2)),u=lr(t,r,de),g=u.length-1,o=g;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=mr(u,g),e.d=u,_=!1,s&&(e=j(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?J(2,l):We.pow(2,l))),_=!0,e)}function Xl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:st(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/gr(5,r)),t=st(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 st(e,t,r,n,i){var o,s,a,l,u=1,g=e.precision,h=Math.ceil(g/F);for(_=!1,l=r.times(r),a=new e(n);;){if(s=j(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=j(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return _=!0,s.d.length=h+1,s}function gr(e,t){for(var r=e;--t;)r*=e;return r}function fo(e,t){var r,n=t.s<0,i=ye(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Fe=n?4:1,t;if(r=t.divToInt(i),r.isZero())Fe=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Fe=eo(r)?n?2:3:n?4:1,t;Fe=eo(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Cn(e,t,r,n){var i,o,s,a,l,u,g,h,v,R=e.constructor,C=r!==void 0;if(C?(se(r,1,$e),n===void 0?n=R.rounding:se(n,0,8)):(r=R.precision,n=R.rounding),!e.isFinite())g=po(e);else{for(g=we(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),v=new R(1),v.e=g.length-s,v.d=lr(we(v),10,i),v.e=v.d.length),h=lr(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new R(e),e.d=h,e.e=o,e=j(e,v,r,n,0,i),h=e.d,o=e.e,u=no),s=h[r],a=i/2,u=u||h[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&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,u)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=lr(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function eu(e){return new this(e).abs()}function tu(e){return new this(e).acos()}function ru(e){return new this(e).acosh()}function nu(e,t){return new this(e).plus(t)}function iu(e){return new this(e).asin()}function ou(e){return new this(e).asinh()}function su(e){return new this(e).atan()}function au(e){return new this(e).atanh()}function lu(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=ye(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ye(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ye(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(j(e,t,o,1)),t=ye(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(j(e,t,o,1)),r}function uu(e){return new this(e).cbrt()}function cu(e){return O(e=new this(e),e.e+1,2)}function pu(e,t,r){return new this(e).clamp(t,r)}function du(e){if(!e||typeof e!="object")throw Error(fr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,$e,"rounding",0,8,"toExpNeg",-ot,0,"toExpPos",0,ot,"maxE",0,ot,"minE",-ot,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(qe+r+": "+n);if(r="crypto",i&&(this[r]=Pn[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(oo);else this[r]=!1;else throw Error(qe+r+": "+n);return this}function fu(e){return new this(e).cos()}function mu(e){return new this(e).cosh()}function mo(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,ro(o)){u.s=o.s,_?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;_?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(oo);else for(;o=10;i/=10)n++;nct,datamodelEnumToSchemaEnum:()=>Bu});m();c();p();d();f();m();c();p();d();f();function Bu(e){return{name:e.name,values:e.values.map(t=>t.name)}}m();c();p();d();f();var ct=(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.updateManyAndReturn="updateManyAndReturn",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw",k))(ct||{});var Eo=Se(Ji());m();c();p();d();f();cn();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var yo={keyword:ke,entity:ke,value:e=>pe(Je(e)),punctuation:Je,directive:ke,function:ke,variable:e=>pe(Je(e)),string:e=>pe(St(e)),boolean:Rt,number:ke,comment:kt};var Uu=e=>e,yr={},Vu=0,N={manual:yr.Prism&&yr.Prism.manual,disableWorkerMessageHandler:yr.Prism&&yr.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof fe){let t=e;return new fe(t.type,N.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(N.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ce instanceof fe)continue;if(z&&Q!=t.length-1){L.lastIndex=ne;var h=L.exec(e);if(!h)break;var g=h.index+(D?h[1].length:0),v=h.index+h[0].length,a=Q,l=ne;for(let $=t.length;a<$&&(l=l&&(++Q,ne=l);if(t[Q]instanceof fe)continue;u=a-Q,Ce=e.slice(ne,l),h.index-=ne}else{L.lastIndex=0;var h=L.exec(Ce),u=1}if(!h){if(o)break;continue}D&&(B=h[1]?h[1].length:0);var g=h.index+B,h=h[0].slice(B),v=g+h.length,R=Ce.slice(0,g),C=Ce.slice(v);let Z=[Q,u];R&&(++Q,ne+=R.length,Z.push(R));let Ye=new fe(A,k?N.tokenize(h,k):h,vt,h,z);if(Z.push(Ye),C&&Z.push(C),Array.prototype.splice.apply(t,Z),u!=1&&N.matchGrammar(e,t,r,Q,ne,!0,A),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 N.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=N.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=N.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:fe};N.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:/[{}[\];(),.:]/};N.languages.javascript=N.languages.extend("clike",{"class-name":[N.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}/});N.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;N.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:N.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:N.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:N.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:N.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});N.languages.markup&&N.languages.markup.tag.addInlined("script","javascript");N.languages.js=N.languages.javascript;N.languages.typescript=N.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/});N.languages.ts=N.languages.typescript;function fe(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}fe.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return fe.stringify(r,t)}).join(""):Qu(e.type)(e.content)};function Qu(e){return yo[e]||Uu}function wo(e){return Gu(e,N.languages.javascript)}function Gu(e,t){return N.tokenize(e,t).map(n=>fe.stringify(n)).join("")}m();c();p();d();f();function bo(e){return mn(e)}var wr=class e{firstLineNumber;lines;static read(t){let r;try{r=or.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,bo(n).split(` +`))}highlight(){let t=wo(this.toString());return new e(this.firstLineNumber,t.split(` +`))}toString(){return this.lines.join(` +`)}};var Ju={red:Ge,gray:kt,dim:Ct,bold:pe,underline:At,highlightSource:e=>e.highlight()},Wu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ku({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Hu({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=Ku({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||y.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=wr.read(a.fileName)?.slice(l,a.lineNumber),g=u?.lineAt(a.lineNumber);if(u&&g){let h=Yu(g),v=zu(g);if(!v)return s;s.functionName=`${v.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,C=>C.slice(0,v.openingBraceIndex))),u=o.highlightSource(u);let R=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((C,A)=>o.gray(String(A).padStart(R))+" "+C).mapLines(C=>o.dim(C)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let C=h+R+1;C+=2,s.callArguments=(0,Eo.default)(i,C).slice(C)}}return s}function zu(e){let t=Object.keys(ct).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 Yu(e){let t=0;for(let r=0;r"Unknown error")}function Co(e){return e.errors.flatMap(t=>t.kind==="Union"?Co(t):[t])}function ec(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:tc(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function tc(e,t){return[...new Set(e.concat(t))]}function rc(e){return En(e,(t,r)=>{let n=Po(t),i=Po(r);return n!==i?n-i:vo(t)-vo(r)})}function Po(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function vo(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}m();c();p();d();f();var ce=class{constructor(t,r){this.name=t;this.value=r}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)}};m();c();p();d();f();m();c();p();d();f();So();m();c();p();d();f();var pt=class{constructor(t=0,r){this.context=r;this.currentIndent=t}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=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}};Ao();m();c();p();d();f();m();c();p();d();f();var xr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};m();c();p();d();f();var Pr=e=>e,vr={bold:Pr,red:Pr,green:Pr,dim:Pr,enabled:!1},Ro={bold:pe,red:Ge,green:St,dim:Ct,enabled:!0},dt={write(e){e.writeLine(",")}};m();c();p();d();f();var xe=class{constructor(t){this.contents=t}isUnderlined=!1;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)))})}};m();c();p();d();f();var Be=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var ft=class extends Be{items=[];addItem(t){return this.items.push(new xr(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new xe("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(dt,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var mt=class e extends Be{fields={};suggestions=[];addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof e?a=o.value.getField(s):o.value instanceof ft&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let o=n.value.getFieldValue(i);if(!o||!(o instanceof e))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new xe("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(dt,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};m();c();p();d();f();var H=class extends Be{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new xe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};m();c();p();d();f();var qt=class{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(dt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Er(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":nc(e,t);break;case"IncludeOnScalar":ic(e,t);break;case"EmptySelection":oc(e,t,r);break;case"UnknownSelectionField":uc(e,t);break;case"InvalidSelectionValue":cc(e,t);break;case"UnknownArgument":pc(e,t);break;case"UnknownInputField":dc(e,t);break;case"RequiredArgumentMissing":fc(e,t);break;case"InvalidArgumentType":mc(e,t);break;case"InvalidArgumentValue":gc(e,t);break;case"ValueTooLarge":hc(e,t);break;case"SomeFieldsMissing":yc(e,t);break;case"TooManyFieldsGiven":wc(e,t);break;case"Union":To(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function nc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function ic(e,t){let[r,n]=$t(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 ce(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)}. ${jt(s)}`:a+=".",a+=` +Note that ${s.bold("include")} statements only accept relation fields.`,a})}function oc(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){sc(e,t,i);return}if(n.hasField("select")){ac(e,t);return}}if(r?.[je(e.outputType.name)]){lc(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function sc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new ce(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function ac(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Fo(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${jt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function lc(e,t){let r=new qt;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new ce("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=$t(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new mt;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function uc(e,t){let r=Io(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":Fo(n,e.outputType);break;case"include":bc(n,e.outputType);break;case"omit":Ec(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(jt(n)),i.join(" ")})}function cc(e,t){let r=Io(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function pc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),xc(n,e.arguments)),t.addErrorMessage(i=>Oo(i,r,e.arguments.map(o=>o.name)))}function dc(e,t){let[r,n]=$t(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&_o(o,e.inputType)}t.addErrorMessage(o=>Oo(o,n,e.inputType.fields.map(s=>s.name)))}function Oo(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=vc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(jt(e)),n.join(" ")}function fc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof H&&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)?.asObject();if(!n)return;let[i,o]=$t(e.argumentPath),s=new qt,a=n.getDeepFieldValue(i)?.asObject();if(a)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 ce(o,s).makeRequired())}else{let l=e.inputTypes.map(Mo).join(" | ");a.addSuggestion(new ce(o,l).makeRequired())}}function Mo(e){return e.kind==="list"?`${Mo(e.elementType)}[]`:e.name}function mc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Tr("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 gc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&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=Tr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function hc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof H&&(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 yc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&_o(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")} ${Tr("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(jt(i)),o.join(" ")})}function wc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(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 ${Tr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Fo(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ce(r.name,"true"))}function bc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new ce(r.name,"true"))}function Ec(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new ce(r.name,"true"))}function xc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new ce(r.name,r.typeNames.join(" | ")))}function Io(e,t){let[r,n]=$t(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function _o(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ce(r.name,r.typeNames.join(" | ")))}function $t(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function jt({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Tr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Pc=3;function vc(e,t){let r=1/0,n;for(let i of t){let o=(0,ko.default)(e,i);o>Pc||o`}};function gt(e){return e instanceof Bt}m();c();p();d();f();var Cr=Symbol(),kn=new WeakMap,Ie=class{constructor(t){t===Cr?kn.set(this,`Prisma.${this._getName()}`):kn.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return kn.get(this)}},Ut=class extends Ie{_getNamespace(){return"NullTypes"}},Vt=class extends Ut{#e};On(Vt,"DbNull");var Qt=class extends Ut{#e};On(Qt,"JsonNull");var Gt=class extends Ut{#e};On(Gt,"AnyNull");var Ar={classes:{DbNull:Vt,JsonNull:Qt,AnyNull:Gt},instances:{DbNull:new Vt(Cr),JsonNull:new Qt(Cr),AnyNull:new Gt(Cr)}};function On(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}m();c();p();d();f();var Lo=": ",Sr=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Lo.length}write(t){let r=new xe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Lo).write(this.value)}};var Mn=class{arguments;errorMessages=[];constructor(t){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 ht(e){return new Mn(No(e))}function No(e){let t=new mt;for(let[r,n]of Object.entries(e)){let i=new Sr(r,Do(n));t.addField(i)}return t}function Do(e){if(typeof e=="string")return new H(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new H(String(e));if(typeof e=="bigint")return new H(`${e}n`);if(e===null)return new H("null");if(e===void 0)return new H("undefined");if(ut(e))return new H(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new H(`Buffer.alloc(${e.byteLength})`):new H(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=hr(e)?e.toISOString():"Invalid Date";return new H(`new Date("${t}")`)}return e instanceof Ie?new H(`Prisma.${e._getName()}`):gt(e)?new H(`prisma.${je(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Tc(e):typeof e=="object"?No(e):new H(Object.prototype.toString.call(e))}function Tc(e){let t=new ft;for(let r of e)t.addItem(Do(r));return t}function Rr(e,t){let r=t==="pretty"?Ro:vr,n=e.renderAllMessages(r),i=new pt(0,{colors:r}).write(e).toString();return{message:n,args:i}}function kr({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=ht(e);for(let h of t)Er(h,a,s);let{message:l,args:u}=Rr(a,r),g=br({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new ee(g,{clientVersion:o})}m();c();p();d();f();m();c();p();d();f();function Pe(e){return e.replace(/^./,t=>t.toLowerCase())}m();c();p();d();f();function $o(e,t,r){let n=Pe(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Cc({...e,...qo(t.name,e,t.result.$allModels),...qo(t.name,e,t.result[n])})}function Cc(e){let t=new Ee,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 it(e,n=>({...n,needs:r(n.name,new Set)}))}function qo(e,t,r){return r?it(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Ac(t,o,i)})):{}}function Ac(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function jo(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}function Bo(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)delete r[i];return r}var Or=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new Ee;modelExtensionsCache=new Ee;queryCallbacksCache=new Ee;clientExtensions=Nt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=Nt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>$o(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Pe(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()}},yt=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Or(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Or(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()??[]}};m();c();p();d();f();var Mr=class{constructor(t){this.name=t}};function Uo(e){return e instanceof Mr}function Vo(e){return new Mr(e)}m();c();p();d();f();m();c();p();d();f();var Qo=Symbol(),Jt=class{constructor(t){if(t!==Qo)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Fr:t}},Fr=new Jt(Qo);function ve(e){return e instanceof Jt}var Sc={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},Go="explicitly `undefined` values are not allowed";function Ir({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=yt.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:g}){let h=new Fn({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:g});return{modelName:e,action:Sc[t],query:Wt(r,h)}}function Wt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Wo(r,n),selection:Rc(e,t,i,n)}}function Rc(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),Fc(e,n)):kc(n,t,r)}function kc(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&Oc(n,t,e),Mc(n,r,e),n}function Oc(e,t,r){for(let[n,i]of Object.entries(t)){if(ve(i))continue;let o=r.nestSelection(n);if(In(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){e[n]=Wt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=Wt(i,o)}}function Mc(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=Bo(i,n);for(let[s,a]of Object.entries(o)){if(ve(a))continue;In(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function Fc(e,t){let r={},n=t.getComputedFields(),i=jo(e,n);for(let[o,s]of Object.entries(i)){if(ve(s))continue;let a=t.nestSelection(o);In(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||ve(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=Wt({},a):r[o]=!0;continue}r[o]=Wt(s,a)}}return r}function Jo(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(lt(e)){if(hr(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(Uo(e))return{$type:"Param",value:e.name};if(gt(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return Ic(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:w.Buffer.from(r,n,i).toString("base64")}}if(_c(e))return e.values;if(ut(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Ie){if(e!==Ar.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(Lc(e))return e.toJSON();if(typeof e=="object")return Wo(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function Wo(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);ve(i)||(i!==void 0?r[n]=Jo(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:Go}))}return r}function Ic(e,t){let r=[];for(let n=0;n({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.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)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[je(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:Me(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};m();c();p();d();f();function Ko(e){if(!e._hasPreviewFlag("metrics"))throw new ee("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var wt=class{_client;constructor(t){this._client=t}prometheus(t){return Ko(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return Ko(this._client),this._client._engine.metrics({format:"json",...t})}};m();c();p();d();f();function Ho(e,t){let r=Nt(()=>Nc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Nc(e){return{datamodel:{models:_n(e.models),enums:_n(e.enums),types:_n(e.types)}}}function _n(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}m();c();p();d();f();var Ln=new WeakMap,_r="$$PrismaTypedSql",Kt=class{constructor(t,r){Ln.set(this,{sql:t,values:r}),Object.defineProperty(this,_r,{value:_r})}get sql(){return Ln.get(this).sql}get values(){return Ln.get(this).values}};function zo(e){return(...t)=>new Kt(e,t)}function Lr(e){return e!=null&&e[_r]===_r}m();c();p();d();f();var ma=Se(Yo());m();c();p();d();f();Zo();cn();dn();m();c();p();d();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 i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}m();c();p();d();f();m();c();p();d();f();var Dr={enumerable:!0,configurable:!0,writable:!0};function qr(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>Dr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var ts=Symbol.for("nodejs.util.inspect.custom");function me(e,t){let r=qc(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=rs(Reflect.ownKeys(o),r),a=rs(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?{...Dr,...l?.getPropertyDescriptor(s)}:Dr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[ts]=function(){let o={...this};return delete o[ts],o},i}function qc(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 rs(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}m();c();p();d();f();function bt(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}m();c();p();d();f();function $r(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}m();c();p();d();f();function ns(e){if(e===void 0)return"";let t=ht(e);return new pt(0,{colors:vr}).write(t).toString()}m();c();p();d();f();var $c="P2037";function jr({error:e,user_facing_error:t},r,n){return t.error_code?new oe(jc(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new G(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function jc(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===$c&&(r+=` +Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var zt="";function is(e){var t=e.split(` +`);return t.reduce(function(r,n){var i=Vc(n)||Gc(n)||Kc(n)||Zc(n)||zc(n);return i&&r.push(i),r},[])}var Bc=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Uc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Vc(e){var t=Bc.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=Uc.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]||zt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Qc=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Gc(e){var t=Qc.exec(e);return t?{file:t[2],methodName:t[1]||zt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Jc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Wc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Kc(e){var t=Jc.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Wc.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||zt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Hc=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function zc(e){var t=Hc.exec(e);return t?{file:t[3],methodName:t[1]||zt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Yc=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Zc(e){var t=Yc.exec(e);return t?{file:t[2],methodName:t[1]||zt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var qn=class{getLocation(){return null}},$n=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=is(t).find(i=>{if(!i.file)return!1;let o=wn(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 Ue(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new qn:new $n}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var os={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Et(e={}){let t=ep(e);return Object.entries(t).reduce((n,[i,o])=>(os[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function ep(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Br(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ss(e,t){let r=Br(e);return t({action:"aggregate",unpacker:r,argsMapper:Et})(e)}m();c();p();d();f();function tp(e={}){let{select:t,...r}=e;return typeof t=="object"?Et({...r,_count:t}):Et({...r,_count:{_all:!0}})}function rp(e={}){return typeof e.select=="object"?t=>Br(e)(t)._count:t=>Br(e)(t)._count._all}function as(e,t){return t({action:"count",unpacker:rp(e),argsMapper:tp})(e)}m();c();p();d();f();function np(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 ip(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ls(e,t){return t({action:"groupBy",unpacker:ip(e),argsMapper:np})(e)}function us(e,t,r){if(t==="aggregate")return n=>ss(n,r);if(t==="count")return n=>as(n,r);if(t==="groupBy")return n=>ls(n,r)}m();c();p();d();f();function cs(e,t){let r=t.fields.filter(i=>!i.relationName),n=go(r,"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 Bt(e,o,s.type,s.isList,s.kind==="enum")},...qr(Object.keys(n))})}m();c();p();d();f();m();c();p();d();f();var ps=e=>Array.isArray(e)?e:e.split("."),jn=(e,t)=>ps(t).reduce((r,n)=>r&&r[n],e),ds=(e,t,r)=>ps(t).reduceRight((n,i,o,s)=>Object.assign({},jn(e,s.slice(0,o)),{[i]:n}),r);function op(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function sp(e,t,r){return t===void 0?e??{}:ds(t,r,e||!0)}function Bn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Ue(e._errorFormat),g=op(n,i),h=sp(l,o,g),v=r({dataPath:g,callsite:u})(h),R=ap(e,t);return new Proxy(v,{get(C,A){if(!R.includes(A))return C[A];let I=[a[A].type,r,A],L=[g,h];return Bn(e,...I,...L)},...qr([...R,...Object.getOwnPropertyNames(v)])})}}function ap(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var lp=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],up=["aggregate","count","groupBy"];function Un(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[cp(e,t),dp(e,t),Ht(r),re("name",()=>t),re("$name",()=>t),re("$parent",()=>e._appliedParent)];return me({},n)}function cp(e,t){let r=Pe(t),n=Object.keys(ct).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=Ue(e._errorFormat);return e._createPrismaPromise(g=>{let h={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:g,callsite:u};return e._request({...h,...a})},{action:o,args:l,model:t})};return lp.includes(o)?Bn(e,t,s):pp(i)?us(e,i,s):s({})}}}function pp(e){return up.includes(e)}function dp(e,t){return Ke(re("fields",()=>{let r=e._runtimeDataModel.models[t];return cs(t,r)}))}m();c();p();d();f();function fs(e){return e.replace(/^./,t=>t.toUpperCase())}var Vn=Symbol();function Yt(e){let t=[fp(e),mp(e),re(Vn,()=>e),re("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Ht(r)),me(e,t)}function fp(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function mp(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Pe),n=[...new Set(t.concat(r))];return Ke({getKeys(){return n},getPropertyValue(i){let o=fs(i);if(e._runtimeDataModel.models[o]!==void 0)return Un(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Un(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function ms(e){return e[Vn]?e[Vn]:e}function gs(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Yt(t)}m();c();p();d();f();m();c();p();d();f();function hs({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(g=>n[g]);u.length>0&&a.push(bt(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(g=>!r[g]);u.length>0&&a.push(bt(u))}gp(e,l.needs)&&s.push(hp(l,me(e,s)))}return s.length>0||a.length>0?me(e,[...s,...a]):e}function gp(e,t){return t.every(r=>bn(e,r))}function hp(e,t){return Ke(re(e.name,()=>e.compute(t)))}m();c();p();d();f();function Ur({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Ur({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function ws({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Ur({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let g=Pe(l);return hs({result:a,modelName:g,select:u.select,omit:u.select?void 0:{...o?.[g],...u.omit},extensions:n})}})}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var yp=["$connect","$disconnect","$on","$transaction","$use","$extends"],bs=yp;function Es(e){if(e instanceof ae)return wp(e);if(Lr(e))return bp(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:Es(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=As(o,l),a.args=s,Ps(e,a,r,n+1)}})})}function vs(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 Ps(e,t,s)}function Ts(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Cs(r,n,0,e):e(r)}}function Cs(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=As(i,l),Cs(a,t,r+1,n)}})}var xs=e=>e;function As(e=xs,t=xs){return r=>e(t(r))}m();c();p();d();f();var Ss=K("prisma:client"),Rs={Vercel:"vercel","Netlify CI":"netlify"};function ks({postinstall:e,ciName:t,clientVersion:r}){if(Ss("checkPlatformCaching:postinstall",e),Ss("checkPlatformCaching:ciName",t),e===!0&&t&&t in Rs){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/${Rs[t]}-build`;throw console.error(n),new V(n,r)}}m();c();p();d();f();function Os(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}m();c();p();d();f();m();c();p();d();f();var Ep=()=>globalThis.process?.release?.name==="node",xp=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Pp=()=>!!globalThis.Deno,vp=()=>typeof globalThis.Netlify=="object",Tp=()=>typeof globalThis.EdgeRuntime=="object",Cp=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Ap(){return[[vp,"netlify"],[Tp,"edge-light"],[Cp,"workerd"],[Pp,"deno"],[xp,"bun"],[Ep,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var Sp={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Ms(){let e=Ap();return{id:e,prettyName:Sp[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}m();c();p();d();f();m();c();p();d();f();var Qn=Se(yn());m();c();p();d();f();function Fs(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}m();c();p();d();f();function Is(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(` +`)}m();c();p();d();f();var _s=Se(Yi());function Ls({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,_s.default)({user:t,repo:r,template:n,title:e,body:i})}function Ns({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=Ii(6e3-(s?.length??0)),l=Is((0,Qn.default)(a)),u=n?`# Description +\`\`\` +${n} +\`\`\``:"",g=(0,Qn.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: +## Versions + +| Name | Version | +|-----------------|--------------------| +| Node | ${y.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?Fs(s):""} +\`\`\` +`),h=Ls({title:r,body:g});return`${r} + +This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. + +${At(h)} + +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. +`}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();function Gn(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}m();c();p();d();f();function Vr(e){return{ok:!0,value:e,map(t){return Vr(t(e))},flatMap(t){return t(e)}}}function He(e){return{ok:!1,error:e,map(){return He(e)},flatMap(){return He(e)}}}var Ds=K("driver-adapter-utils"),Jn=class{registeredErrors=[];consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}};var Wn=(e,t=new Jn)=>{let r={adapterName:e.adapterName,errorRegistry:t,queryRaw:_e(t,e.queryRaw.bind(e)),executeRaw:_e(t,e.executeRaw.bind(e)),executeScript:_e(t,e.executeScript.bind(e)),dispose:_e(t,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await _e(t,e.startTransaction.bind(e))(...n)).map(o=>Rp(t,o))};return e.getConnectionInfo&&(r.getConnectionInfo=kp(t,e.getConnectionInfo.bind(e))),r},Rp=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:_e(e,t.queryRaw.bind(t)),executeRaw:_e(e,t.executeRaw.bind(t)),commit:_e(e,t.commit.bind(t)),rollback:_e(e,t.rollback.bind(t))});function _e(e,t){return async(...r)=>{try{return Vr(await t(...r))}catch(n){if(Ds("[error@wrapAsync]",n),Gn(n))return He(n.cause);let i=e.registerNewError(n);return He({kind:"GenericJs",id:i})}}}function kp(e,t){return(...r)=>{try{return Vr(t(...r))}catch(n){if(Ds("[error@wrapSync]",n),Gn(n))return He(n.cause);let i=e.registerNewError(n);return He({kind:"GenericJs",id:i})}}}m();c();p();d();f();function Qr({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 V(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new V("error: Missing URL environment variable, value, or override.",n);return i}m();c();p();d();f();m();c();p();d();f();function qs(e){if(e?.kind==="itx")return e.options.id}m();c();p();d();f();var Kn=class{engineObject;constructor(t,r,n){this.engineObject=__PrismaProxy.create({datamodel:t.datamodel,env:y.env,ignoreEnvVarErrors:!0,datasourceOverrides:t.datasourceOverrides??{},logLevel:t.logLevel,logQueries:t.logQueries??!1,logCallback:r,enableTracing:t.enableTracing})}async connect(t,r){return __PrismaProxy.connect(this.engineObject,t,r)}async disconnect(t,r){return __PrismaProxy.disconnect(this.engineObject,t,r)}query(t,r,n,i){return __PrismaProxy.execute(this.engineObject,t,r,n,i)}compile(){throw new Error("not implemented")}sdlSchema(){return Promise.resolve("{}")}dmmf(t){return Promise.resolve("{}")}async startTransaction(t,r,n){return __PrismaProxy.startTransaction(this.engineObject,t,r,n)}async commitTransaction(t,r,n){return __PrismaProxy.commitTransaction(this.engineObject,t,r,n)}async rollbackTransaction(t,r,n){return __PrismaProxy.rollbackTransaction(this.engineObject,t,r,n)}metrics(t){return Promise.resolve("{}")}async applyPendingMigrations(){return __PrismaProxy.applyPendingMigrations(this.engineObject)}trace(t){return __PrismaProxy.trace(this.engineObject,t)}},$s={async loadLibrary(e){if(!__PrismaProxy)throw new V("__PrismaProxy not detected make sure React Native bindings are installed",e.clientVersion);return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:Kn}}};var Op="P2036",Te=K("prisma:client:libraryEngine");function Mp(e){return e.item_type==="query"&&"query"in e}function Fp(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var z2=[...pn,"native"],Ip=0xffffffffffffffffn,Hn=1n;function _p(){let e=Hn++;return Hn>Ip&&(Hn=1n),e}var Xt=class{name="LibraryEngine";engine;libraryInstantiationPromise;libraryStartingPromise;libraryStoppingPromise;libraryStarted;executingQueryPromise;config;QueryEngineConstructor;libraryLoader;library;logEmitter;libQueryEnginePath;binaryTarget;datasourceOverrides;datamodel;logQueries;logLevel;lastQuery;loggerRustPanic;tracingHelper;adapterPromise;versionInfo;constructor(t,r){this.libraryLoader=$s,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(t){return{applyPendingMigrations:t.applyPendingMigrations?.bind(t),commitTransaction:this.withRequestId(t.commitTransaction.bind(t)),connect:this.withRequestId(t.connect.bind(t)),disconnect:this.withRequestId(t.disconnect.bind(t)),metrics:t.metrics?.bind(t),query:this.withRequestId(t.query.bind(t)),rollbackTransaction:this.withRequestId(t.rollbackTransaction.bind(t)),sdlSchema:t.sdlSchema?.bind(t),startTransaction:this.withRequestId(t.startTransaction.bind(t)),trace:t.trace.bind(t)}}withRequestId(t){return async(...r)=>{let n=_p().toString();try{return await t(...r,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async applyPendingMigrations(){await this.start(),await this.engine?.applyPendingMigrations()}async transaction(t,r,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(r),s;if(t==="start"){let l=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(l,o)}else t==="commit"?s=await this.engine?.commitTransaction(n.id,o):t==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if(Lp(a)){let l=this.getExternalAdapterError(a,i?.errorRegistry);throw l?l.error:new oe(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new G(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(Te("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new G("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new G("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.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(Wn));let r=await this.adapterPromise;r&&Te("Using driver adapter: %O",r),this.engine=this.wrapEngine(new this.QueryEngineConstructor({datamodel:this.datamodel,env:y.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},n=>{t.deref()?.logger(n)},r))}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);r&&(r.level=r?.level.toLowerCase()??"unknown",Mp(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):Fp(r)?this.loggerRustPanic=new ue(zn(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){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.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Te(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{Te("library starting");try{let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,Te("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryInstantiationPromise,await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Te("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),Te("library stopping");let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0,Te("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){Te(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start();let s=await this.adapterPromise;this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],s?.errorRegistry):new G(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof V)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new ue(zn(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new G(`${a.message} +${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Te("requestBatch");let i=$r(t,r);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),qs(r));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],o?.errorRegistry):new G(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:l,errors:u}=a;if(Array.isArray(l))return l.map(g=>g.errors&&g.errors.length>0?this.loggerRustPanic??this.buildQueryError(g.errors[0],o?.errorRegistry):{data:g});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(t,r){if(t.user_facing_error.is_panic)return new ue(zn(this,t.user_facing_error.message),this.config.clientVersion);let n=this.getExternalAdapterError(t.user_facing_error,r);return n?n.error:jr(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t,r){if(t.error_code===Op&&r){let n=t.meta?.id;sr(typeof n=="number","Malformed external JS error received from the engine");let i=r.consumeError(n);return sr(i,"External error with reported id was not registered"),i}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function Lp(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function zn(e,t){return Ns({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function js({copyEngine:e=!0},t){let r;try{r=Qr({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||gn(r));e&&n&&_t("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=nt(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let g;throw e?r?.startsWith("prisma://")?g=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:g=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:g=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new ee(g.join(` +`),{clientVersion:t.clientVersion})}return new Xt(t)}m();c();p();d();f();function Gr({generator:e}){return e?.previewFeatures??[]}m();c();p();d();f();var Bs=e=>({command:e});m();c();p();d();f();m();c();p();d();f();var Us=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);m();c();p();d();f();function xt(e){try{return Vs(e,"fast")}catch{return Vs(e,"slow")}}function Vs(e,t){return JSON.stringify(e.map(r=>Gs(r,t)))}function Gs(e,t){if(Array.isArray(e))return e.map(r=>Gs(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(lt(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(be.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(w.Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Np(e))return{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:w.Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?Js(e):e}function Np(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Js(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Qs);let t={};for(let r of Object.keys(e))t[r]=Qs(e[r]);return t}function Qs(e){return typeof e=="bigint"?e.toString():Js(e)}var Dp=/^(\s*alter\s)/i,Ws=K("prisma:client");function Yn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Dp.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 Zn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Lr(r))n=r.sql,i={values:xt(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:xt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:xt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:xt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Us(r),i={values:xt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Ws(`prisma.${e}(${n}, ${i.values})`):Ws(`prisma.${e}(${n})`),{query:n,parameters:i}},Ks={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ae(t,r)}},Hs={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};m();c();p();d();f();function Xn(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=zs(r(s)):zs(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function zs(e){return typeof e.then=="function"?e:Promise.resolve(e)}m();c();p();d();f();var qp=fn.split(".")[0],$p={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},ei=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${qp}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??$p}};function Ys(){return new ei}m();c();p();d();f();function Zs(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}m();c();p();d();f();function Xs(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)}m();c();p();d();f();var Jr=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};m();c();p();d();f();var ta=Se(yn());m();c();p();d();f();function Wr(e){return typeof e.batchRequestIdx=="number"}m();c();p();d();f();function ea(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(ti(e.query.arguments)),t.push(ti(e.query.selection)),t.join("")}function ti(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${ti(n)})`:r}).join(" ")})`}m();c();p();d();f();var jp={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!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,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function ri(e){return jp[e]}m();c();p();d();f();var Kr=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;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,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;ize("bigint",r));case"bytes-array":return t.map(r=>ze("bytes",r));case"decimal-array":return t.map(r=>ze("decimal",r));case"datetime-array":return t.map(r=>ze("datetime",r));case"date-array":return t.map(r=>ze("date",r));case"time-array":return t.map(r=>ze("time",r));default:return t}}function Hr(e){let t=[],r=Bp(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(h=>ri(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Vp(o),containsWrite:u,customDataProxyFetch:i})).map((h,v)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[v],h)}catch(R){return R}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?ra(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:ri(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:ea(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,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}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,modelName:s,globalOmit:a}){if(Up(t),Qp(t,i))throw t;if(t instanceof oe&&Gp(t)){let u=na(t.meta);kr({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=br({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new oe(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ue(l,this.client._clientVersion);if(t instanceof G)throw new G(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof V)throw new V(l,this.client._clientVersion);if(t instanceof ue)throw new ue(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,ta.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=jn(o,s),l=i==="queryRaw"?Hr(a):at(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Vp(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:ra(e)};Me(e,"Unknown transaction kind")}}function ra(e){return{id:e.id,payload:e.payload}}function Qp(e,t){return Wr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Gp(e){return e.code==="P2009"||e.code==="P2012"}function na(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(na)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}m();c();p();d();f();var ia="6.7.0";var oa=ia;m();c();p();d();f();var ca=Se(Sn());m();c();p();d();f();var q=class extends Error{constructor(t){super(t+` +Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};le(q,"PrismaClientConstructorValidationError");var sa=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],aa=["pretty","colorless","minimal"],la=["info","query","warn","error"],Wp={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`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=Pt(r,t)||` Available datasources: ${t.join(", ")}`;throw new q(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`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 q(`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 q(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&nt(t.generator)==="client")throw new q('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Gr(t).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(nt(t.generator)==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`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 q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!aa.includes(e)){let t=Pt(e,aa);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!la.includes(r)){let n=Pt(r,la);throw new q(`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=Pt(i,o);throw new q(`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 q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new q('"omit" option is expected to be an object.');if(e===null)throw new q('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Hp(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new q(zp(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Pt(r,t);throw new q(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function pa(e,t){for(let[r,n]of Object.entries(e)){if(!sa.includes(r)){let i=Pt(r,sa);throw new q(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Wp[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Pt(e,t){if(t.length===0||typeof e!="string")return"";let r=Kp(e,t);return r?` Did you mean "${r}"?`:""}function Kp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ca.default)(e,i)}));r.sort((i,o)=>i.distanceje(n)===t);if(r)return e[r]}function zp(e,t){let r=ht(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Rr(r,"colorless");return`Error validating "omit" option: + +${i} + +${n}`}m();c();p();d();f();function da(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{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]=g,a()},g=>{if(!Wr(g)){l(g);return}g.batchRequestIdx===u?l(g):(i||(i=g),a())})})}var Ve=K("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Yp={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Zp=Symbol.for("prisma.client.transaction.id"),Xp={id:0,nextId(){return++this.id}};function ga(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Jr;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=Xn();constructor(n){e=n?.__internal?.configOverride?.(e)??e,ks(e),n&&pa(n,e);let i=new Nr().on("error",()=>{});this._extensions=yt.empty(),this._previewFeatures=Gr(e),this._clientVersion=e.clientVersion??oa,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Ys();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Oe.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Oe.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new V(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new V("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},g=u.debug===!0;g&&K.enable("prisma:client");let h=Oe.resolve(e.dirname,e.relativePath);or.existsSync(h)||(h=e.dirname),Ve("dirname",e.dirname),Ve("relativePath",e.relativePath),Ve("cwd",h);let v=u.engine||{};if(l.errorFormat?this._errorFormat=l.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:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:v.allowTriggerPanic,prismaPath:v.binaryPath??void 0,engineEndpoint:v.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Xs(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Os(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Qr,getBatchRequestPayload:$r,prismaGraphQLToJSError:jr,PrismaClientUnknownRequestError:G,PrismaClientInitializationError:V,PrismaClientKnownRequestError:oe,debug:K("prisma:client:accelerateEngine"),engineVersion:ma.version,clientVersion:e.clientVersion}},Ve("clientVersion",e.clientVersion),this._engine=js(e,this._engineConfig),this._requestHandler=new zr(this,i),l.log)for(let R of l.log){let C=typeof R=="string"?R:R.emit==="stdout"?R.level:null;C&&this.$on(C,A=>{It.log(`${It.tags[C]??""}`,A.message||A.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Yt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$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{_i()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zn({clientMethod:i,activeProvider:a}),callsite:Ue(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=fa(n,i);return Yn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new ee("`$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=>(Yn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new ee(`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:Bs,callsite:Ue(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zn({clientMethod:i,activeProvider:a}),callsite:Ue(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...fa(n,i));throw new ee("`$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})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new ee("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Xp.nextId(),s=Zs(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 g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:u,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return da(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return me(Yt(me(ms(this),[re("_appliedParent",()=>this._appliedParent._createItxClient(n)),re("_createPrismaPromise",()=>Xn(n)),re(Zp,()=>n.id)])),[bt(bs)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}: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??Yp,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 g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,M=>g(u,I=>(M?.end(),l(I))));let{runInTransaction:h,args:v,...R}=u,C={...n,...R};v&&(C.args=i.middlewareArgsToRequestArgs(v)),n.transaction!==void 0&&h===!1&&delete C.transaction;let A=await vs(this,C);return C.model?ws({result:A,modelName:C.model,args:C.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):A};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:g,unpacker:h,otelParentCtx:v,customDataProxyFetch:R}){try{n=u?u(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>Ir({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return K.enabled("prisma:client")&&(Ve("Prisma Client call:"),Ve(`prisma.${i}(${ns(n)})`),Ve("Generated request:"),Ve(JSON.stringify(A,null,2)+` +`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:v,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:R})}catch(C){throw C.clientVersion=this._clientVersion,C}}$metrics=new wt(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=gs}return t}function fa(e,t){return ed(e)?[new ae(e,t),Ks]:[e,Hs]}function ed(e){return Array.isArray(e)&&Array.isArray(e.raw)}m();c();p();d();f();var td=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function ha(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!td.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}m();c();p();d();f();0&&(module.exports={DMMF,Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce}); +//# sourceMappingURL=react-native.js.map diff --git a/src/generated/prisma/runtime/wasm.js b/src/generated/prisma/runtime/wasm.js new file mode 100644 index 0000000..5217de1 --- /dev/null +++ b/src/generated/prisma/runtime/wasm.js @@ -0,0 +1,35 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ +"use strict";var zo=Object.create;var Ot=Object.defineProperty;var Yo=Object.getOwnPropertyDescriptor;var Xo=Object.getOwnPropertyNames;var Zo=Object.getPrototypeOf,es=Object.prototype.hasOwnProperty;var ne=(t,e)=>()=>(t&&(e=t(t=0)),e);var Le=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rt=(t,e)=>{for(var r in e)Ot(t,r,{get:e[r],enumerable:!0})},cn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Xo(e))!es.call(t,i)&&i!==r&&Ot(t,i,{get:()=>e[i],enumerable:!(n=Yo(e,i))||n.enumerable});return t};var nt=(t,e,r)=>(r=t!=null?zo(Zo(t)):{},cn(e||!t||!t.__esModule?Ot(r,"default",{value:t,enumerable:!0}):r,t)),ts=t=>cn(Ot({},"__esModule",{value:!0}),t);function xr(t,e){if(e=e.toLowerCase(),e==="utf8"||e==="utf-8")return new y(os.encode(t));if(e==="base64"||e==="base64url")return t=t.replace(/-/g,"+").replace(/_/g,"/"),t=t.replace(/[^A-Za-z0-9+/]/g,""),new y([...atob(t)].map(r=>r.charCodeAt(0)));if(e==="binary"||e==="ascii"||e==="latin1"||e==="latin-1")return new y([...t].map(r=>r.charCodeAt(0)));if(e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le"){let r=new y(t.length*2),n=new DataView(r.buffer);for(let i=0;ia.startsWith("get")||a.startsWith("set")),n=r.map(a=>a.replace("get","read").replace("set","write")),i=(a,f)=>function(h=0){return B(h,"offset"),Y(h,"offset"),V(h,"offset",this.length-1),new DataView(this.buffer)[r[a]](h,f)},o=(a,f)=>function(h,T=0){let C=r[a].match(/set(\w+\d+)/)[1].toLowerCase(),k=is[C];return B(T,"offset"),Y(T,"offset"),V(T,"offset",this.length-1),ns(h,"value",k[0],k[1]),new DataView(this.buffer)[r[a]](T,h,f),T+parseInt(r[a].match(/\d+/)[0])/8},s=a=>{a.forEach(f=>{f.includes("Uint")&&(t[f.replace("Uint","UInt")]=t[f]),f.includes("Float64")&&(t[f.replace("Float64","Double")]=t[f]),f.includes("Float32")&&(t[f.replace("Float32","Float")]=t[f])})};n.forEach((a,f)=>{a.startsWith("read")&&(t[a]=i(f,!1),t[a+"LE"]=i(f,!0),t[a+"BE"]=i(f,!1)),a.startsWith("write")&&(t[a]=o(f,!1),t[a+"LE"]=o(f,!0),t[a+"BE"]=o(f,!1)),s([a,a+"LE",a+"BE"])})}function pn(t){throw new Error(`Buffer polyfill does not implement "${t}"`)}function Mt(t,e){if(!(t instanceof Uint8Array))throw new TypeError(`The "${e}" argument must be an instance of Buffer or Uint8Array`)}function V(t,e,r=ls+1){if(t<0||t>r){let n=new RangeError(`The value of "${e}" is out of range. It must be >= 0 && <= ${r}. Received ${t}`);throw n.code="ERR_OUT_OF_RANGE",n}}function B(t,e){if(typeof t!="number"){let r=new TypeError(`The "${e}" argument must be of type number. Received type ${typeof t}.`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function Y(t,e){if(!Number.isInteger(t)||Number.isNaN(t)){let r=new RangeError(`The value of "${e}" is out of range. It must be an integer. Received ${t}`);throw r.code="ERR_OUT_OF_RANGE",r}}function ns(t,e,r,n){if(tn){let i=new RangeError(`The value of "${e}" is out of range. It must be >= ${r} and <= ${n}. Received ${t}`);throw i.code="ERR_OUT_OF_RANGE",i}}function mn(t,e){if(typeof t!="string"){let r=new TypeError(`The "${e}" argument must be of type string. Received type ${typeof t}`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function us(t,e="utf8"){return y.from(t,e)}var y,is,os,ss,as,ls,b,Er,u=ne(()=>{"use strict";y=class t extends Uint8Array{_isBuffer=!0;get offset(){return this.byteOffset}static alloc(e,r=0,n="utf8"){return mn(n,"encoding"),t.allocUnsafe(e).fill(r,n)}static allocUnsafe(e){return t.from(e)}static allocUnsafeSlow(e){return t.from(e)}static isBuffer(e){return e&&!!e._isBuffer}static byteLength(e,r="utf8"){if(typeof e=="string")return xr(e,r).byteLength;if(e&&e.byteLength)return e.byteLength;let n=new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer.');throw n.code="ERR_INVALID_ARG_TYPE",n}static isEncoding(e){return as.includes(e)}static compare(e,r){Mt(e,"buff1"),Mt(r,"buff2");for(let n=0;nr[n])return 1}return e.length===r.length?0:e.length>r.length?1:-1}static from(e,r="utf8"){if(e&&typeof e=="object"&&e.type==="Buffer")return new t(e.data);if(typeof e=="number")return new t(new Uint8Array(e));if(typeof e=="string")return xr(e,r);if(ArrayBuffer.isView(e)){let{byteOffset:n,byteLength:i,buffer:o}=e;return"map"in e&&typeof e.map=="function"?new t(e.map(s=>s%256),n,i):new t(o,n,i)}if(e&&typeof e=="object"&&("length"in e||"byteLength"in e||"buffer"in e))return new t(e);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}static concat(e,r){if(e.length===0)return t.alloc(0);let n=[].concat(...e.map(o=>[...o])),i=t.alloc(r!==void 0?r:n.length);return i.set(r!==void 0?n.slice(0,r):n),i}slice(e=0,r=this.length){return this.subarray(e,r)}subarray(e=0,r=this.length){return Object.setPrototypeOf(super.subarray(e,r),t.prototype)}reverse(){return super.reverse(),this}readIntBE(e,r){B(e,"offset"),Y(e,"offset"),V(e,"offset",this.length-1),B(r,"byteLength"),Y(r,"byteLength");let n=new DataView(this.buffer,e,r),i=0;for(let o=0;o=0;o--)i.setUint8(o,e&255),e=e/256;return r+n}writeUintBE(e,r,n){return this.writeUIntBE(e,r,n)}writeUIntLE(e,r,n){B(r,"offset"),Y(r,"offset"),V(r,"offset",this.length-1),B(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n);for(let o=0;or===e[n])}copy(e,r=0,n=0,i=this.length){V(r,"targetStart"),V(n,"sourceStart",this.length),V(i,"sourceEnd"),r>>>=0,n>>>=0,i>>>=0;let o=0;for(;n=this.length?this.length-a:e.length),a);return this}includes(e,r=null,n="utf-8"){return this.indexOf(e,r,n)!==-1}lastIndexOf(e,r=null,n="utf-8"){return this.indexOf(e,r,n,!0)}indexOf(e,r=null,n="utf-8",i=!1){let o=i?this.findLastIndex.bind(this):this.findIndex.bind(this);n=typeof r=="string"?r:n;let s=t.from(typeof e=="number"?[e]:e,n),a=typeof r=="string"?0:r;return a=typeof r=="number"?a:null,a=Number.isNaN(a)?null:a,a??=i?this.length:0,a=a<0?this.length+a:a,s.length===0&&i===!1?a>=this.length?this.length:a:s.length===0&&i===!0?(a>=this.length?this.length:a)||this.length:o((f,h)=>(i?h<=a:h>=a)&&this[h]===s[0]&&s.every((C,k)=>this[h+k]===C))}toString(e="utf8",r=0,n=this.length){if(r=r<0?0:r,e=e.toString().toLowerCase(),n<=0)return"";if(e==="utf8"||e==="utf-8")return ss.decode(this.slice(r,n));if(e==="base64"||e==="base64url"){let i=btoa(this.reduce((o,s)=>o+Er(s),""));return e==="base64url"?i.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):i}if(e==="binary"||e==="ascii"||e==="latin1"||e==="latin-1")return this.slice(r,n).reduce((i,o)=>i+Er(o&(e==="ascii"?127:255)),"");if(e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le"){let i=new DataView(this.buffer.slice(r,n));return Array.from({length:i.byteLength/2},(o,s)=>s*2+1i+o.toString(16).padStart(2,"0"),"");pn(`encoding "${e}"`)}toLocaleString(){return this.toString()}inspect(){return``}};is={int8:[-128,127],int16:[-32768,32767],int32:[-2147483648,2147483647],uint8:[0,255],uint16:[0,65535],uint32:[0,4294967295],float32:[-1/0,1/0],float64:[-1/0,1/0],bigint64:[-0x8000000000000000n,0x7fffffffffffffffn],biguint64:[0n,0xffffffffffffffffn]},os=new TextEncoder,ss=new TextDecoder,as=["utf8","utf-8","hex","base64","ascii","binary","base64url","ucs2","ucs-2","utf16le","utf-16le","latin1","latin-1"],ls=4294967295;rs(y.prototype);b=new Proxy(us,{construct(t,[e,r]){return y.from(e,r)},get(t,e){return y[e]}}),Er=String.fromCodePoint});var g,c=ne(()=>{"use strict";g={nextTick:(t,...e)=>{setTimeout(()=>{t(...e)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var E,m=ne(()=>{"use strict";E=globalThis.performance??(()=>{let t=Date.now();return{now:()=>Date.now()-t}})()});var x,p=ne(()=>{"use strict";x=()=>{};x.prototype=x});var w,d=ne(()=>{"use strict";w=class{value;constructor(e){this.value=e}deref(){return this.value}}});function yn(t,e){var r,n,i,o,s,a,f,h,T=t.constructor,C=T.precision;if(!t.s||!e.s)return e.s||(e=new T(t)),q?_(e,C):e;if(f=t.d,h=e.d,s=t.e,i=e.e,f=f.slice(),o=s-i,o){for(o<0?(n=f,o=-o,a=h.length):(n=h,i=s,a=f.length),s=Math.ceil(C/N),a=s>a?s+1:a+1,o>a&&(o=a,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(a=f.length,o=h.length,a-o<0&&(o=a,n=h,h=f,f=n),r=0;o;)r=(f[--o]=f[o]+h[o]+r)/Q|0,f[o]%=Q;for(r&&(f.unshift(r),++i),a=f.length;f[--a]==0;)f.pop();return e.d=f,e.e=i,q?_(e,C):e}function ce(t,e,r){if(t!==~~t||tr)throw Error(Oe+t)}function ue(t){var e,r,n,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;e16)throw Error(vr+$(t));if(!t.s)return new T(ee);for(e==null?(q=!1,a=C):a=e,s=new T(.03125);t.abs().gte(.1);)t=t.times(s),h+=5;for(n=Math.log(ke(2,h))/Math.LN10*2+5|0,a+=n,r=i=o=new T(ee),T.precision=a;;){if(i=_(i.times(t),a),r=r.times(++f),s=o.plus(he(i,r,a)),ue(s.d).slice(0,a)===ue(o.d).slice(0,a)){for(;h--;)o=_(o.times(o),a);return T.precision=C,e==null?(q=!0,_(o,C)):o}o=s}}function $(t){for(var e=t.e*N,r=t.d[0];r>=10;r/=10)e++;return e}function Pr(t,e,r){if(e>t.LN10.sd())throw q=!0,r&&(t.precision=r),Error(ie+"LN10 precision limit exceeded");return _(new t(t.LN10),e)}function Pe(t){for(var e="";t--;)e+="0";return e}function it(t,e){var r,n,i,o,s,a,f,h,T,C=1,k=10,A=t,O=A.d,S=A.constructor,M=S.precision;if(A.s<1)throw Error(ie+(A.s?"NaN":"-Infinity"));if(A.eq(ee))return new S(0);if(e==null?(q=!1,h=M):h=e,A.eq(10))return e==null&&(q=!0),Pr(S,h);if(h+=k,S.precision=h,r=ue(O),n=r.charAt(0),o=$(A),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(t),r=ue(A.d),n=r.charAt(0),C++;o=$(A),n>1?(A=new S("0."+r),o++):A=new S(n+"."+r.slice(1))}else return f=Pr(S,h+2,M).times(o+""),A=it(new S(n+"."+r.slice(1)),h-k).plus(f),S.precision=M,e==null?(q=!0,_(A,M)):A;for(a=s=A=he(A.minus(ee),A.plus(ee),h),T=_(A.times(A),h),i=3;;){if(s=_(s.times(T),h),f=a.plus(he(s,new S(i),h)),ue(f.d).slice(0,h)===ue(a.d).slice(0,h))return a=a.times(2),o!==0&&(a=a.plus(Pr(S,h+2,M).times(o+""))),a=he(a,new S(C),h),S.precision=M,e==null?(q=!0,_(a,M)):a;a=f,i+=2}}function dn(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;)++n;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(n,i),e){if(i-=n,r=r-n-1,t.e=Ne(r/N),t.d=[],n=(r+1)%N,r<0&&(n+=N),nIt||t.e<-It))throw Error(vr+r)}else t.s=0,t.e=0,t.d=[0];return t}function _(t,e,r){var n,i,o,s,a,f,h,T,C=t.d;for(s=1,o=C[0];o>=10;o/=10)s++;if(n=e-s,n<0)n+=N,i=e,h=C[T=0];else{if(T=Math.ceil((n+1)/N),o=C.length,T>=o)return t;for(h=o=C[T],s=1;o>=10;o/=10)s++;n%=N,i=n-N+s}if(r!==void 0&&(o=ke(10,s-i-1),a=h/o%10|0,f=e<0||C[T+1]!==void 0||h%o,f=r<4?(a||f)&&(r==0||r==(t.s<0?3:2)):a>5||a==5&&(r==4||f||r==6&&(n>0?i>0?h/ke(10,s-i):0:C[T-1])%10&1||r==(t.s<0?8:7))),e<1||!C[0])return f?(o=$(t),C.length=1,e=e-o-1,C[0]=ke(10,(N-e%N)%N),t.e=Ne(-e/N)||0):(C.length=1,C[0]=t.e=t.s=0),t;if(n==0?(C.length=T,o=1,T--):(C.length=T+1,o=ke(10,N-n),C[T]=i>0?(h/ke(10,s-i)%ke(10,i)|0)*o:0),f)for(;;)if(T==0){(C[0]+=o)==Q&&(C[0]=1,++t.e);break}else{if(C[T]+=o,C[T]!=Q)break;C[T--]=0,o=1}for(n=C.length;C[--n]===0;)C.pop();if(q&&(t.e>It||t.e<-It))throw Error(vr+$(t));return t}function bn(t,e){var r,n,i,o,s,a,f,h,T,C,k=t.constructor,A=k.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new k(t),q?_(e,A):e;if(f=t.d,C=e.d,n=e.e,h=t.e,f=f.slice(),s=h-n,s){for(T=s<0,T?(r=f,s=-s,a=C.length):(r=C,n=h,a=f.length),i=Math.max(Math.ceil(A/N),a)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,a=C.length,T=i0;--i)f[a++]=0;for(i=C.length;i>s;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+Pe(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Pe(-i-1)+o,r&&(n=r-s)>0&&(o+=Pe(n))):i>=s?(o+=Pe(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Pe(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Pe(n))),t.s<0?"-"+o:o}function fn(t,e){if(t.length>e)return t.length=e,!0}function wn(t){var e,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Oe+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return dn(s,o.toString())}else if(typeof o!="string")throw Error(Oe+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,ms.test(o))dn(s,o);else throw Error(Oe+o)}if(i.prototype=R,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=wn,i.config=i.set=ps,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(Oe+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Oe+r+": "+n);return this}var Fe,cs,Tr,q,ie,Oe,vr,Ne,ke,ms,ee,Q,N,gn,It,R,he,Tr,Dt,xn=ne(()=>{"use strict";u();c();m();p();d();l();Fe=1e9,cs={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},q=!0,ie="[DecimalError] ",Oe=ie+"Invalid argument: ",vr=ie+"Exponent out of range: ",Ne=Math.floor,ke=Math.pow,ms=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Q=1e7,N=7,gn=9007199254740991,It=Ne(gn/N),R={};R.absoluteValue=R.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};R.comparedTo=R.cmp=function(t){var e,r,n,i,o=this;if(t=new o.constructor(t),o.s!==t.s)return o.s||-t.s;if(o.e!==t.e)return o.e>t.e^o.s<0?1:-1;for(n=o.d.length,i=t.d.length,e=0,r=nt.d[e]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};R.decimalPlaces=R.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*N;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};R.dividedBy=R.div=function(t){return he(this,new this.constructor(t))};R.dividedToIntegerBy=R.idiv=function(t){var e=this,r=e.constructor;return _(he(e,new r(t),0,1),r.precision)};R.equals=R.eq=function(t){return!this.cmp(t)};R.exponent=function(){return $(this)};R.greaterThan=R.gt=function(t){return this.cmp(t)>0};R.greaterThanOrEqualTo=R.gte=function(t){return this.cmp(t)>=0};R.isInteger=R.isint=function(){return this.e>this.d.length-2};R.isNegative=R.isneg=function(){return this.s<0};R.isPositive=R.ispos=function(){return this.s>0};R.isZero=function(){return this.s===0};R.lessThan=R.lt=function(t){return this.cmp(t)<0};R.lessThanOrEqualTo=R.lte=function(t){return this.cmp(t)<1};R.logarithm=R.log=function(t){var e,r=this,n=r.constructor,i=n.precision,o=i+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(ee))throw Error(ie+"NaN");if(r.s<1)throw Error(ie+(r.s?"NaN":"-Infinity"));return r.eq(ee)?new n(0):(q=!1,e=he(it(r,o),it(t,o),o),q=!0,_(e,i))};R.minus=R.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?bn(e,t):yn(e,(t.s=-t.s,t))};R.modulo=R.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(ie+"NaN");return r.s?(q=!1,e=he(r,t,0,1).times(t),q=!0,r.minus(e)):_(new n(r),i)};R.naturalExponential=R.exp=function(){return hn(this)};R.naturalLogarithm=R.ln=function(){return it(this)};R.negated=R.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};R.plus=R.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?yn(e,t):bn(e,(t.s=-t.s,t))};R.precision=R.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Oe+t);if(e=$(i)+1,n=i.d.length-1,r=n*N+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return t&&e>r?e:r};R.squareRoot=R.sqrt=function(){var t,e,r,n,i,o,s,a=this,f=a.constructor;if(a.s<1){if(!a.s)return new f(0);throw Error(ie+"NaN")}for(t=$(a),q=!1,i=Math.sqrt(+a),i==0||i==1/0?(e=ue(a.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Ne((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),n=new f(e)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(o=n,n=o.plus(he(a,o,s+2)).times(.5),ue(o.d).slice(0,s)===(e=ue(n.d)).slice(0,s)){if(e=e.slice(s-3,s+1),i==s&&e=="4999"){if(_(o,r+1,0),o.times(o).eq(a)){n=o;break}}else if(e!="9999")break;s+=4}return q=!0,_(n,r)};R.times=R.mul=function(t){var e,r,n,i,o,s,a,f,h,T=this,C=T.constructor,k=T.d,A=(t=new C(t)).d;if(!T.s||!t.s)return new C(0);for(t.s*=T.s,r=T.e+t.e,f=k.length,h=A.length,f=0;){for(e=0,i=f+n;i>n;)a=o[i]+A[n]*k[i-n-1]+e,o[i--]=a%Q|0,e=a/Q|0;o[i]=(o[i]+e)%Q|0}for(;!o[--s];)o.pop();return e?++r:o.shift(),t.d=o,t.e=r,q?_(t,C.precision):t};R.toDecimalPlaces=R.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(ce(t,0,Fe),e===void 0?e=n.rounding:ce(e,0,8),_(r,t+$(r)+1,e))};R.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Me(n,!0):(ce(t,0,Fe),e===void 0?e=i.rounding:ce(e,0,8),n=_(new i(n),t+1,e),r=Me(n,!0,t+1)),r};R.toFixed=function(t,e){var r,n,i=this,o=i.constructor;return t===void 0?Me(i):(ce(t,0,Fe),e===void 0?e=o.rounding:ce(e,0,8),n=_(new o(i),t+$(i)+1,e),r=Me(n.abs(),!1,t+$(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};R.toInteger=R.toint=function(){var t=this,e=t.constructor;return _(new e(t),$(t)+1,e.rounding)};R.toNumber=function(){return+this};R.toPower=R.pow=function(t){var e,r,n,i,o,s,a=this,f=a.constructor,h=12,T=+(t=new f(t));if(!t.s)return new f(ee);if(a=new f(a),!a.s){if(t.s<1)throw Error(ie+"Infinity");return a}if(a.eq(ee))return a;if(n=f.precision,t.eq(ee))return _(a,n);if(e=t.e,r=t.d.length-1,s=e>=r,o=a.s,s){if((r=T<0?-T:T)<=gn){for(i=new f(ee),e=Math.ceil(n/N+4),q=!1;r%2&&(i=i.times(a),fn(i.d,e)),r=Ne(r/2),r!==0;)a=a.times(a),fn(a.d,e);return q=!0,t.s<0?new f(ee).div(i):_(i,n)}}else if(o<0)throw Error(ie+"NaN");return o=o<0&&t.d[Math.max(e,r)]&1?-1:1,a.s=1,q=!1,i=t.times(it(a,n+h)),q=!0,i=hn(i),i.s=o,i};R.toPrecision=function(t,e){var r,n,i=this,o=i.constructor;return t===void 0?(r=$(i),n=Me(i,r<=o.toExpNeg||r>=o.toExpPos)):(ce(t,1,Fe),e===void 0?e=o.rounding:ce(e,0,8),i=_(new o(i),t,e),r=$(i),n=Me(i,t<=r||r<=o.toExpNeg,t)),n};R.toSignificantDigits=R.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(ce(t,1,Fe),e===void 0?e=n.rounding:ce(e,0,8)),_(new n(r),t,e)};R.toString=R.valueOf=R.val=R.toJSON=R[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=$(t),r=t.constructor;return Me(t,e<=r.toExpNeg||e>=r.toExpPos)};he=function(){function t(n,i){var o,s=0,a=n.length;for(n=n.slice();a--;)o=n[a]*i+s,n[a]=o%Q|0,s=o/Q|0;return s&&n.unshift(s),n}function e(n,i,o,s){var a,f;if(o!=s)f=o>s?1:-1;else for(a=f=0;ai[a]?1:-1;break}return f}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]1;)n.shift()}return function(n,i,o,s){var a,f,h,T,C,k,A,O,S,M,oe,H,L,z,Se,wr,se,St,kt=n.constructor,Ho=n.s==i.s?1:-1,le=n.d,U=i.d;if(!n.s)return new kt(n);if(!i.s)throw Error(ie+"Division by zero");for(f=n.e-i.e,se=U.length,Se=le.length,A=new kt(Ho),O=A.d=[],h=0;U[h]==(le[h]||0);)++h;if(U[h]>(le[h]||0)&&--f,o==null?H=o=kt.precision:s?H=o+($(n)-$(i))+1:H=o,H<0)return new kt(0);if(H=H/N+2|0,h=0,se==1)for(T=0,U=U[0],H++;(h1&&(U=t(U,T),le=t(le,T),se=U.length,Se=le.length),z=se,S=le.slice(0,se),M=S.length;M=Q/2&&++wr;do T=0,a=e(U,S,se,M),a<0?(oe=S[0],se!=M&&(oe=oe*Q+(S[1]||0)),T=oe/wr|0,T>1?(T>=Q&&(T=Q-1),C=t(U,T),k=C.length,M=S.length,a=e(C,S,k,M),a==1&&(T--,r(C,se{"use strict";xn();v=class extends Dt{static isDecimal(e){return e instanceof Dt}static random(e=20){{let n=globalThis.crypto.getRandomValues(new Uint8Array(e)).reduce((i,o)=>i+o,"");return new Dt(`0.${n.slice(0,e)}`)}}},me=v});function bs(){return!1}function Nn(){return{dev:0,ino:0,mode:0,nlink:0,uid:0,gid:0,rdev:0,size:0,blksize:0,blocks:0,atimeMs:0,mtimeMs:0,ctimeMs:0,birthtimeMs:0,atime:new Date,mtime:new Date,ctime:new Date,birthtime:new Date}}function ws(){return Nn()}function xs(){return[]}function Es(t){t(null,[])}function Ps(){return""}function vs(){return""}function Ts(){}function Cs(){}function Rs(){}function As(){}function Ss(){}function ks(){}var Os,Ms,qn,Un=ne(()=>{"use strict";u();c();m();p();d();l();Os={},Ms={existsSync:bs,lstatSync:Nn,statSync:ws,readdirSync:xs,readdir:Es,readlinkSync:Ps,realpathSync:vs,chmodSync:Ts,renameSync:Cs,mkdirSync:Rs,rmdirSync:As,rmSync:Ss,unlinkSync:ks,promises:Os},qn=Ms});function Is(...t){return t.join("/")}function Ds(...t){return t.join("/")}function _s(t){let e=Bn(t),r=$n(t),[n,i]=e.split(".");return{root:"/",dir:r,base:e,ext:i,name:n}}function Bn(t){let e=t.split("/");return e[e.length-1]}function $n(t){return t.split("/").slice(0,-1).join("/")}var Vn,Ls,Fs,Nt,jn=ne(()=>{"use strict";u();c();m();p();d();l();Vn="/",Ls={sep:Vn},Fs={basename:Bn,dirname:$n,join:Ds,parse:_s,posix:Ls,resolve:Is,sep:Vn},Nt=Fs});var Qn=Le((Zc,Ns)=>{Ns.exports={name:"@prisma/internals",version:"6.7.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek ",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-engine-wasm":"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Kn=Le((Em,Wn)=>{"use strict";u();c();m();p();d();l();Wn.exports=(t,e=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(e===0)return t;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return t.replace(n,r.indent.repeat(e))}});var Yn=Le((Lm,zn)=>{"use strict";u();c();m();p();d();l();zn.exports=({onlyFirst:t=!1}={})=>{let e=["[\\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(e,t?void 0:"g")}});var Zn=Le((Vm,Xn)=>{"use strict";u();c();m();p();d();l();var Js=Yn();Xn.exports=t=>typeof t=="string"?t.replace(Js(),""):t});var Fr=Le((oy,ii)=>{"use strict";u();c();m();p();d();l();ii.exports=function(){function t(e,r,n,i,o){return en?n+1:e+1:i===o?r:r+1}return function(e,r){if(e===r)return 0;if(e.length>r.length){var n=e;e=r,r=n}for(var i=e.length,o=r.length;i>0&&e.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s{"use strict";u();c();m();p();d();l()});var ci=ne(()=>{"use strict";u();c();m();p();d();l()});var _i=Le((iP,qa)=>{qa.exports={name:"@prisma/engines-version",version:"6.7.0-36.3cff47a7f5d65c3ea74883f1d736e41d68ce91ed",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"3cff47a7f5d65c3ea74883f1d736e41d68ce91ed"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var nr,Li=ne(()=>{"use strict";u();c();m();p();d();l();nr=class{events={};on(e,r){return this.events[e]||(this.events[e]=[]),this.events[e].push(r),this}emit(e,...r){return this.events[e]?(this.events[e].forEach(n=>{n(...r)}),!0):!1}}});var Jl={};rt(Jl,{DMMF:()=>mt,Debug:()=>J,Decimal:()=>me,Extensions:()=>Cr,MetricsClient:()=>Ye,PrismaClientInitializationError:()=>I,PrismaClientKnownRequestError:()=>X,PrismaClientRustPanicError:()=>we,PrismaClientUnknownRequestError:()=>j,PrismaClientValidationError:()=>W,Public:()=>Rr,Sql:()=>Z,createParam:()=>Ri,defineDmmfProperty:()=>Ii,deserializeJsonResponse:()=>$e,deserializeRawResult:()=>hr,dmmfToRuntimeDataModel:()=>ni,empty:()=>Ni,getPrismaClient:()=>Go,getRuntime:()=>Re,join:()=>Fi,makeStrictEnum:()=>Wo,makeTypedQueryFactory:()=>Di,objectEnumValues:()=>Wt,raw:()=>Jr,serializeJsonQuery:()=>er,skip:()=>Zt,sqltag:()=>Gr,warnEnvConflicts:()=>void 0,warnOnce:()=>lt});module.exports=ts(Jl);u();c();m();p();d();l();var Cr={};rt(Cr,{defineExtension:()=>En,getExtensionContext:()=>Pn});u();c();m();p();d();l();u();c();m();p();d();l();function En(t){return typeof t=="function"?t:e=>e.$extends(t)}u();c();m();p();d();l();function Pn(t){return t}var Rr={};rt(Rr,{validator:()=>vn});u();c();m();p();d();l();u();c();m();p();d();l();function vn(...t){return e=>e}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ar,Tn,Cn,Rn,An=!0;typeof g<"u"&&({FORCE_COLOR:Ar,NODE_DISABLE_COLORS:Tn,NO_COLOR:Cn,TERM:Rn}=g.env||{},An=g.stdout&&g.stdout.isTTY);var ds={enabled:!Tn&&Cn==null&&Rn!=="dumb"&&(Ar!=null&&Ar!=="0"||An)};function F(t,e){let r=new RegExp(`\\x1b\\[${e}m`,"g"),n=`\x1B[${t}m`,i=`\x1B[${e}m`;return function(o){return!ds.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var ju=F(0,0),_t=F(1,22),Lt=F(2,22),Qu=F(3,23),Sn=F(4,24),Ju=F(7,27),Gu=F(8,28),Wu=F(9,29),Ku=F(30,39),qe=F(31,39),kn=F(32,39),On=F(33,39),Mn=F(34,39),Hu=F(35,39),In=F(36,39),zu=F(37,39),Dn=F(90,39),Yu=F(90,39),Xu=F(40,49),Zu=F(41,49),ec=F(42,49),tc=F(43,49),rc=F(44,49),nc=F(45,49),ic=F(46,49),oc=F(47,49);u();c();m();p();d();l();var fs=100,_n=["green","yellow","blue","magenta","cyan","red"],Ft=[],Ln=Date.now(),gs=0,Sr=typeof g<"u"?g.env:{};globalThis.DEBUG??=Sr.DEBUG??"";globalThis.DEBUG_COLORS??=Sr.DEBUG_COLORS?Sr.DEBUG_COLORS==="true":!0;var ot={enable(t){typeof t=="string"&&(globalThis.DEBUG=t)},disable(){let t=globalThis.DEBUG;return globalThis.DEBUG="",t},enabled(t){let e=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=e.some(i=>i===""||i[0]==="-"?!1:t.match(RegExp(i.split("*").join(".*")+"$"))),n=e.some(i=>i===""||i[0]!=="-"?!1:t.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...t)=>{let[e,r,...n]=t;(console.warn??console.log)(`${e} ${r}`,...n)},formatters:{}};function ys(t){let e={color:_n[gs++%_n.length],enabled:ot.enabled(t),namespace:t,log:ot.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=e;if(n.length!==0&&Ft.push([o,...n]),Ft.length>fs&&Ft.shift(),ot.enabled(o)||i){let f=n.map(T=>typeof T=="string"?T:hs(T)),h=`+${Date.now()-Ln}ms`;Ln=Date.now(),a(o,...f,h)}};return new Proxy(r,{get:(n,i)=>e[i],set:(n,i,o)=>e[i]=o})}var J=new Proxy(ys,{get:(t,e)=>ot[e],set:(t,e,r)=>ot[e]=r});function hs(t,e=2){let r=new Set;return JSON.stringify(t,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},e)}function Fn(){Ft.length=0}u();c();m();p();d();l();u();c();m();p();d();l();var kr=["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","freebsd14","freebsd15","openbsd","netbsd","arm"];u();c();m();p();d();l();var qs=Qn(),Or=qs.version;u();c();m();p();d();l();function Ue(t){let e=Us();return e||(t?.config.engineType==="library"?"library":t?.config.engineType==="binary"?"binary":t?.config.engineType==="client"?"client":Bs(t))}function Us(){let t=g.env.PRISMA_CLIENT_ENGINE_TYPE;return t==="library"?"library":t==="binary"?"binary":t==="client"?"client":void 0}function Bs(t){return t?.previewFeatures.includes("queryCompiler")?"client":"library"}u();c();m();p();d();l();var Jn="prisma+postgres",Gn=`${Jn}:`;function Mr(t){return t?.startsWith(`${Gn}//`)??!1}var at={};rt(at,{error:()=>js,info:()=>Vs,log:()=>$s,query:()=>Qs,should:()=>Hn,tags:()=>st,warn:()=>Ir});u();c();m();p();d();l();var st={error:qe("prisma:error"),warn:On("prisma:warn"),info:In("prisma:info"),query:Mn("prisma:query")},Hn={warn:()=>!g.env.PRISMA_DISABLE_WARNINGS};function $s(...t){console.log(...t)}function Ir(t,...e){Hn.warn()&&console.warn(`${st.warn} ${t}`,...e)}function Vs(t,...e){console.info(`${st.info} ${t}`,...e)}function js(t,...e){console.error(`${st.error} ${t}`,...e)}function Qs(t,...e){console.log(`${st.query} ${t}`,...e)}u();c();m();p();d();l();function qt(t,e){if(!t)throw new Error(`${e}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}u();c();m();p();d();l();function be(t,e){throw new Error(e)}u();c();m();p();d();l();function Dr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}u();c();m();p();d();l();function Be(t,e){let r={};for(let n of Object.keys(t))r[n]=e(t[n],n);return r}u();c();m();p();d();l();function _r(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n{ei.has(t)||(ei.add(t),Ir(e,...r))};var I=class t extends Error{clientVersion;errorCode;retryable;constructor(e,r,n){super(e),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(t)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};te(I,"PrismaClientInitializationError");u();c();m();p();d();l();var X=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(e,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(e),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};te(X,"PrismaClientKnownRequestError");u();c();m();p();d();l();var we=class extends Error{clientVersion;constructor(e,r){super(e),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};te(we,"PrismaClientRustPanicError");u();c();m();p();d();l();var j=class extends Error{clientVersion;batchRequestIdx;constructor(e,{clientVersion:r,batchRequestIdx:n}){super(e),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};te(j,"PrismaClientUnknownRequestError");u();c();m();p();d();l();var W=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(e,{clientVersion:r}){super(e),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};te(W,"PrismaClientValidationError");u();c();m();p();d();l();l();function $e(t){return t===null?t:Array.isArray(t)?t.map($e):typeof t=="object"?Gs(t)?Ws(t):Be(t,$e):t}function Gs(t){return t!==null&&typeof t=="object"&&typeof t.$type=="string"}function Ws({$type:t,value:e}){switch(t){case"BigInt":return BigInt(e);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=b.from(e,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(e);case"Decimal":return new me(e);case"Json":return JSON.parse(e);default:be(e,"Unknown tagged value")}}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var pe=class{_map=new Map;get(e){return this._map.get(e)?.value}set(e,r){this._map.set(e,{value:r})}getOrCreate(e,r){let n=this._map.get(e);if(n)return n.value;let i=r();return this.set(e,i),i}};u();c();m();p();d();l();function ve(t){return t.substring(0,1).toLowerCase()+t.substring(1)}u();c();m();p();d();l();function ri(t,e){let r={};for(let n of t){let i=n[e];r[i]=n}return r}u();c();m();p();d();l();function ut(t){let e;return{get(){return e||(e={value:t()}),e.value}}}u();c();m();p();d();l();function ni(t){return{models:Lr(t.models),enums:Lr(t.enums),types:Lr(t.types)}}function Lr(t){let e={};for(let{name:r,...n}of t)e[r]=n;return e}u();c();m();p();d();l();function Ve(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function Ut(t){return t.toString()!=="Invalid Date"}u();c();m();p();d();l();l();function je(t){return v.isDecimal(t)?!0:t!==null&&typeof t=="object"&&typeof t.s=="number"&&typeof t.e=="number"&&typeof t.toFixed=="function"&&Array.isArray(t.d)}u();c();m();p();d();l();u();c();m();p();d();l();var mt={};rt(mt,{ModelAction:()=>ct,datamodelEnumToSchemaEnum:()=>Ks});u();c();m();p();d();l();u();c();m();p();d();l();function Ks(t){return{name:t.name,values:t.values.map(e=>e.name)}}u();c();m();p();d();l();var ct=(L=>(L.findUnique="findUnique",L.findUniqueOrThrow="findUniqueOrThrow",L.findFirst="findFirst",L.findFirstOrThrow="findFirstOrThrow",L.findMany="findMany",L.create="create",L.createMany="createMany",L.createManyAndReturn="createManyAndReturn",L.update="update",L.updateMany="updateMany",L.updateManyAndReturn="updateManyAndReturn",L.upsert="upsert",L.delete="delete",L.deleteMany="deleteMany",L.groupBy="groupBy",L.count="count",L.aggregate="aggregate",L.findRaw="findRaw",L.aggregateRaw="aggregateRaw",L))(ct||{});var Hs=nt(Kn());var zs={red:qe,gray:Dn,dim:Lt,bold:_t,underline:Sn,highlightSource:t=>t.highlight()},Ys={red:t=>t,gray:t=>t,dim:t=>t,bold:t=>t,underline:t=>t,highlightSource:t=>t};function Xs({message:t,originalMethod:e,isPanic:r,callArguments:n}){return{functionName:`prisma.${e}()`,message:t,isPanic:r??!1,callArguments:n}}function Zs({functionName:t,location:e,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],f=e?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${t}\``)} invocation${f}`))):a.push(s.red(`Invalid ${s.bold(`\`${t}\``)} invocation${f}`)),e&&a.push(s.underline(ea(e))),i){a.push("");let h=[i.toString()];o&&(h.push(o),h.push(s.dim(")"))),a.push(h.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` +`)}function ea(t){let e=[t.fileName];return t.lineNumber&&e.push(String(t.lineNumber)),t.columnNumber&&e.push(String(t.columnNumber)),e.join(":")}function Bt(t){let e=t.showColors?zs:Ys,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(t,e):r=Xs(t),Zs(r,e)}u();c();m();p();d();l();var pi=nt(Fr());u();c();m();p();d();l();function ai(t,e,r){let n=li(t),i=ta(n),o=na(i);o?$t(o,e,r):e.addErrorMessage(()=>"Unknown error")}function li(t){return t.errors.flatMap(e=>e.kind==="Union"?li(e):[e])}function ta(t){let e=new Map,r=[];for(let n of t){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=e.get(i);o?e.set(i,{...n,argument:{...n.argument,typeNames:ra(o.argument.typeNames,n.argument.typeNames)}}):e.set(i,n)}return r.push(...e.values()),r}function ra(t,e){return[...new Set(t.concat(e))]}function na(t){return _r(t,(e,r)=>{let n=oi(e),i=oi(r);return n!==i?n-i:si(e)-si(r)})}function oi(t){let e=0;return Array.isArray(t.selectionPath)&&(e+=t.selectionPath.length),Array.isArray(t.argumentPath)&&(e+=t.argumentPath.length),e}function si(t){switch(t.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}u();c();m();p();d();l();var re=class{constructor(e,r){this.name=e;this.value=r}isRequired=!1;makeRequired(){return this.isRequired=!0,this}write(e){let{colors:{green:r}}=e.context;e.addMarginSymbol(r(this.isRequired?"+":"?")),e.write(r(this.name)),this.isRequired||e.write(r("?")),e.write(r(": ")),typeof this.value=="string"?e.write(r(this.value)):e.write(this.value)}};u();c();m();p();d();l();u();c();m();p();d();l();ci();u();c();m();p();d();l();var Qe=class{constructor(e=0,r){this.context=r;this.currentIndent=e}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(e){return typeof e=="string"?this.currentLine+=e:e.write(this),this}writeJoined(e,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(e){return this.marginSymbol=e,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` +`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let e=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+e.slice(1):e}};ui();u();c();m();p();d();l();u();c();m();p();d();l();var Vt=class{constructor(e){this.value=e}write(e){e.write(this.value)}markAsError(){this.value.markAsError()}};u();c();m();p();d();l();var jt=t=>t,Qt={bold:jt,red:jt,green:jt,dim:jt,enabled:!1},mi={bold:_t,red:qe,green:kn,dim:Lt,enabled:!0},Je={write(t){t.writeLine(",")}};u();c();m();p();d();l();var de=class{constructor(e){this.contents=e}isUnderlined=!1;color=e=>e;underline(){return this.isUnderlined=!0,this}setColor(e){return this.color=e,this}write(e){let r=e.getCurrentLineLength();e.write(this.color(this.contents)),this.isUnderlined&&e.afterNextNewline(()=>{e.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};u();c();m();p();d();l();var Te=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var Ge=class extends Te{items=[];addItem(e){return this.items.push(new Vt(e)),this}getField(e){return this.items[e]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(e){if(this.items.length===0){this.writeEmpty(e);return}this.writeWithItems(e)}writeEmpty(e){let r=new de("[]");this.hasError&&r.setColor(e.context.colors.red).underline(),e.write(r)}writeWithItems(e){let{colors:r}=e.context;e.writeLine("[").withIndent(()=>e.writeJoined(Je,this.items).newLine()).write("]"),this.hasError&&e.afterNextNewline(()=>{e.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var We=class t extends Te{fields={};suggestions=[];addField(e){this.fields[e.name]=e}addSuggestion(e){this.suggestions.push(e)}getField(e){return this.fields[e]}getDeepField(e){let[r,...n]=e,i=this.getField(r);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof t?a=o.value.getField(s):o.value instanceof Ge&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(e){return e.length===0?this:this.getDeepField(e)?.value}hasField(e){return!!this.getField(e)}removeAllFields(){this.fields={}}removeField(e){delete this.fields[e]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(e){return this.getField(e)?.value}getDeepSubSelectionValue(e){let r=this;for(let n of e){if(!(r instanceof t))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(e){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of e){let o=n.value.getFieldValue(i);if(!o||!(o instanceof t))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let e=this.getField("select")?.value.asObject();if(e)return{kind:"select",value:e};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(e){return this.getSelectionParent()?.value.fields[e].value}getPrintWidth(){let e=Object.values(this.fields);return e.length==0?2:Math.max(...e.map(n=>n.getPrintWidth()))+2}write(e){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(e);return}this.writeWithContents(e,r)}asObject(){return this}writeEmpty(e){let r=new de("{}");this.hasError&&r.setColor(e.context.colors.red).underline(),e.write(r)}writeWithContents(e,r){e.writeLine("{").withIndent(()=>{e.writeJoined(Je,[...r,...this.suggestions]).newLine()}),e.write("}"),this.hasError&&e.afterNextNewline(()=>{e.writeLine(e.context.colors.red("~".repeat(this.getPrintWidth())))})}};u();c();m();p();d();l();var G=class extends Te{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new de(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};u();c();m();p();d();l();var pt=class{fields=[];addField(e,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${e}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(e){let{colors:{green:r}}=e.context;e.writeLine(r("{")).withIndent(()=>{e.writeJoined(Je,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function $t(t,e,r){switch(t.kind){case"MutuallyExclusiveFields":ia(t,e);break;case"IncludeOnScalar":oa(t,e);break;case"EmptySelection":sa(t,e,r);break;case"UnknownSelectionField":ca(t,e);break;case"InvalidSelectionValue":ma(t,e);break;case"UnknownArgument":pa(t,e);break;case"UnknownInputField":da(t,e);break;case"RequiredArgumentMissing":fa(t,e);break;case"InvalidArgumentType":ga(t,e);break;case"InvalidArgumentValue":ya(t,e);break;case"ValueTooLarge":ha(t,e);break;case"SomeFieldsMissing":ba(t,e);break;case"TooManyFieldsGiven":wa(t,e);break;case"Union":ai(t,e,r);break;default:throw new Error("not implemented: "+t.kind)}}function ia(t,e){let r=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject();r&&(r.getField(t.firstField)?.markAsError(),r.getField(t.secondField)?.markAsError()),e.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${t.firstField}\``)} or ${n.green(`\`${t.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function oa(t,e){let[r,n]=dt(t.selectionPath),i=t.outputType,o=e.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new re(s.name,"true"));e.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${ft(s)}`:a+=".",a+=` +Note that ${s.bold("include")} statements only accept relation fields.`,a})}function sa(t,e,r){let n=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){aa(t,e,i);return}if(n.hasField("select")){la(t,e);return}}if(r?.[ve(t.outputType.name)]){ua(t,e);return}e.addErrorMessage(()=>`Unknown field at "${t.selectionPath.join(".")} selection"`)}function aa(t,e,r){r.removeAllFields();for(let n of t.outputType.fields)r.addSuggestion(new re(n.name,"false"));e.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(t.outputType.name)}. At least one field must be included in the result`)}function la(t,e){let r=t.outputType,n=e.arguments.getDeepSelectionParent(t.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),gi(n,r)),e.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ft(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function ua(t,e){let r=new pt;for(let i of t.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new re("omit",r).makeRequired();if(t.selectionPath.length===0)e.arguments.addSuggestion(n);else{let[i,o]=dt(t.selectionPath),a=e.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let f=a?.value.asObject()??new We;f.addSuggestion(n),a.value=f}}e.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(t.outputType.name)}. At least one field must be included in the result`)}function ca(t,e){let r=yi(t.selectionPath,e);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":gi(n,t.outputType);break;case"include":xa(n,t.outputType);break;case"omit":Ea(n,t.outputType);break}}e.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${t.outputType.name}\``)}.`),i.push(ft(n)),i.join(" ")})}function ma(t,e){let r=yi(t.selectionPath,e);r.parentKind!=="unknown"&&r.field.value.markAsError(),e.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${t.underlyingError}`)}function pa(t,e){let r=t.argumentPath[0],n=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Pa(n,t.arguments)),e.addErrorMessage(i=>di(i,r,t.arguments.map(o=>o.name)))}function da(t,e){let[r,n]=dt(t.argumentPath),i=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject();if(i){i.getDeepField(t.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&hi(o,t.inputType)}e.addErrorMessage(o=>di(o,n,t.inputType.fields.map(s=>s.name)))}function di(t,e,r){let n=[`Unknown argument \`${t.red(e)}\`.`],i=Ta(e,r);return i&&n.push(`Did you mean \`${t.green(i)}\`?`),r.length>0&&n.push(ft(t)),n.join(" ")}function fa(t,e){let r;e.addErrorMessage(f=>r?.value instanceof G&&r.value.text==="null"?`Argument \`${f.green(o)}\` must not be ${f.red("null")}.`:`Argument \`${f.green(o)}\` is missing.`);let n=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject();if(!n)return;let[i,o]=dt(t.argumentPath),s=new pt,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),t.inputTypes.length===1&&t.inputTypes[0].kind==="object"){for(let f of t.inputTypes[0].fields)s.addField(f.name,f.typeNames.join(" | "));a.addSuggestion(new re(o,s).makeRequired())}else{let f=t.inputTypes.map(fi).join(" | ");a.addSuggestion(new re(o,f).makeRequired())}}function fi(t){return t.kind==="list"?`${fi(t.elementType)}[]`:t.name}function ga(t,e){let r=t.argument.name,n=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject();n&&n.getDeepFieldValue(t.argumentPath)?.markAsError(),e.addErrorMessage(i=>{let o=Jt("or",t.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(t.inferredType)}.`})}function ya(t,e){let r=t.argument.name,n=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject();n&&n.getDeepFieldValue(t.argumentPath)?.markAsError(),e.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(t.underlyingError&&o.push(`: ${t.underlyingError}`),o.push("."),t.argument.typeNames.length>0){let s=Jt("or",t.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function ha(t,e){let r=t.argument.name,n=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(t.argumentPath)?.value;s?.markAsError(),s instanceof G&&(i=s.text)}e.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 ba(t,e){let r=t.argumentPath[t.argumentPath.length-1],n=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(t.argumentPath)?.asObject();i&&hi(i,t.inputType)}e.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(t.inputType.name)} needs`];return t.constraints.minFieldCount===1?t.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Jt("or",t.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${t.constraints.minFieldCount}`)} arguments.`),o.push(ft(i)),o.join(" ")})}function wa(t,e){let r=t.argumentPath[t.argumentPath.length-1],n=e.arguments.getDeepSubSelectionValue(t.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(t.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}e.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(t.inputType.name)} needs`];return t.constraints.minFieldCount===1&&t.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):t.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${t.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Jt("and",i.map(a=>o.red(a)))}. Please choose`),t.constraints.maxFieldCount===1?s.push("one."):s.push(`${t.constraints.maxFieldCount}.`),s.join(" ")})}function gi(t,e){for(let r of e.fields)t.hasField(r.name)||t.addSuggestion(new re(r.name,"true"))}function xa(t,e){for(let r of e.fields)r.isRelation&&!t.hasField(r.name)&&t.addSuggestion(new re(r.name,"true"))}function Ea(t,e){for(let r of e.fields)!t.hasField(r.name)&&!r.isRelation&&t.addSuggestion(new re(r.name,"true"))}function Pa(t,e){for(let r of e)t.hasField(r.name)||t.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function yi(t,e){let[r,n]=dt(t),i=e.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),f=o?.getField(n);return o&&f?{parentKind:"select",parent:o,field:f,fieldName:n}:(f=s?.getField(n),s&&f?{parentKind:"include",field:f,parent:s,fieldName:n}:(f=a?.getField(n),a&&f?{parentKind:"omit",field:f,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function hi(t,e){if(e.kind==="object")for(let r of e.fields)t.hasField(r.name)||t.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function dt(t){let e=[...t],r=e.pop();if(!r)throw new Error("unexpected empty path");return[e,r]}function ft({green:t,enabled:e}){return"Available options are "+(e?`listed in ${t("green")}`:"marked with ?")+"."}function Jt(t,e){if(e.length===1)return e[0];let r=[...e],n=r.pop();return`${r.join(", ")} ${t} ${n}`}var va=3;function Ta(t,e){let r=1/0,n;for(let i of e){let o=(0,pi.default)(t,i);o>va||o`}};function Ke(t){return t instanceof gt}u();c();m();p();d();l();var Gt=Symbol(),qr=new WeakMap,xe=class{constructor(e){e===Gt?qr.set(this,`Prisma.${this._getName()}`):qr.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return qr.get(this)}},yt=class extends xe{_getNamespace(){return"NullTypes"}},ht=class extends yt{#e};Ur(ht,"DbNull");var bt=class extends yt{#e};Ur(bt,"JsonNull");var wt=class extends yt{#e};Ur(wt,"AnyNull");var Wt={classes:{DbNull:ht,JsonNull:bt,AnyNull:wt},instances:{DbNull:new ht(Gt),JsonNull:new bt(Gt),AnyNull:new wt(Gt)}};function Ur(t,e){Object.defineProperty(t,"name",{value:e,configurable:!0})}u();c();m();p();d();l();var bi=": ",Kt=class{constructor(e,r){this.name=e;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+bi.length}write(e){let r=new de(this.name);this.hasError&&r.underline().setColor(e.context.colors.red),e.write(r).write(bi).write(this.value)}};var Br=class{arguments;errorMessages=[];constructor(e){this.arguments=e}write(e){e.write(this.arguments)}addErrorMessage(e){this.errorMessages.push(e)}renderAllMessages(e){return this.errorMessages.map(r=>r(e)).join(` +`)}};function He(t){return new Br(wi(t))}function wi(t){let e=new We;for(let[r,n]of Object.entries(t)){let i=new Kt(r,xi(n));e.addField(i)}return e}function xi(t){if(typeof t=="string")return new G(JSON.stringify(t));if(typeof t=="number"||typeof t=="boolean")return new G(String(t));if(typeof t=="bigint")return new G(`${t}n`);if(t===null)return new G("null");if(t===void 0)return new G("undefined");if(je(t))return new G(`new Prisma.Decimal("${t.toFixed()}")`);if(t instanceof Uint8Array)return b.isBuffer(t)?new G(`Buffer.alloc(${t.byteLength})`):new G(`new Uint8Array(${t.byteLength})`);if(t instanceof Date){let e=Ut(t)?t.toISOString():"Invalid Date";return new G(`new Date("${e}")`)}return t instanceof xe?new G(`Prisma.${t._getName()}`):Ke(t)?new G(`prisma.${ve(t.modelName)}.$fields.${t.name}`):Array.isArray(t)?Ca(t):typeof t=="object"?wi(t):new G(Object.prototype.toString.call(t))}function Ca(t){let e=new Ge;for(let r of t)e.addItem(xi(r));return e}function Ht(t,e){let r=e==="pretty"?mi:Qt,n=t.renderAllMessages(r),i=new Qe(0,{colors:r}).write(t).toString();return{message:n,args:i}}function zt({args:t,errors:e,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=He(t);for(let C of e)$t(C,a,s);let{message:f,args:h}=Ht(a,r),T=Bt({message:f,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:h});throw new W(T,{clientVersion:o})}u();c();m();p();d();l();u();c();m();p();d();l();function fe(t){return t.replace(/^./,e=>e.toLowerCase())}u();c();m();p();d();l();function Pi(t,e,r){let n=fe(r);return!e.result||!(e.result.$allModels||e.result[n])?t:Ra({...t,...Ei(e.name,t,e.result.$allModels),...Ei(e.name,t,e.result[n])})}function Ra(t){let e=new pe,r=(n,i)=>e.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),t[n]?t[n].needs.flatMap(o=>r(o,i)):[n]));return Be(t,n=>({...n,needs:r(n.name,new Set)}))}function Ei(t,e,r){return r?Be(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Aa(e,o,i)})):{}}function Aa(t,e,r){let n=t?.[e]?.compute;return n?i=>r({...i,[e]:n(i)}):r}function vi(t,e){if(!e)return t;let r={...t};for(let n of Object.values(e))if(t[n.name])for(let i of n.needs)r[i]=!0;return r}function Ti(t,e){if(!e)return t;let r={...t};for(let n of Object.values(e))if(!t[n.name])for(let i of n.needs)delete r[i];return r}var Yt=class{constructor(e,r){this.extension=e;this.previous=r}computedFieldsCache=new pe;modelExtensionsCache=new pe;queryCallbacksCache=new pe;clientExtensions=ut(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=ut(()=>{let e=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?e.concat(r):e});getAllComputedFields(e){return this.computedFieldsCache.getOrCreate(e,()=>Pi(this.previous?.getAllComputedFields(e),this.extension,e))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(e){return this.modelExtensionsCache.getOrCreate(e,()=>{let r=fe(e);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(e):{...this.previous?.getAllModelExtensions(e),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(e,r){return this.queryCallbacksCache.getOrCreate(`${e}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(e,r)??[],i=[],o=this.extension.query;return!o||!(o[e]||o.$allModels||o[r]||o.$allOperations)?n:(o[e]!==void 0&&(o[e][r]!==void 0&&i.push(o[e][r]),o[e].$allOperations!==void 0&&i.push(o[e].$allOperations)),e!=="$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()}},ze=class t{constructor(e){this.head=e}static empty(){return new t}static single(e){return new t(new Yt(e))}isEmpty(){return this.head===void 0}append(e){return new t(new Yt(e,this.head))}getAllComputedFields(e){return this.head?.getAllComputedFields(e)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(e){return this.head?.getAllModelExtensions(e)}getAllQueryCallbacks(e,r){return this.head?.getAllQueryCallbacks(e,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};u();c();m();p();d();l();var Xt=class{constructor(e){this.name=e}};function Ci(t){return t instanceof Xt}function Ri(t){return new Xt(t)}u();c();m();p();d();l();u();c();m();p();d();l();var Ai=Symbol(),xt=class{constructor(e){if(e!==Ai)throw new Error("Skip instance can not be constructed directly")}ifUndefined(e){return e===void 0?Zt:e}},Zt=new xt(Ai);function ge(t){return t instanceof xt}var Sa={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},Si="explicitly `undefined` values are not allowed";function er({modelName:t,action:e,args:r,runtimeDataModel:n,extensions:i=ze.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:f,previewFeatures:h,globalOmit:T}){let C=new $r({runtimeDataModel:n,modelName:t,action:e,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:f,previewFeatures:h,globalOmit:T});return{modelName:t,action:Sa[e],query:Et(r,C)}}function Et({select:t,include:e,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Oi(r,n),selection:ka(t,e,i,n)}}function ka(t,e,r,n){return t?(e?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),Da(t,n)):Oa(n,e,r)}function Oa(t,e,r){let n={};return t.modelOrType&&!t.isRawAction()&&(n.$composites=!0,n.$scalars=!0),e&&Ma(n,e,t),Ia(n,r,t),n}function Ma(t,e,r){for(let[n,i]of Object.entries(e)){if(ge(i))continue;let o=r.nestSelection(n);if(Vr(i,o),i===!1||i===void 0){t[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){t[n]=Et(i===!0?{}:i,o);continue}if(i===!0){t[n]=!0;continue}t[n]=Et(i,o)}}function Ia(t,e,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...e},o=Ti(i,n);for(let[s,a]of Object.entries(o)){if(ge(a))continue;Vr(a,r.nestSelection(s));let f=r.findField(s);n?.[s]&&!f||(t[s]=!a)}}function Da(t,e){let r={},n=e.getComputedFields(),i=vi(t,n);for(let[o,s]of Object.entries(i)){if(ge(s))continue;let a=e.nestSelection(o);Vr(s,a);let f=e.findField(o);if(!(n?.[o]&&!f)){if(s===!1||s===void 0||ge(s)){r[o]=!1;continue}if(s===!0){f?.kind==="object"?r[o]=Et({},a):r[o]=!0;continue}r[o]=Et(s,a)}}return r}function ki(t,e){if(t===null)return null;if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="bigint")return{$type:"BigInt",value:String(t)};if(Ve(t)){if(Ut(t))return{$type:"DateTime",value:t.toISOString()};e.throwValidationError({kind:"InvalidArgumentValue",selectionPath:e.getSelectionPath(),argumentPath:e.getArgumentPath(),argument:{name:e.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(Ci(t))return{$type:"Param",value:t.name};if(Ke(t))return{$type:"FieldRef",value:{_ref:t.name,_container:t.modelName}};if(Array.isArray(t))return _a(t,e);if(ArrayBuffer.isView(t)){let{buffer:r,byteOffset:n,byteLength:i}=t;return{$type:"Bytes",value:b.from(r,n,i).toString("base64")}}if(La(t))return t.values;if(je(t))return{$type:"Decimal",value:t.toFixed()};if(t instanceof xe){if(t!==Wt.instances[t._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:t._getName()}}if(Fa(t))return t.toJSON();if(typeof t=="object")return Oi(t,e);e.throwValidationError({kind:"InvalidArgumentValue",selectionPath:e.getSelectionPath(),argumentPath:e.getArgumentPath(),argument:{name:e.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(t)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function Oi(t,e){if(t.$type)return{$type:"Raw",value:t};let r={};for(let n in t){let i=t[n],o=e.nestArgument(n);ge(i)||(i!==void 0?r[n]=ki(i,o):e.isPreviewFeatureOn("strictUndefinedChecks")&&e.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:e.getSelectionPath(),argument:{name:e.getArgumentName(),typeNames:[]},underlyingError:Si}))}return r}function _a(t,e){let r=[];for(let n=0;n({name:e.name,typeName:"boolean",isRelation:e.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(e){return this.params.previewFeatures.includes(e)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(e){return this.modelOrType?.fields.find(r=>r.name===e)}nestSelection(e){let r=this.findField(e),n=r?.kind==="object"?r.type:void 0;return new t({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(e)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[ve(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:be(this.params.action,"Unknown action")}}nestArgument(e){return new t({...this.params,argumentPath:this.params.argumentPath.concat(e)})}};u();c();m();p();d();l();function Mi(t){if(!t._hasPreviewFlag("metrics"))throw new W("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:t._clientVersion})}var Ye=class{_client;constructor(e){this._client=e}prometheus(e){return Mi(this._client),this._client._engine.metrics({format:"prometheus",...e})}json(e){return Mi(this._client),this._client._engine.metrics({format:"json",...e})}};u();c();m();p();d();l();function Ii(t,e){let r=ut(()=>Na(e));Object.defineProperty(t,"dmmf",{get:()=>r.get()})}function Na(t){throw new Error("Prisma.dmmf is not available when running in edge runtimes.")}function jr(t){return Object.entries(t).map(([e,r])=>({name:e,...r}))}u();c();m();p();d();l();var Qr=new WeakMap,tr="$$PrismaTypedSql",Pt=class{constructor(e,r){Qr.set(this,{sql:e,values:r}),Object.defineProperty(this,tr,{value:tr})}get sql(){return Qr.get(this).sql}get values(){return Qr.get(this).values}};function Di(t){return(...e)=>new Pt(t,e)}function rr(t){return t!=null&&t[tr]===tr}u();c();m();p();d();l();var Jo=nt(_i());u();c();m();p();d();l();Li();Un();jn();u();c();m();p();d();l();var Z=class t{constructor(e,r){if(e.length-1!==r.length)throw e.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${e.length} strings to have ${e.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof t?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=e[0];let i=0,o=0;for(;it.getPropertyValue(r))},getPropertyDescriptor(r){return t.getPropertyDescriptor?.(r)}}}u();c();m();p();d();l();u();c();m();p();d();l();var ir={enumerable:!0,configurable:!0,writable:!0};function or(t){let e=new Set(t);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>ir,has:(r,n)=>e.has(n),set:(r,n,i)=>e.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...e]}}var qi=Symbol.for("nodejs.util.inspect.custom");function ae(t,e){let r=Ua(e),n=new Set,i=new Proxy(t,{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=Ui(Reflect.ownKeys(o),r),a=Ui(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 f=r.get(s);return f?f.getPropertyDescriptor?{...ir,...f?.getPropertyDescriptor(s)}:ir:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[qi]=function(){let o={...this};return delete o[qi],o},i}function Ua(t){let e=new Map;for(let r of t){let n=r.getKeys();for(let i of n)e.set(i,r)}return e}function Ui(t,e){return t.filter(r=>e.get(r)?.has?.(r)??!0)}u();c();m();p();d();l();function Xe(t){return{getKeys(){return t},has(){return!1},getPropertyValue(){}}}u();c();m();p();d();l();function sr(t,e){return{batch:t,transaction:e?.kind==="batch"?{isolationLevel:e.options.isolationLevel}:void 0}}u();c();m();p();d();l();function Bi(t){if(t===void 0)return"";let e=He(t);return new Qe(0,{colors:Qt}).write(e).toString()}u();c();m();p();d();l();var Ba="P2037";function ar({error:t,user_facing_error:e},r,n){return e.error_code?new X($a(e,n),{code:e.error_code,clientVersion:r,meta:e.meta,batchRequestIdx:e.batch_request_idx}):new j(t,{clientVersion:r,batchRequestIdx:e.batch_request_idx})}function $a(t,e){let r=t.message;return(e==="postgresql"||e==="postgres"||e==="mysql")&&t.error_code===Ba&&(r+=` +Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Wr=class{getLocation(){return null}};function Ce(t){return typeof $EnabledCallSite=="function"&&t!=="minimal"?new $EnabledCallSite:new Wr}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var $i={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ze(t={}){let e=ja(t);return Object.entries(e).reduce((n,[i,o])=>($i[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function ja(t={}){return typeof t._count=="boolean"?{...t,_count:{_all:t._count}}:t}function lr(t={}){return e=>(typeof t._count=="boolean"&&(e._count=e._count._all),e)}function Vi(t,e){let r=lr(t);return e({action:"aggregate",unpacker:r,argsMapper:Ze})(t)}u();c();m();p();d();l();function Qa(t={}){let{select:e,...r}=t;return typeof e=="object"?Ze({...r,_count:e}):Ze({...r,_count:{_all:!0}})}function Ja(t={}){return typeof t.select=="object"?e=>lr(t)(e)._count:e=>lr(t)(e)._count._all}function ji(t,e){return e({action:"count",unpacker:Ja(t),argsMapper:Qa})(t)}u();c();m();p();d();l();function Ga(t={}){let e=Ze(t);if(Array.isArray(e.by))for(let r of e.by)typeof r=="string"&&(e.select[r]=!0);else typeof e.by=="string"&&(e.select[e.by]=!0);return e}function Wa(t={}){return e=>(typeof t?._count=="boolean"&&e.forEach(r=>{r._count=r._count._all}),e)}function Qi(t,e){return e({action:"groupBy",unpacker:Wa(t),argsMapper:Ga})(t)}function Ji(t,e,r){if(e==="aggregate")return n=>Vi(n,r);if(e==="count")return n=>ji(n,r);if(e==="groupBy")return n=>Qi(n,r)}u();c();m();p();d();l();function Gi(t,e){let r=e.fields.filter(i=>!i.relationName),n=ri(r,"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 gt(t,o,s.type,s.isList,s.kind==="enum")},...or(Object.keys(n))})}u();c();m();p();d();l();u();c();m();p();d();l();var Wi=t=>Array.isArray(t)?t:t.split("."),Kr=(t,e)=>Wi(e).reduce((r,n)=>r&&r[n],t),Ki=(t,e,r)=>Wi(e).reduceRight((n,i,o,s)=>Object.assign({},Kr(t,s.slice(0,o)),{[i]:n}),r);function Ka(t,e){return t===void 0||e===void 0?[]:[...e,"select",t]}function Ha(t,e,r){return e===void 0?t??{}:Ki(e,r,t||!0)}function Hr(t,e,r,n,i,o){let a=t._runtimeDataModel.models[e].fields.reduce((f,h)=>({...f,[h.name]:h}),{});return f=>{let h=Ce(t._errorFormat),T=Ka(n,i),C=Ha(f,o,T),k=r({dataPath:T,callsite:h})(C),A=za(t,e);return new Proxy(k,{get(O,S){if(!A.includes(S))return O[S];let oe=[a[S].type,r,S],H=[T,C];return Hr(t,...oe,...H)},...or([...A,...Object.getOwnPropertyNames(k)])})}}function za(t,e){return t._runtimeDataModel.models[e].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Ya=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Xa=["aggregate","count","groupBy"];function zr(t,e){let r=t._extensions.getAllModelExtensions(e)??{},n=[Za(t,e),tl(t,e),vt(r),K("name",()=>e),K("$name",()=>e),K("$parent",()=>t._appliedParent)];return ae({},n)}function Za(t,e){let r=fe(e),n=Object.keys(ct).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>f=>{let h=Ce(t._errorFormat);return t._createPrismaPromise(T=>{let C={args:f,dataPath:[],action:o,model:e,clientMethod:`${r}.${i}`,jsModelName:r,transaction:T,callsite:h};return t._request({...C,...a})},{action:o,args:f,model:e})};return Ya.includes(o)?Hr(t,e,s):el(i)?Ji(t,i,s):s({})}}}function el(t){return Xa.includes(t)}function tl(t,e){return Ie(K("fields",()=>{let r=t._runtimeDataModel.models[e];return Gi(e,r)}))}u();c();m();p();d();l();function Hi(t){return t.replace(/^./,e=>e.toUpperCase())}var Yr=Symbol();function Tt(t){let e=[rl(t),nl(t),K(Yr,()=>t),K("$parent",()=>t._appliedParent)],r=t._extensions.getAllClientExtensions();return r&&e.push(vt(r)),ae(t,e)}function rl(t){let e=Object.getPrototypeOf(t._originalClient),r=[...new Set(Object.getOwnPropertyNames(e))];return{getKeys(){return r},getPropertyValue(n){return t[n]}}}function nl(t){let e=Object.keys(t._runtimeDataModel.models),r=e.map(fe),n=[...new Set(e.concat(r))];return Ie({getKeys(){return n},getPropertyValue(i){let o=Hi(i);if(t._runtimeDataModel.models[o]!==void 0)return zr(t,o);if(t._runtimeDataModel.models[i]!==void 0)return zr(t,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function zi(t){return t[Yr]?t[Yr]:t}function Yi(t){if(typeof t=="function")return t(this);if(t.client?.__AccelerateEngine){let r=t.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let e=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(t)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Tt(e)}u();c();m();p();d();l();u();c();m();p();d();l();function Xi({result:t,modelName:e,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(e);if(!o)return t;let s=[],a=[];for(let f of Object.values(o)){if(n){if(n[f.name])continue;let h=f.needs.filter(T=>n[T]);h.length>0&&a.push(Xe(h))}else if(r){if(!r[f.name])continue;let h=f.needs.filter(T=>!r[T]);h.length>0&&a.push(Xe(h))}il(t,f.needs)&&s.push(ol(f,ae(t,s)))}return s.length>0||a.length>0?ae(t,[...s,...a]):t}function il(t,e){return e.every(r=>Dr(t,r))}function ol(t,e){return Ie(K(t.name,()=>t.compute(e)))}u();c();m();p();d();l();function ur({visitor:t,result:e,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(e)){for(let s=0;sT.name===o);if(!f||f.kind!=="object"||!f.relationName)continue;let h=typeof s=="object"?s:{};e[o]=ur({visitor:i,result:e[o],args:h,modelName:f.type,runtimeDataModel:n})}}function eo({result:t,modelName:e,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||t==null||typeof t!="object"||!i.models[e]?t:ur({result:t,args:r??{},modelName:e,runtimeDataModel:i,visitor:(a,f,h)=>{let T=fe(f);return Xi({result:a,modelName:T,select:h.select,omit:h.select?void 0:{...o?.[T],...h.omit},extensions:n})}})}u();c();m();p();d();l();u();c();m();p();d();l();l();u();c();m();p();d();l();var sl=["$connect","$disconnect","$on","$transaction","$use","$extends"],to=sl;function ro(t){if(t instanceof Z)return al(t);if(rr(t))return ll(t);if(Array.isArray(t)){let r=[t[0]];for(let n=1;n{let o=e.customDataProxyFetch;return"transaction"in e&&i!==void 0&&(e.transaction?.kind==="batch"&&e.transaction.lock.then(),e.transaction=i),n===r.length?t._executeRequest(e):r[n]({model:e.model,operation:e.model?e.action:e.clientMethod,args:ro(e.args??{}),__internalParams:e,query:(s,a=e)=>{let f=a.customDataProxyFetch;return a.customDataProxyFetch=lo(o,f),a.args=s,io(t,a,r,n+1)}})})}function oo(t,e){let{jsModelName:r,action:n,clientMethod:i}=e,o=r?n:i;if(t._extensions.isEmpty())return t._executeRequest(e);let s=t._extensions.getAllQueryCallbacks(r??"$none",o);return io(t,e,s)}function so(t){return e=>{let r={requests:e},n=e[0].extensions.getAllBatchQueryCallbacks();return n.length?ao(r,n,0,t):t(r)}}function ao(t,e,r,n){if(r===e.length)return n(t);let i=t.customDataProxyFetch,o=t.requests[0].transaction;return e[r]({args:{queries:t.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:t,query(s,a=t){let f=a.customDataProxyFetch;return a.customDataProxyFetch=lo(i,f),ao(a,e,r+1,n)}})}var no=t=>t;function lo(t=no,e=no){return r=>t(e(r))}u();c();m();p();d();l();var uo=J("prisma:client"),co={Vercel:"vercel","Netlify CI":"netlify"};function mo({postinstall:t,ciName:e,clientVersion:r}){if(uo("checkPlatformCaching:postinstall",t),uo("checkPlatformCaching:ciName",e),t===!0&&e&&e in co){let n=`Prisma has detected that this project was built on ${e}, 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/${co[e]}-build`;throw console.error(n),new I(n,r)}}u();c();m();p();d();l();function po(t,e){return t?t.datasources?t.datasources:t.datasourceUrl?{[e[0]]:{url:t.datasourceUrl}}:{}:{}}u();c();m();p();d();l();u();c();m();p();d();l();var ul=()=>globalThis.process?.release?.name==="node",cl=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,ml=()=>!!globalThis.Deno,pl=()=>typeof globalThis.Netlify=="object",dl=()=>typeof globalThis.EdgeRuntime=="object",fl=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function gl(){return[[pl,"netlify"],[dl,"edge-light"],[fl,"workerd"],[ml,"deno"],[cl,"bun"],[ul,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var yl={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Re(){let t=gl();return{id:t,prettyName:yl[t]||t,isEdge:["workerd","deno","netlify","edge-light"].includes(t)}}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();function Xr(t){return t.name==="DriverAdapterError"&&typeof t.cause=="object"}u();c();m();p();d();l();function cr(t){return{ok:!0,value:t,map(e){return cr(e(t))},flatMap(e){return e(t)}}}function De(t){return{ok:!1,error:t,map(){return De(t)},flatMap(){return De(t)}}}var fo=J("driver-adapter-utils"),Zr=class{registeredErrors=[];consumeError(e){return this.registeredErrors[e]}registerNewError(e){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:e},r}};var en=(t,e=new Zr)=>{let r={adapterName:t.adapterName,errorRegistry:e,queryRaw:Ee(e,t.queryRaw.bind(t)),executeRaw:Ee(e,t.executeRaw.bind(t)),executeScript:Ee(e,t.executeScript.bind(t)),dispose:Ee(e,t.dispose.bind(t)),provider:t.provider,startTransaction:async(...n)=>(await Ee(e,t.startTransaction.bind(t))(...n)).map(o=>hl(e,o))};return t.getConnectionInfo&&(r.getConnectionInfo=bl(e,t.getConnectionInfo.bind(t))),r},hl=(t,e)=>({adapterName:e.adapterName,provider:e.provider,options:e.options,queryRaw:Ee(t,e.queryRaw.bind(e)),executeRaw:Ee(t,e.executeRaw.bind(e)),commit:Ee(t,e.commit.bind(e)),rollback:Ee(t,e.rollback.bind(e))});function Ee(t,e){return async(...r)=>{try{return cr(await e(...r))}catch(n){if(fo("[error@wrapAsync]",n),Xr(n))return De(n.cause);let i=t.registerNewError(n);return De({kind:"GenericJs",id:i})}}}function bl(t,e){return(...r)=>{try{return cr(e(...r))}catch(n){if(fo("[error@wrapSync]",n),Xr(n))return De(n.cause);let i=t.registerNewError(n);return De({kind:"GenericJs",id:i})}}}u();c();m();p();d();l();function mr({inlineDatasources:t,overrideDatasources:e,env:r,clientVersion:n}){let i,o=Object.keys(t)[0],s=t[o]?.url,a=e[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 Re().id==="workerd"?new I(`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 I(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new I("error: Missing URL environment variable, value, or override.",n);return i}u();c();m();p();d();l();u();c();m();p();d();l();function go(t){if(t?.kind==="itx")return t.options.id}u();c();m();p();d();l();var tn,yo={async loadLibrary(t){let{clientVersion:e,adapter:r,engineWasm:n}=t;if(r===void 0)throw new I(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Re().prettyName})`,e);if(n===void 0)throw new I("WASM engine was unexpectedly `undefined`",e);tn===void 0&&(tn=(async()=>{let o=await n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new I("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",e);let a={"./query_engine_bg.js":o},f=new WebAssembly.Instance(s,a),h=f.exports.__wbindgen_start;return o.__wbg_set_wasm(f.exports),h(),o.QueryEngine})());let i=await tn;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var wl="P2036",ye=J("prisma:client:libraryEngine");function xl(t){return t.item_type==="query"&&"query"in t}function El(t){return"level"in t?t.level==="error"&&t.message==="PANIC":!1}var SS=[...kr,"native"],Pl=0xffffffffffffffffn,rn=1n;function vl(){let t=rn++;return rn>Pl&&(rn=1n),t}var Rt=class{name="LibraryEngine";engine;libraryInstantiationPromise;libraryStartingPromise;libraryStoppingPromise;libraryStarted;executingQueryPromise;config;QueryEngineConstructor;libraryLoader;library;logEmitter;libQueryEnginePath;binaryTarget;datasourceOverrides;datamodel;logQueries;logLevel;lastQuery;loggerRustPanic;tracingHelper;adapterPromise;versionInfo;constructor(e,r){this.libraryLoader=r??yo,this.config=e,this.libraryStarted=!1,this.logQueries=e.logQueries??!1,this.logLevel=e.logLevel??"error",this.logEmitter=e.logEmitter,this.datamodel=e.inlineSchema,this.tracingHelper=e.tracingHelper,e.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(e.overrideDatasources)[0],i=e.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(e){return{applyPendingMigrations:e.applyPendingMigrations?.bind(e),commitTransaction:this.withRequestId(e.commitTransaction.bind(e)),connect:this.withRequestId(e.connect.bind(e)),disconnect:this.withRequestId(e.disconnect.bind(e)),metrics:e.metrics?.bind(e),query:this.withRequestId(e.query.bind(e)),rollbackTransaction:this.withRequestId(e.rollbackTransaction.bind(e)),sdlSchema:e.sdlSchema?.bind(e),startTransaction:this.withRequestId(e.startTransaction.bind(e)),trace:e.trace.bind(e)}}withRequestId(e){return async(...r)=>{let n=vl().toString();try{return await e(...r,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(e,r,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(r),s;if(e==="start"){let f=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(f,o)}else e==="commit"?s=await this.engine?.commitTransaction(n.id,o):e==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if(Tl(a)){let f=this.getExternalAdapterError(a,i?.errorRegistry);throw f?f.error:new X(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new j(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(ye("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(e){if(!e)throw new j("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(e)}catch{throw new j("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.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let e=new w(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(en));let r=await this.adapterPromise;r&&ye("Using driver adapter: %O",r),this.engine=this.wrapEngine(new this.QueryEngineConstructor({datamodel:this.datamodel,env:g.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},n=>{e.deref()?.logger(n)},r))}catch(e){let r=e,n=this.parseInitError(r.message);throw typeof n=="string"?r:new I(n.message,this.config.clientVersion,n.error_code)}}}logger(e){let r=this.parseEngineResponse(e);r&&(r.level=r?.level.toLowerCase()??"unknown",xl(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):(El(r),this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path})))}parseInitError(e){try{return JSON.parse(e)}catch{}return e}parseRequestError(e){try{return JSON.parse(e)}catch{}return e}onBeforeExit(){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.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return ye(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let e=async()=>{ye("library starting");try{let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,ye("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new I(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",e),this.libraryStartingPromise}async stop(){if(await this.libraryInstantiationPromise,await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return ye("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let e=async()=>{await new Promise(n=>setTimeout(n,5)),ye("library stopping");let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0,ye("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",e),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(e){return this.library?.debugPanic(e)}async request(e,{traceparent:r,interactiveTransaction:n}){ye(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(e);try{await this.start();let s=await this.adapterPromise;this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],s?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof I)throw s;s.code==="GenericFailure"&&s.message?.startsWith("PANIC:");let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new j(`${a.message} +${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(e,{transaction:r,traceparent:n}){ye("requestBatch");let i=sr(e,r);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),go(r));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],o?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:f,errors:h}=a;if(Array.isArray(f))return f.map(T=>T.errors&&T.errors.length>0?this.loggerRustPanic??this.buildQueryError(T.errors[0],o?.errorRegistry):{data:T});throw h&&h.length===1?new Error(h[0].error):new Error(JSON.stringify(a))}buildQueryError(e,r){e.user_facing_error.is_panic;let n=this.getExternalAdapterError(e.user_facing_error,r);return n?n.error:ar(e,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(e,r){if(e.error_code===wl&&r){let n=e.meta?.id;qt(typeof n=="number","Malformed external JS error received from the engine");let i=r.consumeError(n);return qt(i,"External error with reported id was not registered"),i}}async metrics(e){await this.start();let r=await this.engine.metrics(JSON.stringify(e));return e.format==="prometheus"?r:this.parseEngineResponse(r)}};function Tl(t){return typeof t=="object"&&t!==null&&t.error_code!==void 0}u();c();m();p();d();l();var At="Accelerate has not been setup correctly. Make sure your client is using `.$extends(withAccelerate())`. See https://pris.ly/d/accelerate-getting-started",pr=class{constructor(e){this.config=e;this.resolveDatasourceUrl=this.config.accelerateUtils?.resolveDatasourceUrl,this.getBatchRequestPayload=this.config.accelerateUtils?.getBatchRequestPayload,this.prismaGraphQLToJSError=this.config.accelerateUtils?.prismaGraphQLToJSError,this.PrismaClientUnknownRequestError=this.config.accelerateUtils?.PrismaClientUnknownRequestError,this.PrismaClientInitializationError=this.config.accelerateUtils?.PrismaClientInitializationError,this.PrismaClientKnownRequestError=this.config.accelerateUtils?.PrismaClientKnownRequestError,this.debug=this.config.accelerateUtils?.debug,this.engineVersion=this.config.accelerateUtils?.engineVersion,this.clientVersion=this.config.accelerateUtils?.clientVersion}name="AccelerateEngine";resolveDatasourceUrl;getBatchRequestPayload;prismaGraphQLToJSError;PrismaClientUnknownRequestError;PrismaClientInitializationError;PrismaClientKnownRequestError;debug;engineVersion;clientVersion;onBeforeExit(e){}async start(){}async stop(){}version(e){return"unknown"}transaction(e,r,n){throw new I(At,this.config.clientVersion)}metrics(e){throw new I(At,this.config.clientVersion)}request(e,r){throw new I(At,this.config.clientVersion)}requestBatch(e,r){throw new I(At,this.config.clientVersion)}applyPendingMigrations(){throw new I(At,this.config.clientVersion)}};function ho({copyEngine:t=!0},e){let r;try{r=mr({inlineDatasources:e.inlineDatasources,overrideDatasources:e.overrideDatasources,env:{...e.env,...g.env},clientVersion:e.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||Mr(r));t&&n&<("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Ue(e.generator),o=n||!t,s=!!e.adapter,a=i==="library",f=i==="binary",h=i==="client";if(o&&s||s&&!1){let T;throw t?r?.startsWith("prisma://")?T=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:T=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:T=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new W(T.join(` +`),{clientVersion:e.clientVersion})}if(s)return new Rt(e);if(o)return new pr(e);{let T=[`PrismaClient failed to initialize because it wasn't configured to run in this environment (${Re().prettyName}).`,"In order to run Prisma Client in an edge runtime, you will need to configure one of the following options:","- Enable Driver Adapters: https://pris.ly/d/driver-adapters","- Enable Accelerate: https://pris.ly/d/accelerate"];throw new W(T.join(` +`),{clientVersion:e.clientVersion})}return"wasm"}u();c();m();p();d();l();function dr({generator:t}){return t?.previewFeatures??[]}u();c();m();p();d();l();var bo=t=>({command:t});u();c();m();p();d();l();u();c();m();p();d();l();var wo=t=>t.strings.reduce((e,r,n)=>`${e}@P${n}${r}`);u();c();m();p();d();l();l();function et(t){try{return xo(t,"fast")}catch{return xo(t,"slow")}}function xo(t,e){return JSON.stringify(t.map(r=>Po(r,e)))}function Po(t,e){if(Array.isArray(t))return t.map(r=>Po(r,e));if(typeof t=="bigint")return{prisma__type:"bigint",prisma__value:t.toString()};if(Ve(t))return{prisma__type:"date",prisma__value:t.toJSON()};if(me.isDecimal(t))return{prisma__type:"decimal",prisma__value:t.toJSON()};if(b.isBuffer(t))return{prisma__type:"bytes",prisma__value:t.toString("base64")};if(Cl(t))return{prisma__type:"bytes",prisma__value:b.from(t).toString("base64")};if(ArrayBuffer.isView(t)){let{buffer:r,byteOffset:n,byteLength:i}=t;return{prisma__type:"bytes",prisma__value:b.from(r,n,i).toString("base64")}}return typeof t=="object"&&e==="slow"?vo(t):t}function Cl(t){return t instanceof ArrayBuffer||t instanceof SharedArrayBuffer?!0:typeof t=="object"&&t!==null?t[Symbol.toStringTag]==="ArrayBuffer"||t[Symbol.toStringTag]==="SharedArrayBuffer":!1}function vo(t){if(typeof t!="object"||t===null)return t;if(typeof t.toJSON=="function")return t.toJSON();if(Array.isArray(t))return t.map(Eo);let e={};for(let r of Object.keys(t))e[r]=Eo(t[r]);return e}function Eo(t){return typeof t=="bigint"?t.toString():vo(t)}var Rl=/^(\s*alter\s)/i,To=J("prisma:client");function nn(t,e,r,n){if(!(t!=="postgresql"&&t!=="cockroachdb")&&r.length>0&&Rl.exec(e))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 on=({clientMethod:t,activeProvider:e})=>r=>{let n="",i;if(rr(r))n=r.sql,i={values:et(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:et(s||[]),__prismaRawParameters__:!0}}else switch(e){case"sqlite":case"mysql":{n=r.sql,i={values:et(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:et(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=wo(r),i={values:et(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${e} provider does not support ${t}`)}return i?.values?To(`prisma.${t}(${n}, ${i.values})`):To(`prisma.${t}(${n})`),{query:n,parameters:i}},Co={requestArgsToMiddlewareArgs(t){return[t.strings,...t.values]},middlewareArgsToRequestArgs(t){let[e,...r]=t;return new Z(e,r)}},Ro={requestArgsToMiddlewareArgs(t){return[t]},middlewareArgsToRequestArgs(t){return t[0]}};u();c();m();p();d();l();function sn(t){return function(r,n){let i,o=(s=t)=>{try{return s===void 0||s?.kind==="itx"?i??=Ao(r(s)):Ao(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Ao(t){return typeof t.then=="function"?t:Promise.resolve(t)}u();c();m();p();d();l();var Al=Or.split(".")[0],Sl={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(t,e){return e()}},an=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(e){return this.getGlobalTracingHelper().getTraceParent(e)}dispatchEngineSpans(e){return this.getGlobalTracingHelper().dispatchEngineSpans(e)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(e,r){return this.getGlobalTracingHelper().runInChildSpan(e,r)}getGlobalTracingHelper(){let e=globalThis[`V${Al}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return e?.helper??r?.helper??Sl}};function So(){return new an}u();c();m();p();d();l();function ko(t,e=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--t===0&&r(e()),i?.(n)}}}u();c();m();p();d();l();function Oo(t){return typeof t=="string"?t:t.reduce((e,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?e:e&&(r==="info"||e==="info")?"info":n},void 0)}u();c();m();p();d();l();var fr=class{_middlewares=[];use(e){this._middlewares.push(e)}get(e){return this._middlewares[e]}has(e){return!!this._middlewares[e]}length(){return this._middlewares.length}};u();c();m();p();d();l();var Io=nt(Zn());u();c();m();p();d();l();function gr(t){return typeof t.batchRequestIdx=="number"}u();c();m();p();d();l();function Mo(t){if(t.action!=="findUnique"&&t.action!=="findUniqueOrThrow")return;let e=[];return t.modelName&&e.push(t.modelName),t.query.arguments&&e.push(ln(t.query.arguments)),e.push(ln(t.query.selection)),e.join("")}function ln(t){return`(${Object.keys(t).sort().map(r=>{let n=t[r];return typeof n=="object"&&n!==null?`(${r} ${ln(n)})`:r}).join(" ")})`}u();c();m();p();d();l();var kl={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!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,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function un(t){return kl[t]}u();c();m();p();d();l();var yr=class{constructor(e){this.options=e;this.batches={}}batches;tickActive=!1;request(e){let r=this.options.batchBy(e);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,g.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:e,resolve:n,reject:i})})):this.options.singleLoader(e)}dispatchBatches(){for(let e in this.batches){let r=this.batches[e];delete this.batches[e],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_e("bigint",r));case"bytes-array":return e.map(r=>_e("bytes",r));case"decimal-array":return e.map(r=>_e("decimal",r));case"datetime-array":return e.map(r=>_e("datetime",r));case"date-array":return e.map(r=>_e("date",r));case"time-array":return e.map(r=>_e("time",r));default:return e}}function hr(t){let e=[],r=Ol(t);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(C=>C.protocolQuery),f=this.client._tracingHelper.getTraceParent(s),h=n.some(C=>un(C.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:f,transaction:Il(o),containsWrite:h,customDataProxyFetch:i})).map((C,k)=>{if(C instanceof Error)return C;try{return this.mapQueryEngineResult(n[k],C)}catch(A){return A}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Do(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:un(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Mo(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(e){try{return await this.dataloader.request(e)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=e;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:e.globalOmit})}}mapQueryEngineResult({dataPath:e,unpacker:r},n){let i=n?.data,o=this.unpack(i,e,r);return g.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(e){try{this.handleRequestError(e)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:e.clientMethod,timestamp:new Date}),r}}handleRequestError({error:e,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(Ml(e),Dl(e,i))throw e;if(e instanceof X&&_l(e)){let h=_o(e.meta);zt({args:o,errors:[h],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let f=e.message;if(n&&(f=Bt({callsite:n,originalMethod:r,isPanic:e.isPanic,showColors:this.client._errorFormat==="pretty",message:f})),f=this.sanitizeMessage(f),e.code){let h=s?{modelName:s,...e.meta}:e.meta;throw new X(f,{code:e.code,clientVersion:this.client._clientVersion,meta:h,batchRequestIdx:e.batchRequestIdx})}else{if(e.isPanic)throw new we(f,this.client._clientVersion);if(e instanceof j)throw new j(f,{clientVersion:this.client._clientVersion,batchRequestIdx:e.batchRequestIdx});if(e instanceof I)throw new I(f,this.client._clientVersion);if(e instanceof we)throw new we(f,this.client._clientVersion)}throw e.clientVersion=this.client._clientVersion,e}sanitizeMessage(e){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Io.default)(e):e}unpack(e,r,n){if(!e||(e.data&&(e=e.data),!e))return e;let i=Object.keys(e)[0],o=Object.values(e)[0],s=r.filter(h=>h!=="select"&&h!=="include"),a=Kr(o,s),f=i==="queryRaw"?hr(a):$e(a);return n?n(f):f}get[Symbol.toStringTag](){return"RequestHandler"}};function Il(t){if(t){if(t.kind==="batch")return{kind:"batch",options:{isolationLevel:t.isolationLevel}};if(t.kind==="itx")return{kind:"itx",options:Do(t)};be(t,"Unknown transaction kind")}}function Do(t){return{id:t.id,payload:t.payload}}function Dl(t,e){return gr(t)&&e?.kind==="batch"&&t.batchRequestIdx!==e.index}function _l(t){return t.code==="P2009"||t.code==="P2012"}function _o(t){if(t.kind==="Union")return{kind:"Union",errors:t.errors.map(_o)};if(Array.isArray(t.selectionPath)){let[,...e]=t.selectionPath;return{...t,selectionPath:e}}return t}u();c();m();p();d();l();var Lo="6.7.0";var Fo=Lo;u();c();m();p();d();l();var $o=nt(Fr());u();c();m();p();d();l();var D=class extends Error{constructor(e){super(e+` +Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};te(D,"PrismaClientConstructorValidationError");var No=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],qo=["pretty","colorless","minimal"],Uo=["info","query","warn","error"],Fl={datasources:(t,{datasourceNames:e})=>{if(t){if(typeof t!="object"||Array.isArray(t))throw new D(`Invalid value ${JSON.stringify(t)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(t)){if(!e.includes(r)){let i=tt(r,e)||` Available datasources: ${e.join(", ")}`;throw new D(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new D(`Invalid value ${JSON.stringify(t)} 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 D(`Invalid value ${JSON.stringify(t)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new D(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(t,e)=>{if(!t&&Ue(e.generator)==="client")throw new D('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(t===null)return;if(t===void 0)throw new D('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!dr(e).includes("driverAdapters"))throw new D('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ue(e.generator)==="binary")throw new D('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:t=>{if(typeof t<"u"&&typeof t!="string")throw new D(`Invalid value ${JSON.stringify(t)} for "datasourceUrl" provided to PrismaClient constructor. +Expected string or undefined.`)},errorFormat:t=>{if(t){if(typeof t!="string")throw new D(`Invalid value ${JSON.stringify(t)} for "errorFormat" provided to PrismaClient constructor.`);if(!qo.includes(t)){let e=tt(t,qo);throw new D(`Invalid errorFormat ${t} provided to PrismaClient constructor.${e}`)}}},log:t=>{if(!t)return;if(!Array.isArray(t))throw new D(`Invalid value ${JSON.stringify(t)} for "log" provided to PrismaClient constructor.`);function e(r){if(typeof r=="string"&&!Uo.includes(r)){let n=tt(r,Uo);throw new D(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of t){e(r);let n={level:e,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=tt(i,o);throw new D(`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 D(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:t=>{if(!t)return;let e=t.maxWait;if(e!=null&&e<=0)throw new D(`Invalid value ${e} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=t.timeout;if(r!=null&&r<=0)throw new D(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(t,e)=>{if(typeof t!="object")throw new D('"omit" option is expected to be an object.');if(t===null)throw new D('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(t)){let o=ql(n,e.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let f=o.fields.find(h=>h.name===s);if(!f){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(f.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new D(Ul(t,r))},__internal:t=>{if(!t)return;let e=["debug","engine","configOverride"];if(typeof t!="object")throw new D(`Invalid value ${JSON.stringify(t)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(t))if(!e.includes(r)){let n=tt(r,e);throw new D(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Vo(t,e){for(let[r,n]of Object.entries(t)){if(!No.includes(r)){let i=tt(r,No);throw new D(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Fl[r](n,e)}if(t.datasourceUrl&&t.datasources)throw new D('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function tt(t,e){if(e.length===0||typeof t!="string")return"";let r=Nl(t,e);return r?` Did you mean "${r}"?`:""}function Nl(t,e){if(e.length===0)return null;let r=e.map(i=>({value:i,distance:(0,$o.default)(t,i)}));r.sort((i,o)=>i.distanceve(n)===e);if(r)return t[r]}function Ul(t,e){let r=He(t);for(let o of e)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Ht(r,"colorless");return`Error validating "omit" option: + +${i} + +${n}`}u();c();m();p();d();l();function jo(t){return t.length===0?Promise.resolve([]):new Promise((e,r)=>{let n=new Array(t.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===t.length&&(o=!0,i?r(i):e(n)))},f=h=>{o||(o=!0,r(h))};for(let h=0;h{n[h]=T,a()},T=>{if(!gr(T)){f(T);return}T.batchRequestIdx===h?f(T):(i||(i=T),a())})})}var Ae=J("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Bl={requestArgsToMiddlewareArgs:t=>t,middlewareArgsToRequestArgs:t=>t},$l=Symbol.for("prisma.client.transaction.id"),Vl={id:0,nextId(){return++this.id}};function Go(t){class e{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new fr;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=sn();constructor(n){t=n?.__internal?.configOverride?.(t)??t,mo(t),n&&Vo(n,t);let i=new nr().on("error",()=>{});this._extensions=ze.empty(),this._previewFeatures=dr(t),this._clientVersion=t.clientVersion??Fo,this._activeProvider=t.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=So();let o=t.relativeEnvPaths&&{rootEnvPath:t.relativeEnvPaths.rootEnvPath&&Nt.resolve(t.dirname,t.relativeEnvPaths.rootEnvPath),schemaEnvPath:t.relativeEnvPaths.schemaEnvPath&&Nt.resolve(t.dirname,t.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let f=t.activeProvider==="postgresql"?"postgres":t.activeProvider;if(s.provider!==f)throw new I(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${f}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new I("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=t.injectableEdgeEnv?.();try{let f=n??{},h=f.__internal??{},T=h.debug===!0;T&&J.enable("prisma:client");let C=Nt.resolve(t.dirname,t.relativePath);qn.existsSync(C)||(C=t.dirname),Ae("dirname",t.dirname),Ae("relativePath",t.relativePath),Ae("cwd",C);let k=h.engine||{};if(f.errorFormat?this._errorFormat=f.errorFormat:g.env.NODE_ENV==="production"?this._errorFormat="minimal":g.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=t.runtimeDataModel,this._engineConfig={cwd:C,dirname:t.dirname,enableDebugLogs:T,allowTriggerPanic:k.allowTriggerPanic,prismaPath:k.binaryPath??void 0,engineEndpoint:k.endpoint,generator:t.generator,showColors:this._errorFormat==="pretty",logLevel:f.log&&Oo(f.log),logQueries:f.log&&!!(typeof f.log=="string"?f.log==="query":f.log.find(A=>typeof A=="string"?A==="query":A.level==="query")),env:a?.parsed??{},flags:[],engineWasm:t.engineWasm,compilerWasm:t.compilerWasm,clientVersion:t.clientVersion,engineVersion:t.engineVersion,previewFeatures:this._previewFeatures,activeProvider:t.activeProvider,inlineSchema:t.inlineSchema,overrideDatasources:po(f,t.datasourceNames),inlineDatasources:t.inlineDatasources,inlineSchemaHash:t.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:f.transactionOptions?.maxWait??2e3,timeout:f.transactionOptions?.timeout??5e3,isolationLevel:f.transactionOptions?.isolationLevel},logEmitter:i,isBundled:t.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:mr,getBatchRequestPayload:sr,prismaGraphQLToJSError:ar,PrismaClientUnknownRequestError:j,PrismaClientInitializationError:I,PrismaClientKnownRequestError:X,debug:J("prisma:client:accelerateEngine"),engineVersion:Jo.version,clientVersion:t.clientVersion}},Ae("clientVersion",t.clientVersion),this._engine=ho(t,this._engineConfig),this._requestHandler=new br(this,i),f.log)for(let A of f.log){let O=typeof A=="string"?A:A.emit==="stdout"?A.level:null;O&&this.$on(O,S=>{at.log(`${at.tags[O]??""}`,S.message||S.query)})}}catch(f){throw f.clientVersion=this._clientVersion,f}return this._appliedParent=Tt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$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{Fn()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:on({clientMethod:i,activeProvider:a}),callsite:Ce(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Qo(n,i);return nn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new W("`$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=>(nn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(t.activeProvider!=="mongodb")throw new W(`The ${t.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:bo,callsite:Ce(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:on({clientMethod:i,activeProvider:a}),callsite:Ce(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Qo(n,i));throw new W("`$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})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new W("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Vl.nextId(),s=ko(n.length),a=n.map((f,h)=>{if(f?.[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 T=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,C={kind:"batch",id:o,index:h,isolationLevel:T,lock:s};return f.requestTransaction?.(C)??f});return jo(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),f;try{let h={kind:"itx",...a};f=await n(this._createItxClient(h)),await this._engine.transaction("commit",o,a)}catch(h){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),h}return f}_createItxClient(n){return ae(Tt(ae(zi(this),[K("_appliedParent",()=>this._appliedParent._createItxClient(n)),K("_createPrismaPromise",()=>sn(n)),K($l,()=>n.id)])),[Xe(to)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}: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??Bl,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,f=async h=>{let T=this._middlewares.get(++a);if(T)return this._tracingHelper.runInChildSpan(s.middleware,M=>T(h,oe=>(M?.end(),f(oe))));let{runInTransaction:C,args:k,...A}=h,O={...n,...A};k&&(O.args=i.middlewareArgsToRequestArgs(k)),n.transaction!==void 0&&C===!1&&delete O.transaction;let S=await oo(this,O);return O.model?eo({result:S,modelName:O.model,args:O.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):S};return this._tracingHelper.runInChildSpan(s.operation,()=>f(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:f,argsMapper:h,transaction:T,unpacker:C,otelParentCtx:k,customDataProxyFetch:A}){try{n=h?h(n):n;let O={name:"serialize"},S=this._tracingHelper.runInChildSpan(O,()=>er({modelName:f,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return J.enabled("prisma:client")&&(Ae("Prisma Client call:"),Ae(`prisma.${i}(${Bi(n)})`),Ae("Generated request:"),Ae(JSON.stringify(S,null,2)+` +`)),T?.kind==="batch"&&await T.lock,this._requestHandler.request({protocolQuery:S,modelName:f,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:T,unpacker:C,otelParentCtx:k,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:A})}catch(O){throw O.clientVersion=this._clientVersion,O}}$metrics=new Ye(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=Yi}return e}function Qo(t,e){return jl(t)?[new Z(t,e),Co]:[t,Ro]}function jl(t){return Array.isArray(t)&&Array.isArray(t.raw)}u();c();m();p();d();l();var Ql=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Wo(t){return new Proxy(t,{get(e,r){if(r in e)return e[r];if(!Ql.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}u();c();m();p();d();l();l();0&&(module.exports={DMMF,Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce}); +//# sourceMappingURL=wasm.js.map diff --git a/src/generated/prisma/schema.prisma b/src/generated/prisma/schema.prisma new file mode 100644 index 0000000..d5fd5da --- /dev/null +++ b/src/generated/prisma/schema.prisma @@ -0,0 +1,191 @@ +// This is your Prisma schema file, +// learn more about it in the docs: https://pris.ly/d/prisma-schema + +// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? +// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init + +generator client { + provider = "prisma-client-js" + output = "../src/generated/prisma" +} + +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +model User { + steamId String @id + name String? + avatar String? + location String? + isAdmin Boolean @default(false) + teamId String? @unique + premierRank Int? + authCode String? + lastKnownShareCode String? + lastKnownShareCodeDate DateTime? + createdAt DateTime @default(now()) + + team Team? @relation("UserTeam", fields: [teamId], references: [id]) + ledTeam Team? @relation("TeamLeader") + invitations Invitation[] @relation("UserInvitations") + notifications Notification[] + matchPlayers MatchPlayer[] + matchRequests CS2MatchRequest[] @relation("MatchRequests") + rankHistory PremierRankHistory[] @relation("UserRankHistory") + demoFiles DemoFile[] +} + +model Team { + id String @id @default(cuid()) + name String @unique + leaderId String? @unique + logo String? + createdAt DateTime @default(now()) + activePlayers String[] + inactivePlayers String[] + leader User? @relation("TeamLeader", fields: [leaderId], references: [steamId]) + members User[] @relation("UserTeam") + invitations Invitation[] + matchPlayers MatchPlayer[] + matchesAsTeamA Match[] @relation("TeamA") + matchesAsTeamB Match[] @relation("TeamB") +} + +model Match { + matchId BigInt @id @default(autoincrement()) + teamAId String? + teamBId String? + matchDate DateTime + matchType String @default("community") + map String? + title String + description String? + demoData Json? + demoFilePath String? + scoreA Int? + scoreB Int? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + teamA Team? @relation("TeamA", fields: [teamAId], references: [id]) + teamB Team? @relation("TeamB", fields: [teamBId], references: [id]) + demoFile DemoFile? + players MatchPlayer[] + rankUpdates PremierRankHistory[] @relation("MatchRankHistory") +} + +model MatchPlayer { + id String @id @default(cuid()) + matchId BigInt + steamId String + teamId String? + + match Match @relation(fields: [matchId], references: [matchId]) + user User @relation(fields: [steamId], references: [steamId]) + team Team? @relation(fields: [teamId], references: [id]) + stats MatchPlayerStats? + + createdAt DateTime @default(now()) + + @@unique([matchId, steamId]) +} + +model MatchPlayerStats { + id String @id @default(cuid()) + matchPlayerId String @unique + kills Int + assists Int + deaths Int + adr Float + headshotPct Float + + flashAssists Int @default(0) + mvps Int @default(0) + mvpEliminations Int @default(0) + mvpDefuse Int @default(0) + mvpPlant Int @default(0) + knifeKills Int @default(0) + zeusKills Int @default(0) + wallbangKills Int @default(0) + smokeKills Int @default(0) + headshots Int @default(0) + noScopes Int @default(0) + blindKills Int @default(0) + + rankOld Int? + rankNew Int? + winCount Int? + + matchPlayer MatchPlayer @relation(fields: [matchPlayerId], references: [id]) +} + +model DemoFile { + id String @id @default(cuid()) + matchId BigInt @unique + steamId String + fileName String @unique + filePath String + parsed Boolean @default(false) + createdAt DateTime @default(now()) + + match Match @relation(fields: [matchId], references: [matchId]) + user User @relation(fields: [steamId], references: [steamId]) +} + +model Invitation { + id String @id @default(cuid()) + userId String + teamId String + type String + createdAt DateTime @default(now()) + + user User @relation("UserInvitations", fields: [userId], references: [steamId]) + team Team @relation(fields: [teamId], references: [id]) +} + +model Notification { + id String @id @default(uuid()) + userId String + title String? + message String + read Boolean @default(false) + persistent Boolean @default(false) + actionType String? + actionData String? + createdAt DateTime @default(now()) + + user User @relation(fields: [userId], references: [steamId]) +} + +model CS2MatchRequest { + id String @id @default(cuid()) + userId String + steamId String + matchId BigInt + reservationId BigInt + tvPort BigInt + processed Boolean @default(false) + createdAt DateTime @default(now()) + + user User @relation("MatchRequests", fields: [userId], references: [steamId]) + + @@unique([steamId, matchId]) +} + +model PremierRankHistory { + id String @id @default(cuid()) + userId String + steamId String + matchId BigInt? + + rankOld Int + rankNew Int + delta Int + winCount Int + createdAt DateTime @default(now()) + + user User @relation("UserRankHistory", fields: [userId], references: [steamId]) + match Match? @relation("MatchRankHistory", fields: [matchId], references: [matchId]) +} diff --git a/src/generated/prisma/wasm.d.ts b/src/generated/prisma/wasm.d.ts new file mode 100644 index 0000000..bc20c6c --- /dev/null +++ b/src/generated/prisma/wasm.d.ts @@ -0,0 +1 @@ +export * from "./index" \ No newline at end of file diff --git a/src/generated/prisma/wasm.js b/src/generated/prisma/wasm.js new file mode 100644 index 0000000..fc7d0bc --- /dev/null +++ b/src/generated/prisma/wasm.js @@ -0,0 +1,319 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! +/* eslint-disable */ + +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + Decimal, + objectEnumValues, + makeStrictEnum, + Public, + getRuntime, + skip +} = require('./runtime/index-browser.js') + + +const Prisma = {} + +exports.Prisma = Prisma +exports.$Enums = {} + +/** + * Prisma Client JS version: 6.7.0 + * Query Engine version: 3cff47a7f5d65c3ea74883f1d736e41d68ce91ed + */ +Prisma.prismaVersion = { + client: "6.7.0", + engine: "3cff47a7f5d65c3ea74883f1d736e41d68ce91ed" +} + +Prisma.PrismaClientKnownRequestError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)}; +Prisma.PrismaClientUnknownRequestError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientRustPanicError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientInitializationError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.PrismaClientValidationError = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.empty = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.join = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.raw = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.validator = Public.validator + +/** +* Extensions +*/ +Prisma.getExtensionContext = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} +Prisma.defineExtension = () => { + const runtimeName = getRuntime().prettyName; + throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). +In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, +)} + +/** + * 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.UserScalarFieldEnum = { + steamId: 'steamId', + name: 'name', + avatar: 'avatar', + location: 'location', + isAdmin: 'isAdmin', + teamId: 'teamId', + premierRank: 'premierRank', + authCode: 'authCode', + lastKnownShareCode: 'lastKnownShareCode', + lastKnownShareCodeDate: 'lastKnownShareCodeDate', + createdAt: 'createdAt' +}; + +exports.Prisma.TeamScalarFieldEnum = { + id: 'id', + name: 'name', + leaderId: 'leaderId', + logo: 'logo', + createdAt: 'createdAt', + activePlayers: 'activePlayers', + inactivePlayers: 'inactivePlayers' +}; + +exports.Prisma.MatchScalarFieldEnum = { + matchId: 'matchId', + teamAId: 'teamAId', + teamBId: 'teamBId', + matchDate: 'matchDate', + matchType: 'matchType', + map: 'map', + title: 'title', + description: 'description', + demoData: 'demoData', + demoFilePath: 'demoFilePath', + scoreA: 'scoreA', + scoreB: 'scoreB', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.MatchPlayerScalarFieldEnum = { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + teamId: 'teamId', + createdAt: 'createdAt' +}; + +exports.Prisma.MatchPlayerStatsScalarFieldEnum = { + id: 'id', + matchPlayerId: 'matchPlayerId', + kills: 'kills', + assists: 'assists', + deaths: 'deaths', + adr: 'adr', + headshotPct: 'headshotPct', + flashAssists: 'flashAssists', + mvps: 'mvps', + mvpEliminations: 'mvpEliminations', + mvpDefuse: 'mvpDefuse', + mvpPlant: 'mvpPlant', + knifeKills: 'knifeKills', + zeusKills: 'zeusKills', + wallbangKills: 'wallbangKills', + smokeKills: 'smokeKills', + headshots: 'headshots', + noScopes: 'noScopes', + blindKills: 'blindKills', + rankOld: 'rankOld', + rankNew: 'rankNew', + winCount: 'winCount' +}; + +exports.Prisma.DemoFileScalarFieldEnum = { + id: 'id', + matchId: 'matchId', + steamId: 'steamId', + fileName: 'fileName', + filePath: 'filePath', + parsed: 'parsed', + createdAt: 'createdAt' +}; + +exports.Prisma.InvitationScalarFieldEnum = { + id: 'id', + userId: 'userId', + teamId: 'teamId', + type: 'type', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationScalarFieldEnum = { + id: 'id', + userId: 'userId', + title: 'title', + message: 'message', + read: 'read', + persistent: 'persistent', + actionType: 'actionType', + actionData: 'actionData', + createdAt: 'createdAt' +}; + +exports.Prisma.CS2MatchRequestScalarFieldEnum = { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + reservationId: 'reservationId', + tvPort: 'tvPort', + processed: 'processed', + createdAt: 'createdAt' +}; + +exports.Prisma.PremierRankHistoryScalarFieldEnum = { + id: 'id', + userId: 'userId', + steamId: 'steamId', + matchId: 'matchId', + rankOld: 'rankOld', + rankNew: 'rankNew', + delta: 'delta', + winCount: 'winCount', + createdAt: 'createdAt' +}; + +exports.Prisma.SortOrder = { + asc: 'asc', + desc: 'desc' +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + +exports.Prisma.QueryMode = { + default: 'default', + insensitive: 'insensitive' +}; + +exports.Prisma.NullsOrder = { + first: 'first', + last: 'last' +}; + +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + + +exports.Prisma.ModelName = { + User: 'User', + Team: 'Team', + Match: 'Match', + MatchPlayer: 'MatchPlayer', + MatchPlayerStats: 'MatchPlayerStats', + DemoFile: 'DemoFile', + Invitation: 'Invitation', + Notification: 'Notification', + CS2MatchRequest: 'CS2MatchRequest', + PremierRankHistory: 'PremierRankHistory' +}; + +/** + * This is a stub Prisma Client that will error at runtime if called. + */ +class PrismaClient { + constructor() { + return new Proxy(this, { + get(target, prop) { + let message + const runtime = getRuntime() + if (runtime.isEdge) { + message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: +- Use Prisma Accelerate: https://pris.ly/d/accelerate +- Use Driver Adapters: https://pris.ly/d/driver-adapters +`; + } else { + message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' + } + + message += ` +If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` + + throw new Error(message) + } + }) + } +} + +exports.PrismaClient = PrismaClient + +Object.assign(exports, Prisma) diff --git a/src/jobs/fetchSteamProfile.ts b/src/jobs/fetchSteamProfile.ts new file mode 100644 index 0000000..2e02e4b --- /dev/null +++ b/src/jobs/fetchSteamProfile.ts @@ -0,0 +1,31 @@ +export async function fetchSteamProfile( + steamId: string +): Promise<{ name: string; avatar: string } | null> { + const key = process.env.STEAM_API_KEY; + if (!key) return null; + + const url = `https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=${key}&steamids=${steamId}`; + + try { + const res = await fetch(url); + const contentType = res.headers.get('content-type') || ''; + + if (!res.ok || !contentType.includes('application/json')) { + const text = await res.text(); + console.warn(`[SteamAPI] ⚠️ Ungültige Antwort für ${steamId} (${res.status}):`, text.slice(0, 200)); + return null; + } + + const data = await res.json(); + const player = data.response?.players?.[0]; + if (!player) return null; + + return { + name: player.personaname, + avatar: player.avatarfull, + }; + } catch (err) { + console.warn(`[SteamAPI] ❌ Fehler für ${steamId}:`, err); + return null; + } +} diff --git a/src/jobs/getNextShareCodeFromAPI.ts b/src/jobs/getNextShareCodeFromAPI.ts new file mode 100644 index 0000000..5b01323 --- /dev/null +++ b/src/jobs/getNextShareCodeFromAPI.ts @@ -0,0 +1,16 @@ +export async function getNextShareCodeFromAPI(authCode: string, currentCode: string): Promise { + try { + const res = await fetch('http://localhost:3000/api/cs2/getNextCode', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ authCode, currentCode }), + }); + + const data = await res.json(); + return data?.nextCode || null; + } catch (err) { + console.error('❌ Fehler beim Abrufen des nächsten ShareCodes:', err); + return null; + } + } + \ No newline at end of file diff --git a/src/jobs/parseAndStoreDemo.ts b/src/jobs/parseAndStoreDemo.ts new file mode 100644 index 0000000..a2374d0 --- /dev/null +++ b/src/jobs/parseAndStoreDemo.ts @@ -0,0 +1,283 @@ +import path from 'path'; +import fs from 'fs/promises'; +import { spawn } from 'child_process'; +import { prisma } from '@/app/lib/prisma'; +import { fetchSteamProfile } from './fetchSteamProfile'; +import type { Match } from '@/generated/prisma'; +import { decodeMatchShareCode } from 'csgo-sharecode'; +import { log } from '../../scripts/cs2-cron-runner'; + +interface PlayerStatsExtended { + name: string; + steamId: string; + kills: number; + deaths: number; + assists: number; + flashAssists: number; + mvps: number; + mvpEliminations: number; + mvpDefuse: number; + mvpPlant: number; + knifeKills: number; + zeusKills: number; + wallbangKills: number; + smokeKills: number; + headshots: number; + noScopes: number; + blindKills: number; + rankOld?: number; + rankNew?: number; + winCount?: number; +} + +interface DemoMatchData { + matchId: bigint; + matchDate: Date; + map: string; + filePath: string; + meta: { + tickRate: number; + duration: number; + map: string; + players: PlayerStatsExtended[]; + }; +} + +const latestDemoDateCache: Record = {}; + +export async function parseAndStoreDemo( + demoPath: string, + steamId: string, + shareCode: string +): Promise { + const parsed = await parseDemoViaGo(demoPath, shareCode); + if (!parsed) return null; + + // ⏩ Demo ggf. umbenennen, falls "unknownmap" im Namen ist + let actualDemoPath = demoPath; + if (parsed.map && parsed.map !== 'unknownmap' && demoPath.includes('unknownmap')) { + const newName = path.basename(demoPath).replace('unknownmap', parsed.map); + const newPath = path.join(path.dirname(demoPath), newName); + await fs.rename(demoPath, newPath); + actualDemoPath = newPath; + } + + const relativePath = path.relative(process.cwd(), actualDemoPath); + + const existing = await prisma.match.findUnique({ + where: { matchId: parsed.matchId }, + }); + + if (existing) return null; + + const match = await prisma.match.create({ + data: { + title: `CS2 Match vom ${parsed.matchDate.toLocaleDateString()}`, + matchDate: parsed.matchDate, + matchId: parsed.matchId, + map: parsed.map, + demoFilePath: relativePath, + matchType: demoPath.endsWith('_premier.dem') + ? 'premier' + : demoPath.endsWith('_competitive.dem') + ? 'competitive' + : 'community', + }, + }); + + await prisma.demoFile.create({ + data: { + steamId, + matchId: match.matchId, + fileName: path.basename(actualDemoPath), + filePath: relativePath, + parsed: true, + }, + }); + + for (const player of parsed.meta.players) { + let playerUser = await prisma.user.findUnique({ + where: { steamId: player.steamId }, + }); + + let steamProfile = null; + if (!playerUser?.name || !playerUser?.avatar) { + steamProfile = await fetchSteamProfile(player.steamId).catch(() => null); + await delay(500); + } + + const isPremier = path.basename(actualDemoPath).toLowerCase().endsWith('_premier.dem'); + + const updatedFields: Partial<{ + name: string; + avatar: string; + premierRank: number; + }> = {}; + + if (!playerUser) { + await prisma.user.create({ + data: { + steamId: player.steamId, + name: steamProfile?.name ?? player.name, + avatar: steamProfile?.avatar ?? undefined, + premierRank: isPremier ? player.rankNew ?? undefined : undefined, + }, + }); + } else { + if (steamProfile?.name && playerUser.name !== steamProfile.name) { + updatedFields.name = steamProfile.name; + } + if (steamProfile?.avatar && playerUser.avatar !== steamProfile.avatar) { + updatedFields.avatar = steamProfile.avatar; + } + if ( + isPremier && + player.rankNew != null && + (await isLatestPremierMatchForPlayer(player.steamId, parsed.matchDate)) + ) { + updatedFields.premierRank = player.rankNew; + } + + if (Object.keys(updatedFields).length > 0) { + await prisma.user.update({ + where: { steamId: player.steamId }, + data: updatedFields, + }); + } + } + + const matchPlayer = await prisma.matchPlayer.create({ + data: { + matchId: match.matchId, + steamId: player.steamId, + ...(playerUser?.teamId && { teamId: playerUser.teamId }), + }, + }); + + await prisma.matchPlayerStats.upsert({ + where: { matchPlayerId: matchPlayer.id }, + update: { + kills: player.kills, + deaths: player.deaths, + assists: player.assists, + adr: 0, + headshotPct: player.kills > 0 ? player.headshots / player.kills : 0, + flashAssists: player.flashAssists, + mvps: player.mvps, + mvpEliminations: player.mvpEliminations, + mvpDefuse: player.mvpDefuse, + mvpPlant: player.mvpPlant, + knifeKills: player.knifeKills, + zeusKills: player.zeusKills, + wallbangKills: player.wallbangKills, + smokeKills: player.smokeKills, + headshots: player.headshots, + noScopes: player.noScopes, + blindKills: player.blindKills, + rankOld: player.rankOld ?? null, + rankNew: player.rankNew ?? null, + winCount: player.winCount ?? null, + }, + create: { + id: matchPlayer.id, + matchPlayerId: matchPlayer.id, + kills: player.kills, + deaths: player.deaths, + assists: player.assists, + adr: 0, + headshotPct: player.kills > 0 ? player.headshots / player.kills : 0, + flashAssists: player.flashAssists, + mvps: player.mvps, + mvpEliminations: player.mvpEliminations, + mvpDefuse: player.mvpDefuse, + mvpPlant: player.mvpPlant, + knifeKills: player.knifeKills, + zeusKills: player.zeusKills, + wallbangKills: player.wallbangKills, + smokeKills: player.smokeKills, + headshots: player.headshots, + noScopes: player.noScopes, + blindKills: player.blindKills, + rankOld: player.rankOld ?? null, + rankNew: player.rankNew ?? null, + winCount: player.winCount ?? null, + }, + }); + } + + return match; +} + +async function parseDemoViaGo(filePath: string, shareCode: string): Promise { + if (!shareCode) throw new Error('❌ Kein ShareCode für MatchId verfügbar'); + return new Promise((resolve) => { + const parserPath = path.resolve(__dirname, '../../../cs2-parser/parser_cs2-win.exe'); + const decoded = decodeMatchShareCode(shareCode); + const matchId = decoded.matchId.toString(); + + const proc = spawn(parserPath, [filePath, matchId]); + + let output = ''; + let errorOutput = ''; + + proc.stdout.on('data', (data) => (output += data)); + proc.stderr.on('data', (data) => (errorOutput += data)); + + proc.on('close', (code) => { + if (code === 0) { + try { + const parsed = JSON.parse(output); + resolve({ + matchId: BigInt(parsed.matchId), + matchDate: new Date(), + map: parsed.map, + filePath, + meta: parsed, + }); + } catch (err) { + log('[Parser] ❌ JSON Fehler:', 'error'); + log(String(err), 'error'); + resolve(null); + } + } else { + log(`[Parser] ❌ Prozess fehlgeschlagen mit Code ${code}`, 'error'); + if (errorOutput) log(String(errorOutput), 'error'); + resolve(null); + } + }); + + proc.on('error', (err) => { + log('[Parser] ❌ Spawn Fehler:' + err, 'error'); + log(String(err), 'error'); + resolve(null); + }); + }); +} + +async function isLatestPremierMatchForPlayer( + steamId: string, + currentMatchDate: Date +): Promise { + const latestPremier = await prisma.match.findFirst({ + where: { + matchType: 'premier', + players: { + some: { steamId } + } + }, + orderBy: { + matchDate: 'desc' + }, + select: { + matchDate: true + } + }); + + if (!latestPremier) return true; // kein früheres Match → ist automatisch das erste & aktuellste + + return latestPremier.matchDate.getTime() === currentMatchDate.getTime(); +} + +function delay(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} diff --git a/src/jobs/processAllUsersCron.ts b/src/jobs/processAllUsersCron.ts new file mode 100644 index 0000000..e244585 --- /dev/null +++ b/src/jobs/processAllUsersCron.ts @@ -0,0 +1,166 @@ +import cron from 'node-cron'; +import { prisma } from '../app/lib/prisma.js'; +import { runDownloaderForUser } from './runDownloaderForUser.js'; +import { sendServerWebSocketMessage } from '../app/lib/websocket-server-client.js'; +import { decrypt } from '../app/lib/crypto.js'; +import { encodeMatch } from 'csgo-sharecode'; +import { log } from '../../scripts/cs2-cron-runner.js'; + +let isRunning = false; + +export function startCS2MatchCron() { + + log('🚀 CS2-CronJob Runner gestartet!') + + const job = cron.schedule('* * * * * *', async () => { + await runMatchCheck(); + }); + + runMatchCheck(); // direkt beim Start ausführen + + return job; +} + +async function runMatchCheck() { + if (isRunning) return; + isRunning = true; + + const users = await prisma.user.findMany({ + where: { + authCode: { not: null }, + lastKnownShareCode: { not: null }, + }, + }); + + for (const user of users) { + let errorOccurred = false; + + if (!user.authCode) { + errorOccurred = true; + log(`[${user.steamId}] ⚠️ Kein authCode vorhanden`, "error"); + continue; + } + + const decryptedAuthCode = decrypt(user.authCode); + const allNewMatches = []; + + log(`[${user.steamId}] 🔍 Suche nach neuem Match...`); + + // 1. ShareCode abrufen + const res = await fetch('http://localhost:3000/api/cs2/getNextCode', { + method: 'GET', + headers: { + 'x-steamid': user.steamId, + }, + }); + + const data = await res.json(); + + if (!data.valid) { + errorOccurred = true; + log(`🛑 ${data.error}`, "error"); + continue; + } + + const nextCode = data.nextCode; + if (!nextCode) { + log(`ℹ️ Keine neuen ShareCodes für ${user.steamId}`); + continue; + } + + log(`[${user.steamId}] 🆕 Neuer ShareCode gefunden!`); + + // 2. MatchRequest abrufen + const matchRequest = await prisma.cS2MatchRequest.findFirst({ + where: { + steamId: user.steamId, + processed: false, + }, + }); + + if (!matchRequest) { + log(`ℹ️ Kein unbearbeiteter MatchRequest für ${user.steamId}`, "warn"); + continue; + } + + // 3. Prüfen, ob Match bereits analysiert wurde + const existing = await prisma.match.findUnique({ + where: { + matchId: matchRequest.matchId, + }, + }); + + if (existing) { + log(`↪️ Match ${matchRequest.matchId} existiert bereits – übersprungen`, "warn"); + + await prisma.cS2MatchRequest.update({ + where: { id: matchRequest.id }, + data: { processed: true }, + }); + + continue; + } + + // 4. Match verarbeiten + const shareCode = encodeMatch({ + matchId: matchRequest.matchId, + reservationId: matchRequest.reservationId, + tvPort: Number(matchRequest.tvPort), + }); + + const result = await runDownloaderForUser({ + ...user, + lastKnownShareCode: shareCode, + }); + + allNewMatches.push(...result.newMatches); + + if (result.newMatches.length > 0) { + await prisma.user.update({ + where: { steamId: user.steamId }, + data: { + lastKnownShareCode: shareCode, + lastKnownShareCodeDate: new Date(), + }, + }); + + log(`[${user.steamId}] 🔁 Neuer lastKnownShareCode gesetzt`); + } + + await prisma.cS2MatchRequest.update({ + where: { id: matchRequest.id }, + data: { processed: true }, + }); + + // 🧠 Notification & WebSocket + if (allNewMatches.length > 0) { + log(`✅ ${allNewMatches.length} neue Matches für ${user.steamId}`); + + const notification = await prisma.notification.create({ + data: { + userId: user.steamId, + title: 'Neue CS2-Matches geladen', + message: `${allNewMatches.length} neue Matches wurden analysiert.`, + actionType: 'cs2-match', + actionData: JSON.stringify({ + matchIds: allNewMatches.map(m => m.matchId.toString()), + }), + }, + }); + + await sendServerWebSocketMessage({ + type: 'cs2-match', + targetUserIds: [user.steamId], + message: notification.message, + id: notification.id, + actionType: notification.actionType ?? undefined, + actionData: notification.actionData ?? undefined, + createdAt: notification.createdAt.toISOString(), + }); + } else if (!errorOccurred) { + log(`ℹ️ Keine neuen Matches für ${user.steamId}`); + } + } + + isRunning = false; +} diff --git a/src/jobs/runDownloaderForUser.ts b/src/jobs/runDownloaderForUser.ts new file mode 100644 index 0000000..46f9ce8 --- /dev/null +++ b/src/jobs/runDownloaderForUser.ts @@ -0,0 +1,58 @@ +import fs from 'fs/promises'; +import path from 'path'; +import { Match, User } from '@/generated/prisma'; +import { parseAndStoreDemo } from './parseAndStoreDemo'; +import { log } from '../../scripts/cs2-cron-runner.js'; + +export async function runDownloaderForUser(user: User): Promise<{ + newMatches: Match[]; + latestShareCode: string | null; +}> { + if (!user.authCode || !user.lastKnownShareCode) { + throw new Error(`User ${user.steamId}: authCode oder ShareCode fehlt`); + } + + const steamId = user.steamId; + const shareCode = user.lastKnownShareCode; + + log(`[${user.steamId}] 📥 Lade Demo herunter...`); + + // 🎯 Nur HTTP-Modus + const res = await fetch('http://localhost:4000/download', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ steamId, shareCode }), + }); + + const data = await res.json(); + + if (!data.success) { + log(`[${steamId}] ❌ Downloader-Fehler: ${data.error}`, 'error'); + } + + const demoPath = data.path; + + if (!demoPath) { + log(`[${steamId}] ⚠️ Kein Demo-Pfad erhalten – Match wird übersprungen`, 'warn'); + return { newMatches: [], latestShareCode: shareCode }; + } + + log(`[${steamId}] 📂 Analysiere: ${path.basename(demoPath)}`); + + const absolutePath = path.resolve(__dirname, '../../../cs2-demo-downloader', demoPath); + const match = await parseAndStoreDemo(absolutePath, steamId, shareCode); + + const newMatches: Match[] = []; + + if (match) { + newMatches.push(match); + log(`[${steamId}] ✅ Match gespeichert: ${match.matchId}`); + } else { + log(`[${steamId}] ⚠️ Match bereits vorhanden oder Analyse fehlgeschlagen`, 'warn'); + } + + return { + newMatches, + latestShareCode: shareCode, + }; +} diff --git a/src/jobs/validateMatchInfo.ts b/src/jobs/validateMatchInfo.ts new file mode 100644 index 0000000..6dff246 --- /dev/null +++ b/src/jobs/validateMatchInfo.ts @@ -0,0 +1,19 @@ +import { MatchInformation } from 'csgo-sharecode' + +export function validateMatchInfo(info: MatchInformation): { + valid: boolean + error?: string +} { + if (!info) return { valid: false, error: 'MatchInfo ist null oder undefined' } + + if (!info.matchId || info.matchId <= 0n) + return { valid: false, error: 'Ungültige matchId' } + + if (!info.reservationId || info.reservationId <= 0n) + return { valid: false, error: 'Ungültige reservationId' } + + if (!info.tvPort || info.tvPort <= 0) + return { valid: false, error: 'Ungültiger tvPort' } + + return { valid: true } +} diff --git a/src/middleware.ts b/src/middleware.ts new file mode 100644 index 0000000..6ac80f0 --- /dev/null +++ b/src/middleware.ts @@ -0,0 +1,33 @@ +import { NextResponse } from 'next/server' +import type { NextRequest } from 'next/server' +import { getToken } from 'next-auth/jwt' + +export async function middleware(req: NextRequest) { + const token = await getToken({ req, secret: process.env.NEXTAUTH_SECRET }) + const { pathname } = req.nextUrl + + // Adminschutz + if (pathname.startsWith('/admin')) { + if (!token || !token.isAdmin) { + return NextResponse.redirect(new URL('/dashboard', req.url)) + } + } + + // Allgemeiner Auth-Schutz + if (!token) { + const loginUrl = new URL('/api/auth/signin', req.url) + loginUrl.searchParams.set('callbackUrl', req.url) + return NextResponse.redirect(loginUrl) + } + + return NextResponse.next() +} + +export const config = { + matcher: [ + '/dashboard/:path*', + '/settings/:path*', + '/matches/:path*', + '/admin/:path*', + ], +} diff --git a/src/theme/theme-provider.tsx b/src/theme/theme-provider.tsx new file mode 100644 index 0000000..10311c0 --- /dev/null +++ b/src/theme/theme-provider.tsx @@ -0,0 +1,13 @@ +"use client"; + +import { + ThemeProvider as NextThemesProvider, + ThemeProviderProps, +} from "next-themes"; + +export default function ThemeProvider({ + children, + ...props +}: ThemeProviderProps) { + return {children}; +} \ No newline at end of file