diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..3e775efb0 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +auto-install-peers=true diff --git a/.vscode/launch.json b/.vscode/launch.json index 3d67d0a5f..97c567d0e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,6 +5,20 @@ { "version": "0.2.0", "configurations": [ + { + "name": "Attach", + "port": 9229, + "request": "attach", + "skipFiles": ["/**"], + "type": "node" + }, + { + "name": "Sample-todo: debug server-side", + "type": "node-terminal", + "request": "launch", + "command": "npm run dev", + "cwd": "${workspaceFolder}/samples/todo" + }, { "name": "Run Extension", "type": "extensionHost", diff --git a/packages/runtime/.gitignore b/packages/runtime/.gitignore new file mode 100644 index 000000000..502167fa0 --- /dev/null +++ b/packages/runtime/.gitignore @@ -0,0 +1 @@ +/lib diff --git a/packages/runtime/package.json b/packages/runtime/package.json new file mode 100644 index 000000000..faffea17c --- /dev/null +++ b/packages/runtime/package.json @@ -0,0 +1,31 @@ +{ + "name": "runtime", + "version": "0.0.3", + "description": "", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "scripts": { + "build": "tsc", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "files": [ + "lib/**/*" + ], + "dependencies": { + "@next-auth/prisma-adapter": "^1.0.4", + "bcryptjs": "^2.4.3", + "next-auth": "^4.10.3" + }, + "peerDependencies": { + "react": "^17.0.2 || ^18", + "react-dom": "^17.0.2 || ^18", + "@prisma/client": "^4.3.1" + }, + "devDependencies": { + "@types/bcryptjs": "^2.4.2", + "typescript": "^4.6.2" + } +} diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts new file mode 100644 index 000000000..e69de29bb diff --git a/packages/runtime/tsconfig.json b/packages/runtime/tsconfig.json new file mode 100644 index 000000000..1833391f0 --- /dev/null +++ b/packages/runtime/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "ESNext", + "lib": ["ESNext"], + "sourceMap": true, + "outDir": "./lib", + "strict": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "moduleResolution": "node", + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "declaration": true + }, + "include": ["src/**/*.ts"], + "exclude": ["lib", "node_modules"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c04dd7235..7c9d2c3f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,6 +2,30 @@ lockfileVersion: 5.4 importers: + .: + specifiers: {} + + packages/runtime: + specifiers: + '@next-auth/prisma-adapter': ^1.0.4 + '@prisma/client': ^4.3.1 + '@types/bcryptjs': ^2.4.2 + bcryptjs: ^2.4.3 + next-auth: ^4.10.3 + react: ^17.0.2 || ^18 + react-dom: ^17.0.2 || ^18 + typescript: ^4.6.2 + dependencies: + '@next-auth/prisma-adapter': 1.0.4_bwhncj256yar2zz55r2fl3abo4 + '@prisma/client': 4.3.1 + bcryptjs: 2.4.3 + next-auth: 4.10.3_biqbaboplfbrettd7655fr4n2y + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + devDependencies: + '@types/bcryptjs': 2.4.2 + typescript: 4.8.3 + packages/schema: specifiers: '@types/jest': ^29.0.3 @@ -45,10 +69,51 @@ importers: eslint: 7.32.0 jest: 29.0.3_johvxhudwcpndp4mle25vwrlq4 langium-cli: 0.4.0 - ts-jest: 29.0.1_jksntdpmkmo5cthob65gehuuvi + ts-jest: 29.0.1_3v2of4mknskhifwzp4doj5a3fa ts-node: 10.9.1_ck2axrxkiif44rdbzjywaqjysa typescript: 4.8.3 + samples/todo: + specifiers: + '@prisma/client': ^4.3.1 + '@types/bcryptjs': ^2.4.2 + '@types/node': ^14.17.3 + '@types/react': 18.0.21 + '@types/react-dom': 18.0.6 + autoprefixer: ^10.4.12 + daisyui: ^2.31.0 + eslint: ^7.19.0 + eslint-config-next: 12.3.1 + next: 12.3.1 + next-auth: ^4.10.3 + postcss: ^8.4.16 + prisma: ^4.3.1 + react: 18.2.0 + react-dom: 18.2.0 + swr: ^1.3.0 + tailwindcss: ^3.1.8 + typescript: ^4.6.2 + dependencies: + '@prisma/client': 4.3.1_prisma@4.3.1 + daisyui: 2.31.0_jhfe3rbur6kzimvcehnoniy6fy + next: 12.3.1_biqbaboplfbrettd7655fr4n2y + next-auth: 4.10.3_biqbaboplfbrettd7655fr4n2y + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + swr: 1.3.0_react@18.2.0 + devDependencies: + '@types/bcryptjs': 2.4.2 + '@types/node': 14.18.29 + '@types/react': 18.0.21 + '@types/react-dom': 18.0.6 + autoprefixer: 10.4.12_postcss@8.4.16 + eslint: 7.32.0 + eslint-config-next: 12.3.1_dyxdave6dwjbccc5dgiifcmuza + postcss: 8.4.16 + prisma: 4.3.1 + tailwindcss: 3.1.8_postcss@8.4.16 + typescript: 4.8.3 + packages: /@ampproject/remapping/2.2.0: @@ -356,6 +421,20 @@ packages: '@babel/helper-plugin-utils': 7.19.0 dev: true + /@babel/runtime-corejs3/7.19.1: + resolution: {integrity: sha512-j2vJGnkopRzH+ykJ8h68wrHnEUmtK//E723jjixiAl/PPf6FhqY/vYRcMVlNydRKQjQsTsYEjpx+DZMIvnGk/g==} + engines: {node: '>=6.9.0'} + dependencies: + core-js-pure: 3.25.2 + regenerator-runtime: 0.13.9 + dev: true + + /@babel/runtime/7.19.0: + resolution: {integrity: sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.13.9 + /@babel/template/7.18.10: resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} engines: {node: '>=6.9.0'} @@ -716,18 +795,153 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@next-auth/prisma-adapter/1.0.4_bwhncj256yar2zz55r2fl3abo4: + resolution: {integrity: sha512-jIOM6CzCbl2/Mzbx9kb2IjtHoJOeRN9wtQgLk4EUm5bhneSVGv1rtz5TDskvp2UfCa+EK9nDmug+lje41z80Gg==} + peerDependencies: + '@prisma/client': '>=2.26.0 || >=3' + next-auth: ^4 + dependencies: + '@prisma/client': 4.3.1_prisma@4.3.1 + next-auth: 4.10.3_biqbaboplfbrettd7655fr4n2y + dev: false + + /@next/env/12.3.1: + resolution: {integrity: sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg==} + dev: false + + /@next/eslint-plugin-next/12.3.1: + resolution: {integrity: sha512-sw+lTf6r6P0j+g/n9y4qdWWI2syPqZx+uc0+B/fRENqfR3KpSid6MIKqc9gNwGhJASazEQ5b3w8h4cAET213jw==} + dependencies: + glob: 7.1.7 + dev: true + + /@next/swc-android-arm-eabi/12.3.1: + resolution: {integrity: sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-android-arm64/12.3.1: + resolution: {integrity: sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-arm64/12.3.1: + resolution: {integrity: sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64/12.3.1: + resolution: {integrity: sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-freebsd-x64/12.3.1: + resolution: {integrity: sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm-gnueabihf/12.3.1: + resolution: {integrity: sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu/12.3.1: + resolution: {integrity: sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl/12.3.1: + resolution: {integrity: sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu/12.3.1: + resolution: {integrity: sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl/12.3.1: + resolution: {integrity: sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc/12.3.1: + resolution: {integrity: sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc/12.3.1: + resolution: {integrity: sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc/12.3.1: + resolution: {integrity: sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + /@nodelib/fs.scandir/2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: true /@nodelib/fs.stat/2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - dev: true /@nodelib/fs.walk/1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -735,6 +949,48 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.13.0 + + /@panva/hkdf/1.0.2: + resolution: {integrity: sha512-MSAs9t3Go7GUkMhpKC44T58DJ5KGk2vBo+h1cqQeqlMfdGkxaVB78ZWpv9gYi/g2fa4sopag9gJsNvS8XGgWJA==} + dev: false + + /@prisma/client/4.3.1: + resolution: {integrity: sha512-FA0/d1VMJNWqzU7WVWTNWJ+lGOLR9JUBnF73GdIPAEVo/6dWk4gHx0EmgeU+SMv4MZoxgOeTBJF2azhg7x0hMw==} + engines: {node: '>=14.17'} + requiresBuild: true + peerDependencies: + prisma: '*' + peerDependenciesMeta: + prisma: + optional: true + dependencies: + '@prisma/engines-version': 4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b + dev: false + + /@prisma/client/4.3.1_prisma@4.3.1: + resolution: {integrity: sha512-FA0/d1VMJNWqzU7WVWTNWJ+lGOLR9JUBnF73GdIPAEVo/6dWk4gHx0EmgeU+SMv4MZoxgOeTBJF2azhg7x0hMw==} + engines: {node: '>=14.17'} + requiresBuild: true + peerDependencies: + prisma: '*' + peerDependenciesMeta: + prisma: + optional: true + dependencies: + '@prisma/engines-version': 4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b + prisma: 4.3.1 + dev: false + + /@prisma/engines-version/4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b: + resolution: {integrity: sha512-8yWpXkQRmiSfsi2Wb/ZS5D3RFbeu/btL9Pm/gdF4phB0Lo5KGsDFMxFMgaD64mwED2nHc8ZaEJg/+4Jymb9Znw==} + dev: false + + /@prisma/engines/4.3.1: + resolution: {integrity: sha512-4JF/uMaEDAPdcdZNOrnzE3BvrbGpjgV0FcPT3EVoi6I86fWkloqqxBt+KcK/+fIRR0Pxj66uGR9wVH8U1Y13JA==} + requiresBuild: true + + /@rushstack/eslint-patch/1.2.0: + resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} dev: true /@sinclair/typebox/0.24.42: @@ -753,6 +1009,12 @@ packages: '@sinonjs/commons': 1.8.3 dev: true + /@swc/helpers/0.4.11: + resolution: {integrity: sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==} + dependencies: + tslib: 2.4.0 + dev: false + /@tsconfig/node10/1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} dev: true @@ -798,6 +1060,10 @@ packages: '@babel/types': 7.19.0 dev: true + /@types/bcryptjs/2.4.2: + resolution: {integrity: sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==} + dev: true + /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: @@ -831,6 +1097,10 @@ packages: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} dev: true + /@types/json5/0.0.29: + resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + dev: true + /@types/node/14.18.29: resolution: {integrity: sha512-LhF+9fbIX4iPzhsRLpK5H7iPdvW8L4IwGciXQIOEcuF62+9nw/VQVsOViAOOGxY3OlOKGLFv0sWwJXdwQeTn6A==} dev: true @@ -839,6 +1109,28 @@ packages: resolution: {integrity: sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==} dev: true + /@types/prop-types/15.7.5: + resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} + dev: true + + /@types/react-dom/18.0.6: + resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} + dependencies: + '@types/react': 18.0.21 + dev: true + + /@types/react/18.0.21: + resolution: {integrity: sha512-7QUCOxvFgnD5Jk8ZKlUAhVcRj7GuJRjnjjiY/IUBWKgOlnvDvTMLD4RTF7NPyVmbRhNrbomZiOepg7M/2Kj1mA==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.2 + csstype: 3.1.1 + dev: true + + /@types/scheduler/0.16.2: + resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} + dev: true + /@types/stack-utils/2.0.1: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} dev: true @@ -925,6 +1217,26 @@ packages: - supports-color dev: true + /@typescript-eslint/parser/5.38.0_dyxdave6dwjbccc5dgiifcmuza: + resolution: {integrity: sha512-/F63giJGLDr0ms1Cr8utDAxP2SPiglaD6V+pCOcG35P2jCqdfR7uuEhz1GIC3oy4hkUF8xA1XSXmd9hOh/a5EA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.38.0 + '@typescript-eslint/types': 5.38.0 + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 + debug: 4.3.4 + eslint: 7.32.0 + typescript: 4.8.3 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/scope-manager/4.33.0: resolution: {integrity: sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} @@ -933,11 +1245,24 @@ packages: '@typescript-eslint/visitor-keys': 4.33.0 dev: true + /@typescript-eslint/scope-manager/5.38.0: + resolution: {integrity: sha512-ByhHIuNyKD9giwkkLqzezZ9y5bALW8VNY6xXcP+VxoH4JBDKjU5WNnsiD4HJdglHECdV+lyaxhvQjTUbRboiTA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.38.0 + '@typescript-eslint/visitor-keys': 5.38.0 + dev: true + /@typescript-eslint/types/4.33.0: resolution: {integrity: sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} dev: true + /@typescript-eslint/types/5.38.0: + resolution: {integrity: sha512-HHu4yMjJ7i3Cb+8NUuRCdOGu2VMkfmKyIJsOr9PfkBVYLYrtMCK/Ap50Rpov+iKpxDTfnqvDbuPLgBE5FwUNfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@typescript-eslint/typescript-estree/4.33.0_typescript@4.8.3: resolution: {integrity: sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==} engines: {node: ^10.12.0 || >=12.0.0} @@ -959,6 +1284,27 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree/5.38.0_typescript@4.8.3: + resolution: {integrity: sha512-6P0RuphkR+UuV7Avv7MU3hFoWaGcrgOdi8eTe1NwhMp2/GjUJoODBTRWzlHpZh6lFOaPmSvgxGlROa0Sg5Zbyg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.38.0 + '@typescript-eslint/visitor-keys': 5.38.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.7 + tsutils: 3.21.0_typescript@4.8.3 + typescript: 4.8.3 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/visitor-keys/4.33.0: resolution: {integrity: sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} @@ -967,6 +1313,14 @@ packages: eslint-visitor-keys: 2.1.0 dev: true + /@typescript-eslint/visitor-keys/5.38.0: + resolution: {integrity: sha512-MxnrdIyArnTi+XyFLR+kt/uNAcdOnmT+879os7qDRI+EYySR4crXJq9BXPfRzzLGq0wgxkwidrCJ9WCAoacm1w==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.38.0 + eslint-visitor-keys: 3.3.0 + dev: true + /acorn-jsx/5.3.2_acorn@7.4.1: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -975,6 +1329,17 @@ packages: acorn: 7.4.1 dev: true + /acorn-node/1.8.2: + resolution: {integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==} + dependencies: + acorn: 7.4.1 + acorn-walk: 7.2.0 + xtend: 4.0.2 + + /acorn-walk/7.2.0: + resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==} + engines: {node: '>=0.4.0'} + /acorn-walk/8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} @@ -984,7 +1349,6 @@ packages: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} engines: {node: '>=0.4.0'} hasBin: true - dev: true /acorn/8.8.0: resolution: {integrity: sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==} @@ -1052,23 +1416,68 @@ packages: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 - dev: true /arg/4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} dev: true + /arg/5.0.2: + resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} + /argparse/1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 dev: true + /aria-query/4.2.2: + resolution: {integrity: sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==} + engines: {node: '>=6.0'} + dependencies: + '@babel/runtime': 7.19.0 + '@babel/runtime-corejs3': 7.19.1 + dev: true + + /array-includes/3.1.5: + resolution: {integrity: sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + get-intrinsic: 1.1.3 + is-string: 1.0.7 + dev: true + /array-union/2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true + /array.prototype.flat/1.3.0: + resolution: {integrity: sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + es-shim-unscopables: 1.0.0 + dev: true + + /array.prototype.flatmap/1.3.0: + resolution: {integrity: sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + es-shim-unscopables: 1.0.0 + dev: true + + /ast-types-flow/0.0.7: + resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==} + dev: true + /astral-regex/2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} @@ -1079,6 +1488,30 @@ packages: engines: {node: '>= 4.0.0'} dev: true + /autoprefixer/10.4.12_postcss@8.4.16: + resolution: {integrity: sha512-WrCGV9/b97Pa+jtwf5UGaRjgQIg7OK3D06GnoYoZNcG1Xb8Gt3EfuKjlhh9i/VtT16g6PYjZ69jdJ2g8FxSC4Q==} + engines: {node: ^10 || ^12 || >=14} + hasBin: true + peerDependencies: + postcss: ^8.1.0 + dependencies: + browserslist: 4.21.4 + caniuse-lite: 1.0.30001409 + fraction.js: 4.2.0 + normalize-range: 0.1.2 + picocolors: 1.0.0 + postcss: 8.4.16 + postcss-value-parser: 4.2.0 + + /axe-core/4.4.3: + resolution: {integrity: sha512-32+ub6kkdhhWick/UjvEwRchgoetXqTK14INLqbGm5U2TzBkBNF3nQtLYm8ovxSkQWArjEQvftCKryjZaATu3w==} + engines: {node: '>=4'} + dev: true + + /axobject-query/2.2.0: + resolution: {integrity: sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==} + dev: true + /babel-jest/29.0.3_@babel+core@7.19.1: resolution: {integrity: sha512-ApPyHSOhS/sVzwUOQIWJmdvDhBsMG01HX9z7ogtkp1TToHGGUWFlnXJUIzCgKPSfiYLn3ibipCYzsKSURHEwLg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1154,6 +1587,14 @@ packages: /balanced-match/1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + /bcryptjs/2.4.3: + resolution: {integrity: sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==} + dev: false + + /binary-extensions/2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + engines: {node: '>=8'} + /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -1165,7 +1606,6 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 - dev: true /browserslist/4.21.4: resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} @@ -1176,7 +1616,6 @@ packages: electron-to-chromium: 1.4.257 node-releases: 2.0.6 update-browserslist-db: 1.0.9_browserslist@4.21.4 - dev: true /bs-logger/0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} @@ -1195,11 +1634,22 @@ packages: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true + /call-bind/1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.1.3 + dev: true + /callsites/3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} dev: true + /camelcase-css/2.0.1: + resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} + engines: {node: '>= 6'} + /camelcase/5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -1212,7 +1662,6 @@ packages: /caniuse-lite/1.0.30001409: resolution: {integrity: sha512-V0mnJ5dwarmhYv8/MzhJ//aW68UpvnQBXv8lJ2QUsvn2pHcmAuNtu8hQEDz37XnA1iE+lRR9CIfGWWpgJ5QedQ==} - dev: true /chalk/2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} @@ -1243,6 +1692,20 @@ packages: '@chevrotain/utils': 9.1.0 regexp-to-ast: 0.5.0 + /chokidar/3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.2 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.2 + /ci-info/3.4.0: resolution: {integrity: sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==} dev: true @@ -1279,7 +1742,6 @@ packages: engines: {node: '>=7.0.0'} dependencies: color-name: 1.1.4 - dev: true /color-name/1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} @@ -1287,7 +1749,21 @@ packages: /color-name/1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: true + + /color-string/1.9.1: + resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} + dependencies: + color-name: 1.1.4 + simple-swizzle: 0.2.2 + dev: false + + /color/4.2.3: + resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} + engines: {node: '>=12.5.0'} + dependencies: + color-convert: 2.0.1 + color-string: 1.9.1 + dev: false /colors/1.4.0: resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} @@ -1328,6 +1804,16 @@ packages: safe-buffer: 5.1.2 dev: true + /cookie/0.4.2: + resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} + engines: {node: '>= 0.6'} + dev: false + + /core-js-pure/3.25.2: + resolution: {integrity: sha512-ItD7YpW1cUB4jaqFLZXe1AXkyqIxz6GqPnsDV4uF4hVcWh/WAGIqSqw5p0/WdsILM0Xht9s3Koyw05R3K6RtiA==} + requiresBuild: true + dev: true + /create-require/1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true @@ -1341,9 +1827,67 @@ packages: which: 2.0.2 dev: true - /date-fns/2.29.3: - resolution: {integrity: sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==} - engines: {node: '>=0.11'} + /css-selector-tokenizer/0.8.0: + resolution: {integrity: sha512-Jd6Ig3/pe62/qe5SBPTN8h8LeUg/pT4lLgtavPf7updwwHpvFzxvOQBHYj2LZDMjUnBzgvIUSjRcf6oT5HzHFg==} + dependencies: + cssesc: 3.0.0 + fastparse: 1.1.2 + dev: false + + /cssesc/3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + + /csstype/3.1.1: + resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} + dev: true + + /daisyui/2.31.0_jhfe3rbur6kzimvcehnoniy6fy: + resolution: {integrity: sha512-qepRXgQPLNcJ8ZPZy+dUvsC7mRWvMLRcVMe85/wZA60Tnhm/bkidhOzdllL8aAk2JX+W/xlIsTJ8NZFpPm+eyw==} + peerDependencies: + autoprefixer: ^10.0.2 + postcss: ^8.1.6 + dependencies: + autoprefixer: 10.4.12_postcss@8.4.16 + color: 4.2.3 + css-selector-tokenizer: 0.8.0 + postcss: 8.4.16 + postcss-js: 4.0.0_postcss@8.4.16 + tailwindcss: 3.1.8_postcss@8.4.16 + transitivePeerDependencies: + - ts-node + dev: false + + /damerau-levenshtein/1.0.8: + resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} + dev: true + + /date-fns/2.29.3: + resolution: {integrity: sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==} + engines: {node: '>=0.11'} + dev: true + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug/3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 dev: true /debug/4.3.4: @@ -1371,11 +1915,34 @@ packages: engines: {node: '>=0.10.0'} dev: true + /define-properties/1.1.4: + resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} + engines: {node: '>= 0.4'} + dependencies: + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: true + + /defined/1.0.0: + resolution: {integrity: sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==} + /detect-newline/3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} dev: true + /detective/5.2.1: + resolution: {integrity: sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==} + engines: {node: '>=0.8.0'} + hasBin: true + dependencies: + acorn-node: 1.8.2 + defined: 1.0.0 + minimist: 1.2.6 + + /didyoumean/1.2.2: + resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} + /diff-sequences/29.0.0: resolution: {integrity: sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1393,6 +1960,16 @@ packages: path-type: 4.0.0 dev: true + /dlv/1.1.3: + resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} + + /doctrine/2.1.0: + resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} + engines: {node: '>=0.10.0'} + dependencies: + esutils: 2.0.3 + dev: true + /doctrine/3.0.0: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} @@ -1402,7 +1979,6 @@ packages: /electron-to-chromium/1.4.257: resolution: {integrity: sha512-C65sIwHqNnPC2ADMfse/jWTtmhZMII+x6ADI9gENzrOiI7BpxmfKFE84WkIEl5wEg+7+SfIkwChDlsd1Erju2A==} - dev: true /emittery/0.10.2: resolution: {integrity: sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==} @@ -1413,6 +1989,10 @@ packages: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true + /emoji-regex/9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: true + /enquirer/2.3.6: resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} engines: {node: '>=8.6'} @@ -1426,10 +2006,54 @@ packages: is-arrayish: 0.2.1 dev: true + /es-abstract/1.20.3: + resolution: {integrity: sha512-AyrnaKVpMzljIdwjzrj+LxGmj8ik2LckwXacHqrJJ/jxz6dDDBcZ7I7nlHM0FvEW8MfbWJwOd+yT2XzYW49Frw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.1.3 + get-symbol-description: 1.0.0 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-symbols: 1.0.3 + internal-slot: 1.0.3 + is-callable: 1.2.6 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-weakref: 1.0.2 + object-inspect: 1.12.2 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + safe-regex-test: 1.0.0 + string.prototype.trimend: 1.0.5 + string.prototype.trimstart: 1.0.5 + unbox-primitive: 1.0.2 + dev: true + + /es-shim-unscopables/1.0.0: + resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} + dependencies: + has: 1.0.3 + dev: true + + /es-to-primitive/1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.6 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} - dev: true /escape-string-regexp/1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} @@ -1446,6 +2070,170 @@ packages: engines: {node: '>=10'} dev: true + /eslint-config-next/12.3.1_dyxdave6dwjbccc5dgiifcmuza: + resolution: {integrity: sha512-EN/xwKPU6jz1G0Qi6Bd/BqMnHLyRAL0VsaQaWA7F3KkjAgZHi4f1uL1JKGWNxdQpHTW/sdGONBd0bzxUka/DJg==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 + typescript: '>=3.3.1' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@next/eslint-plugin-next': 12.3.1 + '@rushstack/eslint-patch': 1.2.0 + '@typescript-eslint/parser': 5.38.0_dyxdave6dwjbccc5dgiifcmuza + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + eslint-import-resolver-typescript: 2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy + eslint-plugin-import: 2.26.0_eslint@7.32.0 + eslint-plugin-jsx-a11y: 6.6.1_eslint@7.32.0 + eslint-plugin-react: 7.31.8_eslint@7.32.0 + eslint-plugin-react-hooks: 4.6.0_eslint@7.32.0 + typescript: 4.8.3 + transitivePeerDependencies: + - eslint-import-resolver-webpack + - supports-color + dev: true + + /eslint-import-resolver-node/0.3.6: + resolution: {integrity: sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==} + dependencies: + debug: 3.2.7 + resolve: 1.22.1 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-import-resolver-typescript/2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy: + resolution: {integrity: sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ==} + engines: {node: '>=4'} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' + dependencies: + debug: 4.3.4 + eslint: 7.32.0 + eslint-plugin-import: 2.26.0_eslint@7.32.0 + glob: 7.2.3 + is-glob: 4.0.3 + resolve: 1.22.1 + tsconfig-paths: 3.14.1 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-module-utils/2.7.4_gw5q3jyuku4zrugqrckhwmprvm: + resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + debug: 3.2.7 + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-import/2.26.0_eslint@7.32.0: + resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + array-includes: 3.1.5 + array.prototype.flat: 1.3.0 + debug: 2.6.9 + doctrine: 2.1.0 + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + eslint-module-utils: 2.7.4_gw5q3jyuku4zrugqrckhwmprvm + has: 1.0.3 + is-core-module: 2.10.0 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.values: 1.1.5 + resolve: 1.22.1 + tsconfig-paths: 3.14.1 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + + /eslint-plugin-jsx-a11y/6.6.1_eslint@7.32.0: + resolution: {integrity: sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q==} + engines: {node: '>=4.0'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + '@babel/runtime': 7.19.0 + aria-query: 4.2.2 + array-includes: 3.1.5 + ast-types-flow: 0.0.7 + axe-core: 4.4.3 + axobject-query: 2.2.0 + damerau-levenshtein: 1.0.8 + emoji-regex: 9.2.2 + eslint: 7.32.0 + has: 1.0.3 + jsx-ast-utils: 3.3.3 + language-tags: 1.0.5 + minimatch: 3.1.2 + semver: 6.3.0 + dev: true + + /eslint-plugin-react-hooks/4.6.0_eslint@7.32.0: + resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + dependencies: + eslint: 7.32.0 + dev: true + + /eslint-plugin-react/7.31.8_eslint@7.32.0: + resolution: {integrity: sha512-5lBTZmgQmARLLSYiwI71tiGVTLUuqXantZM6vlSY39OaDSV0M7+32K5DnLkmFrwTe+Ksz0ffuLUC91RUviVZfw==} + engines: {node: '>=4'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + array-includes: 3.1.5 + array.prototype.flatmap: 1.3.0 + doctrine: 2.1.0 + eslint: 7.32.0 + estraverse: 5.3.0 + jsx-ast-utils: 3.3.3 + minimatch: 3.1.2 + object.entries: 1.1.5 + object.fromentries: 2.0.5 + object.hasown: 1.1.1 + object.values: 1.1.5 + prop-types: 15.8.1 + resolve: 2.0.0-next.4 + semver: 6.3.0 + string.prototype.matchall: 4.0.7 + dev: true + /eslint-scope/5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -1481,6 +2269,11 @@ packages: engines: {node: '>=10'} dev: true + /eslint-visitor-keys/3.3.0: + resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /eslint/7.32.0: resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} engines: {node: ^10.12.0 || >=12.0.0} @@ -1618,7 +2411,6 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - dev: true /fast-json-stable-stringify/2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -1628,11 +2420,14 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true + /fastparse/1.1.2: + resolution: {integrity: sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==} + dev: false + /fastq/1.13.0: resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} dependencies: reusify: 1.0.4 - dev: true /fb-watchman/2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} @@ -1652,7 +2447,6 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - dev: true /find-up/4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} @@ -1674,6 +2468,9 @@ packages: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true + /fraction.js/4.2.0: + resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} + /fs-extra/9.1.0: resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} engines: {node: '>=10'} @@ -1693,17 +2490,29 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true - dev: true optional: true /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + + /function.prototype.name/1.1.5: + resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + functions-have-names: 1.2.3 dev: true /functional-red-black-tree/1.0.1: resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} dev: true + /functions-have-names/1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: true + /gensync/1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -1714,6 +2523,14 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true + /get-intrinsic/1.1.3: + resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.3 + dev: true + /get-package-type/0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} @@ -1724,11 +2541,35 @@ packages: engines: {node: '>=10'} dev: true + /get-symbol-description/1.0.0: + resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + dev: true + /glob-parent/5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 + + /glob-parent/6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + + /glob/7.1.7: + resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 dev: true /glob/7.2.3: @@ -1770,6 +2611,10 @@ packages: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true + /has-bigints/1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: true + /has-flag/3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -1780,12 +2625,29 @@ packages: engines: {node: '>=8'} dev: true + /has-property-descriptors/1.0.0: + resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + dependencies: + get-intrinsic: 1.1.3 + dev: true + + /has-symbols/1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /has-tostringtag/1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + /has/1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true /html-escaper/2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -1839,20 +2701,63 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true + /internal-slot/1.0.3: + resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.1.3 + has: 1.0.3 + side-channel: 1.0.4 + dev: true + /is-arrayish/0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true + /is-arrayish/0.3.2: + resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + dev: false + + /is-bigint/1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: true + + /is-binary-path/2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + dependencies: + binary-extensions: 2.2.0 + + /is-boolean-object/1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-callable/1.2.6: + resolution: {integrity: sha512-krO72EO2NptOGAX2KYyqbP9vYMlNAXdB53rq6f8LXY6RY7JdSR/3BD6wLUlPHSAesmY9vstNrjvqGaCiRK/91Q==} + engines: {node: '>= 0.4'} + dev: true + /is-core-module/2.10.0: resolution: {integrity: sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==} dependencies: has: 1.0.3 + + /is-date-object/1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 dev: true /is-extglob/2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - dev: true /is-fullwidth-code-point/3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} @@ -1869,11 +2774,35 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 + + /is-negative-zero/2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} + engines: {node: '>= 0.4'} + dev: true + + /is-number-object/1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 dev: true /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + + /is-regex/1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-shared-array-buffer/1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.2 dev: true /is-stream/2.0.1: @@ -1881,6 +2810,26 @@ packages: engines: {node: '>=8'} dev: true + /is-string/1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-symbol/1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /is-weakref/1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.2 + dev: true + /isexe/2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true @@ -2339,9 +3288,12 @@ packages: - ts-node dev: true + /jose/4.9.3: + resolution: {integrity: sha512-f8E/z+T3Q0kA9txzH2DKvH/ds2uggcw0m3vVPSB9HrSkrQ7mojjifvS7aR8cw+lQl2Fcmx9npwaHpM/M3GD8UQ==} + dev: false + /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true /js-yaml/3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} @@ -2373,6 +3325,13 @@ packages: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true + /json5/1.0.1: + resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==} + hasBin: true + dependencies: + minimist: 1.2.6 + dev: true + /json5/2.2.1: resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} engines: {node: '>=6'} @@ -2391,6 +3350,14 @@ packages: resolution: {integrity: sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==} dev: true + /jsx-ast-utils/3.3.3: + resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==} + engines: {node: '>=4.0'} + dependencies: + array-includes: 3.1.5 + object.assign: 4.1.4 + dev: true + /kleur/3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} @@ -2418,6 +3385,16 @@ packages: vscode-languageserver-textdocument: 1.0.7 vscode-uri: 3.0.6 + /language-subtag-registry/0.3.22: + resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} + dev: true + + /language-tags/1.0.5: + resolution: {integrity: sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==} + dependencies: + language-subtag-registry: 0.3.22 + dev: true + /leven/3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -2431,6 +3408,10 @@ packages: type-check: 0.4.0 dev: true + /lilconfig/2.0.6: + resolution: {integrity: sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==} + engines: {node: '>=10'} + /lines-and-columns/1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true @@ -2458,6 +3439,12 @@ packages: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true + /loose-envify/1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + dependencies: + js-tokens: 4.0.0 + /lru-cache/6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -2488,7 +3475,6 @@ packages: /merge2/1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - dev: true /micromatch/4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} @@ -2496,7 +3482,6 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 - dev: true /mimic-fn/2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} @@ -2508,26 +3493,109 @@ packages: dependencies: brace-expansion: 1.1.11 + /minimist/1.2.6: + resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==} + + /ms/2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: true + /ms/2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true + /nanoid/3.3.4: + resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + /natural-compare/1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true + /next-auth/4.10.3_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-7zc4aXYc/EEln7Pkcsn21V1IevaTZsMLJwapfbnKA4+JY0+jFzWbt5p/ljugesGIrN4VOZhpZIw50EaFZyghJQ==} + engines: {node: ^12.19.0 || ^14.15.0 || ^16.13.0} + peerDependencies: + nodemailer: ^6.6.5 + react: ^17.0.2 || ^18 + react-dom: ^17.0.2 || ^18 + peerDependenciesMeta: + nodemailer: + optional: true + dependencies: + '@babel/runtime': 7.19.0 + '@panva/hkdf': 1.0.2 + cookie: 0.4.2 + jose: 4.9.3 + oauth: 0.9.15 + openid-client: 5.1.9 + preact: 10.11.0 + preact-render-to-string: 5.2.4_preact@10.11.0 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + uuid: 8.3.2 + dev: false + + /next/12.3.1_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw==} + engines: {node: '>=12.22.0'} + hasBin: true + peerDependencies: + fibers: '>= 3.1.0' + node-sass: ^6.0.0 || ^7.0.0 + react: ^17.0.2 || ^18.0.0-0 + react-dom: ^17.0.2 || ^18.0.0-0 + sass: ^1.3.0 + peerDependenciesMeta: + fibers: + optional: true + node-sass: + optional: true + sass: + optional: true + dependencies: + '@next/env': 12.3.1 + '@swc/helpers': 0.4.11 + caniuse-lite: 1.0.30001409 + postcss: 8.4.14 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + styled-jsx: 5.0.7_react@18.2.0 + use-sync-external-store: 1.2.0_react@18.2.0 + optionalDependencies: + '@next/swc-android-arm-eabi': 12.3.1 + '@next/swc-android-arm64': 12.3.1 + '@next/swc-darwin-arm64': 12.3.1 + '@next/swc-darwin-x64': 12.3.1 + '@next/swc-freebsd-x64': 12.3.1 + '@next/swc-linux-arm-gnueabihf': 12.3.1 + '@next/swc-linux-arm64-gnu': 12.3.1 + '@next/swc-linux-arm64-musl': 12.3.1 + '@next/swc-linux-x64-gnu': 12.3.1 + '@next/swc-linux-x64-musl': 12.3.1 + '@next/swc-win32-arm64-msvc': 12.3.1 + '@next/swc-win32-ia32-msvc': 12.3.1 + '@next/swc-win32-x64-msvc': 12.3.1 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + /node-int64/0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} dev: true /node-releases/2.0.6: resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} - dev: true /normalize-path/3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - dev: true + + /normalize-range/0.1.2: + resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} + engines: {node: '>=0.10.0'} /npm-run-path/4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} @@ -2536,6 +3604,82 @@ packages: path-key: 3.1.1 dev: true + /oauth/0.9.15: + resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} + dev: false + + /object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + + /object-hash/2.2.0: + resolution: {integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==} + engines: {node: '>= 6'} + dev: false + + /object-hash/3.0.0: + resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} + engines: {node: '>= 6'} + + /object-inspect/1.12.2: + resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + dev: true + + /object-keys/1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: true + + /object.assign/4.1.4: + resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /object.entries/1.1.5: + resolution: {integrity: sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + dev: true + + /object.fromentries/2.0.5: + resolution: {integrity: sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + dev: true + + /object.hasown/1.1.1: + resolution: {integrity: sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==} + dependencies: + define-properties: 1.1.4 + es-abstract: 1.20.3 + dev: true + + /object.values/1.1.5: + resolution: {integrity: sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + dev: true + + /oidc-token-hash/5.0.1: + resolution: {integrity: sha512-EvoOtz6FIEBzE+9q253HsLCVRiK/0doEJ2HCvvqMQb3dHZrP3WlJKYtJ55CRTw4jmYomzH4wkPuCj/I3ZvpKxQ==} + engines: {node: ^10.13.0 || >=12.0.0} + dev: false + /once/1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -2549,6 +3693,16 @@ packages: mimic-fn: 2.1.0 dev: true + /openid-client/5.1.9: + resolution: {integrity: sha512-o/11Xos2fRPpK1zQrPfSIhIusFrAkqGSPwkD0UlUB+CCuRzd7zrrBJwIjgnVv3VUSif9ZGXh2d3GSJNH2Koh5g==} + engines: {node: ^12.19.0 || ^14.15.0 || ^16.13.0} + dependencies: + jose: 4.9.3 + lru-cache: 6.0.0 + object-hash: 2.2.0 + oidc-token-hash: 5.0.1 + dev: false + /optionator/0.9.1: resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} engines: {node: '>= 0.8.0'} @@ -2621,7 +3775,6 @@ packages: /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} @@ -2630,12 +3783,14 @@ packages: /picocolors/1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true /picomatch/2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - dev: true + + /pify/2.3.0: + resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} + engines: {node: '>=0.10.0'} /pirates/4.0.5: resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} @@ -2649,6 +3804,91 @@ packages: find-up: 4.1.0 dev: true + /postcss-import/14.1.0_postcss@8.4.16: + resolution: {integrity: sha512-flwI+Vgm4SElObFVPpTIT7SU7R3qk2L7PyduMcokiaVKuWv9d/U+Gm/QAd8NDLuykTWTkcrjOeD2Pp1rMeBTGw==} + engines: {node: '>=10.0.0'} + peerDependencies: + postcss: ^8.0.0 + dependencies: + postcss: 8.4.16 + postcss-value-parser: 4.2.0 + read-cache: 1.0.0 + resolve: 1.22.1 + + /postcss-js/4.0.0_postcss@8.4.16: + resolution: {integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==} + engines: {node: ^12 || ^14 || >= 16} + peerDependencies: + postcss: ^8.3.3 + dependencies: + camelcase-css: 2.0.1 + postcss: 8.4.16 + + /postcss-load-config/3.1.4_postcss@8.4.16: + resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} + engines: {node: '>= 10'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 2.0.6 + postcss: 8.4.16 + yaml: 1.10.2 + + /postcss-nested/5.0.6_postcss@8.4.16: + resolution: {integrity: sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA==} + engines: {node: '>=12.0'} + peerDependencies: + postcss: ^8.2.14 + dependencies: + postcss: 8.4.16 + postcss-selector-parser: 6.0.10 + + /postcss-selector-parser/6.0.10: + resolution: {integrity: sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==} + engines: {node: '>=4'} + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + + /postcss-value-parser/4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + + /postcss/8.4.14: + resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.4 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: false + + /postcss/8.4.16: + resolution: {integrity: sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.4 + picocolors: 1.0.0 + source-map-js: 1.0.2 + + /preact-render-to-string/5.2.4_preact@10.11.0: + resolution: {integrity: sha512-iIPHb3BXUQ3Za6KNhkjN/waq11Oh+QWWtAgN3id3LrL+cszH3DYh8TxJPNQ6Aogsbu4JsqdJLBZltwPFpG6N6w==} + peerDependencies: + preact: '>=10' + dependencies: + preact: 10.11.0 + pretty-format: 3.8.0 + dev: false + + /preact/10.11.0: + resolution: {integrity: sha512-Fk6+vB2kb6mSJfDgODq0YDhMfl0HNtK5+Uc9QqECO4nlyPAQwCI+BKyWO//idA7ikV7o+0Fm6LQmNuQi1wXI1w==} + dev: false + /prelude-ls/1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -2663,6 +3903,18 @@ packages: react-is: 18.2.0 dev: true + /pretty-format/3.8.0: + resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} + dev: false + + /prisma/4.3.1: + resolution: {integrity: sha512-90xo06wtqil76Xsi3mNpc4Js3SdDRR5g4qb9h+4VWY4Y8iImJY6xc3PX+C9xxTSt1lr0Q89A0MLkJjd8ax6KiQ==} + engines: {node: '>=14.17'} + hasBin: true + requiresBuild: true + dependencies: + '@prisma/engines': 4.3.1 + /progress/2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} @@ -2676,6 +3928,14 @@ packages: sisteransi: 1.0.5 dev: true + /prop-types/15.8.1: + resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + dependencies: + loose-envify: 1.4.0 + object-assign: 4.1.1 + react-is: 16.13.1 + dev: true + /punycode/2.1.1: resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} engines: {node: '>=6'} @@ -2683,15 +3943,62 @@ packages: /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + /quick-lru/5.1.1: + resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} + engines: {node: '>=10'} + + /react-dom/18.2.0_react@18.2.0: + resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} + peerDependencies: + react: ^18.2.0 + dependencies: + loose-envify: 1.4.0 + react: 18.2.0 + scheduler: 0.23.0 + dev: false + + /react-is/16.13.1: + resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} dev: true /react-is/18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true + /react/18.2.0: + resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} + engines: {node: '>=0.10.0'} + dependencies: + loose-envify: 1.4.0 + dev: false + + /read-cache/1.0.0: + resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} + dependencies: + pify: 2.3.0 + + /readdirp/3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + dependencies: + picomatch: 2.3.1 + + /regenerator-runtime/0.13.9: + resolution: {integrity: sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==} + /regexp-to-ast/0.5.0: resolution: {integrity: sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==} + /regexp.prototype.flags/1.4.3: + resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + functions-have-names: 1.2.3 + dev: true + /regexpp/3.2.0: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} engines: {node: '>=8'} @@ -2736,12 +4043,19 @@ packages: is-core-module: 2.10.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + + /resolve/2.0.0-next.4: + resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} + hasBin: true + dependencies: + is-core-module: 2.10.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 dev: true /reusify/1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true /rimraf/3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} @@ -2754,7 +4068,6 @@ packages: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - dev: true /rxjs/7.5.6: resolution: {integrity: sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==} @@ -2766,6 +4079,20 @@ packages: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: true + /safe-regex-test/1.0.0: + resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + is-regex: 1.1.4 + dev: true + + /scheduler/0.23.0: + resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} + dependencies: + loose-envify: 1.4.0 + dev: false + /semver/6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true @@ -2794,10 +4121,24 @@ packages: resolution: {integrity: sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==} dev: true + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + object-inspect: 1.12.2 + dev: true + /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true + /simple-swizzle/0.2.2: + resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} + dependencies: + is-arrayish: 0.3.2 + dev: false + /sisteransi/1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} dev: true @@ -2816,6 +4157,10 @@ packages: is-fullwidth-code-point: 3.0.0 dev: true + /source-map-js/1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + /source-map-support/0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} dependencies: @@ -2860,6 +4205,35 @@ packages: strip-ansi: 6.0.1 dev: true + /string.prototype.matchall/4.0.7: + resolution: {integrity: sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + get-intrinsic: 1.1.3 + has-symbols: 1.0.3 + internal-slot: 1.0.3 + regexp.prototype.flags: 1.4.3 + side-channel: 1.0.4 + dev: true + + /string.prototype.trimend/1.0.5: + resolution: {integrity: sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + dev: true + + /string.prototype.trimstart/1.0.5: + resolution: {integrity: sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.3 + dev: true + /strip-ansi/6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -2867,6 +4241,11 @@ packages: ansi-regex: 5.0.1 dev: true + /strip-bom/3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + dev: true + /strip-bom/4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} @@ -2882,6 +4261,22 @@ packages: engines: {node: '>=8'} dev: true + /styled-jsx/5.0.7_react@18.2.0: + resolution: {integrity: sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + react: 18.2.0 + dev: false + /supports-color/5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -2914,7 +4309,14 @@ packages: /supports-preserve-symlinks-flag/1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - dev: true + + /swr/1.3.0_react@18.2.0: + resolution: {integrity: sha512-dkghQrOl2ORX9HYrMDtPa7LTVHJjCTeZoB1dqTbnnEDlSvN8JEKpYIYurDfvbQFUUS8Cg8PceFVZNkW0KNNYPw==} + peerDependencies: + react: ^16.11.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: false /table/6.8.0: resolution: {integrity: sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==} @@ -2927,6 +4329,38 @@ packages: strip-ansi: 6.0.1 dev: true + /tailwindcss/3.1.8_postcss@8.4.16: + resolution: {integrity: sha512-YSneUCZSFDYMwk+TGq8qYFdCA3yfBRdBlS7txSq0LUmzyeqRe3a8fBQzbz9M3WS/iFT4BNf/nmw9mEzrnSaC0g==} + engines: {node: '>=12.13.0'} + hasBin: true + peerDependencies: + postcss: ^8.0.9 + dependencies: + arg: 5.0.2 + chokidar: 3.5.3 + color-name: 1.1.4 + detective: 5.2.1 + didyoumean: 1.2.2 + dlv: 1.1.3 + fast-glob: 3.2.12 + glob-parent: 6.0.2 + is-glob: 4.0.3 + lilconfig: 2.0.6 + normalize-path: 3.0.0 + object-hash: 3.0.0 + picocolors: 1.0.0 + postcss: 8.4.16 + postcss-import: 14.1.0_postcss@8.4.16 + postcss-js: 4.0.0_postcss@8.4.16 + postcss-load-config: 3.1.4_postcss@8.4.16 + postcss-nested: 5.0.6_postcss@8.4.16 + postcss-selector-parser: 6.0.10 + postcss-value-parser: 4.2.0 + quick-lru: 5.1.1 + resolve: 1.22.1 + transitivePeerDependencies: + - ts-node + /terminal-link/2.1.1: resolution: {integrity: sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==} engines: {node: '>=8'} @@ -2962,14 +4396,13 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 - dev: true /tree-kill/1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true dev: true - /ts-jest/29.0.1_jksntdpmkmo5cthob65gehuuvi: + /ts-jest/29.0.1_3v2of4mknskhifwzp4doj5a3fa: resolution: {integrity: sha512-htQOHshgvhn93QLxrmxpiQPk69+M1g7govO1g6kf6GsjCv4uvRV0znVmDrrvjUrVCnTYeY4FBxTYYYD4airyJA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -2990,6 +4423,7 @@ packages: esbuild: optional: true dependencies: + '@babel/core': 7.19.1 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.0.3_johvxhudwcpndp4mle25vwrlq4 @@ -3033,13 +4467,21 @@ packages: yn: 3.1.1 dev: true + /tsconfig-paths/3.14.1: + resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.1 + minimist: 1.2.6 + strip-bom: 3.0.0 + dev: true + /tslib/1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true /tslib/2.4.0: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} - dev: true /tsutils/3.21.0_typescript@4.8.3: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -3079,6 +4521,15 @@ packages: hasBin: true dev: true + /unbox-primitive/1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.2 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: true + /universalify/2.0.0: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} @@ -3093,7 +4544,6 @@ packages: browserslist: 4.21.4 escalade: 3.1.1 picocolors: 1.0.0 - dev: true /uri-js/4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -3101,6 +4551,22 @@ packages: punycode: 2.1.1 dev: true + /use-sync-external-store/1.2.0_react@18.2.0: + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: false + + /util-deprecate/1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + /uuid/8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: false + /uuid/9.0.0: resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==} hasBin: true @@ -3163,6 +4629,16 @@ packages: makeerror: 1.0.12 dev: true + /which-boxed-primitive/1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + /which/2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3197,6 +4673,10 @@ packages: signal-exit: 3.0.7 dev: true + /xtend/4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + /y18n/5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -3205,6 +4685,10 @@ packages: /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + /yaml/1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + /yargs-parser/21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 18ec407ef..51d360569 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ packages: - - 'packages/*' + - 'packages/*' + - 'samples/*' diff --git a/samples/todo/.env b/samples/todo/.env new file mode 100644 index 000000000..23337add5 --- /dev/null +++ b/samples/todo/.env @@ -0,0 +1,5 @@ +NEXTAUTH_URL=http://localhost:3000 +GOOGLE_ID=423589857007-uioobc20f8ek0mend4g7qjck4c5a7f1s.apps.googleusercontent.com +GOOGLE_SECRET=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 +NEXTAUTH_SECRET=abc123 +DATABASE_URL="postgresql://postgres:abc123@localhost:5432/zenstack-todo?schema=public" diff --git a/samples/todo/.eslintrc.json b/samples/todo/.eslintrc.json new file mode 100644 index 000000000..758729586 --- /dev/null +++ b/samples/todo/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["next/core-web-vitals"] +} diff --git a/samples/todo/.gitignore b/samples/todo/.gitignore new file mode 100644 index 000000000..c87c9b392 --- /dev/null +++ b/samples/todo/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/samples/todo/.zenstack/.prisma/index-browser.js b/samples/todo/.zenstack/.prisma/index-browser.js new file mode 100644 index 000000000..efc775d8e --- /dev/null +++ b/samples/todo/.zenstack/.prisma/index-browser.js @@ -0,0 +1,212 @@ + +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + Decimal, + objectEnumValues, + makeStrictEnum +} = require('./runtime/index-browser') + + +const Prisma = {} + +exports.Prisma = Prisma + +/** + * Prisma Client JS version: 4.3.1 + * Query Engine version: c875e43600dfe042452e0b868f7a48b817b9640b + */ +Prisma.prismaVersion = { + client: "4.3.1", + engine: "c875e43600dfe042452e0b868f7a48b817b9640b" +} + +Prisma.PrismaClientKnownRequestError = () => { + throw new Error(`PrismaClientKnownRequestError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)}; +Prisma.PrismaClientUnknownRequestError = () => { + throw new Error(`PrismaClientUnknownRequestError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.PrismaClientRustPanicError = () => { + throw new Error(`PrismaClientRustPanicError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.PrismaClientInitializationError = () => { + throw new Error(`PrismaClientInitializationError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.PrismaClientValidationError = () => { + throw new Error(`PrismaClientValidationError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.NotFoundError = () => { + throw new Error(`NotFoundError is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = () => { + throw new Error(`sqltag is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.empty = () => { + throw new Error(`empty is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.join = () => { + throw new Error(`join is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.raw = () => { + throw new Error(`raw is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, +)} +Prisma.validator = () => (val) => val + +/** + * 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 + */ +// Based on +// https://github.com/microsoft/TypeScript/issues/3192#issuecomment-261720275 +function makeEnum(x) { return x; } + +exports.Prisma.AccountScalarFieldEnum = makeEnum({ + id: 'id', + userId: 'userId', + type: 'type', + provider: 'provider', + providerAccountId: 'providerAccountId', + refresh_token: 'refresh_token', + access_token: 'access_token', + expires_at: 'expires_at', + token_type: 'token_type', + scope: 'scope', + id_token: 'id_token', + session_state: 'session_state' +}); + +exports.Prisma.QueryMode = makeEnum({ + default: 'default', + insensitive: 'insensitive' +}); + +exports.Prisma.SessionScalarFieldEnum = makeEnum({ + id: 'id', + sessionToken: 'sessionToken', + userId: 'userId', + expires: 'expires' +}); + +exports.Prisma.SortOrder = makeEnum({ + asc: 'asc', + desc: 'desc' +}); + +exports.Prisma.SpaceScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + name: 'name', + slug: 'slug' +}); + +exports.Prisma.SpaceUserScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + spaceId: 'spaceId', + userId: 'userId', + role: 'role' +}); + +exports.Prisma.TodoListScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + spaceId: 'spaceId', + ownerId: 'ownerId', + title: 'title', + private: 'private' +}); + +exports.Prisma.TodoScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + ownerId: 'ownerId', + todoListId: 'todoListId', + title: 'title', + completedAt: 'completedAt' +}); + +exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +}); + +exports.Prisma.UserScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + email: 'email', + emailVerified: 'emailVerified', + password: 'password', + name: 'name', + image: 'image' +}); + +exports.Prisma.VerificationTokenScalarFieldEnum = makeEnum({ + identifier: 'identifier', + token: 'token', + expires: 'expires' +}); +exports.SpaceUserRole = makeEnum({ + USER: 'USER', + ADMIN: 'ADMIN' +}); + +exports.Prisma.ModelName = makeEnum({ + Space: 'Space', + SpaceUser: 'SpaceUser', + User: 'User', + Account: 'Account', + Session: 'Session', + VerificationToken: 'VerificationToken', + TodoList: 'TodoList', + Todo: 'Todo' +}); + +/** + * Create the Client + */ +class PrismaClient { + constructor() { + throw new Error( + `PrismaClient is unable to be run in the browser. +In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`, + ) + } +} +exports.PrismaClient = PrismaClient + +Object.assign(exports, Prisma) diff --git a/samples/todo/.zenstack/.prisma/index.d.ts b/samples/todo/.zenstack/.prisma/index.d.ts new file mode 100644 index 000000000..1ac6f4830 --- /dev/null +++ b/samples/todo/.zenstack/.prisma/index.d.ts @@ -0,0 +1,12216 @@ + +/** + * Client +**/ + +import * as runtime from './runtime/index'; +declare const prisma: unique symbol +export type PrismaPromise = Promise & {[prisma]: true} +type UnwrapPromise

= P extends Promise ? R : P +type UnwrapTuple = { + [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise ? X : UnwrapPromise : UnwrapPromise +}; + + +/** + * Model Space + * + */ +export type Space = { + id: string + createdAt: Date + updatedAt: Date + name: string + slug: string +} + +/** + * Model SpaceUser + * + */ +export type SpaceUser = { + id: string + createdAt: Date + updatedAt: Date + spaceId: string + userId: string + role: SpaceUserRole +} + +/** + * Model User + * + */ +export type User = { + id: string + createdAt: Date + updatedAt: Date + email: string + emailVerified: Date | null + password: string + name: string | null + image: string | null +} + +/** + * Model Account + * + */ +export type Account = { + id: string + userId: string + type: string + provider: string + providerAccountId: string + refresh_token: string | null + access_token: string | null + expires_at: number | null + token_type: string | null + scope: string | null + id_token: string | null + session_state: string | null +} + +/** + * Model Session + * + */ +export type Session = { + id: string + sessionToken: string + userId: string + expires: Date +} + +/** + * Model VerificationToken + * + */ +export type VerificationToken = { + identifier: string + token: string + expires: Date +} + +/** + * Model TodoList + * + */ +export type TodoList = { + id: string + createdAt: Date + updatedAt: Date + spaceId: string + ownerId: string + title: string + private: boolean +} + +/** + * Model Todo + * + */ +export type Todo = { + id: string + createdAt: Date + updatedAt: Date + ownerId: string + todoListId: string + title: string + completedAt: Date | null +} + + +/** + * Enums + */ + +// Based on +// https://github.com/microsoft/TypeScript/issues/3192#issuecomment-261720275 + +export const SpaceUserRole: { + USER: 'USER', + ADMIN: 'ADMIN' +}; + +export type SpaceUserRole = (typeof SpaceUserRole)[keyof typeof SpaceUserRole] + + +/** + * ## Prisma Client ʲˢ + * + * Type-safe database client for TypeScript & Node.js + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Spaces + * const spaces = await prisma.space.findMany() + * ``` + * + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export class PrismaClient< + T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + U = 'log' extends keyof T ? T['log'] extends Array ? Prisma.GetEvents : never : never, + GlobalReject extends Prisma.RejectOnNotFound | Prisma.RejectPerOperation | false | undefined = 'rejectOnNotFound' extends keyof T + ? T['rejectOnNotFound'] + : false + > { + /** + * @private + */ + private fetcher; + /** + * @private + */ + private readonly dmmf; + /** + * @private + */ + private connectionPromise?; + /** + * @private + */ + private disconnectionPromise?; + /** + * @private + */ + private readonly engineConfig; + /** + * @private + */ + private readonly measurePerformance; + + /** + * ## Prisma Client ʲˢ + * + * Type-safe database client for TypeScript & Node.js + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Spaces + * const spaces = await prisma.space.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 : V extends 'beforeExit' ? () => Promise : Prisma.LogEvent) => void): void; + + /** + * Connect with the database + */ + $connect(): Promise; + + /** + * Disconnect from the database + */ + $disconnect(): Promise; + + /** + * Add a middleware + */ + $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[]): 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[]): 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[]): 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[]): 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]): Promise>; + + /** + * `prisma.space`: Exposes CRUD operations for the **Space** model. + * Example usage: + * ```ts + * // Fetch zero or more Spaces + * const spaces = await prisma.space.findMany() + * ``` + */ + get space(): Prisma.SpaceDelegate; + + /** + * `prisma.spaceUser`: Exposes CRUD operations for the **SpaceUser** model. + * Example usage: + * ```ts + * // Fetch zero or more SpaceUsers + * const spaceUsers = await prisma.spaceUser.findMany() + * ``` + */ + get spaceUser(): Prisma.SpaceUserDelegate; + + /** + * `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.account`: Exposes CRUD operations for the **Account** model. + * Example usage: + * ```ts + * // Fetch zero or more Accounts + * const accounts = await prisma.account.findMany() + * ``` + */ + get account(): Prisma.AccountDelegate; + + /** + * `prisma.session`: Exposes CRUD operations for the **Session** model. + * Example usage: + * ```ts + * // Fetch zero or more Sessions + * const sessions = await prisma.session.findMany() + * ``` + */ + get session(): Prisma.SessionDelegate; + + /** + * `prisma.verificationToken`: Exposes CRUD operations for the **VerificationToken** model. + * Example usage: + * ```ts + * // Fetch zero or more VerificationTokens + * const verificationTokens = await prisma.verificationToken.findMany() + * ``` + */ + get verificationToken(): Prisma.VerificationTokenDelegate; + + /** + * `prisma.todoList`: Exposes CRUD operations for the **TodoList** model. + * Example usage: + * ```ts + * // Fetch zero or more TodoLists + * const todoLists = await prisma.todoList.findMany() + * ``` + */ + get todoList(): Prisma.TodoListDelegate; + + /** + * `prisma.todo`: Exposes CRUD operations for the **Todo** model. + * Example usage: + * ```ts + * // Fetch zero or more Todos + * const todos = await prisma.todo.findMany() + * ``` + */ + get todo(): Prisma.TodoDelegate; +} + +export namespace Prisma { + export import DMMF = runtime.DMMF + + /** + * Prisma Errors + */ + export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + export import PrismaClientInitializationError = runtime.PrismaClientInitializationError + export import PrismaClientValidationError = runtime.PrismaClientValidationError + export import NotFoundError = runtime.NotFoundError + + /** + * Re-export of sql-template-tag + */ + export import sql = runtime.sqltag + export import empty = runtime.empty + export import join = runtime.join + export import raw = runtime.raw + export import Sql = runtime.Sql + + /** + * Decimal.js + */ + export import Decimal = runtime.Decimal + + export type DecimalJsLike = runtime.DecimalJsLike + + /** + * Metrics + */ + export import Metrics = runtime.Metrics + export import Metric = runtime.Metric + export import MetricHistogram = runtime.MetricHistogram + export import MetricHistogramBucket = runtime.MetricHistogramBucket + + /** + * Prisma Client JS version: 4.3.1 + * Query Engine version: c875e43600dfe042452e0b868f7a48b817b9640b + */ + export type PrismaVersion = { + client: string + } + + export const prismaVersion: PrismaVersion + + /** + * Utility Types + */ + + /** + * From https://github.com/sindresorhus/type-fest/ + * Matches a JSON object. + * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. + */ + export type JsonObject = {[Key in string]?: JsonValue} + + /** + * From https://github.com/sindresorhus/type-fest/ + * Matches a JSON array. + */ + export interface JsonArray extends Array {} + + /** + * From https://github.com/sindresorhus/type-fest/ + * Matches any valid JSON value. + */ + export type JsonValue = string | number | boolean | JsonObject | JsonArray | null + + /** + * Matches a JSON object. + * Unlike `JsonObject`, this type allows undefined and read-only properties. + */ + export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null} + + /** + * Matches a JSON array. + * Unlike `JsonArray`, readonly arrays are assignable to this type. + */ + export interface InputJsonArray extends ReadonlyArray {} + + /** + * Matches any valid value that can be used as an input for operations like + * create and update as the value of a JSON field. Unlike `JsonValue`, this + * type allows read-only arrays and read-only object properties and disallows + * `null` at the top level. + * + * `null` cannot be used as the value of a JSON field because its meaning + * would be ambiguous. Use `Prisma.JsonNull` to store the JSON null value or + * `Prisma.DbNull` to clear the JSON value and set the field to the database + * NULL value instead. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values + */ + export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray + + /** + * 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 HasSelect = { + select: any + } + type HasInclude = { + include: any + } + type CheckSelect = T extends SelectAndInclude + ? 'Please either choose `select` or `include`' + : T extends HasSelect + ? U + : T extends HasInclude + ? U + : S + + /** + * 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 Promise> = 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 = { + [key in keyof T]: T[key] extends false | undefined | null ? never : key + }[keyof T] + + export type TrueKeys = TruthyKeys>> + + /** + * Subset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection + */ + export type Subset = { + [key in keyof T]: key extends keyof U ? T[key] : never; + }; + + /** + * SelectSubset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. + * Additionally, it validates, if both select and include are present. If the case, it errors. + */ + export type SelectSubset = { + [key in keyof T]: key extends keyof U ? T[key] : never + } & + (T extends SelectAndInclude + ? 'Please either choose `select` or `include`.' + : {}) + + /** + * Subset + Intersection + * @desc From `T` pick properties that exist in `U` and intersect `K` + */ + export type SubsetIntersection = { + [key in keyof T]: key extends keyof U ? T[key] : never + } & + K + + type Without = { [P in Exclude]?: never }; + + /** + * XOR is needed to have a real mutually exclusive union type + * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types + */ + type XOR = + T extends object ? + U extends object ? + (Without & U) | (Without & T) + : U : T + + + /** + * Is T a Record? + */ + type IsObject = T extends Array + ? False + : T extends Date + ? False + : T extends Uint8Array + ? False + : T extends BigInt + ? False + : T extends object + ? True + : False + + + /** + * If it's T[], return T + */ + export type UnEnumerate = T extends Array ? U : T + + /** + * From ts-toolbelt + */ + + type __Either = Omit & + { + // Merge all but K + [P in K]: Prisma__Pick // With K possibilities + }[K] + + type EitherStrict = Strict<__Either> + + type EitherLoose = ComputeRaw<__Either> + + type _Either< + O extends object, + K extends Key, + strict extends Boolean + > = { + 1: EitherStrict + 0: EitherLoose + }[strict] + + type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 + > = O extends unknown ? _Either : never + + export type Union = any + + type PatchUndefined = { + [K in keyof O]: O[K] extends undefined ? At : O[K] + } & {} + + /** Helper Types for "Merge" **/ + export type IntersectOf = ( + U extends unknown ? (k: U) => void : never + ) extends (k: infer I) => void + ? I + : never + + export type Overwrite = { + [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; + } & {}; + + type _Merge = IntersectOf; + }>>; + + type Key = string | number | symbol; + type AtBasic = K extends keyof O ? O[K] : never; + type AtStrict = O[K & keyof O]; + type AtLoose = O extends unknown ? AtStrict : never; + export type At = { + 1: AtStrict; + 0: AtLoose; + }[strict]; + + export type ComputeRaw = A extends Function ? A : { + [K in keyof A]: A[K]; + } & {}; + + export type OptionalFlat = { + [K in keyof O]?: O[K]; + } & {}; + + type _Record = { + [P in K]: T; + }; + + 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 Exact = + W extends unknown ? A extends Narrowable ? Cast : Cast< + {[K in keyof A]: K extends keyof W ? Exact : never}, + {[K in keyof W]: K extends keyof A ? Exact : W[K]}> + : never; + + type Narrowable = string | number | boolean | bigint; + + type Cast = A extends B ? A : B; + + export const type: unique symbol; + + export function validator(): (select: Exact) => S; + + /** + * 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 with an array + */ + type PickArray> = Prisma__Pick> + + /** + * Exclude all keys with underscores + */ + type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + + export import FieldRef = runtime.FieldRef + + type FieldRefInputType = Model extends never ? never : FieldRef + + class PrismaClientFetcher { + private readonly prisma; + private readonly debug; + private readonly hooks?; + constructor(prisma: PrismaClient, debug?: boolean, hooks?: Hooks | undefined); + request(document: any, dataPath?: string[], rootField?: string, typeName?: string, isList?: boolean, callsite?: string): Promise; + sanitizeMessage(message: string): string; + protected unpack(document: any, data: any, path: string[], rootField?: string, isList?: boolean): any; + } + + export const ModelName: { + Space: 'Space', + SpaceUser: 'SpaceUser', + User: 'User', + Account: 'Account', + Session: 'Session', + VerificationToken: 'VerificationToken', + TodoList: 'TodoList', + Todo: 'Todo' + }; + + export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + export type Datasources = { + db?: Datasource + } + + export type RejectOnNotFound = boolean | ((error: Error) => Error) + export type RejectPerModel = { [P in ModelName]?: RejectOnNotFound } + export type RejectPerOperation = { [P in "findUnique" | "findFirst"]?: RejectPerModel | RejectOnNotFound } + type IsReject = T extends true ? True : T extends (err: Error) => Error ? True : False + export type HasReject< + GlobalRejectSettings extends Prisma.PrismaClientOptions['rejectOnNotFound'], + LocalRejectSettings, + Action extends PrismaAction, + Model extends ModelName + > = LocalRejectSettings extends RejectOnNotFound + ? IsReject + : GlobalRejectSettings extends RejectPerOperation + ? Action extends keyof GlobalRejectSettings + ? GlobalRejectSettings[Action] extends RejectOnNotFound + ? IsReject + : GlobalRejectSettings[Action] extends RejectPerModel + ? Model extends keyof GlobalRejectSettings[Action] + ? IsReject + : False + : False + : False + : IsReject + export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' + + export interface PrismaClientOptions { + /** + * Configure findUnique/findFirst to throw an error if the query returns null. + * @deprecated since 4.0.0. Use `findUniqueOrThrow`/`findFirstOrThrow` methods instead. + * @example + * ``` + * // Reject on both findUnique/findFirst + * rejectOnNotFound: true + * // Reject only on findFirst with a custom error + * rejectOnNotFound: { findFirst: (err) => new Error("Custom Error")} + * // Reject on user.findUnique with a custom error + * rejectOnNotFound: { findUnique: {User: (err) => new Error("User not found")}} + * ``` + */ + rejectOnNotFound?: RejectOnNotFound | RejectPerOperation + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources + + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + + /** + * @example + * ``` + * // Defaults to stdout + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events + * log: [ + * { emit: 'stdout', level: 'query' }, + * { emit: 'stdout', level: 'info' }, + * { emit: 'stdout', level: 'warn' } + * { emit: 'stdout', level: 'error' } + * ] + * ``` + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). + */ + log?: Array + } + + export type Hooks = { + beforeRequest?: (options: { query: string, path: string[], rootField?: string, typeName?: string, document: any }) => any + } + + /* 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' + | 'findMany' + | 'findFirst' + | 'create' + | 'createMany' + | 'update' + | 'updateMany' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + + /** + * These options are being passed in to 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) => Promise, + ) => Promise + + // tested in getLogLevel.test.ts + export function getLogLevel(log: Array): LogLevel | undefined; + + export type Datasource = { + url?: string + } + + /** + * Count Types + */ + + + /** + * Count Type SpaceCountOutputType + */ + + + export type SpaceCountOutputType = { + members: number + todoLists: number + } + + export type SpaceCountOutputTypeSelect = { + members?: boolean + todoLists?: boolean + } + + export type SpaceCountOutputTypeGetPayload< + S extends boolean | null | undefined | SpaceCountOutputTypeArgs, + U = keyof S + > = S extends true + ? SpaceCountOutputType + : S extends undefined + ? never + : S extends SpaceCountOutputTypeArgs + ?'include' extends U + ? SpaceCountOutputType + : 'select' extends U + ? { + [P in TrueKeys]: + P extends keyof SpaceCountOutputType ? SpaceCountOutputType[P] : never + } + : SpaceCountOutputType + : SpaceCountOutputType + + + + + // Custom InputTypes + + /** + * SpaceCountOutputType without action + */ + export type SpaceCountOutputTypeArgs = { + /** + * Select specific fields to fetch from the SpaceCountOutputType + * + **/ + select?: SpaceCountOutputTypeSelect | null + } + + + + /** + * Count Type UserCountOutputType + */ + + + export type UserCountOutputType = { + accounts: number + sessions: number + todoList: number + spaces: number + Todo: number + } + + export type UserCountOutputTypeSelect = { + accounts?: boolean + sessions?: boolean + todoList?: boolean + spaces?: boolean + Todo?: boolean + } + + export type UserCountOutputTypeGetPayload< + S extends boolean | null | undefined | UserCountOutputTypeArgs, + U = keyof S + > = S extends true + ? UserCountOutputType + : S extends undefined + ? never + : S extends UserCountOutputTypeArgs + ?'include' extends U + ? UserCountOutputType + : 'select' extends U + ? { + [P in TrueKeys]: + P extends keyof UserCountOutputType ? UserCountOutputType[P] : never + } + : UserCountOutputType + : UserCountOutputType + + + + + // Custom InputTypes + + /** + * UserCountOutputType without action + */ + export type UserCountOutputTypeArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + * + **/ + select?: UserCountOutputTypeSelect | null + } + + + + /** + * Count Type TodoListCountOutputType + */ + + + export type TodoListCountOutputType = { + todos: number + } + + export type TodoListCountOutputTypeSelect = { + todos?: boolean + } + + export type TodoListCountOutputTypeGetPayload< + S extends boolean | null | undefined | TodoListCountOutputTypeArgs, + U = keyof S + > = S extends true + ? TodoListCountOutputType + : S extends undefined + ? never + : S extends TodoListCountOutputTypeArgs + ?'include' extends U + ? TodoListCountOutputType + : 'select' extends U + ? { + [P in TrueKeys]: + P extends keyof TodoListCountOutputType ? TodoListCountOutputType[P] : never + } + : TodoListCountOutputType + : TodoListCountOutputType + + + + + // Custom InputTypes + + /** + * TodoListCountOutputType without action + */ + export type TodoListCountOutputTypeArgs = { + /** + * Select specific fields to fetch from the TodoListCountOutputType + * + **/ + select?: TodoListCountOutputTypeSelect | null + } + + + + /** + * Models + */ + + /** + * Model Space + */ + + + export type AggregateSpace = { + _count: SpaceCountAggregateOutputType | null + _min: SpaceMinAggregateOutputType | null + _max: SpaceMaxAggregateOutputType | null + } + + export type SpaceMinAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + name: string | null + slug: string | null + } + + export type SpaceMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + name: string | null + slug: string | null + } + + export type SpaceCountAggregateOutputType = { + id: number + createdAt: number + updatedAt: number + name: number + slug: number + _all: number + } + + + export type SpaceMinAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + name?: true + slug?: true + } + + export type SpaceMaxAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + name?: true + slug?: true + } + + export type SpaceCountAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + name?: true + slug?: true + _all?: true + } + + export type SpaceAggregateArgs = { + /** + * Filter which Space to aggregate. + * + **/ + where?: SpaceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Spaces to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + * + **/ + cursor?: SpaceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Spaces 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` Spaces. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Spaces + **/ + _count?: true | SpaceCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SpaceMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SpaceMaxAggregateInputType + } + + export type GetSpaceAggregateType = { + [P in keyof T & keyof AggregateSpace]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type SpaceGroupByArgs = { + where?: SpaceWhereInput + orderBy?: Enumerable + by: Array + having?: SpaceScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SpaceCountAggregateInputType | true + _min?: SpaceMinAggregateInputType + _max?: SpaceMaxAggregateInputType + } + + + export type SpaceGroupByOutputType = { + id: string + createdAt: Date + updatedAt: Date + name: string + slug: string + _count: SpaceCountAggregateOutputType | null + _min: SpaceMinAggregateOutputType | null + _max: SpaceMaxAggregateOutputType | null + } + + type GetSpaceGroupByPayload = PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof SpaceGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type SpaceSelect = { + id?: boolean + createdAt?: boolean + updatedAt?: boolean + name?: boolean + slug?: boolean + members?: boolean | SpaceUserFindManyArgs + todoLists?: boolean | TodoListFindManyArgs + _count?: boolean | SpaceCountOutputTypeArgs + } + + export type SpaceInclude = { + members?: boolean | SpaceUserFindManyArgs + todoLists?: boolean | TodoListFindManyArgs + _count?: boolean | SpaceCountOutputTypeArgs + } + + export type SpaceGetPayload< + S extends boolean | null | undefined | SpaceArgs, + U = keyof S + > = S extends true + ? Space + : S extends undefined + ? never + : S extends SpaceArgs | SpaceFindManyArgs + ?'include' extends U + ? Space & { + [P in TrueKeys]: + P extends 'members' ? Array < SpaceUserGetPayload[P]>> : + P extends 'todoLists' ? Array < TodoListGetPayload[P]>> : + P extends '_count' ? SpaceCountOutputTypeGetPayload[P]> : never + } + : 'select' extends U + ? { + [P in TrueKeys]: + P extends 'members' ? Array < SpaceUserGetPayload[P]>> : + P extends 'todoLists' ? Array < TodoListGetPayload[P]>> : + P extends '_count' ? SpaceCountOutputTypeGetPayload[P]> : P extends keyof Space ? Space[P] : never + } + : Space + : Space + + + type SpaceCountArgs = Merge< + Omit & { + select?: SpaceCountAggregateInputType | true + } + > + + export interface SpaceDelegate { + /** + * Find zero or one Space that matches the filter. + * @param {SpaceFindUniqueArgs} args - Arguments to find a Space + * @example + * // Get one Space + * const space = await prisma.space.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__SpaceClient>> : CheckSelect, Prisma__SpaceClient | null >> + + /** + * Find the first Space 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 {SpaceFindFirstArgs} args - Arguments to find a Space + * @example + * // Get one Space + * const space = await prisma.space.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__SpaceClient>> : CheckSelect, Prisma__SpaceClient | null >> + + /** + * Find zero or more Spaces 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 {SpaceFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Spaces + * const spaces = await prisma.space.findMany() + * + * // Get first 10 Spaces + * const spaces = await prisma.space.findMany({ take: 10 }) + * + * // Only select the `id` + * const spaceWithIdOnly = await prisma.space.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): CheckSelect>, PrismaPromise>>> + + /** + * Create a Space. + * @param {SpaceCreateArgs} args - Arguments to create a Space. + * @example + * // Create one Space + * const Space = await prisma.space.create({ + * data: { + * // ... data to create a Space + * } + * }) + * + **/ + create( + args: SelectSubset + ): CheckSelect, Prisma__SpaceClient>> + + /** + * Create many Spaces. + * @param {SpaceCreateManyArgs} args - Arguments to create many Spaces. + * @example + * // Create many Spaces + * const space = await prisma.space.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Delete a Space. + * @param {SpaceDeleteArgs} args - Arguments to delete one Space. + * @example + * // Delete one Space + * const Space = await prisma.space.delete({ + * where: { + * // ... filter to delete one Space + * } + * }) + * + **/ + delete( + args: SelectSubset + ): CheckSelect, Prisma__SpaceClient>> + + /** + * Update one Space. + * @param {SpaceUpdateArgs} args - Arguments to update one Space. + * @example + * // Update one Space + * const space = await prisma.space.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): CheckSelect, Prisma__SpaceClient>> + + /** + * Delete zero or more Spaces. + * @param {SpaceDeleteManyArgs} args - Arguments to filter Spaces to delete. + * @example + * // Delete a few Spaces + * const { count } = await prisma.space.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Update zero or more Spaces. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SpaceUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Spaces + * const space = await prisma.space.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): PrismaPromise + + /** + * Create or update one Space. + * @param {SpaceUpsertArgs} args - Arguments to update or create a Space. + * @example + * // Update or create a Space + * const space = await prisma.space.upsert({ + * create: { + * // ... data to create a Space + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Space we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): CheckSelect, Prisma__SpaceClient>> + + /** + * Find one Space that matches the filter or throw + * `NotFoundError` if no matches were found. + * @param {SpaceFindUniqueOrThrowArgs} args - Arguments to find a Space + * @example + * // Get one Space + * const space = await prisma.space.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__SpaceClient>> + + /** + * Find the first Space that matches the filter or + * throw `NotFoundError` 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 {SpaceFindFirstOrThrowArgs} args - Arguments to find a Space + * @example + * // Get one Space + * const space = await prisma.space.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__SpaceClient>> + + /** + * Count the number of Spaces. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SpaceCountArgs} args - Arguments to filter Spaces to count. + * @example + * // Count the number of Spaces + * const count = await prisma.space.count({ + * where: { + * // ... the filter for the Spaces we want to count + * } + * }) + **/ + count( + args?: Subset, + ): PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Space. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SpaceAggregateArgs} 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): PrismaPromise> + + /** + * Group by Space. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SpaceGroupByArgs} 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 SpaceGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: SpaceGroupByArgs['orderBy'] } + : { orderBy?: SpaceGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + 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 ? GetSpaceGroupByPayload : PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Space. + * 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 class Prisma__SpaceClient implements PrismaPromise { + [prisma]: true; + private readonly _dmmf; + private readonly _fetcher; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + constructor(_dmmf: runtime.DMMFClass, _fetcher: PrismaClientFetcher, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + readonly [Symbol.toStringTag]: 'PrismaClientPromise'; + + members(args?: Subset): CheckSelect>, PrismaPromise>>>; + + todoLists(args?: Subset): CheckSelect>, PrismaPromise>>>; + + private get _document(); + /** + * 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): Promise; + /** + * 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): Promise; + /** + * 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): Promise; + } + + + + // Custom InputTypes + + /** + * Space base type for findUnique actions + */ + export type SpaceFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Space + * + **/ + select?: SpaceSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceInclude | null + /** + * Filter, which Space to fetch. + * + **/ + where: SpaceWhereUniqueInput + } + + /** + * Space: findUnique + */ + export interface SpaceFindUniqueArgs extends SpaceFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Space base type for findFirst actions + */ + export type SpaceFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Space + * + **/ + select?: SpaceSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceInclude | null + /** + * Filter, which Space to fetch. + * + **/ + where?: SpaceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Spaces to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Spaces. + * + **/ + cursor?: SpaceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Spaces 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` Spaces. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Spaces. + * + **/ + distinct?: Enumerable + } + + /** + * Space: findFirst + */ + export interface SpaceFindFirstArgs extends SpaceFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Space findMany + */ + export type SpaceFindManyArgs = { + /** + * Select specific fields to fetch from the Space + * + **/ + select?: SpaceSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceInclude | null + /** + * Filter, which Spaces to fetch. + * + **/ + where?: SpaceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Spaces to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Spaces. + * + **/ + cursor?: SpaceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Spaces 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` Spaces. + * + **/ + skip?: number + distinct?: Enumerable + } + + + /** + * Space create + */ + export type SpaceCreateArgs = { + /** + * Select specific fields to fetch from the Space + * + **/ + select?: SpaceSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceInclude | null + /** + * The data needed to create a Space. + * + **/ + data: XOR + } + + + /** + * Space createMany + */ + export type SpaceCreateManyArgs = { + /** + * The data used to create many Spaces. + * + **/ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Space update + */ + export type SpaceUpdateArgs = { + /** + * Select specific fields to fetch from the Space + * + **/ + select?: SpaceSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceInclude | null + /** + * The data needed to update a Space. + * + **/ + data: XOR + /** + * Choose, which Space to update. + * + **/ + where: SpaceWhereUniqueInput + } + + + /** + * Space updateMany + */ + export type SpaceUpdateManyArgs = { + /** + * The data used to update Spaces. + * + **/ + data: XOR + /** + * Filter which Spaces to update + * + **/ + where?: SpaceWhereInput + } + + + /** + * Space upsert + */ + export type SpaceUpsertArgs = { + /** + * Select specific fields to fetch from the Space + * + **/ + select?: SpaceSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceInclude | null + /** + * The filter to search for the Space to update in case it exists. + * + **/ + where: SpaceWhereUniqueInput + /** + * In case the Space found by the `where` argument doesn't exist, create a new Space with this data. + * + **/ + create: XOR + /** + * In case the Space was found with the provided `where` argument, update it with this data. + * + **/ + update: XOR + } + + + /** + * Space delete + */ + export type SpaceDeleteArgs = { + /** + * Select specific fields to fetch from the Space + * + **/ + select?: SpaceSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceInclude | null + /** + * Filter which Space to delete. + * + **/ + where: SpaceWhereUniqueInput + } + + + /** + * Space deleteMany + */ + export type SpaceDeleteManyArgs = { + /** + * Filter which Spaces to delete + * + **/ + where?: SpaceWhereInput + } + + + /** + * Space: findUniqueOrThrow + */ + export type SpaceFindUniqueOrThrowArgs = SpaceFindUniqueArgsBase + + + /** + * Space: findFirstOrThrow + */ + export type SpaceFindFirstOrThrowArgs = SpaceFindFirstArgsBase + + + /** + * Space without action + */ + export type SpaceArgs = { + /** + * Select specific fields to fetch from the Space + * + **/ + select?: SpaceSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceInclude | null + } + + + + /** + * Model SpaceUser + */ + + + export type AggregateSpaceUser = { + _count: SpaceUserCountAggregateOutputType | null + _min: SpaceUserMinAggregateOutputType | null + _max: SpaceUserMaxAggregateOutputType | null + } + + export type SpaceUserMinAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + spaceId: string | null + userId: string | null + role: SpaceUserRole | null + } + + export type SpaceUserMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + spaceId: string | null + userId: string | null + role: SpaceUserRole | null + } + + export type SpaceUserCountAggregateOutputType = { + id: number + createdAt: number + updatedAt: number + spaceId: number + userId: number + role: number + _all: number + } + + + export type SpaceUserMinAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + spaceId?: true + userId?: true + role?: true + } + + export type SpaceUserMaxAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + spaceId?: true + userId?: true + role?: true + } + + export type SpaceUserCountAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + spaceId?: true + userId?: true + role?: true + _all?: true + } + + export type SpaceUserAggregateArgs = { + /** + * Filter which SpaceUser to aggregate. + * + **/ + where?: SpaceUserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SpaceUsers to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + * + **/ + cursor?: SpaceUserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SpaceUsers 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` SpaceUsers. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned SpaceUsers + **/ + _count?: true | SpaceUserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SpaceUserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SpaceUserMaxAggregateInputType + } + + export type GetSpaceUserAggregateType = { + [P in keyof T & keyof AggregateSpaceUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type SpaceUserGroupByArgs = { + where?: SpaceUserWhereInput + orderBy?: Enumerable + by: Array + having?: SpaceUserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SpaceUserCountAggregateInputType | true + _min?: SpaceUserMinAggregateInputType + _max?: SpaceUserMaxAggregateInputType + } + + + export type SpaceUserGroupByOutputType = { + id: string + createdAt: Date + updatedAt: Date + spaceId: string + userId: string + role: SpaceUserRole + _count: SpaceUserCountAggregateOutputType | null + _min: SpaceUserMinAggregateOutputType | null + _max: SpaceUserMaxAggregateOutputType | null + } + + type GetSpaceUserGroupByPayload = PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof SpaceUserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type SpaceUserSelect = { + id?: boolean + createdAt?: boolean + updatedAt?: boolean + spaceId?: boolean + space?: boolean | SpaceArgs + userId?: boolean + user?: boolean | UserArgs + role?: boolean + } + + export type SpaceUserInclude = { + space?: boolean | SpaceArgs + user?: boolean | UserArgs + } + + export type SpaceUserGetPayload< + S extends boolean | null | undefined | SpaceUserArgs, + U = keyof S + > = S extends true + ? SpaceUser + : S extends undefined + ? never + : S extends SpaceUserArgs | SpaceUserFindManyArgs + ?'include' extends U + ? SpaceUser & { + [P in TrueKeys]: + P extends 'space' ? SpaceGetPayload[P]> : + P extends 'user' ? UserGetPayload[P]> : never + } + : 'select' extends U + ? { + [P in TrueKeys]: + P extends 'space' ? SpaceGetPayload[P]> : + P extends 'user' ? UserGetPayload[P]> : P extends keyof SpaceUser ? SpaceUser[P] : never + } + : SpaceUser + : SpaceUser + + + type SpaceUserCountArgs = Merge< + Omit & { + select?: SpaceUserCountAggregateInputType | true + } + > + + export interface SpaceUserDelegate { + /** + * Find zero or one SpaceUser that matches the filter. + * @param {SpaceUserFindUniqueArgs} args - Arguments to find a SpaceUser + * @example + * // Get one SpaceUser + * const spaceUser = await prisma.spaceUser.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__SpaceUserClient>> : CheckSelect, Prisma__SpaceUserClient | null >> + + /** + * Find the first SpaceUser 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 {SpaceUserFindFirstArgs} args - Arguments to find a SpaceUser + * @example + * // Get one SpaceUser + * const spaceUser = await prisma.spaceUser.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__SpaceUserClient>> : CheckSelect, Prisma__SpaceUserClient | null >> + + /** + * Find zero or more SpaceUsers 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 {SpaceUserFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all SpaceUsers + * const spaceUsers = await prisma.spaceUser.findMany() + * + * // Get first 10 SpaceUsers + * const spaceUsers = await prisma.spaceUser.findMany({ take: 10 }) + * + * // Only select the `id` + * const spaceUserWithIdOnly = await prisma.spaceUser.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): CheckSelect>, PrismaPromise>>> + + /** + * Create a SpaceUser. + * @param {SpaceUserCreateArgs} args - Arguments to create a SpaceUser. + * @example + * // Create one SpaceUser + * const SpaceUser = await prisma.spaceUser.create({ + * data: { + * // ... data to create a SpaceUser + * } + * }) + * + **/ + create( + args: SelectSubset + ): CheckSelect, Prisma__SpaceUserClient>> + + /** + * Create many SpaceUsers. + * @param {SpaceUserCreateManyArgs} args - Arguments to create many SpaceUsers. + * @example + * // Create many SpaceUsers + * const spaceUser = await prisma.spaceUser.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Delete a SpaceUser. + * @param {SpaceUserDeleteArgs} args - Arguments to delete one SpaceUser. + * @example + * // Delete one SpaceUser + * const SpaceUser = await prisma.spaceUser.delete({ + * where: { + * // ... filter to delete one SpaceUser + * } + * }) + * + **/ + delete( + args: SelectSubset + ): CheckSelect, Prisma__SpaceUserClient>> + + /** + * Update one SpaceUser. + * @param {SpaceUserUpdateArgs} args - Arguments to update one SpaceUser. + * @example + * // Update one SpaceUser + * const spaceUser = await prisma.spaceUser.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): CheckSelect, Prisma__SpaceUserClient>> + + /** + * Delete zero or more SpaceUsers. + * @param {SpaceUserDeleteManyArgs} args - Arguments to filter SpaceUsers to delete. + * @example + * // Delete a few SpaceUsers + * const { count } = await prisma.spaceUser.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Update zero or more SpaceUsers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SpaceUserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many SpaceUsers + * const spaceUser = await prisma.spaceUser.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): PrismaPromise + + /** + * Create or update one SpaceUser. + * @param {SpaceUserUpsertArgs} args - Arguments to update or create a SpaceUser. + * @example + * // Update or create a SpaceUser + * const spaceUser = await prisma.spaceUser.upsert({ + * create: { + * // ... data to create a SpaceUser + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the SpaceUser we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): CheckSelect, Prisma__SpaceUserClient>> + + /** + * Find one SpaceUser that matches the filter or throw + * `NotFoundError` if no matches were found. + * @param {SpaceUserFindUniqueOrThrowArgs} args - Arguments to find a SpaceUser + * @example + * // Get one SpaceUser + * const spaceUser = await prisma.spaceUser.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__SpaceUserClient>> + + /** + * Find the first SpaceUser that matches the filter or + * throw `NotFoundError` 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 {SpaceUserFindFirstOrThrowArgs} args - Arguments to find a SpaceUser + * @example + * // Get one SpaceUser + * const spaceUser = await prisma.spaceUser.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__SpaceUserClient>> + + /** + * Count the number of SpaceUsers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SpaceUserCountArgs} args - Arguments to filter SpaceUsers to count. + * @example + * // Count the number of SpaceUsers + * const count = await prisma.spaceUser.count({ + * where: { + * // ... the filter for the SpaceUsers we want to count + * } + * }) + **/ + count( + args?: Subset, + ): PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a SpaceUser. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SpaceUserAggregateArgs} 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): PrismaPromise> + + /** + * Group by SpaceUser. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SpaceUserGroupByArgs} 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 SpaceUserGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: SpaceUserGroupByArgs['orderBy'] } + : { orderBy?: SpaceUserGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + 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 ? GetSpaceUserGroupByPayload : PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for SpaceUser. + * 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 class Prisma__SpaceUserClient implements PrismaPromise { + [prisma]: true; + private readonly _dmmf; + private readonly _fetcher; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + constructor(_dmmf: runtime.DMMFClass, _fetcher: PrismaClientFetcher, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + readonly [Symbol.toStringTag]: 'PrismaClientPromise'; + + space(args?: Subset): CheckSelect, Prisma__SpaceClient | null >>; + + user(args?: Subset): CheckSelect, Prisma__UserClient | null >>; + + private get _document(); + /** + * 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): Promise; + /** + * 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): Promise; + /** + * 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): Promise; + } + + + + // Custom InputTypes + + /** + * SpaceUser base type for findUnique actions + */ + export type SpaceUserFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the SpaceUser + * + **/ + select?: SpaceUserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceUserInclude | null + /** + * Filter, which SpaceUser to fetch. + * + **/ + where: SpaceUserWhereUniqueInput + } + + /** + * SpaceUser: findUnique + */ + export interface SpaceUserFindUniqueArgs extends SpaceUserFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * SpaceUser base type for findFirst actions + */ + export type SpaceUserFindFirstArgsBase = { + /** + * Select specific fields to fetch from the SpaceUser + * + **/ + select?: SpaceUserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceUserInclude | null + /** + * Filter, which SpaceUser to fetch. + * + **/ + where?: SpaceUserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SpaceUsers to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SpaceUsers. + * + **/ + cursor?: SpaceUserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SpaceUsers 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` SpaceUsers. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SpaceUsers. + * + **/ + distinct?: Enumerable + } + + /** + * SpaceUser: findFirst + */ + export interface SpaceUserFindFirstArgs extends SpaceUserFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * SpaceUser findMany + */ + export type SpaceUserFindManyArgs = { + /** + * Select specific fields to fetch from the SpaceUser + * + **/ + select?: SpaceUserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceUserInclude | null + /** + * Filter, which SpaceUsers to fetch. + * + **/ + where?: SpaceUserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SpaceUsers to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing SpaceUsers. + * + **/ + cursor?: SpaceUserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SpaceUsers 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` SpaceUsers. + * + **/ + skip?: number + distinct?: Enumerable + } + + + /** + * SpaceUser create + */ + export type SpaceUserCreateArgs = { + /** + * Select specific fields to fetch from the SpaceUser + * + **/ + select?: SpaceUserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceUserInclude | null + /** + * The data needed to create a SpaceUser. + * + **/ + data: XOR + } + + + /** + * SpaceUser createMany + */ + export type SpaceUserCreateManyArgs = { + /** + * The data used to create many SpaceUsers. + * + **/ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * SpaceUser update + */ + export type SpaceUserUpdateArgs = { + /** + * Select specific fields to fetch from the SpaceUser + * + **/ + select?: SpaceUserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceUserInclude | null + /** + * The data needed to update a SpaceUser. + * + **/ + data: XOR + /** + * Choose, which SpaceUser to update. + * + **/ + where: SpaceUserWhereUniqueInput + } + + + /** + * SpaceUser updateMany + */ + export type SpaceUserUpdateManyArgs = { + /** + * The data used to update SpaceUsers. + * + **/ + data: XOR + /** + * Filter which SpaceUsers to update + * + **/ + where?: SpaceUserWhereInput + } + + + /** + * SpaceUser upsert + */ + export type SpaceUserUpsertArgs = { + /** + * Select specific fields to fetch from the SpaceUser + * + **/ + select?: SpaceUserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceUserInclude | null + /** + * The filter to search for the SpaceUser to update in case it exists. + * + **/ + where: SpaceUserWhereUniqueInput + /** + * In case the SpaceUser found by the `where` argument doesn't exist, create a new SpaceUser with this data. + * + **/ + create: XOR + /** + * In case the SpaceUser was found with the provided `where` argument, update it with this data. + * + **/ + update: XOR + } + + + /** + * SpaceUser delete + */ + export type SpaceUserDeleteArgs = { + /** + * Select specific fields to fetch from the SpaceUser + * + **/ + select?: SpaceUserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceUserInclude | null + /** + * Filter which SpaceUser to delete. + * + **/ + where: SpaceUserWhereUniqueInput + } + + + /** + * SpaceUser deleteMany + */ + export type SpaceUserDeleteManyArgs = { + /** + * Filter which SpaceUsers to delete + * + **/ + where?: SpaceUserWhereInput + } + + + /** + * SpaceUser: findUniqueOrThrow + */ + export type SpaceUserFindUniqueOrThrowArgs = SpaceUserFindUniqueArgsBase + + + /** + * SpaceUser: findFirstOrThrow + */ + export type SpaceUserFindFirstOrThrowArgs = SpaceUserFindFirstArgsBase + + + /** + * SpaceUser without action + */ + export type SpaceUserArgs = { + /** + * Select specific fields to fetch from the SpaceUser + * + **/ + select?: SpaceUserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SpaceUserInclude | null + } + + + + /** + * Model User + */ + + + export type AggregateUser = { + _count: UserCountAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null + } + + export type UserMinAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + email: string | null + emailVerified: Date | null + password: string | null + name: string | null + image: string | null + } + + export type UserMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + email: string | null + emailVerified: Date | null + password: string | null + name: string | null + image: string | null + } + + export type UserCountAggregateOutputType = { + id: number + createdAt: number + updatedAt: number + email: number + emailVerified: number + password: number + name: number + image: number + _all: number + } + + + export type UserMinAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + email?: true + emailVerified?: true + password?: true + name?: true + image?: true + } + + export type UserMaxAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + email?: true + emailVerified?: true + password?: true + name?: true + image?: true + } + + export type UserCountAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + email?: true + emailVerified?: true + password?: true + name?: true + image?: 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?: Enumerable + /** + * {@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 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?: Enumerable + by: Array + having?: UserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserCountAggregateInputType | true + _min?: UserMinAggregateInputType + _max?: UserMaxAggregateInputType + } + + + export type UserGroupByOutputType = { + id: string + createdAt: Date + updatedAt: Date + email: string + emailVerified: Date | null + password: string + name: string | null + image: string | null + _count: UserCountAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null + } + + type GetUserGroupByPayload = PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type UserSelect = { + id?: boolean + createdAt?: boolean + updatedAt?: boolean + email?: boolean + emailVerified?: boolean + password?: boolean + accounts?: boolean | AccountFindManyArgs + sessions?: boolean | SessionFindManyArgs + name?: boolean + todoList?: boolean | TodoListFindManyArgs + spaces?: boolean | SpaceUserFindManyArgs + image?: boolean + Todo?: boolean | TodoFindManyArgs + _count?: boolean | UserCountOutputTypeArgs + } + + export type UserInclude = { + accounts?: boolean | AccountFindManyArgs + sessions?: boolean | SessionFindManyArgs + todoList?: boolean | TodoListFindManyArgs + spaces?: boolean | SpaceUserFindManyArgs + Todo?: boolean | TodoFindManyArgs + _count?: boolean | UserCountOutputTypeArgs + } + + export type UserGetPayload< + S extends boolean | null | undefined | UserArgs, + U = keyof S + > = S extends true + ? User + : S extends undefined + ? never + : S extends UserArgs | UserFindManyArgs + ?'include' extends U + ? User & { + [P in TrueKeys]: + P extends 'accounts' ? Array < AccountGetPayload[P]>> : + P extends 'sessions' ? Array < SessionGetPayload[P]>> : + P extends 'todoList' ? Array < TodoListGetPayload[P]>> : + P extends 'spaces' ? Array < SpaceUserGetPayload[P]>> : + P extends 'Todo' ? Array < TodoGetPayload[P]>> : + P extends '_count' ? UserCountOutputTypeGetPayload[P]> : never + } + : 'select' extends U + ? { + [P in TrueKeys]: + P extends 'accounts' ? Array < AccountGetPayload[P]>> : + P extends 'sessions' ? Array < SessionGetPayload[P]>> : + P extends 'todoList' ? Array < TodoListGetPayload[P]>> : + P extends 'spaces' ? Array < SpaceUserGetPayload[P]>> : + P extends 'Todo' ? Array < TodoGetPayload[P]>> : + P extends '_count' ? UserCountOutputTypeGetPayload[P]> : P extends keyof User ? User[P] : never + } + : User + : User + + + type UserCountArgs = Merge< + Omit & { + select?: UserCountAggregateInputType | true + } + > + + export interface UserDelegate { + /** + * 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 + ): HasReject extends True ? CheckSelect, Prisma__UserClient>> : CheckSelect, Prisma__UserClient | null >> + + /** + * 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 + ): HasReject extends True ? CheckSelect, Prisma__UserClient>> : CheckSelect, Prisma__UserClient | null >> + + /** + * 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 `id` + * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): CheckSelect>, PrismaPromise>>> + + /** + * 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 + ): CheckSelect, Prisma__UserClient>> + + /** + * 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 + ): PrismaPromise + + /** + * 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 + ): CheckSelect, Prisma__UserClient>> + + /** + * 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 + ): CheckSelect, Prisma__UserClient>> + + /** + * 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 + ): 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 + ): PrismaPromise + + /** + * 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 + ): CheckSelect, Prisma__UserClient>> + + /** + * Find one User that matches the filter or throw + * `NotFoundError` 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 + ): CheckSelect, Prisma__UserClient>> + + /** + * Find the first User that matches the filter or + * throw `NotFoundError` 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 + ): CheckSelect, Prisma__UserClient>> + + /** + * 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, + ): PrismaPromise< + T extends _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): 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 TupleToUnion, + 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 : PrismaPromise + + } + + /** + * 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 class Prisma__UserClient implements PrismaPromise { + [prisma]: true; + private readonly _dmmf; + private readonly _fetcher; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + constructor(_dmmf: runtime.DMMFClass, _fetcher: PrismaClientFetcher, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + readonly [Symbol.toStringTag]: 'PrismaClientPromise'; + + accounts(args?: Subset): CheckSelect>, PrismaPromise>>>; + + sessions(args?: Subset): CheckSelect>, PrismaPromise>>>; + + todoList(args?: Subset): CheckSelect>, PrismaPromise>>>; + + spaces(args?: Subset): CheckSelect>, PrismaPromise>>>; + + Todo(args?: Subset): CheckSelect>, PrismaPromise>>>; + + private get _document(); + /** + * 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): Promise; + /** + * 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): Promise; + /** + * 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): Promise; + } + + + + // Custom InputTypes + + /** + * User base type for findUnique actions + */ + export type UserFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the User + * + **/ + select?: UserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: UserInclude | null + /** + * Filter, which User to fetch. + * + **/ + where: UserWhereUniqueInput + } + + /** + * User: findUnique + */ + export interface UserFindUniqueArgs extends UserFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * User base type for findFirst actions + */ + export type UserFindFirstArgsBase = { + /** + * Select specific fields to fetch from the User + * + **/ + select?: UserSelect | 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?: Enumerable + /** + * {@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?: Enumerable + } + + /** + * User: findFirst + */ + export interface UserFindFirstArgs extends UserFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * User findMany + */ + export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + * + **/ + select?: UserSelect | 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?: Enumerable + /** + * {@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?: Enumerable + } + + + /** + * User create + */ + export type UserCreateArgs = { + /** + * Select specific fields to fetch from the User + * + **/ + select?: UserSelect | 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: Enumerable + skipDuplicates?: boolean + } + + + /** + * User update + */ + export type UserUpdateArgs = { + /** + * Select specific fields to fetch from the User + * + **/ + select?: UserSelect | 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 + } + + + /** + * User upsert + */ + export type UserUpsertArgs = { + /** + * Select specific fields to fetch from the User + * + **/ + select?: UserSelect | 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 + /** + * 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 + } + + + /** + * User: findUniqueOrThrow + */ + export type UserFindUniqueOrThrowArgs = UserFindUniqueArgsBase + + + /** + * User: findFirstOrThrow + */ + export type UserFindFirstOrThrowArgs = UserFindFirstArgsBase + + + /** + * User without action + */ + export type UserArgs = { + /** + * Select specific fields to fetch from the User + * + **/ + select?: UserSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: UserInclude | null + } + + + + /** + * Model Account + */ + + + export type AggregateAccount = { + _count: AccountCountAggregateOutputType | null + _avg: AccountAvgAggregateOutputType | null + _sum: AccountSumAggregateOutputType | null + _min: AccountMinAggregateOutputType | null + _max: AccountMaxAggregateOutputType | null + } + + export type AccountAvgAggregateOutputType = { + expires_at: number | null + } + + export type AccountSumAggregateOutputType = { + expires_at: number | null + } + + export type AccountMinAggregateOutputType = { + id: string | null + userId: string | null + type: string | null + provider: string | null + providerAccountId: string | null + refresh_token: string | null + access_token: string | null + expires_at: number | null + token_type: string | null + scope: string | null + id_token: string | null + session_state: string | null + } + + export type AccountMaxAggregateOutputType = { + id: string | null + userId: string | null + type: string | null + provider: string | null + providerAccountId: string | null + refresh_token: string | null + access_token: string | null + expires_at: number | null + token_type: string | null + scope: string | null + id_token: string | null + session_state: string | null + } + + export type AccountCountAggregateOutputType = { + id: number + userId: number + type: number + provider: number + providerAccountId: number + refresh_token: number + access_token: number + expires_at: number + token_type: number + scope: number + id_token: number + session_state: number + _all: number + } + + + export type AccountAvgAggregateInputType = { + expires_at?: true + } + + export type AccountSumAggregateInputType = { + expires_at?: true + } + + export type AccountMinAggregateInputType = { + id?: true + userId?: true + type?: true + provider?: true + providerAccountId?: true + refresh_token?: true + access_token?: true + expires_at?: true + token_type?: true + scope?: true + id_token?: true + session_state?: true + } + + export type AccountMaxAggregateInputType = { + id?: true + userId?: true + type?: true + provider?: true + providerAccountId?: true + refresh_token?: true + access_token?: true + expires_at?: true + token_type?: true + scope?: true + id_token?: true + session_state?: true + } + + export type AccountCountAggregateInputType = { + id?: true + userId?: true + type?: true + provider?: true + providerAccountId?: true + refresh_token?: true + access_token?: true + expires_at?: true + token_type?: true + scope?: true + id_token?: true + session_state?: true + _all?: true + } + + export type AccountAggregateArgs = { + /** + * Filter which Account to aggregate. + * + **/ + where?: AccountWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Accounts to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + * + **/ + cursor?: AccountWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Accounts 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` Accounts. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Accounts + **/ + _count?: true | AccountCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: AccountAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: AccountSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: AccountMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: AccountMaxAggregateInputType + } + + export type GetAccountAggregateType = { + [P in keyof T & keyof AggregateAccount]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type AccountGroupByArgs = { + where?: AccountWhereInput + orderBy?: Enumerable + by: Array + having?: AccountScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: AccountCountAggregateInputType | true + _avg?: AccountAvgAggregateInputType + _sum?: AccountSumAggregateInputType + _min?: AccountMinAggregateInputType + _max?: AccountMaxAggregateInputType + } + + + export type AccountGroupByOutputType = { + id: string + userId: string + type: string + provider: string + providerAccountId: string + refresh_token: string | null + access_token: string | null + expires_at: number | null + token_type: string | null + scope: string | null + id_token: string | null + session_state: string | null + _count: AccountCountAggregateOutputType | null + _avg: AccountAvgAggregateOutputType | null + _sum: AccountSumAggregateOutputType | null + _min: AccountMinAggregateOutputType | null + _max: AccountMaxAggregateOutputType | null + } + + type GetAccountGroupByPayload = PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof AccountGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type AccountSelect = { + id?: boolean + userId?: boolean + type?: boolean + provider?: boolean + providerAccountId?: boolean + refresh_token?: boolean + access_token?: boolean + expires_at?: boolean + token_type?: boolean + scope?: boolean + id_token?: boolean + session_state?: boolean + user?: boolean | UserArgs + } + + export type AccountInclude = { + user?: boolean | UserArgs + } + + export type AccountGetPayload< + S extends boolean | null | undefined | AccountArgs, + U = keyof S + > = S extends true + ? Account + : S extends undefined + ? never + : S extends AccountArgs | AccountFindManyArgs + ?'include' extends U + ? Account & { + [P in TrueKeys]: + P extends 'user' ? UserGetPayload[P]> : never + } + : 'select' extends U + ? { + [P in TrueKeys]: + P extends 'user' ? UserGetPayload[P]> : P extends keyof Account ? Account[P] : never + } + : Account + : Account + + + type AccountCountArgs = Merge< + Omit & { + select?: AccountCountAggregateInputType | true + } + > + + export interface AccountDelegate { + /** + * Find zero or one Account that matches the filter. + * @param {AccountFindUniqueArgs} args - Arguments to find a Account + * @example + * // Get one Account + * const account = await prisma.account.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__AccountClient>> : CheckSelect, Prisma__AccountClient | null >> + + /** + * Find the first Account 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 {AccountFindFirstArgs} args - Arguments to find a Account + * @example + * // Get one Account + * const account = await prisma.account.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__AccountClient>> : CheckSelect, Prisma__AccountClient | null >> + + /** + * Find zero or more Accounts 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 {AccountFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Accounts + * const accounts = await prisma.account.findMany() + * + * // Get first 10 Accounts + * const accounts = await prisma.account.findMany({ take: 10 }) + * + * // Only select the `id` + * const accountWithIdOnly = await prisma.account.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): CheckSelect>, PrismaPromise>>> + + /** + * Create a Account. + * @param {AccountCreateArgs} args - Arguments to create a Account. + * @example + * // Create one Account + * const Account = await prisma.account.create({ + * data: { + * // ... data to create a Account + * } + * }) + * + **/ + create( + args: SelectSubset + ): CheckSelect, Prisma__AccountClient>> + + /** + * Create many Accounts. + * @param {AccountCreateManyArgs} args - Arguments to create many Accounts. + * @example + * // Create many Accounts + * const account = await prisma.account.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Delete a Account. + * @param {AccountDeleteArgs} args - Arguments to delete one Account. + * @example + * // Delete one Account + * const Account = await prisma.account.delete({ + * where: { + * // ... filter to delete one Account + * } + * }) + * + **/ + delete( + args: SelectSubset + ): CheckSelect, Prisma__AccountClient>> + + /** + * Update one Account. + * @param {AccountUpdateArgs} args - Arguments to update one Account. + * @example + * // Update one Account + * const account = await prisma.account.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): CheckSelect, Prisma__AccountClient>> + + /** + * Delete zero or more Accounts. + * @param {AccountDeleteManyArgs} args - Arguments to filter Accounts to delete. + * @example + * // Delete a few Accounts + * const { count } = await prisma.account.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Update zero or more Accounts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Accounts + * const account = await prisma.account.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): PrismaPromise + + /** + * Create or update one Account. + * @param {AccountUpsertArgs} args - Arguments to update or create a Account. + * @example + * // Update or create a Account + * const account = await prisma.account.upsert({ + * create: { + * // ... data to create a Account + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Account we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): CheckSelect, Prisma__AccountClient>> + + /** + * Find one Account that matches the filter or throw + * `NotFoundError` if no matches were found. + * @param {AccountFindUniqueOrThrowArgs} args - Arguments to find a Account + * @example + * // Get one Account + * const account = await prisma.account.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__AccountClient>> + + /** + * Find the first Account that matches the filter or + * throw `NotFoundError` 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 {AccountFindFirstOrThrowArgs} args - Arguments to find a Account + * @example + * // Get one Account + * const account = await prisma.account.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__AccountClient>> + + /** + * Count the number of Accounts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountCountArgs} args - Arguments to filter Accounts to count. + * @example + * // Count the number of Accounts + * const count = await prisma.account.count({ + * where: { + * // ... the filter for the Accounts we want to count + * } + * }) + **/ + count( + args?: Subset, + ): PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Account. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountAggregateArgs} 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): PrismaPromise> + + /** + * Group by Account. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountGroupByArgs} 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 AccountGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: AccountGroupByArgs['orderBy'] } + : { orderBy?: AccountGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + 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 ? GetAccountGroupByPayload : PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Account. + * 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 class Prisma__AccountClient implements PrismaPromise { + [prisma]: true; + private readonly _dmmf; + private readonly _fetcher; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + constructor(_dmmf: runtime.DMMFClass, _fetcher: PrismaClientFetcher, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + readonly [Symbol.toStringTag]: 'PrismaClientPromise'; + + user(args?: Subset): CheckSelect, Prisma__UserClient | null >>; + + private get _document(); + /** + * 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): Promise; + /** + * 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): Promise; + /** + * 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): Promise; + } + + + + // Custom InputTypes + + /** + * Account base type for findUnique actions + */ + export type AccountFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Account + * + **/ + select?: AccountSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: AccountInclude | null + /** + * Filter, which Account to fetch. + * + **/ + where: AccountWhereUniqueInput + } + + /** + * Account: findUnique + */ + export interface AccountFindUniqueArgs extends AccountFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Account base type for findFirst actions + */ + export type AccountFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Account + * + **/ + select?: AccountSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: AccountInclude | null + /** + * Filter, which Account to fetch. + * + **/ + where?: AccountWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Accounts to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Accounts. + * + **/ + cursor?: AccountWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Accounts 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` Accounts. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Accounts. + * + **/ + distinct?: Enumerable + } + + /** + * Account: findFirst + */ + export interface AccountFindFirstArgs extends AccountFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Account findMany + */ + export type AccountFindManyArgs = { + /** + * Select specific fields to fetch from the Account + * + **/ + select?: AccountSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: AccountInclude | null + /** + * Filter, which Accounts to fetch. + * + **/ + where?: AccountWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Accounts to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Accounts. + * + **/ + cursor?: AccountWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Accounts 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` Accounts. + * + **/ + skip?: number + distinct?: Enumerable + } + + + /** + * Account create + */ + export type AccountCreateArgs = { + /** + * Select specific fields to fetch from the Account + * + **/ + select?: AccountSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: AccountInclude | null + /** + * The data needed to create a Account. + * + **/ + data: XOR + } + + + /** + * Account createMany + */ + export type AccountCreateManyArgs = { + /** + * The data used to create many Accounts. + * + **/ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Account update + */ + export type AccountUpdateArgs = { + /** + * Select specific fields to fetch from the Account + * + **/ + select?: AccountSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: AccountInclude | null + /** + * The data needed to update a Account. + * + **/ + data: XOR + /** + * Choose, which Account to update. + * + **/ + where: AccountWhereUniqueInput + } + + + /** + * Account updateMany + */ + export type AccountUpdateManyArgs = { + /** + * The data used to update Accounts. + * + **/ + data: XOR + /** + * Filter which Accounts to update + * + **/ + where?: AccountWhereInput + } + + + /** + * Account upsert + */ + export type AccountUpsertArgs = { + /** + * Select specific fields to fetch from the Account + * + **/ + select?: AccountSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: AccountInclude | null + /** + * The filter to search for the Account to update in case it exists. + * + **/ + where: AccountWhereUniqueInput + /** + * In case the Account found by the `where` argument doesn't exist, create a new Account with this data. + * + **/ + create: XOR + /** + * In case the Account was found with the provided `where` argument, update it with this data. + * + **/ + update: XOR + } + + + /** + * Account delete + */ + export type AccountDeleteArgs = { + /** + * Select specific fields to fetch from the Account + * + **/ + select?: AccountSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: AccountInclude | null + /** + * Filter which Account to delete. + * + **/ + where: AccountWhereUniqueInput + } + + + /** + * Account deleteMany + */ + export type AccountDeleteManyArgs = { + /** + * Filter which Accounts to delete + * + **/ + where?: AccountWhereInput + } + + + /** + * Account: findUniqueOrThrow + */ + export type AccountFindUniqueOrThrowArgs = AccountFindUniqueArgsBase + + + /** + * Account: findFirstOrThrow + */ + export type AccountFindFirstOrThrowArgs = AccountFindFirstArgsBase + + + /** + * Account without action + */ + export type AccountArgs = { + /** + * Select specific fields to fetch from the Account + * + **/ + select?: AccountSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: AccountInclude | null + } + + + + /** + * Model Session + */ + + + export type AggregateSession = { + _count: SessionCountAggregateOutputType | null + _min: SessionMinAggregateOutputType | null + _max: SessionMaxAggregateOutputType | null + } + + export type SessionMinAggregateOutputType = { + id: string | null + sessionToken: string | null + userId: string | null + expires: Date | null + } + + export type SessionMaxAggregateOutputType = { + id: string | null + sessionToken: string | null + userId: string | null + expires: Date | null + } + + export type SessionCountAggregateOutputType = { + id: number + sessionToken: number + userId: number + expires: number + _all: number + } + + + export type SessionMinAggregateInputType = { + id?: true + sessionToken?: true + userId?: true + expires?: true + } + + export type SessionMaxAggregateInputType = { + id?: true + sessionToken?: true + userId?: true + expires?: true + } + + export type SessionCountAggregateInputType = { + id?: true + sessionToken?: true + userId?: true + expires?: true + _all?: true + } + + export type SessionAggregateArgs = { + /** + * Filter which Session to aggregate. + * + **/ + where?: SessionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Sessions to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + * + **/ + cursor?: SessionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Sessions 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` Sessions. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Sessions + **/ + _count?: true | SessionCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SessionMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SessionMaxAggregateInputType + } + + export type GetSessionAggregateType = { + [P in keyof T & keyof AggregateSession]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type SessionGroupByArgs = { + where?: SessionWhereInput + orderBy?: Enumerable + by: Array + having?: SessionScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SessionCountAggregateInputType | true + _min?: SessionMinAggregateInputType + _max?: SessionMaxAggregateInputType + } + + + export type SessionGroupByOutputType = { + id: string + sessionToken: string + userId: string + expires: Date + _count: SessionCountAggregateOutputType | null + _min: SessionMinAggregateOutputType | null + _max: SessionMaxAggregateOutputType | null + } + + type GetSessionGroupByPayload = PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof SessionGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type SessionSelect = { + id?: boolean + sessionToken?: boolean + userId?: boolean + expires?: boolean + user?: boolean | UserArgs + } + + export type SessionInclude = { + user?: boolean | UserArgs + } + + export type SessionGetPayload< + S extends boolean | null | undefined | SessionArgs, + U = keyof S + > = S extends true + ? Session + : S extends undefined + ? never + : S extends SessionArgs | SessionFindManyArgs + ?'include' extends U + ? Session & { + [P in TrueKeys]: + P extends 'user' ? UserGetPayload[P]> : never + } + : 'select' extends U + ? { + [P in TrueKeys]: + P extends 'user' ? UserGetPayload[P]> : P extends keyof Session ? Session[P] : never + } + : Session + : Session + + + type SessionCountArgs = Merge< + Omit & { + select?: SessionCountAggregateInputType | true + } + > + + export interface SessionDelegate { + /** + * Find zero or one Session that matches the filter. + * @param {SessionFindUniqueArgs} args - Arguments to find a Session + * @example + * // Get one Session + * const session = await prisma.session.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__SessionClient>> : CheckSelect, Prisma__SessionClient | null >> + + /** + * Find the first Session 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 {SessionFindFirstArgs} args - Arguments to find a Session + * @example + * // Get one Session + * const session = await prisma.session.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__SessionClient>> : CheckSelect, Prisma__SessionClient | null >> + + /** + * Find zero or more Sessions 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 {SessionFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Sessions + * const sessions = await prisma.session.findMany() + * + * // Get first 10 Sessions + * const sessions = await prisma.session.findMany({ take: 10 }) + * + * // Only select the `id` + * const sessionWithIdOnly = await prisma.session.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): CheckSelect>, PrismaPromise>>> + + /** + * Create a Session. + * @param {SessionCreateArgs} args - Arguments to create a Session. + * @example + * // Create one Session + * const Session = await prisma.session.create({ + * data: { + * // ... data to create a Session + * } + * }) + * + **/ + create( + args: SelectSubset + ): CheckSelect, Prisma__SessionClient>> + + /** + * Create many Sessions. + * @param {SessionCreateManyArgs} args - Arguments to create many Sessions. + * @example + * // Create many Sessions + * const session = await prisma.session.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Delete a Session. + * @param {SessionDeleteArgs} args - Arguments to delete one Session. + * @example + * // Delete one Session + * const Session = await prisma.session.delete({ + * where: { + * // ... filter to delete one Session + * } + * }) + * + **/ + delete( + args: SelectSubset + ): CheckSelect, Prisma__SessionClient>> + + /** + * Update one Session. + * @param {SessionUpdateArgs} args - Arguments to update one Session. + * @example + * // Update one Session + * const session = await prisma.session.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): CheckSelect, Prisma__SessionClient>> + + /** + * Delete zero or more Sessions. + * @param {SessionDeleteManyArgs} args - Arguments to filter Sessions to delete. + * @example + * // Delete a few Sessions + * const { count } = await prisma.session.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Update zero or more Sessions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SessionUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Sessions + * const session = await prisma.session.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): PrismaPromise + + /** + * Create or update one Session. + * @param {SessionUpsertArgs} args - Arguments to update or create a Session. + * @example + * // Update or create a Session + * const session = await prisma.session.upsert({ + * create: { + * // ... data to create a Session + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Session we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): CheckSelect, Prisma__SessionClient>> + + /** + * Find one Session that matches the filter or throw + * `NotFoundError` if no matches were found. + * @param {SessionFindUniqueOrThrowArgs} args - Arguments to find a Session + * @example + * // Get one Session + * const session = await prisma.session.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__SessionClient>> + + /** + * Find the first Session that matches the filter or + * throw `NotFoundError` 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 {SessionFindFirstOrThrowArgs} args - Arguments to find a Session + * @example + * // Get one Session + * const session = await prisma.session.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__SessionClient>> + + /** + * Count the number of Sessions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SessionCountArgs} args - Arguments to filter Sessions to count. + * @example + * // Count the number of Sessions + * const count = await prisma.session.count({ + * where: { + * // ... the filter for the Sessions we want to count + * } + * }) + **/ + count( + args?: Subset, + ): PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Session. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SessionAggregateArgs} 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): PrismaPromise> + + /** + * Group by Session. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SessionGroupByArgs} 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 SessionGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: SessionGroupByArgs['orderBy'] } + : { orderBy?: SessionGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + 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 ? GetSessionGroupByPayload : PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Session. + * 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 class Prisma__SessionClient implements PrismaPromise { + [prisma]: true; + private readonly _dmmf; + private readonly _fetcher; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + constructor(_dmmf: runtime.DMMFClass, _fetcher: PrismaClientFetcher, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + readonly [Symbol.toStringTag]: 'PrismaClientPromise'; + + user(args?: Subset): CheckSelect, Prisma__UserClient | null >>; + + private get _document(); + /** + * 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): Promise; + /** + * 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): Promise; + /** + * 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): Promise; + } + + + + // Custom InputTypes + + /** + * Session base type for findUnique actions + */ + export type SessionFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Session + * + **/ + select?: SessionSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SessionInclude | null + /** + * Filter, which Session to fetch. + * + **/ + where: SessionWhereUniqueInput + } + + /** + * Session: findUnique + */ + export interface SessionFindUniqueArgs extends SessionFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Session base type for findFirst actions + */ + export type SessionFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Session + * + **/ + select?: SessionSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SessionInclude | null + /** + * Filter, which Session to fetch. + * + **/ + where?: SessionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Sessions to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Sessions. + * + **/ + cursor?: SessionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Sessions 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` Sessions. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Sessions. + * + **/ + distinct?: Enumerable + } + + /** + * Session: findFirst + */ + export interface SessionFindFirstArgs extends SessionFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Session findMany + */ + export type SessionFindManyArgs = { + /** + * Select specific fields to fetch from the Session + * + **/ + select?: SessionSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SessionInclude | null + /** + * Filter, which Sessions to fetch. + * + **/ + where?: SessionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Sessions to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Sessions. + * + **/ + cursor?: SessionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Sessions 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` Sessions. + * + **/ + skip?: number + distinct?: Enumerable + } + + + /** + * Session create + */ + export type SessionCreateArgs = { + /** + * Select specific fields to fetch from the Session + * + **/ + select?: SessionSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SessionInclude | null + /** + * The data needed to create a Session. + * + **/ + data: XOR + } + + + /** + * Session createMany + */ + export type SessionCreateManyArgs = { + /** + * The data used to create many Sessions. + * + **/ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Session update + */ + export type SessionUpdateArgs = { + /** + * Select specific fields to fetch from the Session + * + **/ + select?: SessionSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SessionInclude | null + /** + * The data needed to update a Session. + * + **/ + data: XOR + /** + * Choose, which Session to update. + * + **/ + where: SessionWhereUniqueInput + } + + + /** + * Session updateMany + */ + export type SessionUpdateManyArgs = { + /** + * The data used to update Sessions. + * + **/ + data: XOR + /** + * Filter which Sessions to update + * + **/ + where?: SessionWhereInput + } + + + /** + * Session upsert + */ + export type SessionUpsertArgs = { + /** + * Select specific fields to fetch from the Session + * + **/ + select?: SessionSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SessionInclude | null + /** + * The filter to search for the Session to update in case it exists. + * + **/ + where: SessionWhereUniqueInput + /** + * In case the Session found by the `where` argument doesn't exist, create a new Session with this data. + * + **/ + create: XOR + /** + * In case the Session was found with the provided `where` argument, update it with this data. + * + **/ + update: XOR + } + + + /** + * Session delete + */ + export type SessionDeleteArgs = { + /** + * Select specific fields to fetch from the Session + * + **/ + select?: SessionSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SessionInclude | null + /** + * Filter which Session to delete. + * + **/ + where: SessionWhereUniqueInput + } + + + /** + * Session deleteMany + */ + export type SessionDeleteManyArgs = { + /** + * Filter which Sessions to delete + * + **/ + where?: SessionWhereInput + } + + + /** + * Session: findUniqueOrThrow + */ + export type SessionFindUniqueOrThrowArgs = SessionFindUniqueArgsBase + + + /** + * Session: findFirstOrThrow + */ + export type SessionFindFirstOrThrowArgs = SessionFindFirstArgsBase + + + /** + * Session without action + */ + export type SessionArgs = { + /** + * Select specific fields to fetch from the Session + * + **/ + select?: SessionSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: SessionInclude | null + } + + + + /** + * Model VerificationToken + */ + + + export type AggregateVerificationToken = { + _count: VerificationTokenCountAggregateOutputType | null + _min: VerificationTokenMinAggregateOutputType | null + _max: VerificationTokenMaxAggregateOutputType | null + } + + export type VerificationTokenMinAggregateOutputType = { + identifier: string | null + token: string | null + expires: Date | null + } + + export type VerificationTokenMaxAggregateOutputType = { + identifier: string | null + token: string | null + expires: Date | null + } + + export type VerificationTokenCountAggregateOutputType = { + identifier: number + token: number + expires: number + _all: number + } + + + export type VerificationTokenMinAggregateInputType = { + identifier?: true + token?: true + expires?: true + } + + export type VerificationTokenMaxAggregateInputType = { + identifier?: true + token?: true + expires?: true + } + + export type VerificationTokenCountAggregateInputType = { + identifier?: true + token?: true + expires?: true + _all?: true + } + + export type VerificationTokenAggregateArgs = { + /** + * Filter which VerificationToken to aggregate. + * + **/ + where?: VerificationTokenWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of VerificationTokens to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + * + **/ + cursor?: VerificationTokenWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` VerificationTokens 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` VerificationTokens. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned VerificationTokens + **/ + _count?: true | VerificationTokenCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: VerificationTokenMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: VerificationTokenMaxAggregateInputType + } + + export type GetVerificationTokenAggregateType = { + [P in keyof T & keyof AggregateVerificationToken]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type VerificationTokenGroupByArgs = { + where?: VerificationTokenWhereInput + orderBy?: Enumerable + by: Array + having?: VerificationTokenScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: VerificationTokenCountAggregateInputType | true + _min?: VerificationTokenMinAggregateInputType + _max?: VerificationTokenMaxAggregateInputType + } + + + export type VerificationTokenGroupByOutputType = { + identifier: string + token: string + expires: Date + _count: VerificationTokenCountAggregateOutputType | null + _min: VerificationTokenMinAggregateOutputType | null + _max: VerificationTokenMaxAggregateOutputType | null + } + + type GetVerificationTokenGroupByPayload = PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof VerificationTokenGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type VerificationTokenSelect = { + identifier?: boolean + token?: boolean + expires?: boolean + } + + export type VerificationTokenGetPayload< + S extends boolean | null | undefined | VerificationTokenArgs, + U = keyof S + > = S extends true + ? VerificationToken + : S extends undefined + ? never + : S extends VerificationTokenArgs | VerificationTokenFindManyArgs + ?'include' extends U + ? VerificationToken + : 'select' extends U + ? { + [P in TrueKeys]: + P extends keyof VerificationToken ? VerificationToken[P] : never + } + : VerificationToken + : VerificationToken + + + type VerificationTokenCountArgs = Merge< + Omit & { + select?: VerificationTokenCountAggregateInputType | true + } + > + + export interface VerificationTokenDelegate { + /** + * Find zero or one VerificationToken that matches the filter. + * @param {VerificationTokenFindUniqueArgs} args - Arguments to find a VerificationToken + * @example + * // Get one VerificationToken + * const verificationToken = await prisma.verificationToken.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__VerificationTokenClient>> : CheckSelect, Prisma__VerificationTokenClient | null >> + + /** + * Find the first VerificationToken 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 {VerificationTokenFindFirstArgs} args - Arguments to find a VerificationToken + * @example + * // Get one VerificationToken + * const verificationToken = await prisma.verificationToken.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__VerificationTokenClient>> : CheckSelect, Prisma__VerificationTokenClient | null >> + + /** + * Find zero or more VerificationTokens 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 {VerificationTokenFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all VerificationTokens + * const verificationTokens = await prisma.verificationToken.findMany() + * + * // Get first 10 VerificationTokens + * const verificationTokens = await prisma.verificationToken.findMany({ take: 10 }) + * + * // Only select the `identifier` + * const verificationTokenWithIdentifierOnly = await prisma.verificationToken.findMany({ select: { identifier: true } }) + * + **/ + findMany( + args?: SelectSubset + ): CheckSelect>, PrismaPromise>>> + + /** + * Create a VerificationToken. + * @param {VerificationTokenCreateArgs} args - Arguments to create a VerificationToken. + * @example + * // Create one VerificationToken + * const VerificationToken = await prisma.verificationToken.create({ + * data: { + * // ... data to create a VerificationToken + * } + * }) + * + **/ + create( + args: SelectSubset + ): CheckSelect, Prisma__VerificationTokenClient>> + + /** + * Create many VerificationTokens. + * @param {VerificationTokenCreateManyArgs} args - Arguments to create many VerificationTokens. + * @example + * // Create many VerificationTokens + * const verificationToken = await prisma.verificationToken.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Delete a VerificationToken. + * @param {VerificationTokenDeleteArgs} args - Arguments to delete one VerificationToken. + * @example + * // Delete one VerificationToken + * const VerificationToken = await prisma.verificationToken.delete({ + * where: { + * // ... filter to delete one VerificationToken + * } + * }) + * + **/ + delete( + args: SelectSubset + ): CheckSelect, Prisma__VerificationTokenClient>> + + /** + * Update one VerificationToken. + * @param {VerificationTokenUpdateArgs} args - Arguments to update one VerificationToken. + * @example + * // Update one VerificationToken + * const verificationToken = await prisma.verificationToken.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): CheckSelect, Prisma__VerificationTokenClient>> + + /** + * Delete zero or more VerificationTokens. + * @param {VerificationTokenDeleteManyArgs} args - Arguments to filter VerificationTokens to delete. + * @example + * // Delete a few VerificationTokens + * const { count } = await prisma.verificationToken.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Update zero or more VerificationTokens. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationTokenUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many VerificationTokens + * const verificationToken = await prisma.verificationToken.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): PrismaPromise + + /** + * Create or update one VerificationToken. + * @param {VerificationTokenUpsertArgs} args - Arguments to update or create a VerificationToken. + * @example + * // Update or create a VerificationToken + * const verificationToken = await prisma.verificationToken.upsert({ + * create: { + * // ... data to create a VerificationToken + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the VerificationToken we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): CheckSelect, Prisma__VerificationTokenClient>> + + /** + * Find one VerificationToken that matches the filter or throw + * `NotFoundError` if no matches were found. + * @param {VerificationTokenFindUniqueOrThrowArgs} args - Arguments to find a VerificationToken + * @example + * // Get one VerificationToken + * const verificationToken = await prisma.verificationToken.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__VerificationTokenClient>> + + /** + * Find the first VerificationToken that matches the filter or + * throw `NotFoundError` 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 {VerificationTokenFindFirstOrThrowArgs} args - Arguments to find a VerificationToken + * @example + * // Get one VerificationToken + * const verificationToken = await prisma.verificationToken.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__VerificationTokenClient>> + + /** + * Count the number of VerificationTokens. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationTokenCountArgs} args - Arguments to filter VerificationTokens to count. + * @example + * // Count the number of VerificationTokens + * const count = await prisma.verificationToken.count({ + * where: { + * // ... the filter for the VerificationTokens we want to count + * } + * }) + **/ + count( + args?: Subset, + ): PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a VerificationToken. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationTokenAggregateArgs} 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): PrismaPromise> + + /** + * Group by VerificationToken. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationTokenGroupByArgs} 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 VerificationTokenGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: VerificationTokenGroupByArgs['orderBy'] } + : { orderBy?: VerificationTokenGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + 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 ? GetVerificationTokenGroupByPayload : PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for VerificationToken. + * 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 class Prisma__VerificationTokenClient implements PrismaPromise { + [prisma]: true; + private readonly _dmmf; + private readonly _fetcher; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + constructor(_dmmf: runtime.DMMFClass, _fetcher: PrismaClientFetcher, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + readonly [Symbol.toStringTag]: 'PrismaClientPromise'; + + + private get _document(); + /** + * 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): Promise; + /** + * 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): Promise; + /** + * 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): Promise; + } + + + + // Custom InputTypes + + /** + * VerificationToken base type for findUnique actions + */ + export type VerificationTokenFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the VerificationToken + * + **/ + select?: VerificationTokenSelect | null + /** + * Filter, which VerificationToken to fetch. + * + **/ + where: VerificationTokenWhereUniqueInput + } + + /** + * VerificationToken: findUnique + */ + export interface VerificationTokenFindUniqueArgs extends VerificationTokenFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * VerificationToken base type for findFirst actions + */ + export type VerificationTokenFindFirstArgsBase = { + /** + * Select specific fields to fetch from the VerificationToken + * + **/ + select?: VerificationTokenSelect | null + /** + * Filter, which VerificationToken to fetch. + * + **/ + where?: VerificationTokenWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of VerificationTokens to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for VerificationTokens. + * + **/ + cursor?: VerificationTokenWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` VerificationTokens 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` VerificationTokens. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of VerificationTokens. + * + **/ + distinct?: Enumerable + } + + /** + * VerificationToken: findFirst + */ + export interface VerificationTokenFindFirstArgs extends VerificationTokenFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * VerificationToken findMany + */ + export type VerificationTokenFindManyArgs = { + /** + * Select specific fields to fetch from the VerificationToken + * + **/ + select?: VerificationTokenSelect | null + /** + * Filter, which VerificationTokens to fetch. + * + **/ + where?: VerificationTokenWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of VerificationTokens to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing VerificationTokens. + * + **/ + cursor?: VerificationTokenWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` VerificationTokens 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` VerificationTokens. + * + **/ + skip?: number + distinct?: Enumerable + } + + + /** + * VerificationToken create + */ + export type VerificationTokenCreateArgs = { + /** + * Select specific fields to fetch from the VerificationToken + * + **/ + select?: VerificationTokenSelect | null + /** + * The data needed to create a VerificationToken. + * + **/ + data: XOR + } + + + /** + * VerificationToken createMany + */ + export type VerificationTokenCreateManyArgs = { + /** + * The data used to create many VerificationTokens. + * + **/ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * VerificationToken update + */ + export type VerificationTokenUpdateArgs = { + /** + * Select specific fields to fetch from the VerificationToken + * + **/ + select?: VerificationTokenSelect | null + /** + * The data needed to update a VerificationToken. + * + **/ + data: XOR + /** + * Choose, which VerificationToken to update. + * + **/ + where: VerificationTokenWhereUniqueInput + } + + + /** + * VerificationToken updateMany + */ + export type VerificationTokenUpdateManyArgs = { + /** + * The data used to update VerificationTokens. + * + **/ + data: XOR + /** + * Filter which VerificationTokens to update + * + **/ + where?: VerificationTokenWhereInput + } + + + /** + * VerificationToken upsert + */ + export type VerificationTokenUpsertArgs = { + /** + * Select specific fields to fetch from the VerificationToken + * + **/ + select?: VerificationTokenSelect | null + /** + * The filter to search for the VerificationToken to update in case it exists. + * + **/ + where: VerificationTokenWhereUniqueInput + /** + * In case the VerificationToken found by the `where` argument doesn't exist, create a new VerificationToken with this data. + * + **/ + create: XOR + /** + * In case the VerificationToken was found with the provided `where` argument, update it with this data. + * + **/ + update: XOR + } + + + /** + * VerificationToken delete + */ + export type VerificationTokenDeleteArgs = { + /** + * Select specific fields to fetch from the VerificationToken + * + **/ + select?: VerificationTokenSelect | null + /** + * Filter which VerificationToken to delete. + * + **/ + where: VerificationTokenWhereUniqueInput + } + + + /** + * VerificationToken deleteMany + */ + export type VerificationTokenDeleteManyArgs = { + /** + * Filter which VerificationTokens to delete + * + **/ + where?: VerificationTokenWhereInput + } + + + /** + * VerificationToken: findUniqueOrThrow + */ + export type VerificationTokenFindUniqueOrThrowArgs = VerificationTokenFindUniqueArgsBase + + + /** + * VerificationToken: findFirstOrThrow + */ + export type VerificationTokenFindFirstOrThrowArgs = VerificationTokenFindFirstArgsBase + + + /** + * VerificationToken without action + */ + export type VerificationTokenArgs = { + /** + * Select specific fields to fetch from the VerificationToken + * + **/ + select?: VerificationTokenSelect | null + } + + + + /** + * Model TodoList + */ + + + export type AggregateTodoList = { + _count: TodoListCountAggregateOutputType | null + _min: TodoListMinAggregateOutputType | null + _max: TodoListMaxAggregateOutputType | null + } + + export type TodoListMinAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + spaceId: string | null + ownerId: string | null + title: string | null + private: boolean | null + } + + export type TodoListMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + spaceId: string | null + ownerId: string | null + title: string | null + private: boolean | null + } + + export type TodoListCountAggregateOutputType = { + id: number + createdAt: number + updatedAt: number + spaceId: number + ownerId: number + title: number + private: number + _all: number + } + + + export type TodoListMinAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + spaceId?: true + ownerId?: true + title?: true + private?: true + } + + export type TodoListMaxAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + spaceId?: true + ownerId?: true + title?: true + private?: true + } + + export type TodoListCountAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + spaceId?: true + ownerId?: true + title?: true + private?: true + _all?: true + } + + export type TodoListAggregateArgs = { + /** + * Filter which TodoList to aggregate. + * + **/ + where?: TodoListWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of TodoLists to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + * + **/ + cursor?: TodoListWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` TodoLists 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` TodoLists. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned TodoLists + **/ + _count?: true | TodoListCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TodoListMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TodoListMaxAggregateInputType + } + + export type GetTodoListAggregateType = { + [P in keyof T & keyof AggregateTodoList]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type TodoListGroupByArgs = { + where?: TodoListWhereInput + orderBy?: Enumerable + by: Array + having?: TodoListScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TodoListCountAggregateInputType | true + _min?: TodoListMinAggregateInputType + _max?: TodoListMaxAggregateInputType + } + + + export type TodoListGroupByOutputType = { + id: string + createdAt: Date + updatedAt: Date + spaceId: string + ownerId: string + title: string + private: boolean + _count: TodoListCountAggregateOutputType | null + _min: TodoListMinAggregateOutputType | null + _max: TodoListMaxAggregateOutputType | null + } + + type GetTodoListGroupByPayload = PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof TodoListGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type TodoListSelect = { + id?: boolean + createdAt?: boolean + updatedAt?: boolean + spaceId?: boolean + space?: boolean | SpaceArgs + ownerId?: boolean + owner?: boolean | UserArgs + title?: boolean + private?: boolean + todos?: boolean | TodoFindManyArgs + _count?: boolean | TodoListCountOutputTypeArgs + } + + export type TodoListInclude = { + space?: boolean | SpaceArgs + owner?: boolean | UserArgs + todos?: boolean | TodoFindManyArgs + _count?: boolean | TodoListCountOutputTypeArgs + } + + export type TodoListGetPayload< + S extends boolean | null | undefined | TodoListArgs, + U = keyof S + > = S extends true + ? TodoList + : S extends undefined + ? never + : S extends TodoListArgs | TodoListFindManyArgs + ?'include' extends U + ? TodoList & { + [P in TrueKeys]: + P extends 'space' ? SpaceGetPayload[P]> : + P extends 'owner' ? UserGetPayload[P]> : + P extends 'todos' ? Array < TodoGetPayload[P]>> : + P extends '_count' ? TodoListCountOutputTypeGetPayload[P]> : never + } + : 'select' extends U + ? { + [P in TrueKeys]: + P extends 'space' ? SpaceGetPayload[P]> : + P extends 'owner' ? UserGetPayload[P]> : + P extends 'todos' ? Array < TodoGetPayload[P]>> : + P extends '_count' ? TodoListCountOutputTypeGetPayload[P]> : P extends keyof TodoList ? TodoList[P] : never + } + : TodoList + : TodoList + + + type TodoListCountArgs = Merge< + Omit & { + select?: TodoListCountAggregateInputType | true + } + > + + export interface TodoListDelegate { + /** + * Find zero or one TodoList that matches the filter. + * @param {TodoListFindUniqueArgs} args - Arguments to find a TodoList + * @example + * // Get one TodoList + * const todoList = await prisma.todoList.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__TodoListClient>> : CheckSelect, Prisma__TodoListClient | null >> + + /** + * Find the first TodoList 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 {TodoListFindFirstArgs} args - Arguments to find a TodoList + * @example + * // Get one TodoList + * const todoList = await prisma.todoList.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__TodoListClient>> : CheckSelect, Prisma__TodoListClient | null >> + + /** + * Find zero or more TodoLists 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 {TodoListFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all TodoLists + * const todoLists = await prisma.todoList.findMany() + * + * // Get first 10 TodoLists + * const todoLists = await prisma.todoList.findMany({ take: 10 }) + * + * // Only select the `id` + * const todoListWithIdOnly = await prisma.todoList.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): CheckSelect>, PrismaPromise>>> + + /** + * Create a TodoList. + * @param {TodoListCreateArgs} args - Arguments to create a TodoList. + * @example + * // Create one TodoList + * const TodoList = await prisma.todoList.create({ + * data: { + * // ... data to create a TodoList + * } + * }) + * + **/ + create( + args: SelectSubset + ): CheckSelect, Prisma__TodoListClient>> + + /** + * Create many TodoLists. + * @param {TodoListCreateManyArgs} args - Arguments to create many TodoLists. + * @example + * // Create many TodoLists + * const todoList = await prisma.todoList.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Delete a TodoList. + * @param {TodoListDeleteArgs} args - Arguments to delete one TodoList. + * @example + * // Delete one TodoList + * const TodoList = await prisma.todoList.delete({ + * where: { + * // ... filter to delete one TodoList + * } + * }) + * + **/ + delete( + args: SelectSubset + ): CheckSelect, Prisma__TodoListClient>> + + /** + * Update one TodoList. + * @param {TodoListUpdateArgs} args - Arguments to update one TodoList. + * @example + * // Update one TodoList + * const todoList = await prisma.todoList.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): CheckSelect, Prisma__TodoListClient>> + + /** + * Delete zero or more TodoLists. + * @param {TodoListDeleteManyArgs} args - Arguments to filter TodoLists to delete. + * @example + * // Delete a few TodoLists + * const { count } = await prisma.todoList.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Update zero or more TodoLists. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoListUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many TodoLists + * const todoList = await prisma.todoList.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): PrismaPromise + + /** + * Create or update one TodoList. + * @param {TodoListUpsertArgs} args - Arguments to update or create a TodoList. + * @example + * // Update or create a TodoList + * const todoList = await prisma.todoList.upsert({ + * create: { + * // ... data to create a TodoList + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the TodoList we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): CheckSelect, Prisma__TodoListClient>> + + /** + * Find one TodoList that matches the filter or throw + * `NotFoundError` if no matches were found. + * @param {TodoListFindUniqueOrThrowArgs} args - Arguments to find a TodoList + * @example + * // Get one TodoList + * const todoList = await prisma.todoList.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__TodoListClient>> + + /** + * Find the first TodoList that matches the filter or + * throw `NotFoundError` 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 {TodoListFindFirstOrThrowArgs} args - Arguments to find a TodoList + * @example + * // Get one TodoList + * const todoList = await prisma.todoList.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__TodoListClient>> + + /** + * Count the number of TodoLists. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoListCountArgs} args - Arguments to filter TodoLists to count. + * @example + * // Count the number of TodoLists + * const count = await prisma.todoList.count({ + * where: { + * // ... the filter for the TodoLists we want to count + * } + * }) + **/ + count( + args?: Subset, + ): PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a TodoList. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoListAggregateArgs} 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): PrismaPromise> + + /** + * Group by TodoList. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoListGroupByArgs} 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 TodoListGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: TodoListGroupByArgs['orderBy'] } + : { orderBy?: TodoListGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + 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 ? GetTodoListGroupByPayload : PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for TodoList. + * 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 class Prisma__TodoListClient implements PrismaPromise { + [prisma]: true; + private readonly _dmmf; + private readonly _fetcher; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + constructor(_dmmf: runtime.DMMFClass, _fetcher: PrismaClientFetcher, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + readonly [Symbol.toStringTag]: 'PrismaClientPromise'; + + space(args?: Subset): CheckSelect, Prisma__SpaceClient | null >>; + + owner(args?: Subset): CheckSelect, Prisma__UserClient | null >>; + + todos(args?: Subset): CheckSelect>, PrismaPromise>>>; + + private get _document(); + /** + * 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): Promise; + /** + * 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): Promise; + /** + * 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): Promise; + } + + + + // Custom InputTypes + + /** + * TodoList base type for findUnique actions + */ + export type TodoListFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the TodoList + * + **/ + select?: TodoListSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoListInclude | null + /** + * Filter, which TodoList to fetch. + * + **/ + where: TodoListWhereUniqueInput + } + + /** + * TodoList: findUnique + */ + export interface TodoListFindUniqueArgs extends TodoListFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * TodoList base type for findFirst actions + */ + export type TodoListFindFirstArgsBase = { + /** + * Select specific fields to fetch from the TodoList + * + **/ + select?: TodoListSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoListInclude | null + /** + * Filter, which TodoList to fetch. + * + **/ + where?: TodoListWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of TodoLists to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for TodoLists. + * + **/ + cursor?: TodoListWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` TodoLists 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` TodoLists. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of TodoLists. + * + **/ + distinct?: Enumerable + } + + /** + * TodoList: findFirst + */ + export interface TodoListFindFirstArgs extends TodoListFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * TodoList findMany + */ + export type TodoListFindManyArgs = { + /** + * Select specific fields to fetch from the TodoList + * + **/ + select?: TodoListSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoListInclude | null + /** + * Filter, which TodoLists to fetch. + * + **/ + where?: TodoListWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of TodoLists to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing TodoLists. + * + **/ + cursor?: TodoListWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` TodoLists 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` TodoLists. + * + **/ + skip?: number + distinct?: Enumerable + } + + + /** + * TodoList create + */ + export type TodoListCreateArgs = { + /** + * Select specific fields to fetch from the TodoList + * + **/ + select?: TodoListSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoListInclude | null + /** + * The data needed to create a TodoList. + * + **/ + data: XOR + } + + + /** + * TodoList createMany + */ + export type TodoListCreateManyArgs = { + /** + * The data used to create many TodoLists. + * + **/ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * TodoList update + */ + export type TodoListUpdateArgs = { + /** + * Select specific fields to fetch from the TodoList + * + **/ + select?: TodoListSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoListInclude | null + /** + * The data needed to update a TodoList. + * + **/ + data: XOR + /** + * Choose, which TodoList to update. + * + **/ + where: TodoListWhereUniqueInput + } + + + /** + * TodoList updateMany + */ + export type TodoListUpdateManyArgs = { + /** + * The data used to update TodoLists. + * + **/ + data: XOR + /** + * Filter which TodoLists to update + * + **/ + where?: TodoListWhereInput + } + + + /** + * TodoList upsert + */ + export type TodoListUpsertArgs = { + /** + * Select specific fields to fetch from the TodoList + * + **/ + select?: TodoListSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoListInclude | null + /** + * The filter to search for the TodoList to update in case it exists. + * + **/ + where: TodoListWhereUniqueInput + /** + * In case the TodoList found by the `where` argument doesn't exist, create a new TodoList with this data. + * + **/ + create: XOR + /** + * In case the TodoList was found with the provided `where` argument, update it with this data. + * + **/ + update: XOR + } + + + /** + * TodoList delete + */ + export type TodoListDeleteArgs = { + /** + * Select specific fields to fetch from the TodoList + * + **/ + select?: TodoListSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoListInclude | null + /** + * Filter which TodoList to delete. + * + **/ + where: TodoListWhereUniqueInput + } + + + /** + * TodoList deleteMany + */ + export type TodoListDeleteManyArgs = { + /** + * Filter which TodoLists to delete + * + **/ + where?: TodoListWhereInput + } + + + /** + * TodoList: findUniqueOrThrow + */ + export type TodoListFindUniqueOrThrowArgs = TodoListFindUniqueArgsBase + + + /** + * TodoList: findFirstOrThrow + */ + export type TodoListFindFirstOrThrowArgs = TodoListFindFirstArgsBase + + + /** + * TodoList without action + */ + export type TodoListArgs = { + /** + * Select specific fields to fetch from the TodoList + * + **/ + select?: TodoListSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoListInclude | null + } + + + + /** + * Model Todo + */ + + + export type AggregateTodo = { + _count: TodoCountAggregateOutputType | null + _min: TodoMinAggregateOutputType | null + _max: TodoMaxAggregateOutputType | null + } + + export type TodoMinAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + ownerId: string | null + todoListId: string | null + title: string | null + completedAt: Date | null + } + + export type TodoMaxAggregateOutputType = { + id: string | null + createdAt: Date | null + updatedAt: Date | null + ownerId: string | null + todoListId: string | null + title: string | null + completedAt: Date | null + } + + export type TodoCountAggregateOutputType = { + id: number + createdAt: number + updatedAt: number + ownerId: number + todoListId: number + title: number + completedAt: number + _all: number + } + + + export type TodoMinAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + ownerId?: true + todoListId?: true + title?: true + completedAt?: true + } + + export type TodoMaxAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + ownerId?: true + todoListId?: true + title?: true + completedAt?: true + } + + export type TodoCountAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + ownerId?: true + todoListId?: true + title?: true + completedAt?: true + _all?: true + } + + export type TodoAggregateArgs = { + /** + * Filter which Todo to aggregate. + * + **/ + where?: TodoWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Todos to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + * + **/ + cursor?: TodoWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Todos 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` Todos. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Todos + **/ + _count?: true | TodoCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TodoMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TodoMaxAggregateInputType + } + + export type GetTodoAggregateType = { + [P in keyof T & keyof AggregateTodo]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type TodoGroupByArgs = { + where?: TodoWhereInput + orderBy?: Enumerable + by: Array + having?: TodoScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TodoCountAggregateInputType | true + _min?: TodoMinAggregateInputType + _max?: TodoMaxAggregateInputType + } + + + export type TodoGroupByOutputType = { + id: string + createdAt: Date + updatedAt: Date + ownerId: string + todoListId: string + title: string + completedAt: Date | null + _count: TodoCountAggregateOutputType | null + _min: TodoMinAggregateOutputType | null + _max: TodoMaxAggregateOutputType | null + } + + type GetTodoGroupByPayload = PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof TodoGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type TodoSelect = { + id?: boolean + createdAt?: boolean + updatedAt?: boolean + ownerId?: boolean + owner?: boolean | UserArgs + todoListId?: boolean + todoList?: boolean | TodoListArgs + title?: boolean + completedAt?: boolean + } + + export type TodoInclude = { + owner?: boolean | UserArgs + todoList?: boolean | TodoListArgs + } + + export type TodoGetPayload< + S extends boolean | null | undefined | TodoArgs, + U = keyof S + > = S extends true + ? Todo + : S extends undefined + ? never + : S extends TodoArgs | TodoFindManyArgs + ?'include' extends U + ? Todo & { + [P in TrueKeys]: + P extends 'owner' ? UserGetPayload[P]> : + P extends 'todoList' ? TodoListGetPayload[P]> : never + } + : 'select' extends U + ? { + [P in TrueKeys]: + P extends 'owner' ? UserGetPayload[P]> : + P extends 'todoList' ? TodoListGetPayload[P]> : P extends keyof Todo ? Todo[P] : never + } + : Todo + : Todo + + + type TodoCountArgs = Merge< + Omit & { + select?: TodoCountAggregateInputType | true + } + > + + export interface TodoDelegate { + /** + * Find zero or one Todo that matches the filter. + * @param {TodoFindUniqueArgs} args - Arguments to find a Todo + * @example + * // Get one Todo + * const todo = await prisma.todo.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__TodoClient>> : CheckSelect, Prisma__TodoClient | null >> + + /** + * Find the first Todo 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 {TodoFindFirstArgs} args - Arguments to find a Todo + * @example + * // Get one Todo + * const todo = await prisma.todo.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? CheckSelect, Prisma__TodoClient>> : CheckSelect, Prisma__TodoClient | null >> + + /** + * Find zero or more Todos 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 {TodoFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Todos + * const todos = await prisma.todo.findMany() + * + * // Get first 10 Todos + * const todos = await prisma.todo.findMany({ take: 10 }) + * + * // Only select the `id` + * const todoWithIdOnly = await prisma.todo.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): CheckSelect>, PrismaPromise>>> + + /** + * Create a Todo. + * @param {TodoCreateArgs} args - Arguments to create a Todo. + * @example + * // Create one Todo + * const Todo = await prisma.todo.create({ + * data: { + * // ... data to create a Todo + * } + * }) + * + **/ + create( + args: SelectSubset + ): CheckSelect, Prisma__TodoClient>> + + /** + * Create many Todos. + * @param {TodoCreateManyArgs} args - Arguments to create many Todos. + * @example + * // Create many Todos + * const todo = await prisma.todo.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Delete a Todo. + * @param {TodoDeleteArgs} args - Arguments to delete one Todo. + * @example + * // Delete one Todo + * const Todo = await prisma.todo.delete({ + * where: { + * // ... filter to delete one Todo + * } + * }) + * + **/ + delete( + args: SelectSubset + ): CheckSelect, Prisma__TodoClient>> + + /** + * Update one Todo. + * @param {TodoUpdateArgs} args - Arguments to update one Todo. + * @example + * // Update one Todo + * const todo = await prisma.todo.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): CheckSelect, Prisma__TodoClient>> + + /** + * Delete zero or more Todos. + * @param {TodoDeleteManyArgs} args - Arguments to filter Todos to delete. + * @example + * // Delete a few Todos + * const { count } = await prisma.todo.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): PrismaPromise + + /** + * Update zero or more Todos. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Todos + * const todo = await prisma.todo.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): PrismaPromise + + /** + * Create or update one Todo. + * @param {TodoUpsertArgs} args - Arguments to update or create a Todo. + * @example + * // Update or create a Todo + * const todo = await prisma.todo.upsert({ + * create: { + * // ... data to create a Todo + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Todo we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): CheckSelect, Prisma__TodoClient>> + + /** + * Find one Todo that matches the filter or throw + * `NotFoundError` if no matches were found. + * @param {TodoFindUniqueOrThrowArgs} args - Arguments to find a Todo + * @example + * // Get one Todo + * const todo = await prisma.todo.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__TodoClient>> + + /** + * Find the first Todo that matches the filter or + * throw `NotFoundError` 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 {TodoFindFirstOrThrowArgs} args - Arguments to find a Todo + * @example + * // Get one Todo + * const todo = await prisma.todo.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): CheckSelect, Prisma__TodoClient>> + + /** + * Count the number of Todos. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoCountArgs} args - Arguments to filter Todos to count. + * @example + * // Count the number of Todos + * const count = await prisma.todo.count({ + * where: { + * // ... the filter for the Todos we want to count + * } + * }) + **/ + count( + args?: Subset, + ): PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Todo. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoAggregateArgs} 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): PrismaPromise> + + /** + * Group by Todo. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoGroupByArgs} 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 TodoGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: TodoGroupByArgs['orderBy'] } + : { orderBy?: TodoGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + 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 ? GetTodoGroupByPayload : PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Todo. + * 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 class Prisma__TodoClient implements PrismaPromise { + [prisma]: true; + private readonly _dmmf; + private readonly _fetcher; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + constructor(_dmmf: runtime.DMMFClass, _fetcher: PrismaClientFetcher, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + readonly [Symbol.toStringTag]: 'PrismaClientPromise'; + + owner(args?: Subset): CheckSelect, Prisma__UserClient | null >>; + + todoList(args?: Subset): CheckSelect, Prisma__TodoListClient | null >>; + + private get _document(); + /** + * 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): Promise; + /** + * 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): Promise; + /** + * 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): Promise; + } + + + + // Custom InputTypes + + /** + * Todo base type for findUnique actions + */ + export type TodoFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Todo + * + **/ + select?: TodoSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoInclude | null + /** + * Filter, which Todo to fetch. + * + **/ + where: TodoWhereUniqueInput + } + + /** + * Todo: findUnique + */ + export interface TodoFindUniqueArgs extends TodoFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Todo base type for findFirst actions + */ + export type TodoFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Todo + * + **/ + select?: TodoSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoInclude | null + /** + * Filter, which Todo to fetch. + * + **/ + where?: TodoWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Todos to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Todos. + * + **/ + cursor?: TodoWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Todos 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` Todos. + * + **/ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Todos. + * + **/ + distinct?: Enumerable + } + + /** + * Todo: findFirst + */ + export interface TodoFindFirstArgs extends TodoFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Todo findMany + */ + export type TodoFindManyArgs = { + /** + * Select specific fields to fetch from the Todo + * + **/ + select?: TodoSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoInclude | null + /** + * Filter, which Todos to fetch. + * + **/ + where?: TodoWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Todos to fetch. + * + **/ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Todos. + * + **/ + cursor?: TodoWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Todos 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` Todos. + * + **/ + skip?: number + distinct?: Enumerable + } + + + /** + * Todo create + */ + export type TodoCreateArgs = { + /** + * Select specific fields to fetch from the Todo + * + **/ + select?: TodoSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoInclude | null + /** + * The data needed to create a Todo. + * + **/ + data: XOR + } + + + /** + * Todo createMany + */ + export type TodoCreateManyArgs = { + /** + * The data used to create many Todos. + * + **/ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Todo update + */ + export type TodoUpdateArgs = { + /** + * Select specific fields to fetch from the Todo + * + **/ + select?: TodoSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoInclude | null + /** + * The data needed to update a Todo. + * + **/ + data: XOR + /** + * Choose, which Todo to update. + * + **/ + where: TodoWhereUniqueInput + } + + + /** + * Todo updateMany + */ + export type TodoUpdateManyArgs = { + /** + * The data used to update Todos. + * + **/ + data: XOR + /** + * Filter which Todos to update + * + **/ + where?: TodoWhereInput + } + + + /** + * Todo upsert + */ + export type TodoUpsertArgs = { + /** + * Select specific fields to fetch from the Todo + * + **/ + select?: TodoSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoInclude | null + /** + * The filter to search for the Todo to update in case it exists. + * + **/ + where: TodoWhereUniqueInput + /** + * In case the Todo found by the `where` argument doesn't exist, create a new Todo with this data. + * + **/ + create: XOR + /** + * In case the Todo was found with the provided `where` argument, update it with this data. + * + **/ + update: XOR + } + + + /** + * Todo delete + */ + export type TodoDeleteArgs = { + /** + * Select specific fields to fetch from the Todo + * + **/ + select?: TodoSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoInclude | null + /** + * Filter which Todo to delete. + * + **/ + where: TodoWhereUniqueInput + } + + + /** + * Todo deleteMany + */ + export type TodoDeleteManyArgs = { + /** + * Filter which Todos to delete + * + **/ + where?: TodoWhereInput + } + + + /** + * Todo: findUniqueOrThrow + */ + export type TodoFindUniqueOrThrowArgs = TodoFindUniqueArgsBase + + + /** + * Todo: findFirstOrThrow + */ + export type TodoFindFirstOrThrowArgs = TodoFindFirstArgsBase + + + /** + * Todo without action + */ + export type TodoArgs = { + /** + * Select specific fields to fetch from the Todo + * + **/ + select?: TodoSelect | null + /** + * Choose, which related nodes to fetch as well. + * + **/ + include?: TodoInclude | null + } + + + + /** + * Enums + */ + + // Based on + // https://github.com/microsoft/TypeScript/issues/3192#issuecomment-261720275 + + export const AccountScalarFieldEnum: { + id: 'id', + userId: 'userId', + type: 'type', + provider: 'provider', + providerAccountId: 'providerAccountId', + refresh_token: 'refresh_token', + access_token: 'access_token', + expires_at: 'expires_at', + token_type: 'token_type', + scope: 'scope', + id_token: 'id_token', + session_state: 'session_state' + }; + + export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum] + + + export const QueryMode: { + default: 'default', + insensitive: 'insensitive' + }; + + export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + + export const SessionScalarFieldEnum: { + id: 'id', + sessionToken: 'sessionToken', + userId: 'userId', + expires: 'expires' + }; + + export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum] + + + export const SortOrder: { + asc: 'asc', + desc: 'desc' + }; + + export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + + export const SpaceScalarFieldEnum: { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + name: 'name', + slug: 'slug' + }; + + export type SpaceScalarFieldEnum = (typeof SpaceScalarFieldEnum)[keyof typeof SpaceScalarFieldEnum] + + + export const SpaceUserScalarFieldEnum: { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + spaceId: 'spaceId', + userId: 'userId', + role: 'role' + }; + + export type SpaceUserScalarFieldEnum = (typeof SpaceUserScalarFieldEnum)[keyof typeof SpaceUserScalarFieldEnum] + + + export const TodoListScalarFieldEnum: { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + spaceId: 'spaceId', + ownerId: 'ownerId', + title: 'title', + private: 'private' + }; + + export type TodoListScalarFieldEnum = (typeof TodoListScalarFieldEnum)[keyof typeof TodoListScalarFieldEnum] + + + export const TodoScalarFieldEnum: { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + ownerId: 'ownerId', + todoListId: 'todoListId', + title: 'title', + completedAt: 'completedAt' + }; + + export type TodoScalarFieldEnum = (typeof TodoScalarFieldEnum)[keyof typeof TodoScalarFieldEnum] + + + export const TransactionIsolationLevel: { + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' + }; + + export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + + export const UserScalarFieldEnum: { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + email: 'email', + emailVerified: 'emailVerified', + password: 'password', + name: 'name', + image: 'image' + }; + + export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + + export const VerificationTokenScalarFieldEnum: { + identifier: 'identifier', + token: 'token', + expires: 'expires' + }; + + export type VerificationTokenScalarFieldEnum = (typeof VerificationTokenScalarFieldEnum)[keyof typeof VerificationTokenScalarFieldEnum] + + + /** + * Deep Input Types + */ + + + export type SpaceWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + updatedAt?: DateTimeFilter | Date | string + name?: StringFilter | string + slug?: StringFilter | string + members?: SpaceUserListRelationFilter + todoLists?: TodoListListRelationFilter + } + + export type SpaceOrderByWithRelationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + name?: SortOrder + slug?: SortOrder + members?: SpaceUserOrderByRelationAggregateInput + todoLists?: TodoListOrderByRelationAggregateInput + } + + export type SpaceWhereUniqueInput = { + id?: string + slug?: string + } + + export type SpaceOrderByWithAggregationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + name?: SortOrder + slug?: SortOrder + _count?: SpaceCountOrderByAggregateInput + _max?: SpaceMaxOrderByAggregateInput + _min?: SpaceMinOrderByAggregateInput + } + + export type SpaceScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + createdAt?: DateTimeWithAggregatesFilter | Date | string + updatedAt?: DateTimeWithAggregatesFilter | Date | string + name?: StringWithAggregatesFilter | string + slug?: StringWithAggregatesFilter | string + } + + export type SpaceUserWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + updatedAt?: DateTimeFilter | Date | string + spaceId?: StringFilter | string + space?: XOR + userId?: StringFilter | string + user?: XOR + role?: EnumSpaceUserRoleFilter | SpaceUserRole + } + + export type SpaceUserOrderByWithRelationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + space?: SpaceOrderByWithRelationInput + userId?: SortOrder + user?: UserOrderByWithRelationInput + role?: SortOrder + } + + export type SpaceUserWhereUniqueInput = { + id?: string + } + + export type SpaceUserOrderByWithAggregationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + userId?: SortOrder + role?: SortOrder + _count?: SpaceUserCountOrderByAggregateInput + _max?: SpaceUserMaxOrderByAggregateInput + _min?: SpaceUserMinOrderByAggregateInput + } + + export type SpaceUserScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + createdAt?: DateTimeWithAggregatesFilter | Date | string + updatedAt?: DateTimeWithAggregatesFilter | Date | string + spaceId?: StringWithAggregatesFilter | string + userId?: StringWithAggregatesFilter | string + role?: EnumSpaceUserRoleWithAggregatesFilter | SpaceUserRole + } + + export type UserWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + updatedAt?: DateTimeFilter | Date | string + email?: StringFilter | string + emailVerified?: DateTimeNullableFilter | Date | string | null + password?: StringFilter | string + accounts?: AccountListRelationFilter + sessions?: SessionListRelationFilter + name?: StringNullableFilter | string | null + todoList?: TodoListListRelationFilter + spaces?: SpaceUserListRelationFilter + image?: StringNullableFilter | string | null + Todo?: TodoListRelationFilter + } + + export type UserOrderByWithRelationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + email?: SortOrder + emailVerified?: SortOrder + password?: SortOrder + accounts?: AccountOrderByRelationAggregateInput + sessions?: SessionOrderByRelationAggregateInput + name?: SortOrder + todoList?: TodoListOrderByRelationAggregateInput + spaces?: SpaceUserOrderByRelationAggregateInput + image?: SortOrder + Todo?: TodoOrderByRelationAggregateInput + } + + export type UserWhereUniqueInput = { + id?: string + email?: string + } + + export type UserOrderByWithAggregationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + email?: SortOrder + emailVerified?: SortOrder + password?: SortOrder + name?: SortOrder + image?: SortOrder + _count?: UserCountOrderByAggregateInput + _max?: UserMaxOrderByAggregateInput + _min?: UserMinOrderByAggregateInput + } + + export type UserScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + createdAt?: DateTimeWithAggregatesFilter | Date | string + updatedAt?: DateTimeWithAggregatesFilter | Date | string + email?: StringWithAggregatesFilter | string + emailVerified?: DateTimeNullableWithAggregatesFilter | Date | string | null + password?: StringWithAggregatesFilter | string + name?: StringNullableWithAggregatesFilter | string | null + image?: StringNullableWithAggregatesFilter | string | null + } + + export type AccountWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + userId?: StringFilter | string + type?: StringFilter | string + provider?: StringFilter | string + providerAccountId?: StringFilter | string + refresh_token?: StringNullableFilter | string | null + access_token?: StringNullableFilter | string | null + expires_at?: IntNullableFilter | number | null + token_type?: StringNullableFilter | string | null + scope?: StringNullableFilter | string | null + id_token?: StringNullableFilter | string | null + session_state?: StringNullableFilter | string | null + user?: XOR + } + + export type AccountOrderByWithRelationInput = { + id?: SortOrder + userId?: SortOrder + type?: SortOrder + provider?: SortOrder + providerAccountId?: SortOrder + refresh_token?: SortOrder + access_token?: SortOrder + expires_at?: SortOrder + token_type?: SortOrder + scope?: SortOrder + id_token?: SortOrder + session_state?: SortOrder + user?: UserOrderByWithRelationInput + } + + export type AccountWhereUniqueInput = { + id?: string + provider_providerAccountId?: AccountProviderProviderAccountIdCompoundUniqueInput + } + + export type AccountOrderByWithAggregationInput = { + id?: SortOrder + userId?: SortOrder + type?: SortOrder + provider?: SortOrder + providerAccountId?: SortOrder + refresh_token?: SortOrder + access_token?: SortOrder + expires_at?: SortOrder + token_type?: SortOrder + scope?: SortOrder + id_token?: SortOrder + session_state?: SortOrder + _count?: AccountCountOrderByAggregateInput + _avg?: AccountAvgOrderByAggregateInput + _max?: AccountMaxOrderByAggregateInput + _min?: AccountMinOrderByAggregateInput + _sum?: AccountSumOrderByAggregateInput + } + + export type AccountScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + userId?: StringWithAggregatesFilter | string + type?: StringWithAggregatesFilter | string + provider?: StringWithAggregatesFilter | string + providerAccountId?: StringWithAggregatesFilter | string + refresh_token?: StringNullableWithAggregatesFilter | string | null + access_token?: StringNullableWithAggregatesFilter | string | null + expires_at?: IntNullableWithAggregatesFilter | number | null + token_type?: StringNullableWithAggregatesFilter | string | null + scope?: StringNullableWithAggregatesFilter | string | null + id_token?: StringNullableWithAggregatesFilter | string | null + session_state?: StringNullableWithAggregatesFilter | string | null + } + + export type SessionWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + sessionToken?: StringFilter | string + userId?: StringFilter | string + expires?: DateTimeFilter | Date | string + user?: XOR + } + + export type SessionOrderByWithRelationInput = { + id?: SortOrder + sessionToken?: SortOrder + userId?: SortOrder + expires?: SortOrder + user?: UserOrderByWithRelationInput + } + + export type SessionWhereUniqueInput = { + id?: string + sessionToken?: string + } + + export type SessionOrderByWithAggregationInput = { + id?: SortOrder + sessionToken?: SortOrder + userId?: SortOrder + expires?: SortOrder + _count?: SessionCountOrderByAggregateInput + _max?: SessionMaxOrderByAggregateInput + _min?: SessionMinOrderByAggregateInput + } + + export type SessionScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + sessionToken?: StringWithAggregatesFilter | string + userId?: StringWithAggregatesFilter | string + expires?: DateTimeWithAggregatesFilter | Date | string + } + + export type VerificationTokenWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + identifier?: StringFilter | string + token?: StringFilter | string + expires?: DateTimeFilter | Date | string + } + + export type VerificationTokenOrderByWithRelationInput = { + identifier?: SortOrder + token?: SortOrder + expires?: SortOrder + } + + export type VerificationTokenWhereUniqueInput = { + token?: string + identifier_token?: VerificationTokenIdentifierTokenCompoundUniqueInput + } + + export type VerificationTokenOrderByWithAggregationInput = { + identifier?: SortOrder + token?: SortOrder + expires?: SortOrder + _count?: VerificationTokenCountOrderByAggregateInput + _max?: VerificationTokenMaxOrderByAggregateInput + _min?: VerificationTokenMinOrderByAggregateInput + } + + export type VerificationTokenScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + identifier?: StringWithAggregatesFilter | string + token?: StringWithAggregatesFilter | string + expires?: DateTimeWithAggregatesFilter | Date | string + } + + export type TodoListWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + updatedAt?: DateTimeFilter | Date | string + spaceId?: StringFilter | string + space?: XOR + ownerId?: StringFilter | string + owner?: XOR + title?: StringFilter | string + private?: BoolFilter | boolean + todos?: TodoListRelationFilter + } + + export type TodoListOrderByWithRelationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + space?: SpaceOrderByWithRelationInput + ownerId?: SortOrder + owner?: UserOrderByWithRelationInput + title?: SortOrder + private?: SortOrder + todos?: TodoOrderByRelationAggregateInput + } + + export type TodoListWhereUniqueInput = { + id?: string + } + + export type TodoListOrderByWithAggregationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + ownerId?: SortOrder + title?: SortOrder + private?: SortOrder + _count?: TodoListCountOrderByAggregateInput + _max?: TodoListMaxOrderByAggregateInput + _min?: TodoListMinOrderByAggregateInput + } + + export type TodoListScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + createdAt?: DateTimeWithAggregatesFilter | Date | string + updatedAt?: DateTimeWithAggregatesFilter | Date | string + spaceId?: StringWithAggregatesFilter | string + ownerId?: StringWithAggregatesFilter | string + title?: StringWithAggregatesFilter | string + private?: BoolWithAggregatesFilter | boolean + } + + export type TodoWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + updatedAt?: DateTimeFilter | Date | string + ownerId?: StringFilter | string + owner?: XOR + todoListId?: StringFilter | string + todoList?: XOR + title?: StringFilter | string + completedAt?: DateTimeNullableFilter | Date | string | null + } + + export type TodoOrderByWithRelationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + ownerId?: SortOrder + owner?: UserOrderByWithRelationInput + todoListId?: SortOrder + todoList?: TodoListOrderByWithRelationInput + title?: SortOrder + completedAt?: SortOrder + } + + export type TodoWhereUniqueInput = { + id?: string + } + + export type TodoOrderByWithAggregationInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + ownerId?: SortOrder + todoListId?: SortOrder + title?: SortOrder + completedAt?: SortOrder + _count?: TodoCountOrderByAggregateInput + _max?: TodoMaxOrderByAggregateInput + _min?: TodoMinOrderByAggregateInput + } + + export type TodoScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + createdAt?: DateTimeWithAggregatesFilter | Date | string + updatedAt?: DateTimeWithAggregatesFilter | Date | string + ownerId?: StringWithAggregatesFilter | string + todoListId?: StringWithAggregatesFilter | string + title?: StringWithAggregatesFilter | string + completedAt?: DateTimeNullableWithAggregatesFilter | Date | string | null + } + + export type SpaceCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + name: string + slug: string + members?: SpaceUserCreateNestedManyWithoutSpaceInput + todoLists?: TodoListCreateNestedManyWithoutSpaceInput + } + + export type SpaceUncheckedCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + name: string + slug: string + members?: SpaceUserUncheckedCreateNestedManyWithoutSpaceInput + todoLists?: TodoListUncheckedCreateNestedManyWithoutSpaceInput + } + + export type SpaceUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + name?: StringFieldUpdateOperationsInput | string + slug?: StringFieldUpdateOperationsInput | string + members?: SpaceUserUpdateManyWithoutSpaceNestedInput + todoLists?: TodoListUpdateManyWithoutSpaceNestedInput + } + + export type SpaceUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + name?: StringFieldUpdateOperationsInput | string + slug?: StringFieldUpdateOperationsInput | string + members?: SpaceUserUncheckedUpdateManyWithoutSpaceNestedInput + todoLists?: TodoListUncheckedUpdateManyWithoutSpaceNestedInput + } + + export type SpaceCreateManyInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + name: string + slug: string + } + + export type SpaceUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + name?: StringFieldUpdateOperationsInput | string + slug?: StringFieldUpdateOperationsInput | string + } + + export type SpaceUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + name?: StringFieldUpdateOperationsInput | string + slug?: StringFieldUpdateOperationsInput | string + } + + export type SpaceUserCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + space: SpaceCreateNestedOneWithoutMembersInput + user: UserCreateNestedOneWithoutSpacesInput + role: SpaceUserRole + } + + export type SpaceUserUncheckedCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + userId: string + role: SpaceUserRole + } + + export type SpaceUserUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + space?: SpaceUpdateOneRequiredWithoutMembersNestedInput + user?: UserUpdateOneRequiredWithoutSpacesNestedInput + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type SpaceUserUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type SpaceUserCreateManyInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + userId: string + role: SpaceUserRole + } + + export type SpaceUserUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type SpaceUserUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type UserCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountCreateNestedManyWithoutUserInput + sessions?: SessionCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListCreateNestedManyWithoutOwnerInput + spaces?: SpaceUserCreateNestedManyWithoutUserInput + image?: string | null + Todo?: TodoCreateNestedManyWithoutOwnerInput + } + + export type UserUncheckedCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountUncheckedCreateNestedManyWithoutUserInput + sessions?: SessionUncheckedCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListUncheckedCreateNestedManyWithoutOwnerInput + spaces?: SpaceUserUncheckedCreateNestedManyWithoutUserInput + image?: string | null + Todo?: TodoUncheckedCreateNestedManyWithoutOwnerInput + } + + export type UserUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUpdateManyWithoutUserNestedInput + sessions?: SessionUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUpdateManyWithoutOwnerNestedInput + spaces?: SpaceUserUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUpdateManyWithoutOwnerNestedInput + } + + export type UserUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUncheckedUpdateManyWithoutUserNestedInput + sessions?: SessionUncheckedUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUncheckedUpdateManyWithoutOwnerNestedInput + spaces?: SpaceUserUncheckedUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUncheckedUpdateManyWithoutOwnerNestedInput + } + + export type UserCreateManyInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + name?: string | null + image?: string | null + } + + export type UserUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + image?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type UserUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + name?: NullableStringFieldUpdateOperationsInput | string | null + image?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type AccountCreateInput = { + id?: string + type: string + provider: string + providerAccountId: string + refresh_token?: string | null + access_token?: string | null + expires_at?: number | null + token_type?: string | null + scope?: string | null + id_token?: string | null + session_state?: string | null + user: UserCreateNestedOneWithoutAccountsInput + } + + export type AccountUncheckedCreateInput = { + id?: string + userId: string + type: string + provider: string + providerAccountId: string + refresh_token?: string | null + access_token?: string | null + expires_at?: number | null + token_type?: string | null + scope?: string | null + id_token?: string | null + session_state?: string | null + } + + export type AccountUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + provider?: StringFieldUpdateOperationsInput | string + providerAccountId?: StringFieldUpdateOperationsInput | string + refresh_token?: NullableStringFieldUpdateOperationsInput | string | null + access_token?: NullableStringFieldUpdateOperationsInput | string | null + expires_at?: NullableIntFieldUpdateOperationsInput | number | null + token_type?: NullableStringFieldUpdateOperationsInput | string | null + scope?: NullableStringFieldUpdateOperationsInput | string | null + id_token?: NullableStringFieldUpdateOperationsInput | string | null + session_state?: NullableStringFieldUpdateOperationsInput | string | null + user?: UserUpdateOneRequiredWithoutAccountsNestedInput + } + + export type AccountUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + provider?: StringFieldUpdateOperationsInput | string + providerAccountId?: StringFieldUpdateOperationsInput | string + refresh_token?: NullableStringFieldUpdateOperationsInput | string | null + access_token?: NullableStringFieldUpdateOperationsInput | string | null + expires_at?: NullableIntFieldUpdateOperationsInput | number | null + token_type?: NullableStringFieldUpdateOperationsInput | string | null + scope?: NullableStringFieldUpdateOperationsInput | string | null + id_token?: NullableStringFieldUpdateOperationsInput | string | null + session_state?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type AccountCreateManyInput = { + id?: string + userId: string + type: string + provider: string + providerAccountId: string + refresh_token?: string | null + access_token?: string | null + expires_at?: number | null + token_type?: string | null + scope?: string | null + id_token?: string | null + session_state?: string | null + } + + export type AccountUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + provider?: StringFieldUpdateOperationsInput | string + providerAccountId?: StringFieldUpdateOperationsInput | string + refresh_token?: NullableStringFieldUpdateOperationsInput | string | null + access_token?: NullableStringFieldUpdateOperationsInput | string | null + expires_at?: NullableIntFieldUpdateOperationsInput | number | null + token_type?: NullableStringFieldUpdateOperationsInput | string | null + scope?: NullableStringFieldUpdateOperationsInput | string | null + id_token?: NullableStringFieldUpdateOperationsInput | string | null + session_state?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type AccountUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + provider?: StringFieldUpdateOperationsInput | string + providerAccountId?: StringFieldUpdateOperationsInput | string + refresh_token?: NullableStringFieldUpdateOperationsInput | string | null + access_token?: NullableStringFieldUpdateOperationsInput | string | null + expires_at?: NullableIntFieldUpdateOperationsInput | number | null + token_type?: NullableStringFieldUpdateOperationsInput | string | null + scope?: NullableStringFieldUpdateOperationsInput | string | null + id_token?: NullableStringFieldUpdateOperationsInput | string | null + session_state?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type SessionCreateInput = { + id?: string + sessionToken: string + expires: Date | string + user: UserCreateNestedOneWithoutSessionsInput + } + + export type SessionUncheckedCreateInput = { + id?: string + sessionToken: string + userId: string + expires: Date | string + } + + export type SessionUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + sessionToken?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutSessionsNestedInput + } + + export type SessionUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + sessionToken?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SessionCreateManyInput = { + id?: string + sessionToken: string + userId: string + expires: Date | string + } + + export type SessionUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + sessionToken?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SessionUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + sessionToken?: StringFieldUpdateOperationsInput | string + userId?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type VerificationTokenCreateInput = { + identifier: string + token: string + expires: Date | string + } + + export type VerificationTokenUncheckedCreateInput = { + identifier: string + token: string + expires: Date | string + } + + export type VerificationTokenUpdateInput = { + identifier?: StringFieldUpdateOperationsInput | string + token?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type VerificationTokenUncheckedUpdateInput = { + identifier?: StringFieldUpdateOperationsInput | string + token?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type VerificationTokenCreateManyInput = { + identifier: string + token: string + expires: Date | string + } + + export type VerificationTokenUpdateManyMutationInput = { + identifier?: StringFieldUpdateOperationsInput | string + token?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type VerificationTokenUncheckedUpdateManyInput = { + identifier?: StringFieldUpdateOperationsInput | string + token?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TodoListCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + space: SpaceCreateNestedOneWithoutTodoListsInput + owner: UserCreateNestedOneWithoutTodoListInput + title: string + private?: boolean + todos?: TodoCreateNestedManyWithoutTodoListInput + } + + export type TodoListUncheckedCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + ownerId: string + title: string + private?: boolean + todos?: TodoUncheckedCreateNestedManyWithoutTodoListInput + } + + export type TodoListUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + space?: SpaceUpdateOneRequiredWithoutTodoListsNestedInput + owner?: UserUpdateOneRequiredWithoutTodoListNestedInput + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + todos?: TodoUpdateManyWithoutTodoListNestedInput + } + + export type TodoListUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + ownerId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + todos?: TodoUncheckedUpdateManyWithoutTodoListNestedInput + } + + export type TodoListCreateManyInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + ownerId: string + title: string + private?: boolean + } + + export type TodoListUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + } + + export type TodoListUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + ownerId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + } + + export type TodoCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + owner: UserCreateNestedOneWithoutTodoInput + todoList: TodoListCreateNestedOneWithoutTodosInput + title: string + completedAt?: Date | string | null + } + + export type TodoUncheckedCreateInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + ownerId: string + todoListId: string + title: string + completedAt?: Date | string | null + } + + export type TodoUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + owner?: UserUpdateOneRequiredWithoutTodoNestedInput + todoList?: TodoListUpdateOneRequiredWithoutTodosNestedInput + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type TodoUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + ownerId?: StringFieldUpdateOperationsInput | string + todoListId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type TodoCreateManyInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + ownerId: string + todoListId: string + title: string + completedAt?: Date | string | null + } + + export type TodoUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type TodoUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + ownerId?: StringFieldUpdateOperationsInput | string + todoListId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type StringFilter = { + equals?: string + in?: Enumerable + notIn?: Enumerable + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringFilter | string + } + + export type DateTimeFilter = { + equals?: Date | string + in?: Enumerable | Enumerable + notIn?: Enumerable | Enumerable + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeFilter | Date | string + } + + export type SpaceUserListRelationFilter = { + every?: SpaceUserWhereInput + some?: SpaceUserWhereInput + none?: SpaceUserWhereInput + } + + export type TodoListListRelationFilter = { + every?: TodoListWhereInput + some?: TodoListWhereInput + none?: TodoListWhereInput + } + + export type SpaceUserOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type TodoListOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type SpaceCountOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + name?: SortOrder + slug?: SortOrder + } + + export type SpaceMaxOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + name?: SortOrder + slug?: SortOrder + } + + export type SpaceMinOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + name?: SortOrder + slug?: SortOrder + } + + export type StringWithAggregatesFilter = { + equals?: string + in?: Enumerable + notIn?: Enumerable + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringWithAggregatesFilter | string + _count?: NestedIntFilter + _min?: NestedStringFilter + _max?: NestedStringFilter + } + + export type DateTimeWithAggregatesFilter = { + equals?: Date | string + in?: Enumerable | Enumerable + notIn?: Enumerable | Enumerable + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeWithAggregatesFilter | Date | string + _count?: NestedIntFilter + _min?: NestedDateTimeFilter + _max?: NestedDateTimeFilter + } + + export type SpaceRelationFilter = { + is?: SpaceWhereInput + isNot?: SpaceWhereInput + } + + export type UserRelationFilter = { + is?: UserWhereInput + isNot?: UserWhereInput + } + + export type EnumSpaceUserRoleFilter = { + equals?: SpaceUserRole + in?: Enumerable + notIn?: Enumerable + not?: NestedEnumSpaceUserRoleFilter | SpaceUserRole + } + + export type SpaceUserCountOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + userId?: SortOrder + role?: SortOrder + } + + export type SpaceUserMaxOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + userId?: SortOrder + role?: SortOrder + } + + export type SpaceUserMinOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + userId?: SortOrder + role?: SortOrder + } + + export type EnumSpaceUserRoleWithAggregatesFilter = { + equals?: SpaceUserRole + in?: Enumerable + notIn?: Enumerable + not?: NestedEnumSpaceUserRoleWithAggregatesFilter | SpaceUserRole + _count?: NestedIntFilter + _min?: NestedEnumSpaceUserRoleFilter + _max?: NestedEnumSpaceUserRoleFilter + } + + export type DateTimeNullableFilter = { + equals?: Date | string | null + in?: Enumerable | Enumerable | null + notIn?: Enumerable | Enumerable | null + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeNullableFilter | Date | string | null + } + + export type AccountListRelationFilter = { + every?: AccountWhereInput + some?: AccountWhereInput + none?: AccountWhereInput + } + + export type SessionListRelationFilter = { + every?: SessionWhereInput + some?: SessionWhereInput + none?: SessionWhereInput + } + + export type StringNullableFilter = { + equals?: string | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringNullableFilter | string | null + } + + export type TodoListRelationFilter = { + every?: TodoWhereInput + some?: TodoWhereInput + none?: TodoWhereInput + } + + export type AccountOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type SessionOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type TodoOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type UserCountOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + email?: SortOrder + emailVerified?: SortOrder + password?: SortOrder + name?: SortOrder + image?: SortOrder + } + + export type UserMaxOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + email?: SortOrder + emailVerified?: SortOrder + password?: SortOrder + name?: SortOrder + image?: SortOrder + } + + export type UserMinOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + email?: SortOrder + emailVerified?: SortOrder + password?: SortOrder + name?: SortOrder + image?: SortOrder + } + + export type DateTimeNullableWithAggregatesFilter = { + equals?: Date | string | null + in?: Enumerable | Enumerable | null + notIn?: Enumerable | Enumerable | null + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeNullableWithAggregatesFilter | Date | string | null + _count?: NestedIntNullableFilter + _min?: NestedDateTimeNullableFilter + _max?: NestedDateTimeNullableFilter + } + + export type StringNullableWithAggregatesFilter = { + equals?: string | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringNullableWithAggregatesFilter | string | null + _count?: NestedIntNullableFilter + _min?: NestedStringNullableFilter + _max?: NestedStringNullableFilter + } + + export type IntNullableFilter = { + equals?: number | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableFilter | number | null + } + + export type AccountProviderProviderAccountIdCompoundUniqueInput = { + provider: string + providerAccountId: string + } + + export type AccountCountOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + type?: SortOrder + provider?: SortOrder + providerAccountId?: SortOrder + refresh_token?: SortOrder + access_token?: SortOrder + expires_at?: SortOrder + token_type?: SortOrder + scope?: SortOrder + id_token?: SortOrder + session_state?: SortOrder + } + + export type AccountAvgOrderByAggregateInput = { + expires_at?: SortOrder + } + + export type AccountMaxOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + type?: SortOrder + provider?: SortOrder + providerAccountId?: SortOrder + refresh_token?: SortOrder + access_token?: SortOrder + expires_at?: SortOrder + token_type?: SortOrder + scope?: SortOrder + id_token?: SortOrder + session_state?: SortOrder + } + + export type AccountMinOrderByAggregateInput = { + id?: SortOrder + userId?: SortOrder + type?: SortOrder + provider?: SortOrder + providerAccountId?: SortOrder + refresh_token?: SortOrder + access_token?: SortOrder + expires_at?: SortOrder + token_type?: SortOrder + scope?: SortOrder + id_token?: SortOrder + session_state?: SortOrder + } + + export type AccountSumOrderByAggregateInput = { + expires_at?: SortOrder + } + + export type IntNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedIntNullableFilter + _min?: NestedIntNullableFilter + _max?: NestedIntNullableFilter + } + + export type SessionCountOrderByAggregateInput = { + id?: SortOrder + sessionToken?: SortOrder + userId?: SortOrder + expires?: SortOrder + } + + export type SessionMaxOrderByAggregateInput = { + id?: SortOrder + sessionToken?: SortOrder + userId?: SortOrder + expires?: SortOrder + } + + export type SessionMinOrderByAggregateInput = { + id?: SortOrder + sessionToken?: SortOrder + userId?: SortOrder + expires?: SortOrder + } + + export type VerificationTokenIdentifierTokenCompoundUniqueInput = { + identifier: string + token: string + } + + export type VerificationTokenCountOrderByAggregateInput = { + identifier?: SortOrder + token?: SortOrder + expires?: SortOrder + } + + export type VerificationTokenMaxOrderByAggregateInput = { + identifier?: SortOrder + token?: SortOrder + expires?: SortOrder + } + + export type VerificationTokenMinOrderByAggregateInput = { + identifier?: SortOrder + token?: SortOrder + expires?: SortOrder + } + + export type BoolFilter = { + equals?: boolean + not?: NestedBoolFilter | boolean + } + + export type TodoListCountOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + ownerId?: SortOrder + title?: SortOrder + private?: SortOrder + } + + export type TodoListMaxOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + ownerId?: SortOrder + title?: SortOrder + private?: SortOrder + } + + export type TodoListMinOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + spaceId?: SortOrder + ownerId?: SortOrder + title?: SortOrder + private?: SortOrder + } + + export type BoolWithAggregatesFilter = { + equals?: boolean + not?: NestedBoolWithAggregatesFilter | boolean + _count?: NestedIntFilter + _min?: NestedBoolFilter + _max?: NestedBoolFilter + } + + export type TodoCountOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + ownerId?: SortOrder + todoListId?: SortOrder + title?: SortOrder + completedAt?: SortOrder + } + + export type TodoMaxOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + ownerId?: SortOrder + todoListId?: SortOrder + title?: SortOrder + completedAt?: SortOrder + } + + export type TodoMinOrderByAggregateInput = { + id?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + ownerId?: SortOrder + todoListId?: SortOrder + title?: SortOrder + completedAt?: SortOrder + } + + export type SpaceUserCreateNestedManyWithoutSpaceInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: SpaceUserCreateManySpaceInputEnvelope + connect?: Enumerable + } + + export type TodoListCreateNestedManyWithoutSpaceInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: TodoListCreateManySpaceInputEnvelope + connect?: Enumerable + } + + export type SpaceUserUncheckedCreateNestedManyWithoutSpaceInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: SpaceUserCreateManySpaceInputEnvelope + connect?: Enumerable + } + + export type TodoListUncheckedCreateNestedManyWithoutSpaceInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: TodoListCreateManySpaceInputEnvelope + connect?: Enumerable + } + + export type StringFieldUpdateOperationsInput = { + set?: string + } + + export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string + } + + export type SpaceUserUpdateManyWithoutSpaceNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: SpaceUserCreateManySpaceInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type TodoListUpdateManyWithoutSpaceNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: TodoListCreateManySpaceInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type SpaceUserUncheckedUpdateManyWithoutSpaceNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: SpaceUserCreateManySpaceInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type TodoListUncheckedUpdateManyWithoutSpaceNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: TodoListCreateManySpaceInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type SpaceCreateNestedOneWithoutMembersInput = { + create?: XOR + connectOrCreate?: SpaceCreateOrConnectWithoutMembersInput + connect?: SpaceWhereUniqueInput + } + + export type UserCreateNestedOneWithoutSpacesInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutSpacesInput + connect?: UserWhereUniqueInput + } + + export type SpaceUpdateOneRequiredWithoutMembersNestedInput = { + create?: XOR + connectOrCreate?: SpaceCreateOrConnectWithoutMembersInput + upsert?: SpaceUpsertWithoutMembersInput + connect?: SpaceWhereUniqueInput + update?: XOR + } + + export type UserUpdateOneRequiredWithoutSpacesNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutSpacesInput + upsert?: UserUpsertWithoutSpacesInput + connect?: UserWhereUniqueInput + update?: XOR + } + + export type EnumSpaceUserRoleFieldUpdateOperationsInput = { + set?: SpaceUserRole + } + + export type AccountCreateNestedManyWithoutUserInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: AccountCreateManyUserInputEnvelope + connect?: Enumerable + } + + export type SessionCreateNestedManyWithoutUserInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: SessionCreateManyUserInputEnvelope + connect?: Enumerable + } + + export type TodoListCreateNestedManyWithoutOwnerInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: TodoListCreateManyOwnerInputEnvelope + connect?: Enumerable + } + + export type SpaceUserCreateNestedManyWithoutUserInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: SpaceUserCreateManyUserInputEnvelope + connect?: Enumerable + } + + export type TodoCreateNestedManyWithoutOwnerInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: TodoCreateManyOwnerInputEnvelope + connect?: Enumerable + } + + export type AccountUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: AccountCreateManyUserInputEnvelope + connect?: Enumerable + } + + export type SessionUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: SessionCreateManyUserInputEnvelope + connect?: Enumerable + } + + export type TodoListUncheckedCreateNestedManyWithoutOwnerInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: TodoListCreateManyOwnerInputEnvelope + connect?: Enumerable + } + + export type SpaceUserUncheckedCreateNestedManyWithoutUserInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: SpaceUserCreateManyUserInputEnvelope + connect?: Enumerable + } + + export type TodoUncheckedCreateNestedManyWithoutOwnerInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: TodoCreateManyOwnerInputEnvelope + connect?: Enumerable + } + + export type NullableDateTimeFieldUpdateOperationsInput = { + set?: Date | string | null + } + + export type AccountUpdateManyWithoutUserNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: AccountCreateManyUserInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type SessionUpdateManyWithoutUserNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: SessionCreateManyUserInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type NullableStringFieldUpdateOperationsInput = { + set?: string | null + } + + export type TodoListUpdateManyWithoutOwnerNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: TodoListCreateManyOwnerInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type SpaceUserUpdateManyWithoutUserNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: SpaceUserCreateManyUserInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type TodoUpdateManyWithoutOwnerNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: TodoCreateManyOwnerInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type AccountUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: AccountCreateManyUserInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type SessionUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: SessionCreateManyUserInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type TodoListUncheckedUpdateManyWithoutOwnerNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: TodoListCreateManyOwnerInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type SpaceUserUncheckedUpdateManyWithoutUserNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: SpaceUserCreateManyUserInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type TodoUncheckedUpdateManyWithoutOwnerNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: TodoCreateManyOwnerInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type UserCreateNestedOneWithoutAccountsInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutAccountsInput + connect?: UserWhereUniqueInput + } + + export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type UserUpdateOneRequiredWithoutAccountsNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutAccountsInput + upsert?: UserUpsertWithoutAccountsInput + connect?: UserWhereUniqueInput + update?: XOR + } + + export type UserCreateNestedOneWithoutSessionsInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutSessionsInput + connect?: UserWhereUniqueInput + } + + export type UserUpdateOneRequiredWithoutSessionsNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutSessionsInput + upsert?: UserUpsertWithoutSessionsInput + connect?: UserWhereUniqueInput + update?: XOR + } + + export type SpaceCreateNestedOneWithoutTodoListsInput = { + create?: XOR + connectOrCreate?: SpaceCreateOrConnectWithoutTodoListsInput + connect?: SpaceWhereUniqueInput + } + + export type UserCreateNestedOneWithoutTodoListInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutTodoListInput + connect?: UserWhereUniqueInput + } + + export type TodoCreateNestedManyWithoutTodoListInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: TodoCreateManyTodoListInputEnvelope + connect?: Enumerable + } + + export type TodoUncheckedCreateNestedManyWithoutTodoListInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + createMany?: TodoCreateManyTodoListInputEnvelope + connect?: Enumerable + } + + export type SpaceUpdateOneRequiredWithoutTodoListsNestedInput = { + create?: XOR + connectOrCreate?: SpaceCreateOrConnectWithoutTodoListsInput + upsert?: SpaceUpsertWithoutTodoListsInput + connect?: SpaceWhereUniqueInput + update?: XOR + } + + export type UserUpdateOneRequiredWithoutTodoListNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutTodoListInput + upsert?: UserUpsertWithoutTodoListInput + connect?: UserWhereUniqueInput + update?: XOR + } + + export type BoolFieldUpdateOperationsInput = { + set?: boolean + } + + export type TodoUpdateManyWithoutTodoListNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: TodoCreateManyTodoListInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type TodoUncheckedUpdateManyWithoutTodoListNestedInput = { + create?: XOR, Enumerable> + connectOrCreate?: Enumerable + upsert?: Enumerable + createMany?: TodoCreateManyTodoListInputEnvelope + set?: Enumerable + disconnect?: Enumerable + delete?: Enumerable + connect?: Enumerable + update?: Enumerable + updateMany?: Enumerable + deleteMany?: Enumerable + } + + export type UserCreateNestedOneWithoutTodoInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutTodoInput + connect?: UserWhereUniqueInput + } + + export type TodoListCreateNestedOneWithoutTodosInput = { + create?: XOR + connectOrCreate?: TodoListCreateOrConnectWithoutTodosInput + connect?: TodoListWhereUniqueInput + } + + export type UserUpdateOneRequiredWithoutTodoNestedInput = { + create?: XOR + connectOrCreate?: UserCreateOrConnectWithoutTodoInput + upsert?: UserUpsertWithoutTodoInput + connect?: UserWhereUniqueInput + update?: XOR + } + + export type TodoListUpdateOneRequiredWithoutTodosNestedInput = { + create?: XOR + connectOrCreate?: TodoListCreateOrConnectWithoutTodosInput + upsert?: TodoListUpsertWithoutTodosInput + connect?: TodoListWhereUniqueInput + update?: XOR + } + + export type NestedStringFilter = { + equals?: string + in?: Enumerable + notIn?: Enumerable + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringFilter | string + } + + export type NestedDateTimeFilter = { + equals?: Date | string + in?: Enumerable | Enumerable + notIn?: Enumerable | Enumerable + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeFilter | Date | string + } + + export type NestedStringWithAggregatesFilter = { + equals?: string + in?: Enumerable + notIn?: Enumerable + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringWithAggregatesFilter | string + _count?: NestedIntFilter + _min?: NestedStringFilter + _max?: NestedStringFilter + } + + export type NestedIntFilter = { + equals?: number + in?: Enumerable + notIn?: Enumerable + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntFilter | number + } + + export type NestedDateTimeWithAggregatesFilter = { + equals?: Date | string + in?: Enumerable | Enumerable + notIn?: Enumerable | Enumerable + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeWithAggregatesFilter | Date | string + _count?: NestedIntFilter + _min?: NestedDateTimeFilter + _max?: NestedDateTimeFilter + } + + export type NestedEnumSpaceUserRoleFilter = { + equals?: SpaceUserRole + in?: Enumerable + notIn?: Enumerable + not?: NestedEnumSpaceUserRoleFilter | SpaceUserRole + } + + export type NestedEnumSpaceUserRoleWithAggregatesFilter = { + equals?: SpaceUserRole + in?: Enumerable + notIn?: Enumerable + not?: NestedEnumSpaceUserRoleWithAggregatesFilter | SpaceUserRole + _count?: NestedIntFilter + _min?: NestedEnumSpaceUserRoleFilter + _max?: NestedEnumSpaceUserRoleFilter + } + + export type NestedDateTimeNullableFilter = { + equals?: Date | string | null + in?: Enumerable | Enumerable | null + notIn?: Enumerable | Enumerable | null + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeNullableFilter | Date | string | null + } + + export type NestedStringNullableFilter = { + equals?: string | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringNullableFilter | string | null + } + + export type NestedDateTimeNullableWithAggregatesFilter = { + equals?: Date | string | null + in?: Enumerable | Enumerable | null + notIn?: Enumerable | Enumerable | null + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeNullableWithAggregatesFilter | Date | string | null + _count?: NestedIntNullableFilter + _min?: NestedDateTimeNullableFilter + _max?: NestedDateTimeNullableFilter + } + + export type NestedIntNullableFilter = { + equals?: number | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableFilter | number | null + } + + export type NestedStringNullableWithAggregatesFilter = { + equals?: string | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringNullableWithAggregatesFilter | string | null + _count?: NestedIntNullableFilter + _min?: NestedStringNullableFilter + _max?: NestedStringNullableFilter + } + + export type NestedIntNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedIntNullableFilter + _min?: NestedIntNullableFilter + _max?: NestedIntNullableFilter + } + + export type NestedFloatNullableFilter = { + equals?: number | null + in?: Enumerable | null + notIn?: Enumerable | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableFilter | number | null + } + + export type NestedBoolFilter = { + equals?: boolean + not?: NestedBoolFilter | boolean + } + + export type NestedBoolWithAggregatesFilter = { + equals?: boolean + not?: NestedBoolWithAggregatesFilter | boolean + _count?: NestedIntFilter + _min?: NestedBoolFilter + _max?: NestedBoolFilter + } + + export type SpaceUserCreateWithoutSpaceInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + user: UserCreateNestedOneWithoutSpacesInput + role: SpaceUserRole + } + + export type SpaceUserUncheckedCreateWithoutSpaceInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + userId: string + role: SpaceUserRole + } + + export type SpaceUserCreateOrConnectWithoutSpaceInput = { + where: SpaceUserWhereUniqueInput + create: XOR + } + + export type SpaceUserCreateManySpaceInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type TodoListCreateWithoutSpaceInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + owner: UserCreateNestedOneWithoutTodoListInput + title: string + private?: boolean + todos?: TodoCreateNestedManyWithoutTodoListInput + } + + export type TodoListUncheckedCreateWithoutSpaceInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + ownerId: string + title: string + private?: boolean + todos?: TodoUncheckedCreateNestedManyWithoutTodoListInput + } + + export type TodoListCreateOrConnectWithoutSpaceInput = { + where: TodoListWhereUniqueInput + create: XOR + } + + export type TodoListCreateManySpaceInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type SpaceUserUpsertWithWhereUniqueWithoutSpaceInput = { + where: SpaceUserWhereUniqueInput + update: XOR + create: XOR + } + + export type SpaceUserUpdateWithWhereUniqueWithoutSpaceInput = { + where: SpaceUserWhereUniqueInput + data: XOR + } + + export type SpaceUserUpdateManyWithWhereWithoutSpaceInput = { + where: SpaceUserScalarWhereInput + data: XOR + } + + export type SpaceUserScalarWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + updatedAt?: DateTimeFilter | Date | string + spaceId?: StringFilter | string + userId?: StringFilter | string + role?: EnumSpaceUserRoleFilter | SpaceUserRole + } + + export type TodoListUpsertWithWhereUniqueWithoutSpaceInput = { + where: TodoListWhereUniqueInput + update: XOR + create: XOR + } + + export type TodoListUpdateWithWhereUniqueWithoutSpaceInput = { + where: TodoListWhereUniqueInput + data: XOR + } + + export type TodoListUpdateManyWithWhereWithoutSpaceInput = { + where: TodoListScalarWhereInput + data: XOR + } + + export type TodoListScalarWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + updatedAt?: DateTimeFilter | Date | string + spaceId?: StringFilter | string + ownerId?: StringFilter | string + title?: StringFilter | string + private?: BoolFilter | boolean + } + + export type SpaceCreateWithoutMembersInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + name: string + slug: string + todoLists?: TodoListCreateNestedManyWithoutSpaceInput + } + + export type SpaceUncheckedCreateWithoutMembersInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + name: string + slug: string + todoLists?: TodoListUncheckedCreateNestedManyWithoutSpaceInput + } + + export type SpaceCreateOrConnectWithoutMembersInput = { + where: SpaceWhereUniqueInput + create: XOR + } + + export type UserCreateWithoutSpacesInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountCreateNestedManyWithoutUserInput + sessions?: SessionCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListCreateNestedManyWithoutOwnerInput + image?: string | null + Todo?: TodoCreateNestedManyWithoutOwnerInput + } + + export type UserUncheckedCreateWithoutSpacesInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountUncheckedCreateNestedManyWithoutUserInput + sessions?: SessionUncheckedCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListUncheckedCreateNestedManyWithoutOwnerInput + image?: string | null + Todo?: TodoUncheckedCreateNestedManyWithoutOwnerInput + } + + export type UserCreateOrConnectWithoutSpacesInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type SpaceUpsertWithoutMembersInput = { + update: XOR + create: XOR + } + + export type SpaceUpdateWithoutMembersInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + name?: StringFieldUpdateOperationsInput | string + slug?: StringFieldUpdateOperationsInput | string + todoLists?: TodoListUpdateManyWithoutSpaceNestedInput + } + + export type SpaceUncheckedUpdateWithoutMembersInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + name?: StringFieldUpdateOperationsInput | string + slug?: StringFieldUpdateOperationsInput | string + todoLists?: TodoListUncheckedUpdateManyWithoutSpaceNestedInput + } + + export type UserUpsertWithoutSpacesInput = { + update: XOR + create: XOR + } + + export type UserUpdateWithoutSpacesInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUpdateManyWithoutUserNestedInput + sessions?: SessionUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUpdateManyWithoutOwnerNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUpdateManyWithoutOwnerNestedInput + } + + export type UserUncheckedUpdateWithoutSpacesInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUncheckedUpdateManyWithoutUserNestedInput + sessions?: SessionUncheckedUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUncheckedUpdateManyWithoutOwnerNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUncheckedUpdateManyWithoutOwnerNestedInput + } + + export type AccountCreateWithoutUserInput = { + id?: string + type: string + provider: string + providerAccountId: string + refresh_token?: string | null + access_token?: string | null + expires_at?: number | null + token_type?: string | null + scope?: string | null + id_token?: string | null + session_state?: string | null + } + + export type AccountUncheckedCreateWithoutUserInput = { + id?: string + type: string + provider: string + providerAccountId: string + refresh_token?: string | null + access_token?: string | null + expires_at?: number | null + token_type?: string | null + scope?: string | null + id_token?: string | null + session_state?: string | null + } + + export type AccountCreateOrConnectWithoutUserInput = { + where: AccountWhereUniqueInput + create: XOR + } + + export type AccountCreateManyUserInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type SessionCreateWithoutUserInput = { + id?: string + sessionToken: string + expires: Date | string + } + + export type SessionUncheckedCreateWithoutUserInput = { + id?: string + sessionToken: string + expires: Date | string + } + + export type SessionCreateOrConnectWithoutUserInput = { + where: SessionWhereUniqueInput + create: XOR + } + + export type SessionCreateManyUserInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type TodoListCreateWithoutOwnerInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + space: SpaceCreateNestedOneWithoutTodoListsInput + title: string + private?: boolean + todos?: TodoCreateNestedManyWithoutTodoListInput + } + + export type TodoListUncheckedCreateWithoutOwnerInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + title: string + private?: boolean + todos?: TodoUncheckedCreateNestedManyWithoutTodoListInput + } + + export type TodoListCreateOrConnectWithoutOwnerInput = { + where: TodoListWhereUniqueInput + create: XOR + } + + export type TodoListCreateManyOwnerInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type SpaceUserCreateWithoutUserInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + space: SpaceCreateNestedOneWithoutMembersInput + role: SpaceUserRole + } + + export type SpaceUserUncheckedCreateWithoutUserInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + role: SpaceUserRole + } + + export type SpaceUserCreateOrConnectWithoutUserInput = { + where: SpaceUserWhereUniqueInput + create: XOR + } + + export type SpaceUserCreateManyUserInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type TodoCreateWithoutOwnerInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + todoList: TodoListCreateNestedOneWithoutTodosInput + title: string + completedAt?: Date | string | null + } + + export type TodoUncheckedCreateWithoutOwnerInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + todoListId: string + title: string + completedAt?: Date | string | null + } + + export type TodoCreateOrConnectWithoutOwnerInput = { + where: TodoWhereUniqueInput + create: XOR + } + + export type TodoCreateManyOwnerInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type AccountUpsertWithWhereUniqueWithoutUserInput = { + where: AccountWhereUniqueInput + update: XOR + create: XOR + } + + export type AccountUpdateWithWhereUniqueWithoutUserInput = { + where: AccountWhereUniqueInput + data: XOR + } + + export type AccountUpdateManyWithWhereWithoutUserInput = { + where: AccountScalarWhereInput + data: XOR + } + + export type AccountScalarWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + userId?: StringFilter | string + type?: StringFilter | string + provider?: StringFilter | string + providerAccountId?: StringFilter | string + refresh_token?: StringNullableFilter | string | null + access_token?: StringNullableFilter | string | null + expires_at?: IntNullableFilter | number | null + token_type?: StringNullableFilter | string | null + scope?: StringNullableFilter | string | null + id_token?: StringNullableFilter | string | null + session_state?: StringNullableFilter | string | null + } + + export type SessionUpsertWithWhereUniqueWithoutUserInput = { + where: SessionWhereUniqueInput + update: XOR + create: XOR + } + + export type SessionUpdateWithWhereUniqueWithoutUserInput = { + where: SessionWhereUniqueInput + data: XOR + } + + export type SessionUpdateManyWithWhereWithoutUserInput = { + where: SessionScalarWhereInput + data: XOR + } + + export type SessionScalarWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + sessionToken?: StringFilter | string + userId?: StringFilter | string + expires?: DateTimeFilter | Date | string + } + + export type TodoListUpsertWithWhereUniqueWithoutOwnerInput = { + where: TodoListWhereUniqueInput + update: XOR + create: XOR + } + + export type TodoListUpdateWithWhereUniqueWithoutOwnerInput = { + where: TodoListWhereUniqueInput + data: XOR + } + + export type TodoListUpdateManyWithWhereWithoutOwnerInput = { + where: TodoListScalarWhereInput + data: XOR + } + + export type SpaceUserUpsertWithWhereUniqueWithoutUserInput = { + where: SpaceUserWhereUniqueInput + update: XOR + create: XOR + } + + export type SpaceUserUpdateWithWhereUniqueWithoutUserInput = { + where: SpaceUserWhereUniqueInput + data: XOR + } + + export type SpaceUserUpdateManyWithWhereWithoutUserInput = { + where: SpaceUserScalarWhereInput + data: XOR + } + + export type TodoUpsertWithWhereUniqueWithoutOwnerInput = { + where: TodoWhereUniqueInput + update: XOR + create: XOR + } + + export type TodoUpdateWithWhereUniqueWithoutOwnerInput = { + where: TodoWhereUniqueInput + data: XOR + } + + export type TodoUpdateManyWithWhereWithoutOwnerInput = { + where: TodoScalarWhereInput + data: XOR + } + + export type TodoScalarWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + createdAt?: DateTimeFilter | Date | string + updatedAt?: DateTimeFilter | Date | string + ownerId?: StringFilter | string + todoListId?: StringFilter | string + title?: StringFilter | string + completedAt?: DateTimeNullableFilter | Date | string | null + } + + export type UserCreateWithoutAccountsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + sessions?: SessionCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListCreateNestedManyWithoutOwnerInput + spaces?: SpaceUserCreateNestedManyWithoutUserInput + image?: string | null + Todo?: TodoCreateNestedManyWithoutOwnerInput + } + + export type UserUncheckedCreateWithoutAccountsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + sessions?: SessionUncheckedCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListUncheckedCreateNestedManyWithoutOwnerInput + spaces?: SpaceUserUncheckedCreateNestedManyWithoutUserInput + image?: string | null + Todo?: TodoUncheckedCreateNestedManyWithoutOwnerInput + } + + export type UserCreateOrConnectWithoutAccountsInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type UserUpsertWithoutAccountsInput = { + update: XOR + create: XOR + } + + export type UserUpdateWithoutAccountsInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + sessions?: SessionUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUpdateManyWithoutOwnerNestedInput + spaces?: SpaceUserUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUpdateManyWithoutOwnerNestedInput + } + + export type UserUncheckedUpdateWithoutAccountsInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + sessions?: SessionUncheckedUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUncheckedUpdateManyWithoutOwnerNestedInput + spaces?: SpaceUserUncheckedUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUncheckedUpdateManyWithoutOwnerNestedInput + } + + export type UserCreateWithoutSessionsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListCreateNestedManyWithoutOwnerInput + spaces?: SpaceUserCreateNestedManyWithoutUserInput + image?: string | null + Todo?: TodoCreateNestedManyWithoutOwnerInput + } + + export type UserUncheckedCreateWithoutSessionsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountUncheckedCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListUncheckedCreateNestedManyWithoutOwnerInput + spaces?: SpaceUserUncheckedCreateNestedManyWithoutUserInput + image?: string | null + Todo?: TodoUncheckedCreateNestedManyWithoutOwnerInput + } + + export type UserCreateOrConnectWithoutSessionsInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type UserUpsertWithoutSessionsInput = { + update: XOR + create: XOR + } + + export type UserUpdateWithoutSessionsInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUpdateManyWithoutOwnerNestedInput + spaces?: SpaceUserUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUpdateManyWithoutOwnerNestedInput + } + + export type UserUncheckedUpdateWithoutSessionsInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUncheckedUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUncheckedUpdateManyWithoutOwnerNestedInput + spaces?: SpaceUserUncheckedUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUncheckedUpdateManyWithoutOwnerNestedInput + } + + export type SpaceCreateWithoutTodoListsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + name: string + slug: string + members?: SpaceUserCreateNestedManyWithoutSpaceInput + } + + export type SpaceUncheckedCreateWithoutTodoListsInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + name: string + slug: string + members?: SpaceUserUncheckedCreateNestedManyWithoutSpaceInput + } + + export type SpaceCreateOrConnectWithoutTodoListsInput = { + where: SpaceWhereUniqueInput + create: XOR + } + + export type UserCreateWithoutTodoListInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountCreateNestedManyWithoutUserInput + sessions?: SessionCreateNestedManyWithoutUserInput + name?: string | null + spaces?: SpaceUserCreateNestedManyWithoutUserInput + image?: string | null + Todo?: TodoCreateNestedManyWithoutOwnerInput + } + + export type UserUncheckedCreateWithoutTodoListInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountUncheckedCreateNestedManyWithoutUserInput + sessions?: SessionUncheckedCreateNestedManyWithoutUserInput + name?: string | null + spaces?: SpaceUserUncheckedCreateNestedManyWithoutUserInput + image?: string | null + Todo?: TodoUncheckedCreateNestedManyWithoutOwnerInput + } + + export type UserCreateOrConnectWithoutTodoListInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type TodoCreateWithoutTodoListInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + owner: UserCreateNestedOneWithoutTodoInput + title: string + completedAt?: Date | string | null + } + + export type TodoUncheckedCreateWithoutTodoListInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + ownerId: string + title: string + completedAt?: Date | string | null + } + + export type TodoCreateOrConnectWithoutTodoListInput = { + where: TodoWhereUniqueInput + create: XOR + } + + export type TodoCreateManyTodoListInputEnvelope = { + data: Enumerable + skipDuplicates?: boolean + } + + export type SpaceUpsertWithoutTodoListsInput = { + update: XOR + create: XOR + } + + export type SpaceUpdateWithoutTodoListsInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + name?: StringFieldUpdateOperationsInput | string + slug?: StringFieldUpdateOperationsInput | string + members?: SpaceUserUpdateManyWithoutSpaceNestedInput + } + + export type SpaceUncheckedUpdateWithoutTodoListsInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + name?: StringFieldUpdateOperationsInput | string + slug?: StringFieldUpdateOperationsInput | string + members?: SpaceUserUncheckedUpdateManyWithoutSpaceNestedInput + } + + export type UserUpsertWithoutTodoListInput = { + update: XOR + create: XOR + } + + export type UserUpdateWithoutTodoListInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUpdateManyWithoutUserNestedInput + sessions?: SessionUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + spaces?: SpaceUserUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUpdateManyWithoutOwnerNestedInput + } + + export type UserUncheckedUpdateWithoutTodoListInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUncheckedUpdateManyWithoutUserNestedInput + sessions?: SessionUncheckedUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + spaces?: SpaceUserUncheckedUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + Todo?: TodoUncheckedUpdateManyWithoutOwnerNestedInput + } + + export type TodoUpsertWithWhereUniqueWithoutTodoListInput = { + where: TodoWhereUniqueInput + update: XOR + create: XOR + } + + export type TodoUpdateWithWhereUniqueWithoutTodoListInput = { + where: TodoWhereUniqueInput + data: XOR + } + + export type TodoUpdateManyWithWhereWithoutTodoListInput = { + where: TodoScalarWhereInput + data: XOR + } + + export type UserCreateWithoutTodoInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountCreateNestedManyWithoutUserInput + sessions?: SessionCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListCreateNestedManyWithoutOwnerInput + spaces?: SpaceUserCreateNestedManyWithoutUserInput + image?: string | null + } + + export type UserUncheckedCreateWithoutTodoInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + email: string + emailVerified?: Date | string | null + password: string + accounts?: AccountUncheckedCreateNestedManyWithoutUserInput + sessions?: SessionUncheckedCreateNestedManyWithoutUserInput + name?: string | null + todoList?: TodoListUncheckedCreateNestedManyWithoutOwnerInput + spaces?: SpaceUserUncheckedCreateNestedManyWithoutUserInput + image?: string | null + } + + export type UserCreateOrConnectWithoutTodoInput = { + where: UserWhereUniqueInput + create: XOR + } + + export type TodoListCreateWithoutTodosInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + space: SpaceCreateNestedOneWithoutTodoListsInput + owner: UserCreateNestedOneWithoutTodoListInput + title: string + private?: boolean + } + + export type TodoListUncheckedCreateWithoutTodosInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + ownerId: string + title: string + private?: boolean + } + + export type TodoListCreateOrConnectWithoutTodosInput = { + where: TodoListWhereUniqueInput + create: XOR + } + + export type UserUpsertWithoutTodoInput = { + update: XOR + create: XOR + } + + export type UserUpdateWithoutTodoInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUpdateManyWithoutUserNestedInput + sessions?: SessionUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUpdateManyWithoutOwnerNestedInput + spaces?: SpaceUserUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type UserUncheckedUpdateWithoutTodoInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + email?: StringFieldUpdateOperationsInput | string + emailVerified?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + password?: StringFieldUpdateOperationsInput | string + accounts?: AccountUncheckedUpdateManyWithoutUserNestedInput + sessions?: SessionUncheckedUpdateManyWithoutUserNestedInput + name?: NullableStringFieldUpdateOperationsInput | string | null + todoList?: TodoListUncheckedUpdateManyWithoutOwnerNestedInput + spaces?: SpaceUserUncheckedUpdateManyWithoutUserNestedInput + image?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type TodoListUpsertWithoutTodosInput = { + update: XOR + create: XOR + } + + export type TodoListUpdateWithoutTodosInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + space?: SpaceUpdateOneRequiredWithoutTodoListsNestedInput + owner?: UserUpdateOneRequiredWithoutTodoListNestedInput + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + } + + export type TodoListUncheckedUpdateWithoutTodosInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + ownerId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + } + + export type SpaceUserCreateManySpaceInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + userId: string + role: SpaceUserRole + } + + export type TodoListCreateManySpaceInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + ownerId: string + title: string + private?: boolean + } + + export type SpaceUserUpdateWithoutSpaceInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + user?: UserUpdateOneRequiredWithoutSpacesNestedInput + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type SpaceUserUncheckedUpdateWithoutSpaceInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + userId?: StringFieldUpdateOperationsInput | string + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type SpaceUserUncheckedUpdateManyWithoutMembersInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + userId?: StringFieldUpdateOperationsInput | string + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type TodoListUpdateWithoutSpaceInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + owner?: UserUpdateOneRequiredWithoutTodoListNestedInput + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + todos?: TodoUpdateManyWithoutTodoListNestedInput + } + + export type TodoListUncheckedUpdateWithoutSpaceInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + ownerId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + todos?: TodoUncheckedUpdateManyWithoutTodoListNestedInput + } + + export type TodoListUncheckedUpdateManyWithoutTodoListsInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + ownerId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + } + + export type AccountCreateManyUserInput = { + id?: string + type: string + provider: string + providerAccountId: string + refresh_token?: string | null + access_token?: string | null + expires_at?: number | null + token_type?: string | null + scope?: string | null + id_token?: string | null + session_state?: string | null + } + + export type SessionCreateManyUserInput = { + id?: string + sessionToken: string + expires: Date | string + } + + export type TodoListCreateManyOwnerInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + title: string + private?: boolean + } + + export type SpaceUserCreateManyUserInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + spaceId: string + role: SpaceUserRole + } + + export type TodoCreateManyOwnerInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + todoListId: string + title: string + completedAt?: Date | string | null + } + + export type AccountUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + provider?: StringFieldUpdateOperationsInput | string + providerAccountId?: StringFieldUpdateOperationsInput | string + refresh_token?: NullableStringFieldUpdateOperationsInput | string | null + access_token?: NullableStringFieldUpdateOperationsInput | string | null + expires_at?: NullableIntFieldUpdateOperationsInput | number | null + token_type?: NullableStringFieldUpdateOperationsInput | string | null + scope?: NullableStringFieldUpdateOperationsInput | string | null + id_token?: NullableStringFieldUpdateOperationsInput | string | null + session_state?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type AccountUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + provider?: StringFieldUpdateOperationsInput | string + providerAccountId?: StringFieldUpdateOperationsInput | string + refresh_token?: NullableStringFieldUpdateOperationsInput | string | null + access_token?: NullableStringFieldUpdateOperationsInput | string | null + expires_at?: NullableIntFieldUpdateOperationsInput | number | null + token_type?: NullableStringFieldUpdateOperationsInput | string | null + scope?: NullableStringFieldUpdateOperationsInput | string | null + id_token?: NullableStringFieldUpdateOperationsInput | string | null + session_state?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type AccountUncheckedUpdateManyWithoutAccountsInput = { + id?: StringFieldUpdateOperationsInput | string + type?: StringFieldUpdateOperationsInput | string + provider?: StringFieldUpdateOperationsInput | string + providerAccountId?: StringFieldUpdateOperationsInput | string + refresh_token?: NullableStringFieldUpdateOperationsInput | string | null + access_token?: NullableStringFieldUpdateOperationsInput | string | null + expires_at?: NullableIntFieldUpdateOperationsInput | number | null + token_type?: NullableStringFieldUpdateOperationsInput | string | null + scope?: NullableStringFieldUpdateOperationsInput | string | null + id_token?: NullableStringFieldUpdateOperationsInput | string | null + session_state?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type SessionUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + sessionToken?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SessionUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + sessionToken?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SessionUncheckedUpdateManyWithoutSessionsInput = { + id?: StringFieldUpdateOperationsInput | string + sessionToken?: StringFieldUpdateOperationsInput | string + expires?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TodoListUpdateWithoutOwnerInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + space?: SpaceUpdateOneRequiredWithoutTodoListsNestedInput + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + todos?: TodoUpdateManyWithoutTodoListNestedInput + } + + export type TodoListUncheckedUpdateWithoutOwnerInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + todos?: TodoUncheckedUpdateManyWithoutTodoListNestedInput + } + + export type TodoListUncheckedUpdateManyWithoutTodoListInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + private?: BoolFieldUpdateOperationsInput | boolean + } + + export type SpaceUserUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + space?: SpaceUpdateOneRequiredWithoutMembersNestedInput + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type SpaceUserUncheckedUpdateWithoutUserInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type SpaceUserUncheckedUpdateManyWithoutSpacesInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + spaceId?: StringFieldUpdateOperationsInput | string + role?: EnumSpaceUserRoleFieldUpdateOperationsInput | SpaceUserRole + } + + export type TodoUpdateWithoutOwnerInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + todoList?: TodoListUpdateOneRequiredWithoutTodosNestedInput + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type TodoUncheckedUpdateWithoutOwnerInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + todoListId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type TodoUncheckedUpdateManyWithoutTodoInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + todoListId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type TodoCreateManyTodoListInput = { + id?: string + createdAt?: Date | string + updatedAt?: Date | string + ownerId: string + title: string + completedAt?: Date | string | null + } + + export type TodoUpdateWithoutTodoListInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + owner?: UserUpdateOneRequiredWithoutTodoNestedInput + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type TodoUncheckedUpdateWithoutTodoListInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + ownerId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type TodoUncheckedUpdateManyWithoutTodosInput = { + id?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + ownerId?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + completedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + + + /** + * 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/samples/todo/.zenstack/.prisma/index.js b/samples/todo/.zenstack/.prisma/index.js new file mode 100644 index 000000000..72d908a1d --- /dev/null +++ b/samples/todo/.zenstack/.prisma/index.js @@ -0,0 +1,260 @@ + +Object.defineProperty(exports, "__esModule", { value: true }); + +const { + PrismaClientKnownRequestError, + PrismaClientUnknownRequestError, + PrismaClientRustPanicError, + PrismaClientInitializationError, + PrismaClientValidationError, + NotFoundError, + decompressFromBase64, + getPrismaClient, + sqltag, + empty, + join, + raw, + Decimal, + Debug, + objectEnumValues, + makeStrictEnum +} = require('./runtime/index') + + +const Prisma = {} + +exports.Prisma = Prisma + +/** + * Prisma Client JS version: 4.3.1 + * Query Engine version: c875e43600dfe042452e0b868f7a48b817b9640b + */ +Prisma.prismaVersion = { + client: "4.3.1", + engine: "c875e43600dfe042452e0b868f7a48b817b9640b" +} + +Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; +Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError +Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError +Prisma.PrismaClientInitializationError = PrismaClientInitializationError +Prisma.PrismaClientValidationError = PrismaClientValidationError +Prisma.NotFoundError = NotFoundError +Prisma.Decimal = Decimal + +/** + * Re-export of sql-template-tag + */ +Prisma.sql = sqltag +Prisma.empty = empty +Prisma.join = join +Prisma.raw = raw +Prisma.validator = () => (val) => val + +/** + * 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') + +const { findSync } = require('./runtime') +const fs = require('fs') + +// some frameworks or bundlers replace or totally remove __dirname +const hasDirname = typeof __dirname !== 'undefined' && __dirname !== '/' + +// will work in most cases, ie. if the client has not been bundled +const regularDirname = hasDirname && fs.existsSync(path.join(__dirname, 'schema.prisma')) && __dirname + +// if the client has been bundled, we need to look for the folders +const foundDirname = !regularDirname && findSync(process.cwd(), [ + ".zenstack/.prisma", + ".prisma", +], ['d'], ['d'], 1)[0] + +const dirname = regularDirname || foundDirname || __dirname + +/** + * Enums + */ +// Based on +// https://github.com/microsoft/TypeScript/issues/3192#issuecomment-261720275 +function makeEnum(x) { return x; } + +exports.Prisma.AccountScalarFieldEnum = makeEnum({ + id: 'id', + userId: 'userId', + type: 'type', + provider: 'provider', + providerAccountId: 'providerAccountId', + refresh_token: 'refresh_token', + access_token: 'access_token', + expires_at: 'expires_at', + token_type: 'token_type', + scope: 'scope', + id_token: 'id_token', + session_state: 'session_state' +}); + +exports.Prisma.QueryMode = makeEnum({ + default: 'default', + insensitive: 'insensitive' +}); + +exports.Prisma.SessionScalarFieldEnum = makeEnum({ + id: 'id', + sessionToken: 'sessionToken', + userId: 'userId', + expires: 'expires' +}); + +exports.Prisma.SortOrder = makeEnum({ + asc: 'asc', + desc: 'desc' +}); + +exports.Prisma.SpaceScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + name: 'name', + slug: 'slug' +}); + +exports.Prisma.SpaceUserScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + spaceId: 'spaceId', + userId: 'userId', + role: 'role' +}); + +exports.Prisma.TodoListScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + spaceId: 'spaceId', + ownerId: 'ownerId', + title: 'title', + private: 'private' +}); + +exports.Prisma.TodoScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + ownerId: 'ownerId', + todoListId: 'todoListId', + title: 'title', + completedAt: 'completedAt' +}); + +exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +}); + +exports.Prisma.UserScalarFieldEnum = makeEnum({ + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + email: 'email', + emailVerified: 'emailVerified', + password: 'password', + name: 'name', + image: 'image' +}); + +exports.Prisma.VerificationTokenScalarFieldEnum = makeEnum({ + identifier: 'identifier', + token: 'token', + expires: 'expires' +}); +exports.SpaceUserRole = makeEnum({ + USER: 'USER', + ADMIN: 'ADMIN' +}); + +exports.Prisma.ModelName = makeEnum({ + Space: 'Space', + SpaceUser: 'SpaceUser', + User: 'User', + Account: 'Account', + Session: 'Session', + VerificationToken: 'VerificationToken', + TodoList: 'TodoList', + Todo: 'Todo' +}); + +const dmmfString = "{\"datamodel\":{\"enums\":[{\"name\":\"SpaceUserRole\",\"values\":[{\"name\":\"USER\",\"dbName\":null},{\"name\":\"ADMIN\",\"dbName\":null}],\"dbName\":null}],\"models\":[{\"name\":\"Space\",\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"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\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"slug\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"members\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SpaceUser\",\"relationName\":\"SpaceToSpaceUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"todoLists\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"TodoList\",\"relationName\":\"SpaceToTodoList\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},{\"name\":\"SpaceUser\",\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"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\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"spaceId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"space\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Space\",\"relationName\":\"SpaceToSpaceUser\",\"relationFromFields\":[\"spaceId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"SpaceUserToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SpaceUserRole\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},{\"name\":\"User\",\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"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\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"emailVerified\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"password\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accounts\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Account\",\"relationName\":\"AccountToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sessions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Session\",\"relationName\":\"SessionToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"todoList\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"TodoList\",\"relationName\":\"TodoListToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"spaces\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SpaceUser\",\"relationName\":\"SpaceUserToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"image\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"Todo\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Todo\",\"relationName\":\"TodoToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},{\"name\":\"Account\",\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"providerAccountId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"refresh_token\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"access_token\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expires_at\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"token_type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scope\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"id_token\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"session_state\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"AccountToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"providerAccountId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"providerAccountId\"]}],\"isGenerated\":false},{\"name\":\"Session\",\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sessionToken\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expires\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"SessionToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},{\"name\":\"VerificationToken\",\"dbName\":null,\"fields\":[{\"name\":\"identifier\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"token\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expires\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"identifier\",\"token\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"identifier\",\"token\"]}],\"isGenerated\":false},{\"name\":\"TodoList\",\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"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\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"spaceId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"space\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Space\",\"relationName\":\"SpaceToTodoList\",\"relationFromFields\":[\"spaceId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ownerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"owner\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"TodoListToUser\",\"relationFromFields\":[\"ownerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"private\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"todos\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Todo\",\"relationName\":\"TodoToTodoList\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},{\"name\":\"Todo\",\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"uuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"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\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"ownerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"owner\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"TodoToUser\",\"relationFromFields\":[\"ownerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"todoListId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"todoList\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"TodoList\",\"relationName\":\"TodoToTodoList\",\"relationFromFields\":[\"todoListId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"completedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}],\"types\":[]},\"mappings\":{\"modelOperations\":[{\"model\":\"Space\",\"plural\":\"spaces\",\"findUnique\":\"findUniqueSpace\",\"findFirst\":\"findFirstSpace\",\"findMany\":\"findManySpace\",\"create\":\"createOneSpace\",\"createMany\":\"createManySpace\",\"delete\":\"deleteOneSpace\",\"update\":\"updateOneSpace\",\"deleteMany\":\"deleteManySpace\",\"updateMany\":\"updateManySpace\",\"upsert\":\"upsertOneSpace\",\"aggregate\":\"aggregateSpace\",\"groupBy\":\"groupBySpace\"},{\"model\":\"SpaceUser\",\"plural\":\"spaceUsers\",\"findUnique\":\"findUniqueSpaceUser\",\"findFirst\":\"findFirstSpaceUser\",\"findMany\":\"findManySpaceUser\",\"create\":\"createOneSpaceUser\",\"createMany\":\"createManySpaceUser\",\"delete\":\"deleteOneSpaceUser\",\"update\":\"updateOneSpaceUser\",\"deleteMany\":\"deleteManySpaceUser\",\"updateMany\":\"updateManySpaceUser\",\"upsert\":\"upsertOneSpaceUser\",\"aggregate\":\"aggregateSpaceUser\",\"groupBy\":\"groupBySpaceUser\"},{\"model\":\"User\",\"plural\":\"users\",\"findUnique\":\"findUniqueUser\",\"findFirst\":\"findFirstUser\",\"findMany\":\"findManyUser\",\"create\":\"createOneUser\",\"createMany\":\"createManyUser\",\"delete\":\"deleteOneUser\",\"update\":\"updateOneUser\",\"deleteMany\":\"deleteManyUser\",\"updateMany\":\"updateManyUser\",\"upsert\":\"upsertOneUser\",\"aggregate\":\"aggregateUser\",\"groupBy\":\"groupByUser\"},{\"model\":\"Account\",\"plural\":\"accounts\",\"findUnique\":\"findUniqueAccount\",\"findFirst\":\"findFirstAccount\",\"findMany\":\"findManyAccount\",\"create\":\"createOneAccount\",\"createMany\":\"createManyAccount\",\"delete\":\"deleteOneAccount\",\"update\":\"updateOneAccount\",\"deleteMany\":\"deleteManyAccount\",\"updateMany\":\"updateManyAccount\",\"upsert\":\"upsertOneAccount\",\"aggregate\":\"aggregateAccount\",\"groupBy\":\"groupByAccount\"},{\"model\":\"Session\",\"plural\":\"sessions\",\"findUnique\":\"findUniqueSession\",\"findFirst\":\"findFirstSession\",\"findMany\":\"findManySession\",\"create\":\"createOneSession\",\"createMany\":\"createManySession\",\"delete\":\"deleteOneSession\",\"update\":\"updateOneSession\",\"deleteMany\":\"deleteManySession\",\"updateMany\":\"updateManySession\",\"upsert\":\"upsertOneSession\",\"aggregate\":\"aggregateSession\",\"groupBy\":\"groupBySession\"},{\"model\":\"VerificationToken\",\"plural\":\"verificationTokens\",\"findUnique\":\"findUniqueVerificationToken\",\"findFirst\":\"findFirstVerificationToken\",\"findMany\":\"findManyVerificationToken\",\"create\":\"createOneVerificationToken\",\"createMany\":\"createManyVerificationToken\",\"delete\":\"deleteOneVerificationToken\",\"update\":\"updateOneVerificationToken\",\"deleteMany\":\"deleteManyVerificationToken\",\"updateMany\":\"updateManyVerificationToken\",\"upsert\":\"upsertOneVerificationToken\",\"aggregate\":\"aggregateVerificationToken\",\"groupBy\":\"groupByVerificationToken\"},{\"model\":\"TodoList\",\"plural\":\"todoLists\",\"findUnique\":\"findUniqueTodoList\",\"findFirst\":\"findFirstTodoList\",\"findMany\":\"findManyTodoList\",\"create\":\"createOneTodoList\",\"createMany\":\"createManyTodoList\",\"delete\":\"deleteOneTodoList\",\"update\":\"updateOneTodoList\",\"deleteMany\":\"deleteManyTodoList\",\"updateMany\":\"updateManyTodoList\",\"upsert\":\"upsertOneTodoList\",\"aggregate\":\"aggregateTodoList\",\"groupBy\":\"groupByTodoList\"},{\"model\":\"Todo\",\"plural\":\"todos\",\"findUnique\":\"findUniqueTodo\",\"findFirst\":\"findFirstTodo\",\"findMany\":\"findManyTodo\",\"create\":\"createOneTodo\",\"createMany\":\"createManyTodo\",\"delete\":\"deleteOneTodo\",\"update\":\"updateOneTodo\",\"deleteMany\":\"deleteManyTodo\",\"updateMany\":\"updateManyTodo\",\"upsert\":\"upsertOneTodo\",\"aggregate\":\"aggregateTodo\",\"groupBy\":\"groupByTodo\"}],\"otherOperations\":{\"read\":[],\"write\":[\"executeRaw\",\"queryRaw\"]}}}" +const dmmf = JSON.parse(dmmfString) +exports.Prisma.dmmf = JSON.parse(dmmfString) + +/** + * Create the Client + */ +const config = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client-js" + }, + "output": { + "value": "/Users/yiming/git/zenstack/zenstack/samples/todo/.zenstack/.prisma", + "fromEnvVar": null + }, + "config": { + "engineType": "library" + }, + "binaryTargets": [], + "previewFeatures": [], + "isCustomOutput": true + }, + "relativeEnvPaths": { + "rootEnvPath": "../../.env", + "schemaEnvPath": "../../.env" + }, + "relativePath": "..", + "clientVersion": "4.3.1", + "engineVersion": "c875e43600dfe042452e0b868f7a48b817b9640b", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "dataProxy": false +} +config.document = dmmf +config.dirname = dirname + + + + +const { warnEnvConflicts } = require('./runtime/index') + +warnEnvConflicts({ + rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(dirname, config.relativeEnvPaths.rootEnvPath), + schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(dirname, config.relativeEnvPaths.schemaEnvPath) +}) + +const PrismaClient = getPrismaClient(config) +exports.PrismaClient = PrismaClient +Object.assign(exports, Prisma) + +path.join(__dirname, "libquery_engine-darwin-arm64.dylib.node"); +path.join(process.cwd(), ".zenstack/.prisma/libquery_engine-darwin-arm64.dylib.node") +path.join(__dirname, "schema.prisma"); +path.join(process.cwd(), ".zenstack/.prisma/schema.prisma") diff --git a/samples/todo/.zenstack/.prisma/libquery_engine-darwin-arm64.dylib.node b/samples/todo/.zenstack/.prisma/libquery_engine-darwin-arm64.dylib.node new file mode 100755 index 000000000..970d97d48 Binary files /dev/null and b/samples/todo/.zenstack/.prisma/libquery_engine-darwin-arm64.dylib.node differ diff --git a/samples/todo/.zenstack/.prisma/package.json b/samples/todo/.zenstack/.prisma/package.json new file mode 100644 index 000000000..9e7a6db78 --- /dev/null +++ b/samples/todo/.zenstack/.prisma/package.json @@ -0,0 +1,6 @@ +{ + "name": ".prisma/client", + "main": "index.js", + "types": "index.d.ts", + "browser": "index-browser.js" +} \ No newline at end of file diff --git a/samples/todo/.zenstack/.prisma/runtime/edge.js b/samples/todo/.zenstack/.prisma/runtime/edge.js new file mode 100644 index 000000000..10455e80c --- /dev/null +++ b/samples/todo/.zenstack/.prisma/runtime/edge.js @@ -0,0 +1,98 @@ +"use strict";var nl=Object.create;var mr=Object.defineProperty;var ol=Object.getOwnPropertyDescriptor;var il=Object.getOwnPropertyNames;var sl=Object.getPrototypeOf,al=Object.prototype.hasOwnProperty;var u=(e,t)=>mr(e,"name",{value:t,configurable:!0});var rn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wi=(e,t)=>{for(var r in t)mr(e,r,{get:t[r],enumerable:!0})},Hi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of il(t))!al.call(e,o)&&o!==r&&mr(e,o,{get:()=>t[o],enumerable:!(n=ol(t,o))||n.enumerable});return e};var Z=(e,t,r)=>(r=e!=null?nl(sl(e)):{},Hi(t||!e||!e.__esModule?mr(r,"default",{value:e,enumerable:!0}):r,e)),ul=e=>Hi(mr({},"__esModule",{value:!0}),e);function q(e){return()=>e}function Fe(){return v}var cl,v,p=rn(()=>{"use strict";u(q,"noop");cl=Promise.resolve();u(Fe,"getProcess");v={abort:q(void 0),addListener:q(Fe()),allowedNodeEnvironmentFlags:new Set,arch:"x64",argv:["/bin/node"],argv0:"node",chdir:q(void 0),config:{target_defaults:{cflags:[],default_configuration:"",defines:[],include_dirs:[],libraries:[]},variables:{clang:0,host_arch:"x64",node_install_npm:!1,node_install_waf:!1,node_prefix:"",node_shared_openssl:!1,node_shared_v8:!1,node_shared_zlib:!1,node_use_dtrace:!1,node_use_etw:!1,node_use_openssl:!1,target_arch:"x64",v8_no_strict_aliasing:0,v8_use_snapshot:!1,visibility:""}},connected:!1,cpuUsage:()=>({user:0,system:0}),cwd:()=>"/",debugPort:0,disconnect:q(void 0),domain:{run:q(void 0),add:q(void 0),remove:q(void 0),bind:q(void 0),intercept:q(void 0),...Fe()},emit:q(Fe()),emitWarning:q(void 0),env:{},eventNames:()=>[],execArgv:[],execPath:"/",exit:q(void 0),features:{inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1},getMaxListeners:q(0),getegid:q(0),geteuid:q(0),getgid:q(0),getgroups:q([]),getuid:q(0),hasUncaughtExceptionCaptureCallback:q(!1),hrtime:q([0,0]),platform:"linux",kill:q(!0),listenerCount:q(0),listeners:q([]),memoryUsage:q({arrayBuffers:0,external:0,heapTotal:0,heapUsed:0,rss:0}),nextTick:(e,...t)=>{cl.then(()=>e(...t)).catch(r=>{setTimeout(()=>{throw r},0)})},off:q(Fe()),on:q(Fe()),once:q(Fe()),openStdin:q({}),pid:0,ppid:0,prependListener:q(Fe()),prependOnceListener:q(Fe()),rawListeners:q([]),release:{name:"node"},removeAllListeners:q(Fe()),removeListener:q(Fe()),resourceUsage:q({fsRead:0,fsWrite:0,involuntaryContextSwitches:0,ipcReceived:0,ipcSent:0,majorPageFault:0,maxRSS:0,minorPageFault:0,sharedMemorySize:0,signalsCount:0,swappedOut:0,systemCPUTime:0,unsharedDataSize:0,unsharedStackSize:0,userCPUTime:0,voluntaryContextSwitches:0}),setMaxListeners:q(Fe()),setUncaughtExceptionCaptureCallback:q(void 0),setegid:q(void 0),seteuid:q(void 0),setgid:q(void 0),setgroups:q(void 0),setuid:q(void 0),stderr:{fd:2},stdin:{fd:0},stdout:{fd:1},title:"node",traceDeprecation:!1,umask:q(0),uptime:q(0),version:"",versions:{http_parser:"",node:"",v8:"",ares:"",uv:"",zlib:"",modules:"",openssl:""}}});var E,m=rn(()=>{"use strict";E=u(()=>{},"fn");E.prototype=E});var ms=Q(Lt=>{"use strict";d();p();m();var Xi=u((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"q"),ll=Xi(e=>{"use strict";e.byteLength=c,e.toByteArray=f,e.fromByteArray=w;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(i=0,s=o.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var T=b.indexOf("=");T===-1&&(T=y);var M=T===y?0:4-T%4;return[T,M]}u(a,"j");function c(b){var y=a(b),T=y[0],M=y[1];return(T+M)*3/4-M}u(c,"sr");function l(b,y,T){return(y+T)*3/4-T}u(l,"lr");function f(b){var y,T=a(b),M=T[0],A=T[1],S=new n(l(b,M,A)),P=0,_=A>0?M-4:M,I;for(I=0;I<_;I+=4)y=r[b.charCodeAt(I)]<<18|r[b.charCodeAt(I+1)]<<12|r[b.charCodeAt(I+2)]<<6|r[b.charCodeAt(I+3)],S[P++]=y>>16&255,S[P++]=y>>8&255,S[P++]=y&255;return A===2&&(y=r[b.charCodeAt(I)]<<2|r[b.charCodeAt(I+1)]>>4,S[P++]=y&255),A===1&&(y=r[b.charCodeAt(I)]<<10|r[b.charCodeAt(I+1)]<<4|r[b.charCodeAt(I+2)]>>2,S[P++]=y>>8&255,S[P++]=y&255),S}u(f,"ar");function g(b){return t[b>>18&63]+t[b>>12&63]+t[b>>6&63]+t[b&63]}u(g,"yr");function h(b,y,T){for(var M,A=[],S=y;S_?_:P+S));return M===1?(y=b[T-1],A.push(t[y>>2]+t[y<<4&63]+"==")):M===2&&(y=(b[T-2]<<8)+b[T-1],A.push(t[y>>10]+t[y>>4&63]+t[y<<2&63]+"=")),A.join("")}u(w,"xr")}),fl=Xi(e=>{e.read=function(t,r,n,o,i){var s,a,c=i*8-o-1,l=(1<>1,g=-7,h=n?i-1:0,w=n?-1:1,b=t[r+h];for(h+=w,s=b&(1<<-g)-1,b>>=-g,g+=c;g>0;s=s*256+t[r+h],h+=w,g-=8);for(a=s&(1<<-g)-1,s>>=-g,g+=o;g>0;a=a*256+t[r+h],h+=w,g-=8);if(s===0)s=1-f;else{if(s===l)return a?NaN:(b?-1:1)*(1/0);a=a+Math.pow(2,o),s=s-f}return(b?-1:1)*a*Math.pow(2,s-o)},e.write=function(t,r,n,o,i,s){var a,c,l,f=s*8-i-1,g=(1<>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=o?0:s-1,y=o?1:-1,T=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=g):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?r+=w/l:r+=w*Math.pow(2,1-h),r*l>=2&&(a++,l/=2),a+h>=g?(c=0,a=g):a+h>=1?(c=(r*l-1)*Math.pow(2,i),a=a+h):(c=r*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+b]=c&255,b+=y,c/=256,i-=8);for(a=a<0;t[n+b]=a&255,b+=y,a/=256,f-=8);t[n+b-y]|=T*128}}),fo=ll(),$t=fl(),Qi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Lt.Buffer=O;Lt.SlowBuffer=yl;Lt.INSPECT_MAX_BYTES=50;var nn=2147483647;Lt.kMaxLength=nn;O.TYPED_ARRAY_SUPPORT=pl();!O.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 pl(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}u(pl,"Br");Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}});Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function Ke(e){if(e>nn)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,O.prototype),t}u(Ke,"d");function O(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 go(e)}return es(e,t,r)}u(O,"h");O.poolSize=8192;function es(e,t,r){if(typeof e=="string")return dl(e,t);if(ArrayBuffer.isView(e))return gl(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(Ue(e,ArrayBuffer)||e&&Ue(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ue(e,SharedArrayBuffer)||e&&Ue(e.buffer,SharedArrayBuffer)))return rs(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 O.from(n,t,r);let o=hl(e);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return O.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)}u(es,"Z");O.from=function(e,t,r){return es(e,t,r)};Object.setPrototypeOf(O.prototype,Uint8Array.prototype);Object.setPrototypeOf(O,Uint8Array);function ts(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"')}u(ts,"Q");function ml(e,t,r){return ts(e),e<=0?Ke(e):t!==void 0?typeof r=="string"?Ke(e).fill(t,r):Ke(e).fill(t):Ke(e)}u(ml,"Er");O.alloc=function(e,t,r){return ml(e,t,r)};function go(e){return ts(e),Ke(e<0?0:ho(e)|0)}u(go,"P");O.allocUnsafe=function(e){return go(e)};O.allocUnsafeSlow=function(e){return go(e)};function dl(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!O.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=ns(e,t)|0,n=Ke(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}u(dl,"dr");function po(e){let t=e.length<0?0:ho(e.length)|0,r=Ke(t);for(let n=0;n=nn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+nn.toString(16)+" bytes");return e|0}u(ho,"O");function yl(e){return+e!=e&&(e=0),O.alloc(+e)}u(yl,"Ir");O.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==O.prototype};O.compare=function(e,t){if(Ue(e,Uint8Array)&&(e=O.from(e,e.offset,e.byteLength)),Ue(t,Uint8Array)&&(t=O.from(t,t.offset,t.byteLength)),!O.isBuffer(e)||!O.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);on.length?(O.isBuffer(i)||(i=O.from(i)),i.copy(n,o)):Uint8Array.prototype.set.call(n,i,o);else if(O.isBuffer(i))i.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=i.length}return n};function ns(e,t){if(O.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Ue(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return mo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ps(e).length;default:if(o)return n?-1:mo(e).length;t=(""+t).toLowerCase(),o=!0}}u(ns,"v");O.byteLength=ns;function bl(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 Ol(this,t,r);case"utf8":case"utf-8":return is(this,t,r);case"ascii":return Pl(this,t,r);case"latin1":case"binary":return Sl(this,t,r);case"base64":return Tl(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _l(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u(bl,"Fr");O.prototype._isBuffer=!0;function Pt(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}u(Pt,"I");O.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+=" ... "),""};Qi&&(O.prototype[Qi]=O.prototype.inspect);O.prototype.compare=function(e,t,r,n,o){if(Ue(e,Uint8Array)&&(e=O.from(e,e.offset,e.byteLength)),!O.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let i=o-n,s=r-t,a=Math.min(i,s),c=this.slice(n,o),l=e.slice(t,r);for(let f=0;f2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,bo(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof t=="string"&&(t=O.from(t,n)),O.isBuffer(t))return t.length===0?-1:Ki(e,t,r,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Ki(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}u(os,"rr");function Ki(e,t,r,n,o){let i=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;i=2,s/=2,a/=2,r/=2}function c(f,g){return i===1?f[g]:f.readUInt16BE(g*i)}u(c,"c");let l;if(o){let f=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let f=!0;for(let g=0;go&&(n=o)):n=o;let i=t.length;n>i/2&&(n=i/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((r===void 0||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return wl(this,e,t,r);case"utf8":case"utf-8":return vl(this,e,t,r);case"ascii":case"latin1":case"binary":return xl(this,e,t,r);case"base64":return El(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Al(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}};O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Tl(e,t,r){return t===0&&r===e.length?fo.fromByteArray(e):fo.fromByteArray(e.slice(t,r))}u(Tl,"Sr");function is(e,t,r){r=Math.min(e.length,r);let n=[],o=t;for(;o239?4:i>223?3:i>191?2:1;if(o+a<=r){let c,l,f,g;switch(a){case 1:i<128&&(s=i);break;case 2:c=e[o+1],(c&192)===128&&(g=(i&31)<<6|c&63,g>127&&(s=g));break;case 3:c=e[o+1],l=e[o+2],(c&192)===128&&(l&192)===128&&(g=(i&15)<<12|(c&63)<<6|l&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:c=e[o+1],l=e[o+2],f=e[o+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(g=(i&15)<<18|(c&63)<<12|(l&63)<<6|f&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),o+=a}return Ml(n)}u(is,"tr");var Yi=4096;function Ml(e){let t=e.length;if(t<=Yi)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let o="";for(let i=t;ir&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}u(ie,"a");O.prototype.readUintLE=O.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||ie(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>0,t=t>>>0,r||ie(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n};O.prototype.readUint8=O.prototype.readUInt8=function(e,t){return e=e>>>0,t||ie(e,1,this.length),this[e]};O.prototype.readUint16LE=O.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||ie(e,2,this.length),this[e]|this[e+1]<<8};O.prototype.readUint16BE=O.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||ie(e,2,this.length),this[e]<<8|this[e+1]};O.prototype.readUint32LE=O.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};O.prototype.readUint32BE=O.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};O.prototype.readBigUInt64LE=st(function(e){e=e>>>0,jt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&dr(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(o)<>>0,jt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&dr(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||ie(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n};O.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||ie(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};O.prototype.readInt8=function(e,t){return e=e>>>0,t||ie(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};O.prototype.readInt16LE=function(e,t){e=e>>>0,t||ie(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};O.prototype.readInt16BE=function(e,t){e=e>>>0,t||ie(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};O.prototype.readInt32LE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};O.prototype.readInt32BE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};O.prototype.readBigInt64LE=st(function(e){e=e>>>0,jt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&dr(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,jt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&dr(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||ie(e,4,this.length),$t.read(this,e,!0,23,4)};O.prototype.readFloatBE=function(e,t){return e=e>>>0,t||ie(e,4,this.length),$t.read(this,e,!1,23,4)};O.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||ie(e,8,this.length),$t.read(this,e,!0,52,8)};O.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||ie(e,8,this.length),$t.read(this,e,!1,52,8)};function we(e,t,r,n,o,i){if(!O.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}u(we,"y");O.prototype.writeUintLE=O.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;we(this,e,t,r,s,0)}let o=1,i=0;for(this[t]=e&255;++i>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;we(this,e,t,r,s,0)}let o=r-1,i=1;for(this[t+o]=e&255;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r};O.prototype.writeUint8=O.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||we(this,e,t,1,255,0),this[t]=e&255,t+1};O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||we(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||we(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||we(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};O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||we(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 ss(e,t,r,n,o){fs(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i,i=i>>8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}u(ss,"ir");function as(e,t,r,n,o){fs(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i=i>>8,e[r+6]=i,i=i>>8,e[r+5]=i,i=i>>8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}u(as,"nr");O.prototype.writeBigUInt64LE=st(function(e,t=0){return ss(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeBigUInt64BE=st(function(e,t=0){return as(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);we(this,e,t,r,a-1,-a)}let o=0,i=1,s=0;for(this[t]=e&255;++o>0)-s&255;return t+r};O.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);we(this,e,t,r,a-1,-a)}let o=r-1,i=1,s=0;for(this[t+o]=e&255;--o>=0&&(i*=256);)e<0&&s===0&&this[t+o+1]!==0&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+r};O.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||we(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};O.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||we(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};O.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||we(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};O.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||we(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};O.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||we(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};O.prototype.writeBigInt64LE=st(function(e,t=0){return ss(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});O.prototype.writeBigInt64BE=st(function(e,t=0){return as(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function us(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}u(us,"er");function cs(e,t,r,n,o){return t=+t,r=r>>>0,o||us(e,t,r,4,34028234663852886e22,-34028234663852886e22),$t.write(e,t,r,n,23,4),r+4}u(cs,"or");O.prototype.writeFloatLE=function(e,t,r){return cs(this,e,t,!0,r)};O.prototype.writeFloatBE=function(e,t,r){return cs(this,e,t,!1,r)};function ls(e,t,r,n,o){return t=+t,r=r>>>0,o||us(e,t,r,8,17976931348623157e292,-17976931348623157e292),$t.write(e,t,r,n,52,8),r+8}u(ls,"ur");O.prototype.writeDoubleLE=function(e,t,r){return ls(this,e,t,!0,r)};O.prototype.writeDoubleBE=function(e,t,r){return ls(this,e,t,!1,r)};O.prototype.copy=function(e,t,r,n){if(!O.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o2**32?o=Zi(String(r)):typeof r=="bigint"&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=Zi(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function Zi(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}`}u(Zi,"K");function Cl(e,t,r){jt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&dr(t,e.length-(r+1))}u(Cl,"Dr");function fs(e,t,r,n,o,i){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(i+1)*8}${s}`:a=`>= -(2${s} ** ${(i+1)*8-1}${s}) and < 2 ** ${(i+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new kt.ERR_OUT_OF_RANGE("value",a,e)}Cl(n,o,i)}u(fs,"hr");function jt(e,t){if(typeof e!="number")throw new kt.ERR_INVALID_ARG_TYPE(t,"number",e)}u(jt,"R");function dr(e,t,r){throw Math.floor(e)!==e?(jt(e,r),new kt.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new kt.ERR_BUFFER_OUT_OF_BOUNDS:new kt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}u(dr,"T");var Fl=/[^+/0-9A-Za-z-_]/g;function Il(e){if(e=e.split("=")[0],e=e.trim().replace(Fl,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}u(Il,"br");function mo(e,t){t=t||1/0;let r,n=e.length,o=null,i=[];for(let s=0;s55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}u(mo,"b");function Rl(e){let t=[];for(let r=0;r>8,o=r%256,i.push(o),i.push(n);return i}u(Dl,"Or");function ps(e){return fo.toByteArray(Il(e))}u(ps,"fr");function on(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}u(on,"_");function Ue(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}u(Ue,"E");function bo(e){return e!==e}u(bo,"Y");var Nl=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function st(e){return typeof BigInt>"u"?kl:e}u(st,"g");function kl(){throw new Error("BigInt not supported")}u(kl,"Yr");});var x,d=rn(()=>{"use strict";x=Z(ms())});var ds=Q((Ag,sn)=>{d();p();m();var $l=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",n={};function o(s,a){if(!n[s]){n[s]={};for(var c=0;c>>8,c[l*2+1]=g%256}return c},decompressFromUint8Array:function(s){if(s==null)return i.decompress(s);for(var a=new Array(s.length/2),c=0,l=a.length;c>1}else{for(f=1,l=0;l>1}T--,T==0&&(T=Math.pow(2,A),A++),delete h[y]}else for(f=g[y],l=0;l>1;T--,T==0&&(T=Math.pow(2,A),A++),g[b]=M++,y=String(w)}if(y!==""){if(Object.prototype.hasOwnProperty.call(h,y)){if(y.charCodeAt(0)<256){for(l=0;l>1}else{for(f=1,l=0;l>1}T--,T==0&&(T=Math.pow(2,A),A++),delete h[y]}else for(f=g[y],l=0;l>1;T--,T==0&&(T=Math.pow(2,A),A++)}for(f=2,l=0;l>1;for(;;)if(P=P<<1,_==a-1){S.push(c(P));break}else _++;return S.join("")},decompress:function(s){return s==null?"":s==""?null:i._decompress(s.length,32768,function(a){return s.charCodeAt(a)})},_decompress:function(s,a,c){var l=[],f,g=4,h=4,w=3,b="",y=[],T,M,A,S,P,_,I,R={val:c(0),position:a,index:1};for(T=0;T<3;T+=1)l[T]=T;for(A=0,P=Math.pow(2,2),_=1;_!=P;)S=R.val&R.position,R.position>>=1,R.position==0&&(R.position=a,R.val=c(R.index++)),A|=(S>0?1:0)*_,_<<=1;switch(f=A){case 0:for(A=0,P=Math.pow(2,8),_=1;_!=P;)S=R.val&R.position,R.position>>=1,R.position==0&&(R.position=a,R.val=c(R.index++)),A|=(S>0?1:0)*_,_<<=1;I=e(A);break;case 1:for(A=0,P=Math.pow(2,16),_=1;_!=P;)S=R.val&R.position,R.position>>=1,R.position==0&&(R.position=a,R.val=c(R.index++)),A|=(S>0?1:0)*_,_<<=1;I=e(A);break;case 2:return""}for(l[3]=I,M=I,y.push(I);;){if(R.index>s)return"";for(A=0,P=Math.pow(2,w),_=1;_!=P;)S=R.val&R.position,R.position>>=1,R.position==0&&(R.position=a,R.val=c(R.index++)),A|=(S>0?1:0)*_,_<<=1;switch(I=A){case 0:for(A=0,P=Math.pow(2,8),_=1;_!=P;)S=R.val&R.position,R.position>>=1,R.position==0&&(R.position=a,R.val=c(R.index++)),A|=(S>0?1:0)*_,_<<=1;l[h++]=e(A),I=h-1,g--;break;case 1:for(A=0,P=Math.pow(2,16),_=1;_!=P;)S=R.val&R.position,R.position>>=1,R.position==0&&(R.position=a,R.val=c(R.index++)),A|=(S>0?1:0)*_,_<<=1;l[h++]=e(A),I=h-1,g--;break;case 2:return y.join("")}if(g==0&&(g=Math.pow(2,w),w++),l[I])b=l[I];else if(I===h)b=M+M.charAt(0);else return null;y.push(b),l[h++]=M+b.charAt(0),g--,M=b,g==0&&(g=Math.pow(2,w),w++)}}};return i}();typeof sn!="undefined"&&sn!=null&&(sn.exports=$l)});var hs=Q((Pg,gs)=>{"use strict";d();p();m();gs.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var vo=Q((Sg,bs)=>{d();p();m();var gr=hs(),ys={};for(let e of Object.keys(gr))ys[gr[e]]=e;var N={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};bs.exports=N;for(let e of Object.keys(N)){if(!("channels"in N[e]))throw new Error("missing channels property: "+e);if(!("labels"in N[e]))throw new Error("missing channel labels property: "+e);if(N[e].labels.length!==N[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=N[e];delete N[e].channels,delete N[e].labels,Object.defineProperty(N[e],"channels",{value:t}),Object.defineProperty(N[e],"labels",{value:r})}N.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(t,r,n),i=Math.max(t,r,n),s=i-o,a,c;i===o?a=0:t===i?a=(r-n)/s:r===i?a=2+(n-t)/s:n===i&&(a=4+(t-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let l=(o+i)/2;return i===o?c=0:l<=.5?c=s/(i+o):c=s/(2-i-o),[a,c*100,l*100]};N.rgb.hsv=function(e){let t,r,n,o,i,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),f=l-Math.min(s,a,c),g=u(function(h){return(l-h)/6/f+1/2},"diffc");return f===0?(o=0,i=0):(i=f/l,t=g(s),r=g(a),n=g(c),s===l?o=n-r:a===l?o=1/3+t-n:c===l&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[o*360,i*100,l*100]};N.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],o=N.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[o,i*100,n*100]};N.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.min(1-t,1-r,1-n),i=(1-t-o)/(1-o)||0,s=(1-r-o)/(1-o)||0,a=(1-n-o)/(1-o)||0;return[i*100,s*100,a*100,o*100]};function jl(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}u(jl,"comparativeDistance");N.rgb.keyword=function(e){let t=ys[e];if(t)return t;let r=1/0,n;for(let o of Object.keys(gr)){let i=gr[o],s=jl(e,i);s.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let o=t*.4124+r*.3576+n*.1805,i=t*.2126+r*.7152+n*.0722,s=t*.0193+r*.1192+n*.9505;return[o*100,i*100,s*100]};N.rgb.lab=function(e){let t=N.rgb.xyz(e),r=t[0],n=t[1],o=t[2];r/=95.047,n/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let i=116*n-16,s=500*(r-n),a=200*(n-o);return[i,s,a]};N.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o,i,s;if(r===0)return s=n*255,[s,s,s];n<.5?o=n*(1+r):o=n+r-n*r;let a=2*n-o,c=[0,0,0];for(let l=0;l<3;l++)i=t+1/3*-(l-1),i<0&&i++,i>1&&i--,6*i<1?s=a+(o-a)*6*i:2*i<1?s=o:3*i<2?s=a+(o-a)*(2/3-i)*6:s=a,c[l]=s*255;return c};N.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=r,i=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,o*=i<=1?i:2-i;let s=(n+r)/2,a=n===0?2*o/(i+o):2*r/(n+r);return[t,a*100,s*100]};N.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,i=t-Math.floor(t),s=255*n*(1-r),a=255*n*(1-r*i),c=255*n*(1-r*(1-i));switch(n*=255,o){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};N.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,o=Math.max(n,.01),i,s;s=(2-r)*n;let a=(2-r)*o;return i=r*o,i/=a<=1?a:2-a,i=i||0,s/=2,[t,i*100,s*100]};N.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,o=r+n,i;o>1&&(r/=o,n/=o);let s=Math.floor(6*t),a=1-n;i=6*t-s,(s&1)!==0&&(i=1-i);let c=r+i*(a-r),l,f,g;switch(s){default:case 6:case 0:l=a,f=c,g=r;break;case 1:l=c,f=a,g=r;break;case 2:l=r,f=a,g=c;break;case 3:l=r,f=c,g=a;break;case 4:l=c,f=r,g=a;break;case 5:l=a,f=r,g=c;break}return[l*255,f*255,g*255]};N.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100,i=1-Math.min(1,t*(1-o)+o),s=1-Math.min(1,r*(1-o)+o),a=1-Math.min(1,n*(1-o)+o);return[i*255,s*255,a*255]};N.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,o,i,s;return o=t*3.2406+r*-1.5372+n*-.4986,i=t*-.9689+r*1.8758+n*.0415,s=t*.0557+r*-.204+n*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),[o*255,i*255,s*255]};N.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let o=116*r-16,i=500*(t-r),s=200*(r-n);return[o,i,s]};N.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],o,i,s;i=(t+16)/116,o=r/500+i,s=i-n/200;let a=i**3,c=o**3,l=s**3;return i=a>.008856?a:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,o*=95.047,i*=100,s*=108.883,[o,i,s]};N.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],o;o=Math.atan2(n,r)*360/2/Math.PI,o<0&&(o+=360);let s=Math.sqrt(r*r+n*n);return[t,s,o]};N.lch.lab=function(e){let t=e[0],r=e[1],o=e[2]/360*2*Math.PI,i=r*Math.cos(o),s=r*Math.sin(o);return[t,i,s]};N.rgb.ansi16=function(e,t=null){let[r,n,o]=e,i=t===null?N.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let s=30+(Math.round(o/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return i===2&&(s+=60),s};N.hsv.ansi16=function(e){return N.rgb.ansi16(N.hsv.rgb(e),e[2])};N.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};N.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,n=(t&1)*r*255,o=(t>>1&1)*r*255,i=(t>>2&1)*r*255;return[n,o,i]};N.ansi256.rgb=function(e){if(e>=232){let i=(e-232)*10+8;return[i,i,i]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[r,n,o]};N.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};N.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),o=n>>16&255,i=n>>8&255,s=n&255;return[o,i,s]};N.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,o=Math.max(Math.max(t,r),n),i=Math.min(Math.min(t,r),n),s=o-i,a,c;return s<1?a=i/(1-s):a=0,s<=0?c=0:o===t?c=(r-n)/s%6:o===r?c=2+(n-t)/s:c=4+(t-r)/s,c/=6,c%=1,[c*360,s*100,a*100]};N.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),o=0;return n<1&&(o=(r-.5*n)/(1-n)),[e[0],n*100,o*100]};N.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],n*100,o*100]};N.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let o=[0,0,0],i=t%1*6,s=i%1,a=1-s,c=0;switch(Math.floor(i)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return c=(1-r)*n,[(r*o[0]+c)*255,(r*o[1]+c)*255,(r*o[2]+c)*255]};N.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),o=0;return n>0&&(o=t/n),[e[0],o*100,n*100]};N.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,o=0;return n>0&&n<.5?o=t/(2*n):n>=.5&&n<1&&(o=t/(2*(1-n))),[e[0],o*100,n*100]};N.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};N.hwb.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=1-r,o=n-t,i=0;return o<1&&(i=(n-o)/(1-o)),[e[0],o*100,i*100]};N.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};N.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};N.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};N.gray.hsl=function(e){return[0,0,e[0]]};N.gray.hsv=N.gray.hsl;N.gray.hwb=function(e){return[0,100,e[0]]};N.gray.cmyk=function(e){return[0,0,0,e[0]]};N.gray.lab=function(e){return[e[0],0,0]};N.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n};N.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var vs=Q((Og,ws)=>{d();p();m();var an=vo();function Ll(){let e={},t=Object.keys(an);for(let r=t.length,n=0;n{d();p();m();var xo=vo(),Vl=vs(),Bt={},Gl=Object.keys(xo);function zl(e){let t=u(function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))},"wrappedFn");return"conversion"in e&&(t.conversion=e.conversion),t}u(zl,"wrapRaw");function Jl(e){let t=u(function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let o=e(r);if(typeof o=="object")for(let i=o.length,s=0;s{Bt[e]={},Object.defineProperty(Bt[e],"channels",{value:xo[e].channels}),Object.defineProperty(Bt[e],"labels",{value:xo[e].labels});let t=Vl(e);Object.keys(t).forEach(n=>{let o=t[n];Bt[e][n]=Jl(o),Bt[e][n].raw=zl(o)})});xs.exports=Bt});var Os=Q((Cg,Ss)=>{"use strict";d();p();m();var As=u((e,t)=>(...r)=>`\x1B[${e(...r)+t}m`,"wrapAnsi16"),Ts=u((e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};5;${n}m`},"wrapAnsi256"),Ms=u((e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},"wrapAnsi16m"),un=u(e=>e,"ansi2ansi"),Ps=u((e,t,r)=>[e,t,r],"rgb2rgb"),qt=u((e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},"setLazyProperty"),Eo,Ut=u((e,t,r,n)=>{Eo===void 0&&(Eo=Es());let o=n?10:0,i={};for(let[s,a]of Object.entries(Eo)){let c=s==="ansi16"?"ansi":s;s===t?i[c]=e(r,o):typeof a=="object"&&(i[c]=e(a[t],o))}return i},"makeDynamicStyles");function Wl(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[r,n]of Object.entries(t)){for(let[o,i]of Object.entries(n))t[o]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[o]=t[o],e.set(i[0],i[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",qt(t.color,"ansi",()=>Ut(As,"ansi16",un,!1)),qt(t.color,"ansi256",()=>Ut(Ts,"ansi256",un,!1)),qt(t.color,"ansi16m",()=>Ut(Ms,"rgb",Ps,!1)),qt(t.bgColor,"ansi",()=>Ut(As,"ansi16",un,!0)),qt(t.bgColor,"ansi256",()=>Ut(Ts,"ansi256",un,!0)),qt(t.bgColor,"ansi16m",()=>Ut(Ms,"rgb",Ps,!0)),t}u(Wl,"assembleStyles");Object.defineProperty(Ss,"exports",{enumerable:!0,get:Wl})});var Ao=Q(()=>{d();p();m()});var Cs=Q((Rg,_s)=>{"use strict";d();p();m();var Hl=u((e,t,r)=>{let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.substr(i,n-i)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.substr(i),s},"stringReplaceAll"),Ql=u((e,t,r,n)=>{let o=0,i="";do{let s=e[n-1]==="\r";i+=e.substr(o,(s?n-1:n)-o)+t+(s?`\r +`:` +`)+r,o=n+1,n=e.indexOf(` +`,o)}while(n!==-1);return i+=e.substr(o),i},"stringEncaseCRLFWithFirstIndex");_s.exports={stringReplaceAll:Hl,stringEncaseCRLFWithFirstIndex:Ql}});var Ns=Q((Dg,Ds)=>{"use strict";d();p();m();var Kl=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Fs=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Yl=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Zl=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Xl=new Map([["n",` +`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Rs(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):Xl.get(e)||e}u(Rs,"unescape");function ef(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),o;for(let i of n){let s=Number(i);if(!Number.isNaN(s))r.push(s);else if(o=i.match(Yl))r.push(o[2].replace(Zl,(a,c,l)=>c?Rs(c):l));else throw new Error(`Invalid Chalk template style argument: ${i} (in style '${e}')`)}return r}u(ef,"parseArguments");function tf(e){Fs.lastIndex=0;let t=[],r;for(;(r=Fs.exec(e))!==null;){let n=r[1];if(r[2]){let o=ef(n,r[2]);t.push([n].concat(o))}else t.push([n])}return t}u(tf,"parseStyle");function Is(e,t){let r={};for(let o of t)for(let i of o.styles)r[i[0]]=o.inverse?null:i.slice(1);let n=e;for(let[o,i]of Object.entries(r))if(!!Array.isArray(i)){if(!(o in n))throw new Error(`Unknown Chalk style: ${o}`);n=i.length>0?n[o](...i):n[o]}return n}u(Is,"buildStyle");Ds.exports=(e,t)=>{let r=[],n=[],o=[];if(t.replace(Kl,(i,s,a,c,l,f)=>{if(s)o.push(Rs(s));else if(c){let g=o.join("");o=[],n.push(r.length===0?g:Is(e,r)(g)),r.push({inverse:a,styles:tf(c)})}else if(l){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(Is(e,r)(o.join(""))),o=[],r.pop()}else o.push(f)}),n.push(o.join("")),r.length>0){let i=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(i)}return n.join("")}});var Ot=Q((Ng,qs)=>{"use strict";d();p();m();var hr=Os(),{stdout:Mo,stderr:Po}=Ao(),{stringReplaceAll:rf,stringEncaseCRLFWithFirstIndex:nf}=Cs(),{isArray:ln}=Array,$s=["ansi","ansi","ansi256","ansi16m"],Vt=Object.create(null),of=u((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Mo?Mo.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),cn=class{constructor(t){return js(t)}};u(cn,"ChalkClass");var js=u(e=>{let t={};return of(t,e),t.template=(...r)=>Bs(t.template,...r),Object.setPrototypeOf(t,fn.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=cn,t.template},"chalkFactory");function fn(e){return js(e)}u(fn,"Chalk");for(let[e,t]of Object.entries(hr))Vt[e]={get(){let r=pn(this,So(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};Vt.visible={get(){let e=pn(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Ls=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Ls)Vt[e]={get(){let{level:t}=this;return function(...r){let n=So(hr.color[$s[t]][e](...r),hr.color.close,this._styler);return pn(this,n,this._isEmpty)}}};for(let e of Ls){let t="bg"+e[0].toUpperCase()+e.slice(1);Vt[t]={get(){let{level:r}=this;return function(...n){let o=So(hr.bgColor[$s[r]][e](...n),hr.bgColor.close,this._styler);return pn(this,o,this._isEmpty)}}}}var sf=Object.defineProperties(()=>{},{...Vt,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),So=u((e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},"createStyler"),pn=u((e,t,r)=>{let n=u((...o)=>ln(o[0])&&ln(o[0].raw)?ks(n,Bs(n,...o)):ks(n,o.length===1?""+o[0]:o.join(" ")),"builder");return Object.setPrototypeOf(n,sf),n._generator=e,n._styler=t,n._isEmpty=r,n},"createBuilder"),ks=u((e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=rf(t,r.close,r.open),r=r.parent;let i=t.indexOf(` +`);return i!==-1&&(t=nf(t,o,n,i)),n+t+o},"applyStyle"),To,Bs=u((e,...t)=>{let[r]=t;if(!ln(r)||!ln(r.raw))return t.join(" ");let n=t.slice(1),o=[r.raw[0]];for(let i=1;i{"use strict";d();p();m();ra.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 Do=Q((jg,na)=>{"use strict";d();p();m();na.exports=function(){function e(t,r,n,o,i){return tn?n+1:t+1:o===i?r:r+1}return u(e,"_min"),function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var o=t.length,i=r.length;o>0&&t.charCodeAt(o-1)===r.charCodeAt(i-1);)o--,i--;for(var s=0;s{d();p();m();var te=u((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"c"),ca=te((e,t)=>{"use strict";t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},n=Symbol("test"),o=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var i=42;r[n]=i;for(n in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var s=Object.getOwnPropertySymbols(r);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(r,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(r,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}}),In=te((e,t)=>{"use strict";var r=ca();t.exports=function(){return r()&&!!Symbol.toStringTag}}),sp=te((e,t)=>{"use strict";var r=typeof Symbol<"u"&&Symbol,n=ca();t.exports=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()}}),ap=te((e,t)=>{"use strict";var r="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,o=Object.prototype.toString,i="[object Function]";t.exports=function(s){var a=this;if(typeof a!="function"||o.call(a)!==i)throw new TypeError(r+a);for(var c=n.call(arguments,1),l,f=function(){if(this instanceof l){var y=a.apply(this,c.concat(n.call(arguments)));return Object(y)===y?y:this}else return a.apply(s,c.concat(n.call(arguments)))},g=Math.max(0,a.length-c.length),h=[],w=0;w{"use strict";var r=ap();t.exports=E.prototype.bind||r}),up=te((e,t)=>{"use strict";var r=qo();t.exports=r.call(E.call,Object.prototype.hasOwnProperty)}),Uo=te((e,t)=>{"use strict";var r,n=SyntaxError,o=E,i=TypeError,s=u(function(V){try{return o('"use strict"; return ('+V+").constructor;")()}catch(Y){}},"cr"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(V){a=null}var c=u(function(){throw new i},"lr"),l=a?function(){try{return arguments.callee,c}catch(V){try{return a(arguments,"callee").get}catch(Y){return c}}}():c,f=sp()(),g=Object.getPrototypeOf||function(V){return V.__proto__},h={},w=typeof Uint8Array>"u"?r:g(Uint8Array),b={"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":f?g([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":void 0,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?g(g([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!f?r:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!f?r:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?g(""[Symbol.iterator]()):r,"%Symbol%":f?Symbol:r,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":w,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet},y=u(function V(Y){var J;if(Y==="%AsyncFunction%")J=s("async function () {}");else if(Y==="%GeneratorFunction%")J=s("function* () {}");else if(Y==="%AsyncGeneratorFunction%")J=s("async function* () {}");else if(Y==="%AsyncGenerator%"){var W=V("%AsyncGeneratorFunction%");W&&(J=W.prototype)}else if(Y==="%AsyncIteratorPrototype%"){var j=V("%AsyncGenerator%");j&&(J=g(j.prototype))}return b[Y]=J,J},"r"),T={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=qo(),A=up(),S=M.call(E.call,Array.prototype.concat),P=M.call(E.apply,Array.prototype.splice),_=M.call(E.call,String.prototype.replace),I=M.call(E.call,String.prototype.slice),R=M.call(E.call,RegExp.prototype.exec),L=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,X=u(function(V){var Y=I(V,0,1),J=I(V,-1);if(Y==="%"&&J!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");if(J==="%"&&Y!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var W=[];return _(V,L,function(j,nt,oe,Nt){W[W.length]=oe?_(Nt,H,"$1"):nt||j}),W},"dt"),z=u(function(V,Y){var J=V,W;if(A(T,J)&&(W=T[J],J="%"+W[0]+"%"),A(b,J)){var j=b[J];if(j===h&&(j=y(J)),typeof j>"u"&&!Y)throw new i("intrinsic "+V+" exists, but is not available. Please file an issue!");return{alias:W,name:J,value:j}}throw new n("intrinsic "+V+" does not exist!")},"bt");t.exports=function(V,Y){if(typeof V!="string"||V.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Y!="boolean")throw new i('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/g,V)===null)throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var J=X(V),W=J.length>0?J[0]:"",j=z("%"+W+"%",Y),nt=j.name,oe=j.value,Nt=!1,ot=j.alias;ot&&(W=ot[0],P(J,S([0,1],ot)));for(var Tt=1,Be=!0;Tt=J.length){var Mt=a(oe,Se);Be=!!Mt,Be&&"get"in Mt&&!("originalValue"in Mt.get)?oe=Mt.get:oe=oe[Se]}else Be=A(oe,Se),oe=oe[Se];Be&&!Nt&&(b[nt]=oe)}}return oe}}),cp=te((e,t)=>{"use strict";var r=qo(),n=Uo(),o=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||r.call(i,o),a=n("%Object.getOwnPropertyDescriptor%",!0),c=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(g){c=null}t.exports=function(g){var h=s(r,i,arguments);if(a&&c){var w=a(h,"length");w.configurable&&c(h,"length",{value:1+l(0,g.length-(arguments.length-1))})}return h};var f=u(function(){return s(r,o,arguments)},"Qr");c?c(t.exports,"apply",{value:f}):t.exports.apply=f}),Vo=te((e,t)=>{"use strict";var r=Uo(),n=cp(),o=n(r("String.prototype.indexOf"));t.exports=function(i,s){var a=r(i,!!s);return typeof a=="function"&&o(i,".prototype.")>-1?n(a):a}}),lp=te((e,t)=>{"use strict";var r=In()(),n=Vo(),o=n("Object.prototype.toString"),i=u(function(c){return r&&c&&typeof c=="object"&&Symbol.toStringTag in c?!1:o(c)==="[object Arguments]"},"H"),s=u(function(c){return i(c)?!0:c!==null&&typeof c=="object"&&typeof c.length=="number"&&c.length>=0&&o(c)!=="[object Array]"&&o(c.callee)==="[object Function]"},"ae"),a=function(){return i(arguments)}();i.isLegacyArguments=s,t.exports=a?i:s}),fp=te((e,t)=>{"use strict";var r=Object.prototype.toString,n=E.prototype.toString,o=/^\s*(?:function)?\*/,i=In()(),s=Object.getPrototypeOf,a=u(function(){if(!i)return!1;try{return E("return function*() {}")()}catch(l){}},"wt"),c;t.exports=function(l){if(typeof l!="function")return!1;if(o.test(n.call(l)))return!0;if(!i){var f=r.call(l);return f==="[object GeneratorFunction]"}if(!s)return!1;if(typeof c>"u"){var g=a();c=g?s(g):!1}return s(l)===c}}),pp=te((e,t)=>{"use strict";var r=E.prototype.toString,n=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,o,i;if(typeof n=="function"&&typeof Object.defineProperty=="function")try{o=Object.defineProperty({},"length",{get:function(){throw i}}),i={},n(function(){throw 42},null,o)}catch(b){b!==i&&(n=null)}else n=null;var s=/^\s*class\b/,a=u(function(b){try{var y=r.call(b);return s.test(y)}catch(T){return!1}},"hr"),c=u(function(b){try{return a(b)?!1:(r.call(b),!0)}catch(y){return!1}},"Tt"),l=Object.prototype.toString,f="[object Function]",g="[object GeneratorFunction]",h=typeof Symbol=="function"&&!!Symbol.toStringTag,w=typeof document=="object"&&typeof document.all>"u"&&document.all!==void 0?document.all:{};t.exports=n?function(b){if(b===w)return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(typeof b=="function"&&!b.prototype)return!0;try{n(b,null,o)}catch(y){if(y!==i)return!1}return!a(b)}:function(b){if(b===w)return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(typeof b=="function"&&!b.prototype)return!0;if(h)return c(b);if(a(b))return!1;var y=l.call(b);return y===f||y===g}}),la=te((e,t)=>{"use strict";var r=pp(),n=Object.prototype.toString,o=Object.prototype.hasOwnProperty,i=u(function(l,f,g){for(var h=0,w=l.length;h=3&&(h=g),n.call(l)==="[object Array]"?i(l,f,h):typeof l=="string"?s(l,f,h):a(l,f,h)},"Mt");t.exports=c}),fa=te((e,t)=>{"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n=typeof globalThis>"u"?global:globalThis;t.exports=function(){for(var o=[],i=0;i{"use strict";var r=Uo(),n=r("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(o){n=null}t.exports=n}),ma=te((e,t)=>{"use strict";var r=la(),n=fa(),o=Vo(),i=o("Object.prototype.toString"),s=In()(),a=typeof globalThis>"u"?global:globalThis,c=n(),l=o("Array.prototype.indexOf",!0)||function(y,T){for(var M=0;M-1}return h?b(y):!1}}),mp=te((e,t)=>{"use strict";var r=la(),n=fa(),o=Vo(),i=o("Object.prototype.toString"),s=In()(),a=typeof globalThis>"u"?global:globalThis,c=n(),l=o("String.prototype.slice"),f={},g=pa(),h=Object.getPrototypeOf;s&&g&&h&&r(c,function(y){if(typeof a[y]=="function"){var T=new a[y];if(Symbol.toStringTag in T){var M=h(T),A=g(M,Symbol.toStringTag);if(!A){var S=h(M);A=g(S,Symbol.toStringTag)}f[y]=A.get}}});var w=u(function(y){var T=!1;return r(f,function(M,A){if(!T)try{var S=M.call(y);S===A&&(T=S)}catch(P){}}),T},"Yt"),b=ma();t.exports=function(y){return b(y)?!s||!(Symbol.toStringTag in y)?l(i(y),8,-1):w(y):!1}}),dp=te(e=>{"use strict";var t=lp(),r=fp(),n=mp(),o=ma();function i(F){return F.call.bind(F)}u(i,"R");var s=typeof BigInt<"u",a=typeof Symbol<"u",c=i(Object.prototype.toString),l=i(Number.prototype.valueOf),f=i(String.prototype.valueOf),g=i(Boolean.prototype.valueOf);s&&(h=i(BigInt.prototype.valueOf));var h;a&&(w=i(Symbol.prototype.valueOf));var w;function b(F,rl){if(typeof F!="object")return!1;try{return rl(F),!0}catch(hg){return!1}}u(b,"M"),e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function y(F){return typeof Promise<"u"&&F instanceof Promise||F!==null&&typeof F=="object"&&typeof F.then=="function"&&typeof F.catch=="function"}u(y,"nn"),e.isPromise=y;function T(F){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(F):o(F)||Se(F)}u(T,"on"),e.isArrayBufferView=T;function M(F){return n(F)==="Uint8Array"}u(M,"an"),e.isUint8Array=M;function A(F){return n(F)==="Uint8ClampedArray"}u(A,"fn"),e.isUint8ClampedArray=A;function S(F){return n(F)==="Uint16Array"}u(S,"un"),e.isUint16Array=S;function P(F){return n(F)==="Uint32Array"}u(P,"yn"),e.isUint32Array=P;function _(F){return n(F)==="Int8Array"}u(_,"sn"),e.isInt8Array=_;function I(F){return n(F)==="Int16Array"}u(I,"pn"),e.isInt16Array=I;function R(F){return n(F)==="Int32Array"}u(R,"cn"),e.isInt32Array=R;function L(F){return n(F)==="Float32Array"}u(L,"ln"),e.isFloat32Array=L;function H(F){return n(F)==="Float64Array"}u(H,"gn"),e.isFloat64Array=H;function X(F){return n(F)==="BigInt64Array"}u(X,"dn"),e.isBigInt64Array=X;function z(F){return n(F)==="BigUint64Array"}u(z,"bn"),e.isBigUint64Array=z;function V(F){return c(F)==="[object Map]"}u(V,"Q"),V.working=typeof Map<"u"&&V(new Map);function Y(F){return typeof Map>"u"?!1:V.working?V(F):F instanceof Map}u(Y,"mn"),e.isMap=Y;function J(F){return c(F)==="[object Set]"}u(J,"X"),J.working=typeof Set<"u"&&J(new Set);function W(F){return typeof Set>"u"?!1:J.working?J(F):F instanceof Set}u(W,"An"),e.isSet=W;function j(F){return c(F)==="[object WeakMap]"}u(j,"rr"),j.working=typeof WeakMap<"u"&&j(new WeakMap);function nt(F){return typeof WeakMap>"u"?!1:j.working?j(F):F instanceof WeakMap}u(nt,"hn"),e.isWeakMap=nt;function oe(F){return c(F)==="[object WeakSet]"}u(oe,"Br"),oe.working=typeof WeakSet<"u"&&oe(new WeakSet);function Nt(F){return oe(F)}u(Nt,"Sn"),e.isWeakSet=Nt;function ot(F){return c(F)==="[object ArrayBuffer]"}u(ot,"er"),ot.working=typeof ArrayBuffer<"u"&&ot(new ArrayBuffer);function Tt(F){return typeof ArrayBuffer>"u"?!1:ot.working?ot(F):F instanceof ArrayBuffer}u(Tt,"Me"),e.isArrayBuffer=Tt;function Be(F){return c(F)==="[object DataView]"}u(Be,"tr"),Be.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Be(new DataView(new ArrayBuffer(1),0,1));function Se(F){return typeof DataView>"u"?!1:Be.working?Be(F):F instanceof DataView}u(Se,"$e"),e.isDataView=Se;var it=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function qe(F){return c(F)==="[object SharedArrayBuffer]"}u(qe,"N");function Mt(F){return typeof it>"u"?!1:(typeof qe.working>"u"&&(qe.working=qe(new it)),qe.working?qe(F):F instanceof it)}u(Mt,"qe"),e.isSharedArrayBuffer=Mt;function Qc(F){return c(F)==="[object AsyncFunction]"}u(Qc,"vn"),e.isAsyncFunction=Qc;function Kc(F){return c(F)==="[object Map Iterator]"}u(Kc,"On"),e.isMapIterator=Kc;function Yc(F){return c(F)==="[object Set Iterator]"}u(Yc,"Pn"),e.isSetIterator=Yc;function Zc(F){return c(F)==="[object Generator]"}u(Zc,"jn"),e.isGeneratorObject=Zc;function Xc(F){return c(F)==="[object WebAssembly.Module]"}u(Xc,"wn"),e.isWebAssemblyCompiledModule=Xc;function Ui(F){return b(F,l)}u(Ui,"Ge"),e.isNumberObject=Ui;function Vi(F){return b(F,f)}u(Vi,"Ce"),e.isStringObject=Vi;function Gi(F){return b(F,g)}u(Gi,"We"),e.isBooleanObject=Gi;function zi(F){return s&&b(F,h)}u(zi,"_e"),e.isBigIntObject=zi;function Ji(F){return a&&b(F,w)}u(Ji,"ze"),e.isSymbolObject=Ji;function el(F){return Ui(F)||Vi(F)||Gi(F)||zi(F)||Ji(F)}u(el,"En"),e.isBoxedPrimitive=el;function tl(F){return typeof Uint8Array<"u"&&(Tt(F)||Mt(F))}u(tl,"Tn"),e.isAnyArrayBuffer=tl,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(F){Object.defineProperty(e,F,{enumerable:!1,value:function(){throw new Error(F+" is not supported in userland")}})})}),gp=te((e,t)=>{t.exports=function(r){return r instanceof x.Buffer}}),hp=te((e,t)=>{typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var o=u(function(){},"n");o.prototype=n.prototype,r.prototype=new o,r.prototype.constructor=r}}}),da=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=o)return c;switch(c){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(l){return"[Circular]"}default:return c}}),s=n[r];r"u")return function(){return G.deprecate(e,t).apply(this,arguments)};var r=!1;function n(){if(!r){if(v.throwDeprecation)throw new Error(t);v.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}return u(n,"n"),n};var Sn={},ga=/^$/;v.env.NODE_DEBUG&&(On=v.env.NODE_DEBUG,On=On.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),ga=new RegExp("^"+On+"$","i"));var On;G.debuglog=function(e){if(e=e.toUpperCase(),!Sn[e])if(ga.test(e)){var t=v.pid;Sn[e]=function(){var r=G.format.apply(G,arguments);console.error("%s %d: %s",e,t,r)}}else Sn[e]=function(){};return Sn[e]};function mt(e,t){var r={seen:[],stylize:wp};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Go(t)?r.showHidden=t:t&&G._extend(r,t),Ft(r.showHidden)&&(r.showHidden=!1),Ft(r.depth)&&(r.depth=2),Ft(r.colors)&&(r.colors=!1),Ft(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=bp),Cn(r,e,r.depth)}u(mt,"A");G.inspect=mt;mt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};mt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function bp(e,t){var r=mt.styles[t];return r?"\x1B["+mt.colors[r][0]+"m"+e+"\x1B["+mt.colors[r][1]+"m":e}u(bp,"In");function wp(e,t){return e}u(wp,"Bn");function vp(e){var t={};return e.forEach(function(r,n){t[r]=!0}),t}u(vp,"Un");function Cn(e,t,r){if(e.customInspect&&t&&_n(t.inspect)&&t.inspect!==G.inspect&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(r,e);return Dn(n)||(n=Cn(e,n,r)),n}var o=xp(e,t);if(o)return o;var i=Object.keys(t),s=vp(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),Sr(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return jo(t);if(i.length===0){if(_n(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(Pr(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Fn(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Sr(t))return jo(t)}var c="",l=!1,f=["{","}"];if(ha(t)&&(l=!0,f=["[","]"]),_n(t)){var g=t.name?": "+t.name:"";c=" [Function"+g+"]"}if(Pr(t)&&(c=" "+RegExp.prototype.toString.call(t)),Fn(t)&&(c=" "+Date.prototype.toUTCString.call(t)),Sr(t)&&(c=" "+jo(t)),i.length===0&&(!l||t.length==0))return f[0]+c+f[1];if(r<0)return Pr(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var h;return l?h=Ep(e,t,r,s,i):h=i.map(function(w){return Bo(e,t,r,s,w,l)}),e.seen.pop(),Ap(h,c,f)}u(Cn,"ar");function xp(e,t){if(Ft(t))return e.stylize("undefined","undefined");if(Dn(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(ya(t))return e.stylize(""+t,"number");if(Go(t))return e.stylize(""+t,"boolean");if(Rn(t))return e.stylize("null","null")}u(xp,"Rn");function jo(e){return"["+Error.prototype.toString.call(e)+"]"}u(jo,"Rr");function Ep(e,t,r,n,o){for(var i=[],s=0,a=t.length;s-1&&(i?a=a.split(` +`).map(function(l){return" "+l}).join(` +`).substr(2):a=` +`+a.split(` +`).map(function(l){return" "+l}).join(` +`))):a=e.stylize("[Circular]","special")),Ft(s)){if(i&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}u(Bo,"xr");function Ap(e,t,r){var n=0,o=e.reduce(function(i,s){return n++,s.indexOf(` +`)>=0&&n++,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(t===""?"":t+` + `)+" "+e.join(`, + `)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}u(Ap,"xn");G.types=dp();function ha(e){return Array.isArray(e)}u(ha,"Ke");G.isArray=ha;function Go(e){return typeof e=="boolean"}u(Go,"Dr");G.isBoolean=Go;function Rn(e){return e===null}u(Rn,"ur");G.isNull=Rn;function Tp(e){return e==null}u(Tp,"Dn");G.isNullOrUndefined=Tp;function ya(e){return typeof e=="number"}u(ya,"Qe");G.isNumber=ya;function Dn(e){return typeof e=="string"}u(Dn,"yr");G.isString=Dn;function Mp(e){return typeof e=="symbol"}u(Mp,"Nn");G.isSymbol=Mp;function Ft(e){return e===void 0}u(Ft,"P");G.isUndefined=Ft;function Pr(e){return Yt(e)&&zo(e)==="[object RegExp]"}u(Pr,"$");G.isRegExp=Pr;G.types.isRegExp=Pr;function Yt(e){return typeof e=="object"&&e!==null}u(Yt,"k");G.isObject=Yt;function Fn(e){return Yt(e)&&zo(e)==="[object Date]"}u(Fn,"fr");G.isDate=Fn;G.types.isDate=Fn;function Sr(e){return Yt(e)&&(zo(e)==="[object Error]"||e instanceof Error)}u(Sr,"q");G.isError=Sr;G.types.isNativeError=Sr;function _n(e){return typeof e=="function"}u(_n,"ir");G.isFunction=_n;function Pp(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}u(Pp,"Mn");G.isPrimitive=Pp;G.isBuffer=gp();function zo(e){return Object.prototype.toString.call(e)}u(zo,"Nr");function Lo(e){return e<10?"0"+e.toString(10):e.toString(10)}u(Lo,"kr");var Sp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Op(){var e=new Date,t=[Lo(e.getHours()),Lo(e.getMinutes()),Lo(e.getSeconds())].join(":");return[e.getDate(),Sp[e.getMonth()],t].join(" ")}u(Op,"qn");G.log=function(){console.log("%s - %s",Op(),G.format.apply(G,arguments))};G.inherits=hp();G._extend=function(e,t){if(!t||!Yt(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};function ba(e,t){return Object.prototype.hasOwnProperty.call(e,t)}u(ba,"Xe");var Ct=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;G.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(Ct&&e[Ct]){var t=e[Ct];if(typeof t!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,Ct,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var r,n,o=new Promise(function(a,c){r=a,n=c}),i=[],s=0;s{d();p();m();var Zt=1e3,Xt=Zt*60,er=Xt*60,It=er*24,Fp=It*7,Ip=It*365.25;va.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Rp(e);if(r==="number"&&isFinite(e))return t.long?Np(e):Dp(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Rp(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ip;case"weeks":case"week":case"w":return r*Fp;case"days":case"day":case"d":return r*It;case"hours":case"hour":case"hrs":case"hr":case"h":return r*er;case"minutes":case"minute":case"mins":case"min":case"m":return r*Xt;case"seconds":case"second":case"secs":case"sec":case"s":return r*Zt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}u(Rp,"parse");function Dp(e){var t=Math.abs(e);return t>=It?Math.round(e/It)+"d":t>=er?Math.round(e/er)+"h":t>=Xt?Math.round(e/Xt)+"m":t>=Zt?Math.round(e/Zt)+"s":e+"ms"}u(Dp,"fmtShort");function Np(e){var t=Math.abs(e);return t>=It?Nn(e,t,It,"day"):t>=er?Nn(e,t,er,"hour"):t>=Xt?Nn(e,t,Xt,"minute"):t>=Zt?Nn(e,t,Zt,"second"):e+" ms"}u(Np,"fmtLong");function Nn(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}u(Nn,"plural")});var Jo=Q((eh,Ea)=>{d();p();m();function kp(e){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=o,r.enabled=s,r.humanize=xa(),r.destroy=l,Object.keys(e).forEach(f=>{r[f]=e[f]}),r.names=[],r.skips=[],r.formatters={};function t(f){let g=0;for(let h=0;h{if(I==="%%")return"%";P++;let L=r.formatters[R];if(typeof L=="function"){let H=T[P];I=L.call(M,H),T.splice(P,1),P--}return I}),r.formatArgs.call(M,T),(M.log||r.log).apply(M,T)}return u(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(w!==r.namespaces&&(w=r.namespaces,b=r.enabled(f)),b),set:T=>{h=T}}),typeof r.init=="function"&&r.init(y),y}u(r,"createDebug");function n(f,g){let h=r(this.namespace+(typeof g=="undefined"?":":g)+f);return h.log=this.log,h}u(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let g,h=(typeof f=="string"?f:"").split(/[\s,]+/),w=h.length;for(g=0;g"-"+g)].join(",");return r.enable(""),f}u(i,"disable");function s(f){if(f[f.length-1]==="*")return!0;let g,h;for(g=0,h=r.skips.length;g{d();p();m();Te.formatArgs=jp;Te.save=Lp;Te.load=Bp;Te.useColors=$p;Te.storage=qp();Te.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Te.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function $p(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}u($p,"useColors");function jp(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+kn.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),e.splice(n,0,t)}u(jp,"formatArgs");Te.log=console.debug||console.log||(()=>{});function Lp(e){try{e?Te.storage.setItem("debug",e):Te.storage.removeItem("debug")}catch(t){}}u(Lp,"save");function Bp(){let e;try{e=Te.storage.getItem("debug")}catch(t){}return!e&&typeof v!="undefined"&&"env"in v&&(e=v.env.DEBUG),e}u(Bp,"load");function qp(){try{return localStorage}catch(e){}}u(qp,"localstorage");kn.exports=Jo()(Te);var{formatters:Up}=kn.exports;Up.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Ta=Q($n=>{d();p();m();$n.isatty=function(){return!1};function Vp(){throw new Error("tty.ReadStream is not implemented")}u(Vp,"t");$n.ReadStream=Vp;function Gp(){throw new Error("tty.WriteStream is not implemented")}u(Gp,"e");$n.WriteStream=Gp});var Pa=Q((ae,Ln)=>{d();p();m();var zp=Ta(),jn=wa();ae.init=Zp;ae.log=Qp;ae.formatArgs=Wp;ae.save=Kp;ae.load=Yp;ae.useColors=Jp;ae.destroy=jn.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ae.colors=[6,2,3,4,5,1];try{let e=Ao();e&&(e.stderr||e).level>=2&&(ae.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}ae.inspectOpts=Object.keys(v.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),n=v.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function Jp(){return"colors"in ae.inspectOpts?Boolean(ae.inspectOpts.colors):zp.isatty(v.stderr.fd)}u(Jp,"useColors");function Wp(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(` +`).join(` +`+i),e.push(o+"m+"+Ln.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Hp()+t+" "+e[0]}u(Wp,"formatArgs");function Hp(){return ae.inspectOpts.hideDate?"":new Date().toISOString()+" "}u(Hp,"getDate");function Qp(...e){return v.stderr.write(jn.format(...e)+` +`)}u(Qp,"log");function Kp(e){e?v.env.DEBUG=e:delete v.env.DEBUG}u(Kp,"save");function Yp(){return v.env.DEBUG}u(Yp,"load");function Zp(e){e.inspectOpts={};let t=Object.keys(ae.inspectOpts);for(let r=0;rt.trim()).join(" ")};Ma.O=function(e){return this.inspectOpts.colors=this.useColors,jn.inspect(e,this.inspectOpts)}});var Sa=Q((rh,Wo)=>{d();p();m();typeof v=="undefined"||v.type==="renderer"||v.browser===!0||v.__nwjs?Wo.exports=Aa():Wo.exports=Pa()});var Em,Qn,si=rn(()=>{d();p();m();Em={existsSync(){return!1}},Qn=Em});var fu=Q((M0,lu)=>{"use strict";d();p();m();function ze(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}u(ze,"c");function cu(e,t){for(var r="",n=0,o=-1,i=0,s,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){c===-1?(r="",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf("/")),o=a,i=0;continue}}else if(r.length===2||r.length===1){r="",n=0,o=a,i=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),n=a-o-1;o=a,i=0}else s===46&&i!==-1?++i:i=-1}return r}u(cu,"A");function Am(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}u(Am,"b");var tr={resolve:function(){for(var e="",t=!1,r,n=arguments.length-1;n>=-1&&!t;n--){var o;n>=0?o=arguments[n]:(r===void 0&&(r=v.cwd()),o=r),ze(o),o.length!==0&&(e=o+"/"+e,t=o.charCodeAt(0)===47)}return e=cu(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(ze(e),e.length===0)return".";var t=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;return e=cu(e,!t),e.length===0&&!t&&(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return ze(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t0&&(e===void 0?e=r:e+="/"+r)}return e===void 0?".":tr.normalize(e)},relative:function(e,t){if(ze(e),ze(t),e===t||(e=tr.resolve(e),t=tr.resolve(t),e===t))return"";for(var r=1;rc){if(t.charCodeAt(i+f)===47)return t.slice(i+f+1);if(f===0)return t.slice(i+f)}else o>c&&(e.charCodeAt(r+f)===47?l=f:f===0&&(l=0));break}var g=e.charCodeAt(r+f),h=t.charCodeAt(i+f);if(g!==h)break;g===47&&(l=f)}var w="";for(f=r+l+1;f<=n;++f)(f===n||e.charCodeAt(f)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+t.slice(i+l):(i+=l,t.charCodeAt(i)===47&&++i,t.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(ze(e),e.length===0)return".";for(var t=e.charCodeAt(0),r=t===47,n=-1,o=!0,i=e.length-1;i>=1;--i)if(t=e.charCodeAt(i),t===47){if(!o){n=i;break}}else o=!1;return n===-1?r?"/":".":r&&n===1?"//":e.slice(0,n)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ze(e);var r=0,n=-1,o=!0,i;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){var c=e.charCodeAt(i);if(c===47){if(!o){r=i+1;break}}else a===-1&&(o=!1,a=i+1),s>=0&&(c===t.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return r===n?n=a:n===-1&&(n=e.length),e.slice(r,n)}else{for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===47){if(!o){r=i+1;break}}else n===-1&&(o=!1,n=i+1);return n===-1?"":e.slice(r,n)}},extname:function(e){ze(e);for(var t=-1,r=0,n=-1,o=!0,i=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(a===47){if(!o){r=s+1;break}continue}n===-1&&(o=!1,n=s+1),a===46?t===-1?t=s:i!==1&&(i=1):t!==-1&&(i=-1)}return t===-1||n===-1||i===0||i===1&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return Am("/",e)},parse:function(e){ze(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var r=e.charCodeAt(0),n=r===47,o;n?(t.root="/",o=1):o=0;for(var i=-1,s=0,a=-1,c=!0,l=e.length-1,f=0;l>=o;--l){if(r=e.charCodeAt(l),r===47){if(!c){s=l+1;break}continue}a===-1&&(c=!1,a=l+1),r===46?i===-1?i=l:f!==1&&(f=1):i!==-1&&(f=-1)}return i===-1||a===-1||f===0||f===1&&i===a-1&&i===s+1?a!==-1&&(s===0&&n?t.base=t.name=e.slice(1,a):t.base=t.name=e.slice(s,a)):(s===0&&n?(t.name=e.slice(1,i),t.base=e.slice(1,a)):(t.name=e.slice(s,i),t.base=e.slice(s,a)),t.ext=e.slice(i,a)),s>0?t.dir=e.slice(0,s-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};tr.posix=tr;lu.exports=tr});var mu=Q((P0,ai)=>{"use strict";d();p();m();var Tm=Object.prototype.hasOwnProperty,he="~";function Rr(){}u(Rr,"_");Object.create&&(Rr.prototype=Object.create(null),new Rr().__proto__||(he=!1));function Mm(e,t,r){this.fn=e,this.context=t,this.once=r||!1}u(Mm,"g");function pu(e,t,r,n,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new Mm(r,n||e,o),s=he?he+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],i]:e._events[s].push(i):(e._events[s]=i,e._eventsCount++),e}u(pu,"w");function Kn(e,t){--e._eventsCount===0?e._events=new Rr:delete e._events[t]}u(Kn,"y");function pe(){this._events=new Rr,this._eventsCount=0}u(pe,"u");pe.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)Tm.call(t,r)&&e.push(he?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};pe.prototype.listeners=function(e){var t=he?he+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,i=new Array(o);n{"use strict";d();p();m();du.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=Q((R0,hu)=>{"use strict";d();p();m();var Pm=gu();hu.exports=e=>typeof e=="string"?e.replace(Pm(),""):e});var Pu=Q((Eb,Mu)=>{d();p();m();var mi=Symbol("arg flag"),be=class extends Error{constructor(t,r){super(t),this.name="ArgError",this.code=r,Object.setPrototypeOf(this,be.prototype)}};u(be,"ArgError");function Br(e,{argv:t=v.argv.slice(2),permissive:r=!1,stopAtPositional:n=!1}={}){if(!e)throw new be("argument specification object is required","ARG_CONFIG_NO_SPEC");let o={_:[]},i={},s={};for(let a of Object.keys(e)){if(!a)throw new be("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(a[0]!=="-")throw new be(`argument key must start with '-' but found: '${a}'`,"ARG_CONFIG_NONOPT_KEY");if(a.length===1)throw new be(`argument key must have a name; singular '-' keys are not allowed: ${a}`,"ARG_CONFIG_NONAME_KEY");if(typeof e[a]=="string"){i[a]=e[a];continue}let c=e[a],l=!1;if(Array.isArray(c)&&c.length===1&&typeof c[0]=="function"){let[f]=c;c=u((g,h,w=[])=>(w.push(f(g,h,w[w.length-1])),w),"type"),l=f===Boolean||f[mi]===!0}else if(typeof c=="function")l=c===Boolean||c[mi]===!0;else throw new be(`type missing or not a function or valid array type: ${a}`,"ARG_CONFIG_VAD_TYPE");if(a[1]!=="-"&&a.length>2)throw new be(`short argument keys (with a single hyphen) must have only one character: ${a}`,"ARG_CONFIG_SHORTOPT_TOOLONG");s[a]=[c,l]}for(let a=0,c=t.length;a0){o._=o._.concat(t.slice(a));break}if(l==="--"){o._=o._.concat(t.slice(a+1));break}if(l.length>1&&l[0]==="-"){let f=l[1]==="-"||l.length===2?[l]:l.slice(1).split("").map(g=>`-${g}`);for(let g=0;g1&&t[a+1][0]==="-"&&!(t[a+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(T===Number||typeof BigInt!="undefined"&&T===BigInt))){let A=w===y?"":` (alias for ${y})`;throw new be(`option requires argument: ${w}${A}`,"ARG_MISSING_REQUIRED_LONGARG")}o[y]=T(t[a+1],y,o[y]),++a}else o[y]=T(b,y,o[y])}}else o._.push(l)}return o}u(Br,"arg");Br.flag=e=>(e[mi]=!0,e);Br.COUNT=Br.flag((e,t,r)=>(r||0)+1);Br.ArgError=be;Mu.exports=Br});var Ou=Q((Ab,Su)=>{"use strict";d();p();m();Su.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var di=Q((Tb,_u)=>{"use strict";d();p();m();var Bm=Ou();_u.exports=e=>{let t=Bm(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Ru=Q(()=>{d();p();m()});var ku=Q((Ei,Ai)=>{d();p();m();(function(e,t){typeof require=="function"&&typeof Ei=="object"&&typeof Ai=="object"?Ai.exports=t():e.pluralize=t()})(Ei,function(){var e=[],t=[],r={},n={},o={};function i(w){return typeof w=="string"?new RegExp("^"+w+"$","i"):w}u(i,"sanitizeRule");function s(w,b){return w===b?b:w===w.toLowerCase()?b.toLowerCase():w===w.toUpperCase()?b.toUpperCase():w[0]===w[0].toUpperCase()?b.charAt(0).toUpperCase()+b.substr(1).toLowerCase():b.toLowerCase()}u(s,"restoreCase");function a(w,b){return w.replace(/\$(\d{1,2})/g,function(y,T){return b[T]||""})}u(a,"interpolate");function c(w,b){return w.replace(b[0],function(y,T){var M=a(b[1],arguments);return s(y===""?w[T-1]:y,M)})}u(c,"replace");function l(w,b,y){if(!w.length||r.hasOwnProperty(w))return b;for(var T=y.length;T--;){var M=y[T];if(M[0].test(b))return c(b,M)}return b}u(l,"sanitizeWord");function f(w,b,y){return function(T){var M=T.toLowerCase();return b.hasOwnProperty(M)?s(T,M):w.hasOwnProperty(M)?s(T,w[M]):l(M,T,y)}}u(f,"replaceWord");function g(w,b,y,T){return function(M){var A=M.toLowerCase();return b.hasOwnProperty(A)?!0:w.hasOwnProperty(A)?!1:l(A,A,y)===A}}u(g,"checkWord");function h(w,b,y){var T=b===1?h.singular(w):h.plural(w);return(y?b+" ":"")+T}return u(h,"pluralize"),h.plural=f(o,n,e),h.isPlural=g(o,n,e),h.singular=f(n,o,t),h.isSingular=g(n,o,t),h.addPluralRule=function(w,b){e.push([i(w),b])},h.addSingularRule=function(w,b){t.push([i(w),b])},h.addUncountableRule=function(w){if(typeof w=="string"){r[w.toLowerCase()]=!0;return}h.addPluralRule(w,"$0"),h.addSingularRule(w,"$0")},h.addIrregularRule=function(w,b){b=b.toLowerCase(),w=w.toLowerCase(),o[w]=b,n[b]=w},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(w){return h.addIrregularRule(w[0],w[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(w){return h.addPluralRule(w[0],w[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(w){return h.addSingularRule(w[0],w[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(h.addUncountableRule),h})});var cc=Q((_w,uc)=>{"use strict";d();p();m();uc.exports=e=>Object.prototype.toString.call(e)==="[object RegExp]"});var fc=Q((Cw,lc)=>{"use strict";d();p();m();lc.exports=e=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")}});var pc=Q(Si=>{"use strict";d();p();m();Object.defineProperty(Si,"__esModule",{value:!0});Si.default=e=>Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))});var Fc=Q((Q2,tg)=>{tg.exports={name:"@prisma/client",version:"4.3.1",description:"Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports MySQL, PostgreSQL, MariaDB, SQLite databases.",keywords:["orm","prisma2","prisma","client","query","database","sql","postgres","postgresql","mysql","sqlite","mariadb","mssql","typescript","query-builder"],main:"index.js",browser:"index-browser.js",types:"index.d.ts",license:"Apache-2.0",engines:{node:">=14.17"},homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/client"},author:"Tim Suchanek ",bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true node -r esbuild-register helpers/build.ts",build:"node -r esbuild-register helpers/build.ts",test:"jest --verbose","test:functional":"node -r esbuild-register helpers/functional-test/run-tests.ts","test:memory":"node -r esbuild-register helpers/memory-tests.ts","test:functional:code":"node -r esbuild-register helpers/functional-test/run-tests.ts --no-types","test:functional:types":"node -r esbuild-register helpers/functional-test/run-tests.ts --types-only","test-notypes":"jest --verbose --testPathIgnorePatterns src/__tests__/types/types.test.ts",generate:"node scripts/postinstall.js",postinstall:"node scripts/postinstall.js",prepublishOnly:"pnpm run build","new-test":"NODE_OPTIONS='-r ts-node/register' yo ./helpers/generator-test/index.ts"},files:["README.md","runtime","scripts","generator-build","edge.js","edge.d.ts","index.js","index.d.ts","index-browser.js"],devDependencies:{"@faker-js/faker":"7.4.0","@jest/test-sequencer":"28.1.3","@microsoft/api-extractor":"7.29.5","@opentelemetry/api":"1.1.0","@opentelemetry/context-async-hooks":"1.5.0","@opentelemetry/instrumentation":"0.31.0","@opentelemetry/resources":"1.5.0","@opentelemetry/sdk-trace-base":"1.5.0","@opentelemetry/semantic-conventions":"1.5.0","@prisma/debug":"workspace:4.3.1","@prisma/engine-core":"workspace:4.3.1","@prisma/engines":"workspace:4.3.1","@prisma/fetch-engine":"workspace:4.3.1","@prisma/generator-helper":"workspace:4.3.1","@prisma/get-platform":"workspace:4.3.1","@prisma/instrumentation":"workspace:4.3.1","@prisma/internals":"workspace:4.3.1","@prisma/migrate":"workspace:4.3.1","@swc-node/register":"1.5.1","@swc/core":"1.2.242","@swc/jest":"0.2.22","@timsuchanek/copy":"1.4.5","@types/debug":"4.1.7","@types/jest":"28.1.7","@types/js-levenshtein":"1.1.1","@types/mssql":"8.1.1","@types/node":"14.18.26","@types/pg":"8.6.5","@types/yeoman-generator":"5.2.11",arg:"5.0.2",benchmark:"2.1.4",chalk:"4.1.2",cuid:"2.1.8","decimal.js":"10.4.0",esbuild:"0.15.5",execa:"5.1.1","expect-type":"0.13.0","flat-map-polyfill":"0.3.8","fs-extra":"10.1.0","fs-monkey":"1.0.3","get-own-enumerable-property-symbols":"3.0.2",globby:"11.1.0","indent-string":"4.0.0","is-obj":"2.0.0","is-regexp":"2.1.0",jest:"28.1.3","jest-junit":"14.0.0","jest-snapshot":"28.1.3","js-levenshtein":"1.1.6",klona:"2.0.5","lz-string":"1.4.4","make-dir":"3.1.0",mariadb:"3.0.1",memfs:"3.4.7",mssql:"9.0.1",pg:"8.8.0","pkg-up":"3.1.0",pluralize:"8.0.0","replace-string":"3.1.0",resolve:"1.22.1",rimraf:"3.0.2","simple-statistics":"7.7.6","sort-keys":"4.2.0","source-map-support":"0.5.21","sql-template-tag":"5.0.3","stacktrace-parser":"0.1.10","strip-ansi":"6.0.1","strip-indent":"3.0.0","ts-jest":"28.0.8","ts-node":"10.9.1",tsd:"0.21.0",typescript:"4.8.2","yeoman-generator":"5.7.0",yo:"4.3.0"},peerDependencies:{prisma:"*"},peerDependenciesMeta:{prisma:{optional:!0}},dependencies:{"@prisma/engines-version":"4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b"},sideEffects:!1}});var gg={};Wi(gg,{DMMF:()=>et,DMMFClass:()=>Xe,Debug:()=>Qo,Decimal:()=>De,Engine:()=>wt,MetricsClient:()=>St,NotFoundError:()=>Qe,PrismaClientInitializationError:()=>ke,PrismaClientKnownRequestError:()=>Je,PrismaClientRustPanicError:()=>We,PrismaClientUnknownRequestError:()=>$e,PrismaClientValidationError:()=>Ee,Sql:()=>ce,decompressFromBase64:()=>dg,empty:()=>Nu,findSync:()=>void 0,getPrismaClient:()=>Gc,join:()=>Du,makeDocument:()=>uo,makeStrictEnum:()=>zc,objectEnumValues:()=>An,raw:()=>vi,sqltag:()=>xi,transformDocument:()=>ki,unpack:()=>co,warnEnvConflicts:()=>void 0});module.exports=ul(gg);d();p();m();var Jc=Z(ds());d();p();m();var St=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};u(St,"MetricsClient");d();p();m();d();p();m();function wo(e,t){var r;for(let n of t)for(let o of Object.getOwnPropertyNames(n.prototype))Object.defineProperty(e.prototype,o,(r=Object.getOwnPropertyDescriptor(n.prototype,o))!=null?r:Object.create(null))}u(wo,"applyMixins");d();p();m();var ft=Z(Ot());d();p();m();var Gt=9e15,lt=1e9,Oo="0123456789abcdef",gn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",hn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",_o={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Gt,maxE:Gt,crypto:!1},zs,Ye,B=!0,bn="[DecimalError] ",ct=bn+"Invalid argument: ",Js=bn+"Precision limit exceeded",Ws=bn+"crypto unavailable",Hs="[object Decimal]",le=Math.floor,re=Math.pow,af=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,uf=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,cf=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Qs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Re=1e7,$=7,lf=9007199254740991,ff=gn.length-1,Co=hn.length-1,C={toStringTag:Hs};C.absoluteValue=C.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};C.ceil=function(){return k(new this.constructor(this),this.e+1,2)};C.clampedTo=C.clamp=function(e,t){var r,n=this,o=n.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(ct+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new o(n)};C.comparedTo=C.cmp=function(e){var t,r,n,o,i=this,s=i.d,a=(e=new i.constructor(e)).d,c=i.s,l=e.s;if(!s||!a)return!c||!l?NaN:c!==l?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-l:0;if(c!==l)return c;if(i.e!==e.e)return i.e>e.e^c<0?1:-1;for(n=s.length,o=a.length,t=0,r=na[t]^c<0?1:-1;return n===o?0:n>o^c<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())+$,n.rounding=1,r=pf(n,ea(n,r)),n.precision=e,n.rounding=t,k(Ye==2||Ye==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};C.cubeRoot=C.cbrt=function(){var e,t,r,n,o,i,s,a,c,l,f=this,g=f.constructor;if(!f.isFinite()||f.isZero())return new g(f);for(B=!1,i=f.s*re(f.s*f,1/3),!i||Math.abs(i)==1/0?(r=se(f.d),e=f.e,(i=(e-r.length+1)%3)&&(r+=i==1||i==-2?"0":"00"),i=re(r,1/3),e=le((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?r="5e"+e:(r=i.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new g(r),n.s=f.s):n=new g(i.toString()),s=(e=g.precision)+3;;)if(a=n,c=a.times(a).times(a),l=c.plus(f),n=K(l.plus(f).times(a),l.plus(c),s+2,1),se(a.d).slice(0,s)===(r=se(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!o&&r=="4999"){if(!o&&(k(a,e+1,0),a.times(a).times(a).eq(f))){n=a;break}s+=4,o=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(k(n,e+1,1),t=!n.times(n).times(n).eq(f));break}return B=!0,k(n,e,g.rounding,t)};C.decimalPlaces=C.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-le(this.e/$))*$,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};C.dividedBy=C.div=function(e){return K(this,new this.constructor(e))};C.dividedToIntegerBy=C.divToInt=function(e){var t=this,r=t.constructor;return k(K(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 k(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,o,i=this,s=i.constructor,a=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(i.e,i.sd())+4,s.rounding=1,o=i.d.length,o<32?(e=Math.ceil(o/3),t=(1/vn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),i=zt(s,1,i.times(t),new s(1),!0);for(var c,l=e,f=new s(8);l--;)c=i.times(i),i=a.minus(c.times(f.minus(c.times(f))));return k(i,s.precision=r,s.rounding=n,!0)};C.hyperbolicSine=C.sinh=function(){var e,t,r,n,o=this,i=o.constructor;if(!o.isFinite()||o.isZero())return new i(o);if(t=i.precision,r=i.rounding,i.precision=t+Math.max(o.e,o.sd())+4,i.rounding=1,n=o.d.length,n<3)o=zt(i,2,o,o,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,o=o.times(1/vn(5,e)),o=zt(i,2,o,o,!0);for(var s,a=new i(5),c=new i(16),l=new i(20);e--;)s=o.times(o),o=o.times(a.plus(s.times(c.times(s).plus(l))))}return i.precision=t,i.rounding=r,k(o,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,K(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};C.inverseCosine=C.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),o=r.precision,i=r.rounding;return n!==-1?n===0?t.isNeg()?Ie(r,o,i):new r(0):new r(NaN):t.isZero()?Ie(r,o+4,i).times(.5):(r.precision=o+6,r.rounding=1,t=t.asin(),e=Ie(r,o+4,i).times(.5),r.precision=o,r.rounding=i,e.minus(t))};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,B=!1,r=r.times(r).minus(1).sqrt().plus(r),B=!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,B=!1,r=r.times(r).plus(1).sqrt().plus(r),B=!0,n.precision=e,n.rounding=t,r.ln())};C.inverseHyperbolicTangent=C.atanh=function(){var e,t,r,n,o=this,i=o.constructor;return o.isFinite()?o.e>=0?new i(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=i.precision,t=i.rounding,n=o.sd(),Math.max(n,e)<2*-o.e-1?k(new i(o),e,t,!0):(i.precision=r=n-o.e,o=K(o.plus(1),new i(1).minus(o),r+e,1),i.precision=e+4,i.rounding=1,o=o.ln(),i.precision=e,i.rounding=t,o.times(.5))):new i(NaN)};C.inverseSine=C.asin=function(){var e,t,r,n,o=this,i=o.constructor;return o.isZero()?new i(o):(t=o.abs().cmp(1),r=i.precision,n=i.rounding,t!==-1?t===0?(e=Ie(i,r+4,n).times(.5),e.s=o.s,e):new i(NaN):(i.precision=r+6,i.rounding=1,o=o.div(new i(1).minus(o.times(o)).sqrt().plus(1)).atan(),i.precision=r,i.rounding=n,o.times(2)))};C.inverseTangent=C.atan=function(){var e,t,r,n,o,i,s,a,c,l=this,f=l.constructor,g=f.precision,h=f.rounding;if(l.isFinite()){if(l.isZero())return new f(l);if(l.abs().eq(1)&&g+4<=Co)return s=Ie(f,g+4,h).times(.25),s.s=l.s,s}else{if(!l.s)return new f(NaN);if(g+4<=Co)return s=Ie(f,g+4,h).times(.5),s.s=l.s,s}for(f.precision=a=g+10,f.rounding=1,r=Math.min(28,a/$+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(B=!1,t=Math.ceil(a/$),n=1,c=l.times(l),s=new f(l),o=l;e!==-1;)if(o=o.times(c),i=s.minus(o.div(n+=2)),o=o.times(c),s=i.plus(o.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===i.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};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,o,i,s,a,c,l=this,f=l.constructor,g=f.precision,h=f.rounding,w=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new f(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)i=!0;else{for(o=r[0];o%10===0;)o/=10;i=o!==1}if(B=!1,a=g+w,s=ut(l,a),n=t?yn(f,a+10):ut(e,a),c=K(s,n,a,1),yr(c.d,o=g,h))do if(a+=10,s=ut(l,a),n=t?yn(f,a+10):ut(e,a),c=K(s,n,a,1),!i){+se(c.d).slice(o+1,o+15)+1==1e14&&(c=k(c,g+1,0));break}while(yr(c.d,o+=10,h));return B=!0,k(c,g,h)};C.minus=C.sub=function(e){var t,r,n,o,i,s,a,c,l,f,g,h,w=this,b=w.constructor;if(e=new b(e),!w.d||!e.d)return!w.s||!e.s?e=new b(NaN):w.d?e.s=-e.s:e=new b(e.d||w.s!==e.s?w:NaN),e;if(w.s!=e.s)return e.s=-e.s,w.plus(e);if(l=w.d,h=e.d,a=b.precision,c=b.rounding,!l[0]||!h[0]){if(h[0])e.s=-e.s;else if(l[0])e=new b(w);else return new b(c===3?-0:0);return B?k(e,a,c):e}if(r=le(e.e/$),f=le(w.e/$),l=l.slice(),i=f-r,i){for(g=i<0,g?(t=l,i=-i,s=h.length):(t=h,r=f,s=l.length),n=Math.max(Math.ceil(a/$),s)+2,i>n&&(i=n,t.length=1),t.reverse(),n=i;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=h.length,g=n0;--n)l[s++]=0;for(n=h.length;n>i;){if(l[--n]s?i+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=f.length,s-o<0&&(o=s,r=f,f=l,l=r),t=0;o;)t=(l[--o]=l[o]+f[o]+t)/Re|0,l[o]%=Re;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=wn(l,n),B?k(e,a,c):e};C.precision=C.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ct+e);return r.d?(t=Ks(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};C.round=function(){var e=this,t=e.constructor;return k(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())+$,n.rounding=1,r=df(n,ea(n,r)),n.precision=e,n.rounding=t,k(Ye>2?r.neg():r,e,t,!0)):new n(NaN)};C.squareRoot=C.sqrt=function(){var e,t,r,n,o,i,s=this,a=s.d,c=s.e,l=s.s,f=s.constructor;if(l!==1||!a||!a[0])return new f(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(B=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=se(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=le((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new f(t)):n=new f(l.toString()),r=(c=f.precision)+3;;)if(i=n,n=i.plus(K(s,i,r+2,1)).times(.5),se(i.d).slice(0,r)===(t=se(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!o&&t=="4999"){if(!o&&(k(i,c+1,0),i.times(i).eq(s))){n=i;break}r+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,c+1,1),e=!n.times(n).eq(s));break}return B=!0,k(n,c,f.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=K(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,k(Ye==2||Ye==4?r.neg():r,e,t,!0)):new n(NaN)};C.times=C.mul=function(e){var t,r,n,o,i,s,a,c,l,f=this,g=f.constructor,h=f.d,w=(e=new g(e)).d;if(e.s*=f.s,!h||!h[0]||!w||!w[0])return new g(!e.s||h&&!h[0]&&!w||w&&!w[0]&&!h?NaN:!h||!w?e.s/0:e.s*0);for(r=le(f.e/$)+le(e.e/$),c=h.length,l=w.length,c=0;){for(t=0,o=c+n;o>n;)a=i[o]+w[n]*h[o-n-1]+t,i[o--]=a%Re|0,t=a/Re|0;i[o]=(i[o]+t)%Re|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=wn(i,r),B?k(e,g.precision,g.rounding):e};C.toBinary=function(e,t){return Ro(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:(ve(e,0,lt),t===void 0?t=n.rounding:ve(t,0,8),k(r,e+r.e+1,t))};C.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Ve(n,!0):(ve(e,0,lt),t===void 0?t=o.rounding:ve(t,0,8),n=k(new o(n),e+1,t),r=Ve(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toFixed=function(e,t){var r,n,o=this,i=o.constructor;return e===void 0?r=Ve(o):(ve(e,0,lt),t===void 0?t=i.rounding:ve(t,0,8),n=k(new i(o),e+o.e+1,t),r=Ve(n,!1,e+n.e+1)),o.isNeg()&&!o.isZero()?"-"+r:r};C.toFraction=function(e){var t,r,n,o,i,s,a,c,l,f,g,h,w=this,b=w.d,y=w.constructor;if(!b)return new y(w);if(l=r=new y(1),n=c=new y(0),t=new y(n),i=t.e=Ks(b)-w.e-1,s=i%$,t.d[0]=re(10,s<0?$+s:s),e==null)e=i>0?t:l;else{if(a=new y(e),!a.isInt()||a.lt(l))throw Error(ct+a);e=a.gt(t)?i>0?t:l:a}for(B=!1,a=new y(se(b)),f=y.precision,y.precision=i=b.length*$*2;g=K(a,t,0,1,1),o=r.plus(g.times(n)),o.cmp(e)!=1;)r=n,n=o,o=l,l=c.plus(g.times(o)),c=o,o=t,t=a.minus(g.times(o)),a=o;return o=K(e.minus(r),n,0,1,1),c=c.plus(o.times(l)),r=r.plus(o.times(n)),c.s=l.s=w.s,h=K(l,n,i,1).minus(w).abs().cmp(K(c,r,i,1).minus(w).abs())<1?[l,n]:[c,r],y.precision=f,B=!0,h};C.toHexadecimal=C.toHex=function(e,t){return Ro(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:ve(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]?(B=!1,r=K(r,e,0,t,1).times(e),B=!0,k(r)):(e.s=r.s,r=e),r};C.toNumber=function(){return+this};C.toOctal=function(e,t){return Ro(this,8,e,t)};C.toPower=C.pow=function(e){var t,r,n,o,i,s,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(re(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,i=c.rounding,e.eq(1))return k(a,n,i);if(t=le(e.e/$),t>=e.d.length-1&&(r=l<0?-l:l)<=lf)return o=Ys(c,a,r,n),e.s<0?new c(1).div(o):k(o,n,i);if(s=a.s,s<0){if(tc.maxE+1||t0?s/0:0):(B=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),o=Fo(e.times(ut(a,n+r)),n),o.d&&(o=k(o,n+5,1),yr(o.d,n,i)&&(t=n+10,o=k(Fo(e.times(ut(a,t+r)),t),t+5,1),+se(o.d).slice(n+1,n+15)+1==1e14&&(o=k(o,n+1,0)))),o.s=s,B=!0,c.rounding=i,k(o,n,i))};C.toPrecision=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Ve(n,n.e<=o.toExpNeg||n.e>=o.toExpPos):(ve(e,1,lt),t===void 0?t=o.rounding:ve(t,0,8),n=k(new o(n),e,t),r=Ve(n,e<=n.e||n.e<=o.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):(ve(e,1,lt),t===void 0?t=n.rounding:ve(t,0,8)),k(new n(r),e,t)};C.toString=function(){var e=this,t=e.constructor,r=Ve(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};C.truncated=C.trunc=function(){return k(new this.constructor(this),this.e+1,1)};C.valueOf=C.toJSON=function(){var e=this,t=e.constructor,r=Ve(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function se(e){var t,r,n,o=e.length-1,i="",s=e[0];if(o>0){for(i+=s,t=1;tr)throw Error(ct+e)}u(ve,"checkInt32");function yr(e,t,r,n){var o,i,s,a;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=$,o=0):(o=Math.ceil((t+1)/$),t%=$),i=re(10,$-t),a=e[o]%i|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==i||r>3&&a+1==i/2)&&(e[o+1]/i/100|0)==re(10,t-2)-1||(a==i/2||a==0)&&(e[o+1]/i/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==i||!n&&r>3&&a+1==i/2)&&(e[o+1]/i/1e3|0)==re(10,t-3)-1,s}u(yr,"checkRoundingDigits");function dn(e,t,r){for(var n,o=[0],i,s=0,a=e.length;sr-1&&(o[n+1]===void 0&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}u(dn,"convertBase");function pf(e,t){var r,n,o;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),o=(1/vn(4,r)).toString()):(r=16,o="2.3283064365386962890625e-10"),e.precision+=r,t=zt(e,1,t.times(o),new e(1));for(var i=r;i--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}u(pf,"cosine");var K=function(){function e(n,o,i){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*o+a,n[c]=s%i|0,a=s/i|0;return a&&n.unshift(a),n}u(e,"multiplyInteger");function t(n,o,i,s){var a,c;if(i!=s)c=i>s?1:-1;else for(a=c=0;ao[a]?1:-1;break}return c}u(t,"compare");function r(n,o,i,s){for(var a=0;i--;)n[i]-=a,a=n[i]1;)n.shift()}return u(r,"subtract"),function(n,o,i,s,a,c){var l,f,g,h,w,b,y,T,M,A,S,P,_,I,R,L,H,X,z,V,Y=n.constructor,J=n.s==o.s?1:-1,W=n.d,j=o.d;if(!W||!W[0]||!j||!j[0])return new Y(!n.s||!o.s||(W?j&&W[0]==j[0]:!j)?NaN:W&&W[0]==0||!j?J*0:J/0);for(c?(w=1,f=n.e-o.e):(c=Re,w=$,f=le(n.e/w)-le(o.e/w)),z=j.length,H=W.length,M=new Y(J),A=M.d=[],g=0;j[g]==(W[g]||0);g++);if(j[g]>(W[g]||0)&&f--,i==null?(I=i=Y.precision,s=Y.rounding):a?I=i+(n.e-o.e)+1:I=i,I<0)A.push(1),b=!0;else{if(I=I/w+2|0,g=0,z==1){for(h=0,j=j[0],I++;(g1&&(j=e(j,h,c),W=e(W,h,c),z=j.length,H=W.length),L=z,S=W.slice(0,z),P=S.length;P=c/2&&++X;do h=0,l=t(j,S,z,P),l<0?(_=S[0],z!=P&&(_=_*c+(S[1]||0)),h=_/X|0,h>1?(h>=c&&(h=c-1),y=e(j,h,c),T=y.length,P=S.length,l=t(y,S,T,P),l==1&&(h--,r(y,z=10;h/=10)g++;M.e=g+f*w-1,k(M,a?i+M.e+1:i,s,b)}return M}}();function k(e,t,r,n){var o,i,s,a,c,l,f,g,h,w=e.constructor;e:if(t!=null){if(g=e.d,!g)return e;for(o=1,a=g[0];a>=10;a/=10)o++;if(i=t-o,i<0)i+=$,s=t,f=g[h=0],c=f/re(10,o-s-1)%10|0;else if(h=Math.ceil((i+1)/$),a=g.length,h>=a)if(n){for(;a++<=h;)g.push(0);f=c=0,o=1,i%=$,s=i-$+1}else break e;else{for(f=a=g[h],o=1;a>=10;a/=10)o++;i%=$,s=i-$+o,c=s<0?0:f/re(10,o-s-1)%10|0}if(n=n||t<0||g[h+1]!==void 0||(s<0?f:f%re(10,o-s-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(i>0?s>0?f/re(10,o-s):0:g[h-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,l?(t-=e.e+1,g[0]=re(10,($-t%$)%$),e.e=-t||0):g[0]=e.e=0,e;if(i==0?(g.length=h,a=1,h--):(g.length=h+1,a=re(10,$-i),g[h]=s>0?(f/re(10,o-s)%re(10,s)|0)*a:0),l)for(;;)if(h==0){for(i=1,s=g[0];s>=10;s/=10)i++;for(s=g[0]+=a,a=1;s>=10;s/=10)a++;i!=a&&(e.e++,g[0]==Re&&(g[0]=1));break}else{if(g[h]+=a,g[h]!=Re)break;g[h--]=0,a=1}for(i=g.length;g[--i]===0;)g.pop()}return B&&(e.e>w.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+at(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):o<0?(i="0."+at(-o-1)+i,r&&(n=r-s)>0&&(i+=at(n))):o>=s?(i+=at(o+1-s),r&&(n=r-o-1)>0&&(i=i+"."+at(n))):((n=o+1)0&&(o+1===s&&(i+="."),i+=at(n))),i}u(Ve,"finiteToString");function wn(e,t){var r=e[0];for(t*=$;r>=10;r/=10)t++;return t}u(wn,"getBase10Exponent");function yn(e,t,r){if(t>ff)throw B=!0,r&&(e.precision=r),Error(Js);return k(new e(gn),t,1,!0)}u(yn,"getLn10");function Ie(e,t,r){if(t>Co)throw Error(Js);return k(new e(hn),t,r,!0)}u(Ie,"getPi");function Ks(e){var t=e.length-1,r=t*$+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}u(Ks,"getPrecision");function at(e){for(var t="";e--;)t+="0";return t}u(at,"getZeroString");function Ys(e,t,r,n){var o,i=new e(1),s=Math.ceil(n/$+4);for(B=!1;;){if(r%2&&(i=i.times(t),Vs(i.d,s)&&(o=!0)),r=le(r/2),r===0){r=i.d.length-1,o&&i.d[r]===0&&++i.d[r];break}t=t.times(t),Vs(t.d,s)}return B=!0,i}u(Ys,"intPow");function Us(e){return e.d[e.d.length-1]&1}u(Us,"isOdd");function Zs(e,t,r){for(var n,o=new e(t[0]),i=0;++i17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(B=!1,c=b):c=t,a=new h(.03125);e.e>-2;)e=e.times(a),g+=5;for(n=Math.log(re(2,g))/Math.LN10*2+5|0,c+=n,r=i=s=new h(1),h.precision=c;;){if(i=k(i.times(e),c,1),r=r.times(++f),a=s.plus(K(i,r,c,1)),se(a.d).slice(0,c)===se(s.d).slice(0,c)){for(o=g;o--;)s=k(s.times(s),c,1);if(t==null)if(l<3&&yr(s.d,c-n,w,l))h.precision=c+=10,r=i=a=new h(1),f=0,l++;else return k(s,h.precision=b,w,B=!0);else return h.precision=b,s}s=a}}u(Fo,"naturalExponential");function ut(e,t){var r,n,o,i,s,a,c,l,f,g,h,w=1,b=10,y=e,T=y.d,M=y.constructor,A=M.rounding,S=M.precision;if(y.s<0||!T||!T[0]||!y.e&&T[0]==1&&T.length==1)return new M(T&&!T[0]?-1/0:y.s!=1?NaN:T?0:y);if(t==null?(B=!1,f=S):f=t,M.precision=f+=b,r=se(T),n=r.charAt(0),Math.abs(i=y.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)y=y.times(e),r=se(y.d),n=r.charAt(0),w++;i=y.e,n>1?(y=new M("0."+r),i++):y=new M(n+"."+r.slice(1))}else return l=yn(M,f+2,S).times(i+""),y=ut(new M(n+"."+r.slice(1)),f-b).plus(l),M.precision=S,t==null?k(y,S,A,B=!0):y;for(g=y,c=s=y=K(y.minus(1),y.plus(1),f,1),h=k(y.times(y),f,1),o=3;;){if(s=k(s.times(h),f,1),l=c.plus(K(s,new M(o),f,1)),se(l.d).slice(0,f)===se(c.d).slice(0,f))if(c=c.times(2),i!==0&&(c=c.plus(yn(M,f+2,S).times(i+""))),c=K(c,new M(w),f,1),t==null)if(yr(c.d,f-b,A,a))M.precision=f+=b,l=s=y=K(g.minus(1),g.plus(1),f,1),h=k(y.times(y),f,1),o=a=1;else return k(c,M.precision=S,A,B=!0);else return M.precision=S,c;c=l,o+=2}}u(ut,"naturalLogarithm");function Xs(e){return String(e.s*e.s/0)}u(Xs,"nonFiniteToString");function Io(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(n,o),t){if(o-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%$,r<0&&(n+=$),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Qs.test(t))return Io(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(uf.test(t))r=16,t=t.toLowerCase();else if(af.test(t))r=2;else if(cf.test(t))r=8;else throw Error(ct+t);for(i=t.search(/p/i),i>0?(c=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),i=t.indexOf("."),s=i>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,i=a-i,o=Ys(n,new n(r),i,i*2)),l=dn(t,r,Re),f=l.length-1,i=f;l[i]===0;--i)l.pop();return i<0?new n(e.s*0):(e.e=wn(l,f),e.d=l,B=!1,s&&(e=K(e,o,a*4)),c&&(e=e.times(Math.abs(c)<54?re(2,c):Ze.pow(2,c))),B=!0,e)}u(mf,"parseOther");function df(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:zt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/vn(5,r)),t=zt(e,2,t,t);for(var o,i=new e(5),s=new e(16),a=new e(20);r--;)o=t.times(t),t=t.times(i.plus(o.times(s.times(o).minus(a))));return t}u(df,"sine");function zt(e,t,r,n,o){var i,s,a,c,l=1,f=e.precision,g=Math.ceil(f/$);for(B=!1,c=r.times(r),a=new e(n);;){if(s=K(a.times(c),new e(t++*t++),f,1),a=o?n.plus(s):n.minus(s),n=K(s.times(c),new e(t++*t++),f,1),s=a.plus(n),s.d[g]!==void 0){for(i=g;s.d[i]===a.d[i]&&i--;);if(i==-1)break}i=a,a=n,n=s,s=i,l++}return B=!0,s.d.length=g+1,s}u(zt,"taylorSeries");function vn(e,t){for(var r=e;--t;)r*=e;return r}u(vn,"tinyPow");function ea(e,t){var r,n=t.s<0,o=Ie(e,e.precision,1),i=o.times(.5);if(t=t.abs(),t.lte(i))return Ye=n?4:1,t;if(r=t.divToInt(o),r.isZero())Ye=n?3:2;else{if(t=t.minus(r.times(o)),t.lte(i))return Ye=Us(r)?n?2:3:n?4:1,t;Ye=Us(r)?n?1:4:n?3:2}return t.minus(o).abs()}u(ea,"toLessThanHalfPi");function Ro(e,t,r,n){var o,i,s,a,c,l,f,g,h,w=e.constructor,b=r!==void 0;if(b?(ve(r,1,lt),n===void 0?n=w.rounding:ve(n,0,8)):(r=w.precision,n=w.rounding),!e.isFinite())f=Xs(e);else{for(f=Ve(e),s=f.indexOf("."),b?(o=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):o=t,s>=0&&(f=f.replace(".",""),h=new w(1),h.e=f.length-s,h.d=dn(Ve(h),10,o),h.e=h.d.length),g=dn(f,10,o),i=c=g.length;g[--c]==0;)g.pop();if(!g[0])f=b?"0p+0":"0";else{if(s<0?i--:(e=new w(e),e.d=g,e.e=i,e=K(e,h,r,n,0,o),g=e.d,i=e.e,l=zs),s=g[r],a=o/2,l=l||g[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&g[r-1]&1||n===(e.s<0?8:7)),g.length=r,l)for(;++g[--r]>o-1;)g[r]=0,r||(++i,g.unshift(1));for(c=g.length;!g[c-1];--c);for(s=0,f="";s1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)f+="0";for(g=dn(f,o,t),c=g.length;!g[c-1];--c);for(s=1,f="1.";sc)for(i-=c;i--;)f+="0";else it)return e.length=t,!0}u(Vs,"truncate");function gf(e){return new this(e).abs()}u(gf,"abs");function hf(e){return new this(e).acos()}u(hf,"acos");function yf(e){return new this(e).acosh()}u(yf,"acosh");function bf(e,t){return new this(e).plus(t)}u(bf,"add");function wf(e){return new this(e).asin()}u(wf,"asin");function vf(e){return new this(e).asinh()}u(vf,"asinh");function xf(e){return new this(e).atan()}u(xf,"atan");function Ef(e){return new this(e).atanh()}u(Ef,"atanh");function Af(e,t){e=new this(e),t=new this(t);var r,n=this.precision,o=this.rounding,i=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Ie(this,i,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Ie(this,n,o):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Ie(this,i,1).times(.5),r.s=e.s):t.s<0?(this.precision=i,this.rounding=1,r=this.atan(K(e,t,i,1)),t=Ie(this,i,1),this.precision=n,this.rounding=o,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(K(e,t,i,1)),r}u(Af,"atan2");function Tf(e){return new this(e).cbrt()}u(Tf,"cbrt");function Mf(e){return k(e=new this(e),e.e+1,2)}u(Mf,"ceil");function Pf(e,t,r){return new this(e).clamp(t,r)}u(Pf,"clamp");function Sf(e){if(!e||typeof e!="object")throw Error(bn+"Object expected");var t,r,n,o=e.defaults===!0,i=["precision",1,lt,"rounding",0,8,"toExpNeg",-Gt,0,"toExpPos",0,Gt,"maxE",0,Gt,"minE",-Gt,0,"modulo",0,9];for(t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(ct+r+": "+n);if(r="crypto",o&&(this[r]=_o[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Ws);else this[r]=!1;else throw Error(ct+r+": "+n);return this}u(Sf,"config");function Of(e){return new this(e).cos()}u(Of,"cos");function _f(e){return new this(e).cosh()}u(_f,"cosh");function ta(e){var t,r,n;function o(i){var s,a,c,l=this;if(!(l instanceof o))return new o(i);if(l.constructor=o,Gs(i)){l.s=i.s,B?!i.d||i.e>o.maxE?(l.e=NaN,l.d=null):i.e=10;a/=10)s++;B?s>o.maxE?(l.e=NaN,l.d=null):s=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:a[i++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);i=214e7?crypto.randomBytes(4).copy(t,i):(a.push(o%1e7),i+=4);i=n/4}else throw Error(Ws);else for(;i=10;o/=10)n++;n<$&&(r-=$-n)}return s.e=r,s.d=a,s}u(Vf,"random");function Gf(e){return k(e=new this(e),e.e+1,this.rounding)}u(Gf,"round");function zf(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}u(zf,"sign");function Jf(e){return new this(e).sin()}u(Jf,"sin");function Wf(e){return new this(e).sinh()}u(Wf,"sinh");function Hf(e){return new this(e).sqrt()}u(Hf,"sqrt");function Qf(e,t){return new this(e).sub(t)}u(Qf,"sub");function Kf(){var e=0,t=arguments,r=new this(t[e]);for(B=!1;r.s&&++e`}};u(Oe,"FieldRefImpl");d();p();m();var oa=["JsonNullValueInput","NullableJsonNullValueInput","JsonNullValueFilter"],En=Symbol(),No=new WeakMap,Ae=class{constructor(t){t===En?No.set(this,`Prisma.${this._getName()}`):No.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return No.get(this)}};u(Ae,"ObjectEnumValue");var Jt=class extends Ae{_getNamespace(){return"NullTypes"}};u(Jt,"NullTypesEnumValue");var br=class extends Jt{};u(br,"DbNull");var wr=class extends Jt{};u(wr,"JsonNull");var vr=class extends Jt{};u(vr,"AnyNull");var An={classes:{DbNull:br,JsonNull:wr,AnyNull:vr},instances:{DbNull:new br(En),JsonNull:new wr(En),AnyNull:new vr(En)}};d();p();m();function Tn(e){return Ze.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&Array.isArray(e.d)}u(Tn,"isDecimalJsLike");function ia(e){if(Ze.isDecimal(e))return String(e);let t=new Ze(0);return t.d=e.d,t.e=e.e,t.s=e.s,String(t)}u(ia,"stringifyDecimalJsLike");var fe=u((e,t)=>{let r={};for(let n of e){let o=n[t];r[o]=n}return r},"keyBy"),Wt={String:!0,Int:!0,Float:!0,Boolean:!0,Long:!0,DateTime:!0,ID:!0,UUID:!0,Json:!0,Bytes:!0,Decimal:!0,BigInt:!0};var ep={string:"String",boolean:"Boolean",object:"Json",symbol:"Symbol"};function Ht(e){return typeof e=="string"?e:e.name}u(Ht,"stringifyGraphQLType");function Er(e,t){return t?`List<${e}>`:e}u(Er,"wrapWithList");var tp=/^(\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60))(\.\d{1,})?(([Z])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$/,rp=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Qt(e,t){let r=t==null?void 0:t.type;if(e===null)return"null";if(Object.prototype.toString.call(e)==="[object BigInt]")return"BigInt";if(De.isDecimal(e)||r==="Decimal"&&Tn(e))return"Decimal";if(x.Buffer.isBuffer(e))return"Bytes";if(np(e,t))return r.name;if(e instanceof Ae)return e._getName();if(e instanceof Oe)return e._toGraphQLInputType();if(Array.isArray(e)){let o=e.reduce((i,s)=>{let a=Qt(s,t);return i.includes(a)||i.push(a),i},[]);return o.includes("Float")&&o.includes("Int")&&(o=["Float"]),`List<${o.join(" | ")}>`}let n=typeof e;if(n==="number")return Math.trunc(e)===e?"Int":"Float";if(Object.prototype.toString.call(e)==="[object Date]")return"DateTime";if(n==="string"){if(rp.test(e))return"UUID";if(new Date(e).toString()==="Invalid Date")return"String";if(tp.test(e))return"DateTime"}return ep[n]}u(Qt,"getGraphQLType");function np(e,t){var n;let r=t==null?void 0:t.type;if(!ip(r))return!1;if((t==null?void 0:t.namespace)==="prisma"&&oa.includes(r.name)){let o=(n=e==null?void 0:e.constructor)==null?void 0:n.name;return typeof o=="string"&&An.instances[o]===e&&r.values.includes(o)}return typeof e=="string"&&r.values.includes(e)}u(np,"isValidEnumValue");function Mn(e,t){return t.reduce((n,o)=>{let i=(0,sa.default)(e,o);return in.length*3)),str:null}).str}u(Mn,"getSuggestion");function Kt(e,t=!1){if(typeof e=="string")return e;if(e.values)return`enum ${e.name} { +${(0,ko.default)(e.values.join(", "),2)} +}`;{let r=(0,ko.default)(e.fields.map(n=>{let o=`${n.name}`,i=`${t?ft.default.green(o):o}${n.isRequired?"":"?"}: ${ft.default.white(n.inputTypes.map(s=>Er(op(s.type)?s.type.name:Ht(s.type),s.isList)).join(" | "))}`;return n.isRequired?i:ft.default.dim(i)}).join(` +`),2);return`${ft.default.dim("type")} ${ft.default.bold.dim(e.name)} ${ft.default.dim("{")} +${r} +${ft.default.dim("}")}`}}u(Kt,"stringifyInputType");function op(e){return typeof e!="string"}u(op,"argIsInputType");function xr(e){return typeof e=="string"?e==="Null"?"null":e:e.name}u(xr,"getInputTypeName");function _t(e){return typeof e=="string"?e:e.name}u(_t,"getOutputTypeName");function $o(e,t,r=!1){if(typeof e=="string")return e==="Null"?"null":e;if(e.values)return e.values.join(" | ");let n=e,o=t&&n.fields.every(i=>{var s;return i.inputTypes[0].location==="inputObjectTypes"||((s=i.inputTypes[1])==null?void 0:s.location)==="inputObjectTypes"});return r?xr(e):n.fields.reduce((i,s)=>{let a="";return!o&&!s.isRequired?a=s.inputTypes.map(c=>xr(c.type)).join(" | "):a=s.inputTypes.map(c=>$o(c.type,s.isRequired,!0)).join(" | "),i[s.name+(s.isRequired?"":"?")]=a,i},{})}u($o,"inputTypeToJson");function aa(e,t,r){let n={};for(let o of e)n[r(o)]=o;for(let o of t){let i=r(o);n[i]||(n[i]=o)}return Object.values(n)}u(aa,"unionBy");function Pn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}u(Pn,"lowerCase");function ua(e){return e.endsWith("GroupByOutputType")}u(ua,"isGroupByOutputName");function ip(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&Array.isArray(e.values)}u(ip,"isSchemaEnum");var Ar=class{constructor({datamodel:t}){this.datamodel=t,this.datamodelEnumMap=this.getDatamodelEnumMap(),this.modelMap=this.getModelMap(),this.typeMap=this.getTypeMap(),this.typeAndModelMap=this.getTypeModelMap()}getDatamodelEnumMap(){return fe(this.datamodel.enums,"name")}getModelMap(){return{...fe(this.datamodel.models,"name")}}getTypeMap(){return{...fe(this.datamodel.types,"name")}}getTypeModelMap(){return{...this.getTypeMap(),...this.getModelMap()}}};u(Ar,"DMMFDatamodelHelper");var Tr=class{constructor({mappings:t}){this.mappings=t,this.mappingsMap=this.getMappingsMap()}getMappingsMap(){return fe(this.mappings.modelOperations,"model")}};u(Tr,"DMMFMappingsHelper");var Mr=class{constructor({schema:t}){this.outputTypeToMergedOutputType=u(t=>({...t,fields:t.fields}),"outputTypeToMergedOutputType");this.schema=t,this.enumMap=this.getEnumMap(),this.queryType=this.getQueryType(),this.mutationType=this.getMutationType(),this.outputTypes=this.getOutputTypes(),this.outputTypeMap=this.getMergedOutputTypeMap(),this.resolveOutputTypes(),this.inputObjectTypes=this.schema.inputObjectTypes,this.inputTypeMap=this.getInputTypeMap(),this.resolveInputTypes(),this.resolveFieldArgumentTypes(),this.queryType=this.outputTypeMap.Query,this.mutationType=this.outputTypeMap.Mutation,this.rootFieldMap=this.getRootFieldMap()}get[Symbol.toStringTag](){return"DMMFClass"}resolveOutputTypes(){for(let t of this.outputTypes.model){for(let r of t.fields)typeof r.outputType.type=="string"&&!Wt[r.outputType.type]&&(r.outputType.type=this.outputTypeMap[r.outputType.type]||this.outputTypeMap[r.outputType.type]||this.enumMap[r.outputType.type]||r.outputType.type);t.fieldMap=fe(t.fields,"name")}for(let t of this.outputTypes.prisma){for(let r of t.fields)typeof r.outputType.type=="string"&&!Wt[r.outputType.type]&&(r.outputType.type=this.outputTypeMap[r.outputType.type]||this.outputTypeMap[r.outputType.type]||this.enumMap[r.outputType.type]||r.outputType.type);t.fieldMap=fe(t.fields,"name")}}resolveInputTypes(){let t=this.inputObjectTypes.prisma;this.inputObjectTypes.model&&t.push(...this.inputObjectTypes.model);for(let r of t){for(let n of r.fields)for(let o of n.inputTypes){let i=o.type;typeof i=="string"&&!Wt[i]&&(this.inputTypeMap[i]||this.enumMap[i])&&(o.type=this.inputTypeMap[i]||this.enumMap[i]||i)}r.fieldMap=fe(r.fields,"name")}}resolveFieldArgumentTypes(){for(let t of this.outputTypes.prisma)for(let r of t.fields)for(let n of r.args)for(let o of n.inputTypes){let i=o.type;typeof i=="string"&&!Wt[i]&&(o.type=this.inputTypeMap[i]||this.enumMap[i]||i)}for(let t of this.outputTypes.model)for(let r of t.fields)for(let n of r.args)for(let o of n.inputTypes){let i=o.type;typeof i=="string"&&!Wt[i]&&(o.type=this.inputTypeMap[i]||this.enumMap[i]||o.type)}}getQueryType(){return this.schema.outputObjectTypes.prisma.find(t=>t.name==="Query")}getMutationType(){return this.schema.outputObjectTypes.prisma.find(t=>t.name==="Mutation")}getOutputTypes(){return{model:this.schema.outputObjectTypes.model.map(this.outputTypeToMergedOutputType),prisma:this.schema.outputObjectTypes.prisma.map(this.outputTypeToMergedOutputType)}}getEnumMap(){return{...fe(this.schema.enumTypes.prisma,"name"),...this.schema.enumTypes.model?fe(this.schema.enumTypes.model,"name"):void 0}}hasEnumInNamespace(t,r){var n;return((n=this.schema.enumTypes[r])==null?void 0:n.find(o=>o.name===t))!==void 0}getMergedOutputTypeMap(){return{...fe(this.outputTypes.model,"name"),...fe(this.outputTypes.prisma,"name")}}getInputTypeMap(){return{...this.schema.inputObjectTypes.model?fe(this.schema.inputObjectTypes.model,"name"):void 0,...fe(this.schema.inputObjectTypes.prisma,"name")}}getRootFieldMap(){return{...fe(this.queryType.fields,"name"),...fe(this.mutationType.fields,"name")}}};u(Mr,"DMMFSchemaHelper");var pt=class{constructor(t){return Object.assign(this,new Ar(t),new Tr(t))}};u(pt,"BaseDMMFHelper");wo(pt,[Ar,Tr]);var Xe=class{constructor(t){return Object.assign(this,new pt(t),new Mr(t))}};u(Xe,"DMMFHelper");wo(Xe,[pt,Mr]);d();p();m();d();p();m();var et;(t=>{let e;(M=>(M.findUnique="findUnique",M.findFirst="findFirst",M.findMany="findMany",M.create="create",M.createMany="createMany",M.update="update",M.updateMany="updateMany",M.upsert="upsert",M.delete="delete",M.deleteMany="deleteMany",M.groupBy="groupBy",M.count="count",M.aggregate="aggregate",M.findRaw="findRaw",M.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(et||(et={}));d();p();m();var Bn=Z(Sa());var Xp=100,Ho=[],Oa,_a;typeof v!="undefined"&&typeof((Oa=v.stderr)==null?void 0:Oa.write)!="function"&&(Bn.default.log=(_a=console.debug)!=null?_a:console.log);function em(e){let t=(0,Bn.default)(e),r=Object.assign((...n)=>(t.log=r.log,n.length!==0&&Ho.push([e,...n]),Ho.length>Xp&&Ho.shift(),t("",...n)),t);return r}u(em,"debugCall");var Qo=Object.assign(em,Bn.default);var Ge=Qo;d();p();m();d();p();m();d();p();m();d();p();m();d();p();m();d();p();m();d();p();m();d();p();m();d();p();m();d();p();m();var Ca=typeof globalThis=="object"?globalThis:global;d();p();m();var dt="1.1.0";d();p();m();var Fa=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function tm(e){var t=new Set([e]),r=new Set,n=e.match(Fa);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return u(function(c){return c===e},"isExactmatch");function i(a){return r.add(a),!1}u(i,"_reject");function s(a){return t.add(a),!0}return u(s,"_accept"),u(function(c){if(t.has(c))return!0;if(r.has(c))return!1;var l=c.match(Fa);if(!l)return i(c);var f={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return f.prerelease!=null||o.major!==f.major?i(c):o.major===0?o.minor===f.minor&&o.patch<=f.patch?s(c):i(c):o.minor<=f.minor?s(c):i(c)},"isCompatible")}u(tm,"_makeCompatibilityCheck");var Ia=tm(dt);var rm=dt.split(".")[0],Or=Symbol.for("opentelemetry.js.api."+rm),_r=Ca;function gt(e,t,r,n){var o;n===void 0&&(n=!1);var i=_r[Or]=(o=_r[Or])!==null&&o!==void 0?o:{version:dt};if(!n&&i[e]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(s.stack||s.message),!1}if(i.version!==dt){var s=new Error("@opentelemetry/api: All API registration versions must match");return r.error(s.stack||s.message),!1}return i[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+dt+"."),!0}u(gt,"registerGlobal");function Ne(e){var t,r,n=(t=_r[Or])===null||t===void 0?void 0:t.version;if(!(!n||!Ia(n)))return(r=_r[Or])===null||r===void 0?void 0:r[e]}u(Ne,"getGlobal");function ht(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+dt+".");var r=_r[Or];r&&delete r[e]}u(ht,"unregisterGlobal");var Ra=function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return u(e,"DiagComponentLogger"),e.prototype.debug=function(){for(var t=[],r=0;rxe.ALL&&(e=xe.ALL),t=t||{};function r(n,o){var i=t[n];return typeof i=="function"&&e>=o?i.bind(t):function(){}}return u(r,"_filterFunc"),{error:r("error",xe.ERROR),warn:r("warn",xe.WARN),info:r("info",xe.INFO),debug:r("debug",xe.DEBUG),verbose:r("verbose",xe.VERBOSE)}}u(Da,"createLogLevelDiagLogger");var nm="diag",Me=function(){function e(){function t(n){return function(){for(var o=[],i=0;i";c.warn("Current logger will be overwritten from "+f),l.warn("Current logger will overwrite one already registered from "+f)}return gt("diag",l,r,!0)},r.disable=function(){ht(nm,r)},r.createComponentLogger=function(n){return new Ra(n)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return u(e,"DiagAPI"),e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();d();p();m();var Na=function(){function e(t){this._entries=t?new Map(t):new Map}return u(e,"BaggageImpl"),e.prototype.getEntry=function(t){var r=this._entries.get(t);if(!!r)return Object.assign({},r)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var r=t[0],n=t[1];return[r,n]})},e.prototype.setEntry=function(t,r){var n=new e(this._entries);return n._entries.set(t,r),n},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t=[],r=0;rwm||(this._internalState=t.split(tu).reverse().reduce(function(r,n){var o=n.trim(),i=o.indexOf(ru);if(i!==-1){var s=o.slice(0,i),a=o.slice(i+1,n.length);Za(s)&&Xa(a)&&r.set(s,a)}return r},new Map),this._internalState.size>eu&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,eu))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}();d();p();m();d();p();m();d();p();m();d();p();m();d();p();m();var ni="trace",nu=function(){function e(){this._proxyTracerProvider=new ti,this.wrapSpanContext=za,this.isSpanContextValid=Ir,this.deleteSpan=qa,this.getSpan=ei,this.getSpanContext=Jn,this.setSpan=Fr,this.setSpanContext=Ua}return u(e,"TraceAPI"),e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var r=gt(ni,this._proxyTracerProvider,Me.instance());return r&&this._proxyTracerProvider.setDelegate(t),r},e.prototype.getTracerProvider=function(){return Ne(ni)||this._proxyTracerProvider},e.prototype.getTracer=function(t,r){return this.getTracerProvider().getTracer(t,r)},e.prototype.disable=function(){ht(ni,Me.instance()),this._proxyTracerProvider=new ti},e}();d();p();m();d();p();m();var ou=function(){function e(){}return u(e,"NoopTextMapPropagator"),e.prototype.inject=function(t,r){},e.prototype.extract=function(t,r){return t},e.prototype.fields=function(){return[]},e}();d();p();m();var oi=qn("OpenTelemetry Baggage Key");function iu(e){return e.getValue(oi)||void 0}u(iu,"getBaggage");function su(e,t){return e.setValue(oi,t)}u(su,"setBaggage");function au(e){return e.deleteValue(oi)}u(au,"deleteBaggage");var ii="propagation",xm=new ou,uu=function(){function e(){this.createBaggage=ka,this.getBaggage=iu,this.setBaggage=su,this.deleteBaggage=au}return u(e,"PropagationAPI"),e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(t){return gt(ii,t,Me.instance())},e.prototype.inject=function(t,r,n){return n===void 0&&(n=ja),this._getGlobalPropagator().inject(t,r,n)},e.prototype.extract=function(t,r,n){return n===void 0&&(n=$a),this._getGlobalPropagator().extract(t,r,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){ht(ii,Me.instance())},e.prototype._getGlobalPropagator=function(){return Ne(ii)||xm},e}();var bt=Un.getInstance(),Hn=nu.getInstance(),Jy=uu.getInstance(),Hy=Me.instance();d();p();m();d();p();m();d();p();m();var wt=class{};u(wt,"Engine");d();p();m();var ke=class extends Error{constructor(r,n,o){super(r);this.clientVersion=n,this.errorCode=o,Error.captureStackTrace(ke)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};u(ke,"PrismaClientInitializationError");d();p();m();var Je=class extends Error{constructor(r,n,o,i){super(r);this.code=n,this.clientVersion=o,this.meta=i}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};u(Je,"PrismaClientKnownRequestError");d();p();m();var We=class extends Error{constructor(r,n){super(r);this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};u(We,"PrismaClientRustPanicError");d();p();m();var $e=class extends Error{constructor(r,n){super(r);this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};u($e,"PrismaClientUnknownRequestError");d();p();m();function yu(e,t){return e.user_facing_error.error_code?new Je(e.user_facing_error.message,e.user_facing_error.error_code,t,e.user_facing_error.meta):new $e(e.error,t)}u(yu,"prismaGraphQLToJSError");d();p();m();d();p();m();function rr({context:e,tracingConfig:t}){let r=Hn.getSpanContext(e!=null?e:bt.active());return(t==null?void 0:t.enabled)&&(r==null?void 0:r.traceFlags)===1?`00-${r.traceId}-${r.spanId}-01`:"00-00-00-00"}u(rr,"getTraceParent");d();p();m();function ui(e){let t=e.includes("tracing");return{get enabled(){return Boolean(globalThis.PRISMA_INSTRUMENTATION&&t)},get middleware(){return Boolean(globalThis.PRISMA_INSTRUMENTATION&&globalThis.PRISMA_INSTRUMENTATION.middleware)}}}u(ui,"getTracingConfig");d();p();m();async function nr(e,t){var o;if(e.enabled===!1)return t();let r=Hn.getTracer("prisma"),n=(o=e.context)!=null?o:bt.active();if(e.active===!1){let i=r.startSpan(`prisma:client:${e.name}`,e,n);try{return await t(i,n)}finally{i.end()}}return r.startActiveSpan(`prisma:client:${e.name}`,e,n,async i=>{try{return await t(i,bt.active())}finally{i.end()}})}u(nr,"runInChildSpan");d();p();m();var Au=Z(mu());d();p();m();d();p();m();var Dr=class extends Error{constructor(r,n){super(r);this.clientVersion=n.clientVersion,this.cause=n.cause}get[Symbol.toStringTag](){return this.name}};u(Dr,"PrismaClientError");var ye=class extends Dr{constructor(r,n){var o;super(r,n);this.isRetryable=(o=n.isRetryable)!=null?o:!0}};u(ye,"DataProxyError");d();p();m();d();p();m();function ee(e,t){return{...e,isRetryable:t}}u(ee,"setRetryable");var or=class extends ye{constructor(r){super("This request must be retried",ee(r,!0));this.name="ForcedRetryError";this.code="P5001"}};u(or,"ForcedRetryError");d();p();m();var tt=class extends ye{constructor(r,n){super(r,ee(n,!1));this.name="InvalidDatasourceError";this.code="P5002"}};u(tt,"InvalidDatasourceError");d();p();m();var He=class extends ye{constructor(r,n){super(r,ee(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};u(He,"NotImplementedYetError");d();p();m();d();p();m();var ue=class extends ye{constructor(r,n){var i;super(r,n);this.response=n.response;let o=(i=this.response.headers)==null?void 0:i["Prisma-Request-Id"];if(o){let s=`(The request id was: ${o})`;this.message=this.message+" "+s}}};u(ue,"DataProxyAPIError");var Rt=class extends ue{constructor(r){super("Schema needs to be uploaded",ee(r,!0));this.name="SchemaMissingError";this.code="P5005"}};u(Rt,"SchemaMissingError");d();p();m();d();p();m();var Sm="This request could not be understood by the server",ir=class extends ue{constructor(r,n,o){super(n||Sm,ee(r,!1));this.name="BadRequestError";this.code="P5000";o&&(this.code=o)}};u(ir,"BadRequestError");d();p();m();var Nr=class extends ue{constructor(r){super("Request timed out",ee(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};u(Nr,"GatewayTimeoutError");d();p();m();var sr=class extends ue{constructor(r){super("Requested resource does not exist",ee(r,!1));this.name="NotFoundError";this.code="P5003"}};u(sr,"NotFoundError");d();p();m();var Om="Unknown server error",vt=class extends ue{constructor(r,n,o){super(n||Om,ee(r,!0));this.name="ServerError";this.code="P5006";this.logs=o}};u(vt,"ServerError");d();p();m();var kr=class extends ue{constructor(r){super("Unauthorized, check your connection string",ee(r,!1));this.name="UnauthorizedError";this.code="P5007"}};u(kr,"UnauthorizedError");d();p();m();var $r=class extends ue{constructor(r){super("Usage exceeded, retry again later",ee(r,!0));this.name="UsageExceededError";this.code="P5008"}};u($r,"UsageExceededError");async function ci(e,t){var n,o,i,s,a;if(e.ok)return;let r={clientVersion:t,response:e};if(e.status===400){let c;try{let l=await e.json();c=(o=(n=l==null?void 0:l.EngineNotStarted)==null?void 0:n.reason)==null?void 0:o.KnownEngineStartupError}catch(l){}if(c)throw new ir(r,c.msg,c.error_code)}if(e.status===401)throw new kr(r);if(e.status===404)try{let c=await e.json();return((i=c==null?void 0:c.EngineNotStarted)==null?void 0:i.reason)==="SchemaMissing"?new Rt(r):new sr(r)}catch(c){return new sr(r)}if(e.status===429)throw new $r(r);if(e.status===504)throw new Nr(r);if(e.status>=500){let c;try{c=await e.json()}catch(l){throw new vt(r)}if(typeof((s=c==null?void 0:c.EngineNotStarted)==null?void 0:s.reason)=="string")throw new vt(r,c.EngineNotStarted.reason);if(typeof((a=c==null?void 0:c.EngineNotStarted)==null?void 0:a.reason)=="object"){let l=Object.keys(c.EngineNotStarted.reason);if(l.length>0){let g=c.EngineNotStarted.reason[l[0]];throw new vt(r,l[0],g.logs)}}throw new vt(r)}if(e.status>=400)throw new ir(r)}u(ci,"responseToError");d();p();m();function bu(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(o=>setTimeout(()=>o(n),n))}u(bu,"backOff");d();p();m();var wu={"@prisma/debug":"workspace:4.3.1","@prisma/engines-version":"4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b","@prisma/fetch-engine":"workspace:4.3.1","@prisma/get-platform":"workspace:4.3.1","@swc/core":"1.2.242","@swc/jest":"0.2.22","@types/jest":"28.1.7","@types/node":"16.11.56",execa:"5.1.1",jest:"28.1.3",typescript:"4.8.2"};d();p();m();d();p();m();var jr=class extends ye{constructor(r,n){super(`Cannot fetch data from service: +${r}`,ee(n,!0));this.name="RequestError";this.code="P5010"}};u(jr,"RequestError");d();p();m();function vu(){return typeof self=="undefined"?"node":"browser"}u(vu,"getJSRuntimeName");async function Lr(e,t){var o;let r=t.clientVersion,n=vu();try{return n==="browser"?await fetch(e,t):await li(e,t)}catch(i){let s=(o=i.message)!=null?o:"Unknown error";throw new jr(s,{clientVersion:r})}}u(Lr,"request");function Cm(e){return{...e.headers,"Content-Type":"application/json"}}u(Cm,"buildHeaders");function Fm(e){return{method:e.method,headers:Cm(e)}}u(Fm,"buildOptions");function Im(e,t){return{text:()=>x.Buffer.concat(e).toString(),json:()=>JSON.parse(x.Buffer.concat(e).toString()),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:t.headers}}u(Im,"buildResponse");async function li(e,t={}){let r=Rm("https"),n=Fm(t),o=[],{origin:i}=new URL(e);return new Promise((s,a)=>{var l;let c=r.request(e,n,f=>{let{statusCode:g,headers:{location:h}}=f;g>=301&&g<=399&&h&&(h.startsWith("http")===!1?s(li(`${i}${h}`,t)):s(li(h,t))),f.on("data",w=>o.push(w)),f.on("end",()=>s(Im(o,f))),f.on("error",a)});c.on("error",a),c.end((l=t.body)!=null?l:"")})}u(li,"nodeFetch");var Rm=typeof require!="undefined"?require:()=>{};var Dm=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,xu=Ge("prisma:client:dataproxyEngine");async function Nm(e){var i,s,a;let t=wu["@prisma/engines-version"],r=(i=e.clientVersion)!=null?i:"unknown";if(v.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return v.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;let[n,o]=(s=r==null?void 0:r.split("-"))!=null?s:[];if(o===void 0&&Dm.test(n))return n;if(o!==void 0||r==="0.0.0"){let[c]=(a=t.split("-"))!=null?a:[],[l,f,g]=c.split("."),h=km(`<=${l}.${f}.${g}`),b=await(await Lr(h,{clientVersion:r})).text();xu("length of body fetched from unpkg.com",b.length);let y;try{y=JSON.parse(b)}catch(T){throw console.error("JSON.parse error: body fetched from unpkg.com: ",b),T}return y.version}throw new He("Only `major.minor.patch` versions are supported by Prisma Data Proxy.",{clientVersion:r})}u(Nm,"_getClientVersion");async function Eu(e){let t=await Nm(e);return xu("version",t),t}u(Eu,"getClientVersion");function km(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}u(km,"prismaPkgURL");var $m=10,jm=Promise.resolve(),fi=Ge("prisma:client:dataproxyEngine"),ar=class extends wt{constructor(r){var i,s,a,c;super();this.config=r,this.env={...this.config.env,...v.env},this.inlineSchema=(i=r.inlineSchema)!=null?i:"",this.inlineDatasources=(s=r.inlineDatasources)!=null?s:{},this.inlineSchemaHash=(a=r.inlineSchemaHash)!=null?a:"",this.clientVersion=(c=r.clientVersion)!=null?c:"unknown",this.logEmitter=new Au.default,this.logEmitter.on("error",()=>{});let[n,o]=this.extractHostAndApiKey();this.remoteClientVersion=jm.then(()=>Eu(this.config)),this.headers={Authorization:`Bearer ${o}`},this.host=n,fi("host",this.host)}version(){return"unknown"}async start(){}async stop(){}on(r,n){if(r==="beforeExit")throw new He("beforeExit event is not yet supported",{clientVersion:this.clientVersion});this.logEmitter.on(r,n)}async url(r){return`https://${this.host}/${await this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async getConfig(){return Promise.resolve({datasources:[{activeProvider:this.config.activeProvider}]})}getDmmf(){throw new He("getDmmf is not yet supported",{clientVersion:this.clientVersion})}async uploadSchema(){let r=await Lr(await this.url("schema"),{method:"PUT",headers:this.headers,body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||fi("schema response status",r.status);let n=await ci(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`})}request(r,n,o=0){return this.logEmitter.emit("query",{query:r}),this.requestInternal({query:r,variables:{}},n,o)}async requestBatch(r,n,o=!1,i=0){this.logEmitter.emit("query",{query:`Batch${o?" in transaction":""} (${r.length}): +${r.join(` +`)}`});let s={batch:r.map(c=>({query:c,variables:{}})),transaction:o},{batchResult:a}=await this.requestInternal(s,n,i);return a}async requestInternal(r,n,o){var i;try{this.logEmitter.emit("info",{message:`Calling ${await this.url("graphql")} (n=${o})`});let s=await Lr(await this.url("graphql"),{method:"POST",headers:{...n,...this.headers},body:JSON.stringify(r),clientVersion:this.clientVersion});s.ok||fi("graphql response status",s.status);let a=await ci(s,this.clientVersion);if(a instanceof Rt)throw await this.uploadSchema(),new or({clientVersion:this.clientVersion,cause:a});if(a)throw a;let c=await s.json();if(c.errors&&c.errors.length===1)throw yu(c.errors[0],this.config.clientVersion);return c}catch(s){if(this.logEmitter.emit("error",{message:`Error while querying: ${(i=s.message)!=null?i:"(unknown)"}`}),!(s instanceof ye)||!s.isRetryable)throw s;if(o>=$m)throw s instanceof or?s.cause:s;this.logEmitter.emit("warn",{message:"This request can be retried"});let a=await bu(o);return this.logEmitter.emit("warn",{message:`Retrying after ${a}ms`}),this.requestInternal(r,n,o+1)}}transaction(){throw new He("Interactive transactions are not yet supported",{clientVersion:this.clientVersion})}extractHostAndApiKey(){let r=this.mergeOverriddenDatasources(),n=Object.keys(r)[0],o=r[n],i=this.resolveDatasourceURL(n,o),s;try{s=new URL(i)}catch(g){throw new tt("Could not parse URL of the datasource",{clientVersion:this.clientVersion})}let{protocol:a,host:c,searchParams:l}=s;if(a!=="prisma:")throw new tt("Datasource URL must use prisma:// protocol when --data-proxy is used",{clientVersion:this.clientVersion});let f=l.get("api_key");if(f===null||f.length<1)throw new tt("No valid API key found in the datasource URL",{clientVersion:this.clientVersion});return[c,f]}mergeOverriddenDatasources(){if(this.config.datasources===void 0)return this.inlineDatasources;let r={...this.inlineDatasources};for(let n of this.config.datasources){if(!this.inlineDatasources[n.name])throw new Error(`Unknown datasource: ${n.name}`);r[n.name]={url:{fromEnvVar:null,value:n.url}}}return r}resolveDatasourceURL(r,n){if(n.url.value)return n.url.value;if(n.url.fromEnvVar){let o=n.url.fromEnvVar,i=this.env[o];if(i===void 0)throw new tt(`Datasource "${r}" references an environment variable "${o}" that is not set`,{clientVersion:this.clientVersion});return i}throw new tt(`Datasource "${r}" specification is invalid: both value and fromEnvVar are null`,{clientVersion:this.clientVersion})}metrics(r){throw new He("Metric are not yet supported for Data Proxy",{clientVersion:this.clientVersion})}};u(ar,"DataProxyEngine");d();p();m();d();p();m();var Tu="library";function pi(e){let t=Lm();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":Tu)}u(pi,"getClientEngineType");function Lm(){let e=v.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}u(Lm,"getEngineTypeFromEnvVar");d();p();m();var qm=Z(Pu()),Um=Z(di());function qr(e){return e instanceof Error}u(qr,"isError");var ur={};Wi(ur,{error:()=>zm,info:()=>Gm,log:()=>Vm,query:()=>Jm,should:()=>Cu,tags:()=>Vr,warn:()=>gi});d();p();m();var Ur=Z(Ot());var Vr={error:Ur.default.red("prisma:error"),warn:Ur.default.yellow("prisma:warn"),info:Ur.default.cyan("prisma:info"),query:Ur.default.blue("prisma:query")},Cu={warn:!v.env.PRISMA_DISABLE_WARNINGS};function Vm(...e){console.log(...e)}u(Vm,"log");function gi(e,...t){Cu.warn&&console.warn(`${Vr.warn} ${e}`,...t)}u(gi,"warn");function Gm(e,...t){console.info(`${Vr.info} ${e}`,...t)}u(Gm,"info");function zm(e,...t){console.error(`${Vr.error} ${e}`,...t)}u(zm,"error");function Jm(e,...t){console.log(`${Vr.query} ${e}`,...t)}u(Jm,"query");d();p();m();function hi(e,t){throw new Error(t)}u(hi,"assertNever");d();p();m();function yi(e){let t;return(...r)=>t!=null?t:t=e(...r)}u(yi,"callOnce");d();p();m();var bi=u((e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{}),"keyBy");d();p();m();var Fu=new Set,wi=u((e,t,...r)=>{Fu.has(e)||(Fu.add(e),gi(t,...r))},"warnOnce");var vv=Z(Ru());si();var tn=Z(fu());d();p();m();var ce=class{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 ce?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let o=0,i=0;for(;o{let o=t.models.find(i=>i.name===n.model);if(!o)throw new Error(`Mapping without model ${n.model}`);return o.fields.some(i=>i.kind!=="object")}).map(n=>({model:n.model,plural:(0,$u.default)(Pn(n.model)),findUnique:n.findUnique||n.findSingle,findFirst:n.findFirst,findMany:n.findMany,create:n.createOne||n.createSingle||n.create,createMany:n.createMany,delete:n.deleteOne||n.deleteSingle||n.delete,update:n.updateOne||n.updateSingle||n.update,deleteMany:n.deleteMany,updateMany:n.updateMany,upsert:n.upsertOne||n.upsertSingle||n.upsert,aggregate:n.aggregate,groupBy:n.groupBy,findRaw:n.findRaw,aggregateRaw:n.aggregateRaw})),otherOperations:e.otherOperations}}u(Hm,"getMappings");function Lu(e){return ju(e)}u(Lu,"getPrismaClientDMMF");d();p();m();d();p();m();d();p();m();var Gr={findUniqueOrThrow:{wrappedAction:et.ModelAction.findUnique},findFirstOrThrow:{wrappedAction:et.ModelAction.findFirst}};function Bu(e){return Zn(e)?Gr[e].wrappedAction:e}u(Bu,"getDmmfActionName");function Zn(e){return Object.prototype.hasOwnProperty.call(Gr,e)}u(Zn,"isClientOnlyAction");var qu=Object.keys(et.ModelAction).concat(Object.keys(Gr));d();p();m();d();p();m();var zr="";function Uu(e){var t=e.split(` +`);return t.reduce(function(r,n){var o=Ym(n)||Xm(n)||rd(n)||sd(n)||od(n);return o&&r.push(o),r},[])}u(Uu,"parse");var Qm=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Km=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Ym(e){var t=Qm.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,o=Km.exec(t[2]);return n&&o!=null&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]),{file:r?null:t[2],methodName:t[1]||zr,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}u(Ym,"parseChrome");var Zm=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Xm(e){var t=Zm.exec(e);return t?{file:t[2],methodName:t[1]||zr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}u(Xm,"parseWinjs");var ed=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,td=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function rd(e){var t=ed.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=td.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||zr,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}u(rd,"parseGecko");var nd=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function od(e){var t=nd.exec(e);return t?{file:t[3],methodName:t[1]||zr,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}u(od,"parseJSC");var id=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function sd(e){var t=id.exec(e);return t?{file:t[2],methodName:t[1]||zr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}u(sd,"parseNode");var Xn=class{getLocation(){return null}};u(Xn,"DisabledCallSite");var eo=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=Uu(t).find(o=>o.file&&o.file!==""&&!o.file.includes("@prisma")&&!o.file.includes("getPrismaClient")&&!o.file.startsWith("internal/")&&!o.methodName.includes("new ")&&!o.methodName.includes("getCallSite")&&!o.methodName.includes("Proxy.")&&o.methodName.split(".").length<4);return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};u(eo,"EnabledCallSite");function rt(e){return e==="minimal"?new Xn:new eo}u(rt,"getCallSite");d();p();m();function xt(e){let t,r=u((n,o)=>{try{return t!=null?t:t=e(n,o)}catch(i){return Promise.reject(i)}},"_callback");return{then(n,o,i){return r(i,void 0).then(n,o,i)},catch(n,o){return r(o,void 0).catch(n,o)},finally(n,o){return r(o,void 0).finally(n,o)},requestTransaction(n,o){let i=r(n,o);return i.requestTransaction?i.requestTransaction(n,o):i},[Symbol.toStringTag]:"PrismaPromise"}}u(xt,"createPrismaPromise");d();p();m();d();p();m();d();p();m();var Vu={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ti(e){let t=ud(e);return Object.entries(t).reduce((n,[o,i])=>(Vu[o]!==void 0?n.select[o]={select:i}:n[o]=i,n),{select:{}})}u(Ti,"desugarUserArgs");function ud(e){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}u(ud,"desugarCountInUserArgs");function cd(e){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}u(cd,"createUnpacker");function Jr(e,t,r){let n=Ti(t!=null?t:{}),o=cd(t!=null?t:{});return r({action:"aggregate",unpacker:o})(n)}u(Jr,"aggregate");d();p();m();function Gu(e,t,r){let{select:n,...o}=t!=null?t:{};return typeof n=="object"?Jr(e,{...o,_count:n},i=>r({...i,action:"count",unpacker:s=>{var a;return(a=i.unpacker)==null?void 0:a.call(i,s)._count}})):Jr(e,{...o,_count:{_all:!0}},i=>r({...i,action:"count",unpacker:s=>{var a;return(a=i.unpacker)==null?void 0:a.call(i,s)._count._all}}))}u(Gu,"count");d();p();m();function ld(e){let t=Ti(e);if(Array.isArray(e.by))for(let r of e.by)typeof r=="string"&&(t.select[r]=!0);return t}u(ld,"desugarUserArgs");function fd(e){return t=>(typeof e._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}u(fd,"createUnpacker");function zu(e,t,r){let n=ld(t!=null?t:{}),o=fd(t!=null?t:{});return r({action:"groupBy",unpacker:o})(n)}u(zu,"groupBy");function Ju(e,t,r){if(t==="aggregate")return n=>Jr(e,n,r);if(t==="count")return n=>Gu(e,n,r);if(t==="groupBy")return n=>zu(e,n,r)}u(Ju,"applyAggregates");d();p();m();d();p();m();var D=Z(Ot());var Dt=Z(xn()),Ii=Z(Yn());d();p();m();var cr=Z(Ot()),Xu=Z(xn());d();p();m();si();d();p();m();d();p();m();d();p();m();var Et=Z(Ot());var pd=Et.default.rgb(246,145,95),md=Et.default.rgb(107,139,140),to=Et.default.cyan,Wu=Et.default.rgb(127,155,155),Hu=u(e=>e,"identity"),Qu={keyword:to,entity:to,value:Wu,punctuation:md,directive:to,function:to,variable:Wu,string:Et.default.greenBright,boolean:pd,number:Et.default.cyan,comment:Et.default.grey};var ro={},dd=0,U={manual:ro.Prism&&ro.Prism.manual,disableWorkerMessageHandler:ro.Prism&&ro.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof je){let t=e;return new je(t.type,U.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(U.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(X instanceof je)continue;if(_&&L!=t.length-1){A.lastIndex=H;var g=A.exec(e);if(!g)break;var f=g.index+(P?g[1].length:0),h=g.index+g[0].length,a=L,c=H;for(let j=t.length;a=c&&(++L,H=c);if(t[L]instanceof je)continue;l=a-L,X=e.slice(H,c),g.index-=H}else{A.lastIndex=0;var g=A.exec(X),l=1}if(!g){if(i)break;continue}P&&(I=g[1]?g[1].length:0);var f=g.index+I,g=g[0].slice(I),h=f+g.length,w=X.slice(0,f),b=X.slice(h);let z=[L,l];w&&(++L,H+=w.length,z.push(w));let V=new je(y,S?U.tokenize(g,S):g,R,g,_);if(z.push(V),b&&z.push(b),Array.prototype.splice.apply(t,z),l!=1&&U.matchGrammar(e,t,r,L,H,!0,y),i)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let o in n)t[o]=n[o];delete t.rest}return U.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=U.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=U.hooks.all[e];if(!(!r||!r.length))for(var n=0,o;o=r[n++];)o(t)}},Token:je};U.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:/[{}[\];(),.:]/};U.languages.javascript=U.languages.extend("clike",{"class-name":[U.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}/});U.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;U.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:U.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:U.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:U.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:U.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});U.languages.markup&&U.languages.markup.tag.addInlined("script","javascript");U.languages.js=U.languages.javascript;U.languages.typescript=U.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/});U.languages.ts=U.languages.typescript;function je(e,t,r,n,o){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!o}u(je,"Token");je.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return je.stringify(r,t)}).join(""):gd(e.type)(e.content)};function gd(e){return Qu[e]||Hu}u(gd,"getColorForSyntaxKind");function Ku(e){return hd(e,U.languages.javascript)}u(Ku,"highlightTS");function hd(e,t){return U.tokenize(e,t).map(n=>je.stringify(n)).join("")}u(hd,"highlight");d();p();m();var Yu=Z(di());function Zu(e){return(0,Yu.default)(e)}u(Zu,"dedent");var _e=class{static read(t){let r;try{r=Qn.readFileSync(t,"utf-8")}catch(n){return null}return _e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new _e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,o=[...this.lines];return o[n]=r(o[n]),new _e(this.firstLineNumber,o)}mapLines(t){return new _e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,o)=>o===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` +`);return new _e(t,Zu(n).split(` +`))}highlight(){let t=Ku(this.toString());return new _e(this.firstLineNumber,t.split(` +`))}toString(){return this.lines.join(` +`)}};u(_e,"SourceFileSlice");var yd={red:e=>cr.default.red(e),gray:e=>cr.default.gray(e),dim:e=>cr.default.dim(e),bold:e=>cr.default.bold(e),underline:e=>cr.default.underline(e),highlightSource:e=>e.highlight()},bd={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function wd({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:o},i){var f;let s={functionName:`prisma.${r}()`,message:t,isPanic:n!=null?n:!1,callArguments:o};if(!e||typeof window!="undefined"||v.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let c=Math.max(1,a.lineNumber-3),l=(f=_e.read(a.fileName))==null?void 0:f.slice(c,a.lineNumber);if(l){let g=l.lineAt(a.lineNumber),h=xd(g),w=vd(g);if(!w)return s;s.functionName=`${w.code})`,s.location=a,n||(l=l.mapLineAt(a.lineNumber,y=>y.slice(0,w.openingBraceIndex))),l=i.highlightSource(l);let b=String(l.lastLineNumber).length;if(s.contextLines=l.mapLines((y,T)=>i.gray(String(T).padStart(b))+" "+y).mapLines(y=>i.dim(y)).prependSymbolAt(a.lineNumber,i.bold(i.red("\u2192"))),o){let y=h+b+1;y+=2,s.callArguments=(0,Xu.default)(o,y).slice(y)}}return s}u(wd,"getTemplateParameters");function vd(e){let t=qu.join("|"),n=new RegExp(String.raw`\S+(${t})\(`).exec(e);return n?{code:n[0],openingBraceIndex:n.index+n[0].length}:null}u(vd,"findPrismaActionCall");function xd(e){let t=0;for(let r=0;rArray.isArray(e)?e:e.split("."),"keys"),Mi=u((e,t)=>oc(t).reduce((r,n)=>r&&r[n],e),"deepGet"),no=u((e,t,r)=>oc(t).reduceRight((n,o,i,s)=>Object.assign({},Mi(e,s.slice(0,i)),{[o]:n}),r),"deepSet");d();p();m();function ic(e,t){if(!e||typeof e!="object"||typeof e.hasOwnProperty!="function")return e;let r={};for(let n in e){let o=e[n];Object.hasOwnProperty.call(e,n)&&t(n,o)&&(r[n]=o)}return r}u(ic,"filterObject");d();p();m();function Td(e){return Array.prototype.concat.apply([],e)}u(Td,"flatten");function Pi(e,t,r){return Td(e.map(t,r))}u(Pi,"flatMap");d();p();m();var Md={"[object Date]":!0,"[object Uint8Array]":!0,"[object Decimal]":!0};function sc(e){return e?typeof e=="object"&&!Md[Object.prototype.toString.call(e)]:!1}u(sc,"isObject");d();p();m();function ac(e,t){let r={},n=Array.isArray(t)?t:[t];for(let o in e)Object.hasOwnProperty.call(e,o)&&!n.includes(o)&&(r[o]=e[o]);return r}u(ac,"omit");d();p();m();var Pe=Z(Ot()),_i=Z(Yn());d();p();m();var Pd=cc(),Sd=fc(),Od=pc().default,_d=u((e,t,r)=>{let n=[];return u(function o(i,s={},a="",c=[]){s.indent=s.indent||" ";let l;s.inlineCharacterLimit===void 0?l={newLine:` +`,newLineOrSpace:` +`,pad:a,indent:a+s.indent}:l={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};let f=u(g=>{if(s.inlineCharacterLimit===void 0)return g;let h=g.replace(new RegExp(l.newLine,"g"),"").replace(new RegExp(l.newLineOrSpace,"g")," ").replace(new RegExp(l.pad+"|"+l.indent,"g"),"");return h.length<=s.inlineCharacterLimit?h:g.replace(new RegExp(l.newLine+"|"+l.newLineOrSpace,"g"),` +`).replace(new RegExp(l.pad,"g"),a).replace(new RegExp(l.indent,"g"),a+s.indent)},"expandWhiteSpace");if(n.indexOf(i)!==-1)return'"[Circular]"';if(x.Buffer.isBuffer(i))return`Buffer(${x.Buffer.length})`;if(i==null||typeof i=="number"||typeof i=="boolean"||typeof i=="function"||typeof i=="symbol"||i instanceof Ae||Pd(i))return String(i);if(i instanceof Date)return`new Date('${i.toISOString()}')`;if(i instanceof Oe)return`prisma.${Pn(i.modelName)}.fields.${i.name}`;if(Array.isArray(i)){if(i.length===0)return"[]";n.push(i);let g="["+l.newLine+i.map((h,w)=>{let b=i.length-1===w?l.newLine:","+l.newLineOrSpace,y=o(h,s,a+s.indent,[...c,w]);return s.transformValue&&(y=s.transformValue(i,w,y)),l.indent+y+b}).join("")+l.pad+"]";return n.pop(),f(g)}if(Sd(i)){let g=Object.keys(i).concat(Od(i));if(s.filter&&(g=g.filter(w=>s.filter(i,w))),g.length===0)return"{}";n.push(i);let h="{"+l.newLine+g.map((w,b)=>{let y=g.length-1===b?l.newLine:","+l.newLineOrSpace,T=typeof w=="symbol",M=!T&&/^[a-z$_][a-z$_0-9]*$/i.test(w),A=T||M?w:o(w,s,void 0,[...c,w]),S=o(i[w],s,a+s.indent,[...c,w]);s.transformValue&&(S=s.transformValue(i,w,S));let P=l.indent+String(A)+": "+S+y;return s.transformLine&&(P=s.transformLine({obj:i,indent:l.indent,key:A,stringifiedValue:S,value:i[w],eol:y,originalLine:P,path:c.concat(A)})),P}).join("")+l.pad+"}";return n.pop(),f(h)}return i=String(i).replace(/[\r\n]/g,g=>g===` +`?"\\n":"\\r"),s.singleQuotes===!1?(i=i.replace(/"/g,'\\"'),`"${i}"`):(i=i.replace(/\\?'/g,"\\'"),`'${i}'`)},"stringifyObject")(e,t,r)},"stringifyObject"),Hr=_d;var Oi="@@__DIM_POINTER__@@";function oo({ast:e,keyPaths:t,valuePaths:r,missingItems:n}){let o=e;for(let{path:i,type:s}of n)o=no(o,i,s);return Hr(o,{indent:" ",transformLine:({indent:i,key:s,value:a,stringifiedValue:c,eol:l,path:f})=>{let g=f.join("."),h=t.includes(g),w=r.includes(g),b=n.find(T=>T.path===g),y=c;if(b){typeof a=="string"&&(y=y.slice(1,y.length-1));let T=b.isRequired?"":"?",M=b.isRequired?"+":"?",S=(b.isRequired?Pe.default.greenBright:Pe.default.green)(Id(s+T+": "+y+l,i,M));return b.isRequired||(S=Pe.default.dim(S)),S}else{let T=n.some(P=>g.startsWith(P.path)),M=s[s.length-2]==="?";M&&(s=s.slice(1,s.length-1)),M&&typeof a=="object"&&a!==null&&(y=y.split(` +`).map((P,_,I)=>_===I.length-1?P+Oi:P).join(` +`)),T&&typeof a=="string"&&(y=y.slice(1,y.length-1),M||(y=Pe.default.bold(y))),(typeof a!="object"||a===null)&&!w&&!T&&(y=Pe.default.dim(y));let A=h?Pe.default.redBright(s):s;y=w?Pe.default.redBright(y):y;let S=i+A+": "+y+(T?l:Pe.default.dim(l));if(h||w){let P=S.split(` +`),_=String(s).length,I=h?Pe.default.redBright("~".repeat(_)):" ".repeat(_),R=w?Cd(i,s,a,c):0,L=w&&mc(a),H=w?" "+Pe.default.redBright("~".repeat(R)):"";I&&I.length>0&&!L&&P.splice(1,0,i+I+H),I&&I.length>0&&L&&P.splice(P.length-1,0,i.slice(0,i.length-2)+H),S=P.join(` +`)}return S}}})}u(oo,"printJsonWithErrors");function Cd(e,t,r,n){return r===null?4:typeof r=="string"?r.length+2:mc(r)?Math.abs(Fd(`${t}: ${(0,_i.default)(n)}`)-e.length):String(r).length}u(Cd,"getValueLength");function mc(e){return typeof e=="object"&&e!==null&&!(e instanceof Ae)}u(mc,"isRenderedAsObject");function Fd(e){return e.split(` +`).reduce((t,r)=>r.length>t?r.length:t,0)}u(Fd,"getLongestLine");function Id(e,t,r){return e.split(` +`).map((n,o,i)=>o===0?r+t.slice(1)+n:o(0,_i.default)(n).includes(Oi)?Pe.default.dim(n.replace(Oi,"")):n.includes("?")?Pe.default.dim(n):n).join(` +`)}u(Id,"prefixLines");var Qr=2,io=class{constructor(t,r){this.type=t;this.children=r;this.printFieldError=u(({error:t},r,n)=>{if(t.type==="emptySelect"){let o=n?"":` Available options are listed in ${D.default.greenBright.dim("green")}.`;return`The ${D.default.redBright("`select`")} statement for type ${D.default.bold(_t(t.field.outputType.type))} must not be empty.${o}`}if(t.type==="emptyInclude"){if(r.length===0)return`${D.default.bold(_t(t.field.outputType.type))} does not have any relation and therefore can't have an ${D.default.redBright("`include`")} statement.`;let o=n?"":` Available options are listed in ${D.default.greenBright.dim("green")}.`;return`The ${D.default.redBright("`include`")} statement for type ${D.default.bold(_t(t.field.outputType.type))} must not be empty.${o}`}if(t.type==="noTrueSelect")return`The ${D.default.redBright("`select`")} statement for type ${D.default.bold(_t(t.field.outputType.type))} needs ${D.default.bold("at least one truthy value")}.`;if(t.type==="includeAndSelect")return`Please ${D.default.bold("either")} use ${D.default.greenBright("`include`")} or ${D.default.greenBright("`select`")}, but ${D.default.redBright("not both")} at the same time.`;if(t.type==="invalidFieldName"){let o=t.isInclude?"include":"select",i=t.isIncludeScalar?"Invalid scalar":"Unknown",s=n?"":t.isInclude&&r.length===0?` +This model has no relations, so you can't use ${D.default.redBright("include")} with it.`:` Available options are listed in ${D.default.greenBright.dim("green")}.`,a=`${i} field ${D.default.redBright(`\`${t.providedName}\``)} for ${D.default.bold(o)} statement on model ${D.default.bold.white(t.modelName)}.${s}`;return t.didYouMean&&(a+=` Did you mean ${D.default.greenBright(`\`${t.didYouMean}\``)}?`),t.isIncludeScalar&&(a+=` +Note, that ${D.default.bold("include")} statements only accept relation fields.`),a}if(t.type==="invalidFieldType")return`Invalid value ${D.default.redBright(`${Hr(t.providedValue)}`)} of type ${D.default.redBright(Qt(t.providedValue,void 0))} for field ${D.default.bold(`${t.fieldName}`)} on model ${D.default.bold.white(t.modelName)}. Expected either ${D.default.greenBright("true")} or ${D.default.greenBright("false")}.`},"printFieldError");this.printArgError=u(({error:t,path:r,id:n},o,i)=>{if(t.type==="invalidName"){let s=`Unknown arg ${D.default.redBright(`\`${t.providedName}\``)} in ${D.default.bold(r.join("."))} for type ${D.default.bold(t.outputType?t.outputType.name:xr(t.originalType))}.`;return t.didYouMeanField?s+=` +\u2192 Did you forget to wrap it with \`${D.default.greenBright("select")}\`? ${D.default.dim("e.g. "+D.default.greenBright(`{ select: { ${t.providedName}: ${t.providedValue} } }`))}`:t.didYouMeanArg?(s+=` Did you mean \`${D.default.greenBright(t.didYouMeanArg)}\`?`,!o&&!i&&(s+=` ${D.default.dim("Available args:")} +`+Kt(t.originalType,!0))):t.originalType.fields.length===0?s+=` The field ${D.default.bold(t.originalType.name)} has no arguments.`:!o&&!i&&(s+=` Available args: + +`+Kt(t.originalType,!0)),s}if(t.type==="invalidType"){let s=Hr(t.providedValue,{indent:" "}),a=s.split(` +`).length>1;if(a&&(s=` +${s} +`),t.requiredType.bestFittingType.location==="enumTypes")return`Argument ${D.default.bold(t.argName)}: Provided value ${D.default.redBright(s)}${a?"":" "}of type ${D.default.redBright(Qt(t.providedValue))} on ${D.default.bold(`prisma.${this.children[0].name}`)} is not a ${D.default.greenBright(Er(Ht(t.requiredType.bestFittingType.type),t.requiredType.bestFittingType.isList))}. +\u2192 Possible values: ${t.requiredType.bestFittingType.type.values.map(g=>D.default.greenBright(`${Ht(t.requiredType.bestFittingType.type)}.${g}`)).join(", ")}`;let c=".";fr(t.requiredType.bestFittingType.type)&&(c=`: +`+Kt(t.requiredType.bestFittingType.type));let l=`${t.requiredType.inputType.map(g=>D.default.greenBright(Er(Ht(g.type),t.requiredType.bestFittingType.isList))).join(" or ")}${c}`,f=t.requiredType.inputType.length===2&&t.requiredType.inputType.find(g=>fr(g.type))||null;return f&&(l+=` +`+Kt(f.type,!0)),`Argument ${D.default.bold(t.argName)}: Got invalid value ${D.default.redBright(s)}${a?"":" "}on ${D.default.bold(`prisma.${this.children[0].name}`)}. Provided ${D.default.redBright(Qt(t.providedValue))}, expected ${l}`}if(t.type==="invalidNullArg"){let s=r.length===1&&r[0]===t.name?"":` for ${D.default.bold(`${r.join(".")}`)}`,a=` Please use ${D.default.bold.greenBright("undefined")} instead.`;return`Argument ${D.default.greenBright(t.name)}${s} must not be ${D.default.bold("null")}.${a}`}if(t.type==="missingArg"){let s=r.length===1&&r[0]===t.missingName?"":` for ${D.default.bold(`${r.join(".")}`)}`;return`Argument ${D.default.greenBright(t.missingName)}${s} is missing.`}if(t.type==="atLeastOne"){let s=i?"":` Available args are listed in ${D.default.dim.green("green")}.`;return`Argument ${D.default.bold(r.join("."))} of type ${D.default.bold(t.inputType.name)} needs ${D.default.greenBright("at least one")} argument.${s}`}if(t.type==="atMostOne"){let s=i?"":` Please choose one. ${D.default.dim("Available args:")} +${Kt(t.inputType,!0)}`;return`Argument ${D.default.bold(r.join("."))} of type ${D.default.bold(t.inputType.name)} needs ${D.default.greenBright("exactly one")} argument, but you provided ${t.providedKeys.map(a=>D.default.redBright(a)).join(" and ")}.${s}`}},"printArgError");this.type=t,this.children=r}get[Symbol.toStringTag](){return"Document"}toString(){return`${this.type} { +${(0,Dt.default)(this.children.map(String).join(` +`),Qr)} +}`}validate(t,r=!1,n,o,i){var M;t||(t={});let s=this.children.filter(A=>A.hasInvalidChild||A.hasInvalidArg);if(s.length===0)return;let a=[],c=[],l=t&&t.select?"select":t.include?"include":void 0;for(let A of s){let S=A.collectErrors(l);a.push(...S.fieldErrors.map(P=>({...P,path:r?P.path:P.path.slice(1)}))),c.push(...S.argErrors.map(P=>({...P,path:r?P.path:P.path.slice(1)})))}let f=this.children[0].name,g=r?this.type:f,h=[],w=[],b=[];for(let A of a){let S=this.normalizePath(A.path,t).join(".");if(A.error.type==="invalidFieldName"){h.push(S);let P=A.error.outputType,{isInclude:_}=A.error;P.fields.filter(I=>_?I.outputType.location==="outputObjectTypes":!0).forEach(I=>{let R=S.split(".");b.push({path:`${R.slice(0,R.length-1).join(".")}.${I.name}`,type:"true",isRequired:!1})})}else A.error.type==="includeAndSelect"?(h.push("select"),h.push("include")):w.push(S);if(A.error.type==="emptySelect"||A.error.type==="noTrueSelect"||A.error.type==="emptyInclude"){let P=this.normalizePath(A.path,t),_=P.slice(0,P.length-1).join(".");(M=A.error.field.outputType.type.fields)==null||M.filter(R=>A.error.type==="emptyInclude"?R.outputType.location==="outputObjectTypes":!0).forEach(R=>{b.push({path:`${_}.${R.name}`,type:"true",isRequired:!1})})}}for(let A of c){let S=this.normalizePath(A.path,t).join(".");if(A.error.type==="invalidName")h.push(S);else if(A.error.type!=="missingArg"&&A.error.type!=="atLeastOne")w.push(S);else if(A.error.type==="missingArg"){let P=A.error.missingArg.inputTypes.length===1?A.error.missingArg.inputTypes[0].type:A.error.missingArg.inputTypes.map(_=>{let I=xr(_.type);return I==="Null"?"null":_.isList?I+"[]":I}).join(" | ");b.push({path:S,type:$o(P,!0,S.split("where.").length===2),isRequired:A.error.missingArg.isRequired})}}let y=u(A=>{let S=c.some(z=>z.error.type==="missingArg"&&z.error.missingArg.isRequired),P=Boolean(c.find(z=>z.error.type==="missingArg"&&!z.error.missingArg.isRequired)),_=P||S,I="";S&&(I+=` +${D.default.dim("Note: Lines with ")}${D.default.reset.greenBright("+")} ${D.default.dim("are required")}`),P&&(I.length===0&&(I=` +`),S?I+=D.default.dim(`, lines with ${D.default.green("?")} are optional`):I+=D.default.dim(`Note: Lines with ${D.default.green("?")} are optional`),I+=D.default.dim("."));let L=c.filter(z=>z.error.type!=="missingArg"||z.error.missingArg.isRequired).map(z=>this.printArgError(z,_,o==="minimal")).join(` +`);if(L+=` +${a.map(z=>this.printFieldError(z,b,o==="minimal")).join(` +`)}`,o==="minimal")return(0,Ii.default)(L);let H={ast:r?{[f]:t}:t,keyPaths:h,valuePaths:w,missingItems:b};n!=null&&n.endsWith("aggregate")&&(H=Ud(H));let X=lr({callsite:A,originalMethod:n||g,showColors:o&&o==="pretty",callArguments:oo(H),message:`${L}${I} +`});return v.env.NO_COLOR||o==="colorless"?(0,Ii.default)(X):X},"renderErrorStr"),T=new Ee(y(i));throw v.env.NODE_ENV!=="production"&&Object.defineProperty(T,"render",{get:()=>y,enumerable:!1}),T}normalizePath(t,r){let n=t.slice(),o=[],i,s=r;for(;(i=n.shift())!==void 0;)!Array.isArray(s)&&i===0||(i==="select"?s[i]?s=s[i]:s=s.include:s&&s[i]&&(s=s[i]),o.push(i));return o}};u(io,"Document");var Ee=class extends Error{get[Symbol.toStringTag](){return"PrismaClientValidationError"}};u(Ee,"PrismaClientValidationError");var ne=class extends Error{constructor(t){super(t+` +Read more at https://pris.ly/d/client-constructor`)}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};u(ne,"PrismaClientConstructorValidationError");var me=class{constructor({name:t,args:r,children:n,error:o,schemaField:i}){this.name=t,this.args=r,this.children=n,this.error=o,this.schemaField=i,this.hasInvalidChild=n?n.some(s=>Boolean(s.error||s.hasInvalidArg||s.hasInvalidChild)):!1,this.hasInvalidArg=r?r.hasInvalidArg:!1}get[Symbol.toStringTag](){return"Field"}toString(){let t=this.name;return this.error?t+" # INVALID_FIELD":(this.args&&this.args.args&&this.args.args.length>0&&(this.args.args.length===1?t+=`(${this.args.toString()})`:t+=`( +${(0,Dt.default)(this.args.toString(),Qr)} +)`),this.children&&(t+=` { +${(0,Dt.default)(this.children.map(String).join(` +`),Qr)} +}`),t)}collectErrors(t="select"){let r=[],n=[];if(this.error&&r.push({path:[this.name],error:this.error}),this.children)for(let o of this.children){let i=o.collectErrors(t);r.push(...i.fieldErrors.map(s=>({...s,path:[this.name,t,...s.path]}))),n.push(...i.argErrors.map(s=>({...s,path:[this.name,t,...s.path]})))}return this.args&&n.push(...this.args.collectErrors().map(o=>({...o,path:[this.name,...o.path]}))),{fieldErrors:r,argErrors:n}}};u(me,"Field");var de=class{constructor(t=[]){this.args=t,this.hasInvalidArg=t?t.some(r=>Boolean(r.hasError)):!1}get[Symbol.toStringTag](){return"Args"}toString(){return this.args.length===0?"":`${this.args.map(t=>t.toString()).filter(t=>t).join(` +`)}`}collectErrors(){return this.hasInvalidArg?Pi(this.args,t=>t.collectErrors()):[]}};u(de,"Args");function Ci(e,t){return x.Buffer.isBuffer(e)?JSON.stringify(e.toString("base64")):e instanceof Oe?`{ _ref: ${JSON.stringify(e.name)}}`:Object.prototype.toString.call(e)==="[object BigInt]"?e.toString():typeof(t==null?void 0:t.type)=="string"&&t.type==="Json"?e===null?"null":e&&e.values&&e.__prismaRawParamaters__?JSON.stringify(e.values):(t==null?void 0:t.isList)&&Array.isArray(e)?JSON.stringify(e.map(r=>JSON.stringify(r))):JSON.stringify(JSON.stringify(e)):e===void 0?null:e===null?"null":De.isDecimal(e)||(t==null?void 0:t.type)==="Decimal"&&Tn(e)?ia(e):(t==null?void 0:t.location)==="enumTypes"&&typeof e=="string"?Array.isArray(e)?`[${e.join(", ")}]`:e:JSON.stringify(e,null,2)}u(Ci,"stringify");var Ce=class{constructor({key:t,value:r,isEnum:n=!1,error:o,schemaArg:i,inputType:s}){this.inputType=s,this.key=t,this.value=r instanceof Ae?r._getName():r,this.isEnum=n,this.error=o,this.schemaArg=i,this.isNullable=(i==null?void 0:i.inputTypes.reduce(a=>a&&i.isNullable,!0))||!1,this.hasError=Boolean(o)||(r instanceof de?r.hasInvalidArg:!1)||Array.isArray(r)&&r.some(a=>a instanceof de?a.hasInvalidArg:!1)}get[Symbol.toStringTag](){return"Arg"}_toString(t,r){var n;if(typeof t!="undefined"){if(t instanceof de)return`${r}: { +${(0,Dt.default)(t.toString(),2)} +}`;if(Array.isArray(t)){if(((n=this.inputType)==null?void 0:n.type)==="Json")return`${r}: ${Ci(t,this.inputType)}`;let o=!t.some(i=>typeof i=="object");return`${r}: [${o?"":` +`}${(0,Dt.default)(t.map(i=>i instanceof de?`{ +${(0,Dt.default)(i.toString(),Qr)} +}`:Ci(i,this.inputType)).join(`,${o?" ":` +`}`),o?0:Qr)}${o?"":` +`}]`}return`${r}: ${Ci(t,this.inputType)}`}}toString(){return this._toString(this.value,this.key)}collectErrors(){var r;if(!this.hasError)return[];let t=[];if(this.error){let n=typeof((r=this.inputType)==null?void 0:r.type)=="object"?`${this.inputType.type.name}${this.inputType.isList?"[]":""}`:void 0;t.push({error:this.error,path:[this.key],id:n})}return Array.isArray(this.value)&&t.push(...Pi(this.value,(n,o)=>n!=null&&n.collectErrors?n.collectErrors().map(i=>({...i,path:[this.key,o,...i.path]})):[])),this.value instanceof de&&t.push(...this.value.collectErrors().map(n=>({...n,path:[this.key,...n.path]}))),t}};u(Ce,"Arg");function uo({dmmf:e,rootTypeName:t,rootField:r,select:n,modelName:o}){n||(n={});let i=t==="query"?e.queryType:e.mutationType,s={args:[],outputType:{isList:!1,type:i,location:"outputObjectTypes"},name:t},a={modelName:o},c=gc(e,{[r]:n},s,[t],a);return new io(t,c)}u(uo,"makeDocument");function ki(e){return e}u(ki,"transformDocument");function gc(e,t,r,n,o){let i=r.outputType.type;return Object.entries(t).reduce((s,[a,c])=>{let l=i.fieldMap?i.fieldMap[a]:i.fields.find(M=>M.name===a);if(!l)return s.push(new me({name:a,children:[],error:{type:"invalidFieldName",modelName:i.name,providedName:a,didYouMean:Mn(a,i.fields.map(M=>M.name)),outputType:i}})),s;if(l.outputType.location==="scalar"&&l.args.length===0&&typeof c!="boolean")return s.push(new me({name:a,children:[],error:{type:"invalidFieldType",modelName:i.name,fieldName:a,providedValue:c}})),s;if(c===!1)return s;let f={name:l.name,fields:l.args,constraints:{minNumFields:null,maxNumFields:null}},g=typeof c=="object"?ac(c,["include","select"]):void 0,h=g?ao(g,f,o,[],typeof l=="string"?void 0:l.outputType.type):void 0,w=l.outputType.location==="outputObjectTypes";if(c){if(c.select&&c.include)s.push(new me({name:a,children:[new me({name:"include",args:new de,error:{type:"includeAndSelect",field:l}})]}));else if(c.include){let M=Object.keys(c.include);if(M.length===0)return s.push(new me({name:a,children:[new me({name:"include",args:new de,error:{type:"emptyInclude",field:l}})]})),s;if(l.outputType.location==="outputObjectTypes"){let A=l.outputType.type,S=A.fields.filter(_=>_.outputType.location==="outputObjectTypes").map(_=>_.name),P=M.filter(_=>!S.includes(_));if(P.length>0)return s.push(...P.map(_=>new me({name:_,children:[new me({name:_,args:new de,error:{type:"invalidFieldName",modelName:A.name,outputType:A,providedName:_,didYouMean:Mn(_,S)||void 0,isInclude:!0,isIncludeScalar:A.fields.some(I=>I.name===_)}})]}))),s}}else if(c.select){let M=Object.values(c.select);if(M.length===0)return s.push(new me({name:a,children:[new me({name:"select",args:new de,error:{type:"emptySelect",field:l}})]})),s;if(M.filter(S=>S).length===0)return s.push(new me({name:a,children:[new me({name:"select",args:new de,error:{type:"noTrueSelect",field:l}})]})),s}}let b=w?Dd(e,l.outputType.type):null,y=b;c&&(c.select?y=c.select:c.include?y=Wr(b,c.include):c.by&&Array.isArray(c.by)&&l.outputType.namespace==="prisma"&&l.outputType.location==="outputObjectTypes"&&ua(l.outputType.type.name)&&(y=Rd(c.by)));let T=y!==!1&&w?gc(e,y,l,[...n,a],o):void 0;return s.push(new me({name:a,args:h,children:T,schemaField:l})),s},[])}u(gc,"selectionToFields");function Rd(e){let t=Object.create(null);for(let r of e)t[r]=!0;return t}u(Rd,"byToSelect");function Dd(e,t){let r=Object.create(null);for(let n of t.fields)e.typeMap[n.outputType.type.name]!==void 0&&(r[n.name]=!0),(n.outputType.location==="scalar"||n.outputType.location==="enumTypes")&&(r[n.name]=!0);return r}u(Dd,"getDefaultSelection");function Ri(e,t,r,n){return new Ce({key:e,value:t,isEnum:n.location==="enumTypes",inputType:n,error:{type:"invalidType",providedValue:t,argName:e,requiredType:{inputType:r.inputTypes,bestFittingType:n}}})}u(Ri,"getInvalidTypeArg");function Nd(e,t,r){let{isList:n}=t,o=kd(t,r),i=Qt(e,t);return!!(i===o||n&&i==="List<>"||o==="Json"&&i!=="Symbol"&&!(e instanceof Ae)&&!(e instanceof Oe)||i==="Int"&&o==="BigInt"||i==="List"&&o==="List"||i==="List"&&o==="List"||i==="List"&&o==="List"||(i==="Int"||i==="Float")&&o==="Decimal"||$d(i,e)&&o==="List"||i==="DateTime"&&o==="String"||i==="List"&&o==="List"||i==="UUID"&&o==="String"||i==="List"&&o==="List"||i==="String"&&o==="ID"||i==="List"&&o==="List"||i==="List"&&o==="List"||o==="List"&&(i==="List"||i==="List")||i==="Int"&&o==="Float"||i==="List"&&o==="List"||i==="Int"&&o==="Long"||i==="List"&&o==="List"||i==="String"&&o==="Decimal"&&hc(e)||e===null)}u(Nd,"hasCorrectScalarType");function kd(e,t,r=e.isList){let n=Ht(e.type);return e.location==="fieldRefTypes"&&t.modelName&&(n+=`<${t.modelName}>`),Er(n,r)}u(kd,"getExpectedType");var so=u(e=>ic(e,(t,r)=>r!==void 0),"cleanObject");function $d(e,t){return e==="List"||e==="List"||e==="List"&&t.every(hc)}u($d,"isValidDecimalListInput");function hc(e){return/^\-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i.test(e)}u(hc,"isDecimalString");function jd(e,t,r,n){let o=null,i=[];for(let s of r.inputTypes){if(o=Bd(e,t,r,s,n),(o==null?void 0:o.collectErrors().length)===0)return o;if(o&&(o==null?void 0:o.collectErrors())){let a=o==null?void 0:o.collectErrors();a&&a.length>0&&i.push({arg:o,errors:a})}}if((o==null?void 0:o.hasError)&&i.length>0){let s=i.map(({arg:a,errors:c})=>{let l=c.map(f=>{let g=1;return f.error.type==="invalidType"&&(g=2*Math.exp(yc(f.error.providedValue))+1),g+=Math.log(f.path.length),f.error.type==="missingArg"&&a.inputType&&fr(a.inputType.type)&&a.inputType.type.name.includes("Unchecked")&&(g*=2),f.error.type==="invalidName"&&fr(f.error.originalType)&&f.error.originalType.name.includes("Unchecked")&&(g*=2),g});return{score:c.length+Ld(l),arg:a,errors:c}});return s.sort((a,c)=>a.scoret+r,0)}u(Ld,"sum");function Bd(e,t,r,n,o){var f,g,h,w;if(typeof t=="undefined")return r.isRequired?new Ce({key:e,value:t,isEnum:n.location==="enumTypes",inputType:n,error:{type:"missingArg",missingName:e,missingArg:r,atLeastOne:!1,atMostOne:!1}}):null;let{isNullable:i,isRequired:s}=r;if(t===null&&!i&&!s&&!(fr(n.type)?n.type.constraints.minNumFields!==null&&n.type.constraints.minNumFields>0:!1))return new Ce({key:e,value:t,isEnum:n.location==="enumTypes",inputType:n,error:{type:"invalidNullArg",name:e,invalidType:r.inputTypes,atLeastOne:!1,atMostOne:!1}});if(!n.isList)if(fr(n.type)){if(typeof t!="object"||Array.isArray(t)||n.location==="inputObjectTypes"&&!sc(t))return Ri(e,t,r,n);{let b=so(t),y,T=Object.keys(b||{}),M=T.length;return M===0&&typeof n.type.constraints.minNumFields=="number"&&n.type.constraints.minNumFields>0?y={type:"atLeastOne",key:e,inputType:n.type}:M>1&&typeof n.type.constraints.maxNumFields=="number"&&n.type.constraints.maxNumFields<2&&(y={type:"atMostOne",key:e,inputType:n.type,providedKeys:T}),new Ce({key:e,value:b===null?null:ao(b,n.type,o,r.inputTypes),isEnum:n.location==="enumTypes",error:y,inputType:n,schemaArg:r})}}else return dc(e,t,r,n,o);if(!Array.isArray(t)&&n.isList&&e!=="updateMany"&&(t=[t]),n.location==="enumTypes"||n.location==="scalar")return dc(e,t,r,n,o);let a=n.type,l=(typeof((f=a.constraints)==null?void 0:f.minNumFields)=="number"&&((g=a.constraints)==null?void 0:g.minNumFields)>0?Array.isArray(t)&&t.some(b=>!b||Object.keys(so(b)).length===0):!1)?{inputType:a,key:e,type:"atLeastOne"}:void 0;if(!l){let b=typeof((h=a.constraints)==null?void 0:h.maxNumFields)=="number"&&((w=a.constraints)==null?void 0:w.maxNumFields)<2?Array.isArray(t)&&t.find(y=>!y||Object.keys(so(y)).length!==1):!1;b&&(l={inputType:a,key:e,type:"atMostOne",providedKeys:Object.keys(b)})}if(!Array.isArray(t))for(let b of r.inputTypes){let y=ao(t,b.type,o);if(y.collectErrors().length===0)return new Ce({key:e,value:y,isEnum:!1,schemaArg:r,inputType:b})}return new Ce({key:e,value:t.map(b=>n.isList&&typeof b!="object"?b:typeof b!="object"||!t?Ri(e,b,r,n):ao(b,a,o)),isEnum:!1,inputType:n,schemaArg:r,error:l})}u(Bd,"tryInferArgs");function fr(e){return!(typeof e=="string"||Object.hasOwnProperty.call(e,"values"))}u(fr,"isInputArgType");function dc(e,t,r,n,o){return Nd(t,n,o)?new Ce({key:e,value:t,isEnum:n.location==="enumTypes",schemaArg:r,inputType:n}):Ri(e,t,r,n)}u(dc,"scalarToArg");function ao(e,t,r,n,o){var h;(h=t.meta)!=null&&h.source&&(r={modelName:t.meta.source});let i=so(e),{fields:s,fieldMap:a}=t,c=s.map(w=>[w.name,void 0]),l=Object.entries(i||{}),g=aa(l,c,w=>w[0]).reduce((w,[b,y])=>{let T=a?a[b]:s.find(A=>A.name===b);if(!T){let A=typeof y=="boolean"&&o&&o.fields.some(S=>S.name===b)?b:null;return w.push(new Ce({key:b,value:y,error:{type:"invalidName",providedName:b,providedValue:y,didYouMeanField:A,didYouMeanArg:!A&&Mn(b,[...s.map(S=>S.name),"select"])||void 0,originalType:t,possibilities:n,outputType:o}})),w}let M=jd(b,y,T,r);return M&&w.push(M),w},[]);if(typeof t.constraints.minNumFields=="number"&&l.length{var b,y;return((b=w.error)==null?void 0:b.type)==="missingArg"||((y=w.error)==null?void 0:y.type)==="atLeastOne"})){let w=t.fields.filter(b=>!b.isRequired&&i&&(typeof i[b.name]=="undefined"||i[b.name]===null));g.push(...w.map(b=>{let y=b.inputTypes[0];return new Ce({key:b.name,value:void 0,isEnum:y.location==="enumTypes",error:{type:"missingArg",missingName:b.name,missingArg:b,atLeastOne:Boolean(t.constraints.minNumFields)||!1,atMostOne:t.constraints.maxNumFields===1||!1},inputType:y})}))}return new de(g)}u(ao,"objectToArgs");function co({document:e,path:t,data:r}){let n=Mi(r,t);if(n==="undefined")return null;if(typeof n!="object")return n;let o=qd(e,t);return Di({field:o,data:n})}u(co,"unpack");function Di({field:e,data:t}){var n;if(!t||typeof t!="object"||!e.children||!e.schemaField)return t;let r={DateTime:o=>new Date(o),Json:o=>JSON.parse(o),Bytes:o=>x.Buffer.from(o,"base64"),Decimal:o=>new De(o),BigInt:o=>BigInt(o)};for(let o of e.children){let i=(n=o.schemaField)==null?void 0:n.outputType.type;if(i&&typeof i=="string"){let s=r[i];if(s)if(Array.isArray(t))for(let a of t)typeof a[o.name]!="undefined"&&a[o.name]!==null&&(Array.isArray(a[o.name])?a[o.name]=a[o.name].map(s):a[o.name]=s(a[o.name]));else typeof t[o.name]!="undefined"&&t[o.name]!==null&&(Array.isArray(t[o.name])?t[o.name]=t[o.name].map(s):t[o.name]=s(t[o.name]))}if(o.schemaField&&o.schemaField.outputType.location==="outputObjectTypes")if(Array.isArray(t))for(let s of t)Di({field:o,data:s[o.name]});else Di({field:o,data:t[o.name]})}return t}u(Di,"mapScalars");function qd(e,t){let r=t.slice(),n=r.shift(),o=e.children.find(i=>i.name===n);if(!o)throw new Error(`Could not find field ${n} in document ${e}`);for(;r.length>0;){let i=r.shift();if(!o.children)throw new Error(`Can't get children for field ${o} with child ${i}`);let s=o.children.find(a=>a.name===i);if(!s)throw new Error(`Can't find child ${i} of field ${o}`);o=s}return o}u(qd,"getField");function Fi(e){return e.split(".").filter(t=>t!=="select").join(".")}u(Fi,"removeSelectFromPath");function Ni(e){if(Object.prototype.toString.call(e)==="[object Object]"){let r={};for(let n in e)if(n==="select")for(let o in e.select)r[o]=Ni(e.select[o]);else r[n]=Ni(e[n]);return r}return e}u(Ni,"removeSelectFromObject");function Ud({ast:e,keyPaths:t,missingItems:r,valuePaths:n}){let o=t.map(Fi),i=n.map(Fi),s=r.map(c=>({path:Fi(c.path),isRequired:c.isRequired,type:c.type}));return{ast:Ni(e),keyPaths:o,missingItems:s,valuePaths:i}}u(Ud,"transformAggregatePrintJsonArgs");d();p();m();var Qe=class extends Error{constructor(t){super(t),this.name="NotFoundError"}};u(Qe,"NotFoundError");function $i(e,t,r,n){let o;if(r&&typeof r=="object"&&"rejectOnNotFound"in r&&r.rejectOnNotFound!==void 0)o=r.rejectOnNotFound,delete r.rejectOnNotFound;else if(typeof n=="boolean")o=n;else if(n&&typeof n=="object"&&e in n){let i=n[e];if(i&&typeof i=="object")return t in i?i[t]:void 0;o=$i(e,t,r,i)}else typeof n=="function"?o=n:o=!1;return o}u($i,"getRejectOnNotFound");var Vd=/(findUnique|findFirst)/;function bc(e,t,r,n){if(n&&!e&&Vd.exec(t))throw typeof n=="boolean"&&n?new Qe(`No ${r} found`):typeof n=="function"?n(new Qe(`No ${r} found`)):qr(n)?n:new Qe(`No ${r} found`)}u(bc,"throwIfNotFound");function wc(e,t,r){if(e==="findFirstOrThrow"||e==="findUniqueOrThrow")return Gd(t,r);hi(e,"Unknown wrapper name")}u(wc,"wrapRequest");function Gd(e,t){return async r=>{if("rejectOnNotFound"in r.args){let o=lr({originalMethod:r.clientMethod,callsite:r.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Ee(o)}let n=await t(r);if(n==null)throw new Qe(`No ${e} found`);return n}}u(Gd,"applyOrThrowWrapper");d();p();m();d();p();m();var zd={enumerable:!0,configurable:!0,writable:!0};function At(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>zd,has:(r,n)=>t.has(n),set:(r,n,o)=>t.add(n)&&Reflect.set(r,n,o),ownKeys:()=>[...t]}}u(At,"defaultProxyHandlers");function vc(e){let t=e.fields.filter(n=>!n.relationName),r=bi(t,n=>n.name);return new Proxy({},{get(n,o){if(o in n||typeof o=="symbol")return n[o];let i=r[o];if(i)return new Oe(e.name,o,i.type,i.isList)},...At(Object.keys(r))})}u(vc,"applyFieldsProxy");d();p();m();function Jd(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}u(Jd,"getNextDataPath");function Wd(e,t,r){return t===void 0?e!=null?e:{}:no(t,r,e||!0)}u(Wd,"getNextUserArgs");function ji(e,t,r,n,o,i){let a=e._baseDmmf.modelMap[t].fields.reduce((c,l)=>({...c,[l.name]:l}),{});return c=>{let l=rt(e._errorFormat),f=Jd(n,o),g=Wd(c,i,f),h=r({dataPath:f,callsite:l})(g),w=Hd(e,t);return new Proxy(h,{get(b,y){if(!w.includes(y))return b[y];let M=[a[y].type,r,y],A=[f,g];return ji(e,...M,...A)},...At([...w,...Object.getOwnPropertyNames(h)])})}}u(ji,"applyFluent");function Hd(e,t){return e._baseDmmf.modelMap[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}u(Hd,"getOwnKeys");d();p();m();function lo(e){return e.replace(/^./,t=>t.toLowerCase())}u(lo,"dmmfToJSModelName");var Qd=["findUnique","findFirst","create","update","upsert","delete"],Kd=["aggregate","count","groupBy"];function Li(e,t){var c;let r=lo(t),n=e._baseDmmf.modelMap[t],o=(c=e._engineConfig.previewFeatures)==null?void 0:c.includes("fieldReference"),i=xc(e,t),s={},a;return new Proxy(s,{get(l,f){if(f in l||typeof f=="symbol")return l[f];if(f==="fields"&&o)return a!=null?a:a=vc(n);if(!Ec(e,t,f))return;let g=Bu(f),h=u(b=>e._request(b),"requestFn");Zn(f)&&(h=wc(f,t,h));let w=u(b=>y=>{let T=rt(e._errorFormat);return xt((M,A)=>{let S={args:y,dataPath:[]},P={action:g,model:t},_={clientMethod:`${r}.${f}`,jsModelName:r},L={...S,...P,..._,...{runInTransaction:!!M,transactionId:M,lock:A},...{callsite:T}};return h({...L,...b})})},"action");return Qd.includes(g)?ji(e,t,w):Yd(f)?Ju(e,f,w):w({})},...At(i)})}u(Li,"applyModel");function xc(e,t){return[...Object.keys(e._baseDmmf.mappingsMap[t]),"count"].filter(r=>!["model","plural"].includes(r))}u(xc,"getOwnKeys");function Ec(e,t,r){return Zn(r)?Ec(e,t,Gr[r].wrappedAction):xc(e,t).includes(r)}u(Ec,"isValidActionName");function Yd(e){return Kd.includes(e)}u(Yd,"isValidAggregateName");d();p();m();function Ac(e){return e.replace(/^./,t=>t.toUpperCase())}u(Ac,"jsToDMMFModelName");function Tc(e){let t={},r=Zd(e);return new Proxy(e,{get(n,o){if(o in n||typeof o=="symbol")return n[o];let i=Ac(o);if(t[i]!==void 0)return t[i];if(e._baseDmmf.modelMap[i]!==void 0)return t[i]=Li(e,i);if(e._baseDmmf.modelMap[o]!==void 0)return t[i]=Li(e,o)},...At(r)})}u(Tc,"applyModels");function Zd(e){return[...Object.keys(e._baseDmmf.modelMap).map(lo),...Object.keys(e)]}u(Zd,"getOwnKeys");d();p();m();function Mc(e,t=()=>{}){let r,n=new Promise(o=>r=o);return{then(o){return--e===0&&r(t()),o==null?void 0:o(n)}}}u(Mc,"getLockCountPromise");d();p();m();function Pc(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)}u(Pc,"getLogLevel");d();p();m();function Oc(e,t,r){let n=Sc(e,r),o=Sc(t,r),i=Object.values(o).map(a=>a[a.length-1]),s=Object.keys(o);return Object.entries(n).forEach(([a,c])=>{s.includes(a)||i.push(c[c.length-1])}),i}u(Oc,"mergeBy");var Sc=u((e,t)=>e.reduce((r,n)=>{let o=t(n);return r[o]||(r[o]=[]),r[o].push(n),r},{}),"groupBy");d();p();m();var Kr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};u(Kr,"MiddlewareHandler");var Yr=class{constructor(){this.query=new Kr;this.engine=new Kr}};u(Yr,"Middlewares");d();p();m();var Cc=Z(Yn());d();p();m();var Zr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,v.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,o)=>{this.batches[r].push({request:t,resolve:n,reject:o})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let o=0;o{for(let o=0;o{let o=_c(n[0]),i=n.map(a=>String(a.document)),s=rr({context:n[0].otelParentCtx,tracingConfig:t._tracingConfig});return s&&(o.headers.traceparent=s),this.client._engine.requestBatch(i,o.headers,o.inTx)},singleLoader:n=>{let o=_c(n),i=String(n.document);return this.client._engine.request(i,o.headers)},batchBy:n=>n.transactionId?`transaction-${n.transactionId}`:eg(n)})}async request({document:t,dataPath:r=[],rootField:n,typeName:o,isList:i,callsite:s,rejectOnNotFound:a,clientMethod:c,runInTransaction:l,engineHook:f,args:g,headers:h,transactionId:w,unpacker:b,otelParentCtx:y,otelChildCtx:T}){if(this.hooks&&this.hooks.beforeRequest){let M=String(t);this.hooks.beforeRequest({query:M,path:r,rootField:n,typeName:o,document:t,isList:i,clientMethod:c,args:g})}try{let M,A;if(f){let P=await f({document:t,runInTransaction:l},_=>this.dataloader.request({..._,tracingConfig:this.client._tracingConfig}));M=P.data,A=P.elapsed}else{let P=await this.dataloader.request({document:t,runInTransaction:l,headers:h,transactionId:w,otelParentCtx:y,otelChildCtx:T,tracingConfig:this.client._tracingConfig});M=P==null?void 0:P.data,A=P==null?void 0:P.elapsed}let S=this.unpack(t,M,r,n,b);return bc(S,c,o,a),v.env.PRISMA_CLIENT_GET_TIME?{data:S,elapsed:A}:S}catch(M){this.handleRequestError({error:M,clientMethod:c,callsite:s})}}handleRequestError({error:t,clientMethod:r,callsite:n}){Xd(t);let o=t.message;throw n&&(o=lr({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:o})),o=this.sanitizeMessage(o),t.code?new Je(o,t.code,this.client._clientVersion,t.meta):t.isPanic?new We(o,this.client._clientVersion):t instanceof $e?new $e(o,this.client._clientVersion):t instanceof ke?new ke(o,this.client._clientVersion):t instanceof We?new We(o,this.client._clientVersion):(t.clientVersion=this.client._clientVersion,t)}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Cc.default)(t):t}unpack(t,r,n,o,i){r!=null&&r.data&&(r=r.data),i&&(r[o]=i(r[o]));let s=[];return o&&s.push(o),s.push(...n.filter(a=>a!=="select"&&a!=="include")),co({document:t,data:r,path:s})}get[Symbol.toStringTag](){return"RequestHandler"}};u(Xr,"RequestHandler");function eg(e){var n;if(!e.document.children[0].name.startsWith("findUnique"))return;let t=(n=e.document.children[0].args)==null?void 0:n.args.map(o=>o.value instanceof de?`${o.key}-${o.value.args.map(i=>i.key).join(",")}`:o.key).join(","),r=e.document.children[0].children.join(",");return`${e.document.children[0].name}|${t}|${r}`}u(eg,"batchFindUniqueBy");d();p();m();var Ic=Fc().version;d();p();m();function Rc(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Dc(t[n]);return r})}u(Rc,"deserializeRawResults");function Dc({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return x.Buffer.from(t,"base64");case"decimal":return new De(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Dc);default:return t}}u(Dc,"deserializeValue");d();p();m();var en=u(e=>e.reduce((t,r,n)=>`${t}@P${n}${r}`),"mssqlPreparedStatement");d();p();m();function Le(e){try{return Nc(e,"fast")}catch(t){return Nc(e,"slow")}}u(Le,"serializeRawParameters");function Nc(e,t){return JSON.stringify(e.map(r=>rg(r,t)))}u(Nc,"serializeRawParametersInternal");function rg(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:ng(e)?{prisma__type:"date",prisma__value:e.toJSON()}:De.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:x.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:og(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:x.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?$c(e):e}u(rg,"encodeParameter");function ng(e){return e instanceof Date?!0:Object.prototype.toString.call(e)==="[object Date]"&&typeof e.toJSON=="function"}u(ng,"isDate");function og(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}u(og,"isArrayBufferLike");function $c(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(kc);let t={};for(let r of Object.keys(e))t[r]=kc(e[r]);return t}u($c,"preprocessObject");function kc(e){return typeof e=="bigint"?e.toString():$c(e)}u(kc,"preprocessValueInObject");d();p();m();var qc=Z(Do());var jc=["datasources","errorFormat","log","__internal","rejectOnNotFound"],Lc=["pretty","colorless","minimal"],Bc=["info","query","warn","error"],ig={datasources:(e,t)=>{if(!!e){if(typeof e!="object"||Array.isArray(e))throw new ne(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let o=pr(r,t)||`Available datasources: ${t.join(", ")}`;throw new ne(`Unknown datasource ${r} provided to PrismaClient constructor.${o}`)}if(typeof n!="object"||Array.isArray(n))throw new ne(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[o,i]of Object.entries(n)){if(o!=="url")throw new ne(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`);if(typeof i!="string")throw new ne(`Invalid value ${JSON.stringify(i)} for datasource "${r}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }`)}}}},errorFormat:e=>{if(!!e){if(typeof e!="string")throw new ne(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Lc.includes(e)){let t=pr(e,Lc);throw new ne(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new ne(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Bc.includes(r)){let n=pr(r,Bc);throw new ne(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}u(t,"validateLogLevel");for(let r of e){t(r);let n={level:t,emit:o=>{let i=["stdout","event"];if(!i.includes(o)){let s=pr(o,i);throw new ne(`Invalid value ${JSON.stringify(o)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[o,i]of Object.entries(r))if(n[o])n[o](i);else throw new ne(`Invalid property ${o} for "log" provided to PrismaClient constructor`)}},__internal:e=>{if(!e)return;let t=["debug","hooks","engine","measurePerformance"];if(typeof e!="object")throw new ne(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=pr(r,t);throw new ne(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}},rejectOnNotFound:e=>{if(!!e){if(qr(e)||typeof e=="boolean"||typeof e=="object"||typeof e=="function")return e;throw new ne(`Invalid rejectOnNotFound expected a boolean/Error/{[modelName: Error | boolean]} but received ${JSON.stringify(e)}`)}}};function Uc(e,t){for(let[r,n]of Object.entries(e)){if(!jc.includes(r)){let o=pr(r,jc);throw new ne(`Unknown property ${r} provided to PrismaClient constructor.${o}`)}ig[r](n,t)}}u(Uc,"validatePrismaClientOptions");function pr(e,t){if(t.length===0||typeof e!="string")return"";let r=sg(e,t);return r?` Did you mean "${r}"?`:""}u(pr,"getDidYouMean");function sg(e,t){if(t.length===0)return null;let r=t.map(o=>({value:o,distance:(0,qc.default)(e,o)}));r.sort((o,i)=>o.distance0&&ag.exec(e))throw new Error(`Running ALTER using ${r} 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 +`)}u(Bi,"checkAlter");var ug={findUnique:"query",findFirst:"query",findMany:"query",count:"query",create:"mutation",createMany:"mutation",update:"mutation",updateMany:"mutation",upsert:"mutation",delete:"mutation",deleteMany:"mutation",executeRaw:"mutation",queryRaw:"mutation",aggregate:"query",groupBy:"query",runCommandRaw:"mutation",findRaw:"query",aggregateRaw:"query"},cg=Symbol.for("prisma.client.transaction.id");function Gc(e){class t{constructor(n){this._middlewares=new Yr;this._transactionId=1;this._getDmmf=yi(async n=>{try{let o=await this._engine.getDmmf();return new Xe(Lu(o))}catch(o){this._fetcher.handleRequestError({...n,error:o})}});var s,a,c,l,f,g,h,w,b;n&&Uc(n,e.datasourceNames),this._previewFeatures=(a=(s=e.generator)==null?void 0:s.previewFeatures)!=null?a:[],this._rejectOnNotFound=n==null?void 0:n.rejectOnNotFound,this._clientVersion=(c=e.clientVersion)!=null?c:Ic,this._activeProvider=e.activeProvider,this._dataProxy=e.dataProxy,this._tracingConfig=ui(this._previewFeatures),this._clientEngineType=pi(e.generator);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&tn.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&tn.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},i=!1;try{let y=n!=null?n:{},T=(l=y.__internal)!=null?l:{},M=T.debug===!0;M&&Ge.enable("prisma:client"),T.hooks&&(this._hooks=T.hooks);let A=tn.default.resolve(e.dirname,e.relativePath);Qn.existsSync(A)||(A=e.dirname),ge("dirname",e.dirname),ge("relativePath",e.relativePath),ge("cwd",A);let S=y.datasources||{},P=Object.entries(S).filter(([R,L])=>L&&L.url).map(([R,{url:L}])=>({name:R,url:L})),_=Oc([],P,R=>R.name),I=T.engine||{};if(y.errorFormat?this._errorFormat=y.errorFormat:v.env.NODE_ENV==="production"?this._errorFormat="minimal":v.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._baseDmmf=new pt(e.document),this._dataProxy){let R=e.document;this._dmmf=new Xe(R)}if(this._engineConfig={cwd:A,dirname:e.dirname,enableDebugLogs:M,allowTriggerPanic:I.allowTriggerPanic,datamodelPath:tn.default.join(e.dirname,(f=e.filename)!=null?f:"schema.prisma"),prismaPath:(g=I.binaryPath)!=null?g:void 0,engineEndpoint:I.endpoint,datasources:_,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:y.log&&Pc(y.log),logQueries:y.log&&Boolean(typeof y.log=="string"?y.log==="query":y.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:(b=(w=i==null?void 0:i.parsed)!=null?w:(h=e.injectableEdgeEnv)==null?void 0:h.parsed)!=null?b:{},flags:[],clientVersion:e.clientVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingConfig:this._tracingConfig},ge("clientVersion",e.clientVersion),ge("clientEngineType",this._dataProxy?"dataproxy":this._clientEngineType),this._dataProxy&&ge("using Data Proxy with edge runtime"),this._engine=this.getEngine(),this._getActiveProvider(),this._fetcher=new Xr(this,this._hooks),y.log)for(let R of y.log){let L=typeof R=="string"?R:R.emit==="stdout"?R.level:null;L&&this.$on(L,H=>{var X;ur.log(`${(X=ur.tags[L])!=null?X:""}`,H.message||H.query)})}this._metrics=new St(this._engine)}catch(y){throw y.clientVersion=this._clientVersion,y}return Tc(this)}get[Symbol.toStringTag](){return"PrismaClient"}getEngine(){if(this._dataProxy===!0)return new ar(this._engineConfig);if(this._clientEngineType==="library")return!1;if(this._clientEngineType==="binary")return!1;throw new Ee("Invalid client engine type, please use `library` or `binary`")}$use(n,o){if(typeof n=="function")this._middlewares.query.use(n);else if(n==="all")this._middlewares.query.use(o);else if(n==="engine")this._middlewares.engine.use(o);else throw new Error(`Invalid middleware ${n}`)}$on(n,o){n==="beforeExit"?this._engine.on("beforeExit",o):this._engine.on(n,i=>{var a,c,l,f;let s=i.fields;return o(n==="query"?{timestamp:i.timestamp,query:(a=s==null?void 0:s.query)!=null?a:i.query,params:(c=s==null?void 0:s.params)!=null?c:i.params,duration:(l=s==null?void 0:s.duration_ms)!=null?l:i.duration,target:i.target}:{timestamp:i.timestamp,message:(f=s==null?void 0:s.message)!=null?f:i.message,target:i.target})})}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async _runDisconnect(){await this._engine.stop(),delete this._connectionPromise,this._engine=this.getEngine(),delete this._disconnectionPromise,delete this._getConfigPromise}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{this._dataProxy||(this._dmmf=void 0)}}async _getActiveProvider(){try{let n=await this._engine.getConfig();this._activeProvider=n.datasources[0].activeProvider}catch(n){}}$executeRawInternal(n,o,i,...s){let a="",c;if(typeof i=="string")a=i,c={values:Le(s||[]),__prismaRawParamaters__:!0},Bi(a,s,"prisma.$executeRawUnsafe(, [...values])");else if(Vc(i))switch(this._activeProvider){case"sqlite":case"mysql":{let f=new ce(i,s);a=f.sql,c={values:Le(f.values),__prismaRawParamaters__:!0};break}case"cockroachdb":case"postgresql":{let f=new ce(i,s);a=f.text,Bi(a,f.values,"prisma.$executeRaw``"),c={values:Le(f.values),__prismaRawParamaters__:!0};break}case"sqlserver":{a=en(i),c={values:Le(s),__prismaRawParamaters__:!0};break}default:throw new Error(`The ${this._activeProvider} provider does not support $executeRaw`)}else{switch(this._activeProvider){case"sqlite":case"mysql":a=i.sql;break;case"cockroachdb":case"postgresql":a=i.text,Bi(a,i.values,"prisma.$executeRaw(sql``)");break;case"sqlserver":a=en(i.strings);break;default:throw new Error(`The ${this._activeProvider} provider does not support $executeRaw`)}c={values:Le(i.values),__prismaRawParamaters__:!0}}c!=null&&c.values?ge(`prisma.$executeRaw(${a}, ${c.values})`):ge(`prisma.$executeRaw(${a})`);let l={query:a,parameters:c};return ge("Prisma Client call:"),this._request({args:l,clientMethod:"$executeRaw",dataPath:[],action:"executeRaw",callsite:rt(this._errorFormat),runInTransaction:!!n,transactionId:n,lock:o})}$executeRaw(n,...o){return xt((i,s)=>{if(n.raw!==void 0||n.sql!==void 0)return this.$executeRawInternal(i,s,n,...o);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")})}$executeRawUnsafe(n,...o){return xt((i,s)=>this.$executeRawInternal(i,s,n,...o))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Ee(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`);return xt((o,i)=>this._request({args:{command:n},clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",callsite:rt(this._errorFormat),runInTransaction:!!o,transactionId:o,lock:i}))}$queryRawInternal(n,o,i,...s){let a="",c;if(typeof i=="string")a=i,c={values:Le(s||[]),__prismaRawParamaters__:!0};else if(Vc(i))switch(this._activeProvider){case"sqlite":case"mysql":{let f=new ce(i,s);a=f.sql,c={values:Le(f.values),__prismaRawParamaters__:!0};break}case"cockroachdb":case"postgresql":{let f=new ce(i,s);a=f.text,c={values:Le(f.values),__prismaRawParamaters__:!0};break}case"sqlserver":{let f=new ce(i,s);a=en(f.strings),c={values:Le(f.values),__prismaRawParamaters__:!0};break}default:throw new Error(`The ${this._activeProvider} provider does not support $queryRaw`)}else{switch(this._activeProvider){case"sqlite":case"mysql":a=i.sql;break;case"cockroachdb":case"postgresql":a=i.text;break;case"sqlserver":a=en(i.strings);break;default:throw new Error(`The ${this._activeProvider} provider does not support $queryRaw`)}c={values:Le(i.values),__prismaRawParamaters__:!0}}c!=null&&c.values?ge(`prisma.queryRaw(${a}, ${c.values})`):ge(`prisma.queryRaw(${a})`);let l={query:a,parameters:c};return ge("Prisma Client call:"),this._request({args:l,clientMethod:"$queryRaw",dataPath:[],action:"queryRaw",callsite:rt(this._errorFormat),runInTransaction:!!n,transactionId:n,lock:o}).then(Rc)}$queryRaw(n,...o){return xt((i,s)=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(i,s,n,...o);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")})}$queryRawUnsafe(n,...o){return xt((i,s)=>this.$queryRawInternal(i,s,n,...o))}__internal_triggerPanic(n){if(!this._engineConfig.allowTriggerPanic)throw new Error(`In order to use .__internal_triggerPanic(), please enable it like so: +new PrismaClient({ + __internal: { + engine: { + allowTriggerPanic: true + } + } +})`);let o=n?{"X-DEBUG-FATAL":"1"}:{"X-DEBUG-NON-FATAL":"1"};return this._request({action:"queryRaw",args:{query:"SELECT 1",parameters:void 0},clientMethod:"queryRaw",dataPath:[],runInTransaction:!1,headers:o,callsite:rt(this._errorFormat)})}_transactionWithArray(n){let o=this._transactionId++,i=Mc(n.length),s=n.map(a=>{var c;if((a==null?void 0:a[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.");return(c=a.requestTransaction)==null?void 0:c.call(a,o,i)});return Promise.all(s)}async _transactionWithCallback({callback:n,options:o}){let i={traceparent:rr({tracingConfig:this._tracingConfig})},s=await this._engine.transaction("start",i,o),a;try{a=await n(qi(this,s.id)),await this._engine.transaction("commit",i,s)}catch(c){throw await this._engine.transaction("rollback",i,s).catch(()=>{}),c.clientVersion=this._clientVersion,c}return a}$transaction(n,o){let i;typeof n=="function"&&this._hasPreviewFlag("interactiveTransactions")?i=u(()=>this._transactionWithCallback({callback:n,options:o}),"callback"):i=u(()=>this._transactionWithArray(n),"callback");let s={name:"transaction",enabled:this._tracingConfig.enabled,attributes:{method:"$transaction"}};return nr(s,i)}async _request(n){n.otelParentCtx=bt.active();try{let o={args:n.args,dataPath:n.dataPath,runInTransaction:n.runInTransaction,action:n.action,model:n.model},i={middleware:{name:"middleware",enabled:this._tracingConfig.middleware,attributes:{method:"$use"},active:!1},operation:{name:"operation",enabled:this._tracingConfig.enabled,attributes:{method:o.action,model:o.model,name:`${o.model}.${o.action}`}}},s=-1,a=u(c=>{let l=this._middlewares.query.get(++s);return l?nr(i.middleware,async f=>l(c,g=>(f==null||f.end(),a(g)))):this._executeRequest({...n,...c})},"consumer");return await nr(i.operation,()=>a(o))}catch(o){throw o.clientVersion=this._clientVersion,o}}async _executeRequest({args:n,clientMethod:o,jsModelName:i,dataPath:s,callsite:a,runInTransaction:c,action:l,model:f,headers:g,transactionId:h,lock:w,unpacker:b,otelParentCtx:y}){var X,z;this._dmmf===void 0&&(this._dmmf=await this._getDmmf({clientMethod:o,callsite:a}));let T,M=ug[l];(l==="executeRaw"||l==="queryRaw"||l==="runCommandRaw")&&(T=l);let A;if(f!==void 0){if(A=(X=this._dmmf)==null?void 0:X.mappingsMap[f],A===void 0)throw new Error(`Could not find mapping for model ${f}`);T=A[l==="count"?"aggregate":l]}if(M!=="query"&&M!=="mutation")throw new Error(`Invalid operation ${M} for action ${l}`);let S=(z=this._dmmf)==null?void 0:z.rootFieldMap[T];if(S===void 0)throw new Error(`Could not find rootField ${T} for action ${l} for model ${f} on rootType ${M}`);let{isList:P}=S.outputType,_=_t(S.outputType.type),I=$i(l,_,n,this._rejectOnNotFound);pg(I,i,l);let R=u(()=>{let V=uo({dmmf:this._dmmf,rootField:T,rootTypeName:M,select:n,modelName:f});return V.validate(n,!1,o,this._errorFormat,a),V},"serializationFn"),L={name:"serialize",enabled:this._tracingConfig.enabled},H=await nr(L,R);if(Ge.enabled("prisma:client")){let V=String(H);ge("Prisma Client call:"),ge(`prisma.${o}(${oo({ast:n,keyPaths:[],valuePaths:[],missingItems:[]})})`),ge("Generated request:"),ge(V+` +`)}return await w,this._fetcher.request({document:H,clientMethod:o,typeName:_,dataPath:s,rejectOnNotFound:I,isList:P,rootField:T,callsite:a,args:n,engineHook:this._middlewares.engine.get(0),runInTransaction:c,headers:g,transactionId:h,unpacker:b,otelParentCtx:y,otelChildCtx:bt.active()})}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Ee("`metrics` preview feature must be enabled in order to access metrics API");return this._metrics}_hasPreviewFlag(n){var o;return!!((o=this._engineConfig.previewFeatures)!=null&&o.includes(n))}}return u(t,"PrismaClient"),t}u(Gc,"getPrismaClient");var lg=["$connect","$disconnect","$on","$transaction","$use"];function qi(e,t){return typeof e!="object"?e:new Proxy(e,{get:(r,n)=>{if(!lg.includes(n))return n===cg?t:typeof r[n]=="function"?(...o)=>n==="then"?r[n](o[0],o[1],t):n==="catch"||n==="finally"?r[n](o[0],t):qi(r[n](...o),t):qi(r[n],t)}})}u(qi,"transactionProxy");var fg={findUnique:"findUniqueOrThrow",findFirst:"findFirstOrThrow"};function pg(e,t,r){if(e){let n=fg[r],o=t?`prisma.${t}.${n}`:`prisma.${n}`,i=`rejectOnNotFound.${t!=null?t:""}.${r}`;wi(i,`\`rejectOnNotFound\` option is deprecated and will be removed in Prisma 5. Please use \`${o}\` method instead`)}}u(pg,"warnAboutRejectOnNotFound");d();p();m();var mg=new Set(["toJSON","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function zc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!mg.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}u(zc,"makeStrictEnum");d();p();m();d();p();m();var dg=Jc.decompressFromBase64;0&&(module.exports={DMMF,DMMFClass,Debug,Decimal,Engine,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Sql,decompressFromBase64,empty,findSync,getPrismaClient,join,makeDocument,makeStrictEnum,objectEnumValues,raw,sqltag,transformDocument,unpack,warnEnvConflicts}); diff --git a/samples/todo/.zenstack/.prisma/runtime/index-browser.d.ts b/samples/todo/.zenstack/.prisma/runtime/index-browser.d.ts new file mode 100644 index 000000000..1a40408e5 --- /dev/null +++ b/samples/todo/.zenstack/.prisma/runtime/index-browser.d.ts @@ -0,0 +1,323 @@ +declare class AnyNull extends NullTypesEnumValue { +} + +declare class DbNull extends NullTypesEnumValue { +} + +export declare namespace Decimal { + export type Constructor = typeof Decimal; + export type Instance = Decimal; + export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + export type Modulo = Rounding | 9; + export type Value = string | number | Decimal; + + // http://mikemcl.github.io/decimal.js/#constructor-properties + export interface Config { + precision?: number; + rounding?: Rounding; + toExpNeg?: number; + toExpPos?: number; + minE?: number; + maxE?: number; + crypto?: boolean; + modulo?: Modulo; + defaults?: boolean; + } +} + +export declare class Decimal { + readonly d: number[]; + readonly e: number; + readonly s: number; + private readonly toStringTag: string; + + 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): Decimal; + 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 class JsonNull extends NullTypesEnumValue { +} + +/** + * Generates more strict variant of an enum which, unlike regular enum, + * throws on non-existing property access. This can be useful in following situations: + * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input + * - enum values are generated dynamically from DMMF. + * + * In that case, if using normal enums and no compile-time typechecking, using non-existing property + * will result in `undefined` value being used, which will be accepted. Using strict enum + * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. + * + * Note: if you need to check for existence of a value in the enum you can still use either + * `in` operator or `hasOwnProperty` function. + * + * @param definition + * @returns + */ +export declare function makeStrictEnum>(definition: T): T; + +declare class NullTypesEnumValue extends ObjectEnumValue { + _getNamespace(): string; +} + +/** + * Base class for unique values of object-valued enums. + */ +declare abstract class ObjectEnumValue { + constructor(arg?: symbol); + abstract _getNamespace(): string; + _getName(): string; + toString(): string; +} + +export declare const objectEnumValues: { + classes: { + DbNull: typeof DbNull; + JsonNull: typeof JsonNull; + AnyNull: typeof AnyNull; + }; + instances: { + DbNull: DbNull; + JsonNull: JsonNull; + AnyNull: AnyNull; + }; +}; + +export { } diff --git a/samples/todo/.zenstack/.prisma/runtime/index-browser.js b/samples/todo/.zenstack/.prisma/runtime/index-browser.js new file mode 100644 index 000000000..8b1a8294c --- /dev/null +++ b/samples/todo/.zenstack/.prisma/runtime/index-browser.js @@ -0,0 +1,2479 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); + +// src/runtime/index-browser.ts +var index_browser_exports = {}; +__export(index_browser_exports, { + Decimal: () => decimal_default, + makeStrictEnum: () => makeStrictEnum, + objectEnumValues: () => objectEnumValues +}); +module.exports = __toCommonJS(index_browser_exports); + +// src/runtime/object-enums.ts +var secret = Symbol(); +var representations = /* @__PURE__ */ new WeakMap(); +var ObjectEnumValue = class { + constructor(arg) { + if (arg === secret) { + representations.set(this, `Prisma.${this._getName()}`); + } else { + representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`); + } + } + _getName() { + return this.constructor.name; + } + toString() { + return representations.get(this); + } +}; +__name(ObjectEnumValue, "ObjectEnumValue"); +var NullTypesEnumValue = class extends ObjectEnumValue { + _getNamespace() { + return "NullTypes"; + } +}; +__name(NullTypesEnumValue, "NullTypesEnumValue"); +var DbNull = class extends NullTypesEnumValue { +}; +__name(DbNull, "DbNull"); +var JsonNull = class extends NullTypesEnumValue { +}; +__name(JsonNull, "JsonNull"); +var AnyNull = class extends NullTypesEnumValue { +}; +__name(AnyNull, "AnyNull"); +var objectEnumValues = { + classes: { + DbNull, + JsonNull, + AnyNull + }, + instances: { + DbNull: new DbNull(secret), + JsonNull: new JsonNull(secret), + AnyNull: new AnyNull(secret) + } +}; + +// src/runtime/strictEnum.ts +var allowList = /* @__PURE__ */ new Set([ + "toJSON", + "asymmetricMatch", + Symbol.iterator, + Symbol.toStringTag, + Symbol.isConcatSpreadable, + Symbol.toPrimitive +]); +function makeStrictEnum(definition) { + return new Proxy(definition, { + get(target, property) { + if (property in target) { + return target[property]; + } + if (allowList.has(property)) { + return void 0; + } + throw new TypeError(`Invalid enum value: ${String(property)}`); + } + }); +} +__name(makeStrictEnum, "makeStrictEnum"); + +// ../../node_modules/.pnpm/decimal.js@10.4.0/node_modules/decimal.js/decimal.mjs +var EXP_LIMIT = 9e15; +var MAX_DIGITS = 1e9; +var NUMERALS = "0123456789abcdef"; +var LN10 = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058"; +var PI = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789"; +var DEFAULTS = { + precision: 20, + rounding: 4, + modulo: 1, + toExpNeg: -7, + toExpPos: 21, + minE: -EXP_LIMIT, + maxE: EXP_LIMIT, + crypto: false +}; +var inexact; +var quadrant; +var external = true; +var decimalError = "[DecimalError] "; +var invalidArgument = decimalError + "Invalid argument: "; +var precisionLimitExceeded = decimalError + "Precision limit exceeded"; +var cryptoUnavailable = decimalError + "crypto unavailable"; +var tag = "[object Decimal]"; +var mathfloor = Math.floor; +var mathpow = Math.pow; +var isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i; +var isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i; +var isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i; +var isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; +var BASE = 1e7; +var LOG_BASE = 7; +var MAX_SAFE_INTEGER = 9007199254740991; +var LN10_PRECISION = LN10.length - 1; +var PI_PRECISION = PI.length - 1; +var P = { toStringTag: tag }; +P.absoluteValue = P.abs = function() { + var x = new this.constructor(this); + if (x.s < 0) + x.s = 1; + return finalise(x); +}; +P.ceil = function() { + return finalise(new this.constructor(this), this.e + 1, 2); +}; +P.clampedTo = P.clamp = function(min2, max2) { + var k, x = this, Ctor = x.constructor; + min2 = new Ctor(min2); + max2 = new Ctor(max2); + if (!min2.s || !max2.s) + return new Ctor(NaN); + if (min2.gt(max2)) + throw Error(invalidArgument + max2); + k = x.cmp(min2); + return k < 0 ? min2 : x.cmp(max2) > 0 ? max2 : new Ctor(x); +}; +P.comparedTo = P.cmp = function(y) { + var i, j, xdL, ydL, x = this, xd = x.d, yd = (y = new x.constructor(y)).d, xs = x.s, ys = y.s; + if (!xd || !yd) { + return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1; + } + if (!xd[0] || !yd[0]) + return xd[0] ? xs : yd[0] ? -ys : 0; + if (xs !== ys) + return xs; + if (x.e !== y.e) + return x.e > y.e ^ xs < 0 ? 1 : -1; + xdL = xd.length; + ydL = yd.length; + for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) { + if (xd[i] !== yd[i]) + return xd[i] > yd[i] ^ xs < 0 ? 1 : -1; + } + return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1; +}; +P.cosine = P.cos = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.d) + return new Ctor(NaN); + if (!x.d[0]) + return new Ctor(1); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + x = cosine(Ctor, toLessThanHalfPi(Ctor, x)); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true); +}; +P.cubeRoot = P.cbrt = function() { + var e, m, n, r, rep, s, sd, t, t3, t3plusx, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + external = false; + s = x.s * mathpow(x.s * x, 1 / 3); + if (!s || Math.abs(s) == 1 / 0) { + n = digitsToString(x.d); + e = x.e; + if (s = (e - n.length + 1) % 3) + n += s == 1 || s == -2 ? "0" : "00"; + s = mathpow(n, 1 / 3); + e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)); + if (s == 1 / 0) { + n = "5e" + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf("e") + 1) + e; + } + r = new Ctor(n); + r.s = x.s; + } else { + r = new Ctor(s.toString()); + } + sd = (e = Ctor.precision) + 3; + for (; ; ) { + t = r; + t3 = t.times(t).times(t); + t3plusx = t3.plus(x); + r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1); + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + if (n == "9999" || !rep && n == "4999") { + if (!rep) { + finalise(t, e + 1, 0); + if (t.times(t).times(t).eq(x)) { + r = t; + break; + } + } + sd += 4; + rep = 1; + } else { + if (!+n || !+n.slice(1) && n.charAt(0) == "5") { + finalise(r, e + 1, 1); + m = !r.times(r).times(r).eq(x); + } + break; + } + } + } + external = true; + return finalise(r, e, Ctor.rounding, m); +}; +P.decimalPlaces = P.dp = function() { + var w, d = this.d, n = NaN; + if (d) { + w = d.length - 1; + n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE; + w = d[w]; + if (w) + for (; w % 10 == 0; w /= 10) + n--; + if (n < 0) + n = 0; + } + return n; +}; +P.dividedBy = P.div = function(y) { + return divide(this, new this.constructor(y)); +}; +P.dividedToIntegerBy = P.divToInt = function(y) { + var x = this, Ctor = x.constructor; + return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding); +}; +P.equals = P.eq = function(y) { + return this.cmp(y) === 0; +}; +P.floor = function() { + return finalise(new this.constructor(this), this.e + 1, 3); +}; +P.greaterThan = P.gt = function(y) { + return this.cmp(y) > 0; +}; +P.greaterThanOrEqualTo = P.gte = function(y) { + var k = this.cmp(y); + return k == 1 || k === 0; +}; +P.hyperbolicCosine = P.cosh = function() { + var k, n, pr, rm, len, x = this, Ctor = x.constructor, one = new Ctor(1); + if (!x.isFinite()) + return new Ctor(x.s ? 1 / 0 : NaN); + if (x.isZero()) + return one; + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + if (len < 32) { + k = Math.ceil(len / 3); + n = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + n = "2.3283064365386962890625e-10"; + } + x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true); + var cosh2_x, i = k, d8 = new Ctor(8); + for (; i--; ) { + cosh2_x = x.times(x); + x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8)))); + } + return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true); +}; +P.hyperbolicSine = P.sinh = function() { + var k, pr, rm, len, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + if (len < 3) { + x = taylorSeries(Ctor, 2, x, x, true); + } else { + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x, true); + var sinh2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); + for (; k--; ) { + sinh2_x = x.times(x); + x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20)))); + } + } + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(x, pr, rm, true); +}; +P.hyperbolicTangent = P.tanh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(x.s); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 7; + Ctor.rounding = 1; + return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm); +}; +P.inverseCosine = P.acos = function() { + var halfPi, x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding; + if (k !== -1) { + return k === 0 ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN); + } + if (x.isZero()) + return getPi(Ctor, pr + 4, rm).times(0.5); + Ctor.precision = pr + 6; + Ctor.rounding = 1; + x = x.asin(); + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + Ctor.precision = pr; + Ctor.rounding = rm; + return halfPi.minus(x); +}; +P.inverseHyperbolicCosine = P.acosh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (x.lte(1)) + return new Ctor(x.eq(1) ? 0 : NaN); + if (!x.isFinite()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4; + Ctor.rounding = 1; + external = false; + x = x.times(x).minus(1).sqrt().plus(x); + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + return x.ln(); +}; +P.inverseHyperbolicSine = P.asinh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6; + Ctor.rounding = 1; + external = false; + x = x.times(x).plus(1).sqrt().plus(x); + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + return x.ln(); +}; +P.inverseHyperbolicTangent = P.atanh = function() { + var pr, rm, wpr, xsd, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.e >= 0) + return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN); + pr = Ctor.precision; + rm = Ctor.rounding; + xsd = x.sd(); + if (Math.max(xsd, pr) < 2 * -x.e - 1) + return finalise(new Ctor(x), pr, rm, true); + Ctor.precision = wpr = xsd - x.e; + x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1); + Ctor.precision = pr + 4; + Ctor.rounding = 1; + x = x.ln(); + Ctor.precision = pr; + Ctor.rounding = rm; + return x.times(0.5); +}; +P.inverseSine = P.asin = function() { + var halfPi, k, pr, rm, x = this, Ctor = x.constructor; + if (x.isZero()) + return new Ctor(x); + k = x.abs().cmp(1); + pr = Ctor.precision; + rm = Ctor.rounding; + if (k !== -1) { + if (k === 0) { + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + halfPi.s = x.s; + return halfPi; + } + return new Ctor(NaN); + } + Ctor.precision = pr + 6; + Ctor.rounding = 1; + x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan(); + Ctor.precision = pr; + Ctor.rounding = rm; + return x.times(2); +}; +P.inverseTangent = P.atan = function() { + var i, j, k, n, px, t, r, wpr, x2, x = this, Ctor = x.constructor, pr = Ctor.precision, rm = Ctor.rounding; + if (!x.isFinite()) { + if (!x.s) + return new Ctor(NaN); + if (pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.5); + r.s = x.s; + return r; + } + } else if (x.isZero()) { + return new Ctor(x); + } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.25); + r.s = x.s; + return r; + } + Ctor.precision = wpr = pr + 10; + Ctor.rounding = 1; + k = Math.min(28, wpr / LOG_BASE + 2 | 0); + for (i = k; i; --i) + x = x.div(x.times(x).plus(1).sqrt().plus(1)); + external = false; + j = Math.ceil(wpr / LOG_BASE); + n = 1; + x2 = x.times(x); + r = new Ctor(x); + px = x; + for (; i !== -1; ) { + px = px.times(x2); + t = r.minus(px.div(n += 2)); + px = px.times(x2); + r = t.plus(px.div(n += 2)); + if (r.d[j] !== void 0) + for (i = j; r.d[i] === t.d[i] && i--; ) + ; + } + if (k) + r = r.times(2 << k - 1); + external = true; + return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true); +}; +P.isFinite = function() { + return !!this.d; +}; +P.isInteger = P.isInt = function() { + return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2; +}; +P.isNaN = function() { + return !this.s; +}; +P.isNegative = P.isNeg = function() { + return this.s < 0; +}; +P.isPositive = P.isPos = function() { + return this.s > 0; +}; +P.isZero = function() { + return !!this.d && this.d[0] === 0; +}; +P.lessThan = P.lt = function(y) { + return this.cmp(y) < 0; +}; +P.lessThanOrEqualTo = P.lte = function(y) { + return this.cmp(y) < 1; +}; +P.logarithm = P.log = function(base) { + var isBase10, d, denominator, k, inf, num, sd, r, arg = this, Ctor = arg.constructor, pr = Ctor.precision, rm = Ctor.rounding, guard = 5; + if (base == null) { + base = new Ctor(10); + isBase10 = true; + } else { + base = new Ctor(base); + d = base.d; + if (base.s < 0 || !d || !d[0] || base.eq(1)) + return new Ctor(NaN); + isBase10 = base.eq(10); + } + d = arg.d; + if (arg.s < 0 || !d || !d[0] || arg.eq(1)) { + return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0); + } + if (isBase10) { + if (d.length > 1) { + inf = true; + } else { + for (k = d[0]; k % 10 === 0; ) + k /= 10; + inf = k !== 1; + } + } + external = false; + sd = pr + guard; + num = naturalLogarithm(arg, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + r = divide(num, denominator, sd, 1); + if (checkRoundingDigits(r.d, k = pr, rm)) { + do { + sd += 10; + num = naturalLogarithm(arg, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + r = divide(num, denominator, sd, 1); + if (!inf) { + if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + break; + } + } while (checkRoundingDigits(r.d, k += 10, rm)); + } + external = true; + return finalise(r, pr, rm); +}; +P.minus = P.sub = function(y) { + var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.d) { + if (!x.s || !y.s) + y = new Ctor(NaN); + else if (x.d) + y.s = -y.s; + else + y = new Ctor(y.d || x.s !== y.s ? x : NaN); + return y; + } + if (x.s != y.s) { + y.s = -y.s; + return x.plus(y); + } + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + if (!xd[0] || !yd[0]) { + if (yd[0]) + y.s = -y.s; + else if (xd[0]) + y = new Ctor(x); + else + return new Ctor(rm === 3 ? -0 : 0); + return external ? finalise(y, pr, rm) : y; + } + e = mathfloor(y.e / LOG_BASE); + xe = mathfloor(x.e / LOG_BASE); + xd = xd.slice(); + k = xe - e; + if (k) { + xLTy = k < 0; + if (xLTy) { + d = xd; + k = -k; + len = yd.length; + } else { + d = yd; + e = xe; + len = xd.length; + } + i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2; + if (k > i) { + k = i; + d.length = 1; + } + d.reverse(); + for (i = k; i--; ) + d.push(0); + d.reverse(); + } else { + i = xd.length; + len = yd.length; + xLTy = i < len; + if (xLTy) + len = i; + for (i = 0; i < len; i++) { + if (xd[i] != yd[i]) { + xLTy = xd[i] < yd[i]; + break; + } + } + k = 0; + } + if (xLTy) { + d = xd; + xd = yd; + yd = d; + y.s = -y.s; + } + len = xd.length; + for (i = yd.length - len; i > 0; --i) + xd[len++] = 0; + for (i = yd.length; i > k; ) { + if (xd[--i] < yd[i]) { + for (j = i; j && xd[--j] === 0; ) + xd[j] = BASE - 1; + --xd[j]; + xd[i] += BASE; + } + xd[i] -= yd[i]; + } + for (; xd[--len] === 0; ) + xd.pop(); + for (; xd[0] === 0; xd.shift()) + --e; + if (!xd[0]) + return new Ctor(rm === 3 ? -0 : 0); + y.d = xd; + y.e = getBase10Exponent(xd, e); + return external ? finalise(y, pr, rm) : y; +}; +P.modulo = P.mod = function(y) { + var q, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.s || y.d && !y.d[0]) + return new Ctor(NaN); + if (!y.d || x.d && !x.d[0]) { + return finalise(new Ctor(x), Ctor.precision, Ctor.rounding); + } + external = false; + if (Ctor.modulo == 9) { + q = divide(x, y.abs(), 0, 3, 1); + q.s *= y.s; + } else { + q = divide(x, y, 0, Ctor.modulo, 1); + } + q = q.times(y); + external = true; + return x.minus(q); +}; +P.naturalExponential = P.exp = function() { + return naturalExponential(this); +}; +P.naturalLogarithm = P.ln = function() { + return naturalLogarithm(this); +}; +P.negated = P.neg = function() { + var x = new this.constructor(this); + x.s = -x.s; + return finalise(x); +}; +P.plus = P.add = function(y) { + var carry, d, e, i, k, len, pr, rm, xd, yd, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.d) { + if (!x.s || !y.s) + y = new Ctor(NaN); + else if (!x.d) + y = new Ctor(y.d || x.s === y.s ? x : NaN); + return y; + } + if (x.s != y.s) { + y.s = -y.s; + return x.minus(y); + } + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + if (!xd[0] || !yd[0]) { + if (!yd[0]) + y = new Ctor(x); + return external ? finalise(y, pr, rm) : y; + } + k = mathfloor(x.e / LOG_BASE); + e = mathfloor(y.e / LOG_BASE); + xd = xd.slice(); + i = k - e; + if (i) { + if (i < 0) { + d = xd; + i = -i; + len = yd.length; + } else { + d = yd; + e = k; + len = xd.length; + } + k = Math.ceil(pr / LOG_BASE); + len = k > len ? k + 1 : len + 1; + if (i > len) { + i = len; + d.length = 1; + } + d.reverse(); + for (; i--; ) + d.push(0); + d.reverse(); + } + len = xd.length; + i = yd.length; + if (len - i < 0) { + i = len; + d = yd; + yd = xd; + xd = d; + } + for (carry = 0; i; ) { + carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0; + xd[i] %= BASE; + } + if (carry) { + xd.unshift(carry); + ++e; + } + for (len = xd.length; xd[--len] == 0; ) + xd.pop(); + y.d = xd; + y.e = getBase10Exponent(xd, e); + return external ? finalise(y, pr, rm) : y; +}; +P.precision = P.sd = function(z) { + var k, x = this; + if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) + throw Error(invalidArgument + z); + if (x.d) { + k = getPrecision(x.d); + if (z && x.e + 1 > k) + k = x.e + 1; + } else { + k = NaN; + } + return k; +}; +P.round = function() { + var x = this, Ctor = x.constructor; + return finalise(new Ctor(x), x.e + 1, Ctor.rounding); +}; +P.sine = P.sin = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + x = sine(Ctor, toLessThanHalfPi(Ctor, x)); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true); +}; +P.squareRoot = P.sqrt = function() { + var m, n, sd, r, rep, t, x = this, d = x.d, e = x.e, s = x.s, Ctor = x.constructor; + if (s !== 1 || !d || !d[0]) { + return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0); + } + external = false; + s = Math.sqrt(+x); + if (s == 0 || s == 1 / 0) { + n = digitsToString(d); + if ((n.length + e) % 2 == 0) + n += "0"; + s = Math.sqrt(n); + e = mathfloor((e + 1) / 2) - (e < 0 || e % 2); + if (s == 1 / 0) { + n = "5e" + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf("e") + 1) + e; + } + r = new Ctor(n); + } else { + r = new Ctor(s.toString()); + } + sd = (e = Ctor.precision) + 3; + for (; ; ) { + t = r; + r = t.plus(divide(x, t, sd + 2, 1)).times(0.5); + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + if (n == "9999" || !rep && n == "4999") { + if (!rep) { + finalise(t, e + 1, 0); + if (t.times(t).eq(x)) { + r = t; + break; + } + } + sd += 4; + rep = 1; + } else { + if (!+n || !+n.slice(1) && n.charAt(0) == "5") { + finalise(r, e + 1, 1); + m = !r.times(r).eq(x); + } + break; + } + } + } + external = true; + return finalise(r, e, Ctor.rounding, m); +}; +P.tangent = P.tan = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 10; + Ctor.rounding = 1; + x = x.sin(); + x.s = 1; + x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true); +}; +P.times = P.mul = function(y) { + var carry, e, i, k, r, rL, t, xdL, ydL, x = this, Ctor = x.constructor, xd = x.d, yd = (y = new Ctor(y)).d; + y.s *= x.s; + if (!xd || !xd[0] || !yd || !yd[0]) { + return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd ? NaN : !xd || !yd ? y.s / 0 : y.s * 0); + } + e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE); + xdL = xd.length; + ydL = yd.length; + if (xdL < ydL) { + r = xd; + xd = yd; + yd = r; + rL = xdL; + xdL = ydL; + ydL = rL; + } + r = []; + rL = xdL + ydL; + for (i = rL; i--; ) + r.push(0); + for (i = ydL; --i >= 0; ) { + carry = 0; + for (k = xdL + i; k > i; ) { + t = r[k] + yd[i] * xd[k - i - 1] + carry; + r[k--] = t % BASE | 0; + carry = t / BASE | 0; + } + r[k] = (r[k] + carry) % BASE | 0; + } + for (; !r[--rL]; ) + r.pop(); + if (carry) + ++e; + else + r.shift(); + y.d = r; + y.e = getBase10Exponent(r, e); + return external ? finalise(y, Ctor.precision, Ctor.rounding) : y; +}; +P.toBinary = function(sd, rm) { + return toStringBinary(this, 2, sd, rm); +}; +P.toDecimalPlaces = P.toDP = function(dp, rm) { + var x = this, Ctor = x.constructor; + x = new Ctor(x); + if (dp === void 0) + return x; + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + return finalise(x, dp + x.e + 1, rm); +}; +P.toExponential = function(dp, rm) { + var str, x = this, Ctor = x.constructor; + if (dp === void 0) { + str = finiteToString(x, true); + } else { + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + x = finalise(new Ctor(x), dp + 1, rm); + str = finiteToString(x, true, dp + 1); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toFixed = function(dp, rm) { + var str, y, x = this, Ctor = x.constructor; + if (dp === void 0) { + str = finiteToString(x); + } else { + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + y = finalise(new Ctor(x), dp + x.e + 1, rm); + str = finiteToString(y, false, dp + y.e + 1); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toFraction = function(maxD) { + var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r, x = this, xd = x.d, Ctor = x.constructor; + if (!xd) + return new Ctor(x); + n1 = d0 = new Ctor(1); + d1 = n0 = new Ctor(0); + d = new Ctor(d1); + e = d.e = getPrecision(xd) - x.e - 1; + k = e % LOG_BASE; + d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k); + if (maxD == null) { + maxD = e > 0 ? d : n1; + } else { + n = new Ctor(maxD); + if (!n.isInt() || n.lt(n1)) + throw Error(invalidArgument + n); + maxD = n.gt(d) ? e > 0 ? d : n1 : n; + } + external = false; + n = new Ctor(digitsToString(xd)); + pr = Ctor.precision; + Ctor.precision = e = xd.length * LOG_BASE * 2; + for (; ; ) { + q = divide(n, d, 0, 1, 1); + d2 = d0.plus(q.times(d1)); + if (d2.cmp(maxD) == 1) + break; + d0 = d1; + d1 = d2; + d2 = n1; + n1 = n0.plus(q.times(d2)); + n0 = d2; + d2 = d; + d = n.minus(q.times(d2)); + n = d2; + } + d2 = divide(maxD.minus(d0), d1, 0, 1, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; + Ctor.precision = pr; + external = true; + return r; +}; +P.toHexadecimal = P.toHex = function(sd, rm) { + return toStringBinary(this, 16, sd, rm); +}; +P.toNearest = function(y, rm) { + var x = this, Ctor = x.constructor; + x = new Ctor(x); + if (y == null) { + if (!x.d) + return x; + y = new Ctor(1); + rm = Ctor.rounding; + } else { + y = new Ctor(y); + if (rm === void 0) { + rm = Ctor.rounding; + } else { + checkInt32(rm, 0, 8); + } + if (!x.d) + return y.s ? x : y; + if (!y.d) { + if (y.s) + y.s = x.s; + return y; + } + } + if (y.d[0]) { + external = false; + x = divide(x, y, 0, rm, 1).times(y); + external = true; + finalise(x); + } else { + y.s = x.s; + x = y; + } + return x; +}; +P.toNumber = function() { + return +this; +}; +P.toOctal = function(sd, rm) { + return toStringBinary(this, 8, sd, rm); +}; +P.toPower = P.pow = function(y) { + var e, k, pr, r, rm, s, x = this, Ctor = x.constructor, yn = +(y = new Ctor(y)); + if (!x.d || !y.d || !x.d[0] || !y.d[0]) + return new Ctor(mathpow(+x, yn)); + x = new Ctor(x); + if (x.eq(1)) + return x; + pr = Ctor.precision; + rm = Ctor.rounding; + if (y.eq(1)) + return finalise(x, pr, rm); + e = mathfloor(y.e / LOG_BASE); + if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) { + r = intPow(Ctor, x, k, pr); + return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm); + } + s = x.s; + if (s < 0) { + if (e < y.d.length - 1) + return new Ctor(NaN); + if ((y.d[e] & 1) == 0) + s = 1; + if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) { + x.s = s; + return x; + } + } + k = mathpow(+x, yn); + e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log("0." + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + "").e; + if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) + return new Ctor(e > 0 ? s / 0 : 0); + external = false; + Ctor.rounding = x.s = 1; + k = Math.min(12, (e + "").length); + r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr); + if (r.d) { + r = finalise(r, pr + 5, 1); + if (checkRoundingDigits(r.d, pr, rm)) { + e = pr + 10; + r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1); + if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + } + } + r.s = s; + external = true; + Ctor.rounding = rm; + return finalise(r, pr, rm); +}; +P.toPrecision = function(sd, rm) { + var str, x = this, Ctor = x.constructor; + if (sd === void 0) { + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + } else { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + x = finalise(new Ctor(x), sd, rm); + str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toSignificantDigits = P.toSD = function(sd, rm) { + var x = this, Ctor = x.constructor; + if (sd === void 0) { + sd = Ctor.precision; + rm = Ctor.rounding; + } else { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + } + return finalise(new Ctor(x), sd, rm); +}; +P.toString = function() { + var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.truncated = P.trunc = function() { + return finalise(new this.constructor(this), this.e + 1, 1); +}; +P.valueOf = P.toJSON = function() { + var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + return x.isNeg() ? "-" + str : str; +}; +function digitsToString(d) { + var i, k, ws, indexOfLastWord = d.length - 1, str = "", w = d[0]; + if (indexOfLastWord > 0) { + str += w; + for (i = 1; i < indexOfLastWord; i++) { + ws = d[i] + ""; + k = LOG_BASE - ws.length; + if (k) + str += getZeroString(k); + str += ws; + } + w = d[i]; + ws = w + ""; + k = LOG_BASE - ws.length; + if (k) + str += getZeroString(k); + } else if (w === 0) { + return "0"; + } + for (; w % 10 === 0; ) + w /= 10; + return str + w; +} +__name(digitsToString, "digitsToString"); +function checkInt32(i, min2, max2) { + if (i !== ~~i || i < min2 || i > max2) { + throw Error(invalidArgument + i); + } +} +__name(checkInt32, "checkInt32"); +function checkRoundingDigits(d, i, rm, repeating) { + var di, k, r, rd; + for (k = d[0]; k >= 10; k /= 10) + --i; + if (--i < 0) { + i += LOG_BASE; + di = 0; + } else { + di = Math.ceil((i + 1) / LOG_BASE); + i %= LOG_BASE; + } + k = mathpow(10, LOG_BASE - i); + rd = d[di] % k | 0; + if (repeating == null) { + if (i < 3) { + if (i == 0) + rd = rd / 100 | 0; + else if (i == 1) + rd = rd / 10 | 0; + r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 5e4 || rd == 0; + } else { + r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0; + } + } else { + if (i < 4) { + if (i == 0) + rd = rd / 1e3 | 0; + else if (i == 1) + rd = rd / 100 | 0; + else if (i == 2) + rd = rd / 10 | 0; + r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999; + } else { + r = ((repeating || rm < 4) && rd + 1 == k || !repeating && rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 1e3 | 0) == mathpow(10, i - 3) - 1; + } + } + return r; +} +__name(checkRoundingDigits, "checkRoundingDigits"); +function convertBase(str, baseIn, baseOut) { + var j, arr = [0], arrL, i = 0, strL = str.length; + for (; i < strL; ) { + for (arrL = arr.length; arrL--; ) + arr[arrL] *= baseIn; + arr[0] += NUMERALS.indexOf(str.charAt(i++)); + for (j = 0; j < arr.length; j++) { + if (arr[j] > baseOut - 1) { + if (arr[j + 1] === void 0) + arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + return arr.reverse(); +} +__name(convertBase, "convertBase"); +function cosine(Ctor, x) { + var k, len, y; + if (x.isZero()) + return x; + len = x.d.length; + if (len < 32) { + k = Math.ceil(len / 3); + y = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + y = "2.3283064365386962890625e-10"; + } + Ctor.precision += k; + x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1)); + for (var i = k; i--; ) { + var cos2x = x.times(x); + x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1); + } + Ctor.precision -= k; + return x; +} +__name(cosine, "cosine"); +var divide = function() { + function multiplyInteger(x, k, base) { + var temp, carry = 0, i = x.length; + for (x = x.slice(); i--; ) { + temp = x[i] * k + carry; + x[i] = temp % base | 0; + carry = temp / base | 0; + } + if (carry) + x.unshift(carry); + return x; + } + __name(multiplyInteger, "multiplyInteger"); + function compare(a, b, aL, bL) { + var i, r; + if (aL != bL) { + r = aL > bL ? 1 : -1; + } else { + for (i = r = 0; i < aL; i++) { + if (a[i] != b[i]) { + r = a[i] > b[i] ? 1 : -1; + break; + } + } + } + return r; + } + __name(compare, "compare"); + function subtract(a, b, aL, base) { + var i = 0; + for (; aL--; ) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + for (; !a[0] && a.length > 1; ) + a.shift(); + } + __name(subtract, "subtract"); + return function(x, y, pr, rm, dp, base) { + var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz, Ctor = x.constructor, sign2 = x.s == y.s ? 1 : -1, xd = x.d, yd = y.d; + if (!xd || !xd[0] || !yd || !yd[0]) { + return new Ctor( + !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN : xd && xd[0] == 0 || !yd ? sign2 * 0 : sign2 / 0 + ); + } + if (base) { + logBase = 1; + e = x.e - y.e; + } else { + base = BASE; + logBase = LOG_BASE; + e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase); + } + yL = yd.length; + xL = xd.length; + q = new Ctor(sign2); + qd = q.d = []; + for (i = 0; yd[i] == (xd[i] || 0); i++) + ; + if (yd[i] > (xd[i] || 0)) + e--; + if (pr == null) { + sd = pr = Ctor.precision; + rm = Ctor.rounding; + } else if (dp) { + sd = pr + (x.e - y.e) + 1; + } else { + sd = pr; + } + if (sd < 0) { + qd.push(1); + more = true; + } else { + sd = sd / logBase + 2 | 0; + i = 0; + if (yL == 1) { + k = 0; + yd = yd[0]; + sd++; + for (; (i < xL || k) && sd--; i++) { + t = k * base + (xd[i] || 0); + qd[i] = t / yd | 0; + k = t % yd | 0; + } + more = k || i < xL; + } else { + k = base / (yd[0] + 1) | 0; + if (k > 1) { + yd = multiplyInteger(yd, k, base); + xd = multiplyInteger(xd, k, base); + yL = yd.length; + xL = xd.length; + } + xi = yL; + rem = xd.slice(0, yL); + remL = rem.length; + for (; remL < yL; ) + rem[remL++] = 0; + yz = yd.slice(); + yz.unshift(0); + yd0 = yd[0]; + if (yd[1] >= base / 2) + ++yd0; + do { + k = 0; + cmp = compare(yd, rem, yL, remL); + if (cmp < 0) { + rem0 = rem[0]; + if (yL != remL) + rem0 = rem0 * base + (rem[1] || 0); + k = rem0 / yd0 | 0; + if (k > 1) { + if (k >= base) + k = base - 1; + prod = multiplyInteger(yd, k, base); + prodL = prod.length; + remL = rem.length; + cmp = compare(prod, rem, prodL, remL); + if (cmp == 1) { + k--; + subtract(prod, yL < prodL ? yz : yd, prodL, base); + } + } else { + if (k == 0) + cmp = k = 1; + prod = yd.slice(); + } + prodL = prod.length; + if (prodL < remL) + prod.unshift(0); + subtract(rem, prod, remL, base); + if (cmp == -1) { + remL = rem.length; + cmp = compare(yd, rem, yL, remL); + if (cmp < 1) { + k++; + subtract(rem, yL < remL ? yz : yd, remL, base); + } + } + remL = rem.length; + } else if (cmp === 0) { + k++; + rem = [0]; + } + qd[i++] = k; + if (cmp && rem[0]) { + rem[remL++] = xd[xi] || 0; + } else { + rem = [xd[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] !== void 0) && sd--); + more = rem[0] !== void 0; + } + if (!qd[0]) + qd.shift(); + } + if (logBase == 1) { + q.e = e; + inexact = more; + } else { + for (i = 1, k = qd[0]; k >= 10; k /= 10) + i++; + q.e = i + e * logBase - 1; + finalise(q, dp ? pr + q.e + 1 : pr, rm, more); + } + return q; + }; +}(); +function finalise(x, sd, rm, isTruncated) { + var digits, i, j, k, rd, roundUp, w, xd, xdi, Ctor = x.constructor; + out: + if (sd != null) { + xd = x.d; + if (!xd) + return x; + for (digits = 1, k = xd[0]; k >= 10; k /= 10) + digits++; + i = sd - digits; + if (i < 0) { + i += LOG_BASE; + j = sd; + w = xd[xdi = 0]; + rd = w / mathpow(10, digits - j - 1) % 10 | 0; + } else { + xdi = Math.ceil((i + 1) / LOG_BASE); + k = xd.length; + if (xdi >= k) { + if (isTruncated) { + for (; k++ <= xdi; ) + xd.push(0); + w = rd = 0; + digits = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + w = k = xd[xdi]; + for (digits = 1; k >= 10; k /= 10) + digits++; + i %= LOG_BASE; + j = i - LOG_BASE + digits; + rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0; + } + } + isTruncated = isTruncated || sd < 0 || xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1)); + roundUp = rm < 4 ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && (i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7)); + if (sd < 1 || !xd[0]) { + xd.length = 0; + if (roundUp) { + sd -= x.e + 1; + xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE); + x.e = -sd || 0; + } else { + xd[0] = x.e = 0; + } + return x; + } + if (i == 0) { + xd.length = xdi; + k = 1; + xdi--; + } else { + xd.length = xdi + 1; + k = mathpow(10, LOG_BASE - i); + xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0; + } + if (roundUp) { + for (; ; ) { + if (xdi == 0) { + for (i = 1, j = xd[0]; j >= 10; j /= 10) + i++; + j = xd[0] += k; + for (k = 1; j >= 10; j /= 10) + k++; + if (i != k) { + x.e++; + if (xd[0] == BASE) + xd[0] = 1; + } + break; + } else { + xd[xdi] += k; + if (xd[xdi] != BASE) + break; + xd[xdi--] = 0; + k = 1; + } + } + } + for (i = xd.length; xd[--i] === 0; ) + xd.pop(); + } + if (external) { + if (x.e > Ctor.maxE) { + x.d = null; + x.e = NaN; + } else if (x.e < Ctor.minE) { + x.e = 0; + x.d = [0]; + } + } + return x; +} +__name(finalise, "finalise"); +function finiteToString(x, isExp, sd) { + if (!x.isFinite()) + return nonFiniteToString(x); + var k, e = x.e, str = digitsToString(x.d), len = str.length; + if (isExp) { + if (sd && (k = sd - len) > 0) { + str = str.charAt(0) + "." + str.slice(1) + getZeroString(k); + } else if (len > 1) { + str = str.charAt(0) + "." + str.slice(1); + } + str = str + (x.e < 0 ? "e" : "e+") + x.e; + } else if (e < 0) { + str = "0." + getZeroString(-e - 1) + str; + if (sd && (k = sd - len) > 0) + str += getZeroString(k); + } else if (e >= len) { + str += getZeroString(e + 1 - len); + if (sd && (k = sd - e - 1) > 0) + str = str + "." + getZeroString(k); + } else { + if ((k = e + 1) < len) + str = str.slice(0, k) + "." + str.slice(k); + if (sd && (k = sd - len) > 0) { + if (e + 1 === len) + str += "."; + str += getZeroString(k); + } + } + return str; +} +__name(finiteToString, "finiteToString"); +function getBase10Exponent(digits, e) { + var w = digits[0]; + for (e *= LOG_BASE; w >= 10; w /= 10) + e++; + return e; +} +__name(getBase10Exponent, "getBase10Exponent"); +function getLn10(Ctor, sd, pr) { + if (sd > LN10_PRECISION) { + external = true; + if (pr) + Ctor.precision = pr; + throw Error(precisionLimitExceeded); + } + return finalise(new Ctor(LN10), sd, 1, true); +} +__name(getLn10, "getLn10"); +function getPi(Ctor, sd, rm) { + if (sd > PI_PRECISION) + throw Error(precisionLimitExceeded); + return finalise(new Ctor(PI), sd, rm, true); +} +__name(getPi, "getPi"); +function getPrecision(digits) { + var w = digits.length - 1, len = w * LOG_BASE + 1; + w = digits[w]; + if (w) { + for (; w % 10 == 0; w /= 10) + len--; + for (w = digits[0]; w >= 10; w /= 10) + len++; + } + return len; +} +__name(getPrecision, "getPrecision"); +function getZeroString(k) { + var zs = ""; + for (; k--; ) + zs += "0"; + return zs; +} +__name(getZeroString, "getZeroString"); +function intPow(Ctor, x, n, pr) { + var isTruncated, r = new Ctor(1), k = Math.ceil(pr / LOG_BASE + 4); + external = false; + for (; ; ) { + if (n % 2) { + r = r.times(x); + if (truncate(r.d, k)) + isTruncated = true; + } + n = mathfloor(n / 2); + if (n === 0) { + n = r.d.length - 1; + if (isTruncated && r.d[n] === 0) + ++r.d[n]; + break; + } + x = x.times(x); + truncate(x.d, k); + } + external = true; + return r; +} +__name(intPow, "intPow"); +function isOdd(n) { + return n.d[n.d.length - 1] & 1; +} +__name(isOdd, "isOdd"); +function maxOrMin(Ctor, args, ltgt) { + var y, x = new Ctor(args[0]), i = 0; + for (; ++i < args.length; ) { + y = new Ctor(args[i]); + if (!y.s) { + x = y; + break; + } else if (x[ltgt](y)) { + x = y; + } + } + return x; +} +__name(maxOrMin, "maxOrMin"); +function naturalExponential(x, sd) { + var denominator, guard, j, pow2, sum2, t, wpr, rep = 0, i = 0, k = 0, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; + if (!x.d || !x.d[0] || x.e > 17) { + return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : 0 / 0); + } + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + t = new Ctor(0.03125); + while (x.e > -2) { + x = x.times(t); + k += 5; + } + guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0; + wpr += guard; + denominator = pow2 = sum2 = new Ctor(1); + Ctor.precision = wpr; + for (; ; ) { + pow2 = finalise(pow2.times(x), wpr, 1); + denominator = denominator.times(++i); + t = sum2.plus(divide(pow2, denominator, wpr, 1)); + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) { + j = k; + while (j--) + sum2 = finalise(sum2.times(sum2), wpr, 1); + if (sd == null) { + if (rep < 3 && checkRoundingDigits(sum2.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += 10; + denominator = pow2 = t = new Ctor(1); + i = 0; + rep++; + } else { + return finalise(sum2, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum2; + } + } + sum2 = t; + } +} +__name(naturalExponential, "naturalExponential"); +function naturalLogarithm(y, sd) { + var c, c0, denominator, e, numerator, rep, sum2, t, wpr, x1, x2, n = 1, guard = 10, x = y, xd = x.d, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; + if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) { + return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x); + } + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + Ctor.precision = wpr += guard; + c = digitsToString(xd); + c0 = c.charAt(0); + if (Math.abs(e = x.e) < 15e14) { + while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) { + x = x.times(y); + c = digitsToString(x.d); + c0 = c.charAt(0); + n++; + } + e = x.e; + if (c0 > 1) { + x = new Ctor("0." + c); + e++; + } else { + x = new Ctor(c0 + "." + c.slice(1)); + } + } else { + t = getLn10(Ctor, wpr + 2, pr).times(e + ""); + x = naturalLogarithm(new Ctor(c0 + "." + c.slice(1)), wpr - guard).plus(t); + Ctor.precision = pr; + return sd == null ? finalise(x, pr, rm, external = true) : x; + } + x1 = x; + sum2 = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = 3; + for (; ; ) { + numerator = finalise(numerator.times(x2), wpr, 1); + t = sum2.plus(divide(numerator, new Ctor(denominator), wpr, 1)); + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) { + sum2 = sum2.times(2); + if (e !== 0) + sum2 = sum2.plus(getLn10(Ctor, wpr + 2, pr).times(e + "")); + sum2 = divide(sum2, new Ctor(n), wpr, 1); + if (sd == null) { + if (checkRoundingDigits(sum2.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += guard; + t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = rep = 1; + } else { + return finalise(sum2, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum2; + } + } + sum2 = t; + denominator += 2; + } +} +__name(naturalLogarithm, "naturalLogarithm"); +function nonFiniteToString(x) { + return String(x.s * x.s / 0); +} +__name(nonFiniteToString, "nonFiniteToString"); +function parseDecimal(x, str) { + var e, i, len; + if ((e = str.indexOf(".")) > -1) + str = str.replace(".", ""); + if ((i = str.search(/e/i)) > 0) { + if (e < 0) + e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + e = str.length; + } + for (i = 0; str.charCodeAt(i) === 48; i++) + ; + for (len = str.length; str.charCodeAt(len - 1) === 48; --len) + ; + str = str.slice(i, len); + if (str) { + len -= i; + x.e = e = e - i - 1; + x.d = []; + i = (e + 1) % LOG_BASE; + if (e < 0) + i += LOG_BASE; + if (i < len) { + if (i) + x.d.push(+str.slice(0, i)); + for (len -= LOG_BASE; i < len; ) + x.d.push(+str.slice(i, i += LOG_BASE)); + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + for (; i--; ) + str += "0"; + x.d.push(+str); + if (external) { + if (x.e > x.constructor.maxE) { + x.d = null; + x.e = NaN; + } else if (x.e < x.constructor.minE) { + x.e = 0; + x.d = [0]; + } + } + } else { + x.e = 0; + x.d = [0]; + } + return x; +} +__name(parseDecimal, "parseDecimal"); +function parseOther(x, str) { + var base, Ctor, divisor, i, isFloat, len, p, xd, xe; + if (str.indexOf("_") > -1) { + str = str.replace(/(\d)_(?=\d)/g, "$1"); + if (isDecimal.test(str)) + return parseDecimal(x, str); + } else if (str === "Infinity" || str === "NaN") { + if (!+str) + x.s = NaN; + x.e = NaN; + x.d = null; + return x; + } + if (isHex.test(str)) { + base = 16; + str = str.toLowerCase(); + } else if (isBinary.test(str)) { + base = 2; + } else if (isOctal.test(str)) { + base = 8; + } else { + throw Error(invalidArgument + str); + } + i = str.search(/p/i); + if (i > 0) { + p = +str.slice(i + 1); + str = str.substring(2, i); + } else { + str = str.slice(2); + } + i = str.indexOf("."); + isFloat = i >= 0; + Ctor = x.constructor; + if (isFloat) { + str = str.replace(".", ""); + len = str.length; + i = len - i; + divisor = intPow(Ctor, new Ctor(base), i, i * 2); + } + xd = convertBase(str, base, BASE); + xe = xd.length - 1; + for (i = xe; xd[i] === 0; --i) + xd.pop(); + if (i < 0) + return new Ctor(x.s * 0); + x.e = getBase10Exponent(xd, xe); + x.d = xd; + external = false; + if (isFloat) + x = divide(x, divisor, len * 4); + if (p) + x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p)); + external = true; + return x; +} +__name(parseOther, "parseOther"); +function sine(Ctor, x) { + var k, len = x.d.length; + if (len < 3) { + return x.isZero() ? x : taylorSeries(Ctor, 2, x, x); + } + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x); + var sin2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); + for (; k--; ) { + sin2_x = x.times(x); + x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20)))); + } + return x; +} +__name(sine, "sine"); +function taylorSeries(Ctor, n, x, y, isHyperbolic) { + var j, t, u, x2, i = 1, pr = Ctor.precision, k = Math.ceil(pr / LOG_BASE); + external = false; + x2 = x.times(x); + u = new Ctor(y); + for (; ; ) { + t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1); + u = isHyperbolic ? y.plus(t) : y.minus(t); + y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1); + t = u.plus(y); + if (t.d[k] !== void 0) { + for (j = k; t.d[j] === u.d[j] && j--; ) + ; + if (j == -1) + break; + } + j = u; + u = y; + y = t; + t = j; + i++; + } + external = true; + t.d.length = k + 1; + return t; +} +__name(taylorSeries, "taylorSeries"); +function tinyPow(b, e) { + var n = b; + while (--e) + n *= b; + return n; +} +__name(tinyPow, "tinyPow"); +function toLessThanHalfPi(Ctor, x) { + var t, isNeg = x.s < 0, pi = getPi(Ctor, Ctor.precision, 1), halfPi = pi.times(0.5); + x = x.abs(); + if (x.lte(halfPi)) { + quadrant = isNeg ? 4 : 1; + return x; + } + t = x.divToInt(pi); + if (t.isZero()) { + quadrant = isNeg ? 3 : 2; + } else { + x = x.minus(t.times(pi)); + if (x.lte(halfPi)) { + quadrant = isOdd(t) ? isNeg ? 2 : 3 : isNeg ? 4 : 1; + return x; + } + quadrant = isOdd(t) ? isNeg ? 1 : 4 : isNeg ? 3 : 2; + } + return x.minus(pi).abs(); +} +__name(toLessThanHalfPi, "toLessThanHalfPi"); +function toStringBinary(x, baseOut, sd, rm) { + var base, e, i, k, len, roundUp, str, xd, y, Ctor = x.constructor, isExp = sd !== void 0; + if (isExp) { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + } else { + sd = Ctor.precision; + rm = Ctor.rounding; + } + if (!x.isFinite()) { + str = nonFiniteToString(x); + } else { + str = finiteToString(x); + i = str.indexOf("."); + if (isExp) { + base = 2; + if (baseOut == 16) { + sd = sd * 4 - 3; + } else if (baseOut == 8) { + sd = sd * 3 - 2; + } + } else { + base = baseOut; + } + if (i >= 0) { + str = str.replace(".", ""); + y = new Ctor(1); + y.e = str.length - i; + y.d = convertBase(finiteToString(y), 10, base); + y.e = y.d.length; + } + xd = convertBase(str, 10, base); + e = len = xd.length; + for (; xd[--len] == 0; ) + xd.pop(); + if (!xd[0]) { + str = isExp ? "0p+0" : "0"; + } else { + if (i < 0) { + e--; + } else { + x = new Ctor(x); + x.d = xd; + x.e = e; + x = divide(x, y, sd, rm, 0, base); + xd = x.d; + e = x.e; + roundUp = inexact; + } + i = xd[sd]; + k = base / 2; + roundUp = roundUp || xd[sd + 1] !== void 0; + roundUp = rm < 4 ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 || rm === (x.s < 0 ? 8 : 7)); + xd.length = sd; + if (roundUp) { + for (; ++xd[--sd] > base - 1; ) { + xd[sd] = 0; + if (!sd) { + ++e; + xd.unshift(1); + } + } + } + for (len = xd.length; !xd[len - 1]; --len) + ; + for (i = 0, str = ""; i < len; i++) + str += NUMERALS.charAt(xd[i]); + if (isExp) { + if (len > 1) { + if (baseOut == 16 || baseOut == 8) { + i = baseOut == 16 ? 4 : 3; + for (--len; len % i; len++) + str += "0"; + xd = convertBase(str, base, baseOut); + for (len = xd.length; !xd[len - 1]; --len) + ; + for (i = 1, str = "1."; i < len; i++) + str += NUMERALS.charAt(xd[i]); + } else { + str = str.charAt(0) + "." + str.slice(1); + } + } + str = str + (e < 0 ? "p" : "p+") + e; + } else if (e < 0) { + for (; ++e; ) + str = "0" + str; + str = "0." + str; + } else { + if (++e > len) + for (e -= len; e--; ) + str += "0"; + else if (e < len) + str = str.slice(0, e) + "." + str.slice(e); + } + } + str = (baseOut == 16 ? "0x" : baseOut == 2 ? "0b" : baseOut == 8 ? "0o" : "") + str; + } + return x.s < 0 ? "-" + str : str; +} +__name(toStringBinary, "toStringBinary"); +function truncate(arr, len) { + if (arr.length > len) { + arr.length = len; + return true; + } +} +__name(truncate, "truncate"); +function abs(x) { + return new this(x).abs(); +} +__name(abs, "abs"); +function acos(x) { + return new this(x).acos(); +} +__name(acos, "acos"); +function acosh(x) { + return new this(x).acosh(); +} +__name(acosh, "acosh"); +function add(x, y) { + return new this(x).plus(y); +} +__name(add, "add"); +function asin(x) { + return new this(x).asin(); +} +__name(asin, "asin"); +function asinh(x) { + return new this(x).asinh(); +} +__name(asinh, "asinh"); +function atan(x) { + return new this(x).atan(); +} +__name(atan, "atan"); +function atanh(x) { + return new this(x).atanh(); +} +__name(atanh, "atanh"); +function atan2(y, x) { + y = new this(y); + x = new this(x); + var r, pr = this.precision, rm = this.rounding, wpr = pr + 4; + if (!y.s || !x.s) { + r = new this(NaN); + } else if (!y.d && !x.d) { + r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75); + r.s = y.s; + } else if (!x.d || y.isZero()) { + r = x.s < 0 ? getPi(this, pr, rm) : new this(0); + r.s = y.s; + } else if (!y.d || x.isZero()) { + r = getPi(this, wpr, 1).times(0.5); + r.s = y.s; + } else if (x.s < 0) { + this.precision = wpr; + this.rounding = 1; + r = this.atan(divide(y, x, wpr, 1)); + x = getPi(this, wpr, 1); + this.precision = pr; + this.rounding = rm; + r = y.s < 0 ? r.minus(x) : r.plus(x); + } else { + r = this.atan(divide(y, x, wpr, 1)); + } + return r; +} +__name(atan2, "atan2"); +function cbrt(x) { + return new this(x).cbrt(); +} +__name(cbrt, "cbrt"); +function ceil(x) { + return finalise(x = new this(x), x.e + 1, 2); +} +__name(ceil, "ceil"); +function clamp(x, min2, max2) { + return new this(x).clamp(min2, max2); +} +__name(clamp, "clamp"); +function config(obj) { + if (!obj || typeof obj !== "object") + throw Error(decimalError + "Object expected"); + var i, p, v, useDefaults = obj.defaults === true, ps = [ + "precision", + 1, + MAX_DIGITS, + "rounding", + 0, + 8, + "toExpNeg", + -EXP_LIMIT, + 0, + "toExpPos", + 0, + EXP_LIMIT, + "maxE", + 0, + EXP_LIMIT, + "minE", + -EXP_LIMIT, + 0, + "modulo", + 0, + 9 + ]; + for (i = 0; i < ps.length; i += 3) { + if (p = ps[i], useDefaults) + this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) + this[p] = v; + else + throw Error(invalidArgument + p + ": " + v); + } + } + if (p = "crypto", useDefaults) + this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (v === true || v === false || v === 0 || v === 1) { + if (v) { + if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) { + this[p] = true; + } else { + throw Error(cryptoUnavailable); + } + } else { + this[p] = false; + } + } else { + throw Error(invalidArgument + p + ": " + v); + } + } + return this; +} +__name(config, "config"); +function cos(x) { + return new this(x).cos(); +} +__name(cos, "cos"); +function cosh(x) { + return new this(x).cosh(); +} +__name(cosh, "cosh"); +function clone(obj) { + var i, p, ps; + function Decimal2(v) { + var e, i2, t, x = this; + if (!(x instanceof Decimal2)) + return new Decimal2(v); + x.constructor = Decimal2; + if (isDecimalInstance(v)) { + x.s = v.s; + if (external) { + if (!v.d || v.e > Decimal2.maxE) { + x.e = NaN; + x.d = null; + } else if (v.e < Decimal2.minE) { + x.e = 0; + x.d = [0]; + } else { + x.e = v.e; + x.d = v.d.slice(); + } + } else { + x.e = v.e; + x.d = v.d ? v.d.slice() : v.d; + } + return; + } + t = typeof v; + if (t === "number") { + if (v === 0) { + x.s = 1 / v < 0 ? -1 : 1; + x.e = 0; + x.d = [0]; + return; + } + if (v < 0) { + v = -v; + x.s = -1; + } else { + x.s = 1; + } + if (v === ~~v && v < 1e7) { + for (e = 0, i2 = v; i2 >= 10; i2 /= 10) + e++; + if (external) { + if (e > Decimal2.maxE) { + x.e = NaN; + x.d = null; + } else if (e < Decimal2.minE) { + x.e = 0; + x.d = [0]; + } else { + x.e = e; + x.d = [v]; + } + } else { + x.e = e; + x.d = [v]; + } + return; + } else if (v * 0 !== 0) { + if (!v) + x.s = NaN; + x.e = NaN; + x.d = null; + return; + } + return parseDecimal(x, v.toString()); + } else if (t !== "string") { + throw Error(invalidArgument + v); + } + if ((i2 = v.charCodeAt(0)) === 45) { + v = v.slice(1); + x.s = -1; + } else { + if (i2 === 43) + v = v.slice(1); + x.s = 1; + } + return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v); + } + __name(Decimal2, "Decimal"); + Decimal2.prototype = P; + Decimal2.ROUND_UP = 0; + Decimal2.ROUND_DOWN = 1; + Decimal2.ROUND_CEIL = 2; + Decimal2.ROUND_FLOOR = 3; + Decimal2.ROUND_HALF_UP = 4; + Decimal2.ROUND_HALF_DOWN = 5; + Decimal2.ROUND_HALF_EVEN = 6; + Decimal2.ROUND_HALF_CEIL = 7; + Decimal2.ROUND_HALF_FLOOR = 8; + Decimal2.EUCLID = 9; + Decimal2.config = Decimal2.set = config; + Decimal2.clone = clone; + Decimal2.isDecimal = isDecimalInstance; + Decimal2.abs = abs; + Decimal2.acos = acos; + Decimal2.acosh = acosh; + Decimal2.add = add; + Decimal2.asin = asin; + Decimal2.asinh = asinh; + Decimal2.atan = atan; + Decimal2.atanh = atanh; + Decimal2.atan2 = atan2; + Decimal2.cbrt = cbrt; + Decimal2.ceil = ceil; + Decimal2.clamp = clamp; + Decimal2.cos = cos; + Decimal2.cosh = cosh; + Decimal2.div = div; + Decimal2.exp = exp; + Decimal2.floor = floor; + Decimal2.hypot = hypot; + Decimal2.ln = ln; + Decimal2.log = log; + Decimal2.log10 = log10; + Decimal2.log2 = log2; + Decimal2.max = max; + Decimal2.min = min; + Decimal2.mod = mod; + Decimal2.mul = mul; + Decimal2.pow = pow; + Decimal2.random = random; + Decimal2.round = round; + Decimal2.sign = sign; + Decimal2.sin = sin; + Decimal2.sinh = sinh; + Decimal2.sqrt = sqrt; + Decimal2.sub = sub; + Decimal2.sum = sum; + Decimal2.tan = tan; + Decimal2.tanh = tanh; + Decimal2.trunc = trunc; + if (obj === void 0) + obj = {}; + if (obj) { + if (obj.defaults !== true) { + ps = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"]; + for (i = 0; i < ps.length; ) + if (!obj.hasOwnProperty(p = ps[i++])) + obj[p] = this[p]; + } + } + Decimal2.config(obj); + return Decimal2; +} +__name(clone, "clone"); +function div(x, y) { + return new this(x).div(y); +} +__name(div, "div"); +function exp(x) { + return new this(x).exp(); +} +__name(exp, "exp"); +function floor(x) { + return finalise(x = new this(x), x.e + 1, 3); +} +__name(floor, "floor"); +function hypot() { + var i, n, t = new this(0); + external = false; + for (i = 0; i < arguments.length; ) { + n = new this(arguments[i++]); + if (!n.d) { + if (n.s) { + external = true; + return new this(1 / 0); + } + t = n; + } else if (t.d) { + t = t.plus(n.times(n)); + } + } + external = true; + return t.sqrt(); +} +__name(hypot, "hypot"); +function isDecimalInstance(obj) { + return obj instanceof Decimal || obj && obj.toStringTag === tag || false; +} +__name(isDecimalInstance, "isDecimalInstance"); +function ln(x) { + return new this(x).ln(); +} +__name(ln, "ln"); +function log(x, y) { + return new this(x).log(y); +} +__name(log, "log"); +function log2(x) { + return new this(x).log(2); +} +__name(log2, "log2"); +function log10(x) { + return new this(x).log(10); +} +__name(log10, "log10"); +function max() { + return maxOrMin(this, arguments, "lt"); +} +__name(max, "max"); +function min() { + return maxOrMin(this, arguments, "gt"); +} +__name(min, "min"); +function mod(x, y) { + return new this(x).mod(y); +} +__name(mod, "mod"); +function mul(x, y) { + return new this(x).mul(y); +} +__name(mul, "mul"); +function pow(x, y) { + return new this(x).pow(y); +} +__name(pow, "pow"); +function random(sd) { + var d, e, k, n, i = 0, r = new this(1), rd = []; + if (sd === void 0) + sd = this.precision; + else + checkInt32(sd, 1, MAX_DIGITS); + k = Math.ceil(sd / LOG_BASE); + if (!this.crypto) { + for (; i < k; ) + rd[i++] = Math.random() * 1e7 | 0; + } else if (crypto.getRandomValues) { + d = crypto.getRandomValues(new Uint32Array(k)); + for (; i < k; ) { + n = d[i]; + if (n >= 429e7) { + d[i] = crypto.getRandomValues(new Uint32Array(1))[0]; + } else { + rd[i++] = n % 1e7; + } + } + } else if (crypto.randomBytes) { + d = crypto.randomBytes(k *= 4); + for (; i < k; ) { + n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 127) << 24); + if (n >= 214e7) { + crypto.randomBytes(4).copy(d, i); + } else { + rd.push(n % 1e7); + i += 4; + } + } + i = k / 4; + } else { + throw Error(cryptoUnavailable); + } + k = rd[--i]; + sd %= LOG_BASE; + if (k && sd) { + n = mathpow(10, LOG_BASE - sd); + rd[i] = (k / n | 0) * n; + } + for (; rd[i] === 0; i--) + rd.pop(); + if (i < 0) { + e = 0; + rd = [0]; + } else { + e = -1; + for (; rd[0] === 0; e -= LOG_BASE) + rd.shift(); + for (k = 1, n = rd[0]; n >= 10; n /= 10) + k++; + if (k < LOG_BASE) + e -= LOG_BASE - k; + } + r.e = e; + r.d = rd; + return r; +} +__name(random, "random"); +function round(x) { + return finalise(x = new this(x), x.e + 1, this.rounding); +} +__name(round, "round"); +function sign(x) { + x = new this(x); + return x.d ? x.d[0] ? x.s : 0 * x.s : x.s || NaN; +} +__name(sign, "sign"); +function sin(x) { + return new this(x).sin(); +} +__name(sin, "sin"); +function sinh(x) { + return new this(x).sinh(); +} +__name(sinh, "sinh"); +function sqrt(x) { + return new this(x).sqrt(); +} +__name(sqrt, "sqrt"); +function sub(x, y) { + return new this(x).sub(y); +} +__name(sub, "sub"); +function sum() { + var i = 0, args = arguments, x = new this(args[i]); + external = false; + for (; x.s && ++i < args.length; ) + x = x.plus(args[i]); + external = true; + return finalise(x, this.precision, this.rounding); +} +__name(sum, "sum"); +function tan(x) { + return new this(x).tan(); +} +__name(tan, "tan"); +function tanh(x) { + return new this(x).tanh(); +} +__name(tanh, "tanh"); +function trunc(x) { + return finalise(x = new this(x), x.e + 1, 1); +} +__name(trunc, "trunc"); +P[Symbol.for("nodejs.util.inspect.custom")] = P.toString; +P[Symbol.toStringTag] = "Decimal"; +var Decimal = P.constructor = clone(DEFAULTS); +LN10 = new Decimal(LN10); +PI = new Decimal(PI); +var decimal_default = Decimal; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Decimal, + makeStrictEnum, + objectEnumValues +}); +/*! + * decimal.js v10.4.0 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */ diff --git a/samples/todo/.zenstack/.prisma/runtime/index.d.ts b/samples/todo/.zenstack/.prisma/runtime/index.d.ts new file mode 100644 index 000000000..5f5a6270c --- /dev/null +++ b/samples/todo/.zenstack/.prisma/runtime/index.d.ts @@ -0,0 +1,1566 @@ +declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; + +declare class AnyNull extends NullTypesEnumValue { +} + +declare class Arg { + key: string; + value: ArgValue; + error?: InvalidArgError; + hasError: boolean; + isEnum: boolean; + schemaArg?: DMMF.SchemaArg; + isNullable: boolean; + inputType?: DMMF.SchemaArgInputType; + constructor({ key, value, isEnum, error, schemaArg, inputType }: ArgOptions); + get [Symbol.toStringTag](): string; + _toString(value: ArgValue, key: string): string | undefined; + toString(): string | undefined; + collectErrors(): ArgError[]; +} + +declare interface ArgError { + path: string[]; + id?: string; + error: InvalidArgError; +} + +declare interface ArgOptions { + key: string; + value: ArgValue; + isEnum?: boolean; + error?: InvalidArgError; + schemaArg?: DMMF.SchemaArg; + inputType?: DMMF.SchemaArgInputType; +} + +declare class Args { + args: Arg[]; + readonly hasInvalidArg: boolean; + constructor(args?: Arg[]); + get [Symbol.toStringTag](): string; + toString(): string; + collectErrors(): ArgError[]; +} + +declare type ArgValue = string | boolean | number | undefined | Args | string[] | boolean[] | number[] | Args[] | null; + +declare interface AtLeastOneError { + type: 'atLeastOne'; + key: string; + inputType: DMMF.InputType; +} + +declare interface AtMostOneError { + type: 'atMostOne'; + key: string; + inputType: DMMF.InputType; + providedKeys: string[]; +} + +export declare type BaseDMMF = Pick; + +declare interface BaseDMMFHelper extends DMMFDatamodelHelper, DMMFMappingsHelper { +} + +declare class BaseDMMFHelper { + constructor(dmmf: BaseDMMF); +} + +declare interface BinaryTargetsEnvValue { + fromEnvVar: null | string; + value: string; +} + +declare interface CallSite { + getLocation(): LocationInFile | null; +} + +declare interface Client { + /** Only via tx proxy */ + [TX_ID]?: string; + _baseDmmf: BaseDMMFHelper; + _dmmf?: DMMFClass; + _engine: Engine; + _fetcher: RequestHandler; + _connectionPromise?: Promise; + _disconnectionPromise?: Promise; + _engineConfig: EngineConfig; + _clientVersion: string; + _errorFormat: ErrorFormat; + _tracingConfig: TracingConfig; + readonly $metrics: MetricsClient; + $use(arg0: Namespace | QueryMiddleware, arg1?: QueryMiddleware | EngineMiddleware): any; + $on(eventType: EngineEventType, callback: (event: any) => void): any; + $connect(): any; + $disconnect(): any; + _runDisconnect(): any; + $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): any; + $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): any; + __internal_triggerPanic(fatal: boolean): any; + $transaction(input: any, options?: any): any; + _request(internalParams: InternalRequestParams): Promise; +} + +declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'sqlserver' | 'jdbc:sqlserver' | 'cockroachdb'; + +declare type ConnectorType_2 = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'sqlserver' | 'jdbc: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 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; +}; + +declare interface DataSource { + name: string; + activeProvider: ConnectorType; + provider: ConnectorType; + url: EnvValue; + config: { + [key: string]: string; + }; +} + +declare type Datasource = { + url?: string; +}; + +declare interface DatasourceOverwrite { + name: string; + url?: string; + env?: string; +} + +declare type Datasources = { + [name in string]: Datasource; +}; + +declare class DbNull extends NullTypesEnumValue { +} + +export declare interface Debug { + (namespace: string): Debugger; + disable: () => string; + enable: (namespace: string) => void; + enabled: (namespace: string) => boolean; + log: (...args: any[]) => any; + formatters: Record string) | undefined>; +} + +declare interface Debugger { + (format: any, ...args: any[]): void; + log: (...args: any[]) => any; + extend: (namespace: string, delimiter?: string) => Debugger; + color: string | number; + enabled: boolean; + namespace: string; +} + +export declare namespace Decimal { + export type Constructor = typeof Decimal; + export type Instance = Decimal; + export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + export type Modulo = Rounding | 9; + export type Value = string | number | Decimal; + + // http://mikemcl.github.io/decimal.js/#constructor-properties + export interface Config { + precision?: number; + rounding?: Rounding; + toExpNeg?: number; + toExpPos?: number; + minE?: number; + maxE?: number; + crypto?: boolean; + modulo?: Modulo; + defaults?: boolean; + } +} + +export declare class Decimal { + readonly d: number[]; + readonly e: number; + readonly s: number; + private readonly toStringTag: string; + + 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): Decimal; + 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; +} + +export declare const decompressFromBase64: any; + +declare type Dictionary = { + [key: string]: T; +}; + +declare interface Dictionary_2 { + [key: string]: T; +} + +export declare namespace DMMF { + export interface Document { + datamodel: Datamodel; + schema: Schema; + mappings: Mappings; + } + export interface Mappings { + modelOperations: ModelMapping[]; + otherOperations: { + read: string[]; + write: string[]; + }; + } + export interface OtherOperationMappings { + read: string[]; + write: string[]; + } + export interface DatamodelEnum { + name: string; + values: EnumValue[]; + dbName?: string | null; + documentation?: string; + } + export interface SchemaEnum { + name: string; + values: string[]; + } + export interface EnumValue { + name: string; + dbName: string | null; + } + export interface Datamodel { + models: Model[]; + enums: DatamodelEnum[]; + types: Model[]; + } + export interface uniqueIndex { + name: string; + fields: string[]; + } + export interface PrimaryKey { + name: string | null; + fields: string[]; + } + export interface Model { + name: string; + dbName: string | null; + fields: Field[]; + uniqueFields: string[][]; + uniqueIndexes: uniqueIndex[]; + documentation?: string; + primaryKey: PrimaryKey | null; + [key: string]: any; + } + export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; + export type FieldNamespace = 'model' | 'prisma'; + export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; + export interface Field { + kind: FieldKind; + name: string; + isRequired: boolean; + isList: boolean; + isUnique: boolean; + isId: boolean; + isReadOnly: boolean; + isGenerated?: boolean; + isUpdatedAt?: boolean; + /** + * Describes the data type in the same the way is is defined in the Prisma schema: + * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName + */ + type: string; + dbNames?: string[] | null; + hasDefaultValue: boolean; + default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; + relationFromFields?: string[]; + relationToFields?: any[]; + relationOnDelete?: string; + relationName?: string; + documentation?: string; + [key: string]: any; + } + export interface FieldDefault { + name: string; + args: any[]; + } + export type FieldDefaultScalar = string | boolean | number; + export interface Schema { + rootQueryType?: string; + rootMutationType?: string; + inputObjectTypes: { + model?: InputType[]; + prisma: InputType[]; + }; + outputObjectTypes: { + model: OutputType[]; + prisma: OutputType[]; + }; + enumTypes: { + model?: SchemaEnum[]; + prisma: SchemaEnum[]; + }; + fieldRefTypes: { + prisma?: FieldRefType[]; + }; + } + export interface Query { + name: string; + args: SchemaArg[]; + output: QueryOutput; + } + export interface QueryOutput { + name: string; + isRequired: boolean; + isList: boolean; + } + export type ArgType = string | InputType | SchemaEnum; + export interface SchemaArgInputType { + isList: boolean; + type: ArgType; + location: FieldLocation; + namespace?: FieldNamespace; + } + export interface SchemaArg { + name: string; + comment?: string; + isNullable: boolean; + isRequired: boolean; + inputTypes: SchemaArgInputType[]; + deprecation?: Deprecation; + } + export interface OutputType { + name: string; + fields: SchemaField[]; + fieldMap?: Record; + } + export interface SchemaField { + name: string; + isNullable?: boolean; + outputType: OutputTypeRef; + args: SchemaArg[]; + deprecation?: Deprecation; + documentation?: string; + } + export type TypeRefCommon = { + isList: boolean; + namespace?: FieldNamespace; + }; + export type TypeRefScalar = TypeRefCommon & { + location: 'scalar'; + type: string; + }; + export type TypeRefOutputObject = TypeRefCommon & { + location: 'outputObjectTypes'; + type: OutputType | string; + }; + export type TypeRefEnum = TypeRefCommon & { + location: 'enumTypes'; + type: SchemaEnum | string; + }; + export type OutputTypeRef = TypeRefScalar | TypeRefOutputObject | TypeRefEnum; + export interface Deprecation { + sinceVersion: string; + reason: string; + plannedRemovalVersion?: string; + } + export interface InputType { + name: string; + constraints: { + maxNumFields: number | null; + minNumFields: number | null; + }; + meta?: { + source?: string; + }; + fields: SchemaArg[]; + fieldMap?: Record; + } + export interface FieldRefType { + name: string; + allowTypes: FieldRefAllowType[]; + fields: SchemaArg[]; + } + export type FieldRefAllowType = TypeRefScalar | TypeRefEnum; + export interface ModelMapping { + model: string; + plural: string; + findUnique?: string | null; + findFirst?: string | null; + findMany?: string | null; + create?: string | null; + createMany?: string | null; + update?: string | null; + updateMany?: string | null; + upsert?: string | null; + delete?: string | null; + deleteMany?: string | null; + aggregate?: string | null; + groupBy?: string | null; + count?: string | null; + findRaw?: string | null; + aggregateRaw?: string | null; + } + export enum ModelAction { + findUnique = "findUnique", + findFirst = "findFirst", + findMany = "findMany", + create = "create", + createMany = "createMany", + update = "update", + updateMany = "updateMany", + upsert = "upsert", + delete = "delete", + deleteMany = "deleteMany", + groupBy = "groupBy", + count = "count", + aggregate = "aggregate", + findRaw = "findRaw", + aggregateRaw = "aggregateRaw" + } +} + +export declare interface DMMFClass extends BaseDMMFHelper, DMMFSchemaHelper { +} + +export declare class DMMFClass { + constructor(dmmf: DMMF.Document); +} + +declare class DMMFDatamodelHelper implements Pick { + datamodel: DMMF.Datamodel; + datamodelEnumMap: Dictionary_2; + modelMap: Dictionary_2; + typeMap: Dictionary_2; + typeAndModelMap: Dictionary_2; + constructor({ datamodel }: Pick); + getDatamodelEnumMap(): Dictionary_2; + getModelMap(): Dictionary_2; + getTypeMap(): Dictionary_2; + getTypeModelMap(): Dictionary_2; +} + +declare class DMMFMappingsHelper implements Pick { + mappings: DMMF.Mappings; + mappingsMap: Dictionary_2; + constructor({ mappings }: Pick); + getMappingsMap(): Dictionary_2; +} + +declare class DMMFSchemaHelper implements Pick { + schema: DMMF.Schema; + queryType: DMMF.OutputType; + mutationType: DMMF.OutputType; + outputTypes: { + model: DMMF.OutputType[]; + prisma: DMMF.OutputType[]; + }; + outputTypeMap: Dictionary_2; + inputObjectTypes: { + model?: DMMF.InputType[]; + prisma: DMMF.InputType[]; + }; + inputTypeMap: Dictionary_2; + enumMap: Dictionary_2; + rootFieldMap: Dictionary_2; + constructor({ schema }: Pick); + get [Symbol.toStringTag](): string; + outputTypeToMergedOutputType: (outputType: DMMF.OutputType) => DMMF.OutputType; + resolveOutputTypes(): void; + resolveInputTypes(): void; + resolveFieldArgumentTypes(): void; + getQueryType(): DMMF.OutputType; + getMutationType(): DMMF.OutputType; + getOutputTypes(): { + model: DMMF.OutputType[]; + prisma: DMMF.OutputType[]; + }; + getEnumMap(): Dictionary_2; + hasEnumInNamespace(enumName: string, namespace: 'prisma' | 'model'): boolean; + getMergedOutputTypeMap(): Dictionary_2; + getInputTypeMap(): Dictionary_2; + getRootFieldMap(): Dictionary_2; +} + +declare class Document_2 { + readonly type: 'query' | 'mutation'; + readonly children: Field[]; + constructor(type: 'query' | 'mutation', children: Field[]); + get [Symbol.toStringTag](): string; + toString(): string; + validate(select?: any, isTopLevelQuery?: boolean, originalMethod?: string, errorFormat?: 'pretty' | 'minimal' | 'colorless', validationCallsite?: any): void; + protected printFieldError: ({ error }: FieldError, missingItems: MissingItem[], minimal: boolean) => string | undefined; + protected printArgError: ({ error, path, id }: ArgError, hasMissingItems: boolean, minimal: boolean) => string | undefined; + /** + * As we're allowing both single objects and array of objects for list inputs, we need to remove incorrect + * zero indexes from the path + * @param inputPath e.g. ['where', 'AND', 0, 'id'] + * @param select select object + */ + private normalizePath; +} + +declare interface DocumentInput { + dmmf: DMMFClass; + rootTypeName: 'query' | 'mutation'; + rootField: string; + select?: any; + modelName?: string; +} + +/** + * Placeholder value for "no text". + */ +export declare const empty: Sql; + +declare interface EmptyIncludeError { + type: 'emptyInclude'; + field: DMMF.SchemaField; +} + +declare interface EmptySelectError { + type: 'emptySelect'; + field: DMMF.SchemaField; +} + +export declare abstract class Engine { + abstract on(event: EngineEventType, listener: (args?: any) => any): void; + abstract start(): Promise; + abstract stop(): Promise; + abstract getConfig(): Promise; + abstract getDmmf(): Promise; + abstract version(forceRun?: boolean): Promise | string; + abstract request(query: string, headers?: QueryEngineRequestHeaders, numTry?: number): Promise>; + abstract requestBatch(queries: string[], headers?: QueryEngineRequestHeaders, transaction?: boolean, numTry?: number): Promise[]>; + abstract transaction(action: 'start', headers: Transaction.TransactionHeaders, options?: Transaction.Options): Promise; + abstract transaction(action: 'commit', headers: Transaction.TransactionHeaders, info: Transaction.Info): Promise; + abstract transaction(action: 'rollback', headers: Transaction.TransactionHeaders, info: Transaction.Info): Promise; + abstract metrics(options: MetricsOptionsJson): Promise; + abstract metrics(options: MetricsOptionsPrometheus): Promise; +} + +declare interface EngineConfig { + cwd?: string; + dirname?: string; + datamodelPath: string; + enableDebugLogs?: boolean; + allowTriggerPanic?: boolean; + prismaPath?: string; + fetcher?: (query: string) => Promise<{ + data?: any; + error?: any; + }>; + generator?: GeneratorConfig; + datasources?: DatasourceOverwrite[]; + showColors?: boolean; + logQueries?: boolean; + logLevel?: 'info' | 'warn'; + env: Record; + flags?: string[]; + clientVersion?: string; + previewFeatures?: string[]; + engineEndpoint?: string; + activeProvider?: string; + /** + * The contents of the schema encoded into a string + * @remarks only used for the purpose of data proxy + */ + inlineSchema?: string; + /** + * The contents of the datasource url saved in a string + * @remarks only used for the purpose of data proxy + */ + inlineDatasources?: Record; + /** + * The string hash that was produced for a given schema + * @remarks only used for the purpose of data proxy + */ + inlineSchemaHash?: string; + /** + * The configuration object for enabling tracing + * @remarks enabling is determined by the client + */ + tracingConfig: TracingConfig; +} + +declare type EngineEventType = 'query' | 'info' | 'warn' | 'error' | 'beforeExit'; + +declare type EngineMiddleware = (params: EngineMiddlewareParams, next: (params: EngineMiddlewareParams) => Promise<{ + data: T; + elapsed: number; +}>) => Promise<{ + data: T; + elapsed: number; +}>; + +declare type EngineMiddlewareParams = { + document: Document_2; + runInTransaction?: boolean; +}; + +declare interface EnvValue { + fromEnvVar: null | string; + value: string; +} + +declare interface EnvValue_2 { + fromEnvVar: string | null; + value: string | null; +} + +declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; + +declare class Field { + readonly name: string; + readonly args?: Args; + readonly children?: Field[]; + readonly error?: InvalidFieldError; + readonly hasInvalidChild: boolean; + readonly hasInvalidArg: boolean; + readonly schemaField?: DMMF.SchemaField; + constructor({ name, args, children, error, schemaField }: FieldArgs); + get [Symbol.toStringTag](): string; + toString(): string; + collectErrors(prefix?: string): { + fieldErrors: FieldError[]; + argErrors: ArgError[]; + }; +} + +declare interface FieldArgs { + name: string; + schemaField?: DMMF.SchemaField; + args?: Args; + children?: Field[]; + error?: InvalidFieldError; +} + +declare interface FieldError { + path: string[]; + error: InvalidFieldError; +} + +/** + * 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; +} + +/** + * Find paths that match a set of regexes + * @param root to start from + * @param match to match against + * @param types to select files, folders, links + * @param deep to recurse in the directory tree + * @param limit to limit the results + * @param handler to further filter results + * @param found to add to already found + * @param seen to add to already seen + * @returns found paths (symlinks preserved) + */ +export declare function findSync(root: string, match: (RegExp | string)[], types?: ('f' | 'd' | 'l')[], deep?: ('d' | 'l')[], limit?: number, handler?: Handler, found?: string[], seen?: Record): string[]; + +declare interface GeneratorConfig { + name: string; + output: EnvValue | null; + isCustomOutput?: boolean; + provider: EnvValue; + config: Dictionary; + binaryTargets: BinaryTargetsEnvValue[]; + previewFeatures: string[]; +} + +declare type GetConfigResult = { + datasources: DataSource[]; + generators: GeneratorConfig[]; +}; + +export declare function getPrismaClient(config: GetPrismaClientConfig): new (optionsArg?: PrismaClientOptions) => Client; + +/** + * 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]]. + */ +declare interface GetPrismaClientConfig { + document: Omit; + generator?: GeneratorConfig; + sqliteDatasourceOverrides?: DatasourceOverwrite[]; + relativeEnvPaths: { + rootEnvPath?: string | null; + schemaEnvPath?: string | null; + }; + relativePath: string; + dirname: string; + filename?: string; + clientVersion?: string; + engineVersion?: string; + datasourceNames: string[]; + activeProvider: string; + /** + * True when `--data-proxy` is passed to `prisma generate` + * If enabled, we disregard the generator config engineType. + * It means that `--data-proxy` binds you to the Data Proxy. + */ + dataProxy: boolean; + /** + * 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?: InlineDatasources; + /** + * The string hash that was produced for a given schema + * @remarks only used for the purpose of data proxy + */ + inlineSchemaHash?: string; +} + +declare type HandleErrorParams = { + error: any; + clientMethod: string; + callsite?: CallSite; +}; + +declare type Handler = (base: string, item: string, type: ItemType) => boolean | string; + +declare type HookParams = { + query: string; + path: string[]; + rootField?: string; + typeName?: string; + document: any; + clientMethod: string; + args: any; +}; + +declare type Hooks = { + beforeRequest?: (options: HookParams) => any; +}; + +declare interface IncludeAndSelectError { + type: 'includeAndSelect'; + field: DMMF.SchemaField; +} + +declare type Info = { + id: string; +}; + +declare type InlineDatasource = { + url: NullableEnvValue; +}; + +declare type InlineDatasources = { + [name in InternalDatasource['name']]: { + url: InternalDatasource['url']; + }; +}; + +declare type InstanceRejectOnNotFound = RejectOnNotFound | Record | Record>; + +declare interface InternalDatasource { + name: string; + activeProvider: ConnectorType_2; + provider: ConnectorType_2; + url: EnvValue_2; + config: any; +} + +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; + /** Headers metadata that will be passed to the Engine */ + headers?: Record; + transactionId?: string | number; + unpacker?: Unpacker; + lock?: PromiseLike; + otelParentCtx?: Context; +} & QueryMiddlewareParams; + +declare type InvalidArgError = InvalidArgNameError | MissingArgError | InvalidArgTypeError | AtLeastOneError | AtMostOneError | InvalidNullArgError; + +/** + * This error occurs if the user provides an arg name that doens't exist + */ +declare interface InvalidArgNameError { + type: 'invalidName'; + providedName: string; + providedValue: any; + didYouMeanArg?: string; + didYouMeanField?: string; + originalType: DMMF.ArgType; + possibilities?: DMMF.SchemaArgInputType[]; + outputType?: DMMF.OutputType; +} + +/** + * If the scalar type of an arg is not matching what is required + */ +declare interface InvalidArgTypeError { + type: 'invalidType'; + argName: string; + requiredType: { + bestFittingType: DMMF.SchemaArgInputType; + inputType: DMMF.SchemaArgInputType[]; + }; + providedValue: any; +} + +declare type InvalidFieldError = InvalidFieldNameError | InvalidFieldTypeError | EmptySelectError | NoTrueSelectError | IncludeAndSelectError | EmptyIncludeError; + +declare interface InvalidFieldNameError { + type: 'invalidFieldName'; + modelName: string; + didYouMean?: string | null; + providedName: string; + isInclude?: boolean; + isIncludeScalar?: boolean; + outputType: DMMF.OutputType; +} + +declare interface InvalidFieldTypeError { + type: 'invalidFieldType'; + modelName: string; + fieldName: string; + providedValue: any; +} + +/** + * If a user incorrectly provided null where she shouldn't have + */ +declare interface InvalidNullArgError { + type: 'invalidNullArg'; + name: string; + invalidType: DMMF.SchemaArgInputType[]; + atLeastOne: boolean; + atMostOne: boolean; +} + +declare enum IsolationLevel { + ReadUncommitted = "ReadUncommitted", + ReadCommitted = "ReadCommitted", + RepeatableRead = "RepeatableRead", + Snapshot = "Snapshot", + Serializable = "Serializable" +} + +declare type ItemType = 'd' | 'f' | 'l'; + +declare interface Job { + resolve: (data: any) => void; + reject: (data: any) => void; + request: any; +} + +/** + * Create a SQL query for a list of values. + */ +export declare function join(values: RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; + +declare class JsonNull extends NullTypesEnumValue { +} + +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'; +}; + +declare type LogLevel = 'info' | 'query' | 'warn' | 'error'; + +export declare function makeDocument({ dmmf, rootTypeName, rootField, select, modelName }: DocumentInput): Document_2; + +/** + * Generates more strict variant of an enum which, unlike regular enum, + * throws on non-existing property access. This can be useful in following situations: + * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input + * - enum values are generated dynamically from DMMF. + * + * In that case, if using normal enums and no compile-time typechecking, using non-existing property + * will result in `undefined` value being used, which will be accepted. Using strict enum + * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. + * + * Note: if you need to check for existence of a value in the enum you can still use either + * `in` operator or `hasOwnProperty` function. + * + * @param definition + * @returns + */ +export declare function makeStrictEnum>(definition: T): T; + +export declare type Metric = { + key: string; + value: T; + labels: Record; + description: string; +}; + +export declare type MetricHistogram = { + buckets: MetricHistogramBucket[]; + sum: number; + count: number; +}; + +export declare type MetricHistogramBucket = [maxValue: number, count: number]; + +export declare type Metrics = { + counters: Metric[]; + gauges: Metric[]; + histograms: Metric[]; +}; + +export declare class MetricsClient { + private _engine; + constructor(engine: Engine); + /** + * Returns all metrics gathered up to this point in prometheus format. + * Result of this call can be exposed directly to prometheus scraping endpoint + * + * @param options + * @returns + */ + prometheus(options?: MetricsOptions): Promise; + /** + * Returns all metrics gathered up to this point in prometheus format. + * + * @param options + * @returns + */ + json(options?: MetricsOptions): Promise; +} + +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; + +/** + * Opposite of InvalidArgNameError - if the user *doesn't* provide an arg that should be provided + * This error both happens with an implicit and explicit `undefined` + */ +declare interface MissingArgError { + type: 'missingArg'; + missingName: string; + missingArg: DMMF.SchemaArg; + atLeastOne: boolean; + atMostOne: boolean; +} + +declare interface MissingItem { + path: string; + isRequired: boolean; + type: string | object; +} + +declare type Namespace = 'all' | 'engine'; + +export declare class NotFoundError extends Error { + constructor(message: string); +} + +declare interface NoTrueSelectError { + type: 'noTrueSelect'; + field: DMMF.SchemaField; +} + +declare type NullableEnvValue = { + fromEnvVar: string | null; + value?: string | null; +}; + +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; + }; +}; + +/** + * maxWait ?= 2000 + * timeout ?= 5000 + */ +declare type Options = { + maxWait?: number; + timeout?: number; + isolationLevel?: IsolationLevel; +}; + +export declare class PrismaClientInitializationError extends Error { + clientVersion: string; + errorCode?: string; + constructor(message: string, clientVersion: string, errorCode?: string); + get [Symbol.toStringTag](): string; +} + +export declare class PrismaClientKnownRequestError extends Error { + code: string; + meta?: Record; + clientVersion: string; + constructor(message: string, code: string, clientVersion: string, meta?: any); + get [Symbol.toStringTag](): string; +} + +export declare interface PrismaClientOptions { + /** + * Will throw an Error if findUnique returns null + */ + rejectOnNotFound?: InstanceRejectOnNotFound; + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources; + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat; + /** + * @example + * \`\`\` + * // Defaults to stdout + * log: ['query', 'info', 'warn'] + * + * // Emit as events + * log: [ + * { emit: 'stdout', level: 'query' }, + * { emit: 'stdout', level: 'info' }, + * { emit: 'stdout', level: 'warn' } + * ] + * \`\`\` + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). + */ + log?: Array; + /** + * @internal + * You probably don't want to use this. \`__internal\` is used by internal tooling. + */ + __internal?: { + debug?: boolean; + hooks?: Hooks; + engine?: { + cwd?: string; + binaryPath?: string; + endpoint?: string; + allowTriggerPanic?: boolean; + }; + }; +} + +export declare class PrismaClientRustPanicError extends Error { + clientVersion: string; + constructor(message: string, clientVersion: string); + get [Symbol.toStringTag](): string; +} + +export declare class PrismaClientUnknownRequestError extends Error { + clientVersion: string; + constructor(message: string, clientVersion: string); + get [Symbol.toStringTag](): string; +} + +export declare class PrismaClientValidationError extends Error { + get [Symbol.toStringTag](): string; +} + +declare type QueryEngineRequestHeaders = { + traceparent?: string; + transactionId?: string; + fatal?: string; +}; + +declare type QueryEngineResult = { + data: T; + elapsed: number; +}; + +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; + /** TODO what is this */ + args: any; +}; + +/** + * Create raw SQL statement. + */ +export declare function raw(value: string): Sql; + +/** + * Supported value or SQL instance. + */ +export declare type RawValue = Value | Sql; + +declare type RejectOnNotFound = boolean | ((error: Error) => Error) | undefined; + +declare type Request_2 = { + document: Document_2; + runInTransaction?: boolean; + transactionId?: string | number; + headers?: Record; + otelParentCtx?: Context; + otelChildCtx?: Context; + tracingConfig?: TracingConfig; +}; + +declare class RequestHandler { + client: Client; + hooks: any; + dataloader: DataLoader; + constructor(client: Client, hooks?: any); + request({ document, dataPath, rootField, typeName, isList, callsite, rejectOnNotFound, clientMethod, runInTransaction, engineHook, args, headers, transactionId, unpacker, otelParentCtx, otelChildCtx, }: RequestParams): Promise; + handleRequestError({ error, clientMethod, callsite }: HandleErrorParams): never; + sanitizeMessage(message: any): any; + unpack(document: any, data: any, path: any, rootField: any, unpacker?: Unpacker): any; + get [Symbol.toStringTag](): string; +} + +declare type RequestParams = { + document: Document_2; + dataPath: string[]; + rootField: string; + typeName: string; + isList: boolean; + clientMethod: string; + callsite?: CallSite; + rejectOnNotFound?: RejectOnNotFound; + runInTransaction?: boolean; + engineHook?: EngineMiddleware; + args: any; + headers?: Record; + transactionId?: string | number; + unpacker?: Unpacker; + otelParentCtx?: Context; + otelChildCtx?: Context; +}; + +/** + * A SQL instance can be nested within each other to build SQL strings. + */ +export declare class Sql { + values: Value[]; + strings: string[]; + constructor(rawStrings: ReadonlyArray, rawValues: ReadonlyArray); + get text(): string; + get sql(): string; + inspect(): { + text: string; + sql: string; + values: unknown[]; + }; +} + +/** + * Create a SQL object from a template string. + */ +export declare function sqltag(strings: ReadonlyArray, ...values: RawValue[]): Sql; + +declare type TracingConfig = { + enabled: boolean; + middleware: boolean; +}; + +declare namespace Transaction { + export { + IsolationLevel, + Options, + Info, + TransactionHeaders + } +} + +declare type TransactionHeaders = { + traceparent?: string; +}; + +export declare function transformDocument(document: Document_2): Document_2; + +declare const TX_ID: unique symbol; + +/** + * Unpacks the result of a data object and maps DateTime fields to instances of `Date` inplace + * @param options: UnpackOptions + */ +export declare function unpack({ document, path, data }: UnpackOptions): any; + +declare type Unpacker = (data: any) => any; + +declare interface UnpackOptions { + document: Document_2; + path: string[]; + data: any; +} + +/** + * Values supported by SQL engine. + */ +export declare type Value = unknown; + +export declare function warnEnvConflicts(envPaths: any): void; + +export { } diff --git a/samples/todo/.zenstack/.prisma/runtime/index.js b/samples/todo/.zenstack/.prisma/runtime/index.js new file mode 100644 index 000000000..9eb67889d --- /dev/null +++ b/samples/todo/.zenstack/.prisma/runtime/index.js @@ -0,0 +1,31190 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __commonJS = (cb, mod2) => function __require() { + return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( + isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, + mod2 +)); +var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// ../../node_modules/.pnpm/lz-string@1.4.4/node_modules/lz-string/libs/lz-string.js +var require_lz_string = __commonJS({ + "../../node_modules/.pnpm/lz-string@1.4.4/node_modules/lz-string/libs/lz-string.js"(exports, module2) { + var LZString = function() { + var f = String.fromCharCode; + var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$"; + var baseReverseDic = {}; + function getBaseValue(alphabet, character) { + if (!baseReverseDic[alphabet]) { + baseReverseDic[alphabet] = {}; + for (var i = 0; i < alphabet.length; i++) { + baseReverseDic[alphabet][alphabet.charAt(i)] = i; + } + } + return baseReverseDic[alphabet][character]; + } + __name(getBaseValue, "getBaseValue"); + var LZString2 = { + compressToBase64: function(input) { + if (input == null) + return ""; + var res = LZString2._compress(input, 6, function(a) { + return keyStrBase64.charAt(a); + }); + switch (res.length % 4) { + default: + case 0: + return res; + case 1: + return res + "==="; + case 2: + return res + "=="; + case 3: + return res + "="; + } + }, + decompressFromBase64: function(input) { + if (input == null) + return ""; + if (input == "") + return null; + return LZString2._decompress(input.length, 32, function(index) { + return getBaseValue(keyStrBase64, input.charAt(index)); + }); + }, + compressToUTF16: function(input) { + if (input == null) + return ""; + return LZString2._compress(input, 15, function(a) { + return f(a + 32); + }) + " "; + }, + decompressFromUTF16: function(compressed) { + if (compressed == null) + return ""; + if (compressed == "") + return null; + return LZString2._decompress(compressed.length, 16384, function(index) { + return compressed.charCodeAt(index) - 32; + }); + }, + compressToUint8Array: function(uncompressed) { + var compressed = LZString2.compress(uncompressed); + var buf = new Uint8Array(compressed.length * 2); + for (var i = 0, TotalLen = compressed.length; i < TotalLen; i++) { + var current_value = compressed.charCodeAt(i); + buf[i * 2] = current_value >>> 8; + buf[i * 2 + 1] = current_value % 256; + } + return buf; + }, + decompressFromUint8Array: function(compressed) { + if (compressed === null || compressed === void 0) { + return LZString2.decompress(compressed); + } else { + var buf = new Array(compressed.length / 2); + for (var i = 0, TotalLen = buf.length; i < TotalLen; i++) { + buf[i] = compressed[i * 2] * 256 + compressed[i * 2 + 1]; + } + var result = []; + buf.forEach(function(c) { + result.push(f(c)); + }); + return LZString2.decompress(result.join("")); + } + }, + compressToEncodedURIComponent: function(input) { + if (input == null) + return ""; + return LZString2._compress(input, 6, function(a) { + return keyStrUriSafe.charAt(a); + }); + }, + decompressFromEncodedURIComponent: function(input) { + if (input == null) + return ""; + if (input == "") + return null; + input = input.replace(/ /g, "+"); + return LZString2._decompress(input.length, 32, function(index) { + return getBaseValue(keyStrUriSafe, input.charAt(index)); + }); + }, + compress: function(uncompressed) { + return LZString2._compress(uncompressed, 16, function(a) { + return f(a); + }); + }, + _compress: function(uncompressed, bitsPerChar, getCharFromInt) { + if (uncompressed == null) + return ""; + var i, value, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0, ii; + for (ii = 0; ii < uncompressed.length; ii += 1) { + context_c = uncompressed.charAt(ii); + if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) { + context_dictionary[context_c] = context_dictSize++; + context_dictionaryToCreate[context_c] = true; + } + context_wc = context_w + context_c; + if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) { + context_w = context_wc; + } else { + if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) { + if (context_w.charCodeAt(0) < 256) { + for (i = 0; i < context_numBits; i++) { + context_data_val = context_data_val << 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + } + value = context_w.charCodeAt(0); + for (i = 0; i < 8; i++) { + context_data_val = context_data_val << 1 | value & 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = value >> 1; + } + } else { + value = 1; + for (i = 0; i < context_numBits; i++) { + context_data_val = context_data_val << 1 | value; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = 0; + } + value = context_w.charCodeAt(0); + for (i = 0; i < 16; i++) { + context_data_val = context_data_val << 1 | value & 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = value >> 1; + } + } + context_enlargeIn--; + if (context_enlargeIn == 0) { + context_enlargeIn = Math.pow(2, context_numBits); + context_numBits++; + } + delete context_dictionaryToCreate[context_w]; + } else { + value = context_dictionary[context_w]; + for (i = 0; i < context_numBits; i++) { + context_data_val = context_data_val << 1 | value & 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = value >> 1; + } + } + context_enlargeIn--; + if (context_enlargeIn == 0) { + context_enlargeIn = Math.pow(2, context_numBits); + context_numBits++; + } + context_dictionary[context_wc] = context_dictSize++; + context_w = String(context_c); + } + } + if (context_w !== "") { + if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) { + if (context_w.charCodeAt(0) < 256) { + for (i = 0; i < context_numBits; i++) { + context_data_val = context_data_val << 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + } + value = context_w.charCodeAt(0); + for (i = 0; i < 8; i++) { + context_data_val = context_data_val << 1 | value & 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = value >> 1; + } + } else { + value = 1; + for (i = 0; i < context_numBits; i++) { + context_data_val = context_data_val << 1 | value; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = 0; + } + value = context_w.charCodeAt(0); + for (i = 0; i < 16; i++) { + context_data_val = context_data_val << 1 | value & 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = value >> 1; + } + } + context_enlargeIn--; + if (context_enlargeIn == 0) { + context_enlargeIn = Math.pow(2, context_numBits); + context_numBits++; + } + delete context_dictionaryToCreate[context_w]; + } else { + value = context_dictionary[context_w]; + for (i = 0; i < context_numBits; i++) { + context_data_val = context_data_val << 1 | value & 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = value >> 1; + } + } + context_enlargeIn--; + if (context_enlargeIn == 0) { + context_enlargeIn = Math.pow(2, context_numBits); + context_numBits++; + } + } + value = 2; + for (i = 0; i < context_numBits; i++) { + context_data_val = context_data_val << 1 | value & 1; + if (context_data_position == bitsPerChar - 1) { + context_data_position = 0; + context_data.push(getCharFromInt(context_data_val)); + context_data_val = 0; + } else { + context_data_position++; + } + value = value >> 1; + } + while (true) { + context_data_val = context_data_val << 1; + if (context_data_position == bitsPerChar - 1) { + context_data.push(getCharFromInt(context_data_val)); + break; + } else + context_data_position++; + } + return context_data.join(""); + }, + decompress: function(compressed) { + if (compressed == null) + return ""; + if (compressed == "") + return null; + return LZString2._decompress(compressed.length, 32768, function(index) { + return compressed.charCodeAt(index); + }); + }, + _decompress: function(length, resetValue, getNextValue) { + var dictionary = [], next, enlargeIn = 4, dictSize = 4, numBits = 3, entry = "", result = [], i, w, bits, resb, maxpower, power, c, data = { val: getNextValue(0), position: resetValue, index: 1 }; + for (i = 0; i < 3; i += 1) { + dictionary[i] = i; + } + bits = 0; + maxpower = Math.pow(2, 2); + power = 1; + while (power != maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb > 0 ? 1 : 0) * power; + power <<= 1; + } + switch (next = bits) { + case 0: + bits = 0; + maxpower = Math.pow(2, 8); + power = 1; + while (power != maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb > 0 ? 1 : 0) * power; + power <<= 1; + } + c = f(bits); + break; + case 1: + bits = 0; + maxpower = Math.pow(2, 16); + power = 1; + while (power != maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb > 0 ? 1 : 0) * power; + power <<= 1; + } + c = f(bits); + break; + case 2: + return ""; + } + dictionary[3] = c; + w = c; + result.push(c); + while (true) { + if (data.index > length) { + return ""; + } + bits = 0; + maxpower = Math.pow(2, numBits); + power = 1; + while (power != maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb > 0 ? 1 : 0) * power; + power <<= 1; + } + switch (c = bits) { + case 0: + bits = 0; + maxpower = Math.pow(2, 8); + power = 1; + while (power != maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb > 0 ? 1 : 0) * power; + power <<= 1; + } + dictionary[dictSize++] = f(bits); + c = dictSize - 1; + enlargeIn--; + break; + case 1: + bits = 0; + maxpower = Math.pow(2, 16); + power = 1; + while (power != maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb > 0 ? 1 : 0) * power; + power <<= 1; + } + dictionary[dictSize++] = f(bits); + c = dictSize - 1; + enlargeIn--; + break; + case 2: + return result.join(""); + } + if (enlargeIn == 0) { + enlargeIn = Math.pow(2, numBits); + numBits++; + } + if (dictionary[c]) { + entry = dictionary[c]; + } else { + if (c === dictSize) { + entry = w + w.charAt(0); + } else { + return null; + } + } + result.push(entry); + dictionary[dictSize++] = w + entry.charAt(0); + enlargeIn--; + w = entry; + if (enlargeIn == 0) { + enlargeIn = Math.pow(2, numBits); + numBits++; + } + } + } + }; + return LZString2; + }(); + if (typeof define === "function" && false) { + define(function() { + return LZString; + }); + } else if (typeof module2 !== "undefined" && module2 != null) { + module2.exports = LZString; + } + } +}); + +// ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +var require_color_name = __commonJS({ + "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports, module2) { + "use strict"; + module2.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] + }; + } +}); + +// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +var require_conversions = __commonJS({ + "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports, module2) { + var cssKeywords = require_color_name(); + var reverseKeywords = {}; + for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; + } + var convert = { + rgb: { channels: 3, labels: "rgb" }, + hsl: { channels: 3, labels: "hsl" }, + hsv: { channels: 3, labels: "hsv" }, + hwb: { channels: 3, labels: "hwb" }, + cmyk: { channels: 4, labels: "cmyk" }, + xyz: { channels: 3, labels: "xyz" }, + lab: { channels: 3, labels: "lab" }, + lch: { channels: 3, labels: "lch" }, + hex: { channels: 1, labels: ["hex"] }, + keyword: { channels: 1, labels: ["keyword"] }, + ansi16: { channels: 1, labels: ["ansi16"] }, + ansi256: { channels: 1, labels: ["ansi256"] }, + hcg: { channels: 3, labels: ["h", "c", "g"] }, + apple: { channels: 3, labels: ["r16", "g16", "b16"] }, + gray: { channels: 1, labels: ["gray"] } + }; + module2.exports = convert; + for (const model of Object.keys(convert)) { + if (!("channels" in convert[model])) { + throw new Error("missing channels property: " + model); + } + if (!("labels" in convert[model])) { + throw new Error("missing channel labels property: " + model); + } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error("channel and label counts mismatch: " + model); + } + const { channels, labels } = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], "channels", { value: channels }); + Object.defineProperty(convert[model], "labels", { value: labels }); + } + convert.rgb.hsl = function(rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min2 = Math.min(r, g, b); + const max2 = Math.max(r, g, b); + const delta = max2 - min2; + let h; + let s; + if (max2 === min2) { + h = 0; + } else if (r === max2) { + h = (g - b) / delta; + } else if (g === max2) { + h = 2 + (b - r) / delta; + } else if (b === max2) { + h = 4 + (r - g) / delta; + } + h = Math.min(h * 60, 360); + if (h < 0) { + h += 360; + } + const l = (min2 + max2) / 2; + if (max2 === min2) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max2 + min2); + } else { + s = delta / (2 - max2 - min2); + } + return [h, s * 100, l * 100]; + }; + convert.rgb.hsv = function(rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = /* @__PURE__ */ __name(function(c) { + return (v - c) / 6 / diff + 1 / 2; + }, "diffc"); + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = 1 / 3 + rdif - bdif; + } else if (b === v) { + h = 2 / 3 + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + return [ + h * 360, + s * 100, + v * 100 + ]; + }; + convert.rgb.hwb = function(rgb) { + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); + return [h, w * 100, b * 100]; + }; + convert.rgb.cmyk = function(rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; + return [c * 100, m * 100, y * 100, k * 100]; + }; + function comparativeDistance(x, y) { + return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2; + } + __name(comparativeDistance, "comparativeDistance"); + convert.rgb.keyword = function(rgb) { + const reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + let currentClosestDistance = Infinity; + let currentClosestKeyword; + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; + const distance = comparativeDistance(rgb, value); + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + return currentClosestKeyword; + }; + convert.keyword.rgb = function(keyword) { + return cssKeywords[keyword]; + }; + convert.rgb.xyz = function(rgb) { + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; + r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92; + g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92; + b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92; + const x = r * 0.4124 + g * 0.3576 + b * 0.1805; + const y = r * 0.2126 + g * 0.7152 + b * 0.0722; + const z = r * 0.0193 + g * 0.1192 + b * 0.9505; + return [x * 100, y * 100, z * 100]; + }; + convert.rgb.lab = function(rgb) { + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; + y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; + z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; + const l = 116 * y - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + return [l, a, b]; + }; + convert.hsl.rgb = function(hsl) { + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + const t1 = 2 * l - t2; + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } + if (t3 > 1) { + t3--; + } + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } + rgb[i] = val * 255; + } + return rgb; + }; + convert.hsl.hsv = function(hsl) { + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); + l *= 2; + s *= l <= 1 ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l + s) / 2; + const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s); + return [h, sv * 100, v * 100]; + }; + convert.hsv.rgb = function(hsv) { + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - s * f); + const t = 255 * v * (1 - s * (1 - f)); + v *= 255; + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } + }; + convert.hsv.hsl = function(hsv) { + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; + l = (2 - s) * v; + const lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= lmin <= 1 ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + return [h, sl * 100, l * 100]; + }; + convert.hwb.rgb = function(hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + const i = Math.floor(6 * h); + const v = 1 - bl; + f = 6 * h - i; + if ((i & 1) !== 0) { + f = 1 - f; + } + const n = wh + f * (v - wh); + let r; + let g; + let b; + switch (i) { + default: + case 6: + case 0: + r = v; + g = n; + b = wh; + break; + case 1: + r = n; + g = v; + b = wh; + break; + case 2: + r = wh; + g = v; + b = n; + break; + case 3: + r = wh; + g = n; + b = v; + break; + case 4: + r = n; + g = wh; + b = v; + break; + case 5: + r = v; + g = wh; + b = n; + break; + } + return [r * 255, g * 255, b * 255]; + }; + convert.cmyk.rgb = function(cmyk) { + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); + return [r * 255, g * 255, b * 255]; + }; + convert.xyz.rgb = function(xyz) { + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; + r = x * 3.2406 + y * -1.5372 + z * -0.4986; + g = x * -0.9689 + y * 1.8758 + z * 0.0415; + b = x * 0.0557 + y * -0.204 + z * 1.057; + r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92; + g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92; + b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92; + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + return [r * 255, g * 255, b * 255]; + }; + convert.xyz.lab = function(xyz) { + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; + y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; + z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; + const l = 116 * y - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + return [l, a, b]; + }; + convert.lab.xyz = function(lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; + y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; + x *= 95.047; + y *= 100; + z *= 108.883; + return [x, y, z]; + }; + convert.lab.lch = function(lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; + const hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; + if (h < 0) { + h += 360; + } + const c = Math.sqrt(a * a + b * b); + return [l, c, h]; + }; + convert.lch.lab = function(lch) { + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); + return [l, a, b]; + }; + convert.rgb.ansi16 = function(args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; + value = Math.round(value / 50); + if (value === 0) { + return 30; + } + let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255)); + if (value === 2) { + ansi += 60; + } + return ansi; + }; + convert.hsv.ansi16 = function(args) { + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); + }; + convert.rgb.ansi256 = function(args) { + const r = args[0]; + const g = args[1]; + const b = args[2]; + if (r === g && g === b) { + if (r < 8) { + return 16; + } + if (r > 248) { + return 231; + } + return Math.round((r - 8) / 247 * 24) + 232; + } + const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); + return ansi; + }; + convert.ansi16.rgb = function(args) { + let color = args % 10; + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } + color = color / 10.5 * 255; + return [color, color, color]; + } + const mult = (~~(args > 50) + 1) * 0.5; + const r = (color & 1) * mult * 255; + const g = (color >> 1 & 1) * mult * 255; + const b = (color >> 2 & 1) * mult * 255; + return [r, g, b]; + }; + convert.ansi256.rgb = function(args) { + if (args >= 232) { + const c = (args - 232) * 10 + 8; + return [c, c, c]; + } + args -= 16; + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = rem % 6 / 5 * 255; + return [r, g, b]; + }; + convert.rgb.hex = function(args) { + const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255); + const string = integer.toString(16).toUpperCase(); + return "000000".substring(string.length) + string; + }; + convert.hex.rgb = function(args) { + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } + let colorString = match[0]; + if (match[0].length === 3) { + colorString = colorString.split("").map((char) => { + return char + char; + }).join(""); + } + const integer = parseInt(colorString, 16); + const r = integer >> 16 & 255; + const g = integer >> 8 & 255; + const b = integer & 255; + return [r, g, b]; + }; + convert.rgb.hcg = function(rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max2 = Math.max(Math.max(r, g), b); + const min2 = Math.min(Math.min(r, g), b); + const chroma = max2 - min2; + let grayscale; + let hue; + if (chroma < 1) { + grayscale = min2 / (1 - chroma); + } else { + grayscale = 0; + } + if (chroma <= 0) { + hue = 0; + } else if (max2 === r) { + hue = (g - b) / chroma % 6; + } else if (max2 === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; + } + hue /= 6; + hue %= 1; + return [hue * 360, chroma * 100, grayscale * 100]; + }; + convert.hsl.hcg = function(hsl) { + const s = hsl[1] / 100; + const l = hsl[2] / 100; + const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l); + let f = 0; + if (c < 1) { + f = (l - 0.5 * c) / (1 - c); + } + return [hsl[0], c * 100, f * 100]; + }; + convert.hsv.hcg = function(hsv) { + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const c = s * v; + let f = 0; + if (c < 1) { + f = (v - c) / (1 - c); + } + return [hsv[0], c * 100, f * 100]; + }; + convert.hcg.rgb = function(hcg) { + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; + if (c === 0) { + return [g * 255, g * 255, g * 255]; + } + const pure = [0, 0, 0]; + const hi = h % 1 * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; + pure[1] = v; + pure[2] = 0; + break; + case 1: + pure[0] = w; + pure[1] = 1; + pure[2] = 0; + break; + case 2: + pure[0] = 0; + pure[1] = 1; + pure[2] = v; + break; + case 3: + pure[0] = 0; + pure[1] = w; + pure[2] = 1; + break; + case 4: + pure[0] = v; + pure[1] = 0; + pure[2] = 1; + break; + default: + pure[0] = 1; + pure[1] = 0; + pure[2] = w; + } + mg = (1 - c) * g; + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; + }; + convert.hcg.hsv = function(hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1 - c); + let f = 0; + if (v > 0) { + f = c / v; + } + return [hcg[0], f * 100, v * 100]; + }; + convert.hcg.hsl = function(hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const l = g * (1 - c) + 0.5 * c; + let s = 0; + if (l > 0 && l < 0.5) { + s = c / (2 * l); + } else if (l >= 0.5 && l < 1) { + s = c / (2 * (1 - l)); + } + return [hcg[0], s * 100, l * 100]; + }; + convert.hcg.hwb = function(hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; + }; + convert.hwb.hcg = function(hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; + if (c < 1) { + g = (v - c) / (1 - c); + } + return [hwb[0], c * 100, g * 100]; + }; + convert.apple.rgb = function(apple) { + return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; + }; + convert.rgb.apple = function(rgb) { + return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; + }; + convert.gray.rgb = function(args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; + }; + convert.gray.hsl = function(args) { + return [0, 0, args[0]]; + }; + convert.gray.hsv = convert.gray.hsl; + convert.gray.hwb = function(gray) { + return [0, 100, gray[0]]; + }; + convert.gray.cmyk = function(gray) { + return [0, 0, 0, gray[0]]; + }; + convert.gray.lab = function(gray) { + return [gray[0], 0, 0]; + }; + convert.gray.hex = function(gray) { + const val = Math.round(gray[0] / 100 * 255) & 255; + const integer = (val << 16) + (val << 8) + val; + const string = integer.toString(16).toUpperCase(); + return "000000".substring(string.length) + string; + }; + convert.rgb.gray = function(rgb) { + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; + }; + } +}); + +// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +var require_route = __commonJS({ + "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports, module2) { + var conversions = require_conversions(); + function buildGraph() { + const graph = {}; + const models = Object.keys(conversions); + for (let len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + distance: -1, + parent: null + }; + } + return graph; + } + __name(buildGraph, "buildGraph"); + function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; + graph[fromModel].distance = 0; + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + return graph; + } + __name(deriveBFS, "deriveBFS"); + function link(from, to) { + return function(args) { + return to(from(args)); + }; + } + __name(link, "link"); + function wrapConversion(toModel, graph) { + const path7 = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path7.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } + fn.conversion = path7; + return fn; + } + __name(wrapConversion, "wrapConversion"); + module2.exports = function(fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; + if (node.parent === null) { + continue; + } + conversion[toModel] = wrapConversion(toModel, graph); + } + return conversion; + }; + } +}); + +// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +var require_color_convert = __commonJS({ + "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports, module2) { + var conversions = require_conversions(); + var route = require_route(); + var convert = {}; + var models = Object.keys(conversions); + function wrapRaw(fn) { + const wrappedFn = /* @__PURE__ */ __name(function(...args) { + const arg0 = args[0]; + if (arg0 === void 0 || arg0 === null) { + return arg0; + } + if (arg0.length > 1) { + args = arg0; + } + return fn(args); + }, "wrappedFn"); + if ("conversion" in fn) { + wrappedFn.conversion = fn.conversion; + } + return wrappedFn; + } + __name(wrapRaw, "wrapRaw"); + function wrapRounded(fn) { + const wrappedFn = /* @__PURE__ */ __name(function(...args) { + const arg0 = args[0]; + if (arg0 === void 0 || arg0 === null) { + return arg0; + } + if (arg0.length > 1) { + args = arg0; + } + const result = fn(args); + if (typeof result === "object") { + for (let len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + return result; + }, "wrappedFn"); + if ("conversion" in fn) { + wrappedFn.conversion = fn.conversion; + } + return wrappedFn; + } + __name(wrapRounded, "wrapRounded"); + models.forEach((fromModel) => { + convert[fromModel] = {}; + Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }); + Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels }); + const routes = route(fromModel); + const routeModels = Object.keys(routes); + routeModels.forEach((toModel) => { + const fn = routes[toModel]; + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); + }); + module2.exports = convert; + } +}); + +// ../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +var require_ansi_styles = __commonJS({ + "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module2) { + "use strict"; + var wrapAnsi16 = /* @__PURE__ */ __name((fn, offset) => (...args) => { + const code = fn(...args); + return `\x1B[${code + offset}m`; + }, "wrapAnsi16"); + var wrapAnsi256 = /* @__PURE__ */ __name((fn, offset) => (...args) => { + const code = fn(...args); + return `\x1B[${38 + offset};5;${code}m`; + }, "wrapAnsi256"); + var wrapAnsi16m = /* @__PURE__ */ __name((fn, offset) => (...args) => { + const rgb = fn(...args); + return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; + }, "wrapAnsi16m"); + var ansi2ansi = /* @__PURE__ */ __name((n) => n, "ansi2ansi"); + var rgb2rgb = /* @__PURE__ */ __name((r, g, b) => [r, g, b], "rgb2rgb"); + var setLazyProperty = /* @__PURE__ */ __name((object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + return value; + }, + enumerable: true, + configurable: true + }); + }, "setLazyProperty"); + var colorConvert; + var makeDynamicStyles = /* @__PURE__ */ __name((wrap, targetSpace, identity2, isBackground) => { + if (colorConvert === void 0) { + colorConvert = require_color_convert(); + } + const offset = isBackground ? 10 : 0; + const styles = {}; + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity2, offset); + } else if (typeof suite === "object") { + styles[name] = wrap(suite[targetSpace], offset); + } + } + return styles; + }, "makeDynamicStyles"); + function assembleStyles() { + const codes = /* @__PURE__ */ new Map(); + const styles = { + modifier: { + reset: [0, 0], + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\x1B[${style[0]}m`, + close: `\x1B[${style[1]}m` + }; + group[styleName] = styles[styleName]; + codes.set(style[0], style[1]); + } + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + Object.defineProperty(styles, "codes", { + value: codes, + enumerable: false + }); + styles.color.close = "\x1B[39m"; + styles.bgColor.close = "\x1B[49m"; + setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false)); + setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false)); + setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false)); + setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true)); + setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true)); + setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true)); + return styles; + } + __name(assembleStyles, "assembleStyles"); + Object.defineProperty(module2, "exports", { + enumerable: true, + get: assembleStyles + }); + } +}); + +// ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module2) { + "use strict"; + module2.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); + }; + } +}); + +// ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module2) { + "use strict"; + var os3 = require("os"); + var tty = require("tty"); + var hasFlag = require_has_flag(); + var { env: env2 } = process; + var forceColor; + if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + forceColor = 0; + } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + forceColor = 1; + } + if ("FORCE_COLOR" in env2) { + if (env2.FORCE_COLOR === "true") { + forceColor = 1; + } else if (env2.FORCE_COLOR === "false") { + forceColor = 0; + } else { + forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3); + } + } + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; + } + __name(translateLevel, "translateLevel"); + function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; + } + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min2 = forceColor || 0; + if (env2.TERM === "dumb") { + return min2; + } + if (process.platform === "win32") { + const osRelease = os3.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env2) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign2) => sign2 in env2) || env2.CI_NAME === "codeship") { + return 1; + } + return min2; + } + if ("TEAMCITY_VERSION" in env2) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0; + } + if (env2.COLORTERM === "truecolor") { + return 3; + } + if ("TERM_PROGRAM" in env2) { + const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env2.TERM_PROGRAM) { + case "iTerm.app": + return version >= 3 ? 3 : 2; + case "Apple_Terminal": + return 2; + } + } + if (/-256(color)?$/i.test(env2.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) { + return 1; + } + if ("COLORTERM" in env2) { + return 1; + } + return min2; + } + __name(supportsColor, "supportsColor"); + function getSupportLevel(stream2) { + const level = supportsColor(stream2, stream2 && stream2.isTTY); + return translateLevel(level); + } + __name(getSupportLevel, "getSupportLevel"); + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) + }; + } +}); + +// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +var require_util = __commonJS({ + "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports, module2) { + "use strict"; + var stringReplaceAll = /* @__PURE__ */ __name((string, substring, replacer) => { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ""; + do { + returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); + returnValue += string.substr(endIndex); + return returnValue; + }, "stringReplaceAll"); + var stringEncaseCRLFWithFirstIndex = /* @__PURE__ */ __name((string, prefix, postfix, index) => { + let endIndex = 0; + let returnValue = ""; + do { + const gotCR = string[index - 1] === "\r"; + returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix; + endIndex = index + 1; + index = string.indexOf("\n", endIndex); + } while (index !== -1); + returnValue += string.substr(endIndex); + return returnValue; + }, "stringEncaseCRLFWithFirstIndex"); + module2.exports = { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex + }; + } +}); + +// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +var require_templates = __commonJS({ + "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports, module2) { + "use strict"; + var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; + var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; + var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; + var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; + var ESCAPES = /* @__PURE__ */ new Map([ + ["n", "\n"], + ["r", "\r"], + ["t", " "], + ["b", "\b"], + ["f", "\f"], + ["v", "\v"], + ["0", "\0"], + ["\\", "\\"], + ["e", "\x1B"], + ["a", "\x07"] + ]); + function unescape(c) { + const u = c[0] === "u"; + const bracket = c[1] === "{"; + if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) { + return String.fromCharCode(parseInt(c.slice(1), 16)); + } + if (u && bracket) { + return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); + } + return ESCAPES.get(c) || c; + } + __name(unescape, "unescape"); + function parseArguments(name, arguments_) { + const results = []; + const chunks = arguments_.trim().split(/\s*,\s*/g); + let matches; + for (const chunk of chunks) { + const number = Number(chunk); + if (!Number.isNaN(number)) { + results.push(number); + } else if (matches = chunk.match(STRING_REGEX)) { + results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); + } + } + return results; + } + __name(parseArguments, "parseArguments"); + function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; + const results = []; + let matches; + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; + if (matches[2]) { + const args = parseArguments(name, matches[2]); + results.push([name].concat(args)); + } else { + results.push([name]); + } + } + return results; + } + __name(parseStyle, "parseStyle"); + function buildStyle(chalk12, styles) { + const enabled = {}; + for (const layer of styles) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } + } + let current = chalk12; + for (const [styleName, styles2] of Object.entries(enabled)) { + if (!Array.isArray(styles2)) { + continue; + } + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } + current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName]; + } + return current; + } + __name(buildStyle, "buildStyle"); + module2.exports = (chalk12, temporary) => { + const styles = []; + const chunks = []; + let chunk = []; + temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { + if (escapeCharacter) { + chunk.push(unescape(escapeCharacter)); + } else if (style) { + const string = chunk.join(""); + chunk = []; + chunks.push(styles.length === 0 ? string : buildStyle(chalk12, styles)(string)); + styles.push({ inverse, styles: parseStyle(style) }); + } else if (close) { + if (styles.length === 0) { + throw new Error("Found extraneous } in Chalk template literal"); + } + chunks.push(buildStyle(chalk12, styles)(chunk.join(""))); + chunk = []; + styles.pop(); + } else { + chunk.push(character); + } + }); + chunks.push(chunk.join("")); + if (styles.length > 0) { + const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`; + throw new Error(errMessage); + } + return chunks.join(""); + }; + } +}); + +// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +var require_source = __commonJS({ + "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports, module2) { + "use strict"; + var ansiStyles = require_ansi_styles(); + var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color(); + var { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex + } = require_util(); + var { isArray: isArray2 } = Array; + var levelMapping = [ + "ansi", + "ansi", + "ansi256", + "ansi16m" + ]; + var styles = /* @__PURE__ */ Object.create(null); + var applyOptions = /* @__PURE__ */ __name((object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error("The `level` option should be an integer from 0 to 3"); + } + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === void 0 ? colorLevel : options.level; + }, "applyOptions"); + var ChalkClass = class { + constructor(options) { + return chalkFactory(options); + } + }; + __name(ChalkClass, "ChalkClass"); + var chalkFactory = /* @__PURE__ */ __name((options) => { + const chalk13 = {}; + applyOptions(chalk13, options); + chalk13.template = (...arguments_) => chalkTag(chalk13.template, ...arguments_); + Object.setPrototypeOf(chalk13, Chalk.prototype); + Object.setPrototypeOf(chalk13.template, chalk13); + chalk13.template.constructor = () => { + throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead."); + }; + chalk13.template.Instance = ChalkClass; + return chalk13.template; + }, "chalkFactory"); + function Chalk(options) { + return chalkFactory(options); + } + __name(Chalk, "Chalk"); + for (const [styleName, style] of Object.entries(ansiStyles)) { + styles[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); + Object.defineProperty(this, styleName, { value: builder }); + return builder; + } + }; + } + styles.visible = { + get() { + const builder = createBuilder(this, this._styler, true); + Object.defineProperty(this, "visible", { value: builder }); + return builder; + } + }; + var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"]; + for (const model of usedModels) { + styles[model] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; + } + for (const model of usedModels) { + const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; + } + var proto = Object.defineProperties(() => { + }, { + ...styles, + level: { + enumerable: true, + get() { + return this._generator.level; + }, + set(level) { + this._generator.level = level; + } + } + }); + var createStyler = /* @__PURE__ */ __name((open, close, parent) => { + let openAll; + let closeAll; + if (parent === void 0) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } + return { + open, + close, + openAll, + closeAll, + parent + }; + }, "createStyler"); + var createBuilder = /* @__PURE__ */ __name((self2, _styler, _isEmpty) => { + const builder = /* @__PURE__ */ __name((...arguments_) => { + if (isArray2(arguments_[0]) && isArray2(arguments_[0].raw)) { + return applyStyle(builder, chalkTag(builder, ...arguments_)); + } + return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); + }, "builder"); + Object.setPrototypeOf(builder, proto); + builder._generator = self2; + builder._styler = _styler; + builder._isEmpty = _isEmpty; + return builder; + }, "createBuilder"); + var applyStyle = /* @__PURE__ */ __name((self2, string) => { + if (self2.level <= 0 || !string) { + return self2._isEmpty ? "" : string; + } + let styler = self2._styler; + if (styler === void 0) { + return string; + } + const { openAll, closeAll } = styler; + if (string.indexOf("\x1B") !== -1) { + while (styler !== void 0) { + string = stringReplaceAll(string, styler.close, styler.open); + styler = styler.parent; + } + } + const lfIndex = string.indexOf("\n"); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } + return openAll + string + closeAll; + }, "applyStyle"); + var template; + var chalkTag = /* @__PURE__ */ __name((chalk13, ...strings) => { + const [firstString] = strings; + if (!isArray2(firstString) || !isArray2(firstString.raw)) { + return strings.join(" "); + } + const arguments_ = strings.slice(1); + const parts = [firstString.raw[0]]; + for (let i = 1; i < firstString.length; i++) { + parts.push( + String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), + String(firstString.raw[i]) + ); + } + if (template === void 0) { + template = require_templates(); + } + return template(chalk13, parts.join("")); + }, "chalkTag"); + Object.defineProperties(Chalk.prototype, styles); + var chalk12 = Chalk(); + chalk12.supportsColor = stdoutColor; + chalk12.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 }); + chalk12.stderr.supportsColor = stderrColor; + module2.exports = chalk12; + } +}); + +// ../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js +var require_indent_string = __commonJS({ + "../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js"(exports, module2) { + "use strict"; + module2.exports = (string, count2 = 1, options) => { + options = { + indent: " ", + includeEmptyLines: false, + ...options + }; + if (typeof string !== "string") { + throw new TypeError( + `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` + ); + } + if (typeof count2 !== "number") { + throw new TypeError( + `Expected \`count\` to be a \`number\`, got \`${typeof count2}\`` + ); + } + if (typeof options.indent !== "string") { + throw new TypeError( + `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` + ); + } + if (count2 === 0) { + return string; + } + const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; + return string.replace(regex, options.indent.repeat(count2)); + }; + } +}); + +// ../../node_modules/.pnpm/js-levenshtein@1.1.6/node_modules/js-levenshtein/index.js +var require_js_levenshtein = __commonJS({ + "../../node_modules/.pnpm/js-levenshtein@1.1.6/node_modules/js-levenshtein/index.js"(exports, module2) { + "use strict"; + module2.exports = function() { + function _min(d0, d1, d2, bx, ay) { + return d0 < d1 || d2 < d1 ? d0 > d2 ? d2 + 1 : d0 + 1 : bx === ay ? d1 : d1 + 1; + } + __name(_min, "_min"); + return function(a, b) { + if (a === b) { + return 0; + } + if (a.length > b.length) { + var tmp = a; + a = b; + b = tmp; + } + var la = a.length; + var lb = b.length; + while (la > 0 && a.charCodeAt(la - 1) === b.charCodeAt(lb - 1)) { + la--; + lb--; + } + var offset = 0; + while (offset < la && a.charCodeAt(offset) === b.charCodeAt(offset)) { + offset++; + } + la -= offset; + lb -= offset; + if (la === 0 || lb < 3) { + return lb; + } + var x = 0; + var y; + var d0; + var d1; + var d2; + var d3; + var dd; + var dy; + var ay; + var bx0; + var bx1; + var bx2; + var bx3; + var vector = []; + for (y = 0; y < la; y++) { + vector.push(y + 1); + vector.push(a.charCodeAt(offset + y)); + } + var len = vector.length - 1; + for (; x < lb - 3; ) { + bx0 = b.charCodeAt(offset + (d0 = x)); + bx1 = b.charCodeAt(offset + (d1 = x + 1)); + bx2 = b.charCodeAt(offset + (d2 = x + 2)); + bx3 = b.charCodeAt(offset + (d3 = x + 3)); + dd = x += 4; + for (y = 0; y < len; y += 2) { + dy = vector[y]; + ay = vector[y + 1]; + d0 = _min(dy, d0, d1, bx0, ay); + d1 = _min(d0, d1, d2, bx1, ay); + d2 = _min(d1, d2, d3, bx2, ay); + dd = _min(d2, d3, dd, bx3, ay); + vector[y] = dd; + d3 = d2; + d2 = d1; + d1 = d0; + d0 = dy; + } + } + for (; x < lb; ) { + bx0 = b.charCodeAt(offset + (d0 = x)); + dd = ++x; + for (y = 0; y < len; y += 2) { + dy = vector[y]; + vector[y] = dd = _min(dy, d0, dd, bx0, vector[y + 1]); + d0 = dy; + } + } + return dd; + }; + }(); + } +}); + +// ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js +var require_ms = __commonJS({ + "../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports, module2) { + var s = 1e3; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse2(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse2(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n * y; + case "weeks": + case "week": + case "w": + return n * w; + case "days": + case "day": + case "d": + return n * d; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n * h; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n * m; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n * s; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n; + default: + return void 0; + } + } + __name(parse2, "parse"); + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + "d"; + } + if (msAbs >= h) { + return Math.round(ms / h) + "h"; + } + if (msAbs >= m) { + return Math.round(ms / m) + "m"; + } + if (msAbs >= s) { + return Math.round(ms / s) + "s"; + } + return ms + "ms"; + } + __name(fmtShort, "fmtShort"); + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, "day"); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, "hour"); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, "minute"); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, "second"); + } + return ms + " ms"; + } + __name(fmtLong, "fmtLong"); + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + } + __name(plural, "plural"); + } +}); + +// ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js +var require_common = __commonJS({ + "../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js"(exports, module2) { + function setup(env2) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require_ms(); + createDebug.destroy = destroy; + Object.keys(env2).forEach((key) => { + createDebug[key] = env2[key]; + }); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + __name(selectColor, "selectColor"); + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug13(...args) { + if (!debug13.enabled) { + return; + } + const self2 = debug13; + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self2.diff = ms; + self2.prev = prevTime; + self2.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== "string") { + args.unshift("%O"); + } + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format2]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + __name(debug13, "debug"); + debug13.namespace = namespace; + debug13.useColors = createDebug.useColors(); + debug13.color = createDebug.selectColor(namespace); + debug13.extend = extend; + debug13.destroy = createDebug.destroy; + Object.defineProperty(debug13, "enabled", { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + return enabledCache; + }, + set: (v) => { + enableOverride = v; + } + }); + if (typeof createDebug.init === "function") { + createDebug.init(debug13); + } + return debug13; + } + __name(createDebug, "createDebug"); + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + __name(extend, "extend"); + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + createDebug.names = []; + createDebug.skips = []; + let i; + const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); + const len = split.length; + for (i = 0; i < len; i++) { + if (!split[i]) { + continue; + } + namespaces = split[i].replace(/\*/g, ".*?"); + if (namespaces[0] === "-") { + createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); + } else { + createDebug.names.push(new RegExp("^" + namespaces + "$")); + } + } + } + __name(enable, "enable"); + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; + } + __name(disable, "disable"); + function enabled(name) { + if (name[name.length - 1] === "*") { + return true; + } + let i; + let len; + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + return false; + } + __name(enabled, "enabled"); + function toNamespace(regexp) { + return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); + } + __name(toNamespace, "toNamespace"); + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + __name(coerce, "coerce"); + function destroy() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + __name(destroy, "destroy"); + createDebug.enable(createDebug.load()); + return createDebug; + } + __name(setup, "setup"); + module2.exports = setup; + } +}); + +// ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js +var require_browser = __commonJS({ + "../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js"(exports, module2) { + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = localstorage(); + exports.destroy = (() => { + let warned = false; + return () => { + if (!warned) { + warned = true; + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + }; + })(); + exports.colors = [ + "#0000CC", + "#0000FF", + "#0033CC", + "#0033FF", + "#0066CC", + "#0066FF", + "#0099CC", + "#0099FF", + "#00CC00", + "#00CC33", + "#00CC66", + "#00CC99", + "#00CCCC", + "#00CCFF", + "#3300CC", + "#3300FF", + "#3333CC", + "#3333FF", + "#3366CC", + "#3366FF", + "#3399CC", + "#3399FF", + "#33CC00", + "#33CC33", + "#33CC66", + "#33CC99", + "#33CCCC", + "#33CCFF", + "#6600CC", + "#6600FF", + "#6633CC", + "#6633FF", + "#66CC00", + "#66CC33", + "#9900CC", + "#9900FF", + "#9933CC", + "#9933FF", + "#99CC00", + "#99CC33", + "#CC0000", + "#CC0033", + "#CC0066", + "#CC0099", + "#CC00CC", + "#CC00FF", + "#CC3300", + "#CC3333", + "#CC3366", + "#CC3399", + "#CC33CC", + "#CC33FF", + "#CC6600", + "#CC6633", + "#CC9900", + "#CC9933", + "#CCCC00", + "#CCCC33", + "#FF0000", + "#FF0033", + "#FF0066", + "#FF0099", + "#FF00CC", + "#FF00FF", + "#FF3300", + "#FF3333", + "#FF3366", + "#FF3399", + "#FF33CC", + "#FF33FF", + "#FF6600", + "#FF6633", + "#FF9900", + "#FF9933", + "#FFCC00", + "#FFCC33" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { + return true; + } + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + } + __name(useColors, "useColors"); + function formatArgs(args) { + args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); + if (!this.useColors) { + return; + } + const c = "color: " + this.color; + args.splice(1, 0, c, "color: inherit"); + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); + } + __name(formatArgs, "formatArgs"); + exports.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem("debug", namespaces); + } else { + exports.storage.removeItem("debug"); + } + } catch (error2) { + } + } + __name(save, "save"); + function load() { + let r; + try { + r = exports.storage.getItem("debug"); + } catch (error2) { + } + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + __name(load, "load"); + function localstorage() { + try { + return localStorage; + } catch (error2) { + } + } + __name(localstorage, "localstorage"); + module2.exports = require_common()(exports); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error2) { + return "[UnexpectedJSONParseError]: " + error2.message; + } + }; + } +}); + +// ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js +var require_node = __commonJS({ + "../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(exports, module2) { + var tty = require("tty"); + var util2 = require("util"); + exports.init = init; + exports.log = log4; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.destroy = util2.deprecate( + () => { + }, + "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." + ); + exports.colors = [6, 2, 3, 4, 5, 1]; + try { + const supportsColor = require_supports_color(); + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error2) { + } + exports.inspectOpts = Object.keys(process.env).filter((key) => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === "null") { + val = null; + } else { + val = Number(val); + } + obj[prop] = val; + return obj; + }, {}); + function useColors() { + return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); + } + __name(useColors, "useColors"); + function formatArgs(args) { + const { namespace: name, useColors: useColors2 } = this; + if (useColors2) { + const c = this.color; + const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); + const prefix = ` ${colorCode};1m${name} \x1B[0m`; + args[0] = prefix + args[0].split("\n").join("\n" + prefix); + args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args[0] = getDate() + name + " " + args[0]; + } + } + __name(formatArgs, "formatArgs"); + function getDate() { + if (exports.inspectOpts.hideDate) { + return ""; + } + return new Date().toISOString() + " "; + } + __name(getDate, "getDate"); + function log4(...args) { + return process.stderr.write(util2.format(...args) + "\n"); + } + __name(log4, "log"); + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; + } + } + __name(save, "save"); + function load() { + return process.env.DEBUG; + } + __name(load, "load"); + function init(debug13) { + debug13.inspectOpts = {}; + const keys2 = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys2.length; i++) { + debug13.inspectOpts[keys2[i]] = exports.inspectOpts[keys2[i]]; + } + } + __name(init, "init"); + module2.exports = require_common()(exports); + var { formatters } = module2.exports; + formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util2.inspect(v, this.inspectOpts); + }; + } +}); + +// ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js +var require_src = __commonJS({ + "../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js"(exports, module2) { + if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { + module2.exports = require_browser(); + } else { + module2.exports = require_node(); + } + } +}); + +// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +var require_windows = __commonJS({ + "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) { + module2.exports = isexe; + isexe.sync = sync; + var fs11 = require("fs"); + function checkPathExt(path7, options) { + var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT; + if (!pathext) { + return true; + } + pathext = pathext.split(";"); + if (pathext.indexOf("") !== -1) { + return true; + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase(); + if (p && path7.substr(-p.length).toLowerCase() === p) { + return true; + } + } + return false; + } + __name(checkPathExt, "checkPathExt"); + function checkStat(stat, path7, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false; + } + return checkPathExt(path7, options); + } + __name(checkStat, "checkStat"); + function isexe(path7, options, cb) { + fs11.stat(path7, function(er, stat) { + cb(er, er ? false : checkStat(stat, path7, options)); + }); + } + __name(isexe, "isexe"); + function sync(path7, options) { + return checkStat(fs11.statSync(path7), path7, options); + } + __name(sync, "sync"); + } +}); + +// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +var require_mode = __commonJS({ + "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module2) { + module2.exports = isexe; + isexe.sync = sync; + var fs11 = require("fs"); + function isexe(path7, options, cb) { + fs11.stat(path7, function(er, stat) { + cb(er, er ? false : checkStat(stat, options)); + }); + } + __name(isexe, "isexe"); + function sync(path7, options) { + return checkStat(fs11.statSync(path7), options); + } + __name(sync, "sync"); + function checkStat(stat, options) { + return stat.isFile() && checkMode(stat, options); + } + __name(checkStat, "checkStat"); + function checkMode(stat, options) { + var mod2 = stat.mode; + var uid = stat.uid; + var gid = stat.gid; + var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(); + var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(); + var u = parseInt("100", 8); + var g = parseInt("010", 8); + var o = parseInt("001", 8); + var ug = u | g; + var ret = mod2 & o || mod2 & g && gid === myGid || mod2 & u && uid === myUid || mod2 & ug && myUid === 0; + return ret; + } + __name(checkMode, "checkMode"); + } +}); + +// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +var require_isexe = __commonJS({ + "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module2) { + var fs11 = require("fs"); + var core; + if (process.platform === "win32" || global.TESTING_WINDOWS) { + core = require_windows(); + } else { + core = require_mode(); + } + module2.exports = isexe; + isexe.sync = sync; + function isexe(path7, options, cb) { + if (typeof options === "function") { + cb = options; + options = {}; + } + if (!cb) { + if (typeof Promise !== "function") { + throw new TypeError("callback not provided"); + } + return new Promise(function(resolve, reject) { + isexe(path7, options || {}, function(er, is) { + if (er) { + reject(er); + } else { + resolve(is); + } + }); + }); + } + core(path7, options || {}, function(er, is) { + if (er) { + if (er.code === "EACCES" || options && options.ignoreErrors) { + er = null; + is = false; + } + } + cb(er, is); + }); + } + __name(isexe, "isexe"); + function sync(path7, options) { + try { + return core.sync(path7, options || {}); + } catch (er) { + if (options && options.ignoreErrors || er.code === "EACCES") { + return false; + } else { + throw er; + } + } + } + __name(sync, "sync"); + } +}); + +// ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +var require_which = __commonJS({ + "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module2) { + var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys"; + var path7 = require("path"); + var COLON = isWindows ? ";" : ":"; + var isexe = require_isexe(); + var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError"); + var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => { + const colon = opt.colon || COLON; + const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [ + ...isWindows ? [process.cwd()] : [], + ...(opt.path || process.env.PATH || "").split(colon) + ]; + const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : ""; + const pathExt = isWindows ? pathExtExe.split(colon) : [""]; + if (isWindows) { + if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") + pathExt.unshift(""); + } + return { + pathEnv, + pathExt, + pathExtExe + }; + }, "getPathInfo"); + var which = /* @__PURE__ */ __name((cmd, opt, cb) => { + if (typeof opt === "function") { + cb = opt; + opt = {}; + } + if (!opt) + opt = {}; + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); + const found = []; + const step = /* @__PURE__ */ __name((i) => new Promise((resolve, reject) => { + if (i === pathEnv.length) + return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd)); + const ppRaw = pathEnv[i]; + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; + const pCmd = path7.join(pathPart, cmd); + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; + resolve(subStep(p, i, 0)); + }), "step"); + const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve, reject) => { + if (ii === pathExt.length) + return resolve(step(i + 1)); + const ext = pathExt[ii]; + isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { + if (!er && is) { + if (opt.all) + found.push(p + ext); + else + return resolve(p + ext); + } + return resolve(subStep(p, i, ii + 1)); + }); + }), "subStep"); + return cb ? step(0).then((res) => cb(null, res), cb) : step(0); + }, "which"); + var whichSync = /* @__PURE__ */ __name((cmd, opt) => { + opt = opt || {}; + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); + const found = []; + for (let i = 0; i < pathEnv.length; i++) { + const ppRaw = pathEnv[i]; + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; + const pCmd = path7.join(pathPart, cmd); + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; + for (let j = 0; j < pathExt.length; j++) { + const cur = p + pathExt[j]; + try { + const is = isexe.sync(cur, { pathExt: pathExtExe }); + if (is) { + if (opt.all) + found.push(cur); + else + return cur; + } + } catch (ex) { + } + } + } + if (opt.all && found.length) + return found; + if (opt.nothrow) + return null; + throw getNotFoundError(cmd); + }, "whichSync"); + module2.exports = which; + which.sync = whichSync; + } +}); + +// ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +var require_path_key = __commonJS({ + "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module2) { + "use strict"; + var pathKey = /* @__PURE__ */ __name((options = {}) => { + const environment = options.env || process.env; + const platform3 = options.platform || process.platform; + if (platform3 !== "win32") { + return "PATH"; + } + return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path"; + }, "pathKey"); + module2.exports = pathKey; + module2.exports.default = pathKey; + } +}); + +// ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js +var require_resolveCommand = __commonJS({ + "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) { + "use strict"; + var path7 = require("path"); + var which = require_which(); + var getPathKey = require_path_key(); + function resolveCommandAttempt(parsed, withoutPathExt) { + const env2 = parsed.options.env || process.env; + const cwd = process.cwd(); + const hasCustomCwd = parsed.options.cwd != null; + const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled; + if (shouldSwitchCwd) { + try { + process.chdir(parsed.options.cwd); + } catch (err) { + } + } + let resolved; + try { + resolved = which.sync(parsed.command, { + path: env2[getPathKey({ env: env2 })], + pathExt: withoutPathExt ? path7.delimiter : void 0 + }); + } catch (e) { + } finally { + if (shouldSwitchCwd) { + process.chdir(cwd); + } + } + if (resolved) { + resolved = path7.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved); + } + return resolved; + } + __name(resolveCommandAttempt, "resolveCommandAttempt"); + function resolveCommand(parsed) { + return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); + } + __name(resolveCommand, "resolveCommand"); + module2.exports = resolveCommand; + } +}); + +// ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js +var require_escape = __commonJS({ + "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) { + "use strict"; + var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; + function escapeCommand(arg2) { + arg2 = arg2.replace(metaCharsRegExp, "^$1"); + return arg2; + } + __name(escapeCommand, "escapeCommand"); + function escapeArgument(arg2, doubleEscapeMetaChars) { + arg2 = `${arg2}`; + arg2 = arg2.replace(/(\\*)"/g, '$1$1\\"'); + arg2 = arg2.replace(/(\\*)$/, "$1$1"); + arg2 = `"${arg2}"`; + arg2 = arg2.replace(metaCharsRegExp, "^$1"); + if (doubleEscapeMetaChars) { + arg2 = arg2.replace(metaCharsRegExp, "^$1"); + } + return arg2; + } + __name(escapeArgument, "escapeArgument"); + module2.exports.command = escapeCommand; + module2.exports.argument = escapeArgument; + } +}); + +// ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +var require_shebang_regex = __commonJS({ + "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module2) { + "use strict"; + module2.exports = /^#!(.*)/; + } +}); + +// ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +var require_shebang_command = __commonJS({ + "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module2) { + "use strict"; + var shebangRegex = require_shebang_regex(); + module2.exports = (string = "") => { + const match = string.match(shebangRegex); + if (!match) { + return null; + } + const [path7, argument] = match[0].replace(/#! ?/, "").split(" "); + const binary = path7.split("/").pop(); + if (binary === "env") { + return argument; + } + return argument ? `${binary} ${argument}` : binary; + }; + } +}); + +// ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js +var require_readShebang = __commonJS({ + "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) { + "use strict"; + var fs11 = require("fs"); + var shebangCommand = require_shebang_command(); + function readShebang(command) { + const size = 150; + const buffer = Buffer.alloc(size); + let fd; + try { + fd = fs11.openSync(command, "r"); + fs11.readSync(fd, buffer, 0, size, 0); + fs11.closeSync(fd); + } catch (e) { + } + return shebangCommand(buffer.toString()); + } + __name(readShebang, "readShebang"); + module2.exports = readShebang; + } +}); + +// ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js +var require_parse = __commonJS({ + "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js"(exports, module2) { + "use strict"; + var path7 = require("path"); + var resolveCommand = require_resolveCommand(); + var escape = require_escape(); + var readShebang = require_readShebang(); + var isWin = process.platform === "win32"; + var isExecutableRegExp = /\.(?:com|exe)$/i; + var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; + function detectShebang(parsed) { + parsed.file = resolveCommand(parsed); + const shebang = parsed.file && readShebang(parsed.file); + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; + return resolveCommand(parsed); + } + return parsed.file; + } + __name(detectShebang, "detectShebang"); + function parseNonShell(parsed) { + if (!isWin) { + return parsed; + } + const commandFile = detectShebang(parsed); + const needsShell = !isExecutableRegExp.test(commandFile); + if (parsed.options.forceShell || needsShell) { + const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); + parsed.command = path7.normalize(parsed.command); + parsed.command = escape.command(parsed.command); + parsed.args = parsed.args.map((arg2) => escape.argument(arg2, needsDoubleEscapeMetaChars)); + const shellCommand = [parsed.command].concat(parsed.args).join(" "); + parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`]; + parsed.command = process.env.comspec || "cmd.exe"; + parsed.options.windowsVerbatimArguments = true; + } + return parsed; + } + __name(parseNonShell, "parseNonShell"); + function parse2(command, args, options) { + if (args && !Array.isArray(args)) { + options = args; + args = null; + } + args = args ? args.slice(0) : []; + options = Object.assign({}, options); + const parsed = { + command, + args, + options, + file: void 0, + original: { + command, + args + } + }; + return options.shell ? parsed : parseNonShell(parsed); + } + __name(parse2, "parse"); + module2.exports = parse2; + } +}); + +// ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js +var require_enoent = __commonJS({ + "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js"(exports, module2) { + "use strict"; + var isWin = process.platform === "win32"; + function notFoundError(original, syscall) { + return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { + code: "ENOENT", + errno: "ENOENT", + syscall: `${syscall} ${original.command}`, + path: original.command, + spawnargs: original.args + }); + } + __name(notFoundError, "notFoundError"); + function hookChildProcess(cp, parsed) { + if (!isWin) { + return; + } + const originalEmit = cp.emit; + cp.emit = function(name, arg1) { + if (name === "exit") { + const err = verifyENOENT(arg1, parsed, "spawn"); + if (err) { + return originalEmit.call(cp, "error", err); + } + } + return originalEmit.apply(cp, arguments); + }; + } + __name(hookChildProcess, "hookChildProcess"); + function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, "spawn"); + } + return null; + } + __name(verifyENOENT, "verifyENOENT"); + function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, "spawnSync"); + } + return null; + } + __name(verifyENOENTSync, "verifyENOENTSync"); + module2.exports = { + hookChildProcess, + verifyENOENT, + verifyENOENTSync, + notFoundError + }; + } +}); + +// ../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js +var require_cross_spawn = __commonJS({ + "../../node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports, module2) { + "use strict"; + var cp = require("child_process"); + var parse2 = require_parse(); + var enoent = require_enoent(); + function spawn2(command, args, options) { + const parsed = parse2(command, args, options); + const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); + enoent.hookChildProcess(spawned, parsed); + return spawned; + } + __name(spawn2, "spawn"); + function spawnSync(command, args, options) { + const parsed = parse2(command, args, options); + const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); + return result; + } + __name(spawnSync, "spawnSync"); + module2.exports = spawn2; + module2.exports.spawn = spawn2; + module2.exports.sync = spawnSync; + module2.exports._parse = parse2; + module2.exports._enoent = enoent; + } +}); + +// ../../node_modules/.pnpm/@prisma+engines-version@4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b/node_modules/@prisma/engines-version/package.json +var require_package = __commonJS({ + "../../node_modules/.pnpm/@prisma+engines-version@4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b/node_modules/@prisma/engines-version/package.json"(exports, module2) { + module2.exports = { + name: "@prisma/engines-version", + version: "4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b", + main: "index.js", + types: "index.d.ts", + license: "Apache-2.0", + author: "Tim Suchanek ", + prisma: { + enginesVersion: "c875e43600dfe042452e0b868f7a48b817b9640b" + }, + repository: { + type: "git", + url: "https://github.com/prisma/engines-wrapper.git", + directory: "packages/engines-version" + }, + devDependencies: { + "@types/node": "16.11.56", + typescript: "4.7.4" + }, + files: [ + "index.js", + "index.d.ts" + ], + scripts: { + build: "tsc -d" + } + }; + } +}); + +// ../../node_modules/.pnpm/@prisma+engines-version@4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b/node_modules/@prisma/engines-version/index.js +var require_engines_version = __commonJS({ + "../../node_modules/.pnpm/@prisma+engines-version@4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b/node_modules/@prisma/engines-version/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.enginesVersion = void 0; + exports.enginesVersion = require_package().prisma.enginesVersion; + } +}); + +// ../../node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +var require_strip_final_newline = __commonJS({ + "../../node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js"(exports, module2) { + "use strict"; + module2.exports = (input) => { + const LF = typeof input === "string" ? "\n" : "\n".charCodeAt(); + const CR = typeof input === "string" ? "\r" : "\r".charCodeAt(); + if (input[input.length - 1] === LF) { + input = input.slice(0, input.length - 1); + } + if (input[input.length - 1] === CR) { + input = input.slice(0, input.length - 1); + } + return input; + }; + } +}); + +// ../../node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +var require_npm_run_path = __commonJS({ + "../../node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js"(exports, module2) { + "use strict"; + var path7 = require("path"); + var pathKey = require_path_key(); + var npmRunPath = /* @__PURE__ */ __name((options) => { + options = { + cwd: process.cwd(), + path: process.env[pathKey()], + execPath: process.execPath, + ...options + }; + let previous; + let cwdPath = path7.resolve(options.cwd); + const result = []; + while (previous !== cwdPath) { + result.push(path7.join(cwdPath, "node_modules/.bin")); + previous = cwdPath; + cwdPath = path7.resolve(cwdPath, ".."); + } + const execPathDir = path7.resolve(options.cwd, options.execPath, ".."); + result.push(execPathDir); + return result.concat(options.path).join(path7.delimiter); + }, "npmRunPath"); + module2.exports = npmRunPath; + module2.exports.default = npmRunPath; + module2.exports.env = (options) => { + options = { + env: process.env, + ...options + }; + const env2 = { ...options.env }; + const path8 = pathKey({ env: env2 }); + options.path = env2[path8]; + env2[path8] = module2.exports(options); + return env2; + }; + } +}); + +// ../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +var require_mimic_fn = __commonJS({ + "../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports, module2) { + "use strict"; + var mimicFn = /* @__PURE__ */ __name((to, from) => { + for (const prop of Reflect.ownKeys(from)) { + Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); + } + return to; + }, "mimicFn"); + module2.exports = mimicFn; + module2.exports.default = mimicFn; + } +}); + +// ../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +var require_onetime = __commonJS({ + "../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports, module2) { + "use strict"; + var mimicFn = require_mimic_fn(); + var calledFunctions = /* @__PURE__ */ new WeakMap(); + var onetime = /* @__PURE__ */ __name((function_, options = {}) => { + if (typeof function_ !== "function") { + throw new TypeError("Expected a function"); + } + let returnValue; + let callCount = 0; + const functionName = function_.displayName || function_.name || ""; + const onetime2 = /* @__PURE__ */ __name(function(...arguments_) { + calledFunctions.set(onetime2, ++callCount); + if (callCount === 1) { + returnValue = function_.apply(this, arguments_); + function_ = null; + } else if (options.throw === true) { + throw new Error(`Function \`${functionName}\` can only be called once`); + } + return returnValue; + }, "onetime"); + mimicFn(onetime2, function_); + calledFunctions.set(onetime2, callCount); + return onetime2; + }, "onetime"); + module2.exports = onetime; + module2.exports.default = onetime; + module2.exports.callCount = (function_) => { + if (!calledFunctions.has(function_)) { + throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); + } + return calledFunctions.get(function_); + }; + } +}); + +// ../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +var require_core = __commonJS({ + "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SIGNALS = void 0; + var SIGNALS = [ + { + name: "SIGHUP", + number: 1, + action: "terminate", + description: "Terminal closed", + standard: "posix" + }, + { + name: "SIGINT", + number: 2, + action: "terminate", + description: "User interruption with CTRL-C", + standard: "ansi" + }, + { + name: "SIGQUIT", + number: 3, + action: "core", + description: "User interruption with CTRL-\\", + standard: "posix" + }, + { + name: "SIGILL", + number: 4, + action: "core", + description: "Invalid machine instruction", + standard: "ansi" + }, + { + name: "SIGTRAP", + number: 5, + action: "core", + description: "Debugger breakpoint", + standard: "posix" + }, + { + name: "SIGABRT", + number: 6, + action: "core", + description: "Aborted", + standard: "ansi" + }, + { + name: "SIGIOT", + number: 6, + action: "core", + description: "Aborted", + standard: "bsd" + }, + { + name: "SIGBUS", + number: 7, + action: "core", + description: "Bus error due to misaligned, non-existing address or paging error", + standard: "bsd" + }, + { + name: "SIGEMT", + number: 7, + action: "terminate", + description: "Command should be emulated but is not implemented", + standard: "other" + }, + { + name: "SIGFPE", + number: 8, + action: "core", + description: "Floating point arithmetic error", + standard: "ansi" + }, + { + name: "SIGKILL", + number: 9, + action: "terminate", + description: "Forced termination", + standard: "posix", + forced: true + }, + { + name: "SIGUSR1", + number: 10, + action: "terminate", + description: "Application-specific signal", + standard: "posix" + }, + { + name: "SIGSEGV", + number: 11, + action: "core", + description: "Segmentation fault", + standard: "ansi" + }, + { + name: "SIGUSR2", + number: 12, + action: "terminate", + description: "Application-specific signal", + standard: "posix" + }, + { + name: "SIGPIPE", + number: 13, + action: "terminate", + description: "Broken pipe or socket", + standard: "posix" + }, + { + name: "SIGALRM", + number: 14, + action: "terminate", + description: "Timeout or timer", + standard: "posix" + }, + { + name: "SIGTERM", + number: 15, + action: "terminate", + description: "Termination", + standard: "ansi" + }, + { + name: "SIGSTKFLT", + number: 16, + action: "terminate", + description: "Stack is empty or overflowed", + standard: "other" + }, + { + name: "SIGCHLD", + number: 17, + action: "ignore", + description: "Child process terminated, paused or unpaused", + standard: "posix" + }, + { + name: "SIGCLD", + number: 17, + action: "ignore", + description: "Child process terminated, paused or unpaused", + standard: "other" + }, + { + name: "SIGCONT", + number: 18, + action: "unpause", + description: "Unpaused", + standard: "posix", + forced: true + }, + { + name: "SIGSTOP", + number: 19, + action: "pause", + description: "Paused", + standard: "posix", + forced: true + }, + { + name: "SIGTSTP", + number: 20, + action: "pause", + description: 'Paused using CTRL-Z or "suspend"', + standard: "posix" + }, + { + name: "SIGTTIN", + number: 21, + action: "pause", + description: "Background process cannot read terminal input", + standard: "posix" + }, + { + name: "SIGBREAK", + number: 21, + action: "terminate", + description: "User interruption with CTRL-BREAK", + standard: "other" + }, + { + name: "SIGTTOU", + number: 22, + action: "pause", + description: "Background process cannot write to terminal output", + standard: "posix" + }, + { + name: "SIGURG", + number: 23, + action: "ignore", + description: "Socket received out-of-band data", + standard: "bsd" + }, + { + name: "SIGXCPU", + number: 24, + action: "core", + description: "Process timed out", + standard: "bsd" + }, + { + name: "SIGXFSZ", + number: 25, + action: "core", + description: "File too big", + standard: "bsd" + }, + { + name: "SIGVTALRM", + number: 26, + action: "terminate", + description: "Timeout or timer", + standard: "bsd" + }, + { + name: "SIGPROF", + number: 27, + action: "terminate", + description: "Timeout or timer", + standard: "bsd" + }, + { + name: "SIGWINCH", + number: 28, + action: "ignore", + description: "Terminal window size changed", + standard: "bsd" + }, + { + name: "SIGIO", + number: 29, + action: "terminate", + description: "I/O is available", + standard: "other" + }, + { + name: "SIGPOLL", + number: 29, + action: "terminate", + description: "Watched event", + standard: "other" + }, + { + name: "SIGINFO", + number: 29, + action: "ignore", + description: "Request for process information", + standard: "other" + }, + { + name: "SIGPWR", + number: 30, + action: "terminate", + description: "Device running out of power", + standard: "systemv" + }, + { + name: "SIGSYS", + number: 31, + action: "core", + description: "Invalid system call", + standard: "other" + }, + { + name: "SIGUNUSED", + number: 31, + action: "terminate", + description: "Invalid system call", + standard: "other" + } + ]; + exports.SIGNALS = SIGNALS; + } +}); + +// ../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +var require_realtime = __commonJS({ + "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SIGRTMAX = exports.getRealtimeSignals = void 0; + var getRealtimeSignals = /* @__PURE__ */ __name(function() { + const length = SIGRTMAX - SIGRTMIN + 1; + return Array.from({ length }, getRealtimeSignal); + }, "getRealtimeSignals"); + exports.getRealtimeSignals = getRealtimeSignals; + var getRealtimeSignal = /* @__PURE__ */ __name(function(value, index) { + return { + name: `SIGRT${index + 1}`, + number: SIGRTMIN + index, + action: "terminate", + description: "Application-specific signal (realtime)", + standard: "posix" + }; + }, "getRealtimeSignal"); + var SIGRTMIN = 34; + var SIGRTMAX = 64; + exports.SIGRTMAX = SIGRTMAX; + } +}); + +// ../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +var require_signals = __commonJS({ + "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getSignals = void 0; + var _os = require("os"); + var _core = require_core(); + var _realtime = require_realtime(); + var getSignals = /* @__PURE__ */ __name(function() { + const realtimeSignals = (0, _realtime.getRealtimeSignals)(); + const signals = [..._core.SIGNALS, ...realtimeSignals].map(normalizeSignal); + return signals; + }, "getSignals"); + exports.getSignals = getSignals; + var normalizeSignal = /* @__PURE__ */ __name(function({ + name, + number: defaultNumber, + description, + action, + forced = false, + standard + }) { + const { + signals: { [name]: constantSignal } + } = _os.constants; + const supported = constantSignal !== void 0; + const number = supported ? constantSignal : defaultNumber; + return { name, number, description, supported, action, forced, standard }; + }, "normalizeSignal"); + } +}); + +// ../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +var require_main = __commonJS({ + "../../node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.signalsByNumber = exports.signalsByName = void 0; + var _os = require("os"); + var _signals = require_signals(); + var _realtime = require_realtime(); + var getSignalsByName = /* @__PURE__ */ __name(function() { + const signals = (0, _signals.getSignals)(); + return signals.reduce(getSignalByName, {}); + }, "getSignalsByName"); + var getSignalByName = /* @__PURE__ */ __name(function(signalByNameMemo, { name, number, description, supported, action, forced, standard }) { + return { + ...signalByNameMemo, + [name]: { name, number, description, supported, action, forced, standard } + }; + }, "getSignalByName"); + var signalsByName = getSignalsByName(); + exports.signalsByName = signalsByName; + var getSignalsByNumber = /* @__PURE__ */ __name(function() { + const signals = (0, _signals.getSignals)(); + const length = _realtime.SIGRTMAX + 1; + const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals)); + return Object.assign({}, ...signalsA); + }, "getSignalsByNumber"); + var getSignalByNumber = /* @__PURE__ */ __name(function(number, signals) { + const signal = findSignalByNumber(number, signals); + if (signal === void 0) { + return {}; + } + const { name, description, supported, action, forced, standard } = signal; + return { + [number]: { + name, + number, + description, + supported, + action, + forced, + standard + } + }; + }, "getSignalByNumber"); + var findSignalByNumber = /* @__PURE__ */ __name(function(number, signals) { + const signal = signals.find(({ name }) => _os.constants.signals[name] === number); + if (signal !== void 0) { + return signal; + } + return signals.find((signalA) => signalA.number === number); + }, "findSignalByNumber"); + var signalsByNumber = getSignalsByNumber(); + exports.signalsByNumber = signalsByNumber; + } +}); + +// ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +var require_error = __commonJS({ + "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js"(exports, module2) { + "use strict"; + var { signalsByName } = require_main(); + var getErrorPrefix = /* @__PURE__ */ __name(({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => { + if (timedOut) { + return `timed out after ${timeout} milliseconds`; + } + if (isCanceled) { + return "was canceled"; + } + if (errorCode !== void 0) { + return `failed with ${errorCode}`; + } + if (signal !== void 0) { + return `was killed with ${signal} (${signalDescription})`; + } + if (exitCode !== void 0) { + return `failed with exit code ${exitCode}`; + } + return "failed"; + }, "getErrorPrefix"); + var makeError = /* @__PURE__ */ __name(({ + stdout, + stderr, + all, + error: error2, + signal, + exitCode, + command, + escapedCommand, + timedOut, + isCanceled, + killed, + parsed: { options: { timeout } } + }) => { + exitCode = exitCode === null ? void 0 : exitCode; + signal = signal === null ? void 0 : signal; + const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description; + const errorCode = error2 && error2.code; + const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }); + const execaMessage = `Command ${prefix}: ${command}`; + const isError2 = Object.prototype.toString.call(error2) === "[object Error]"; + const shortMessage = isError2 ? `${execaMessage} +${error2.message}` : execaMessage; + const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n"); + if (isError2) { + error2.originalMessage = error2.message; + error2.message = message; + } else { + error2 = new Error(message); + } + error2.shortMessage = shortMessage; + error2.command = command; + error2.escapedCommand = escapedCommand; + error2.exitCode = exitCode; + error2.signal = signal; + error2.signalDescription = signalDescription; + error2.stdout = stdout; + error2.stderr = stderr; + if (all !== void 0) { + error2.all = all; + } + if ("bufferedData" in error2) { + delete error2.bufferedData; + } + error2.failed = true; + error2.timedOut = Boolean(timedOut); + error2.isCanceled = isCanceled; + error2.killed = killed && !timedOut; + return error2; + }, "makeError"); + module2.exports = makeError; + } +}); + +// ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +var require_stdio = __commonJS({ + "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js"(exports, module2) { + "use strict"; + var aliases = ["stdin", "stdout", "stderr"]; + var hasAlias = /* @__PURE__ */ __name((options) => aliases.some((alias) => options[alias] !== void 0), "hasAlias"); + var normalizeStdio = /* @__PURE__ */ __name((options) => { + if (!options) { + return; + } + const { stdio } = options; + if (stdio === void 0) { + return aliases.map((alias) => options[alias]); + } + if (hasAlias(options)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`); + } + if (typeof stdio === "string") { + return stdio; + } + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } + const length = Math.max(stdio.length, aliases.length); + return Array.from({ length }, (value, index) => stdio[index]); + }, "normalizeStdio"); + module2.exports = normalizeStdio; + module2.exports.node = (options) => { + const stdio = normalizeStdio(options); + if (stdio === "ipc") { + return "ipc"; + } + if (stdio === void 0 || typeof stdio === "string") { + return [stdio, stdio, stdio, "ipc"]; + } + if (stdio.includes("ipc")) { + return stdio; + } + return [...stdio, "ipc"]; + }; + } +}); + +// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +var require_signals2 = __commonJS({ + "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports, module2) { + module2.exports = [ + "SIGABRT", + "SIGALRM", + "SIGHUP", + "SIGINT", + "SIGTERM" + ]; + if (process.platform !== "win32") { + module2.exports.push( + "SIGVTALRM", + "SIGXCPU", + "SIGXFSZ", + "SIGUSR2", + "SIGTRAP", + "SIGSYS", + "SIGQUIT", + "SIGIOT" + ); + } + if (process.platform === "linux") { + module2.exports.push( + "SIGIO", + "SIGPOLL", + "SIGPWR", + "SIGSTKFLT", + "SIGUNUSED" + ); + } + } +}); + +// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +var require_signal_exit = __commonJS({ + "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports, module2) { + var process2 = global.process; + var processOk = /* @__PURE__ */ __name(function(process3) { + return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function"; + }, "processOk"); + if (!processOk(process2)) { + module2.exports = function() { + return function() { + }; + }; + } else { + assert = require("assert"); + signals = require_signals2(); + isWin = /^win/i.test(process2.platform); + EE = require("events"); + if (typeof EE !== "function") { + EE = EE.EventEmitter; + } + if (process2.__signal_exit_emitter__) { + emitter = process2.__signal_exit_emitter__; + } else { + emitter = process2.__signal_exit_emitter__ = new EE(); + emitter.count = 0; + emitter.emitted = {}; + } + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity); + emitter.infinite = true; + } + module2.exports = function(cb, opts) { + if (!processOk(global.process)) { + return function() { + }; + } + assert.equal(typeof cb, "function", "a callback must be provided for exit handler"); + if (loaded === false) { + load(); + } + var ev = "exit"; + if (opts && opts.alwaysLast) { + ev = "afterexit"; + } + var remove = /* @__PURE__ */ __name(function() { + emitter.removeListener(ev, cb); + if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { + unload(); + } + }, "remove"); + emitter.on(ev, cb); + return remove; + }; + unload = /* @__PURE__ */ __name(function unload2() { + if (!loaded || !processOk(global.process)) { + return; + } + loaded = false; + signals.forEach(function(sig) { + try { + process2.removeListener(sig, sigListeners[sig]); + } catch (er) { + } + }); + process2.emit = originalProcessEmit; + process2.reallyExit = originalProcessReallyExit; + emitter.count -= 1; + }, "unload"); + module2.exports.unload = unload; + emit = /* @__PURE__ */ __name(function emit2(event, code, signal) { + if (emitter.emitted[event]) { + return; + } + emitter.emitted[event] = true; + emitter.emit(event, code, signal); + }, "emit"); + sigListeners = {}; + signals.forEach(function(sig) { + sigListeners[sig] = /* @__PURE__ */ __name(function listener() { + if (!processOk(global.process)) { + return; + } + var listeners = process2.listeners(sig); + if (listeners.length === emitter.count) { + unload(); + emit("exit", null, sig); + emit("afterexit", null, sig); + if (isWin && sig === "SIGHUP") { + sig = "SIGINT"; + } + process2.kill(process2.pid, sig); + } + }, "listener"); + }); + module2.exports.signals = function() { + return signals; + }; + loaded = false; + load = /* @__PURE__ */ __name(function load2() { + if (loaded || !processOk(global.process)) { + return; + } + loaded = true; + emitter.count += 1; + signals = signals.filter(function(sig) { + try { + process2.on(sig, sigListeners[sig]); + return true; + } catch (er) { + return false; + } + }); + process2.emit = processEmit; + process2.reallyExit = processReallyExit; + }, "load"); + module2.exports.load = load; + originalProcessReallyExit = process2.reallyExit; + processReallyExit = /* @__PURE__ */ __name(function processReallyExit2(code) { + if (!processOk(global.process)) { + return; + } + process2.exitCode = code || 0; + emit("exit", process2.exitCode, null); + emit("afterexit", process2.exitCode, null); + originalProcessReallyExit.call(process2, process2.exitCode); + }, "processReallyExit"); + originalProcessEmit = process2.emit; + processEmit = /* @__PURE__ */ __name(function processEmit2(ev, arg2) { + if (ev === "exit" && processOk(global.process)) { + if (arg2 !== void 0) { + process2.exitCode = arg2; + } + var ret = originalProcessEmit.apply(this, arguments); + emit("exit", process2.exitCode, null); + emit("afterexit", process2.exitCode, null); + return ret; + } else { + return originalProcessEmit.apply(this, arguments); + } + }, "processEmit"); + } + var assert; + var signals; + var isWin; + var EE; + var emitter; + var unload; + var emit; + var sigListeners; + var loaded; + var load; + var originalProcessReallyExit; + var processReallyExit; + var originalProcessEmit; + var processEmit; + } +}); + +// ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +var require_kill = __commonJS({ + "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js"(exports, module2) { + "use strict"; + var os3 = require("os"); + var onExit = require_signal_exit(); + var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5; + var spawnedKill = /* @__PURE__ */ __name((kill, signal = "SIGTERM", options = {}) => { + const killResult = kill(signal); + setKillTimeout(kill, signal, options, killResult); + return killResult; + }, "spawnedKill"); + var setKillTimeout = /* @__PURE__ */ __name((kill, signal, options, killResult) => { + if (!shouldForceKill(signal, options, killResult)) { + return; + } + const timeout = getForceKillAfterTimeout(options); + const t = setTimeout(() => { + kill("SIGKILL"); + }, timeout); + if (t.unref) { + t.unref(); + } + }, "setKillTimeout"); + var shouldForceKill = /* @__PURE__ */ __name((signal, { forceKillAfterTimeout }, killResult) => { + return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; + }, "shouldForceKill"); + var isSigterm = /* @__PURE__ */ __name((signal) => { + return signal === os3.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM"; + }, "isSigterm"); + var getForceKillAfterTimeout = /* @__PURE__ */ __name(({ forceKillAfterTimeout = true }) => { + if (forceKillAfterTimeout === true) { + return DEFAULT_FORCE_KILL_TIMEOUT; + } + if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { + throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); + } + return forceKillAfterTimeout; + }, "getForceKillAfterTimeout"); + var spawnedCancel = /* @__PURE__ */ __name((spawned, context3) => { + const killResult = spawned.kill(); + if (killResult) { + context3.isCanceled = true; + } + }, "spawnedCancel"); + var timeoutKill = /* @__PURE__ */ __name((spawned, signal, reject) => { + spawned.kill(signal); + reject(Object.assign(new Error("Timed out"), { timedOut: true, signal })); + }, "timeoutKill"); + var setupTimeout = /* @__PURE__ */ __name((spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => { + if (timeout === 0 || timeout === void 0) { + return spawnedPromise; + } + let timeoutId; + const timeoutPromise = new Promise((resolve, reject) => { + timeoutId = setTimeout(() => { + timeoutKill(spawned, killSignal, reject); + }, timeout); + }); + const safeSpawnedPromise = spawnedPromise.finally(() => { + clearTimeout(timeoutId); + }); + return Promise.race([timeoutPromise, safeSpawnedPromise]); + }, "setupTimeout"); + var validateTimeout = /* @__PURE__ */ __name(({ timeout }) => { + if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) { + throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); + } + }, "validateTimeout"); + var setExitHandler = /* @__PURE__ */ __name(async (spawned, { cleanup, detached }, timedPromise) => { + if (!cleanup || detached) { + return timedPromise; + } + const removeExitHandler = onExit(() => { + spawned.kill(); + }); + return timedPromise.finally(() => { + removeExitHandler(); + }); + }, "setExitHandler"); + module2.exports = { + spawnedKill, + spawnedCancel, + setupTimeout, + validateTimeout, + setExitHandler + }; + } +}); + +// ../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +var require_is_stream = __commonJS({ + "../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js"(exports, module2) { + "use strict"; + var isStream = /* @__PURE__ */ __name((stream2) => stream2 !== null && typeof stream2 === "object" && typeof stream2.pipe === "function", "isStream"); + isStream.writable = (stream2) => isStream(stream2) && stream2.writable !== false && typeof stream2._write === "function" && typeof stream2._writableState === "object"; + isStream.readable = (stream2) => isStream(stream2) && stream2.readable !== false && typeof stream2._read === "function" && typeof stream2._readableState === "object"; + isStream.duplex = (stream2) => isStream.writable(stream2) && isStream.readable(stream2); + isStream.transform = (stream2) => isStream.duplex(stream2) && typeof stream2._transform === "function"; + module2.exports = isStream; + } +}); + +// ../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +var require_buffer_stream = __commonJS({ + "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js"(exports, module2) { + "use strict"; + var { PassThrough: PassThroughStream } = require("stream"); + module2.exports = (options) => { + options = { ...options }; + const { array } = options; + let { encoding } = options; + const isBuffer = encoding === "buffer"; + let objectMode = false; + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || "utf8"; + } + if (isBuffer) { + encoding = null; + } + const stream2 = new PassThroughStream({ objectMode }); + if (encoding) { + stream2.setEncoding(encoding); + } + let length = 0; + const chunks = []; + stream2.on("data", (chunk) => { + chunks.push(chunk); + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); + stream2.getBufferedValue = () => { + if (array) { + return chunks; + } + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(""); + }; + stream2.getBufferedLength = () => length; + return stream2; + }; + } +}); + +// ../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +var require_get_stream = __commonJS({ + "../../node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js"(exports, module2) { + "use strict"; + var { constants: BufferConstants } = require("buffer"); + var stream2 = require("stream"); + var { promisify: promisify4 } = require("util"); + var bufferStream = require_buffer_stream(); + var streamPipelinePromisified = promisify4(stream2.pipeline); + var MaxBufferError = class extends Error { + constructor() { + super("maxBuffer exceeded"); + this.name = "MaxBufferError"; + } + }; + __name(MaxBufferError, "MaxBufferError"); + async function getStream2(inputStream, options) { + if (!inputStream) { + throw new Error("Expected a stream"); + } + options = { + maxBuffer: Infinity, + ...options + }; + const { maxBuffer } = options; + const stream3 = bufferStream(options); + await new Promise((resolve, reject) => { + const rejectPromise = /* @__PURE__ */ __name((error2) => { + if (error2 && stream3.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error2.bufferedData = stream3.getBufferedValue(); + } + reject(error2); + }, "rejectPromise"); + (async () => { + try { + await streamPipelinePromisified(inputStream, stream3); + resolve(); + } catch (error2) { + rejectPromise(error2); + } + })(); + stream3.on("data", () => { + if (stream3.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); + return stream3.getBufferedValue(); + } + __name(getStream2, "getStream"); + module2.exports = getStream2; + module2.exports.buffer = (stream3, options) => getStream2(stream3, { ...options, encoding: "buffer" }); + module2.exports.array = (stream3, options) => getStream2(stream3, { ...options, array: true }); + module2.exports.MaxBufferError = MaxBufferError; + } +}); + +// ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +var require_merge_stream = __commonJS({ + "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module2) { + "use strict"; + var { PassThrough } = require("stream"); + module2.exports = function() { + var sources = []; + var output = new PassThrough({ objectMode: true }); + output.setMaxListeners(0); + output.add = add2; + output.isEmpty = isEmpty; + output.on("unpipe", remove); + Array.prototype.slice.call(arguments).forEach(add2); + return output; + function add2(source) { + if (Array.isArray(source)) { + source.forEach(add2); + return this; + } + sources.push(source); + source.once("end", remove.bind(null, source)); + source.once("error", output.emit.bind(output, "error")); + source.pipe(output, { end: false }); + return this; + } + __name(add2, "add"); + function isEmpty() { + return sources.length == 0; + } + __name(isEmpty, "isEmpty"); + function remove(source) { + sources = sources.filter(function(it) { + return it !== source; + }); + if (!sources.length && output.readable) { + output.end(); + } + } + __name(remove, "remove"); + }; + } +}); + +// ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +var require_stream = __commonJS({ + "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js"(exports, module2) { + "use strict"; + var isStream = require_is_stream(); + var getStream2 = require_get_stream(); + var mergeStream = require_merge_stream(); + var handleInput = /* @__PURE__ */ __name((spawned, input) => { + if (input === void 0 || spawned.stdin === void 0) { + return; + } + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } + }, "handleInput"); + var makeAllStream = /* @__PURE__ */ __name((spawned, { all }) => { + if (!all || !spawned.stdout && !spawned.stderr) { + return; + } + const mixed = mergeStream(); + if (spawned.stdout) { + mixed.add(spawned.stdout); + } + if (spawned.stderr) { + mixed.add(spawned.stderr); + } + return mixed; + }, "makeAllStream"); + var getBufferedData = /* @__PURE__ */ __name(async (stream2, streamPromise) => { + if (!stream2) { + return; + } + stream2.destroy(); + try { + return await streamPromise; + } catch (error2) { + return error2.bufferedData; + } + }, "getBufferedData"); + var getStreamPromise = /* @__PURE__ */ __name((stream2, { encoding, buffer, maxBuffer }) => { + if (!stream2 || !buffer) { + return; + } + if (encoding) { + return getStream2(stream2, { encoding, maxBuffer }); + } + return getStream2.buffer(stream2, { maxBuffer }); + }, "getStreamPromise"); + var getSpawnedResult = /* @__PURE__ */ __name(async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => { + const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer }); + const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer }); + const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 }); + try { + return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); + } catch (error2) { + return Promise.all([ + { error: error2, signal: error2.signal, timedOut: error2.timedOut }, + getBufferedData(stdout, stdoutPromise), + getBufferedData(stderr, stderrPromise), + getBufferedData(all, allPromise) + ]); + } + }, "getSpawnedResult"); + var validateInputSync = /* @__PURE__ */ __name(({ input }) => { + if (isStream(input)) { + throw new TypeError("The `input` option cannot be a stream in sync mode"); + } + }, "validateInputSync"); + module2.exports = { + handleInput, + makeAllStream, + getSpawnedResult, + validateInputSync + }; + } +}); + +// ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +var require_promise = __commonJS({ + "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js"(exports, module2) { + "use strict"; + var nativePromisePrototype = (async () => { + })().constructor.prototype; + var descriptors = ["then", "catch", "finally"].map((property) => [ + property, + Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) + ]); + var mergePromise = /* @__PURE__ */ __name((spawned, promise) => { + for (const [property, descriptor] of descriptors) { + const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise); + Reflect.defineProperty(spawned, property, { ...descriptor, value }); + } + return spawned; + }, "mergePromise"); + var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => { + return new Promise((resolve, reject) => { + spawned.on("exit", (exitCode, signal) => { + resolve({ exitCode, signal }); + }); + spawned.on("error", (error2) => { + reject(error2); + }); + if (spawned.stdin) { + spawned.stdin.on("error", (error2) => { + reject(error2); + }); + } + }); + }, "getSpawnedPromise"); + module2.exports = { + mergePromise, + getSpawnedPromise + }; + } +}); + +// ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +var require_command = __commonJS({ + "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js"(exports, module2) { + "use strict"; + var normalizeArgs = /* @__PURE__ */ __name((file, args = []) => { + if (!Array.isArray(args)) { + return [file]; + } + return [file, ...args]; + }, "normalizeArgs"); + var NO_ESCAPE_REGEXP = /^[\w.-]+$/; + var DOUBLE_QUOTES_REGEXP = /"/g; + var escapeArg = /* @__PURE__ */ __name((arg2) => { + if (typeof arg2 !== "string" || NO_ESCAPE_REGEXP.test(arg2)) { + return arg2; + } + return `"${arg2.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`; + }, "escapeArg"); + var joinCommand = /* @__PURE__ */ __name((file, args) => { + return normalizeArgs(file, args).join(" "); + }, "joinCommand"); + var getEscapedCommand = /* @__PURE__ */ __name((file, args) => { + return normalizeArgs(file, args).map((arg2) => escapeArg(arg2)).join(" "); + }, "getEscapedCommand"); + var SPACES_REGEXP = / +/g; + var parseCommand = /* @__PURE__ */ __name((command) => { + const tokens = []; + for (const token of command.trim().split(SPACES_REGEXP)) { + const previousToken = tokens[tokens.length - 1]; + if (previousToken && previousToken.endsWith("\\")) { + tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; + } else { + tokens.push(token); + } + } + return tokens; + }, "parseCommand"); + module2.exports = { + joinCommand, + getEscapedCommand, + parseCommand + }; + } +}); + +// ../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +var require_execa = __commonJS({ + "../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js"(exports, module2) { + "use strict"; + var path7 = require("path"); + var childProcess = require("child_process"); + var crossSpawn = require_cross_spawn(); + var stripFinalNewline = require_strip_final_newline(); + var npmRunPath = require_npm_run_path(); + var onetime = require_onetime(); + var makeError = require_error(); + var normalizeStdio = require_stdio(); + var { spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler } = require_kill(); + var { handleInput, getSpawnedResult, makeAllStream, validateInputSync } = require_stream(); + var { mergePromise, getSpawnedPromise } = require_promise(); + var { joinCommand, parseCommand, getEscapedCommand } = require_command(); + var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100; + var getEnv2 = /* @__PURE__ */ __name(({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => { + const env2 = extendEnv ? { ...process.env, ...envOption } : envOption; + if (preferLocal) { + return npmRunPath.env({ env: env2, cwd: localDir, execPath }); + } + return env2; + }, "getEnv"); + var handleArguments = /* @__PURE__ */ __name((file, args, options = {}) => { + const parsed = crossSpawn._parse(file, args, options); + file = parsed.command; + args = parsed.args; + options = parsed.options; + options = { + maxBuffer: DEFAULT_MAX_BUFFER, + buffer: true, + stripFinalNewline: true, + extendEnv: true, + preferLocal: false, + localDir: options.cwd || process.cwd(), + execPath: process.execPath, + encoding: "utf8", + reject: true, + cleanup: true, + all: false, + windowsHide: true, + ...options + }; + options.env = getEnv2(options); + options.stdio = normalizeStdio(options); + if (process.platform === "win32" && path7.basename(file, ".exe") === "cmd") { + args.unshift("/q"); + } + return { file, args, options, parsed }; + }, "handleArguments"); + var handleOutput = /* @__PURE__ */ __name((options, value, error2) => { + if (typeof value !== "string" && !Buffer.isBuffer(value)) { + return error2 === void 0 ? void 0 : ""; + } + if (options.stripFinalNewline) { + return stripFinalNewline(value); + } + return value; + }, "handleOutput"); + var execa2 = /* @__PURE__ */ __name((file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); + const escapedCommand = getEscapedCommand(file, args); + validateTimeout(parsed.options); + let spawned; + try { + spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); + } catch (error2) { + const dummySpawned = new childProcess.ChildProcess(); + const errorPromise = Promise.reject(makeError({ + error: error2, + stdout: "", + stderr: "", + all: "", + command, + escapedCommand, + parsed, + timedOut: false, + isCanceled: false, + killed: false + })); + return mergePromise(dummySpawned, errorPromise); + } + const spawnedPromise = getSpawnedPromise(spawned); + const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); + const processDone = setExitHandler(spawned, parsed.options, timedPromise); + const context3 = { isCanceled: false }; + spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); + spawned.cancel = spawnedCancel.bind(null, spawned, context3); + const handlePromise = /* @__PURE__ */ __name(async () => { + const [{ error: error2, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); + const stdout = handleOutput(parsed.options, stdoutResult); + const stderr = handleOutput(parsed.options, stderrResult); + const all = handleOutput(parsed.options, allResult); + if (error2 || exitCode !== 0 || signal !== null) { + const returnedError = makeError({ + error: error2, + exitCode, + signal, + stdout, + stderr, + all, + command, + escapedCommand, + parsed, + timedOut, + isCanceled: context3.isCanceled, + killed: spawned.killed + }); + if (!parsed.options.reject) { + return returnedError; + } + throw returnedError; + } + return { + command, + escapedCommand, + exitCode: 0, + stdout, + stderr, + all, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; + }, "handlePromise"); + const handlePromiseOnce = onetime(handlePromise); + handleInput(spawned, parsed.options.input); + spawned.all = makeAllStream(spawned, parsed.options); + return mergePromise(spawned, handlePromiseOnce); + }, "execa"); + module2.exports = execa2; + module2.exports.sync = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); + const escapedCommand = getEscapedCommand(file, args); + validateInputSync(parsed.options); + let result; + try { + result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); + } catch (error2) { + throw makeError({ + error: error2, + stdout: "", + stderr: "", + all: "", + command, + escapedCommand, + parsed, + timedOut: false, + isCanceled: false, + killed: false + }); + } + const stdout = handleOutput(parsed.options, result.stdout, result.error); + const stderr = handleOutput(parsed.options, result.stderr, result.error); + if (result.error || result.status !== 0 || result.signal !== null) { + const error2 = makeError({ + stdout, + stderr, + error: result.error, + signal: result.signal, + exitCode: result.status, + command, + escapedCommand, + parsed, + timedOut: result.error && result.error.code === "ETIMEDOUT", + isCanceled: false, + killed: result.signal !== null + }); + if (!parsed.options.reject) { + return error2; + } + throw error2; + } + return { + command, + escapedCommand, + exitCode: 0, + stdout, + stderr, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; + }; + module2.exports.command = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa2(file, args, options); + }; + module2.exports.commandSync = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa2.sync(file, args, options); + }; + module2.exports.node = (scriptPath, args, options = {}) => { + if (args && !Array.isArray(args) && typeof args === "object") { + options = args; + args = []; + } + const stdio = normalizeStdio.node(options); + const defaultExecArgv = process.execArgv.filter((arg2) => !arg2.startsWith("--inspect")); + const { + nodePath = process.execPath, + nodeOptions = defaultExecArgv + } = options; + return execa2( + nodePath, + [ + ...nodeOptions, + scriptPath, + ...Array.isArray(args) ? args : [] + ], + { + ...options, + stdin: void 0, + stdout: void 0, + stderr: void 0, + stdio, + shell: false + } + ); + }; + } +}); + +// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js +var require_retry_operation = __commonJS({ + "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module2) { + function RetryOperation(timeouts, options) { + if (typeof options === "boolean") { + options = { forever: options }; + } + this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); + this._timeouts = timeouts; + this._options = options || {}; + this._maxRetryTime = options && options.maxRetryTime || Infinity; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + this._operationStart = null; + this._timer = null; + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } + } + __name(RetryOperation, "RetryOperation"); + module2.exports = RetryOperation; + RetryOperation.prototype.reset = function() { + this._attempts = 1; + this._timeouts = this._originalTimeouts.slice(0); + }; + RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + if (this._timer) { + clearTimeout(this._timer); + } + this._timeouts = []; + this._cachedTimeouts = null; + }; + RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + if (!err) { + return false; + } + var currentTime = new Date().getTime(); + if (err && currentTime - this._operationStart >= this._maxRetryTime) { + this._errors.push(err); + this._errors.unshift(new Error("RetryOperation timeout occurred")); + return false; + } + this._errors.push(err); + var timeout = this._timeouts.shift(); + if (timeout === void 0) { + if (this._cachedTimeouts) { + this._errors.splice(0, this._errors.length - 1); + timeout = this._cachedTimeouts.slice(-1); + } else { + return false; + } + } + var self2 = this; + this._timer = setTimeout(function() { + self2._attempts++; + if (self2._operationTimeoutCb) { + self2._timeout = setTimeout(function() { + self2._operationTimeoutCb(self2._attempts); + }, self2._operationTimeout); + if (self2._options.unref) { + self2._timeout.unref(); + } + } + self2._fn(self2._attempts); + }, timeout); + if (this._options.unref) { + this._timer.unref(); + } + return true; + }; + RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + var self2 = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self2._operationTimeoutCb(); + }, self2._operationTimeout); + } + this._operationStart = new Date().getTime(); + this._fn(this._attempts); + }; + RetryOperation.prototype.try = function(fn) { + console.log("Using RetryOperation.try() is deprecated"); + this.attempt(fn); + }; + RetryOperation.prototype.start = function(fn) { + console.log("Using RetryOperation.start() is deprecated"); + this.attempt(fn); + }; + RetryOperation.prototype.start = RetryOperation.prototype.try; + RetryOperation.prototype.errors = function() { + return this._errors; + }; + RetryOperation.prototype.attempts = function() { + return this._attempts; + }; + RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + for (var i = 0; i < this._errors.length; i++) { + var error2 = this._errors[i]; + var message = error2.message; + var count2 = (counts[message] || 0) + 1; + counts[message] = count2; + if (count2 >= mainErrorCount) { + mainError = error2; + mainErrorCount = count2; + } + } + return mainError; + }; + } +}); + +// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js +var require_retry = __commonJS({ + "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports) { + var RetryOperation = require_retry_operation(); + exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && (options.forever || options.retries === Infinity), + unref: options && options.unref, + maxRetryTime: options && options.maxRetryTime + }); + }; + exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1e3, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + if (opts.minTimeout > opts.maxTimeout) { + throw new Error("minTimeout is greater than maxTimeout"); + } + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + timeouts.sort(function(a, b) { + return a - b; + }); + return timeouts; + }; + exports.createTimeout = function(attempt, opts) { + var random2 = opts.randomize ? Math.random() + 1 : 1; + var timeout = Math.round(random2 * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + return timeout; + }; + exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === "function") { + methods.push(key); + } + } + } + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + obj[method] = (/* @__PURE__ */ __name(function retryWrapper(original2) { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments, 1); + var callback = args.pop(); + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + op.attempt(function() { + original2.apply(obj, args); + }); + }, "retryWrapper")).bind(obj, original); + obj[method].options = options; + } + }; + } +}); + +// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js +var require_retry2 = __commonJS({ + "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module2) { + module2.exports = require_retry(); + } +}); + +// ../../node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js +var require_p_retry = __commonJS({ + "../../node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js"(exports, module2) { + "use strict"; + var retry = require_retry2(); + var networkErrorMsgs = [ + "Failed to fetch", + "NetworkError when attempting to fetch resource.", + "The Internet connection appears to be offline.", + "Network request failed" + ]; + var AbortError = class extends Error { + constructor(message) { + super(); + if (message instanceof Error) { + this.originalError = message; + ({ message } = message); + } else { + this.originalError = new Error(message); + this.originalError.stack = this.stack; + } + this.name = "AbortError"; + this.message = message; + } + }; + __name(AbortError, "AbortError"); + var decorateErrorWithCounts = /* @__PURE__ */ __name((error2, attemptNumber, options) => { + const retriesLeft = options.retries - (attemptNumber - 1); + error2.attemptNumber = attemptNumber; + error2.retriesLeft = retriesLeft; + return error2; + }, "decorateErrorWithCounts"); + var isNetworkError = /* @__PURE__ */ __name((errorMessage) => networkErrorMsgs.includes(errorMessage), "isNetworkError"); + var pRetry2 = /* @__PURE__ */ __name((input, options) => new Promise((resolve, reject) => { + options = { + onFailedAttempt: () => { + }, + retries: 10, + ...options + }; + const operation = retry.operation(options); + operation.attempt(async (attemptNumber) => { + try { + resolve(await input(attemptNumber)); + } catch (error2) { + if (!(error2 instanceof Error)) { + reject(new TypeError(`Non-error was thrown: "${error2}". You should only throw errors.`)); + return; + } + if (error2 instanceof AbortError) { + operation.stop(); + reject(error2.originalError); + } else if (error2 instanceof TypeError && !isNetworkError(error2.message)) { + operation.stop(); + reject(error2); + } else { + decorateErrorWithCounts(error2, attemptNumber, options); + try { + await options.onFailedAttempt(error2); + } catch (error3) { + reject(error3); + return; + } + if (!operation.retry(error2)) { + reject(operation.mainError()); + } + } + } + }); + }), "pRetry"); + module2.exports = pRetry2; + module2.exports.default = pRetry2; + module2.exports.AbortError = AbortError; + } +}); + +// ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js +var require_ansi_regex = __commonJS({ + "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module2) { + "use strict"; + module2.exports = ({ onlyFirst = false } = {}) => { + const pattern = [ + "[\\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(pattern, onlyFirst ? void 0 : "g"); + }; + } +}); + +// ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js +var require_strip_ansi = __commonJS({ + "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module2) { + "use strict"; + var ansiRegex = require_ansi_regex(); + module2.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string; + } +}); + +// ../../node_modules/.pnpm/new-github-issue-url@0.2.1/node_modules/new-github-issue-url/index.js +var require_new_github_issue_url = __commonJS({ + "../../node_modules/.pnpm/new-github-issue-url@0.2.1/node_modules/new-github-issue-url/index.js"(exports, module2) { + "use strict"; + module2.exports = (options = {}) => { + let repoUrl; + if (options.repoUrl) { + repoUrl = options.repoUrl; + } else if (options.user && options.repo) { + repoUrl = `https://github.com/${options.user}/${options.repo}`; + } else { + throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options"); + } + const url = new URL(`${repoUrl}/issues/new`); + const types = [ + "body", + "title", + "labels", + "template", + "milestone", + "assignee", + "projects" + ]; + for (const type of types) { + let value = options[type]; + if (value === void 0) { + continue; + } + if (type === "labels" || type === "projects") { + if (!Array.isArray(value)) { + throw new TypeError(`The \`${type}\` option should be an array`); + } + value = value.join(","); + } + url.searchParams.set(type, value); + } + return url.toString(); + }; + module2.exports.default = module2.exports; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/symbols.js +var require_symbols = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/symbols.js"(exports, module2) { + module2.exports = { + kClose: Symbol("close"), + kDestroy: Symbol("destroy"), + kDispatch: Symbol("dispatch"), + kUrl: Symbol("url"), + kWriting: Symbol("writing"), + kResuming: Symbol("resuming"), + kQueue: Symbol("queue"), + kConnect: Symbol("connect"), + kConnecting: Symbol("connecting"), + kHeadersList: Symbol("headers list"), + kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), + kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), + kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), + kKeepAliveTimeoutValue: Symbol("keep alive timeout"), + kKeepAlive: Symbol("keep alive"), + kHeadersTimeout: Symbol("headers timeout"), + kBodyTimeout: Symbol("body timeout"), + kServerName: Symbol("server name"), + kHost: Symbol("host"), + kNoRef: Symbol("no ref"), + kBodyUsed: Symbol("used"), + kRunning: Symbol("running"), + kBlocking: Symbol("blocking"), + kPending: Symbol("pending"), + kSize: Symbol("size"), + kBusy: Symbol("busy"), + kQueued: Symbol("queued"), + kFree: Symbol("free"), + kConnected: Symbol("connected"), + kClosed: Symbol("closed"), + kNeedDrain: Symbol("need drain"), + kReset: Symbol("reset"), + kDestroyed: Symbol("destroyed"), + kMaxHeadersSize: Symbol("max headers size"), + kRunningIdx: Symbol("running index"), + kPendingIdx: Symbol("pending index"), + kError: Symbol("error"), + kClients: Symbol("clients"), + kClient: Symbol("client"), + kParser: Symbol("parser"), + kOnDestroyed: Symbol("destroy callbacks"), + kPipelining: Symbol("pipelinig"), + kSocket: Symbol("socket"), + kHostHeader: Symbol("host header"), + kConnector: Symbol("connector"), + kStrictContentLength: Symbol("strict content length"), + kMaxRedirections: Symbol("maxRedirections"), + kMaxRequests: Symbol("maxRequestsPerClient"), + kProxy: Symbol("proxy agent options"), + kCounter: Symbol("socket request counter") + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/errors.js +var require_errors = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/errors.js"(exports, module2) { + "use strict"; + var UndiciError = class extends Error { + constructor(message) { + super(message); + this.name = "UndiciError"; + this.code = "UND_ERR"; + } + }; + __name(UndiciError, "UndiciError"); + var ConnectTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, ConnectTimeoutError); + this.name = "ConnectTimeoutError"; + this.message = message || "Connect Timeout Error"; + this.code = "UND_ERR_CONNECT_TIMEOUT"; + } + }; + __name(ConnectTimeoutError, "ConnectTimeoutError"); + var HeadersTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, HeadersTimeoutError); + this.name = "HeadersTimeoutError"; + this.message = message || "Headers Timeout Error"; + this.code = "UND_ERR_HEADERS_TIMEOUT"; + } + }; + __name(HeadersTimeoutError, "HeadersTimeoutError"); + var HeadersOverflowError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, HeadersOverflowError); + this.name = "HeadersOverflowError"; + this.message = message || "Headers Overflow Error"; + this.code = "UND_ERR_HEADERS_OVERFLOW"; + } + }; + __name(HeadersOverflowError, "HeadersOverflowError"); + var BodyTimeoutError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, BodyTimeoutError); + this.name = "BodyTimeoutError"; + this.message = message || "Body Timeout Error"; + this.code = "UND_ERR_BODY_TIMEOUT"; + } + }; + __name(BodyTimeoutError, "BodyTimeoutError"); + var ResponseStatusCodeError = class extends UndiciError { + constructor(message, statusCode, headers, body) { + super(message); + Error.captureStackTrace(this, ResponseStatusCodeError); + this.name = "ResponseStatusCodeError"; + this.message = message || "Response Status Code Error"; + this.code = "UND_ERR_RESPONSE_STATUS_CODE"; + this.body = body; + this.status = statusCode; + this.statusCode = statusCode; + this.headers = headers; + } + }; + __name(ResponseStatusCodeError, "ResponseStatusCodeError"); + var InvalidArgumentError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, InvalidArgumentError); + this.name = "InvalidArgumentError"; + this.message = message || "Invalid Argument Error"; + this.code = "UND_ERR_INVALID_ARG"; + } + }; + __name(InvalidArgumentError, "InvalidArgumentError"); + var InvalidReturnValueError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, InvalidReturnValueError); + this.name = "InvalidReturnValueError"; + this.message = message || "Invalid Return Value Error"; + this.code = "UND_ERR_INVALID_RETURN_VALUE"; + } + }; + __name(InvalidReturnValueError, "InvalidReturnValueError"); + var RequestAbortedError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, RequestAbortedError); + this.name = "AbortError"; + this.message = message || "Request aborted"; + this.code = "UND_ERR_ABORTED"; + } + }; + __name(RequestAbortedError, "RequestAbortedError"); + var InformationalError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, InformationalError); + this.name = "InformationalError"; + this.message = message || "Request information"; + this.code = "UND_ERR_INFO"; + } + }; + __name(InformationalError, "InformationalError"); + var RequestContentLengthMismatchError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, RequestContentLengthMismatchError); + this.name = "RequestContentLengthMismatchError"; + this.message = message || "Request body length does not match content-length header"; + this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; + } + }; + __name(RequestContentLengthMismatchError, "RequestContentLengthMismatchError"); + var ResponseContentLengthMismatchError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, ResponseContentLengthMismatchError); + this.name = "ResponseContentLengthMismatchError"; + this.message = message || "Response body length does not match content-length header"; + this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; + } + }; + __name(ResponseContentLengthMismatchError, "ResponseContentLengthMismatchError"); + var ClientDestroyedError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, ClientDestroyedError); + this.name = "ClientDestroyedError"; + this.message = message || "The client is destroyed"; + this.code = "UND_ERR_DESTROYED"; + } + }; + __name(ClientDestroyedError, "ClientDestroyedError"); + var ClientClosedError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, ClientClosedError); + this.name = "ClientClosedError"; + this.message = message || "The client is closed"; + this.code = "UND_ERR_CLOSED"; + } + }; + __name(ClientClosedError, "ClientClosedError"); + var SocketError = class extends UndiciError { + constructor(message, socket) { + super(message); + Error.captureStackTrace(this, SocketError); + this.name = "SocketError"; + this.message = message || "Socket error"; + this.code = "UND_ERR_SOCKET"; + this.socket = socket; + } + }; + __name(SocketError, "SocketError"); + var NotSupportedError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, NotSupportedError); + this.name = "NotSupportedError"; + this.message = message || "Not supported error"; + this.code = "UND_ERR_NOT_SUPPORTED"; + } + }; + __name(NotSupportedError, "NotSupportedError"); + var BalancedPoolMissingUpstreamError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, NotSupportedError); + this.name = "MissingUpstreamError"; + this.message = message || "No upstream has been added to the BalancedPool"; + this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; + } + }; + __name(BalancedPoolMissingUpstreamError, "BalancedPoolMissingUpstreamError"); + var HTTPParserError = class extends Error { + constructor(message, code, data) { + super(message); + Error.captureStackTrace(this, HTTPParserError); + this.name = "HTTPParserError"; + this.code = code ? `HPE_${code}` : void 0; + this.data = data ? data.toString() : void 0; + } + }; + __name(HTTPParserError, "HTTPParserError"); + module2.exports = { + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/util.js +var require_util2 = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/util.js"(exports, module2) { + "use strict"; + var assert = require("assert"); + var { kDestroyed, kBodyUsed } = require_symbols(); + var { IncomingMessage } = require("http"); + var stream2 = require("stream"); + var net2 = require("net"); + var { InvalidArgumentError } = require_errors(); + var { Blob } = require("buffer"); + var nodeUtil = require("util"); + function nop() { + } + __name(nop, "nop"); + function isStream(obj) { + return obj && typeof obj.pipe === "function"; + } + __name(isStream, "isStream"); + function isBlobLike(object) { + return Blob && object instanceof Blob || object && typeof object === "object" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]); + } + __name(isBlobLike, "isBlobLike"); + function isObject3(val) { + return val !== null && typeof val === "object"; + } + __name(isObject3, "isObject"); + function encode(val) { + return encodeURIComponent(val); + } + __name(encode, "encode"); + function buildURL(url, queryParams) { + if (url.includes("?") || url.includes("#")) { + throw new Error('Query params cannot be passed when url already contains "?" or "#".'); + } + if (!isObject3(queryParams)) { + throw new Error("Query params must be an object"); + } + const parts = []; + for (let [key, val] of Object.entries(queryParams)) { + if (val === null || typeof val === "undefined") { + continue; + } + if (!Array.isArray(val)) { + val = [val]; + } + for (const v of val) { + if (isObject3(v)) { + throw new Error("Passing object as a query param is not supported, please serialize to string up-front"); + } + parts.push(encode(key) + "=" + encode(v)); + } + } + const serializedParams = parts.join("&"); + if (serializedParams) { + url += "?" + serializedParams; + } + return url; + } + __name(buildURL, "buildURL"); + function parseURL(url) { + if (typeof url === "string") { + url = new URL(url); + } + if (!url || typeof url !== "object") { + throw new InvalidArgumentError("invalid url"); + } + if (url.port != null && url.port !== "" && !Number.isFinite(parseInt(url.port))) { + throw new InvalidArgumentError("invalid port"); + } + if (url.path != null && typeof url.path !== "string") { + throw new InvalidArgumentError("invalid path"); + } + if (url.pathname != null && typeof url.pathname !== "string") { + throw new InvalidArgumentError("invalid pathname"); + } + if (url.hostname != null && typeof url.hostname !== "string") { + throw new InvalidArgumentError("invalid hostname"); + } + if (url.origin != null && typeof url.origin !== "string") { + throw new InvalidArgumentError("invalid origin"); + } + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError("invalid protocol"); + } + if (!(url instanceof URL)) { + const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; + let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}`; + let path7 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + if (origin.endsWith("/")) { + origin = origin.substring(0, origin.length - 1); + } + if (path7 && !path7.startsWith("/")) { + path7 = `/${path7}`; + } + url = new URL(origin + path7); + } + return url; + } + __name(parseURL, "parseURL"); + function parseOrigin(url) { + url = parseURL(url); + if (url.pathname !== "/" || url.search || url.hash) { + throw new InvalidArgumentError("invalid url"); + } + return url; + } + __name(parseOrigin, "parseOrigin"); + function getHostname(host) { + if (host[0] === "[") { + const idx2 = host.indexOf("]"); + assert(idx2 !== -1); + return host.substr(1, idx2 - 1); + } + const idx = host.indexOf(":"); + if (idx === -1) + return host; + return host.substr(0, idx); + } + __name(getHostname, "getHostname"); + function getServerName(host) { + if (!host) { + return null; + } + assert.strictEqual(typeof host, "string"); + const servername = getHostname(host); + if (net2.isIP(servername)) { + return ""; + } + return servername; + } + __name(getServerName, "getServerName"); + function deepClone2(obj) { + return JSON.parse(JSON.stringify(obj)); + } + __name(deepClone2, "deepClone"); + function isAsyncIterable(obj) { + return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function"); + } + __name(isAsyncIterable, "isAsyncIterable"); + function isIterable(obj) { + return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function")); + } + __name(isIterable, "isIterable"); + function bodyLength(body) { + if (body == null) { + return 0; + } else if (isStream(body)) { + const state = body._readableState; + return state && state.ended === true && Number.isFinite(state.length) ? state.length : null; + } else if (isBlobLike(body)) { + return body.size != null ? body.size : null; + } else if (isBuffer(body)) { + return body.byteLength; + } + return null; + } + __name(bodyLength, "bodyLength"); + function isDestroyed(stream3) { + return !stream3 || !!(stream3.destroyed || stream3[kDestroyed]); + } + __name(isDestroyed, "isDestroyed"); + function isReadableAborted(stream3) { + const state = stream3 && stream3._readableState; + return isDestroyed(stream3) && state && !state.endEmitted; + } + __name(isReadableAborted, "isReadableAborted"); + function destroy(stream3, err) { + if (!isStream(stream3) || isDestroyed(stream3)) { + return; + } + if (typeof stream3.destroy === "function") { + if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { + stream3.socket = null; + } + stream3.destroy(err); + } else if (err) { + process.nextTick((stream4, err2) => { + stream4.emit("error", err2); + }, stream3, err); + } + if (stream3.destroyed !== true) { + stream3[kDestroyed] = true; + } + } + __name(destroy, "destroy"); + var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); + return m ? parseInt(m[1], 10) * 1e3 : null; + } + __name(parseKeepAliveTimeout, "parseKeepAliveTimeout"); + function parseHeaders(headers, obj = {}) { + for (let i = 0; i < headers.length; i += 2) { + const key = headers[i].toString().toLowerCase(); + let val = obj[key]; + if (!val) { + if (Array.isArray(headers[i + 1])) { + obj[key] = headers[i + 1]; + } else { + obj[key] = headers[i + 1].toString(); + } + } else { + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; + } + val.push(headers[i + 1].toString()); + } + } + return obj; + } + __name(parseHeaders, "parseHeaders"); + function parseRawHeaders(headers) { + return headers.map((header) => header.toString()); + } + __name(parseRawHeaders, "parseRawHeaders"); + function isBuffer(buffer) { + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer); + } + __name(isBuffer, "isBuffer"); + function validateHandler(handler, method, upgrade) { + if (!handler || typeof handler !== "object") { + throw new InvalidArgumentError("handler must be an object"); + } + if (typeof handler.onConnect !== "function") { + throw new InvalidArgumentError("invalid onConnect method"); + } + if (typeof handler.onError !== "function") { + throw new InvalidArgumentError("invalid onError method"); + } + if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) { + throw new InvalidArgumentError("invalid onBodySent method"); + } + if (upgrade || method === "CONNECT") { + if (typeof handler.onUpgrade !== "function") { + throw new InvalidArgumentError("invalid onUpgrade method"); + } + } else { + if (typeof handler.onHeaders !== "function") { + throw new InvalidArgumentError("invalid onHeaders method"); + } + if (typeof handler.onData !== "function") { + throw new InvalidArgumentError("invalid onData method"); + } + if (typeof handler.onComplete !== "function") { + throw new InvalidArgumentError("invalid onComplete method"); + } + } + } + __name(validateHandler, "validateHandler"); + function isDisturbed(body) { + return !!(body && (stream2.isDisturbed ? stream2.isDisturbed(body) || body[kBodyUsed] : body[kBodyUsed] || body.readableDidRead || body._readableState && body._readableState.dataEmitted || isReadableAborted(body))); + } + __name(isDisturbed, "isDisturbed"); + function isErrored(body) { + return !!(body && (stream2.isErrored ? stream2.isErrored(body) : /state: 'errored'/.test( + nodeUtil.inspect(body) + ))); + } + __name(isErrored, "isErrored"); + function isReadable(body) { + return !!(body && (stream2.isReadable ? stream2.isReadable(body) : /state: 'readable'/.test( + nodeUtil.inspect(body) + ))); + } + __name(isReadable, "isReadable"); + function getSocketInfo(socket) { + return { + localAddress: socket.localAddress, + localPort: socket.localPort, + remoteAddress: socket.remoteAddress, + remotePort: socket.remotePort, + remoteFamily: socket.remoteFamily, + timeout: socket.timeout, + bytesWritten: socket.bytesWritten, + bytesRead: socket.bytesRead + }; + } + __name(getSocketInfo, "getSocketInfo"); + var ReadableStream; + function ReadableStreamFrom(iterable) { + if (!ReadableStream) { + ReadableStream = require("stream/web").ReadableStream; + } + if (ReadableStream.from) { + return ReadableStream.from(iterable); + } + let iterator; + return new ReadableStream( + { + async start() { + iterator = iterable[Symbol.asyncIterator](); + }, + async pull(controller) { + const { done, value } = await iterator.next(); + if (done) { + queueMicrotask(() => { + controller.close(); + }); + } else { + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); + controller.enqueue(new Uint8Array(buf)); + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator.return(); + } + }, + 0 + ); + } + __name(ReadableStreamFrom, "ReadableStreamFrom"); + function isFormDataLike(chunk) { + return chunk && chunk.constructor && chunk.constructor.name === "FormData"; + } + __name(isFormDataLike, "isFormDataLike"); + var kEnumerableProperty = /* @__PURE__ */ Object.create(null); + kEnumerableProperty.enumerable = true; + module2.exports = { + kEnumerableProperty, + nop, + isDisturbed, + isErrored, + isReadable, + toUSVString: nodeUtil.toUSVString || ((val) => `${val}`), + isReadableAborted, + isBlobLike, + parseOrigin, + parseURL, + getServerName, + isStream, + isIterable, + isAsyncIterable, + isDestroyed, + parseRawHeaders, + parseHeaders, + parseKeepAliveTimeout, + destroy, + bodyLength, + deepClone: deepClone2, + ReadableStreamFrom, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/constants.js +var require_constants = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/constants.js"(exports, module2) { + "use strict"; + var corsSafeListedMethods = ["GET", "HEAD", "POST"]; + var nullBodyStatus = [101, 204, 205, 304]; + var redirectStatus = [301, 302, 303, 307, 308]; + var referrerPolicy = [ + "", + "no-referrer", + "no-referrer-when-downgrade", + "same-origin", + "origin", + "strict-origin", + "origin-when-cross-origin", + "strict-origin-when-cross-origin", + "unsafe-url" + ]; + var requestRedirect = ["follow", "manual", "error"]; + var safeMethods = ["GET", "HEAD", "OPTIONS", "TRACE"]; + var requestMode = ["navigate", "same-origin", "no-cors", "cors"]; + var requestCredentials = ["omit", "same-origin", "include"]; + var requestCache = [ + "default", + "no-store", + "reload", + "no-cache", + "force-cache", + "only-if-cached" + ]; + var requestBodyHeader = [ + "content-encoding", + "content-language", + "content-location", + "content-type" + ]; + var forbiddenMethods = ["CONNECT", "TRACE", "TRACK"]; + var subresource = [ + "audio", + "audioworklet", + "font", + "image", + "manifest", + "paintworklet", + "script", + "style", + "track", + "video", + "xslt", + "" + ]; + var _a3; + var DOMException = (_a3 = globalThis.DOMException) != null ? _a3 : (() => { + try { + atob("~"); + } catch (err) { + return Object.getPrototypeOf(err).constructor; + } + })(); + module2.exports = { + DOMException, + subresource, + forbiddenMethods, + requestBodyHeader, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + redirectStatus, + corsSafeListedMethods, + nullBodyStatus, + safeMethods + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/symbols.js +var require_symbols2 = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/symbols.js"(exports, module2) { + "use strict"; + module2.exports = { + kUrl: Symbol("url"), + kHeaders: Symbol("headers"), + kSignal: Symbol("signal"), + kState: Symbol("state"), + kGuard: Symbol("guard"), + kRealm: Symbol("realm") + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/webidl.js +var require_webidl = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/webidl.js"(exports, module2) { + "use strict"; + var { types } = require("util"); + var { hasOwn, toUSVString } = require_util3(); + var webidl = {}; + webidl.converters = {}; + webidl.util = {}; + webidl.errors = {}; + webidl.errors.exception = function(message) { + throw new TypeError(`${message.header}: ${message.message}`); + }; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; + return webidl.errors.exception({ + header: context3.prefix, + message + }); + }; + webidl.errors.invalidArgument = function(context3) { + return webidl.errors.exception({ + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` + }); + }; + webidl.util.Type = function(V) { + switch (typeof V) { + case "undefined": + return "Undefined"; + case "boolean": + return "Boolean"; + case "string": + return "String"; + case "symbol": + return "Symbol"; + case "number": + return "Number"; + case "bigint": + return "BigInt"; + case "function": + case "object": { + if (V === null) { + return "Null"; + } + return "Object"; + } + } + }; + webidl.util.ConvertToInt = function(V, bitLength, signedness, opts = {}) { + let upperBound; + let lowerBound; + if (bitLength === 64) { + upperBound = Math.pow(2, 53) - 1; + if (signedness === "unsigned") { + lowerBound = 0; + } else { + lowerBound = Math.pow(-2, 53) + 1; + } + } else if (signedness === "unsigned") { + lowerBound = 0; + upperBound = Math.pow(2, bitLength) - 1; + } else { + lowerBound = Math.pow(-2, bitLength) - 1; + upperBound = Math.pow(2, bitLength - 1) - 1; + } + let x = Number(V); + if (Object.is(-0, x)) { + x = 0; + } + if (opts.enforceRange === true) { + if (Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { + webidl.errors.exception({ + header: "Integer conversion", + message: `Could not convert ${V} to an integer.` + }); + } + x = webidl.util.IntegerPart(x); + if (x < lowerBound || x > upperBound) { + webidl.errors.exception({ + header: "Integer conversion", + message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` + }); + } + return x; + } + if (!Number.isNaN(x) && opts.clamp === true) { + x = Math.min(Math.max(x, lowerBound), upperBound); + if (Math.floor(x) % 2 === 0) { + x = Math.floor(x); + } else { + x = Math.ceil(x); + } + return x; + } + if (Number.isNaN(x) || Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { + return 0; + } + x = webidl.util.IntegerPart(x); + x = x % Math.pow(2, bitLength); + if (signedness === "signed" && x >= Math.pow(2, bitLength) - 1) { + return x - Math.pow(2, bitLength); + } + return x; + }; + webidl.util.IntegerPart = function(n) { + const r = Math.floor(Math.abs(n)); + if (n < 0) { + return -1 * r; + } + return r; + }; + webidl.sequenceConverter = function(converter) { + return (V) => { + var _a3; + if (webidl.util.Type(V) !== "Object") { + webidl.errors.exception({ + header: "Sequence", + message: `Value of type ${webidl.util.Type(V)} is not an Object.` + }); + } + const method = (_a3 = V == null ? void 0 : V[Symbol.iterator]) == null ? void 0 : _a3.call(V); + const seq = []; + if (method === void 0 || typeof method.next !== "function") { + webidl.errors.exception({ + header: "Sequence", + message: "Object is not an iterator." + }); + } + while (true) { + const { done, value } = method.next(); + if (done) { + break; + } + seq.push(converter(value)); + } + return seq; + }; + }; + webidl.recordConverter = function(keyConverter, valueConverter) { + return (V) => { + const record = {}; + const type = webidl.util.Type(V); + if (type === "Undefined" || type === "Null") { + return record; + } + if (type !== "Object") { + webidl.errors.exception({ + header: "Record", + message: `Expected ${V} to be an Object type.` + }); + } + for (let [key, value] of Object.entries(V)) { + key = keyConverter(key); + value = valueConverter(value); + record[key] = value; + } + return record; + }; + }; + webidl.interfaceConverter = function(i) { + return (V, opts = {}) => { + if (opts.strict !== false && !(V instanceof i)) { + webidl.errors.exception({ + header: i.name, + message: `Expected ${V} to be an instance of ${i.name}.` + }); + } + return V; + }; + }; + webidl.dictionaryConverter = function(converters) { + return (dictionary) => { + const type = webidl.util.Type(dictionary); + const dict = {}; + if (type !== "Null" && type !== "Undefined" && type !== "Object") { + webidl.errors.exception({ + header: "Dictionary", + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` + }); + } + for (const options of converters) { + const { key, defaultValue, required, converter } = options; + if (required === true) { + if (!hasOwn(dictionary, key)) { + webidl.errors.exception({ + header: "Dictionary", + message: `Missing required key "${key}".` + }); + } + } + let value = dictionary[key]; + const hasDefault = hasOwn(options, "defaultValue"); + if (hasDefault && value !== null) { + value = value != null ? value : defaultValue; + } + if (required || hasDefault || value !== void 0) { + value = converter(value); + if (options.allowedValues && !options.allowedValues.includes(value)) { + webidl.errors.exception({ + header: "Dictionary", + message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.` + }); + } + dict[key] = value; + } + } + return dict; + }; + }; + webidl.nullableConverter = function(converter) { + return (V) => { + if (V === null) { + return V; + } + return converter(V); + }; + }; + webidl.converters.DOMString = function(V, opts = {}) { + if (V === null && opts.legacyNullToEmptyString) { + return ""; + } + if (typeof V === "symbol") { + throw new TypeError("Could not convert argument of type symbol to string."); + } + return String(V); + }; + webidl.converters.ByteString = function(V) { + const x = webidl.converters.DOMString(V); + for (let index = 0; index < x.length; index++) { + const charCode = x.charCodeAt(index); + if (charCode > 255) { + throw new TypeError( + `Cannot convert argument to a ByteString because the character atindex ${index} has a value of ${charCode} which is greater than 255.` + ); + } + } + return x; + }; + webidl.converters.USVString = toUSVString; + webidl.converters.boolean = function(V) { + const x = Boolean(V); + return x; + }; + webidl.converters.any = function(V) { + return V; + }; + webidl.converters["long long"] = function(V, opts) { + const x = webidl.util.ConvertToInt(V, 64, "signed", opts); + return x; + }; + webidl.converters["unsigned short"] = function(V) { + const x = webidl.util.ConvertToInt(V, 16, "unsigned"); + return x; + }; + webidl.converters.ArrayBuffer = function(V, opts = {}) { + if (webidl.util.Type(V) !== "Object" || !types.isAnyArrayBuffer(V)) { + webidl.errors.conversionFailed({ + prefix: `${V}`, + argument: `${V}`, + types: ["ArrayBuffer"] + }); + } + if (opts.allowShared === false && types.isSharedArrayBuffer(V)) { + webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V; + }; + webidl.converters.TypedArray = function(V, T, opts = {}) { + if (webidl.util.Type(V) !== "Object" || !types.isTypedArray(V) || V.constructor.name !== T.name) { + webidl.errors.conversionFailed({ + prefix: `${T.name}`, + argument: `${V}`, + types: [T.name] + }); + } + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V; + }; + webidl.converters.DataView = function(V, opts = {}) { + if (webidl.util.Type(V) !== "Object" || !types.isDataView(V)) { + webidl.errors.exception({ + header: "DataView", + message: "Object is not a DataView." + }); + } + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + webidl.errors.exception({ + header: "ArrayBuffer", + message: "SharedArrayBuffer is not allowed." + }); + } + return V; + }; + webidl.converters.BufferSource = function(V, opts = {}) { + if (types.isAnyArrayBuffer(V)) { + return webidl.converters.ArrayBuffer(V, opts); + } + if (types.isTypedArray(V)) { + return webidl.converters.TypedArray(V, V.constructor); + } + if (types.isDataView(V)) { + return webidl.converters.DataView(V, opts); + } + throw new TypeError(`Could not convert ${V} to a BufferSource.`); + }; + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.ByteString + ); + webidl.converters["sequence>"] = webidl.sequenceConverter( + webidl.converters["sequence"] + ); + webidl.converters["record"] = webidl.recordConverter( + webidl.converters.ByteString, + webidl.converters.ByteString + ); + module2.exports = { + webidl + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/file.js +var require_file = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/file.js"(exports, module2) { + "use strict"; + var { Blob } = require("buffer"); + var { types } = require("util"); + var { kState } = require_symbols2(); + var { isBlobLike } = require_util3(); + var { webidl } = require_webidl(); + var File = class extends Blob { + constructor(fileBits, fileName, options = {}) { + if (arguments.length < 2) { + throw new TypeError("2 arguments required"); + } + fileBits = webidl.converters["sequence"](fileBits); + fileName = webidl.converters.USVString(fileName); + options = webidl.converters.FilePropertyBag(options); + const n = fileName; + const d = options.lastModified; + super(processBlobParts(fileBits, options), { type: options.type }); + this[kState] = { + name: n, + lastModified: d + }; + } + get name() { + if (!(this instanceof File)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].name; + } + get lastModified() { + if (!(this instanceof File)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].lastModified; + } + get [Symbol.toStringTag]() { + return this.constructor.name; + } + }; + __name(File, "File"); + var FileLike = class { + constructor(blobLike, fileName, options = {}) { + var _a3; + const n = fileName; + const t = options.type; + const d = (_a3 = options.lastModified) != null ? _a3 : Date.now(); + this[kState] = { + blobLike, + name: n, + type: t, + lastModified: d + }; + } + stream(...args) { + if (!(this instanceof FileLike)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].blobLike.stream(...args); + } + arrayBuffer(...args) { + if (!(this instanceof FileLike)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].blobLike.arrayBuffer(...args); + } + slice(...args) { + if (!(this instanceof FileLike)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].blobLike.slice(...args); + } + text(...args) { + if (!(this instanceof FileLike)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].blobLike.text(...args); + } + get size() { + if (!(this instanceof FileLike)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].blobLike.size; + } + get type() { + if (!(this instanceof FileLike)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].blobLike.type; + } + get name() { + if (!(this instanceof FileLike)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].name; + } + get lastModified() { + if (!(this instanceof FileLike)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].lastModified; + } + get [Symbol.toStringTag]() { + return "File"; + } + }; + __name(FileLike, "FileLike"); + webidl.converters.Blob = webidl.interfaceConverter(Blob); + webidl.converters.BlobPart = function(V, opts) { + if (webidl.util.Type(V) === "Object") { + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }); + } + return webidl.converters.BufferSource(V, opts); + } else { + return webidl.converters.USVString(V, opts); + } + }; + webidl.converters["sequence"] = webidl.sequenceConverter( + webidl.converters.BlobPart + ); + webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ + { + key: "lastModified", + converter: webidl.converters["long long"], + get defaultValue() { + return Date.now(); + } + }, + { + key: "type", + converter: webidl.converters.DOMString, + defaultValue: "" + }, + { + key: "endings", + converter: (value) => { + value = webidl.converters.DOMString(value); + value = value.toLowerCase(); + if (value !== "native") { + value = "transparent"; + } + return value; + }, + defaultValue: "transparent" + } + ]); + function processBlobParts(parts, options) { + const bytes = []; + for (const element of parts) { + if (typeof element === "string") { + let s = element; + if (options.endings === "native") { + s = convertLineEndingsNative(s); + } + bytes.push(new TextEncoder().encode(s)); + } else if (types.isAnyArrayBuffer(element) || types.isTypedArray(element)) { + if (!element.buffer) { + bytes.push(new Uint8Array(element)); + } else { + bytes.push( + new Uint8Array(element.buffer, element.byteOffset, element.byteLength) + ); + } + } else if (isBlobLike(element)) { + bytes.push(element); + } + } + return bytes; + } + __name(processBlobParts, "processBlobParts"); + function convertLineEndingsNative(s) { + let nativeLineEnding = "\n"; + if (process.platform === "win32") { + nativeLineEnding = "\r\n"; + } + return s.replace(/\r?\n/g, nativeLineEnding); + } + __name(convertLineEndingsNative, "convertLineEndingsNative"); + module2.exports = { File, FileLike }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/util.js +var require_util3 = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/util.js"(exports, module2) { + "use strict"; + var { redirectStatus } = require_constants(); + var { performance: performance3 } = require("perf_hooks"); + var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util2(); + var assert = require("assert"); + var { isUint8Array } = require("util/types"); + var File; + var crypto2; + try { + crypto2 = require("crypto"); + } catch (e) { + } + var badPorts = [ + "1", + "7", + "9", + "11", + "13", + "15", + "17", + "19", + "20", + "21", + "22", + "23", + "25", + "37", + "42", + "43", + "53", + "69", + "77", + "79", + "87", + "95", + "101", + "102", + "103", + "104", + "109", + "110", + "111", + "113", + "115", + "117", + "119", + "123", + "135", + "137", + "139", + "143", + "161", + "179", + "389", + "427", + "465", + "512", + "513", + "514", + "515", + "526", + "530", + "531", + "532", + "540", + "548", + "554", + "556", + "563", + "587", + "601", + "636", + "989", + "990", + "993", + "995", + "1719", + "1720", + "1723", + "2049", + "3659", + "4045", + "5060", + "5061", + "6000", + "6566", + "6665", + "6666", + "6667", + "6668", + "6669", + "6697", + "10080" + ]; + function responseURL(response) { + const urlList = response.urlList; + const length = urlList.length; + return length === 0 ? null : urlList[length - 1].toString(); + } + __name(responseURL, "responseURL"); + function responseLocationURL(response, requestFragment) { + if (!redirectStatus.includes(response.status)) { + return null; + } + let location = response.headersList.get("location"); + location = location ? new URL(location, responseURL(response)) : null; + if (location && !location.hash) { + location.hash = requestFragment; + } + return location; + } + __name(responseLocationURL, "responseLocationURL"); + function requestCurrentURL(request2) { + return request2.urlList[request2.urlList.length - 1]; + } + __name(requestCurrentURL, "requestCurrentURL"); + function requestBadPort(request2) { + const url = requestCurrentURL(request2); + if (/^https?:/.test(url.protocol) && badPorts.includes(url.port)) { + return "blocked"; + } + return "allowed"; + } + __name(requestBadPort, "requestBadPort"); + function isFileLike(object) { + if (!File) { + File = require_file().File; + } + return object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(File)$/.test(object[Symbol.toStringTag]); + } + __name(isFileLike, "isFileLike"); + function isErrorLike(object) { + var _a3, _b2; + return object instanceof Error || (((_a3 = object == null ? void 0 : object.constructor) == null ? void 0 : _a3.name) === "Error" || ((_b2 = object == null ? void 0 : object.constructor) == null ? void 0 : _b2.name) === "DOMException"); + } + __name(isErrorLike, "isErrorLike"); + function isValidReasonPhrase(statusText) { + for (let i = 0; i < statusText.length; ++i) { + const c = statusText.charCodeAt(i); + if (!(c === 9 || c >= 32 && c <= 126 || c >= 128 && c <= 255)) { + return false; + } + } + return true; + } + __name(isValidReasonPhrase, "isValidReasonPhrase"); + function isTokenChar(c) { + return !(c >= 127 || c <= 32 || c === "(" || c === ")" || c === "<" || c === ">" || c === "@" || c === "," || c === ";" || c === ":" || c === "\\" || c === '"' || c === "/" || c === "[" || c === "]" || c === "?" || c === "=" || c === "{" || c === "}"); + } + __name(isTokenChar, "isTokenChar"); + function isValidHTTPToken(characters) { + if (!characters || typeof characters !== "string") { + return false; + } + for (let i = 0; i < characters.length; ++i) { + const c = characters.charCodeAt(i); + if (c > 127 || !isTokenChar(c)) { + return false; + } + } + return true; + } + __name(isValidHTTPToken, "isValidHTTPToken"); + function isValidHeaderName(potentialValue) { + if (potentialValue.length === 0) { + return false; + } + for (const char of potentialValue) { + if (!isValidHTTPToken(char)) { + return false; + } + } + return true; + } + __name(isValidHeaderName, "isValidHeaderName"); + function isValidHeaderValue(potentialValue) { + if (potentialValue.startsWith(" ") || potentialValue.startsWith(" ") || potentialValue.endsWith(" ") || potentialValue.endsWith(" ")) { + return false; + } + if (potentialValue.includes("\0") || potentialValue.includes("\r") || potentialValue.includes("\n")) { + return false; + } + return true; + } + __name(isValidHeaderValue, "isValidHeaderValue"); + function setRequestReferrerPolicyOnRedirect(request2, actualResponse) { + const policy = ""; + if (policy !== "") { + request2.referrerPolicy = policy; + } + } + __name(setRequestReferrerPolicyOnRedirect, "setRequestReferrerPolicyOnRedirect"); + function crossOriginResourcePolicyCheck() { + return "allowed"; + } + __name(crossOriginResourcePolicyCheck, "crossOriginResourcePolicyCheck"); + function corsCheck() { + return "success"; + } + __name(corsCheck, "corsCheck"); + function TAOCheck() { + return "success"; + } + __name(TAOCheck, "TAOCheck"); + function appendFetchMetadata(httpRequest) { + let header = null; + header = httpRequest.mode; + httpRequest.headersList.set("sec-fetch-mode", header); + } + __name(appendFetchMetadata, "appendFetchMetadata"); + function appendRequestOriginHeader(request2) { + let serializedOrigin = request2.origin; + if (request2.responseTainting === "cors" || request2.mode === "websocket") { + if (serializedOrigin) { + request2.headersList.append("Origin", serializedOrigin); + } + } else if (request2.method !== "GET" && request2.method !== "HEAD") { + switch (request2.referrerPolicy) { + case "no-referrer": + serializedOrigin = null; + break; + case "no-referrer-when-downgrade": + case "strict-origin": + case "strict-origin-when-cross-origin": + if (/^https:/.test(request2.origin) && !/^https:/.test(requestCurrentURL(request2))) { + serializedOrigin = null; + } + break; + case "same-origin": + if (!sameOrigin(request2, requestCurrentURL(request2))) { + serializedOrigin = null; + } + break; + default: + } + if (serializedOrigin) { + request2.headersList.append("Origin", serializedOrigin); + } + } + } + __name(appendRequestOriginHeader, "appendRequestOriginHeader"); + function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { + return performance3.now(); + } + __name(coarsenedSharedCurrentTime, "coarsenedSharedCurrentTime"); + function createOpaqueTimingInfo(timingInfo) { + var _a3, _b2; + return { + startTime: (_a3 = timingInfo.startTime) != null ? _a3 : 0, + redirectStartTime: 0, + redirectEndTime: 0, + postRedirectStartTime: (_b2 = timingInfo.startTime) != null ? _b2 : 0, + finalServiceWorkerStartTime: 0, + finalNetworkResponseStartTime: 0, + finalNetworkRequestStartTime: 0, + endTime: 0, + encodedBodySize: 0, + decodedBodySize: 0, + finalConnectionTimingInfo: null + }; + } + __name(createOpaqueTimingInfo, "createOpaqueTimingInfo"); + function makePolicyContainer() { + return {}; + } + __name(makePolicyContainer, "makePolicyContainer"); + function clonePolicyContainer() { + return {}; + } + __name(clonePolicyContainer, "clonePolicyContainer"); + function determineRequestsReferrer(request2) { + return "no-referrer"; + } + __name(determineRequestsReferrer, "determineRequestsReferrer"); + function bytesMatch(bytes, metadataList) { + if (crypto2 === void 0) { + return true; + } + const parsedMetadata = parseMetadata(metadataList); + if (parsedMetadata === "no metadata") { + return true; + } + if (parsedMetadata.length === 0) { + return true; + } + const metadata = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo)); + for (const item of metadata) { + const algorithm = item.algo; + const expectedValue = item.hash; + const actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); + if (actualValue === expectedValue) { + return true; + } + } + return false; + } + __name(bytesMatch, "bytesMatch"); + var parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={1,2}))( +[\x21-\x7e]?)?/i; + function parseMetadata(metadata) { + const result = []; + let empty2 = true; + const supportedHashes = crypto2.getHashes(); + for (const token of metadata.split(" ")) { + empty2 = false; + const parsedToken = parseHashWithOptions.exec(token); + if (parsedToken === null || parsedToken.groups === void 0) { + continue; + } + const algorithm = parsedToken.groups.algo; + if (supportedHashes.includes(algorithm.toLowerCase())) { + result.push(parsedToken.groups); + } + } + if (empty2 === true) { + return "no metadata"; + } + return result; + } + __name(parseMetadata, "parseMetadata"); + function tryUpgradeRequestToAPotentiallyTrustworthyURL(request2) { + } + __name(tryUpgradeRequestToAPotentiallyTrustworthyURL, "tryUpgradeRequestToAPotentiallyTrustworthyURL"); + function sameOrigin(A, B) { + if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { + return true; + } + return false; + } + __name(sameOrigin, "sameOrigin"); + function createDeferredPromise() { + let res; + let rej; + const promise = new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }); + return { promise, resolve: res, reject: rej }; + } + __name(createDeferredPromise, "createDeferredPromise"); + function isAborted(fetchParams) { + return fetchParams.controller.state === "aborted"; + } + __name(isAborted, "isAborted"); + function isCancelled(fetchParams) { + return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; + } + __name(isCancelled, "isCancelled"); + function normalizeMethod(method) { + return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method) ? method.toUpperCase() : method; + } + __name(normalizeMethod, "normalizeMethod"); + function serializeJavascriptValueToJSONString(value) { + const result = JSON.stringify(value); + if (result === void 0) { + throw new TypeError("Value is not JSON serializable"); + } + assert(typeof result === "string"); + return result; + } + __name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString"); + var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); + function makeIterator(iterator, name) { + const i = { + next() { + if (Object.getPrototypeOf(this) !== i) { + throw new TypeError( + `'next' called on an object that does not implement interface ${name} Iterator.` + ); + } + return iterator.next(); + }, + [Symbol.toStringTag]: `${name} Iterator` + }; + Object.setPrototypeOf(i, esIteratorPrototype); + return Object.setPrototypeOf({}, i); + } + __name(makeIterator, "makeIterator"); + async function fullyReadBody(body, processBody, processBodyError) { + try { + const chunks = []; + let length = 0; + const reader = body.stream.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done === true) { + break; + } + assert(isUint8Array(value)); + chunks.push(value); + length += value.byteLength; + } + const fulfilledSteps = /* @__PURE__ */ __name((bytes) => queueMicrotask(() => { + processBody(bytes); + }), "fulfilledSteps"); + fulfilledSteps(Buffer.concat(chunks, length)); + } catch (err) { + queueMicrotask(() => processBodyError(err)); + } + } + __name(fullyReadBody, "fullyReadBody"); + var hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)); + module2.exports = { + isAborted, + isCancelled, + createDeferredPromise, + ReadableStreamFrom, + toUSVString, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike, + isFileLike, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + makeIterator, + isValidHeaderName, + isValidHeaderValue, + hasOwn, + isErrorLike, + fullyReadBody, + bytesMatch + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/formdata.js +var require_formdata = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/formdata.js"(exports, module2) { + "use strict"; + var { isBlobLike, isFileLike, toUSVString, makeIterator } = require_util3(); + var { kState } = require_symbols2(); + var { File, FileLike } = require_file(); + var { webidl } = require_webidl(); + var { Blob } = require("buffer"); + var _FormData = class { + constructor(form) { + if (arguments.length > 0 && form != null) { + webidl.errors.conversionFailed({ + prefix: "FormData constructor", + argument: "Argument 1", + types: ["null"] + }); + } + this[kState] = []; + } + append(name, value, filename = void 0) { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 2) { + throw new TypeError( + `Failed to execute 'append' on 'FormData': 2 arguments required, but only ${arguments.length} present.` + ); + } + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" + ); + } + name = webidl.converters.USVString(name); + value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value); + filename = arguments.length === 3 ? webidl.converters.USVString(filename) : void 0; + const entry = makeEntry(name, value, filename); + this[kState].push(entry); + } + delete(name) { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'delete' on 'FormData': 1 arguments required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.USVString(name); + const next = []; + for (const entry of this[kState]) { + if (entry.name !== name) { + next.push(entry); + } + } + this[kState] = next; + } + get(name) { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'get' on 'FormData': 1 arguments required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.USVString(name); + const idx = this[kState].findIndex((entry) => entry.name === name); + if (idx === -1) { + return null; + } + return this[kState][idx].value; + } + getAll(name) { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'getAll' on 'FormData': 1 arguments required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.USVString(name); + return this[kState].filter((entry) => entry.name === name).map((entry) => entry.value); + } + has(name) { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'has' on 'FormData': 1 arguments required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.USVString(name); + return this[kState].findIndex((entry) => entry.name === name) !== -1; + } + set(name, value, filename = void 0) { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 2) { + throw new TypeError( + `Failed to execute 'set' on 'FormData': 2 arguments required, but only ${arguments.length} present.` + ); + } + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" + ); + } + name = webidl.converters.USVString(name); + value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value); + filename = arguments.length === 3 ? toUSVString(filename) : void 0; + const entry = makeEntry(name, value, filename); + const idx = this[kState].findIndex((entry2) => entry2.name === name); + if (idx !== -1) { + this[kState] = [ + ...this[kState].slice(0, idx), + entry, + ...this[kState].slice(idx + 1).filter((entry2) => entry2.name !== name) + ]; + } else { + this[kState].push(entry); + } + } + get [Symbol.toStringTag]() { + return this.constructor.name; + } + entries() { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + return makeIterator( + makeIterable(this[kState], "entries"), + "FormData" + ); + } + keys() { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + return makeIterator( + makeIterable(this[kState], "keys"), + "FormData" + ); + } + values() { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + return makeIterator( + makeIterable(this[kState], "values"), + "FormData" + ); + } + forEach(callbackFn, thisArg = globalThis) { + if (!(this instanceof _FormData)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'forEach' on 'FormData': 1 argument required, but only ${arguments.length} present.` + ); + } + if (typeof callbackFn !== "function") { + throw new TypeError( + "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." + ); + } + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]); + } + } + }; + var FormData = _FormData; + __name(FormData, "FormData"); + __publicField(FormData, "name", "FormData"); + FormData.prototype[Symbol.iterator] = FormData.prototype.entries; + function makeEntry(name, value, filename) { + name = Buffer.from(name).toString("utf8"); + if (typeof value === "string") { + value = Buffer.from(value).toString("utf8"); + } else { + if (!isFileLike(value)) { + value = value instanceof Blob ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); + } + if (filename !== void 0) { + value = value instanceof File ? new File([value], filename, { type: value.type }) : new FileLike(value, filename, { type: value.type }); + } + } + return { name, value }; + } + __name(makeEntry, "makeEntry"); + function* makeIterable(entries, type) { + for (const { name, value } of entries) { + if (type === "entries") { + yield [name, value]; + } else if (type === "values") { + yield value; + } else { + yield name; + } + } + } + __name(makeIterable, "makeIterable"); + module2.exports = { FormData }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/body.js +var require_body = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/body.js"(exports, module2) { + "use strict"; + var util2 = require_util2(); + var { ReadableStreamFrom, toUSVString, isBlobLike } = require_util3(); + var { FormData } = require_formdata(); + var { kState } = require_symbols2(); + var { webidl } = require_webidl(); + var { Blob } = require("buffer"); + var { kBodyUsed } = require_symbols(); + var assert = require("assert"); + var { NotSupportedError } = require_errors(); + var { isErrored } = require_util2(); + var { isUint8Array, isArrayBuffer } = require("util/types"); + var ReadableStream; + async function* blobGen(blob) { + yield* blob.stream(); + } + __name(blobGen, "blobGen"); + function extractBody(object, keepalive = false) { + if (!ReadableStream) { + ReadableStream = require("stream/web").ReadableStream; + } + let stream2 = null; + let action = null; + let source = null; + let length = null; + let contentType = null; + if (object == null) { + } else if (object instanceof URLSearchParams) { + source = object.toString(); + contentType = "application/x-www-form-urlencoded;charset=UTF-8"; + } else if (isArrayBuffer(object)) { + source = new Uint8Array(object.slice()); + } else if (ArrayBuffer.isView(object)) { + source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); + } else if (util2.isFormDataLike(object)) { + const boundary = "----formdata-undici-" + Math.random(); + const prefix = `--${boundary}\r +Content-Disposition: form-data`; + const escape = /* @__PURE__ */ __name((str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "escape"); + const normalizeLinefeeds = /* @__PURE__ */ __name((value) => value.replace(/\r?\n|\r/g, "\r\n"), "normalizeLinefeeds"); + action = /* @__PURE__ */ __name(async function* (object2) { + const enc = new TextEncoder(); + for (const [name, value] of object2) { + if (typeof value === "string") { + yield enc.encode( + prefix + `; name="${escape(normalizeLinefeeds(name))}"\r +\r +${normalizeLinefeeds(value)}\r +` + ); + } else { + yield enc.encode( + prefix + `; name="${escape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape(value.name)}"` : "") + `\r +Content-Type: ${value.type || "application/octet-stream"}\r +\r +` + ); + yield* blobGen(value); + yield enc.encode("\r\n"); + } + } + yield enc.encode(`--${boundary}--`); + }, "action"); + source = object; + contentType = "multipart/form-data; boundary=" + boundary; + } else if (isBlobLike(object)) { + action = blobGen; + source = object; + length = object.size; + if (object.type) { + contentType = object.type; + } + } else if (typeof object[Symbol.asyncIterator] === "function") { + if (keepalive) { + throw new TypeError("keepalive"); + } + if (util2.isDisturbed(object) || object.locked) { + throw new TypeError( + "Response body object should not be disturbed or locked" + ); + } + stream2 = object instanceof ReadableStream ? object : ReadableStreamFrom(object); + } else { + source = toUSVString(object); + contentType = "text/plain;charset=UTF-8"; + } + if (typeof source === "string" || util2.isBuffer(source)) { + length = Buffer.byteLength(source); + } + if (action != null) { + let iterator; + stream2 = new ReadableStream({ + async start() { + iterator = action(object)[Symbol.asyncIterator](); + }, + async pull(controller) { + const { value, done } = await iterator.next(); + if (done) { + queueMicrotask(() => { + controller.close(); + }); + } else { + if (!isErrored(stream2)) { + controller.enqueue(new Uint8Array(value)); + } + } + return controller.desiredSize > 0; + }, + async cancel(reason) { + await iterator.return(); + } + }); + } else if (!stream2) { + stream2 = new ReadableStream({ + async pull(controller) { + controller.enqueue( + typeof source === "string" ? new TextEncoder().encode(source) : source + ); + queueMicrotask(() => { + controller.close(); + }); + } + }); + } + const body = { stream: stream2, source, length }; + return [body, contentType]; + } + __name(extractBody, "extractBody"); + function safelyExtractBody(object, keepalive = false) { + if (!ReadableStream) { + ReadableStream = require("stream/web").ReadableStream; + } + if (object instanceof ReadableStream) { + assert(!util2.isDisturbed(object), "disturbed"); + assert(!object.locked, "locked"); + } + return extractBody(object, keepalive); + } + __name(safelyExtractBody, "safelyExtractBody"); + function cloneBody(body) { + const [out1, out2] = body.stream.tee(); + body.stream = out1; + return { + stream: out2, + length: body.length, + source: body.source + }; + } + __name(cloneBody, "cloneBody"); + async function* consumeBody(body) { + if (body) { + if (isUint8Array(body)) { + yield body; + } else { + const stream2 = body.stream; + if (util2.isDisturbed(stream2)) { + throw new TypeError("disturbed"); + } + if (stream2.locked) { + throw new TypeError("locked"); + } + stream2[kBodyUsed] = true; + yield* stream2; + } + } + } + __name(consumeBody, "consumeBody"); + function bodyMixinMethods(instance) { + const methods = { + async blob() { + if (!(this instanceof instance)) { + throw new TypeError("Illegal invocation"); + } + const chunks = []; + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError("Expected Uint8Array chunk"); + } + chunks.push(new Blob([chunk])); + } + return new Blob(chunks, { type: this.headers.get("Content-Type") || "" }); + }, + async arrayBuffer() { + if (!(this instanceof instance)) { + throw new TypeError("Illegal invocation"); + } + const contentLength = this.headers.get("content-length"); + const encoded = this.headers.has("content-encoding"); + if (!encoded && contentLength) { + const buffer2 = new Uint8Array(contentLength); + let offset2 = 0; + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError("Expected Uint8Array chunk"); + } + buffer2.set(chunk, offset2); + offset2 += chunk.length; + } + return buffer2.buffer; + } + const chunks = []; + let size = 0; + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError("Expected Uint8Array chunk"); + } + chunks.push(chunk); + size += chunk.byteLength; + } + const buffer = new Uint8Array(size); + let offset = 0; + for (const chunk of chunks) { + buffer.set(chunk, offset); + offset += chunk.byteLength; + } + return buffer.buffer; + }, + async text() { + if (!(this instanceof instance)) { + throw new TypeError("Illegal invocation"); + } + let result = ""; + const textDecoder = new TextDecoder(); + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError("Expected Uint8Array chunk"); + } + result += textDecoder.decode(chunk, { stream: true }); + } + result += textDecoder.decode(); + return result; + }, + async json() { + if (!(this instanceof instance)) { + throw new TypeError("Illegal invocation"); + } + return JSON.parse(await this.text()); + }, + async formData() { + if (!(this instanceof instance)) { + throw new TypeError("Illegal invocation"); + } + const contentType = this.headers.get("Content-Type"); + if (/multipart\/form-data/.test(contentType)) { + throw new NotSupportedError("multipart/form-data not supported"); + } else if (/application\/x-www-form-urlencoded/.test(contentType)) { + let entries; + try { + let text = ""; + const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }); + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError("Expected Uint8Array chunk"); + } + text += textDecoder.decode(chunk, { stream: true }); + } + text += textDecoder.decode(); + entries = new URLSearchParams(text); + } catch (err) { + throw Object.assign(new TypeError(), { cause: err }); + } + const formData = new FormData(); + for (const [name, value] of entries) { + formData.append(name, value); + } + return formData; + } else { + webidl.errors.exception({ + header: `${instance.name}.formData`, + value: "Could not parse content as FormData." + }); + } + } + }; + return methods; + } + __name(bodyMixinMethods, "bodyMixinMethods"); + var properties = { + body: { + enumerable: true, + get() { + if (!this || !this[kState]) { + throw new TypeError("Illegal invocation"); + } + return this[kState].body ? this[kState].body.stream : null; + } + }, + bodyUsed: { + enumerable: true, + get() { + if (!this || !this[kState]) { + throw new TypeError("Illegal invocation"); + } + return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); + } + } + }; + function mixinBody(prototype) { + Object.assign(prototype.prototype, bodyMixinMethods(prototype)); + Object.defineProperties(prototype.prototype, properties); + } + __name(mixinBody, "mixinBody"); + module2.exports = { + extractBody, + safelyExtractBody, + cloneBody, + mixinBody + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/request.js +var require_request = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/request.js"(exports, module2) { + "use strict"; + var { + InvalidArgumentError, + NotSupportedError + } = require_errors(); + var assert = require("assert"); + var util2 = require_util2(); + var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; + var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; + var invalidPathRegex = /[^\u0021-\u00ff]/; + var kHandler = Symbol("handler"); + var channels = {}; + var extractBody; + var nodeVersion = process.versions.node.split("."); + var nodeMajor = Number(nodeVersion[0]); + var nodeMinor = Number(nodeVersion[1]); + try { + const diagnosticsChannel = require("diagnostics_channel"); + channels.create = diagnosticsChannel.channel("undici:request:create"); + channels.bodySent = diagnosticsChannel.channel("undici:request:bodySent"); + channels.headers = diagnosticsChannel.channel("undici:request:headers"); + channels.trailers = diagnosticsChannel.channel("undici:request:trailers"); + channels.error = diagnosticsChannel.channel("undici:request:error"); + } catch (e) { + channels.create = { hasSubscribers: false }; + channels.bodySent = { hasSubscribers: false }; + channels.headers = { hasSubscribers: false }; + channels.trailers = { hasSubscribers: false }; + channels.error = { hasSubscribers: false }; + } + var Request = class { + constructor(origin, { + path: path7, + method, + body, + headers, + query: query2, + idempotent, + blocking, + upgrade, + headersTimeout, + bodyTimeout, + throwOnError + }, handler) { + if (typeof path7 !== "string") { + throw new InvalidArgumentError("path must be a string"); + } else if (path7[0] !== "/" && !(path7.startsWith("http://") || path7.startsWith("https://")) && method !== "CONNECT") { + throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); + } else if (invalidPathRegex.exec(path7) !== null) { + throw new InvalidArgumentError("invalid request path"); + } + if (typeof method !== "string") { + throw new InvalidArgumentError("method must be a string"); + } else if (tokenRegExp.exec(method) === null) { + throw new InvalidArgumentError("invalid request method"); + } + if (upgrade && typeof upgrade !== "string") { + throw new InvalidArgumentError("upgrade must be a string"); + } + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError("invalid headersTimeout"); + } + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError("invalid bodyTimeout"); + } + this.headersTimeout = headersTimeout; + this.bodyTimeout = bodyTimeout; + this.throwOnError = throwOnError === true; + this.method = method; + if (body == null) { + this.body = null; + } else if (util2.isStream(body)) { + this.body = body; + } else if (util2.isBuffer(body)) { + this.body = body.byteLength ? body : null; + } else if (ArrayBuffer.isView(body)) { + this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null; + } else if (body instanceof ArrayBuffer) { + this.body = body.byteLength ? Buffer.from(body) : null; + } else if (typeof body === "string") { + this.body = body.length ? Buffer.from(body) : null; + } else if (util2.isFormDataLike(body) || util2.isIterable(body) || util2.isBlobLike(body)) { + this.body = body; + } else { + throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); + } + this.completed = false; + this.aborted = false; + this.upgrade = upgrade || null; + this.path = query2 ? util2.buildURL(path7, query2) : path7; + this.origin = origin; + this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; + this.blocking = blocking == null ? false : blocking; + this.host = null; + this.contentLength = null; + this.contentType = null; + this.headers = ""; + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError("headers array must be even"); + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(this, headers[i], headers[i + 1]); + } + } else if (headers && typeof headers === "object") { + const keys2 = Object.keys(headers); + for (let i = 0; i < keys2.length; i++) { + const key = keys2[i]; + processHeader(this, key, headers[key]); + } + } else if (headers != null) { + throw new InvalidArgumentError("headers must be an object or an array"); + } + if (util2.isFormDataLike(this.body)) { + if (nodeMajor < 16 || nodeMajor === 16 && nodeMinor < 8) { + throw new InvalidArgumentError("Form-Data bodies are only supported in node v16.8 and newer."); + } + if (!extractBody) { + extractBody = require_body().extractBody; + } + const [bodyStream, contentType] = extractBody(body); + if (this.contentType == null) { + this.contentType = contentType; + this.headers += `content-type: ${contentType}\r +`; + } + this.body = bodyStream.stream; + } else if (util2.isBlobLike(body) && this.contentType == null && body.type) { + this.contentType = body.type; + this.headers += `content-type: ${body.type}\r +`; + } + util2.validateHandler(handler, method, upgrade); + this.servername = util2.getServerName(this.host); + this[kHandler] = handler; + if (channels.create.hasSubscribers) { + channels.create.publish({ request: this }); + } + } + onBodySent(chunk) { + if (this[kHandler].onBodySent) { + try { + this[kHandler].onBodySent(chunk); + } catch (err) { + this.onError(err); + } + } + } + onRequestSent() { + if (channels.bodySent.hasSubscribers) { + channels.bodySent.publish({ request: this }); + } + } + onConnect(abort) { + assert(!this.aborted); + assert(!this.completed); + return this[kHandler].onConnect(abort); + } + onHeaders(statusCode, headers, resume, statusText) { + assert(!this.aborted); + assert(!this.completed); + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); + } + return this[kHandler].onHeaders(statusCode, headers, resume, statusText); + } + onData(chunk) { + assert(!this.aborted); + assert(!this.completed); + return this[kHandler].onData(chunk); + } + onUpgrade(statusCode, headers, socket) { + assert(!this.aborted); + assert(!this.completed); + return this[kHandler].onUpgrade(statusCode, headers, socket); + } + onComplete(trailers) { + assert(!this.aborted); + this.completed = true; + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers }); + } + return this[kHandler].onComplete(trailers); + } + onError(error2) { + if (channels.error.hasSubscribers) { + channels.error.publish({ request: this, error: error2 }); + } + if (this.aborted) { + return; + } + this.aborted = true; + return this[kHandler].onError(error2); + } + addHeader(key, value) { + processHeader(this, key, value); + return this; + } + }; + __name(Request, "Request"); + function processHeader(request2, key, val) { + if (val && typeof val === "object") { + throw new InvalidArgumentError(`invalid ${key} header`); + } else if (val === void 0) { + return; + } + if (request2.host === null && key.length === 4 && key.toLowerCase() === "host") { + request2.host = val; + } else if (request2.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { + request2.contentLength = parseInt(val, 10); + if (!Number.isFinite(request2.contentLength)) { + throw new InvalidArgumentError("invalid content-length header"); + } + } else if (request2.contentType === null && key.length === 12 && key.toLowerCase() === "content-type" && headerCharRegex.exec(val) === null) { + request2.contentType = val; + request2.headers += `${key}: ${val}\r +`; + } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { + throw new InvalidArgumentError("invalid transfer-encoding header"); + } else if (key.length === 10 && key.toLowerCase() === "connection") { + throw new InvalidArgumentError("invalid connection header"); + } else if (key.length === 10 && key.toLowerCase() === "keep-alive") { + throw new InvalidArgumentError("invalid keep-alive header"); + } else if (key.length === 7 && key.toLowerCase() === "upgrade") { + throw new InvalidArgumentError("invalid upgrade header"); + } else if (key.length === 6 && key.toLowerCase() === "expect") { + throw new NotSupportedError("expect header not supported"); + } else if (tokenRegExp.exec(key) === null) { + throw new InvalidArgumentError("invalid header key"); + } else if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`); + } else { + request2.headers += `${key}: ${val}\r +`; + } + } + __name(processHeader, "processHeader"); + module2.exports = Request; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/dispatcher.js +var require_dispatcher = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/dispatcher.js"(exports, module2) { + "use strict"; + var EventEmitter4 = require("events"); + var Dispatcher = class extends EventEmitter4 { + dispatch() { + throw new Error("not implemented"); + } + close() { + throw new Error("not implemented"); + } + destroy() { + throw new Error("not implemented"); + } + }; + __name(Dispatcher, "Dispatcher"); + module2.exports = Dispatcher; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/dispatcher-base.js +var require_dispatcher_base = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/dispatcher-base.js"(exports, module2) { + "use strict"; + var Dispatcher = require_dispatcher(); + var { + ClientDestroyedError, + ClientClosedError, + InvalidArgumentError + } = require_errors(); + var { kDestroy, kClose, kDispatch } = require_symbols(); + var kDestroyed = Symbol("destroyed"); + var kClosed = Symbol("closed"); + var kOnDestroyed = Symbol("onDestroyed"); + var kOnClosed = Symbol("onClosed"); + var DispatcherBase = class extends Dispatcher { + constructor() { + super(); + this[kDestroyed] = false; + this[kOnDestroyed] = []; + this[kClosed] = false; + this[kOnClosed] = []; + } + get destroyed() { + return this[kDestroyed]; + } + get closed() { + return this[kClosed]; + } + close(callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + this.close((err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError(), null)); + return; + } + if (this[kClosed]) { + if (this[kOnClosed]) { + this[kOnClosed].push(callback); + } else { + queueMicrotask(() => callback(null, null)); + } + return; + } + this[kClosed] = true; + this[kOnClosed].push(callback); + const onClosed = /* @__PURE__ */ __name(() => { + const callbacks = this[kOnClosed]; + this[kOnClosed] = null; + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null); + } + }, "onClosed"); + this[kClose]().then(() => this.destroy()).then(() => { + queueMicrotask(onClosed); + }); + } + destroy(err, callback) { + if (typeof err === "function") { + callback = err; + err = null; + } + if (callback === void 0) { + return new Promise((resolve, reject) => { + this.destroy(err, (err2, data) => { + return err2 ? reject(err2) : resolve(data); + }); + }); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (this[kDestroyed]) { + if (this[kOnDestroyed]) { + this[kOnDestroyed].push(callback); + } else { + queueMicrotask(() => callback(null, null)); + } + return; + } + if (!err) { + err = new ClientDestroyedError(); + } + this[kDestroyed] = true; + this[kOnDestroyed].push(callback); + const onDestroyed = /* @__PURE__ */ __name(() => { + const callbacks = this[kOnDestroyed]; + this[kOnDestroyed] = null; + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null); + } + }, "onDestroyed"); + this[kDestroy](err).then(() => { + queueMicrotask(onDestroyed); + }); + } + dispatch(opts, handler) { + if (!handler || typeof handler !== "object") { + throw new InvalidArgumentError("handler must be an object"); + } + try { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("opts must be an object."); + } + if (this[kDestroyed]) { + throw new ClientDestroyedError(); + } + if (this[kClosed]) { + throw new ClientClosedError(); + } + return this[kDispatch](opts, handler); + } catch (err) { + if (typeof handler.onError !== "function") { + throw new InvalidArgumentError("invalid onError method"); + } + handler.onError(err); + return false; + } + } + }; + __name(DispatcherBase, "DispatcherBase"); + module2.exports = DispatcherBase; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/handler/redirect.js +var require_redirect = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/handler/redirect.js"(exports, module2) { + "use strict"; + var util2 = require_util2(); + var { kBodyUsed } = require_symbols(); + var assert = require("assert"); + var { InvalidArgumentError } = require_errors(); + var EE = require("events"); + var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; + var kBody = Symbol("body"); + var BodyAsyncIterable = class { + constructor(body) { + this[kBody] = body; + this[kBodyUsed] = false; + } + async *[Symbol.asyncIterator]() { + assert(!this[kBodyUsed], "disturbed"); + this[kBodyUsed] = true; + yield* this[kBody]; + } + }; + __name(BodyAsyncIterable, "BodyAsyncIterable"); + var RedirectHandler = class { + constructor(dispatcher, maxRedirections, opts, handler) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + util2.validateHandler(handler, opts.method, opts.upgrade); + this.dispatcher = dispatcher; + this.location = null; + this.abort = null; + this.opts = { ...opts, maxRedirections: 0 }; + this.maxRedirections = maxRedirections; + this.handler = handler; + this.history = []; + if (util2.isStream(this.opts.body)) { + if (util2.bodyLength(this.opts.body) === 0) { + this.opts.body.on("data", function() { + assert(false); + }); + } + if (typeof this.opts.body.readableDidRead !== "boolean") { + this.opts.body[kBodyUsed] = false; + EE.prototype.on.call(this.opts.body, "data", function() { + this[kBodyUsed] = true; + }); + } + } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { + this.opts.body = new BodyAsyncIterable(this.opts.body); + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util2.isIterable(this.opts.body)) { + this.opts.body = new BodyAsyncIterable(this.opts.body); + } + } + onConnect(abort) { + this.abort = abort; + this.handler.onConnect(abort, { history: this.history }); + } + onUpgrade(statusCode, headers, socket) { + this.handler.onUpgrade(statusCode, headers, socket); + } + onError(error2) { + this.handler.onError(error2); + } + onHeaders(statusCode, headers, resume, statusText) { + this.location = this.history.length >= this.maxRedirections || util2.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); + if (this.opts.origin) { + this.history.push(new URL(this.opts.path, this.opts.origin)); + } + if (!this.location) { + return this.handler.onHeaders(statusCode, headers, resume, statusText); + } + const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const path7 = search ? `${pathname}${search}` : pathname; + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); + this.opts.path = path7; + this.opts.origin = origin; + this.opts.maxRedirections = 0; + if (statusCode === 303 && this.opts.method !== "HEAD") { + this.opts.method = "GET"; + this.opts.body = null; + } + } + onData(chunk) { + if (this.location) { + } else { + return this.handler.onData(chunk); + } + } + onComplete(trailers) { + if (this.location) { + this.location = null; + this.abort = null; + this.dispatcher.dispatch(this.opts, this); + } else { + this.handler.onComplete(trailers); + } + } + onBodySent(chunk) { + if (this.handler.onBodySent) { + this.handler.onBodySent(chunk); + } + } + }; + __name(RedirectHandler, "RedirectHandler"); + function parseLocation(statusCode, headers) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) { + return null; + } + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toString().toLowerCase() === "location") { + return headers[i + 1]; + } + } + } + __name(parseLocation, "parseLocation"); + function shouldRemoveHeader(header, removeContent, unknownOrigin) { + return header.length === 4 && header.toString().toLowerCase() === "host" || removeContent && header.toString().toLowerCase().indexOf("content-") === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === "authorization" || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === "cookie"; + } + __name(shouldRemoveHeader, "shouldRemoveHeader"); + function cleanRequestHeaders(headers, removeContent, unknownOrigin) { + const ret = []; + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { + ret.push(headers[i], headers[i + 1]); + } + } + } else if (headers && typeof headers === "object") { + for (const key of Object.keys(headers)) { + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { + ret.push(key, headers[key]); + } + } + } else { + assert(headers == null, "headers must be an object or an array"); + } + return ret; + } + __name(cleanRequestHeaders, "cleanRequestHeaders"); + module2.exports = RedirectHandler; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/connect.js +var require_connect = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/core/connect.js"(exports, module2) { + "use strict"; + var net2 = require("net"); + var assert = require("assert"); + var util2 = require_util2(); + var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); + var tls; + function buildConnector({ maxCachedSessions, socketPath, timeout, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); + } + const options = { path: socketPath, ...opts }; + const sessionCache = /* @__PURE__ */ new Map(); + timeout = timeout == null ? 1e4 : timeout; + maxCachedSessions = maxCachedSessions == null ? 100 : maxCachedSessions; + return /* @__PURE__ */ __name(function connect({ hostname: hostname3, host, protocol, port, servername, httpSocket }, callback) { + let socket; + if (protocol === "https:") { + if (!tls) { + tls = require("tls"); + } + servername = servername || options.servername || util2.getServerName(host) || null; + const sessionKey = servername || hostname3; + const session = sessionCache.get(sessionKey) || null; + assert(sessionKey); + socket = tls.connect({ + highWaterMark: 16384, + ...options, + servername, + session, + socket: httpSocket, + port: port || 443, + host: hostname3 + }); + socket.on("session", function(session2) { + if (maxCachedSessions === 0) { + return; + } + if (sessionCache.size >= maxCachedSessions) { + const { value: oldestKey } = sessionCache.keys().next(); + sessionCache.delete(oldestKey); + } + sessionCache.set(sessionKey, session2); + }).on("error", function(err) { + if (sessionKey && err.code !== "UND_ERR_INFO") { + sessionCache.delete(sessionKey); + } + }); + } else { + assert(!httpSocket, "httpSocket can only be sent on TLS update"); + socket = net2.connect({ + highWaterMark: 64 * 1024, + ...options, + port: port || 80, + host: hostname3 + }); + } + const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout); + socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { + cancelTimeout(); + if (callback) { + const cb = callback; + callback = null; + cb(null, this); + } + }).on("error", function(err) { + cancelTimeout(); + if (callback) { + const cb = callback; + callback = null; + cb(err); + } + }); + return socket; + }, "connect"); + } + __name(buildConnector, "buildConnector"); + function setupTimeout(onConnectTimeout2, timeout) { + if (!timeout) { + return () => { + }; + } + let s1 = null; + let s2 = null; + const timeoutId = setTimeout(() => { + s1 = setImmediate(() => { + if (process.platform === "win32") { + s2 = setImmediate(() => onConnectTimeout2()); + } else { + onConnectTimeout2(); + } + }); + }, timeout); + return () => { + clearTimeout(timeoutId); + clearImmediate(s1); + clearImmediate(s2); + }; + } + __name(setupTimeout, "setupTimeout"); + function onConnectTimeout(socket) { + util2.destroy(socket, new ConnectTimeoutError()); + } + __name(onConnectTimeout, "onConnectTimeout"); + module2.exports = buildConnector; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/llhttp/utils.js +var require_utils = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/llhttp/utils.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.enumToMap = void 0; + function enumToMap(obj) { + const res = {}; + Object.keys(obj).forEach((key) => { + const value = obj[key]; + if (typeof value === "number") { + res[key] = value; + } + }); + return res; + } + __name(enumToMap, "enumToMap"); + exports.enumToMap = enumToMap; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/llhttp/constants.js +var require_constants2 = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/llhttp/constants.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; + var utils_1 = require_utils(); + var ERROR; + (function(ERROR2) { + ERROR2[ERROR2["OK"] = 0] = "OK"; + ERROR2[ERROR2["INTERNAL"] = 1] = "INTERNAL"; + ERROR2[ERROR2["STRICT"] = 2] = "STRICT"; + ERROR2[ERROR2["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR2[ERROR2["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR2[ERROR2["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR2[ERROR2["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR2[ERROR2["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR2[ERROR2["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR2[ERROR2["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR2[ERROR2["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR2[ERROR2["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR2[ERROR2["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR2[ERROR2["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR2[ERROR2["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR2[ERROR2["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR2[ERROR2["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR2[ERROR2["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR2[ERROR2["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR2[ERROR2["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR2[ERROR2["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR2[ERROR2["PAUSED"] = 21] = "PAUSED"; + ERROR2[ERROR2["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR2[ERROR2["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR2[ERROR2["USER"] = 24] = "USER"; + })(ERROR = exports.ERROR || (exports.ERROR = {})); + var TYPE; + (function(TYPE2) { + TYPE2[TYPE2["BOTH"] = 0] = "BOTH"; + TYPE2[TYPE2["REQUEST"] = 1] = "REQUEST"; + TYPE2[TYPE2["RESPONSE"] = 2] = "RESPONSE"; + })(TYPE = exports.TYPE || (exports.TYPE = {})); + var FLAGS; + (function(FLAGS2) { + FLAGS2[FLAGS2["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS2[FLAGS2["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS2[FLAGS2["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS2[FLAGS2["CHUNKED"] = 8] = "CHUNKED"; + FLAGS2[FLAGS2["UPGRADE"] = 16] = "UPGRADE"; + FLAGS2[FLAGS2["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS2[FLAGS2["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS2[FLAGS2["TRAILING"] = 128] = "TRAILING"; + FLAGS2[FLAGS2["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; + })(FLAGS = exports.FLAGS || (exports.FLAGS = {})); + var LENIENT_FLAGS; + (function(LENIENT_FLAGS2) { + LENIENT_FLAGS2[LENIENT_FLAGS2["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS2[LENIENT_FLAGS2["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS2[LENIENT_FLAGS2["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; + })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); + var METHODS; + (function(METHODS2) { + METHODS2[METHODS2["DELETE"] = 0] = "DELETE"; + METHODS2[METHODS2["GET"] = 1] = "GET"; + METHODS2[METHODS2["HEAD"] = 2] = "HEAD"; + METHODS2[METHODS2["POST"] = 3] = "POST"; + METHODS2[METHODS2["PUT"] = 4] = "PUT"; + METHODS2[METHODS2["CONNECT"] = 5] = "CONNECT"; + METHODS2[METHODS2["OPTIONS"] = 6] = "OPTIONS"; + METHODS2[METHODS2["TRACE"] = 7] = "TRACE"; + METHODS2[METHODS2["COPY"] = 8] = "COPY"; + METHODS2[METHODS2["LOCK"] = 9] = "LOCK"; + METHODS2[METHODS2["MKCOL"] = 10] = "MKCOL"; + METHODS2[METHODS2["MOVE"] = 11] = "MOVE"; + METHODS2[METHODS2["PROPFIND"] = 12] = "PROPFIND"; + METHODS2[METHODS2["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS2[METHODS2["SEARCH"] = 14] = "SEARCH"; + METHODS2[METHODS2["UNLOCK"] = 15] = "UNLOCK"; + METHODS2[METHODS2["BIND"] = 16] = "BIND"; + METHODS2[METHODS2["REBIND"] = 17] = "REBIND"; + METHODS2[METHODS2["UNBIND"] = 18] = "UNBIND"; + METHODS2[METHODS2["ACL"] = 19] = "ACL"; + METHODS2[METHODS2["REPORT"] = 20] = "REPORT"; + METHODS2[METHODS2["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS2[METHODS2["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS2[METHODS2["MERGE"] = 23] = "MERGE"; + METHODS2[METHODS2["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS2[METHODS2["NOTIFY"] = 25] = "NOTIFY"; + METHODS2[METHODS2["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS2[METHODS2["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + METHODS2[METHODS2["PATCH"] = 28] = "PATCH"; + METHODS2[METHODS2["PURGE"] = 29] = "PURGE"; + METHODS2[METHODS2["MKCALENDAR"] = 30] = "MKCALENDAR"; + METHODS2[METHODS2["LINK"] = 31] = "LINK"; + METHODS2[METHODS2["UNLINK"] = 32] = "UNLINK"; + METHODS2[METHODS2["SOURCE"] = 33] = "SOURCE"; + METHODS2[METHODS2["PRI"] = 34] = "PRI"; + METHODS2[METHODS2["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS2[METHODS2["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS2[METHODS2["SETUP"] = 37] = "SETUP"; + METHODS2[METHODS2["PLAY"] = 38] = "PLAY"; + METHODS2[METHODS2["PAUSE"] = 39] = "PAUSE"; + METHODS2[METHODS2["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS2[METHODS2["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS2[METHODS2["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS2[METHODS2["REDIRECT"] = 43] = "REDIRECT"; + METHODS2[METHODS2["RECORD"] = 44] = "RECORD"; + METHODS2[METHODS2["FLUSH"] = 45] = "FLUSH"; + })(METHODS = exports.METHODS || (exports.METHODS = {})); + exports.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS["M-SEARCH"], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + METHODS.SOURCE + ]; + exports.METHODS_ICE = [ + METHODS.SOURCE + ]; + exports.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + METHODS.GET, + METHODS.POST + ]; + exports.METHOD_MAP = utils_1.enumToMap(METHODS); + exports.H_METHOD_MAP = {}; + Object.keys(exports.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; + } + }); + var FINISH; + (function(FINISH2) { + FINISH2[FINISH2["SAFE"] = 0] = "SAFE"; + FINISH2[FINISH2["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH2[FINISH2["UNSAFE"] = 2] = "UNSAFE"; + })(FINISH = exports.FINISH || (exports.FINISH = {})); + exports.ALPHA = []; + for (let i = "A".charCodeAt(0); i <= "Z".charCodeAt(0); i++) { + exports.ALPHA.push(String.fromCharCode(i)); + exports.ALPHA.push(String.fromCharCode(i + 32)); + } + exports.NUM_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9 + }; + exports.HEX_MAP = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + A: 10, + B: 11, + C: 12, + D: 13, + E: 14, + F: 15, + a: 10, + b: 11, + c: 12, + d: 13, + e: 14, + f: 15 + }; + exports.NUM = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9" + ]; + exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); + exports.MARK = ["-", "_", ".", "!", "~", "*", "'", "(", ")"]; + exports.USERINFO_CHARS = exports.ALPHANUM.concat(exports.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]); + exports.STRICT_URL_CHAR = [ + "!", + '"', + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + ":", + ";", + "<", + "=", + ">", + "@", + "[", + "\\", + "]", + "^", + "_", + "`", + "{", + "|", + "}", + "~" + ].concat(exports.ALPHANUM); + exports.URL_CHAR = exports.STRICT_URL_CHAR.concat([" ", "\f"]); + for (let i = 128; i <= 255; i++) { + exports.URL_CHAR.push(i); + } + exports.HEX = exports.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]); + exports.STRICT_TOKEN = [ + "!", + "#", + "$", + "%", + "&", + "'", + "*", + "+", + "-", + ".", + "^", + "_", + "`", + "|", + "~" + ].concat(exports.ALPHANUM); + exports.TOKEN = exports.STRICT_TOKEN.concat([" "]); + exports.HEADER_CHARS = [" "]; + for (let i = 32; i <= 255; i++) { + if (i !== 127) { + exports.HEADER_CHARS.push(i); + } + } + exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); + exports.MAJOR = exports.NUM_MAP; + exports.MINOR = exports.MAJOR; + var HEADER_STATE; + (function(HEADER_STATE2) { + HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE2[HEADER_STATE2["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE2[HEADER_STATE2["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; + })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); + exports.SPECIAL_HEADERS = { + "connection": HEADER_STATE.CONNECTION, + "content-length": HEADER_STATE.CONTENT_LENGTH, + "proxy-connection": HEADER_STATE.CONNECTION, + "transfer-encoding": HEADER_STATE.TRANSFER_ENCODING, + "upgrade": HEADER_STATE.UPGRADE + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/llhttp/llhttp.wasm.js +var require_llhttp_wasm = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/llhttp/llhttp.wasm.js"(exports, module2) { + module2.exports = "AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzk4AwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAYGAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAAMEBQFwAQ4OBQMBAAIGCAF/AUGAuAQLB/UEHwZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAJGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAKGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQA1DGxsaHR0cF9hbGxvYwAMBm1hbGxvYwA6C2xsaHR0cF9mcmVlAA0EZnJlZQA8D2xsaHR0cF9nZXRfdHlwZQAOFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAPFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAQEWxsaHR0cF9nZXRfbWV0aG9kABEWbGxodHRwX2dldF9zdGF0dXNfY29kZQASEmxsaHR0cF9nZXRfdXBncmFkZQATDGxsaHR0cF9yZXNldAAUDmxsaHR0cF9leGVjdXRlABUUbGxodHRwX3Nld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sAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC08AIABBGGpCADcDACAAQgA3AwAgAEEwakIANwMAIABBKGpCADcDACAAQSBqQgA3AwAgAEEQakIANwMAIABBCGpCADcDACAAQbwBNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQuICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC9POAQMcfwN+BX8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDyABIRAgASERIAEhEiABIRMgASEUIAEhFSABIRYgASEXIAEhGCABIRkgASEaIAEhGyABIRwgASEdAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIeQX9qDrwBtwEBtgECAwQFBgcICQoLDA0ODxDAAb8BERITtQEUFRYXGBkavQG8ARscHR4fICG0AbMBIiOyAbEBJCUmJygpKissLS4vMDEyMzQ1Njc4OTq4ATs8PT4/QE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QAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgHg6wAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgaHB4fICMkJSYnKCkqLC0uLzD7AjQ2ODk8P0FCQ0RFRkdISUpLTE1OT1BRUlNVV1lcXV5gYmNkZWZnaGtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBh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QALQd4AIR4MsAILQd4AIR4MrwILAkAgASIBIAJGDQAgAEGMgICAADYCCCAAIAE2AgQgASEBQc8AIR4MnwILQeAAIR4MrgILAkAgASIBIAJHDQBB4QAhHgyuAgsgAEGMgICAADYCCCAAIAE2AgQgASEBC0EDIR4MnAILA0AgAS0AAEEgRw2MAiABQQFqIgEgAkcNAAtB4gAhHgyrAgsCQCABIgEgAkcNAEHjACEeDKsCCyABLQAAQSBHDbgBIAFBAWohAQzUAQsCQCABIgggAkcNAEHkACEeDKoCCyAILQAAQcwARw27ASAIQQFqIQFBEyEeDLkBC0HlACEeIAEiIiACRg2oAiACICJrIAAoAgAiJmohIyAiIQggJiEBA0AgCC0AACABQfCygIAAai0AAEcNugEgAUEFRg24ASABQQFqIQEgCEEBaiIIIAJHDQALIAAgIzYCAAyoAgsCQCABIgggAkcNAEHmACEeDKgCCwJAAkAgCC0AAEG9f2oODAC7AbsBuwG7AbsBuwG7AbsBuwG7AQG7AQsgCEEBaiEBQdQAIR4MmAILIAhBAWohAUHVACEeDJcCC0HnACEeIAEiIiACRg2mAiACICJrIAAoAgAiJmohIyAiIQggJiEBAkADQCAILQAAIAFB7bOAgABqLQAARw25ASABQQJGDQEgAUEBaiEBIAhBAWoiCCACRw0ACyAAICM2AgAMpwILIABBADYCACAiICZrQQNqIQFBECEeDLYBC0HoACEeIAEiIiACRg2lAiACICJrIAAoAgAiJmohIyAiIQggJiEBAkADQCAILQAAIAFB9rKAgABqLQAARw24ASABQQVGDQEgAUEBaiEBIAhBAWoiCCACRw0ACyAAICM2AgAMpgILIABBADYCACAiICZrQQZqIQFBFiEeDLUBC0HpACEeIAEiIiACRg2kAiACICJrIAAoAgAiJmohIyAiIQggJiEBAkADQCAILQAAIAFB/LKAgABqLQAARw23ASABQQNGDQEgAUEBaiEBIAhBAWoiCCACRw0ACyAAICM2AgAMpQILIABBADYCACAiICZrQQRqIQFBBSEeDLQBCwJAIAEiCCACRw0AQeoAIR4MpAILIAgtAABB2QBHDbUB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BggEhHgyMAgsgAiAeayAAKAIAIiJqISYgHiEIICIhAQJAA0AgCC0AACABQamzgIAAai0AAEcNngEgAUEERg0BIAFBAWohASAIQQFqIgggAkcNAAsgACAmNgIAQYIBIR4MjAILIABBADYCACAeICJrQQVqIQFBGSEeDJsBCwJAIAEiIiACRw0AQYMBIR4MiwILIAIgImsgACgCACImaiEeICIhCCAmIQECQANAIAgtAAAgAUGus4CAAGotAABHDZ0BIAFBBUYNASABQQFqIQEgCEEBaiIIIAJHDQALIAAgHjYCAEGDASEeDIsCCyAAQQA2AgBBBiEeICIgJmtBBmohAQyaAQsCQCABIh4gAkcNAEGEASEeDIoCCyACIB5rIAAoAgAiImohJiAeIQggIiEBAkADQCAILQAAIAFBtLOAgABqLQAARw2cASABQQFGDQEgAUEBaiEBIAhBAWoiCCACRw0ACyAAICY2AgBBhAEhHgyKAgsgAEEANgIAIB4gImtBAmohAUEcIR4MmQELAkAgASIeIAJHDQBBhQEhHgyJAgsgAiAeayAAKAIAIiJqISYgHiEIICIhAQJAA0AgCC0AACABQbazgIAAai0AAEcNmwEgAUEBRg0BIAFBAWohASAIQQFqIgggAkcNAAsgACAmNgIAQYUBIR4MiQILIABBADYCACAeICJrQQJqIQFBJyEeDJgBCwJAIAEiCCACRw0AQYYBIR4MiAILAkACQCAILQAAQax/ag4CAAGbAQsgCEEBaiEBQfQAIR4M+AELIAhBAWohAUH1ACEeDPcBCwJAIAEiHiACRw0AQYcBIR4MhwILIAIgHmsgACgCACIiaiEmIB4hCCAiIQECQANAIAgtAAAgAUG4s4CAAGotAABHDZkBIAFBAUYNASABQQFqIQEgCEEBaiIIIAJHDQALIAAgJjYCAEGHASEeDIcCCyAAQQA2AgAgHiAia0ECaiEBQSYhHgyWAQsCQCABIh4gAkcNAEGIASEeDIYCCyACIB5rIAAoAgAiImohJiAeIQggIiEBAkADQCAILQAAIAFBurOAgABqLQAARw2YASABQQFGDQEgAUEBaiEBIAhBAWoiCCACRw0ACyAAICY2AgBBiAEhH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42AgxBACEeDJYBC0EAIR4gAEEANgIcIAAgATYCFCAAQeuNgIAANgIQIABBCTYCDAyVAQtBASEeCyAAIB46ACsgAUEBaiEBIAAtAClBIkYNiwEMTAsgAEEANgIcIAAgATYCFCAAQaKNgIAANgIQIABBCTYCDEEAIR4MkgELIABBADYCHCAAIAE2AhQgAEHFioCAADYCECAAQQk2AgxBACEeDJEBC0EBIR4LIAAgHjoAKiABQQFqIQEMSgsgAEEANgIcIAAgATYCFCAAQbiNgIAANgIQIABBCTYCDEEAIR4MjgELIABBADYCACAmICNrQQRqIQECQCAALQApQSNPDQAgASEBDEoLIABBADYCHCAAIAE2AhQgAEGviYCAADYCECAAQQg2AgxBACEeDI0BCyAAQQA2AgALQQAhHiAAQQA2AhwgACABNgIUIABBuZuAgAA2AhAgAEEINgIMDIsBCyAAQQA2AgAgJiAja0EDaiEBAkAgAC0AKUEhRw0AIAEhAQxHCyAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMQQAhHgyKAQsgAEEANgIAICYgI2tBBGohAQJAIAAtACkiHkFdakELTw0AIAEhAQxGCwJAIB5BBksNAEEBIB50QcoAcUUNACABIQEMRgtBACEeIABBADYCHCAAIAE2AhQgAEHTiYCAADYCECAAQQg2AgwMiQELIAAoAgQhHiAAQQA2AgQCQCAAIB4gARCkgICAACIeDQAgASEBDEYLIABB0AA2AhwgACABNgIUIAAgHjYCDEEAIR4MiAELIAAoAgQhHiAAQQA2AgQCQCAAIB4gARCkgICAACIeDQAgASEBDD8LIABBxAA2AhwgACABNgIUIAAgHjYCDEEAIR4MhwELIAAoAgQhHiAAQQA2AgQCQCAAIB4gARCkgICAACIeDQAgASEBDD8LIABBxQA2AhwgACABNgIUIAAgHjYCDEEAIR4MhgELIAAoAgQhHiAAQQA2AgQCQCAAIB4gARCkgICAACIeDQAgASEBDEMLIABB0AA2AhwgACABNgIUIAAgHjYCDEEAIR4MhQELIABBADYCHCAAIAE2AhQgAEGiioCAADYCECAAQQc2AgxBACE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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8="; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/llhttp/llhttp_simd.wasm.js +var require_llhttp_simd_wasm = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/llhttp/llhttp_simd.wasm.js"(exports, module2) { + module2.exports = "AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzk4AwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAYGAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAAMEBQFwAQ4OBQMBAAIGCAF/AUGAuAQLB/UEHwZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAJGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAKGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQA1DGxsaHR0cF9hbGxvYwAMBm1hbGxvYwA6C2xs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EhAyAALQAoQQFGDQAgAC8BMiIFQZx/akHkAEkNACAFQcwBRg0AIAVBsAJGDQAgBEHAAHENAEEAIQMgBEGIBHFBgARGDQAgBEEocUEARyEDCyAAQQA7ATAgAEEAOgAvIAMLlAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AQQAhASAALwEwIgJBAnFFDQEMAgtBACEBIAAvATAiAkEBcUUNAQtBASEBIAAtAChBAUYNACAALwEyIgBBnH9qQeQASQ0AIABBzAFGDQAgAEGwAkYNACACQcAAcQ0AQQAhASACQYgEcUGABEYNACACQShxQQBHIQELIAELSAEBeyAAQRBq/QwAAAAAAAAAAAAAAAAAAAAAIgH9CwMAIAAgAf0LAwAgAEEwakIANwMAIABBIGogAf0LAwAgAEG8ATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACELiAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvTzgEDHH8DfgV/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8gASEQIAEhESABIRIgASETIAEhFCABIRUgASEWIAEhFyABIRggASEZIAEhGiABIRsgASEcIAEhHQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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EhHgwSC0GdASEeDBELQZoBIR4MEAtBASEeDA8LQZsBIR4MDgtBnAEhHgwNC0GeASEeDAwLQaABIR4MCwtBnwEhHgwKC0GhASEeDAkLQaIBIR4MCAtBowEhHgwHC0GkASEeDAYLQaUBIR4MBQtBpgEhHgwEC0GnASEeDAMLQagBIR4MAgtBqQEhHgwBC0GvASEeCwNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQ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AILQAAIAFBiLOAgABqLQAARw2vASABQQNGDQEgAUEBaiEBIAhBAWoiCCACRw0ACyAAICM2AgAMnQILIABBADYCACAiICZrQQRqIQFBLSEeDKwBC0HyACEeIAEiIiACRg2bAiACICJrIAAoAgAiJmohIyAiIQggJiEBAkADQCAILQAAIAFB0LOAgABqLQAARw2uASABQQhGDQEgAUEBaiEBIAhBAWoiCCACRw0ACyAAICM2AgAMnAILIABBADYCACAiICZrQQlqIQFBKSEeDKsBCwJAIAEiASACRw0AQfMAIR4MmwILQQEhHiABLQAAQd8ARw2qASABQQFqIQEM3AELQfQAIR4gASIiIAJGDZkCIAIgImsgACgCACImaiEjICIhCCAmIQEDQCAILQAAIAFBjLOAgABqLQAARw2rASABQQFGDfcBIAFBAWohASAIQQFqIgggAkcNAAsgACAjNgIADJkCCwJAIAEiHiACRw0AQfUAIR4MmQILIAIgHmsgACgCACIiaiEmIB4hCCAiIQECQANAIAgtAAAgAUGOs4CAAGotAABHDasBIAFBAkYNASABQQFqIQEgCEEBaiIIIAJHDQALIAAgJjYCAEH1ACEeDJkCCyAAQQA2AgAgHiAia0EDaiEBQQIhHgyoAQsCQCABIh4gAkcNAEH2ACEeDJgCCyACIB5rIAAoAgAiImohJiAeIQggIiEBAkADQCAILQAAIAFB8LOAgABqLQAARw2qASABQQFGDQEgAUEBaiEBIAhBAWoiCCACRw0ACyAAICY2AgBB9gAhHgyYAgsgAEEANgIAIB4gImtBAmohAUEfIR4MpwELAkAgASIeIAJHDQBB9wAhHgyXAgsgAiAeayAAKAIAIiJqISYgHiEIICIhAQJAA0AgCC0AACABQfKzgIAAai0AAEcNqQEgAUEBRg0BIAFBAWohASAIQQFqIgggAkcNAAsgACAmNgIAQfcAIR4MlwILIABBADYCACAeICJrQQJqIQFBCSEeDKYBCwJAIAEiCCACRw0AQfgAIR4MlgILAkACQCAILQAAQbd/ag4HAKkBqQGpAakBqQEBqQELIAhBAWohAUHmACEeDIYCCyAIQQFqIQFB5wAhHgyFAgsCQC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gIUIABBh46AgAA2AhAgAEEKNgIMQQAhHgycAQsgAUEBaiEBCyAAQYASOwEqIAAgASACEKWAgIAAGiABIQELQawBIR4MiQELIAAoAgQhHiAAQQA2AgQCQCAAIB4gARCkgICAACIeDQAgASEBDFALIABBxAA2AhwgACABNgIUIAAgHjYCDEEAIR4MmAELIABBADYCHCAAICI2AhQgAEHlmICAADYCECAAQQc2AgwgAEEANgIAQQAhHgyXAQsgACgCBCEeIABBADYCBAJAIAAgHiABEKSAgIAAIh4NACABIQEMTwsgAEHFADYCHCAAIAE2AhQgACAeNgIMQQAhHgyWAQtBACEeIABBADYCHCAAIAE2AhQgAEHrjYCAADYCECAAQQk2AgwMlQELQQEhHgsgACAeOgArIAFBAWohASAALQApQSJGDYsBDEwLIABBADYCHCAAIAE2AhQgAEGijYCAADYCECAAQQk2AgxBACEeDJIBCyAAQQA2AhwgACABNgIUIABBxYqAgAA2AhAgAEEJNgIMQQAhHgyRAQtBASEeCyAAIB46ACogAUEBaiEBDEoLIABBADYCHCAAIAE2AhQgAEG4jYCAADYCECAAQQk2AgxBACEeDI4BCyAAQQA2AgAgJiAja0EEaiEBAkAgAC0AKUEjTw0AIAEhAQxKCyAAQQA2AhwgACABNgIUIABBr4mAgAA2AhAgAEEINgIMQQAhHgyNAQsgAEEANgIAC0EAIR4gAEEANgIcIAAgATYCFCAAQbmbgIAANgIQIABBCDYCDAyLAQsgAEEANgIAICYgI2tBA2ohAQJAIAAtAClBIUcNACABIQEMRwsgAEEANgIcIAAgATYCFCAAQfeJgIAANgIQIABBCDYCDEEAIR4MigELIABBADYCACAmICNrQQRqIQECQCAALQApIh5BXWpBC08NACABIQEMRgsCQCAeQQZLDQBBASAedEHKAHFFDQAgASEBDEYLQQAhHiAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMDIkBCyAAKAIEIR4gAEEANgIEAkAgACAeIAEQpICAgAAiHg0AIAEhAQxGCyAAQdAANgIcIAAgATYCFCAAIB42AgxBACEeDIgBCy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ygCCA4DAQcCAAsQv4CAgAAACyAAQQA2AhwgAEGJk4CAADYCECAAQRc2AgwgACABQQFqNgIUQQAhHgwFCyAAQQA2AhwgACABNgIUIABBnpOAgAA2AhAgAEEJNgIMQQAhHgwECwJAIAEiASACRw0AQSEhHgwECwJAIAEtAABBCkYNACAAQQA2AhwgACABNgIUIABB7oyAgAA2AhAgAEEKNgIMQQAhHgwECyAAKAIEIQggAEEANgIEIAAgCCABEKqAgIAAIggNASABQQFqIQELQQAhHiAAQQA2AhwgACABNgIUIABB6pCAgAA2AhAgAEEZNgIMDAILIABBIDYCHCAAIAg2AgwgACABQQFqNgIUQQAhHgwBCwJAIAEiASACRw0AQRQhHgwBCyAAQYmAgIAANgIIIAAgATYCBEETIR4LIANBEGokgICAgAAgHguvAQECfyABKAIAIQYCQAJAIAIgA0YNACAEIAZqIQQgBiADaiACayEHIAIgBkF/cyAFaiIGaiEFA0ACQCACLQAAIAQtAABGDQBBAiEEDAMLAkAgBg0AQQAhBCAFIQIMAwsgBkF/aiEGIARBAWohBCACQQFqIgIgA0cNAAsgByEGIAMhAgsgAEEBNgIAIAEgBjYCACAAIAI2AgQPCyABQQA2AgAgACAENgIAIAAgAjYCBAsKACAAELuAgIAAC5U3AQt/I4CAgIAAQRBrIgEkgICAgAACQEEAKAKgtICAAA0AQQAQvoCAgABBgLiEgABrIgJB2QBJDQBBACEDAkBBACgC4LeAgAAiBA0AQQBCfzcC7LeAgABBAEKAgISAgIDAADcC5LeAgABBACABQQhqQXBxQdiq1aoFcyIENgLgt4CAAEEAQQA2AvS3gIAAQQBBADYCxLeAgAALQQAgAjYCzLeAgABBAEGAuISAADYCyLeAgABBAEGAuISAADYCmLSAgABBACAENgKstICAAEEAQX82Aqi0gIAAA0AgA0HEtICAAGogA0G4tICAAGoiBDYCACAEIANBsLSAgABqIgU2AgAgA0G8tICAAGogBTYCACADQcy0gIAAaiADQcC0gIAAaiIFNgIAIAUgBDYCACADQdS0gIAAaiADQci0gIAAaiIENgIA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAACAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv"; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/client.js +var require_client = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/client.js"(exports, module2) { + "use strict"; + var assert = require("assert"); + var net2 = require("net"); + var util2 = require_util2(); + var Request = require_request(); + var DispatcherBase = require_dispatcher_base(); + var RedirectHandler = require_redirect(); + var { + RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, + InvalidArgumentError, + RequestAbortedError, + HeadersTimeoutError, + HeadersOverflowError, + SocketError, + InformationalError, + BodyTimeoutError, + HTTPParserError + } = require_errors(); + var buildConnector = require_connect(); + var { + kUrl, + kReset, + kServerName, + kClient, + kBusy, + kParser, + kConnect, + kBlocking, + kResuming, + kRunning, + kPending, + kSize, + kWriting, + kQueue, + kConnected, + kConnecting, + kNeedDrain, + kNoRef, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kSocket, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kConnector, + kMaxRedirections, + kMaxRequests, + kCounter, + kClose, + kDestroy, + kDispatch + } = require_symbols(); + var kClosedResolve = Symbol("kClosedResolve"); + var channels = {}; + try { + const diagnosticsChannel = require("diagnostics_channel"); + channels.sendHeaders = diagnosticsChannel.channel("undici:client:sendHeaders"); + channels.beforeConnect = diagnosticsChannel.channel("undici:client:beforeConnect"); + channels.connectError = diagnosticsChannel.channel("undici:client:connectError"); + channels.connected = diagnosticsChannel.channel("undici:client:connected"); + } catch (e) { + channels.sendHeaders = { hasSubscribers: false }; + channels.beforeConnect = { hasSubscribers: false }; + channels.connectError = { hasSubscribers: false }; + channels.connected = { hasSubscribers: false }; + } + var Client = class extends DispatcherBase { + constructor(url, { + maxHeaderSize, + headersTimeout, + socketTimeout, + requestTimeout, + connectTimeout, + bodyTimeout, + idleTimeout, + keepAlive, + keepAliveTimeout, + maxKeepAliveTimeout, + keepAliveMaxTimeout, + keepAliveTimeoutThreshold, + socketPath, + pipelining, + tls, + strictContentLength, + maxCachedSessions, + maxRedirections, + connect: connect2, + maxRequestsPerClient + } = {}) { + super(); + if (keepAlive !== void 0) { + throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); + } + if (socketTimeout !== void 0) { + throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead"); + } + if (requestTimeout !== void 0) { + throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead"); + } + if (idleTimeout !== void 0) { + throw new InvalidArgumentError("unsupported idleTimeout, use keepAliveTimeout instead"); + } + if (maxKeepAliveTimeout !== void 0) { + throw new InvalidArgumentError("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead"); + } + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { + throw new InvalidArgumentError("invalid maxHeaderSize"); + } + if (socketPath != null && typeof socketPath !== "string") { + throw new InvalidArgumentError("invalid socketPath"); + } + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { + throw new InvalidArgumentError("invalid connectTimeout"); + } + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { + throw new InvalidArgumentError("invalid keepAliveTimeout"); + } + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { + throw new InvalidArgumentError("invalid keepAliveMaxTimeout"); + } + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { + throw new InvalidArgumentError("invalid keepAliveTimeoutThreshold"); + } + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError("headersTimeout must be a positive integer or zero"); + } + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero"); + } + if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { + throw new InvalidArgumentError("maxRequestsPerClient must be a positive number"); + } + if (typeof connect2 !== "function") { + connect2 = buildConnector({ + ...tls, + maxCachedSessions, + socketPath, + timeout: connectTimeout, + ...connect2 + }); + } + this[kUrl] = util2.parseOrigin(url); + this[kConnector] = connect2; + this[kSocket] = null; + this[kPipelining] = pipelining != null ? pipelining : 1; + this[kMaxHeadersSize] = maxHeaderSize || 16384; + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold; + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]; + this[kServerName] = null; + this[kResuming] = 0; + this[kNeedDrain] = 0; + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r +`; + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e4; + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e4; + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength; + this[kMaxRedirections] = maxRedirections; + this[kMaxRequests] = maxRequestsPerClient; + this[kClosedResolve] = null; + this[kQueue] = []; + this[kRunningIdx] = 0; + this[kPendingIdx] = 0; + } + get pipelining() { + return this[kPipelining]; + } + set pipelining(value) { + this[kPipelining] = value; + resume(this, true); + } + get [kPending]() { + return this[kQueue].length - this[kPendingIdx]; + } + get [kRunning]() { + return this[kPendingIdx] - this[kRunningIdx]; + } + get [kSize]() { + return this[kQueue].length - this[kRunningIdx]; + } + get [kConnected]() { + return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed; + } + get [kBusy]() { + const socket = this[kSocket]; + return socket && (socket[kReset] || socket[kWriting] || socket[kBlocking]) || this[kSize] >= (this[kPipelining] || 1) || this[kPending] > 0; + } + [kConnect](cb) { + connect(this); + this.once("connect", cb); + } + [kDispatch](opts, handler) { + const { maxRedirections = this[kMaxRedirections] } = opts; + if (maxRedirections) { + handler = new RedirectHandler(this, maxRedirections, opts, handler); + } + const origin = opts.origin || this[kUrl].origin; + const request2 = new Request(origin, opts, handler); + this[kQueue].push(request2); + if (this[kResuming]) { + } else if (util2.bodyLength(request2.body) == null && util2.isIterable(request2.body)) { + this[kResuming] = 1; + process.nextTick(resume, this); + } else { + resume(this, true); + } + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { + this[kNeedDrain] = 2; + } + return this[kNeedDrain] < 2; + } + async [kClose]() { + return new Promise((resolve) => { + if (!this[kSize]) { + this.destroy(resolve); + } else { + this[kClosedResolve] = resolve; + } + }); + } + async [kDestroy](err) { + return new Promise((resolve) => { + const requests = this[kQueue].splice(this[kPendingIdx]); + for (let i = 0; i < requests.length; i++) { + const request2 = requests[i]; + errorRequest(this, request2, err); + } + const callback = /* @__PURE__ */ __name(() => { + if (this[kClosedResolve]) { + this[kClosedResolve](); + this[kClosedResolve] = null; + } + resolve(); + }, "callback"); + if (!this[kSocket]) { + queueMicrotask(callback); + } else { + util2.destroy(this[kSocket].on("close", callback), err); + } + resume(this); + }); + } + }; + __name(Client, "Client"); + var constants = require_constants2(); + var EMPTY_BUF = Buffer.alloc(0); + async function lazyllhttp() { + const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; + let mod2; + try { + mod2 = await WebAssembly.compile(Buffer.from(require_llhttp_simd_wasm(), "base64")); + } catch (e) { + mod2 = await WebAssembly.compile(Buffer.from(llhttpWasmData || require_llhttp_wasm(), "base64")); + } + return await WebAssembly.instantiate(mod2, { + env: { + wasm_on_url: (p, at, len) => { + return 0; + }, + wasm_on_status: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p); + const start = at - currentBufferPtr; + const end = start + len; + return currentParser.onStatus(currentBufferRef.slice(start, end)) || 0; + }, + wasm_on_message_begin: (p) => { + assert.strictEqual(currentParser.ptr, p); + return currentParser.onMessageBegin() || 0; + }, + wasm_on_header_field: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p); + const start = at - currentBufferPtr; + const end = start + len; + return currentParser.onHeaderField(currentBufferRef.slice(start, end)) || 0; + }, + wasm_on_header_value: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p); + const start = at - currentBufferPtr; + const end = start + len; + return currentParser.onHeaderValue(currentBufferRef.slice(start, end)) || 0; + }, + wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { + assert.strictEqual(currentParser.ptr, p); + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; + }, + wasm_on_body: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p); + const start = at - currentBufferPtr; + const end = start + len; + return currentParser.onBody(currentBufferRef.slice(start, end)) || 0; + }, + wasm_on_message_complete: (p) => { + assert.strictEqual(currentParser.ptr, p); + return currentParser.onMessageComplete() || 0; + } + } + }); + } + __name(lazyllhttp, "lazyllhttp"); + var llhttpInstance = null; + var llhttpPromise = lazyllhttp().catch(() => { + }); + var currentParser = null; + var currentBufferRef = null; + var currentBufferSize = 0; + var currentBufferPtr = null; + var TIMEOUT_HEADERS = 1; + var TIMEOUT_BODY = 2; + var TIMEOUT_IDLE = 3; + var Parser = class { + constructor(client, socket, { exports: exports2 }) { + assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); + this.llhttp = exports2; + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); + this.client = client; + this.socket = socket; + this.timeout = null; + this.timeoutValue = null; + this.timeoutType = null; + this.statusCode = null; + this.statusText = ""; + this.upgrade = false; + this.headers = []; + this.headersSize = 0; + this.headersMaxSize = client[kMaxHeadersSize]; + this.shouldKeepAlive = false; + this.paused = false; + this.resume = this.resume.bind(this); + this.bytesRead = 0; + this.keepAlive = ""; + this.contentLength = ""; + } + setTimeout(value, type) { + this.timeoutType = type; + if (value !== this.timeoutValue) { + clearTimeout(this.timeout); + if (value) { + this.timeout = setTimeout(onParserTimeout, value, this); + if (this.timeout.unref) { + this.timeout.unref(); + } + } else { + this.timeout = null; + } + this.timeoutValue = value; + } else if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + } + resume() { + if (this.socket.destroyed || !this.paused) { + return; + } + assert(this.ptr != null); + assert(currentParser == null); + this.llhttp.llhttp_resume(this.ptr); + assert(this.timeoutType === TIMEOUT_BODY); + if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + this.paused = false; + this.execute(this.socket.read() || EMPTY_BUF); + this.readMore(); + } + readMore() { + while (!this.paused && this.ptr) { + const chunk = this.socket.read(); + if (chunk === null) { + break; + } + this.execute(chunk); + } + } + execute(data) { + assert(this.ptr != null); + assert(currentParser == null); + assert(!this.paused); + const { socket, llhttp } = this; + if (data.length > currentBufferSize) { + if (currentBufferPtr) { + llhttp.free(currentBufferPtr); + } + currentBufferSize = Math.ceil(data.length / 4096) * 4096; + currentBufferPtr = llhttp.malloc(currentBufferSize); + } + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data); + try { + let ret; + try { + currentBufferRef = data; + currentParser = this; + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); + } catch (err) { + throw err; + } finally { + currentParser = null; + currentBufferRef = null; + } + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(data.slice(offset)); + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true; + socket.unshift(data.slice(offset)); + } else if (ret !== constants.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr); + let message = ""; + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); + message = Buffer.from(llhttp.memory.buffer, ptr, len).toString(); + } + throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)); + } + } catch (err) { + util2.destroy(socket, err); + } + } + finish() { + try { + try { + currentParser = this; + } finally { + currentParser = null; + } + } catch (err) { + util2.destroy(this.socket, err); + } + } + destroy() { + assert(this.ptr != null); + assert(currentParser == null); + this.llhttp.llhttp_free(this.ptr); + this.ptr = null; + clearTimeout(this.timeout); + this.timeout = null; + this.timeoutValue = null; + this.timeoutType = null; + this.paused = false; + } + onStatus(buf) { + this.statusText = buf.toString(); + } + onMessageBegin() { + const { socket, client } = this; + if (socket.destroyed) { + return -1; + } + const request2 = client[kQueue][client[kRunningIdx]]; + if (!request2) { + return -1; + } + } + onHeaderField(buf) { + const len = this.headers.length; + if ((len & 1) === 0) { + this.headers.push(buf); + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); + } + this.trackHeader(buf.length); + } + onHeaderValue(buf) { + let len = this.headers.length; + if ((len & 1) === 1) { + this.headers.push(buf); + len += 1; + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); + } + const key = this.headers[len - 2]; + if (key.length === 10 && key.toString().toLowerCase() === "keep-alive") { + this.keepAlive += buf.toString(); + } else if (key.length === 14 && key.toString().toLowerCase() === "content-length") { + this.contentLength += buf.toString(); + } + this.trackHeader(buf.length); + } + trackHeader(len) { + this.headersSize += len; + if (this.headersSize >= this.headersMaxSize) { + util2.destroy(this.socket, new HeadersOverflowError()); + } + } + onUpgrade(head) { + const { upgrade, client, socket, headers, statusCode } = this; + assert(upgrade); + const request2 = client[kQueue][client[kRunningIdx]]; + assert(request2); + assert(!socket.destroyed); + assert(socket === client[kSocket]); + assert(!this.paused); + assert(request2.upgrade || request2.method === "CONNECT"); + this.statusCode = null; + this.statusText = ""; + this.shouldKeepAlive = null; + assert(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + socket.unshift(head); + socket[kParser].destroy(); + socket[kParser] = null; + socket[kClient] = null; + socket[kError] = null; + socket.removeListener("error", onSocketError).removeListener("readable", onSocketReadable).removeListener("end", onSocketEnd).removeListener("close", onSocketClose); + client[kSocket] = null; + client[kQueue][client[kRunningIdx]++] = null; + client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); + try { + request2.onUpgrade(statusCode, headers, socket); + } catch (err) { + util2.destroy(socket, err); + } + resume(client); + } + onHeadersComplete(statusCode, upgrade, shouldKeepAlive) { + const { client, socket, headers, statusText } = this; + if (socket.destroyed) { + return -1; + } + const request2 = client[kQueue][client[kRunningIdx]]; + if (!request2) { + return -1; + } + assert(!this.upgrade); + assert(this.statusCode < 200); + if (statusCode === 100) { + util2.destroy(socket, new SocketError("bad response", util2.getSocketInfo(socket))); + return -1; + } + if (upgrade && !request2.upgrade) { + util2.destroy(socket, new SocketError("bad upgrade", util2.getSocketInfo(socket))); + return -1; + } + assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS); + this.statusCode = statusCode; + this.shouldKeepAlive = shouldKeepAlive; + if (this.statusCode >= 200) { + const bodyTimeout = request2.bodyTimeout != null ? request2.bodyTimeout : client[kBodyTimeout]; + this.setTimeout(bodyTimeout, TIMEOUT_BODY); + } else if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + if (request2.method === "CONNECT") { + assert(client[kRunning] === 1); + this.upgrade = true; + return 2; + } + if (upgrade) { + assert(client[kRunning] === 1); + this.upgrade = true; + return 2; + } + assert(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + if (shouldKeepAlive && client[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util2.parseKeepAliveTimeout(this.keepAlive) : null; + if (keepAliveTimeout != null) { + const timeout = Math.min( + keepAliveTimeout - client[kKeepAliveTimeoutThreshold], + client[kKeepAliveMaxTimeout] + ); + if (timeout <= 0) { + socket[kReset] = true; + } else { + client[kKeepAliveTimeoutValue] = timeout; + } + } else { + client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]; + } + } else { + socket[kReset] = true; + } + let pause; + try { + pause = request2.onHeaders(statusCode, headers, this.resume, statusText) === false; + } catch (err) { + util2.destroy(socket, err); + return -1; + } + if (request2.method === "HEAD") { + assert(socket[kReset]); + return 1; + } + if (statusCode < 200) { + return 1; + } + if (socket[kBlocking]) { + socket[kBlocking] = false; + resume(client); + } + return pause ? constants.ERROR.PAUSED : 0; + } + onBody(buf) { + const { client, socket, statusCode } = this; + if (socket.destroyed) { + return -1; + } + const request2 = client[kQueue][client[kRunningIdx]]; + assert(request2); + assert.strictEqual(this.timeoutType, TIMEOUT_BODY); + if (this.timeout) { + if (this.timeout.refresh) { + this.timeout.refresh(); + } + } + assert(statusCode >= 200); + this.bytesRead += buf.length; + try { + if (request2.onData(buf) === false) { + return constants.ERROR.PAUSED; + } + } catch (err) { + util2.destroy(socket, err); + return -1; + } + } + onMessageComplete() { + const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this; + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { + return -1; + } + if (upgrade) { + return; + } + const request2 = client[kQueue][client[kRunningIdx]]; + assert(request2); + assert(statusCode >= 100); + this.statusCode = null; + this.statusText = ""; + this.bytesRead = 0; + this.contentLength = ""; + this.keepAlive = ""; + assert(this.headers.length % 2 === 0); + this.headers = []; + this.headersSize = 0; + if (statusCode < 200) { + return; + } + if (request2.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { + util2.destroy(socket, new ResponseContentLengthMismatchError()); + return -1; + } + try { + request2.onComplete(headers); + } catch (err) { + errorRequest(client, request2, err); + } + client[kQueue][client[kRunningIdx]++] = null; + if (socket[kWriting]) { + assert.strictEqual(client[kRunning], 0); + util2.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (!shouldKeepAlive) { + util2.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (socket[kReset] && client[kRunning] === 0) { + util2.destroy(socket, new InformationalError("reset")); + return constants.ERROR.PAUSED; + } else if (client[kPipelining] === 1) { + setImmediate(resume, client); + } else { + resume(client); + } + } + }; + __name(Parser, "Parser"); + function onParserTimeout(parser) { + const { socket, timeoutType, client } = parser; + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { + assert(!parser.paused, "cannot be paused while waiting for headers"); + util2.destroy(socket, new HeadersTimeoutError()); + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!parser.paused) { + util2.destroy(socket, new BodyTimeoutError()); + } + } else if (timeoutType === TIMEOUT_IDLE) { + assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); + util2.destroy(socket, new InformationalError("socket idle timeout")); + } + } + __name(onParserTimeout, "onParserTimeout"); + function onSocketReadable() { + const { [kParser]: parser } = this; + parser.readMore(); + } + __name(onSocketReadable, "onSocketReadable"); + function onSocketError(err) { + const { [kParser]: parser } = this; + assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { + parser.finish(); + return; + } + this[kError] = err; + onError(this[kClient], err); + } + __name(onSocketError, "onSocketError"); + function onError(client, err) { + if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { + assert(client[kPendingIdx] === client[kRunningIdx]); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request2 = requests[i]; + errorRequest(client, request2, err); + } + assert(client[kSize] === 0); + } + } + __name(onError, "onError"); + function onSocketEnd() { + const { [kParser]: parser } = this; + if (parser.statusCode && !parser.shouldKeepAlive) { + parser.finish(); + return; + } + util2.destroy(this, new SocketError("other side closed", util2.getSocketInfo(this))); + } + __name(onSocketEnd, "onSocketEnd"); + function onSocketClose() { + const { [kClient]: client } = this; + this[kParser].destroy(); + this[kParser] = null; + const err = this[kError] || new SocketError("closed", util2.getSocketInfo(this)); + client[kSocket] = null; + if (client.destroyed) { + assert(client[kPending] === 0); + const requests = client[kQueue].splice(client[kRunningIdx]); + for (let i = 0; i < requests.length; i++) { + const request2 = requests[i]; + errorRequest(client, request2, err); + } + } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") { + const request2 = client[kQueue][client[kRunningIdx]]; + client[kQueue][client[kRunningIdx]++] = null; + errorRequest(client, request2, err); + } + client[kPendingIdx] = client[kRunningIdx]; + assert(client[kRunning] === 0); + client.emit("disconnect", client[kUrl], [client], err); + resume(client); + } + __name(onSocketClose, "onSocketClose"); + async function connect(client) { + assert(!client[kConnecting]); + assert(!client[kSocket]); + let { host, hostname: hostname3, protocol, port } = client[kUrl]; + if (hostname3[0] === "[") { + const idx = hostname3.indexOf("]"); + assert(idx !== -1); + const ip = hostname3.substr(1, idx - 1); + assert(net2.isIP(ip)); + hostname3 = ip; + } + client[kConnecting] = true; + if (channels.beforeConnect.hasSubscribers) { + channels.beforeConnect.publish({ + connectParams: { + host, + hostname: hostname3, + protocol, + port, + servername: client[kServerName] + }, + connector: client[kConnector] + }); + } + try { + const socket = await new Promise((resolve, reject) => { + client[kConnector]({ + host, + hostname: hostname3, + protocol, + port, + servername: client[kServerName] + }, (err, socket2) => { + if (err) { + reject(err); + } else { + resolve(socket2); + } + }); + }); + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise; + llhttpPromise = null; + } + client[kConnecting] = false; + assert(socket); + client[kSocket] = socket; + socket[kNoRef] = false; + socket[kWriting] = false; + socket[kReset] = false; + socket[kBlocking] = false; + socket[kError] = null; + socket[kParser] = new Parser(client, socket, llhttpInstance); + socket[kClient] = client; + socket[kCounter] = 0; + socket[kMaxRequests] = client[kMaxRequests]; + socket.on("error", onSocketError).on("readable", onSocketReadable).on("end", onSocketEnd).on("close", onSocketClose); + if (channels.connected.hasSubscribers) { + channels.connected.publish({ + connectParams: { + host, + hostname: hostname3, + protocol, + port, + servername: client[kServerName] + }, + connector: client[kConnector], + socket + }); + } + client.emit("connect", client[kUrl], [client]); + } catch (err) { + client[kConnecting] = false; + if (channels.connectError.hasSubscribers) { + channels.connectError.publish({ + connectParams: { + host, + hostname: hostname3, + protocol, + port, + servername: client[kServerName] + }, + connector: client[kConnector], + error: err + }); + } + if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { + assert(client[kRunning] === 0); + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { + const request2 = client[kQueue][client[kPendingIdx]++]; + errorRequest(client, request2, err); + } + } else { + onError(client, err); + } + client.emit("connectionError", client[kUrl], [client], err); + } + resume(client); + } + __name(connect, "connect"); + function emitDrain(client) { + client[kNeedDrain] = 0; + client.emit("drain", client[kUrl], [client]); + } + __name(emitDrain, "emitDrain"); + function resume(client, sync) { + if (client[kResuming] === 2) { + return; + } + client[kResuming] = 2; + _resume(client, sync); + client[kResuming] = 0; + if (client[kRunningIdx] > 256) { + client[kQueue].splice(0, client[kRunningIdx]); + client[kPendingIdx] -= client[kRunningIdx]; + client[kRunningIdx] = 0; + } + } + __name(resume, "resume"); + function _resume(client, sync) { + while (true) { + if (client.destroyed) { + assert(client[kPending] === 0); + return; + } + if (client.closed && !client[kSize]) { + client.destroy(); + return; + } + const socket = client[kSocket]; + if (socket) { + if (client[kSize] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref(); + socket[kNoRef] = true; + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref(); + socket[kNoRef] = false; + } + if (client[kSize] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { + socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE); + } + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request3 = client[kQueue][client[kRunningIdx]]; + const headersTimeout = request3.headersTimeout != null ? request3.headersTimeout : client[kHeadersTimeout]; + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); + } + } + } + if (client[kBusy]) { + client[kNeedDrain] = 2; + } else if (client[kNeedDrain] === 2) { + if (sync) { + client[kNeedDrain] = 1; + process.nextTick(emitDrain, client); + } else { + emitDrain(client); + } + continue; + } + if (client[kPending] === 0) { + return; + } + if (client[kRunning] >= (client[kPipelining] || 1)) { + return; + } + const request2 = client[kQueue][client[kPendingIdx]]; + if (client[kUrl].protocol === "https:" && client[kServerName] !== request2.servername) { + if (client[kRunning] > 0) { + return; + } + client[kServerName] = request2.servername; + if (socket && socket.servername !== request2.servername) { + util2.destroy(socket, new InformationalError("servername changed")); + return; + } + } + if (client[kConnecting]) { + return; + } + if (!socket) { + connect(client); + continue; + } + if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { + return; + } + if (client[kRunning] > 0 && !request2.idempotent) { + return; + } + if (client[kRunning] > 0 && (request2.upgrade || request2.method === "CONNECT")) { + return; + } + if (util2.isStream(request2.body) && util2.bodyLength(request2.body) === 0) { + request2.body.on("data", function() { + assert(false); + }).on("error", function(err) { + errorRequest(client, request2, err); + }).on("end", function() { + util2.destroy(this); + }); + request2.body = null; + } + if (client[kRunning] > 0 && (util2.isStream(request2.body) || util2.isAsyncIterable(request2.body))) { + return; + } + if (!request2.aborted && write(client, request2)) { + client[kPendingIdx]++; + } else { + client[kQueue].splice(client[kPendingIdx], 1); + } + } + } + __name(_resume, "_resume"); + function write(client, request2) { + const { body, method, path: path7, host, upgrade, headers, blocking } = request2; + const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; + if (body && typeof body.read === "function") { + body.read(0); + } + let contentLength = util2.bodyLength(body); + if (contentLength === null) { + contentLength = request2.contentLength; + } + if (contentLength === 0 && !expectsPayload) { + contentLength = null; + } + if (request2.contentLength !== null && request2.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + errorRequest(client, request2, new RequestContentLengthMismatchError()); + return false; + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + const socket = client[kSocket]; + try { + request2.onConnect((err) => { + if (request2.aborted || request2.completed) { + return; + } + errorRequest(client, request2, err || new RequestAbortedError()); + util2.destroy(socket, new InformationalError("aborted")); + }); + } catch (err) { + errorRequest(client, request2, err); + } + if (request2.aborted) { + return false; + } + if (method === "HEAD") { + socket[kReset] = true; + } + if (upgrade || method === "CONNECT") { + socket[kReset] = true; + } + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { + socket[kReset] = true; + } + if (blocking) { + socket[kBlocking] = true; + } + let header = `${method} ${path7} HTTP/1.1\r +`; + if (typeof host === "string") { + header += `host: ${host}\r +`; + } else { + header += client[kHostHeader]; + } + if (upgrade) { + header += `connection: upgrade\r +upgrade: ${upgrade}\r +`; + } else if (client[kPipelining]) { + header += "connection: keep-alive\r\n"; + } else { + header += "connection: close\r\n"; + } + if (headers) { + header += headers; + } + if (channels.sendHeaders.hasSubscribers) { + channels.sendHeaders.publish({ request: request2, headers: header, socket }); + } + if (!body) { + if (contentLength === 0) { + socket.write(`${header}content-length: 0\r +\r +`, "ascii"); + } else { + assert(contentLength === null, "no body must not have content length"); + socket.write(`${header}\r +`, "ascii"); + } + request2.onRequestSent(); + } else if (util2.isBuffer(body)) { + assert(contentLength === body.byteLength, "buffer body must have content length"); + socket.cork(); + socket.write(`${header}content-length: ${contentLength}\r +\r +`, "ascii"); + socket.write(body); + socket.uncork(); + request2.onBodySent(body); + request2.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + } else if (util2.isBlobLike(body)) { + if (typeof body.stream === "function") { + writeIterable({ body: body.stream(), client, request: request2, socket, contentLength, header, expectsPayload }); + } else { + writeBlob({ body, client, request: request2, socket, contentLength, header, expectsPayload }); + } + } else if (util2.isStream(body)) { + writeStream({ body, client, request: request2, socket, contentLength, header, expectsPayload }); + } else if (util2.isIterable(body)) { + writeIterable({ body, client, request: request2, socket, contentLength, header, expectsPayload }); + } else { + assert(false); + } + return true; + } + __name(write, "write"); + function writeStream({ body, client, request: request2, socket, contentLength, header, expectsPayload }) { + assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + let finished = false; + const writer = new AsyncWriter({ socket, request: request2, contentLength, client, expectsPayload, header }); + const onData = /* @__PURE__ */ __name(function(chunk) { + try { + assert(!finished); + if (!writer.write(chunk) && this.pause) { + this.pause(); + } + } catch (err) { + util2.destroy(this, err); + } + }, "onData"); + const onDrain = /* @__PURE__ */ __name(function() { + assert(!finished); + if (body.resume) { + body.resume(); + } + }, "onDrain"); + const onAbort = /* @__PURE__ */ __name(function() { + onFinished(new RequestAbortedError()); + }, "onAbort"); + const onFinished = /* @__PURE__ */ __name(function(err) { + if (finished) { + return; + } + finished = true; + assert(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); + socket.off("drain", onDrain).off("error", onFinished); + body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort); + if (!err) { + try { + writer.end(); + } catch (er) { + err = er; + } + } + writer.destroy(err); + if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { + util2.destroy(body, err); + } else { + util2.destroy(body); + } + }, "onFinished"); + body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort); + if (body.resume) { + body.resume(); + } + socket.on("drain", onDrain).on("error", onFinished); + } + __name(writeStream, "writeStream"); + async function writeBlob({ body, client, request: request2, socket, contentLength, header, expectsPayload }) { + assert(contentLength === body.size, "blob body must have content length"); + try { + if (contentLength != null && contentLength !== body.size) { + throw new RequestContentLengthMismatchError(); + } + const buffer = Buffer.from(await body.arrayBuffer()); + socket.cork(); + socket.write(`${header}content-length: ${contentLength}\r +\r +`, "ascii"); + socket.write(buffer); + socket.uncork(); + request2.onBodySent(buffer); + request2.onRequestSent(); + if (!expectsPayload) { + socket[kReset] = true; + } + resume(client); + } catch (err) { + util2.destroy(socket, err); + } + } + __name(writeBlob, "writeBlob"); + async function writeIterable({ body, client, request: request2, socket, contentLength, header, expectsPayload }) { + assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + let callback = null; + function onDrain() { + if (callback) { + const cb = callback; + callback = null; + cb(); + } + } + __name(onDrain, "onDrain"); + const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve, reject) => { + assert(callback === null); + if (socket[kError]) { + reject(socket[kError]); + } else { + callback = resolve; + } + }), "waitForDrain"); + socket.on("close", onDrain).on("drain", onDrain); + const writer = new AsyncWriter({ socket, request: request2, contentLength, client, expectsPayload, header }); + try { + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError]; + } + if (!writer.write(chunk)) { + await waitForDrain(); + } + } + writer.end(); + } catch (err) { + writer.destroy(err); + } finally { + socket.off("close", onDrain).off("drain", onDrain); + } + } + __name(writeIterable, "writeIterable"); + var AsyncWriter = class { + constructor({ socket, request: request2, contentLength, client, expectsPayload, header }) { + this.socket = socket; + this.request = request2; + this.contentLength = contentLength; + this.client = client; + this.bytesWritten = 0; + this.expectsPayload = expectsPayload; + this.header = header; + socket[kWriting] = true; + } + write(chunk) { + const { socket, request: request2, contentLength, client, bytesWritten, expectsPayload, header } = this; + if (socket[kError]) { + throw socket[kError]; + } + if (socket.destroyed) { + return false; + } + const len = Buffer.byteLength(chunk); + if (!len) { + return true; + } + if (contentLength !== null && bytesWritten + len > contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError(); + } + process.emitWarning(new RequestContentLengthMismatchError()); + } + if (bytesWritten === 0) { + if (!expectsPayload) { + socket[kReset] = true; + } + if (contentLength === null) { + socket.write(`${header}transfer-encoding: chunked\r +`, "ascii"); + } else { + socket.write(`${header}content-length: ${contentLength}\r +\r +`, "ascii"); + } + } + if (contentLength === null) { + socket.write(`\r +${len.toString(16)}\r +`, "ascii"); + } + this.bytesWritten += len; + const ret = socket.write(chunk); + request2.onBodySent(chunk); + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh(); + } + } + } + return ret; + } + end() { + const { socket, contentLength, client, bytesWritten, expectsPayload, header, request: request2 } = this; + request2.onRequestSent(); + socket[kWriting] = false; + if (socket[kError]) { + throw socket[kError]; + } + if (socket.destroyed) { + return; + } + if (bytesWritten === 0) { + if (expectsPayload) { + socket.write(`${header}content-length: 0\r +\r +`, "ascii"); + } else { + socket.write(`${header}\r +`, "ascii"); + } + } else if (contentLength === null) { + socket.write("\r\n0\r\n\r\n", "ascii"); + } + if (contentLength !== null && bytesWritten !== contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError(); + } else { + process.emitWarning(new RequestContentLengthMismatchError()); + } + } + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh(); + } + } + resume(client); + } + destroy(err) { + const { socket, client } = this; + socket[kWriting] = false; + if (err) { + assert(client[kRunning] <= 1, "pipeline should only contain this request"); + util2.destroy(socket, err); + } + } + }; + __name(AsyncWriter, "AsyncWriter"); + function errorRequest(client, request2, err) { + try { + request2.onError(err); + assert(request2.aborted); + } catch (err2) { + client.emit("error", err2); + } + } + __name(errorRequest, "errorRequest"); + module2.exports = Client; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/node/fixed-queue.js +var require_fixed_queue = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/node/fixed-queue.js"(exports, module2) { + "use strict"; + var kSize = 2048; + var kMask = kSize - 1; + var FixedCircularBuffer = class { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize); + this.next = null; + } + isEmpty() { + return this.top === this.bottom; + } + isFull() { + return (this.top + 1 & kMask) === this.bottom; + } + push(data) { + this.list[this.top] = data; + this.top = this.top + 1 & kMask; + } + shift() { + const nextItem = this.list[this.bottom]; + if (nextItem === void 0) + return null; + this.list[this.bottom] = void 0; + this.bottom = this.bottom + 1 & kMask; + return nextItem; + } + }; + __name(FixedCircularBuffer, "FixedCircularBuffer"); + module2.exports = /* @__PURE__ */ __name(class FixedQueue { + constructor() { + this.head = this.tail = new FixedCircularBuffer(); + } + isEmpty() { + return this.head.isEmpty(); + } + push(data) { + if (this.head.isFull()) { + this.head = this.head.next = new FixedCircularBuffer(); + } + this.head.push(data); + } + shift() { + const tail = this.tail; + const next = tail.shift(); + if (tail.isEmpty() && tail.next !== null) { + this.tail = tail.next; + } + return next; + } + }, "FixedQueue"); + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/pool-stats.js +var require_pool_stats = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/pool-stats.js"(exports, module2) { + var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); + var kPool = Symbol("pool"); + var PoolStats = class { + constructor(pool) { + this[kPool] = pool; + } + get connected() { + return this[kPool][kConnected]; + } + get free() { + return this[kPool][kFree]; + } + get pending() { + return this[kPool][kPending]; + } + get queued() { + return this[kPool][kQueued]; + } + get running() { + return this[kPool][kRunning]; + } + get size() { + return this[kPool][kSize]; + } + }; + __name(PoolStats, "PoolStats"); + module2.exports = PoolStats; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/pool-base.js +var require_pool_base = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/pool-base.js"(exports, module2) { + "use strict"; + var DispatcherBase = require_dispatcher_base(); + var FixedQueue = require_fixed_queue(); + var { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols(); + var PoolStats = require_pool_stats(); + var kClients = Symbol("clients"); + var kNeedDrain = Symbol("needDrain"); + var kQueue = Symbol("queue"); + var kClosedResolve = Symbol("closed resolve"); + var kOnDrain = Symbol("onDrain"); + var kOnConnect = Symbol("onConnect"); + var kOnDisconnect = Symbol("onDisconnect"); + var kOnConnectionError = Symbol("onConnectionError"); + var kGetDispatcher = Symbol("get dispatcher"); + var kAddClient = Symbol("add client"); + var kRemoveClient = Symbol("remove client"); + var kStats = Symbol("stats"); + var PoolBase = class extends DispatcherBase { + constructor() { + super(); + this[kQueue] = new FixedQueue(); + this[kClients] = []; + this[kQueued] = 0; + const pool = this; + this[kOnDrain] = /* @__PURE__ */ __name(function onDrain(origin, targets) { + const queue = pool[kQueue]; + let needDrain = false; + while (!needDrain) { + const item = queue.shift(); + if (!item) { + break; + } + pool[kQueued]--; + needDrain = !this.dispatch(item.opts, item.handler); + } + this[kNeedDrain] = needDrain; + if (!this[kNeedDrain] && pool[kNeedDrain]) { + pool[kNeedDrain] = false; + pool.emit("drain", origin, [pool, ...targets]); + } + if (pool[kClosedResolve] && queue.isEmpty()) { + Promise.all(pool[kClients].map((c) => c.close())).then(pool[kClosedResolve]); + } + }, "onDrain"); + this[kOnConnect] = (origin, targets) => { + pool.emit("connect", origin, [pool, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + pool.emit("disconnect", origin, [pool, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + pool.emit("connectionError", origin, [pool, ...targets], err); + }; + this[kStats] = new PoolStats(this); + } + get [kBusy]() { + return this[kNeedDrain]; + } + get [kConnected]() { + return this[kClients].filter((client) => client[kConnected]).length; + } + get [kFree]() { + return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length; + } + get [kPending]() { + let ret = this[kQueued]; + for (const { [kPending]: pending } of this[kClients]) { + ret += pending; + } + return ret; + } + get [kRunning]() { + let ret = 0; + for (const { [kRunning]: running } of this[kClients]) { + ret += running; + } + return ret; + } + get [kSize]() { + let ret = this[kQueued]; + for (const { [kSize]: size } of this[kClients]) { + ret += size; + } + return ret; + } + get stats() { + return this[kStats]; + } + async [kClose]() { + if (this[kQueue].isEmpty()) { + return Promise.all(this[kClients].map((c) => c.close())); + } else { + return new Promise((resolve) => { + this[kClosedResolve] = resolve; + }); + } + } + async [kDestroy](err) { + while (true) { + const item = this[kQueue].shift(); + if (!item) { + break; + } + item.handler.onError(err); + } + return Promise.all(this[kClients].map((c) => c.destroy(err))); + } + [kDispatch](opts, handler) { + const dispatcher = this[kGetDispatcher](); + if (!dispatcher) { + this[kNeedDrain] = true; + this[kQueue].push({ opts, handler }); + this[kQueued]++; + } else if (!dispatcher.dispatch(opts, handler)) { + dispatcher[kNeedDrain] = true; + this[kNeedDrain] = !this[kGetDispatcher](); + } + return !this[kNeedDrain]; + } + [kAddClient](client) { + client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients].push(client); + if (this[kNeedDrain]) { + process.nextTick(() => { + if (this[kNeedDrain]) { + this[kOnDrain](client[kUrl], [this, client]); + } + }); + } + return this; + } + [kRemoveClient](client) { + client.close(() => { + const idx = this[kClients].indexOf(client); + if (idx !== -1) { + this[kClients].splice(idx, 1); + } + }); + this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); + } + }; + __name(PoolBase, "PoolBase"); + module2.exports = { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/pool.js +var require_pool = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/pool.js"(exports, module2) { + "use strict"; + var { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kGetDispatcher + } = require_pool_base(); + var Client = require_client(); + var { + InvalidArgumentError + } = require_errors(); + var util2 = require_util2(); + var { kUrl } = require_symbols(); + var buildConnector = require_connect(); + var kOptions = Symbol("options"); + var kConnections = Symbol("connections"); + var kFactory = Symbol("factory"); + function defaultFactory(origin, opts) { + return new Client(origin, opts); + } + __name(defaultFactory, "defaultFactory"); + var Pool = class extends PoolBase { + constructor(origin, { + connections, + factory = defaultFactory, + connect, + connectTimeout, + tls, + maxCachedSessions, + socketPath, + ...options + } = {}) { + super(); + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError("invalid connections"); + } + if (typeof factory !== "function") { + throw new InvalidArgumentError("factory must be a function."); + } + if (connect != null && typeof connect !== "function" && typeof connect !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (typeof connect !== "function") { + connect = buildConnector({ + ...tls, + maxCachedSessions, + socketPath, + timeout: connectTimeout == null ? 1e4 : connectTimeout, + ...connect + }); + } + this[kConnections] = connections || null; + this[kUrl] = util2.parseOrigin(origin); + this[kOptions] = { ...util2.deepClone(options), connect }; + this[kFactory] = factory; + } + [kGetDispatcher]() { + let dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain]); + if (dispatcher) { + return dispatcher; + } + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + dispatcher = this[kFactory](this[kUrl], this[kOptions]); + this[kAddClient](dispatcher); + } + return dispatcher; + } + }; + __name(Pool, "Pool"); + module2.exports = Pool; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/balanced-pool.js +var require_balanced_pool = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/balanced-pool.js"(exports, module2) { + "use strict"; + var { + BalancedPoolMissingUpstreamError, + InvalidArgumentError + } = require_errors(); + var { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher + } = require_pool_base(); + var Pool = require_pool(); + var { kUrl } = require_symbols(); + var { parseOrigin } = require_util2(); + var kFactory = Symbol("factory"); + var kOptions = Symbol("options"); + var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); + var kCurrentWeight = Symbol("kCurrentWeight"); + var kIndex = Symbol("kIndex"); + var kWeight = Symbol("kWeight"); + var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); + var kErrorPenalty = Symbol("kErrorPenalty"); + function getGreatestCommonDivisor(a, b) { + if (b === 0) + return a; + return getGreatestCommonDivisor(b, a % b); + } + __name(getGreatestCommonDivisor, "getGreatestCommonDivisor"); + function defaultFactory(origin, opts) { + return new Pool(origin, opts); + } + __name(defaultFactory, "defaultFactory"); + var BalancedPool = class extends PoolBase { + constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) { + super(); + this[kOptions] = opts; + this[kIndex] = -1; + this[kCurrentWeight] = 0; + this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100; + this[kErrorPenalty] = this[kOptions].errorPenalty || 15; + if (!Array.isArray(upstreams)) { + upstreams = [upstreams]; + } + if (typeof factory !== "function") { + throw new InvalidArgumentError("factory must be a function."); + } + this[kFactory] = factory; + for (const upstream of upstreams) { + this.addUpstream(upstream); + } + this._updateBalancedPoolStats(); + } + addUpstream(upstream) { + const upstreamOrigin = parseOrigin(upstream).origin; + if (this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true)) { + return this; + } + const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])); + this[kAddClient](pool); + pool.on("connect", () => { + pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]); + }); + pool.on("connectionError", () => { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); + this._updateBalancedPoolStats(); + }); + pool.on("disconnect", (...args) => { + const err = args[2]; + if (err && err.code === "UND_ERR_SOCKET") { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); + this._updateBalancedPoolStats(); + } + }); + for (const client of this[kClients]) { + client[kWeight] = this[kMaxWeightPerServer]; + } + this._updateBalancedPoolStats(); + return this; + } + _updateBalancedPoolStats() { + this[kGreatestCommonDivisor] = this[kClients].map((p) => p[kWeight]).reduce(getGreatestCommonDivisor, 0); + } + removeUpstream(upstream) { + const upstreamOrigin = parseOrigin(upstream).origin; + const pool = this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true); + if (pool) { + this[kRemoveClient](pool); + } + return this; + } + get upstreams() { + return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p) => p[kUrl].origin); + } + [kGetDispatcher]() { + if (this[kClients].length === 0) { + throw new BalancedPoolMissingUpstreamError(); + } + const dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain] && dispatcher2.closed !== true && dispatcher2.destroyed !== true); + if (!dispatcher) { + return; + } + const allClientsBusy = this[kClients].map((pool) => pool[kNeedDrain]).reduce((a, b) => a && b, true); + if (allClientsBusy) { + return; + } + let counter = 0; + let maxWeightIndex = this[kClients].findIndex((pool) => !pool[kNeedDrain]); + while (counter++ < this[kClients].length) { + this[kIndex] = (this[kIndex] + 1) % this[kClients].length; + const pool = this[kClients][this[kIndex]]; + if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { + maxWeightIndex = this[kIndex]; + } + if (this[kIndex] === 0) { + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]; + if (this[kCurrentWeight] <= 0) { + this[kCurrentWeight] = this[kMaxWeightPerServer]; + } + } + if (pool[kWeight] >= this[kCurrentWeight] && !pool[kNeedDrain]) { + return pool; + } + } + this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]; + this[kIndex] = maxWeightIndex; + return this[kClients][maxWeightIndex]; + } + }; + __name(BalancedPool, "BalancedPool"); + module2.exports = BalancedPool; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/compat/dispatcher-weakref.js +var require_dispatcher_weakref = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/compat/dispatcher-weakref.js"(exports, module2) { + "use strict"; + var { kConnected, kSize } = require_symbols(); + var CompatWeakRef = class { + constructor(value) { + this.value = value; + } + deref() { + return this.value[kConnected] === 0 && this.value[kSize] === 0 ? void 0 : this.value; + } + }; + __name(CompatWeakRef, "CompatWeakRef"); + var CompatFinalizer = class { + constructor(finalizer) { + this.finalizer = finalizer; + } + register(dispatcher, key) { + dispatcher.on("disconnect", () => { + if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { + this.finalizer(key); + } + }); + } + }; + __name(CompatFinalizer, "CompatFinalizer"); + module2.exports = function() { + return { + WeakRef: global.WeakRef || CompatWeakRef, + FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer + }; + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/agent.js +var require_agent = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/agent.js"(exports, module2) { + "use strict"; + var { InvalidArgumentError } = require_errors(); + var { kClients, kRunning, kClose, kDestroy, kDispatch } = require_symbols(); + var DispatcherBase = require_dispatcher_base(); + var Pool = require_pool(); + var Client = require_client(); + var util2 = require_util2(); + var RedirectHandler = require_redirect(); + var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); + var kOnConnect = Symbol("onConnect"); + var kOnDisconnect = Symbol("onDisconnect"); + var kOnConnectionError = Symbol("onConnectionError"); + var kMaxRedirections = Symbol("maxRedirections"); + var kOnDrain = Symbol("onDrain"); + var kFactory = Symbol("factory"); + var kFinalizer = Symbol("finalizer"); + var kOptions = Symbol("options"); + function defaultFactory(origin, opts) { + return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); + } + __name(defaultFactory, "defaultFactory"); + var Agent = class extends DispatcherBase { + constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { + super(); + if (typeof factory !== "function") { + throw new InvalidArgumentError("factory must be a function."); + } + if (connect != null && typeof connect !== "function" && typeof connect !== "object") { + throw new InvalidArgumentError("connect must be a function or an object"); + } + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { + throw new InvalidArgumentError("maxRedirections must be a positive number"); + } + if (connect && typeof connect !== "function") { + connect = { ...connect }; + } + this[kOptions] = { ...util2.deepClone(options), connect }; + this[kMaxRedirections] = maxRedirections; + this[kFactory] = factory; + this[kClients] = /* @__PURE__ */ new Map(); + this[kFinalizer] = new FinalizationRegistry((key) => { + const ref = this[kClients].get(key); + if (ref !== void 0 && ref.deref() === void 0) { + this[kClients].delete(key); + } + }); + const agent = this; + this[kOnDrain] = (origin, targets) => { + agent.emit("drain", origin, [agent, ...targets]); + }; + this[kOnConnect] = (origin, targets) => { + agent.emit("connect", origin, [agent, ...targets]); + }; + this[kOnDisconnect] = (origin, targets, err) => { + agent.emit("disconnect", origin, [agent, ...targets], err); + }; + this[kOnConnectionError] = (origin, targets, err) => { + agent.emit("connectionError", origin, [agent, ...targets], err); + }; + } + get [kRunning]() { + let ret = 0; + for (const ref of this[kClients].values()) { + const client = ref.deref(); + if (client) { + ret += client[kRunning]; + } + } + return ret; + } + [kDispatch](opts, handler) { + let key; + if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) { + key = String(opts.origin); + } else { + throw new InvalidArgumentError("opts.origin must be a non-empty string or URL."); + } + const ref = this[kClients].get(key); + let dispatcher = ref ? ref.deref() : null; + if (!dispatcher) { + dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); + this[kClients].set(key, new WeakRef2(dispatcher)); + this[kFinalizer].register(dispatcher, key); + } + const { maxRedirections = this[kMaxRedirections] } = opts; + if (maxRedirections != null && maxRedirections !== 0) { + opts = { ...opts, maxRedirections: 0 }; + handler = new RedirectHandler(this, maxRedirections, opts, handler); + } + return dispatcher.dispatch(opts, handler); + } + async [kClose]() { + const closePromises = []; + for (const ref of this[kClients].values()) { + const client = ref.deref(); + if (client) { + closePromises.push(client.close()); + } + } + await Promise.all(closePromises); + } + async [kDestroy](err) { + const destroyPromises = []; + for (const ref of this[kClients].values()) { + const client = ref.deref(); + if (client) { + destroyPromises.push(client.destroy(err)); + } + } + await Promise.all(destroyPromises); + } + }; + __name(Agent, "Agent"); + module2.exports = Agent; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/readable.js +var require_readable = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/readable.js"(exports, module2) { + "use strict"; + var assert = require("assert"); + var { Readable } = require("stream"); + var { RequestAbortedError, NotSupportedError } = require_errors(); + var util2 = require_util2(); + var { ReadableStreamFrom, toUSVString } = require_util2(); + var Blob; + var kConsume = Symbol("kConsume"); + var kReading = Symbol("kReading"); + var kBody = Symbol("kBody"); + var kAbort = Symbol("abort"); + var kContentType = Symbol("kContentType"); + module2.exports = /* @__PURE__ */ __name(class BodyReadable extends Readable { + constructor(resume, abort, contentType = "") { + super({ + autoDestroy: true, + read: resume, + highWaterMark: 64 * 1024 + }); + this._readableState.dataEmitted = false; + this[kAbort] = abort; + this[kConsume] = null; + this[kBody] = null; + this[kContentType] = contentType; + this[kReading] = false; + } + destroy(err) { + if (this.destroyed) { + return this; + } + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError(); + } + if (err) { + this[kAbort](); + } + return super.destroy(err); + } + emit(ev, ...args) { + if (ev === "data") { + this._readableState.dataEmitted = true; + } else if (ev === "error") { + this._readableState.errorEmitted = true; + } + return super.emit(ev, ...args); + } + on(ev, ...args) { + if (ev === "data" || ev === "readable") { + this[kReading] = true; + } + return super.on(ev, ...args); + } + addListener(ev, ...args) { + return this.on(ev, ...args); + } + off(ev, ...args) { + const ret = super.off(ev, ...args); + if (ev === "data" || ev === "readable") { + this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0; + } + return ret; + } + removeListener(ev, ...args) { + return this.off(ev, ...args); + } + push(chunk) { + if (this[kConsume] && chunk !== null && this.readableLength === 0) { + consumePush(this[kConsume], chunk); + return this[kReading] ? super.push(chunk) : true; + } + return super.push(chunk); + } + async text() { + return consume(this, "text"); + } + async json() { + return consume(this, "json"); + } + async blob() { + return consume(this, "blob"); + } + async arrayBuffer() { + return consume(this, "arrayBuffer"); + } + async formData() { + throw new NotSupportedError(); + } + get bodyUsed() { + return util2.isDisturbed(this); + } + get body() { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this); + if (this[kConsume]) { + this[kBody].getReader(); + assert(this[kBody].locked); + } + } + return this[kBody]; + } + async dump(opts) { + let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144; + try { + for await (const chunk of this) { + limit -= Buffer.byteLength(chunk); + if (limit < 0) { + return; + } + } + } catch (e) { + } + } + }, "BodyReadable"); + function isLocked(self2) { + return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; + } + __name(isLocked, "isLocked"); + function isUnusable(self2) { + return util2.isDisturbed(self2) || isLocked(self2); + } + __name(isUnusable, "isUnusable"); + async function consume(stream2, type) { + if (isUnusable(stream2)) { + throw new TypeError("unusable"); + } + assert(!stream2[kConsume]); + return new Promise((resolve, reject) => { + stream2[kConsume] = { + type, + stream: stream2, + resolve, + reject, + length: 0, + body: [] + }; + stream2.on("error", function(err) { + consumeFinish(this[kConsume], err); + }).on("close", function() { + if (this[kConsume].body !== null) { + consumeFinish(this[kConsume], new RequestAbortedError()); + } + }); + process.nextTick(consumeStart, stream2[kConsume]); + }); + } + __name(consume, "consume"); + function consumeStart(consume2) { + if (consume2.body === null) { + return; + } + const { _readableState: state } = consume2.stream; + for (const chunk of state.buffer) { + consumePush(consume2, chunk); + } + if (state.endEmitted) { + consumeEnd(this[kConsume]); + } else { + consume2.stream.on("end", function() { + consumeEnd(this[kConsume]); + }); + } + consume2.stream.resume(); + while (consume2.stream.read() != null) { + } + } + __name(consumeStart, "consumeStart"); + function consumeEnd(consume2) { + const { type, body, resolve, stream: stream2, length } = consume2; + try { + if (type === "text") { + resolve(toUSVString(Buffer.concat(body))); + } else if (type === "json") { + resolve(JSON.parse(Buffer.concat(body))); + } else if (type === "arrayBuffer") { + const dst = new Uint8Array(length); + let pos = 0; + for (const buf of body) { + dst.set(buf, pos); + pos += buf.byteLength; + } + resolve(dst); + } else if (type === "blob") { + if (!Blob) { + Blob = require("buffer").Blob; + } + resolve(new Blob(body, { type: stream2[kContentType] })); + } + consumeFinish(consume2); + } catch (err) { + stream2.destroy(err); + } + } + __name(consumeEnd, "consumeEnd"); + function consumePush(consume2, chunk) { + consume2.length += chunk.length; + consume2.body.push(chunk); + } + __name(consumePush, "consumePush"); + function consumeFinish(consume2, err) { + if (consume2.body === null) { + return; + } + if (err) { + consume2.reject(err); + } else { + consume2.resolve(); + } + consume2.type = null; + consume2.stream = null; + consume2.resolve = null; + consume2.reject = null; + consume2.length = 0; + consume2.body = null; + } + __name(consumeFinish, "consumeFinish"); + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/abort-signal.js +var require_abort_signal = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/abort-signal.js"(exports, module2) { + var { RequestAbortedError } = require_errors(); + var kListener = Symbol("kListener"); + var kSignal = Symbol("kSignal"); + function abort(self2) { + if (self2.abort) { + self2.abort(); + } else { + self2.onError(new RequestAbortedError()); + } + } + __name(abort, "abort"); + function addSignal(self2, signal) { + self2[kSignal] = null; + self2[kListener] = null; + if (!signal) { + return; + } + if (signal.aborted) { + abort(self2); + return; + } + self2[kSignal] = signal; + self2[kListener] = () => { + abort(self2); + }; + if ("addEventListener" in self2[kSignal]) { + self2[kSignal].addEventListener("abort", self2[kListener]); + } else { + self2[kSignal].addListener("abort", self2[kListener]); + } + } + __name(addSignal, "addSignal"); + function removeSignal(self2) { + if (!self2[kSignal]) { + return; + } + if ("removeEventListener" in self2[kSignal]) { + self2[kSignal].removeEventListener("abort", self2[kListener]); + } else { + self2[kSignal].removeListener("abort", self2[kListener]); + } + self2[kSignal] = null; + self2[kListener] = null; + } + __name(removeSignal, "removeSignal"); + module2.exports = { + addSignal, + removeSignal + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-request.js +var require_api_request = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-request.js"(exports, module2) { + "use strict"; + var Readable = require_readable(); + var { + InvalidArgumentError, + RequestAbortedError, + ResponseStatusCodeError + } = require_errors(); + var util2 = require_util2(); + var { AsyncResource: AsyncResource2 } = require("async_hooks"); + var { addSignal, removeSignal } = require_abort_signal(); + var RequestHandler2 = class extends AsyncResource2 { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts; + try { + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_REQUEST"); + } catch (err) { + if (util2.isStream(body)) { + util2.destroy(body.on("error", util2.nop), err); + } + throw err; + } + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.res = null; + this.abort = null; + this.body = body; + this.trailers = {}; + this.context = null; + this.onInfo = onInfo || null; + this.throwOnError = throwOnError; + if (util2.isStream(body)) { + body.on("error", (err) => { + this.onError(err); + }); + } + addSignal(this, signal); + } + onConnect(abort, context3) { + if (!this.callback) { + throw new RequestAbortedError(); + } + this.abort = abort; + this.context = context3; + } + onHeaders(statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context: context3 } = this; + if (statusCode < 200) { + if (this.onInfo) { + const headers2 = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + this.onInfo({ statusCode, headers: headers2 }); + } + return; + } + const parsedHeaders = util2.parseHeaders(rawHeaders); + const contentType = parsedHeaders["content-type"]; + const body = new Readable(resume, abort, contentType); + this.callback = null; + this.res = body; + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope( + getResolveErrorBodyCallback, + null, + { callback, body, contentType, statusCode, statusMessage, headers } + ); + return; + } + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body, + context: context3 + }); + } + } + onData(chunk) { + const { res } = this; + return res.push(chunk); + } + onComplete(trailers) { + const { res } = this; + removeSignal(this); + util2.parseHeaders(trailers, this.trailers); + res.push(null); + } + onError(err) { + const { res, callback, body, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (res) { + this.res = null; + queueMicrotask(() => { + util2.destroy(res, err); + }); + } + if (body) { + this.body = null; + util2.destroy(body, err); + } + } + }; + __name(RequestHandler2, "RequestHandler"); + async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { + if (statusCode === 204 || !contentType) { + body.dump(); + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers)); + return; + } + try { + if (contentType.startsWith("application/json")) { + const payload = await body.json(); + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers, payload)); + return; + } + if (contentType.startsWith("text/")) { + const payload = await body.text(); + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers, payload)); + return; + } + } catch (err) { + } + body.dump(); + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers)); + } + __name(getResolveErrorBodyCallback, "getResolveErrorBodyCallback"); + function request2(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + request2.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + this.dispatch(opts, new RequestHandler2(opts, callback)); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + __name(request2, "request"); + module2.exports = request2; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-stream.js +var require_api_stream = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-stream.js"(exports, module2) { + "use strict"; + var { finished } = require("stream"); + var { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError + } = require_errors(); + var util2 = require_util2(); + var { AsyncResource: AsyncResource2 } = require("async_hooks"); + var { addSignal, removeSignal } = require_abort_signal(); + var StreamHandler = class extends AsyncResource2 { + constructor(opts, factory, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + const { signal, method, opaque, body, onInfo, responseHeaders } = opts; + try { + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + if (typeof factory !== "function") { + throw new InvalidArgumentError("invalid factory"); + } + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_STREAM"); + } catch (err) { + if (util2.isStream(body)) { + util2.destroy(body.on("error", util2.nop), err); + } + throw err; + } + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.factory = factory; + this.callback = callback; + this.res = null; + this.abort = null; + this.context = null; + this.trailers = null; + this.body = body; + this.onInfo = onInfo || null; + if (util2.isStream(body)) { + body.on("error", (err) => { + this.onError(err); + }); + } + addSignal(this, signal); + } + onConnect(abort, context3) { + if (!this.callback) { + throw new RequestAbortedError(); + } + this.abort = abort; + this.context = context3; + } + onHeaders(statusCode, rawHeaders, resume) { + const { factory, opaque, context: context3 } = this; + if (statusCode < 200) { + if (this.onInfo) { + const headers2 = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + this.onInfo({ statusCode, headers: headers2 }); + } + return; + } + this.factory = null; + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + const res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context: context3 + }); + if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { + throw new InvalidReturnValueError("expected Writable"); + } + res.on("drain", resume); + finished(res, { readable: false }, (err) => { + const { callback, res: res2, opaque: opaque2, trailers, abort } = this; + this.res = null; + if (err || !res2.readable) { + util2.destroy(res2, err); + } + this.callback = null; + this.runInAsyncScope(callback, null, err || null, { opaque: opaque2, trailers }); + if (err) { + abort(); + } + }); + this.res = res; + const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState && res._writableState.needDrain; + return needDrain !== true; + } + onData(chunk) { + const { res } = this; + return res.write(chunk); + } + onComplete(trailers) { + const { res } = this; + removeSignal(this); + this.trailers = util2.parseHeaders(trailers); + res.end(); + } + onError(err) { + const { res, callback, opaque, body } = this; + removeSignal(this); + this.factory = null; + if (res) { + this.res = null; + util2.destroy(res, err); + } else if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + if (body) { + this.body = null; + util2.destroy(body, err); + } + } + }; + __name(StreamHandler, "StreamHandler"); + function stream2(opts, factory, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + stream2.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + this.dispatch(opts, new StreamHandler(opts, factory, callback)); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + __name(stream2, "stream"); + module2.exports = stream2; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-pipeline.js +var require_api_pipeline = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-pipeline.js"(exports, module2) { + "use strict"; + var { + Readable, + Duplex, + PassThrough + } = require("stream"); + var { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError + } = require_errors(); + var util2 = require_util2(); + var { AsyncResource: AsyncResource2 } = require("async_hooks"); + var { addSignal, removeSignal } = require_abort_signal(); + var assert = require("assert"); + var kResume = Symbol("resume"); + var PipelineRequest = class extends Readable { + constructor() { + super({ autoDestroy: true }); + this[kResume] = null; + } + _read() { + const { [kResume]: resume } = this; + if (resume) { + this[kResume] = null; + resume(); + } + } + _destroy(err, callback) { + this._read(); + callback(err); + } + }; + __name(PipelineRequest, "PipelineRequest"); + var PipelineResponse = class extends Readable { + constructor(resume) { + super({ autoDestroy: true }); + this[kResume] = resume; + } + _read() { + this[kResume](); + } + _destroy(err, callback) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError(); + } + callback(err); + } + }; + __name(PipelineResponse, "PipelineResponse"); + var PipelineHandler = class extends AsyncResource2 { + constructor(opts, handler) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof handler !== "function") { + throw new InvalidArgumentError("invalid handler"); + } + const { signal, method, opaque, onInfo, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + if (method === "CONNECT") { + throw new InvalidArgumentError("invalid method"); + } + if (onInfo && typeof onInfo !== "function") { + throw new InvalidArgumentError("invalid onInfo callback"); + } + super("UNDICI_PIPELINE"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.handler = handler; + this.abort = null; + this.context = null; + this.onInfo = onInfo || null; + this.req = new PipelineRequest().on("error", util2.nop); + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body } = this; + if (body && body.resume) { + body.resume(); + } + }, + write: (chunk, encoding, callback) => { + const { req } = this; + if (req.push(chunk, encoding) || req._readableState.destroyed) { + callback(); + } else { + req[kResume] = callback; + } + }, + destroy: (err, callback) => { + const { body, req, res, ret, abort } = this; + if (!err && !ret._readableState.endEmitted) { + err = new RequestAbortedError(); + } + if (abort && err) { + abort(); + } + util2.destroy(body, err); + util2.destroy(req, err); + util2.destroy(res, err); + removeSignal(this); + callback(err); + } + }).on("prefinish", () => { + const { req } = this; + req.push(null); + }); + this.res = null; + addSignal(this, signal); + } + onConnect(abort, context3) { + const { ret, res } = this; + assert(!res, "pipeline cannot be retried"); + if (ret.destroyed) { + throw new RequestAbortedError(); + } + this.abort = abort; + this.context = context3; + } + onHeaders(statusCode, rawHeaders, resume) { + const { opaque, handler, context: context3 } = this; + if (statusCode < 200) { + if (this.onInfo) { + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + this.onInfo({ statusCode, headers }); + } + return; + } + this.res = new PipelineResponse(resume); + let body; + try { + this.handler = null; + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + body = this.runInAsyncScope(handler, null, { + statusCode, + headers, + opaque, + body: this.res, + context: context3 + }); + } catch (err) { + this.res.on("error", util2.nop); + throw err; + } + if (!body || typeof body.on !== "function") { + throw new InvalidReturnValueError("expected Readable"); + } + body.on("data", (chunk) => { + const { ret, body: body2 } = this; + if (!ret.push(chunk) && body2.pause) { + body2.pause(); + } + }).on("error", (err) => { + const { ret } = this; + util2.destroy(ret, err); + }).on("end", () => { + const { ret } = this; + ret.push(null); + }).on("close", () => { + const { ret } = this; + if (!ret._readableState.ended) { + util2.destroy(ret, new RequestAbortedError()); + } + }); + this.body = body; + } + onData(chunk) { + const { res } = this; + return res.push(chunk); + } + onComplete(trailers) { + const { res } = this; + res.push(null); + } + onError(err) { + const { ret } = this; + this.handler = null; + util2.destroy(ret, err); + } + }; + __name(PipelineHandler, "PipelineHandler"); + function pipeline(opts, handler) { + try { + const pipelineHandler = new PipelineHandler(opts, handler); + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); + return pipelineHandler.ret; + } catch (err) { + return new PassThrough().destroy(err); + } + } + __name(pipeline, "pipeline"); + module2.exports = pipeline; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-upgrade.js +var require_api_upgrade = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-upgrade.js"(exports, module2) { + "use strict"; + var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); + var { AsyncResource: AsyncResource2 } = require("async_hooks"); + var util2 = require_util2(); + var { addSignal, removeSignal } = require_abort_signal(); + var assert = require("assert"); + var UpgradeHandler = class extends AsyncResource2 { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + super("UNDICI_UPGRADE"); + this.responseHeaders = responseHeaders || null; + this.opaque = opaque || null; + this.callback = callback; + this.abort = null; + this.context = null; + addSignal(this, signal); + } + onConnect(abort, context3) { + if (!this.callback) { + throw new RequestAbortedError(); + } + this.abort = abort; + this.context = null; + } + onHeaders() { + throw new SocketError("bad upgrade", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + const { callback, opaque, context: context3 } = this; + assert.strictEqual(statusCode, 101); + removeSignal(this); + this.callback = null; + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + this.runInAsyncScope(callback, null, null, { + headers, + socket, + opaque, + context: context3 + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + } + }; + __name(UpgradeHandler, "UpgradeHandler"); + function upgrade(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + upgrade.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + const upgradeHandler = new UpgradeHandler(opts, callback); + this.dispatch({ + ...opts, + method: opts.method || "GET", + upgrade: opts.protocol || "Websocket" + }, upgradeHandler); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + __name(upgrade, "upgrade"); + module2.exports = upgrade; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-connect.js +var require_api_connect = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/api-connect.js"(exports, module2) { + "use strict"; + var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); + var { AsyncResource: AsyncResource2 } = require("async_hooks"); + var util2 = require_util2(); + var { addSignal, removeSignal } = require_abort_signal(); + var ConnectHandler = class extends AsyncResource2 { + constructor(opts, callback) { + if (!opts || typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (typeof callback !== "function") { + throw new InvalidArgumentError("invalid callback"); + } + const { signal, opaque, responseHeaders } = opts; + if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { + throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); + } + super("UNDICI_CONNECT"); + this.opaque = opaque || null; + this.responseHeaders = responseHeaders || null; + this.callback = callback; + this.abort = null; + addSignal(this, signal); + } + onConnect(abort, context3) { + if (!this.callback) { + throw new RequestAbortedError(); + } + this.abort = abort; + this.context = context3; + } + onHeaders() { + throw new SocketError("bad connect", null); + } + onUpgrade(statusCode, rawHeaders, socket) { + const { callback, opaque, context: context3 } = this; + removeSignal(this); + this.callback = null; + const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context: context3 + }); + } + onError(err) { + const { callback, opaque } = this; + removeSignal(this); + if (callback) { + this.callback = null; + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }); + }); + } + } + }; + __name(ConnectHandler, "ConnectHandler"); + function connect(opts, callback) { + if (callback === void 0) { + return new Promise((resolve, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data); + }); + }); + } + try { + const connectHandler = new ConnectHandler(opts, callback); + this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); + } catch (err) { + if (typeof callback !== "function") { + throw err; + } + const opaque = opts && opts.opaque; + queueMicrotask(() => callback(err, { opaque })); + } + } + __name(connect, "connect"); + module2.exports = connect; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/index.js +var require_api = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/api/index.js"(exports, module2) { + "use strict"; + module2.exports.request = require_api_request(); + module2.exports.stream = require_api_stream(); + module2.exports.pipeline = require_api_pipeline(); + module2.exports.upgrade = require_api_upgrade(); + module2.exports.connect = require_api_connect(); + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-errors.js +var require_mock_errors = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-errors.js"(exports, module2) { + "use strict"; + var { UndiciError } = require_errors(); + var MockNotMatchedError = class extends UndiciError { + constructor(message) { + super(message); + Error.captureStackTrace(this, MockNotMatchedError); + this.name = "MockNotMatchedError"; + this.message = message || "The request does not match any registered mock dispatches"; + this.code = "UND_MOCK_ERR_MOCK_NOT_MATCHED"; + } + }; + __name(MockNotMatchedError, "MockNotMatchedError"); + module2.exports = { + MockNotMatchedError + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-symbols.js +var require_mock_symbols = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-symbols.js"(exports, module2) { + "use strict"; + module2.exports = { + kAgent: Symbol("agent"), + kOptions: Symbol("options"), + kFactory: Symbol("factory"), + kDispatches: Symbol("dispatches"), + kDispatchKey: Symbol("dispatch key"), + kDefaultHeaders: Symbol("default headers"), + kDefaultTrailers: Symbol("default trailers"), + kContentLength: Symbol("content length"), + kMockAgent: Symbol("mock agent"), + kMockAgentSet: Symbol("mock agent set"), + kMockAgentGet: Symbol("mock agent get"), + kMockDispatch: Symbol("mock dispatch"), + kClose: Symbol("close"), + kOriginalClose: Symbol("original agent close"), + kOrigin: Symbol("origin"), + kIsMockActive: Symbol("is mock active"), + kNetConnect: Symbol("net connect"), + kGetNetConnect: Symbol("get net connect"), + kConnected: Symbol("connected") + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-utils.js +var require_mock_utils = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-utils.js"(exports, module2) { + "use strict"; + var { MockNotMatchedError } = require_mock_errors(); + var { + kDispatches, + kMockAgent, + kOriginalDispatch, + kOrigin, + kGetNetConnect + } = require_mock_symbols(); + var { buildURL, nop } = require_util2(); + function matchValue(match, value) { + if (typeof match === "string") { + return match === value; + } + if (match instanceof RegExp) { + return match.test(value); + } + if (typeof match === "function") { + return match(value) === true; + } + return false; + } + __name(matchValue, "matchValue"); + function lowerCaseEntries(headers) { + return Object.fromEntries( + Object.entries(headers).map(([headerName, headerValue]) => { + return [headerName.toLocaleLowerCase(), headerValue]; + }) + ); + } + __name(lowerCaseEntries, "lowerCaseEntries"); + function getHeaderByName(headers, key) { + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { + return headers[i + 1]; + } + } + return void 0; + } else if (typeof headers.get === "function") { + return headers.get(key); + } else { + return lowerCaseEntries(headers)[key.toLocaleLowerCase()]; + } + } + __name(getHeaderByName, "getHeaderByName"); + function buildHeadersFromArray(headers) { + const clone2 = headers.slice(); + const entries = []; + for (let index = 0; index < clone2.length; index += 2) { + entries.push([clone2[index], clone2[index + 1]]); + } + return Object.fromEntries(entries); + } + __name(buildHeadersFromArray, "buildHeadersFromArray"); + function matchHeaders(mockDispatch2, headers) { + if (typeof mockDispatch2.headers === "function") { + if (Array.isArray(headers)) { + headers = buildHeadersFromArray(headers); + } + return mockDispatch2.headers(headers ? lowerCaseEntries(headers) : {}); + } + if (typeof mockDispatch2.headers === "undefined") { + return true; + } + if (typeof headers !== "object" || typeof mockDispatch2.headers !== "object") { + return false; + } + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch2.headers)) { + const headerValue = getHeaderByName(headers, matchHeaderName); + if (!matchValue(matchHeaderValue, headerValue)) { + return false; + } + } + return true; + } + __name(matchHeaders, "matchHeaders"); + function safeUrl(path7) { + if (typeof path7 !== "string") { + return path7; + } + const pathSegments = path7.split("?"); + if (pathSegments.length !== 2) { + return path7; + } + const qp = new URLSearchParams(pathSegments.pop()); + qp.sort(); + return [...pathSegments, qp.toString()].join("?"); + } + __name(safeUrl, "safeUrl"); + function matchKey(mockDispatch2, { path: path7, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path7); + const methodMatch = matchValue(mockDispatch2.method, method); + const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; + const headersMatch = matchHeaders(mockDispatch2, headers); + return pathMatch && methodMatch && bodyMatch && headersMatch; + } + __name(matchKey, "matchKey"); + function getResponseData(data) { + if (Buffer.isBuffer(data)) { + return data; + } else if (typeof data === "object") { + return JSON.stringify(data); + } else { + return data.toString(); + } + } + __name(getResponseData, "getResponseData"); + function getMockDispatch(mockDispatches, key) { + const basePath = key.query ? buildURL(key.path, key.query) : key.path; + const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path7 }) => matchValue(safeUrl(path7), resolvedPath)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); + } + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`); + } + matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== "undefined" ? matchValue(body, key.body) : true); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`); + } + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2, key.headers)); + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers}'`); + } + return matchedMockDispatches[0]; + } + __name(getMockDispatch, "getMockDispatch"); + function addMockDispatch(mockDispatches, key, data) { + const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }; + const replyData = typeof data === "function" ? { callback: data } : { ...data }; + const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }; + mockDispatches.push(newMockDispatch); + return newMockDispatch; + } + __name(addMockDispatch, "addMockDispatch"); + function deleteMockDispatch(mockDispatches, key) { + const index = mockDispatches.findIndex((dispatch) => { + if (!dispatch.consumed) { + return false; + } + return matchKey(dispatch, key); + }); + if (index !== -1) { + mockDispatches.splice(index, 1); + } + } + __name(deleteMockDispatch, "deleteMockDispatch"); + function buildKey(opts) { + const { path: path7, method, body, headers, query: query2 } = opts; + return { + path: path7, + method, + body, + headers, + query: query2 + }; + } + __name(buildKey, "buildKey"); + function generateKeyValues(data) { + return Object.entries(data).reduce((keyValuePairs, [key, value]) => [...keyValuePairs, key, value], []); + } + __name(generateKeyValues, "generateKeyValues"); + function getStatusText(statusCode) { + switch (statusCode) { + case 100: + return "Continue"; + case 101: + return "Switching Protocols"; + case 102: + return "Processing"; + case 103: + return "Early Hints"; + case 200: + return "OK"; + case 201: + return "Created"; + case 202: + return "Accepted"; + case 203: + return "Non-Authoritative Information"; + case 204: + return "No Content"; + case 205: + return "Reset Content"; + case 206: + return "Partial Content"; + case 207: + return "Multi-Status"; + case 208: + return "Already Reported"; + case 226: + return "IM Used"; + case 300: + return "Multiple Choice"; + case 301: + return "Moved Permanently"; + case 302: + return "Found"; + case 303: + return "See Other"; + case 304: + return "Not Modified"; + case 305: + return "Use Proxy"; + case 306: + return "unused"; + case 307: + return "Temporary Redirect"; + case 308: + return "Permanent Redirect"; + case 400: + return "Bad Request"; + case 401: + return "Unauthorized"; + case 402: + return "Payment Required"; + case 403: + return "Forbidden"; + case 404: + return "Not Found"; + case 405: + return "Method Not Allowed"; + case 406: + return "Not Acceptable"; + case 407: + return "Proxy Authentication Required"; + case 408: + return "Request Timeout"; + case 409: + return "Conflict"; + case 410: + return "Gone"; + case 411: + return "Length Required"; + case 412: + return "Precondition Failed"; + case 413: + return "Payload Too Large"; + case 414: + return "URI Too Large"; + case 415: + return "Unsupported Media Type"; + case 416: + return "Range Not Satisfiable"; + case 417: + return "Expectation Failed"; + case 418: + return "I'm a teapot"; + case 421: + return "Misdirected Request"; + case 422: + return "Unprocessable Entity"; + case 423: + return "Locked"; + case 424: + return "Failed Dependency"; + case 425: + return "Too Early"; + case 426: + return "Upgrade Required"; + case 428: + return "Precondition Required"; + case 429: + return "Too Many Requests"; + case 431: + return "Request Header Fields Too Large"; + case 451: + return "Unavailable For Legal Reasons"; + case 500: + return "Internal Server Error"; + case 501: + return "Not Implemented"; + case 502: + return "Bad Gateway"; + case 503: + return "Service Unavailable"; + case 504: + return "Gateway Timeout"; + case 505: + return "HTTP Version Not Supported"; + case 506: + return "Variant Also Negotiates"; + case 507: + return "Insufficient Storage"; + case 508: + return "Loop Detected"; + case 510: + return "Not Extended"; + case 511: + return "Network Authentication Required"; + default: + return "unknown"; + } + } + __name(getStatusText, "getStatusText"); + async function getResponse(body) { + const buffers = []; + for await (const data of body) { + buffers.push(data); + } + return Buffer.concat(buffers).toString("utf8"); + } + __name(getResponse, "getResponse"); + function mockDispatch(opts, handler) { + const key = buildKey(opts); + const mockDispatch2 = getMockDispatch(this[kDispatches], key); + mockDispatch2.timesInvoked++; + if (mockDispatch2.data.callback) { + mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; + } + const { data: { statusCode, data, headers, trailers, error: error2 }, delay, persist } = mockDispatch2; + const { timesInvoked, times } = mockDispatch2; + mockDispatch2.consumed = !persist && timesInvoked >= times; + mockDispatch2.pending = timesInvoked < times; + if (error2 !== null) { + deleteMockDispatch(this[kDispatches], key); + handler.onError(error2); + return true; + } + if (typeof delay === "number" && delay > 0) { + setTimeout(() => { + handleReply(this[kDispatches]); + }, delay); + } else { + handleReply(this[kDispatches]); + } + function handleReply(mockDispatches) { + const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers; + const responseData = getResponseData( + typeof data === "function" ? data({ ...opts, headers: optsHeaders }) : data + ); + const responseHeaders = generateKeyValues(headers); + const responseTrailers = generateKeyValues(trailers); + handler.abort = nop; + handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)); + handler.onData(Buffer.from(responseData)); + handler.onComplete(responseTrailers); + deleteMockDispatch(mockDispatches, key); + } + __name(handleReply, "handleReply"); + function resume() { + } + __name(resume, "resume"); + return true; + } + __name(mockDispatch, "mockDispatch"); + function buildMockDispatch() { + const agent = this[kMockAgent]; + const origin = this[kOrigin]; + const originalDispatch = this[kOriginalDispatch]; + return /* @__PURE__ */ __name(function dispatch(opts, handler) { + if (agent.isMockActive) { + try { + mockDispatch.call(this, opts, handler); + } catch (error2) { + if (error2 instanceof MockNotMatchedError) { + const netConnect = agent[kGetNetConnect](); + if (netConnect === false) { + throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + } + if (checkNetConnect(netConnect, origin)) { + originalDispatch.call(this, opts, handler); + } else { + throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + } + } else { + throw error2; + } + } + } else { + originalDispatch.call(this, opts, handler); + } + }, "dispatch"); + } + __name(buildMockDispatch, "buildMockDispatch"); + function checkNetConnect(netConnect, origin) { + const url = new URL(origin); + if (netConnect === true) { + return true; + } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { + return true; + } + return false; + } + __name(checkNetConnect, "checkNetConnect"); + function buildMockOptions(opts) { + if (opts) { + const { agent, ...mockOptions } = opts; + return mockOptions; + } + } + __name(buildMockOptions, "buildMockOptions"); + module2.exports = { + getResponseData, + getMockDispatch, + addMockDispatch, + deleteMockDispatch, + buildKey, + generateKeyValues, + matchValue, + getResponse, + getStatusText, + mockDispatch, + buildMockDispatch, + checkNetConnect, + buildMockOptions, + getHeaderByName + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-interceptor.js +var require_mock_interceptor = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-interceptor.js"(exports, module2) { + "use strict"; + var { getResponseData, buildKey, addMockDispatch } = require_mock_utils(); + var { + kDispatches, + kDispatchKey, + kDefaultHeaders, + kDefaultTrailers, + kContentLength, + kMockDispatch + } = require_mock_symbols(); + var { InvalidArgumentError } = require_errors(); + var { buildURL } = require_util2(); + var MockScope = class { + constructor(mockDispatch) { + this[kMockDispatch] = mockDispatch; + } + delay(waitInMs) { + if (typeof waitInMs !== "number" || !Number.isInteger(waitInMs) || waitInMs <= 0) { + throw new InvalidArgumentError("waitInMs must be a valid integer > 0"); + } + this[kMockDispatch].delay = waitInMs; + return this; + } + persist() { + this[kMockDispatch].persist = true; + return this; + } + times(repeatTimes) { + if (typeof repeatTimes !== "number" || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { + throw new InvalidArgumentError("repeatTimes must be a valid integer > 0"); + } + this[kMockDispatch].times = repeatTimes; + return this; + } + }; + __name(MockScope, "MockScope"); + var MockInterceptor = class { + constructor(opts, mockDispatches) { + if (typeof opts !== "object") { + throw new InvalidArgumentError("opts must be an object"); + } + if (typeof opts.path === "undefined") { + throw new InvalidArgumentError("opts.path must be defined"); + } + if (typeof opts.method === "undefined") { + opts.method = "GET"; + } + if (typeof opts.path === "string") { + if (opts.query) { + opts.path = buildURL(opts.path, opts.query); + } else { + const parsedURL = new URL(opts.path, "data://"); + opts.path = parsedURL.pathname + parsedURL.search; + } + } + if (typeof opts.method === "string") { + opts.method = opts.method.toUpperCase(); + } + this[kDispatchKey] = buildKey(opts); + this[kDispatches] = mockDispatches; + this[kDefaultHeaders] = {}; + this[kDefaultTrailers] = {}; + this[kContentLength] = false; + } + createMockScopeDispatchData(statusCode, data, responseOptions = {}) { + const responseData = getResponseData(data); + const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {}; + const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }; + const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }; + return { statusCode, data, headers, trailers }; + } + validateReplyParameters(statusCode, data, responseOptions) { + if (typeof statusCode === "undefined") { + throw new InvalidArgumentError("statusCode must be defined"); + } + if (typeof data === "undefined") { + throw new InvalidArgumentError("data must be defined"); + } + if (typeof responseOptions !== "object") { + throw new InvalidArgumentError("responseOptions must be an object"); + } + } + reply(replyData) { + if (typeof replyData === "function") { + const wrappedDefaultsCallback = /* @__PURE__ */ __name((opts) => { + const resolvedData = replyData(opts); + if (typeof resolvedData !== "object") { + throw new InvalidArgumentError("reply options callback must return an object"); + } + const { statusCode: statusCode2, data: data2 = "", responseOptions: responseOptions2 = {} } = resolvedData; + this.validateReplyParameters(statusCode2, data2, responseOptions2); + return { + ...this.createMockScopeDispatchData(statusCode2, data2, responseOptions2) + }; + }, "wrappedDefaultsCallback"); + const newMockDispatch2 = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback); + return new MockScope(newMockDispatch2); + } + const [statusCode, data = "", responseOptions = {}] = [...arguments]; + this.validateReplyParameters(statusCode, data, responseOptions); + const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData); + return new MockScope(newMockDispatch); + } + replyWithError(error2) { + if (typeof error2 === "undefined") { + throw new InvalidArgumentError("error must be defined"); + } + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error2 }); + return new MockScope(newMockDispatch); + } + defaultReplyHeaders(headers) { + if (typeof headers === "undefined") { + throw new InvalidArgumentError("headers must be defined"); + } + this[kDefaultHeaders] = headers; + return this; + } + defaultReplyTrailers(trailers) { + if (typeof trailers === "undefined") { + throw new InvalidArgumentError("trailers must be defined"); + } + this[kDefaultTrailers] = trailers; + return this; + } + replyContentLength() { + this[kContentLength] = true; + return this; + } + }; + __name(MockInterceptor, "MockInterceptor"); + module2.exports.MockInterceptor = MockInterceptor; + module2.exports.MockScope = MockScope; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-client.js +var require_mock_client = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-client.js"(exports, module2) { + "use strict"; + var { promisify: promisify4 } = require("util"); + var Client = require_client(); + var { buildMockDispatch } = require_mock_utils(); + var { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected + } = require_mock_symbols(); + var { MockInterceptor } = require_mock_interceptor(); + var Symbols = require_symbols(); + var { InvalidArgumentError } = require_errors(); + var MockClient = class extends Client { + constructor(origin, opts) { + super(origin, opts); + if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + } + this[kMockAgent] = opts.agent; + this[kOrigin] = origin; + this[kDispatches] = []; + this[kConnected] = 1; + this[kOriginalDispatch] = this.dispatch; + this[kOriginalClose] = this.close.bind(this); + this.dispatch = buildMockDispatch.call(this); + this.close = this[kClose]; + } + get [Symbols.kConnected]() { + return this[kConnected]; + } + intercept(opts) { + return new MockInterceptor(opts, this[kDispatches]); + } + async [kClose]() { + await promisify4(this[kOriginalClose])(); + this[kConnected] = 0; + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); + } + }; + __name(MockClient, "MockClient"); + module2.exports = MockClient; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-pool.js +var require_mock_pool = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-pool.js"(exports, module2) { + "use strict"; + var { promisify: promisify4 } = require("util"); + var Pool = require_pool(); + var { buildMockDispatch } = require_mock_utils(); + var { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected + } = require_mock_symbols(); + var { MockInterceptor } = require_mock_interceptor(); + var Symbols = require_symbols(); + var { InvalidArgumentError } = require_errors(); + var MockPool = class extends Pool { + constructor(origin, opts) { + super(origin, opts); + if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + } + this[kMockAgent] = opts.agent; + this[kOrigin] = origin; + this[kDispatches] = []; + this[kConnected] = 1; + this[kOriginalDispatch] = this.dispatch; + this[kOriginalClose] = this.close.bind(this); + this.dispatch = buildMockDispatch.call(this); + this.close = this[kClose]; + } + get [Symbols.kConnected]() { + return this[kConnected]; + } + intercept(opts) { + return new MockInterceptor(opts, this[kDispatches]); + } + async [kClose]() { + await promisify4(this[kOriginalClose])(); + this[kConnected] = 0; + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); + } + }; + __name(MockPool, "MockPool"); + module2.exports = MockPool; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/pluralizer.js +var require_pluralizer = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/pluralizer.js"(exports, module2) { + "use strict"; + var singulars = { + pronoun: "it", + is: "is", + was: "was", + this: "this" + }; + var plurals = { + pronoun: "they", + is: "are", + was: "were", + this: "these" + }; + module2.exports = /* @__PURE__ */ __name(class Pluralizer { + constructor(singular, plural) { + this.singular = singular; + this.plural = plural; + } + pluralize(count2) { + const one = count2 === 1; + const keys2 = one ? singulars : plurals; + const noun = one ? this.singular : this.plural; + return { ...keys2, count: count2, noun }; + } + }, "Pluralizer"); + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js +var require_pending_interceptors_formatter = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js"(exports, module2) { + "use strict"; + var { Transform } = require("stream"); + var { Console } = require("console"); + module2.exports = /* @__PURE__ */ __name(class PendingInterceptorsFormatter { + constructor({ disableColors } = {}) { + this.transform = new Transform({ + transform(chunk, _enc, cb) { + cb(null, chunk); + } + }); + this.logger = new Console({ + stdout: this.transform, + inspectOptions: { + colors: !disableColors && !process.env.CI + } + }); + } + format(pendingInterceptors) { + const withPrettyHeaders = pendingInterceptors.map( + ({ method, path: path7, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + Method: method, + Origin: origin, + Path: path7, + "Status code": statusCode, + Persistent: persist ? "\u2705" : "\u274C", + Invocations: timesInvoked, + Remaining: persist ? Infinity : times - timesInvoked + }) + ); + this.logger.table(withPrettyHeaders); + return this.transform.read().toString(); + } + }, "PendingInterceptorsFormatter"); + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-agent.js +var require_mock_agent = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/mock/mock-agent.js"(exports, module2) { + "use strict"; + var { kClients } = require_symbols(); + var Agent = require_agent(); + var { + kAgent, + kMockAgentSet, + kMockAgentGet, + kDispatches, + kIsMockActive, + kNetConnect, + kGetNetConnect, + kOptions, + kFactory + } = require_mock_symbols(); + var MockClient = require_mock_client(); + var MockPool = require_mock_pool(); + var { matchValue, buildMockOptions } = require_mock_utils(); + var { InvalidArgumentError, UndiciError } = require_errors(); + var Dispatcher = require_dispatcher(); + var Pluralizer = require_pluralizer(); + var PendingInterceptorsFormatter = require_pending_interceptors_formatter(); + var FakeWeakRef = class { + constructor(value) { + this.value = value; + } + deref() { + return this.value; + } + }; + __name(FakeWeakRef, "FakeWeakRef"); + var MockAgent = class extends Dispatcher { + constructor(opts) { + super(opts); + this[kNetConnect] = true; + this[kIsMockActive] = true; + if (opts && opts.agent && typeof opts.agent.dispatch !== "function") { + throw new InvalidArgumentError("Argument opts.agent must implement Agent"); + } + const agent = opts && opts.agent ? opts.agent : new Agent(opts); + this[kAgent] = agent; + this[kClients] = agent[kClients]; + this[kOptions] = buildMockOptions(opts); + } + get(origin) { + let dispatcher = this[kMockAgentGet](origin); + if (!dispatcher) { + dispatcher = this[kFactory](origin); + this[kMockAgentSet](origin, dispatcher); + } + return dispatcher; + } + dispatch(opts, handler) { + this.get(opts.origin); + return this[kAgent].dispatch(opts, handler); + } + async close() { + await this[kAgent].close(); + this[kClients].clear(); + } + deactivate() { + this[kIsMockActive] = false; + } + activate() { + this[kIsMockActive] = true; + } + enableNetConnect(matcher) { + if (typeof matcher === "string" || typeof matcher === "function" || matcher instanceof RegExp) { + if (Array.isArray(this[kNetConnect])) { + this[kNetConnect].push(matcher); + } else { + this[kNetConnect] = [matcher]; + } + } else if (typeof matcher === "undefined") { + this[kNetConnect] = true; + } else { + throw new InvalidArgumentError("Unsupported matcher. Must be one of String|Function|RegExp."); + } + } + disableNetConnect() { + this[kNetConnect] = false; + } + get isMockActive() { + return this[kIsMockActive]; + } + [kMockAgentSet](origin, dispatcher) { + this[kClients].set(origin, new FakeWeakRef(dispatcher)); + } + [kFactory](origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]); + return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions); + } + [kMockAgentGet](origin) { + const ref = this[kClients].get(origin); + if (ref) { + return ref.deref(); + } + if (typeof origin !== "string") { + const dispatcher = this[kFactory]("http://localhost:9999"); + this[kMockAgentSet](origin, dispatcher); + return dispatcher; + } + for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { + const nonExplicitDispatcher = nonExplicitRef.deref(); + if (nonExplicitDispatcher && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) { + const dispatcher = this[kFactory](origin); + this[kMockAgentSet](origin, dispatcher); + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]; + return dispatcher; + } + } + } + [kGetNetConnect]() { + return this[kNetConnect]; + } + pendingInterceptors() { + const mockAgentClients = this[kClients]; + return Array.from(mockAgentClients.entries()).flatMap(([origin, scope]) => scope.deref()[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending }) => pending); + } + assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { + const pending = this.pendingInterceptors(); + if (pending.length === 0) { + return; + } + const pluralizer = new Pluralizer("interceptor", "interceptors").pluralize(pending.length); + throw new UndiciError(` +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + +${pendingInterceptorsFormatter.format(pending)} +`.trim()); + } + }; + __name(MockAgent, "MockAgent"); + module2.exports = MockAgent; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/proxy-agent.js +var require_proxy_agent = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/proxy-agent.js"(exports, module2) { + "use strict"; + var { kClose, kDestroy } = require_symbols(); + var Client = require_agent(); + var Agent = require_agent(); + var DispatcherBase = require_dispatcher_base(); + var { InvalidArgumentError, RequestAbortedError } = require_errors(); + var buildConnector = require_connect(); + var kAgent = Symbol("proxy agent"); + var kClient = Symbol("proxy client"); + var kProxyHeaders = Symbol("proxy headers"); + var kRequestTls = Symbol("request tls settings"); + var kProxyTls = Symbol("proxy tls settings"); + var kConnectEndpoint = Symbol("connect endpoint function"); + function defaultProtocolPort(protocol) { + return protocol === "https:" ? 443 : 80; + } + __name(defaultProtocolPort, "defaultProtocolPort"); + var ProxyAgent = class extends DispatcherBase { + constructor(opts) { + super(opts); + if (typeof opts === "string") { + opts = { uri: opts }; + } + if (!opts || !opts.uri) { + throw new InvalidArgumentError("Proxy opts.uri is mandatory"); + } + this[kRequestTls] = opts.requestTls; + this[kProxyTls] = opts.proxyTls; + this[kProxyHeaders] = {}; + if (opts.auth) { + this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`; + } + const { origin, port } = new URL(opts.uri); + const connect = buildConnector({ ...opts.proxyTls }); + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }); + this[kClient] = new Client({ origin: opts.origin, connect }); + this[kAgent] = new Agent({ + ...opts, + connect: async (opts2, callback) => { + let requestedHost = opts2.host; + if (!opts2.port) { + requestedHost += `:${defaultProtocolPort(opts2.protocol)}`; + } + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedHost, + signal: opts2.signal, + headers: { + ...this[kProxyHeaders], + host: opts2.host + } + }); + if (statusCode !== 200) { + socket.on("error", () => { + }).destroy(); + callback(new RequestAbortedError("Proxy response !== 200 when HTTP Tunneling")); + } + if (opts2.protocol !== "https:") { + callback(null, socket); + return; + } + let servername; + if (this[kRequestTls]) { + servername = this[kRequestTls].servername; + } else { + servername = opts2.servername; + } + this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); + } catch (err) { + callback(err); + } + } + }); + } + dispatch(opts, handler) { + const { host } = new URL(opts.origin); + const headers = buildHeaders2(opts.headers); + throwIfProxyAuthIsSent(headers); + return this[kAgent].dispatch( + { + ...opts, + headers: { + ...headers, + host + } + }, + handler + ); + } + async [kClose]() { + await this[kAgent].close(); + await this[kClient].close(); + } + async [kDestroy]() { + await this[kAgent].destroy(); + await this[kClient].destroy(); + } + }; + __name(ProxyAgent, "ProxyAgent"); + function buildHeaders2(headers) { + if (Array.isArray(headers)) { + const headersPair = {}; + for (let i = 0; i < headers.length; i += 2) { + headersPair[headers[i]] = headers[i + 1]; + } + return headersPair; + } + return headers; + } + __name(buildHeaders2, "buildHeaders"); + function throwIfProxyAuthIsSent(headers) { + const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization"); + if (existProxyAuth) { + throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); + } + } + __name(throwIfProxyAuthIsSent, "throwIfProxyAuthIsSent"); + module2.exports = ProxyAgent; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/global.js +var require_global = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/global.js"(exports, module2) { + "use strict"; + var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var { InvalidArgumentError } = require_errors(); + var Agent = require_agent(); + if (getGlobalDispatcher() === void 0) { + setGlobalDispatcher(new Agent()); + } + function setGlobalDispatcher(agent) { + if (!agent || typeof agent.dispatch !== "function") { + throw new InvalidArgumentError("Argument agent must implement Agent"); + } + Object.defineProperty(globalThis, globalDispatcher, { + value: agent, + writable: true, + enumerable: false, + configurable: false + }); + } + __name(setGlobalDispatcher, "setGlobalDispatcher"); + function getGlobalDispatcher() { + return globalThis[globalDispatcher]; + } + __name(getGlobalDispatcher, "getGlobalDispatcher"); + module2.exports = { + setGlobalDispatcher, + getGlobalDispatcher + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/headers.js +var require_headers = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/headers.js"(exports, module2) { + "use strict"; + var { kHeadersList } = require_symbols(); + var { kGuard } = require_symbols2(); + var { kEnumerableProperty } = require_util2(); + var { + makeIterator, + isValidHeaderName, + isValidHeaderValue + } = require_util3(); + var { webidl } = require_webidl(); + var kHeadersMap = Symbol("headers map"); + var kHeadersSortedMap = Symbol("headers map sorted"); + function headerValueNormalize(potentialValue) { + return potentialValue.replace( + /^[\r\n\t ]+|[\r\n\t ]+$/g, + "" + ); + } + __name(headerValueNormalize, "headerValueNormalize"); + function fill(headers, object) { + if (Array.isArray(object)) { + for (const header of object) { + if (header.length !== 2) { + webidl.errors.exception({ + header: "Headers constructor", + message: `expected name/value pair to be length 2, found ${header.length}.` + }); + } + headers.append(header[0], header[1]); + } + } else if (typeof object === "object" && object !== null) { + for (const [key, value] of Object.entries(object)) { + headers.append(key, value); + } + } else { + webidl.errors.conversionFailed({ + prefix: "Headers constructor", + argument: "Argument 1", + types: ["sequence>", "record"] + }); + } + } + __name(fill, "fill"); + var HeadersList = class { + constructor(init) { + if (init instanceof HeadersList) { + this[kHeadersMap] = new Map(init[kHeadersMap]); + this[kHeadersSortedMap] = init[kHeadersSortedMap]; + } else { + this[kHeadersMap] = new Map(init); + this[kHeadersSortedMap] = null; + } + } + contains(name) { + name = name.toLowerCase(); + return this[kHeadersMap].has(name); + } + clear() { + this[kHeadersMap].clear(); + this[kHeadersSortedMap] = null; + } + append(name, value) { + this[kHeadersSortedMap] = null; + name = name.toLowerCase(); + const exists4 = this[kHeadersMap].get(name); + if (exists4) { + this[kHeadersMap].set(name, `${exists4}, ${value}`); + } else { + this[kHeadersMap].set(name, `${value}`); + } + } + set(name, value) { + this[kHeadersSortedMap] = null; + name = name.toLowerCase(); + return this[kHeadersMap].set(name, value); + } + delete(name) { + this[kHeadersSortedMap] = null; + name = name.toLowerCase(); + return this[kHeadersMap].delete(name); + } + get(name) { + var _a3; + name = name.toLowerCase(); + if (!this.contains(name)) { + return null; + } + return (_a3 = this[kHeadersMap].get(name)) != null ? _a3 : null; + } + has(name) { + name = name.toLowerCase(); + return this[kHeadersMap].has(name); + } + keys() { + return this[kHeadersMap].keys(); + } + values() { + return this[kHeadersMap].values(); + } + entries() { + return this[kHeadersMap].entries(); + } + [Symbol.iterator]() { + return this[kHeadersMap][Symbol.iterator](); + } + }; + __name(HeadersList, "HeadersList"); + var Headers = class { + constructor(init = void 0) { + this[kHeadersList] = new HeadersList(); + this[kGuard] = "none"; + if (init !== void 0) { + init = webidl.converters.HeadersInit(init); + fill(this, init); + } + } + get [Symbol.toStringTag]() { + return this.constructor.name; + } + append(name, value) { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 2) { + throw new TypeError( + `Failed to execute 'append' on 'Headers': 2 arguments required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.ByteString(name); + value = webidl.converters.ByteString(value); + value = headerValueNormalize(value); + if (!isValidHeaderName(name)) { + webidl.errors.invalidArgument({ + prefix: "Headers.append", + value: name, + type: "header name" + }); + } else if (!isValidHeaderValue(value)) { + webidl.errors.invalidArgument({ + prefix: "Headers.append", + value, + type: "header value" + }); + } + if (this[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (this[kGuard] === "request-no-cors") { + } + return this[kHeadersList].append(name, value); + } + delete(name) { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'delete' on 'Headers': 1 argument required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.ByteString(name); + if (!isValidHeaderName(name)) { + webidl.errors.invalidArgument({ + prefix: "Headers.delete", + value: name, + type: "header name" + }); + } + if (this[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (this[kGuard] === "request-no-cors") { + } + if (!this[kHeadersList].contains(name)) { + return; + } + return this[kHeadersList].delete(name); + } + get(name) { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'get' on 'Headers': 1 argument required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.ByteString(name); + if (!isValidHeaderName(name)) { + webidl.errors.invalidArgument({ + prefix: "Headers.get", + value: name, + type: "header name" + }); + } + return this[kHeadersList].get(name); + } + has(name) { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'has' on 'Headers': 1 argument required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.ByteString(name); + if (!isValidHeaderName(name)) { + webidl.errors.invalidArgument({ + prefix: "Headers.has", + value: name, + type: "header name" + }); + } + return this[kHeadersList].contains(name); + } + set(name, value) { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 2) { + throw new TypeError( + `Failed to execute 'set' on 'Headers': 2 arguments required, but only ${arguments.length} present.` + ); + } + name = webidl.converters.ByteString(name); + value = webidl.converters.ByteString(value); + value = headerValueNormalize(value); + if (!isValidHeaderName(name)) { + webidl.errors.invalidArgument({ + prefix: "Headers.set", + value: name, + type: "header name" + }); + } else if (!isValidHeaderValue(value)) { + webidl.errors.invalidArgument({ + prefix: "Headers.set", + value, + type: "header value" + }); + } + if (this[kGuard] === "immutable") { + throw new TypeError("immutable"); + } else if (this[kGuard] === "request-no-cors") { + } + return this[kHeadersList].set(name, value); + } + get [kHeadersSortedMap]() { + var _a3, _b2; + (_b2 = (_a3 = this[kHeadersList])[kHeadersSortedMap]) != null ? _b2 : _a3[kHeadersSortedMap] = new Map([...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)); + return this[kHeadersList][kHeadersSortedMap]; + } + keys() { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + return makeIterator(this[kHeadersSortedMap].keys(), "Headers"); + } + values() { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + return makeIterator(this[kHeadersSortedMap].values(), "Headers"); + } + entries() { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + return makeIterator(this[kHeadersSortedMap].entries(), "Headers"); + } + forEach(callbackFn, thisArg = globalThis) { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'forEach' on 'Headers': 1 argument required, but only ${arguments.length} present.` + ); + } + if (typeof callbackFn !== "function") { + throw new TypeError( + "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." + ); + } + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]); + } + } + [Symbol.for("nodejs.util.inspect.custom")]() { + if (!(this instanceof Headers)) { + throw new TypeError("Illegal invocation"); + } + return this[kHeadersList]; + } + }; + __name(Headers, "Headers"); + Headers.prototype[Symbol.iterator] = Headers.prototype.entries; + Object.defineProperties(Headers.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + keys: kEnumerableProperty, + values: kEnumerableProperty, + entries: kEnumerableProperty, + forEach: kEnumerableProperty + }); + webidl.converters.HeadersInit = function(V) { + if (webidl.util.Type(V) === "Object") { + if (V[Symbol.iterator]) { + return webidl.converters["sequence>"](V); + } + return webidl.converters["record"](V); + } + webidl.errors.conversionFailed({ + prefix: "Headers constructor", + argument: "Argument 1", + types: ["sequence>", "record"] + }); + }; + module2.exports = { + fill, + Headers, + HeadersList + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/response.js +var require_response = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/response.js"(exports, module2) { + "use strict"; + var { Headers, HeadersList, fill } = require_headers(); + var { extractBody, cloneBody, mixinBody } = require_body(); + var util2 = require_util2(); + var { kEnumerableProperty } = util2; + var { + responseURL, + isValidReasonPhrase, + isCancelled, + isAborted, + isBlobLike, + serializeJavascriptValueToJSONString, + isErrorLike + } = require_util3(); + var { + redirectStatus, + nullBodyStatus, + DOMException + } = require_constants(); + var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); + var { webidl } = require_webidl(); + var { FormData } = require_formdata(); + var { kHeadersList } = require_symbols(); + var assert = require("assert"); + var { types } = require("util"); + var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream; + var Response = class { + static error() { + const relevantRealm = { settingsObject: {} }; + const responseObject = new Response(); + responseObject[kState] = makeNetworkError(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + return responseObject; + } + static json(data, init = {}) { + if (arguments.length === 0) { + throw new TypeError( + "Failed to execute 'json' on 'Response': 1 argument required, but 0 present." + ); + } + if (init !== null) { + init = webidl.converters.ResponseInit(init); + } + const bytes = new TextEncoder("utf-8").encode( + serializeJavascriptValueToJSONString(data) + ); + const body = extractBody(bytes); + const relevantRealm = { settingsObject: {} }; + const responseObject = new Response(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kGuard] = "response"; + responseObject[kHeaders][kRealm] = relevantRealm; + initializeResponse(responseObject, init, { body: body[0], type: "application/json" }); + return responseObject; + } + static redirect(url, status = 302) { + const relevantRealm = { settingsObject: {} }; + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'redirect' on 'Response': 1 argument required, but only ${arguments.length} present.` + ); + } + url = webidl.converters.USVString(url); + status = webidl.converters["unsigned short"](status); + let parsedURL; + try { + parsedURL = new URL(url); + } catch (err) { + throw Object.assign(new TypeError("Failed to parse URL from " + url), { + cause: err + }); + } + if (!redirectStatus.includes(status)) { + throw new RangeError("Invalid status code"); + } + const responseObject = new Response(); + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + responseObject[kState].status = status; + const value = parsedURL.toString(); + responseObject[kState].headersList.append("location", value); + return responseObject; + } + constructor(body = null, init = {}) { + if (body !== null) { + body = webidl.converters.BodyInit(body); + } + init = webidl.converters.ResponseInit(init); + this[kRealm] = { settingsObject: {} }; + this[kState] = makeResponse({}); + this[kHeaders] = new Headers(); + this[kHeaders][kGuard] = "response"; + this[kHeaders][kHeadersList] = this[kState].headersList; + this[kHeaders][kRealm] = this[kRealm]; + let bodyWithType = null; + if (body != null) { + const [extractedBody, type] = extractBody(body); + bodyWithType = { body: extractedBody, type }; + } + initializeResponse(this, init, bodyWithType); + } + get [Symbol.toStringTag]() { + return this.constructor.name; + } + get type() { + if (!(this instanceof Response)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].type; + } + get url() { + if (!(this instanceof Response)) { + throw new TypeError("Illegal invocation"); + } + let url = responseURL(this[kState]); + if (url == null) { + return ""; + } + if (url.hash) { + url = new URL(url); + url.hash = ""; + } + return url.toString(); + } + get redirected() { + if (!(this instanceof Response)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].urlList.length > 1; + } + get status() { + if (!(this instanceof Response)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].status; + } + get ok() { + if (!(this instanceof Response)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].status >= 200 && this[kState].status <= 299; + } + get statusText() { + if (!(this instanceof Response)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].statusText; + } + get headers() { + if (!(this instanceof Response)) { + throw new TypeError("Illegal invocation"); + } + return this[kHeaders]; + } + clone() { + if (!(this instanceof Response)) { + throw new TypeError("Illegal invocation"); + } + if (this.bodyUsed || this.body && this.body.locked) { + webidl.errors.exception({ + header: "Response.clone", + message: "Body has already been consumed." + }); + } + const clonedResponse = cloneResponse(this[kState]); + const clonedResponseObject = new Response(); + clonedResponseObject[kState] = clonedResponse; + clonedResponseObject[kRealm] = this[kRealm]; + clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList; + clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]; + clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]; + return clonedResponseObject; + } + }; + __name(Response, "Response"); + mixinBody(Response); + Object.defineProperties(Response.prototype, { + type: kEnumerableProperty, + url: kEnumerableProperty, + status: kEnumerableProperty, + ok: kEnumerableProperty, + redirected: kEnumerableProperty, + statusText: kEnumerableProperty, + headers: kEnumerableProperty, + clone: kEnumerableProperty + }); + function cloneResponse(response) { + if (response.internalResponse) { + return filterResponse( + cloneResponse(response.internalResponse), + response.type + ); + } + const newResponse = makeResponse({ ...response, body: null }); + if (response.body != null) { + newResponse.body = cloneBody(response.body); + } + return newResponse; + } + __name(cloneResponse, "cloneResponse"); + function makeResponse(init) { + return { + aborted: false, + rangeRequested: false, + timingAllowPassed: false, + requestIncludesCredentials: false, + type: "default", + status: 200, + timingInfo: null, + cacheState: "", + statusText: "", + ...init, + headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList(), + urlList: init.urlList ? [...init.urlList] : [] + }; + } + __name(makeResponse, "makeResponse"); + function makeNetworkError(reason) { + const isError2 = isErrorLike(reason); + return makeResponse({ + type: "error", + status: 0, + error: isError2 ? reason : new Error(reason ? String(reason) : reason, { + cause: isError2 ? reason : void 0 + }), + aborted: reason && reason.name === "AbortError" + }); + } + __name(makeNetworkError, "makeNetworkError"); + function makeFilteredResponse(response, state) { + state = { + internalResponse: response, + ...state + }; + return new Proxy(response, { + get(target, p) { + return p in state ? state[p] : target[p]; + }, + set(target, p, value) { + assert(!(p in state)); + target[p] = value; + return true; + } + }); + } + __name(makeFilteredResponse, "makeFilteredResponse"); + function filterResponse(response, type) { + if (type === "basic") { + return makeFilteredResponse(response, { + type: "basic", + headersList: response.headersList + }); + } else if (type === "cors") { + return makeFilteredResponse(response, { + type: "cors", + headersList: response.headersList + }); + } else if (type === "opaque") { + return makeFilteredResponse(response, { + type: "opaque", + urlList: Object.freeze([]), + status: 0, + statusText: "", + body: null + }); + } else if (type === "opaqueredirect") { + return makeFilteredResponse(response, { + type: "opaqueredirect", + status: 0, + statusText: "", + headersList: [], + body: null + }); + } else { + assert(false); + } + } + __name(filterResponse, "filterResponse"); + function makeAppropriateNetworkError(fetchParams) { + assert(isCancelled(fetchParams)); + return isAborted(fetchParams) ? makeNetworkError(new DOMException("The operation was aborted.", "AbortError")) : makeNetworkError(fetchParams.controller.terminated.reason); + } + __name(makeAppropriateNetworkError, "makeAppropriateNetworkError"); + function initializeResponse(response, init, body) { + if (init.status !== null && (init.status < 200 || init.status > 599)) { + throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.'); + } + if ("statusText" in init && init.statusText != null) { + if (!isValidReasonPhrase(String(init.statusText))) { + throw new TypeError("Invalid statusText"); + } + } + if ("status" in init && init.status != null) { + response[kState].status = init.status; + } + if ("statusText" in init && init.statusText != null) { + response[kState].statusText = init.statusText; + } + if ("headers" in init && init.headers != null) { + fill(response[kState].headersList, init.headers); + } + if (body) { + if (nullBodyStatus.includes(response.status)) { + webidl.errors.exception({ + header: "Response constructor", + message: "Invalid response status code." + }); + } + response[kState].body = body.body; + if (body.type != null && !response[kState].headersList.has("Content-Type")) { + response[kState].headersList.append("content-type", body.type); + } + } + } + __name(initializeResponse, "initializeResponse"); + webidl.converters.ReadableStream = webidl.interfaceConverter( + ReadableStream + ); + webidl.converters.FormData = webidl.interfaceConverter( + FormData + ); + webidl.converters.URLSearchParams = webidl.interfaceConverter( + URLSearchParams + ); + webidl.converters.XMLHttpRequestBodyInit = function(V) { + if (typeof V === "string") { + return webidl.converters.USVString(V); + } + if (isBlobLike(V)) { + return webidl.converters.Blob(V); + } + if (types.isAnyArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { + return webidl.converters.BufferSource(V); + } + if (V instanceof FormData) { + return webidl.converters.FormData(V); + } + if (V instanceof URLSearchParams) { + return webidl.converters.URLSearchParams(V); + } + return webidl.converters.DOMString(V); + }; + webidl.converters.BodyInit = function(V) { + if (V instanceof ReadableStream) { + return webidl.converters.ReadableStream(V); + } + if (V == null ? void 0 : V[Symbol.asyncIterator]) { + return V; + } + return webidl.converters.XMLHttpRequestBodyInit(V); + }; + webidl.converters.ResponseInit = webidl.dictionaryConverter([ + { + key: "status", + converter: webidl.converters["unsigned short"], + defaultValue: 200 + }, + { + key: "statusText", + converter: webidl.converters.ByteString, + defaultValue: "" + }, + { + key: "headers", + converter: webidl.converters.HeadersInit + } + ]); + module2.exports = { + makeNetworkError, + makeResponse, + makeAppropriateNetworkError, + filterResponse, + Response + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/request.js +var require_request2 = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/request.js"(exports, module2) { + "use strict"; + var { extractBody, mixinBody, cloneBody } = require_body(); + var { Headers, fill: fillHeaders, HeadersList } = require_headers(); + var { FinalizationRegistry } = require_dispatcher_weakref()(); + var util2 = require_util2(); + var { + isValidHTTPToken, + sameOrigin, + normalizeMethod + } = require_util3(); + var { + forbiddenMethods, + corsSafeListedMethods, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache + } = require_constants(); + var { kEnumerableProperty } = util2; + var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols2(); + var { webidl } = require_webidl(); + var { kHeadersList } = require_symbols(); + var assert = require("assert"); + var TransformStream; + var kInit = Symbol("init"); + var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { + signal.removeEventListener("abort", abort); + }); + var Request = class { + constructor(input, init = {}) { + var _a3, _b2; + if (input === kInit) { + return; + } + if (arguments.length < 1) { + throw new TypeError( + `Failed to construct 'Request': 1 argument required, but only ${arguments.length} present.` + ); + } + input = webidl.converters.RequestInfo(input); + init = webidl.converters.RequestInit(init); + this[kRealm] = { settingsObject: {} }; + let request2 = null; + let fallbackMode = null; + const baseUrl = this[kRealm].settingsObject.baseUrl; + let signal = null; + if (typeof input === "string") { + let parsedURL; + try { + parsedURL = new URL(input, baseUrl); + } catch (err) { + throw new TypeError("Failed to parse URL from " + input, { cause: err }); + } + if (parsedURL.username || parsedURL.password) { + throw new TypeError( + "Request cannot be constructed from a URL that includes credentials: " + input + ); + } + request2 = makeRequest({ urlList: [parsedURL] }); + fallbackMode = "cors"; + } else { + assert(input instanceof Request); + request2 = input[kState]; + signal = input[kSignal]; + } + const origin = this[kRealm].settingsObject.origin; + let window2 = "client"; + if (((_b2 = (_a3 = request2.window) == null ? void 0 : _a3.constructor) == null ? void 0 : _b2.name) === "EnvironmentSettingsObject" && sameOrigin(request2.window, origin)) { + window2 = request2.window; + } + if (init.window !== void 0 && init.window != null) { + throw new TypeError(`'window' option '${window2}' must be null`); + } + if (init.window !== void 0) { + window2 = "no-window"; + } + request2 = makeRequest({ + method: request2.method, + headersList: request2.headersList, + unsafeRequest: request2.unsafeRequest, + client: this[kRealm].settingsObject, + window: window2, + priority: request2.priority, + origin: request2.origin, + referrer: request2.referrer, + referrerPolicy: request2.referrerPolicy, + mode: request2.mode, + credentials: request2.credentials, + cache: request2.cache, + redirect: request2.redirect, + integrity: request2.integrity, + keepalive: request2.keepalive, + reloadNavigation: request2.reloadNavigation, + historyNavigation: request2.historyNavigation, + urlList: [...request2.urlList] + }); + if (Object.keys(init).length > 0) { + if (request2.mode === "navigate") { + request2.mode = "same-origin"; + } + request2.reloadNavigation = false; + request2.historyNavigation = false; + request2.origin = "client"; + request2.referrer = "client"; + request2.referrerPolicy = ""; + request2.url = request2.urlList[request2.urlList.length - 1]; + request2.urlList = [request2.url]; + } + if (init.referrer !== void 0) { + const referrer = init.referrer; + if (referrer === "") { + request2.referrer = "no-referrer"; + } else { + let parsedReferrer; + try { + parsedReferrer = new URL(referrer, baseUrl); + } catch (err) { + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }); + } + request2.referrer = parsedReferrer; + } + } + if (init.referrerPolicy !== void 0) { + request2.referrerPolicy = init.referrerPolicy; + if (!referrerPolicy.includes(request2.referrerPolicy)) { + throw new TypeError( + `Failed to construct 'Request': The provided value '${request2.referrerPolicy}' is not a valid enum value of type ReferrerPolicy.` + ); + } + } + let mode; + if (init.mode !== void 0) { + mode = init.mode; + if (!requestMode.includes(mode)) { + throw new TypeError( + `Failed to construct 'Request': The provided value '${request2.mode}' is not a valid enum value of type RequestMode.` + ); + } + } else { + mode = fallbackMode; + } + if (mode === "navigate") { + webidl.errors.exception({ + header: "Request constructor", + message: "invalid request mode navigate." + }); + } + if (mode != null) { + request2.mode = mode; + } + if (init.credentials !== void 0) { + request2.credentials = init.credentials; + if (!requestCredentials.includes(request2.credentials)) { + throw new TypeError( + `Failed to construct 'Request': The provided value '${request2.credentials}' is not a valid enum value of type RequestCredentials.` + ); + } + } + if (init.cache !== void 0) { + request2.cache = init.cache; + if (!requestCache.includes(request2.cache)) { + throw new TypeError( + `Failed to construct 'Request': The provided value '${request2.cache}' is not a valid enum value of type RequestCache.` + ); + } + } + if (request2.cache === "only-if-cached" && request2.mode !== "same-origin") { + throw new TypeError( + "'only-if-cached' can be set only with 'same-origin' mode" + ); + } + if (init.redirect !== void 0) { + request2.redirect = init.redirect; + if (!requestRedirect.includes(request2.redirect)) { + throw new TypeError( + `Failed to construct 'Request': The provided value '${request2.redirect}' is not a valid enum value of type RequestRedirect.` + ); + } + } + if (init.integrity !== void 0 && init.integrity != null) { + request2.integrity = String(init.integrity); + } + if (init.keepalive !== void 0) { + request2.keepalive = Boolean(init.keepalive); + } + if (init.method !== void 0) { + let method = init.method; + if (!isValidHTTPToken(init.method)) { + throw TypeError(`'${init.method}' is not a valid HTTP method.`); + } + if (forbiddenMethods.indexOf(method.toUpperCase()) !== -1) { + throw TypeError(`'${init.method}' HTTP method is unsupported.`); + } + method = normalizeMethod(init.method); + request2.method = method; + } + if (init.signal !== void 0) { + signal = init.signal; + } + this[kState] = request2; + const ac = new AbortController(); + this[kSignal] = ac.signal; + this[kSignal][kRealm] = this[kRealm]; + if (signal != null) { + if (!signal || typeof signal.aborted !== "boolean" || typeof signal.addEventListener !== "function") { + throw new TypeError( + "Failed to construct 'Request': member signal is not of type AbortSignal." + ); + } + if (signal.aborted) { + ac.abort(signal.reason); + } else { + const abort = /* @__PURE__ */ __name(() => ac.abort(signal.reason), "abort"); + signal.addEventListener("abort", abort, { once: true }); + requestFinalizer.register(this, { signal, abort }); + } + } + this[kHeaders] = new Headers(); + this[kHeaders][kHeadersList] = request2.headersList; + this[kHeaders][kGuard] = "request"; + this[kHeaders][kRealm] = this[kRealm]; + if (mode === "no-cors") { + if (!corsSafeListedMethods.includes(request2.method)) { + throw new TypeError( + `'${request2.method} is unsupported in no-cors mode.` + ); + } + this[kHeaders][kGuard] = "request-no-cors"; + } + if (Object.keys(init).length !== 0) { + let headers = new Headers(this[kHeaders]); + if (init.headers !== void 0) { + headers = init.headers; + } + this[kHeaders][kHeadersList].clear(); + if (headers.constructor.name === "Headers") { + for (const [key, val] of headers) { + this[kHeaders].append(key, val); + } + } else { + fillHeaders(this[kHeaders], headers); + } + } + const inputBody = input instanceof Request ? input[kState].body : null; + if ((init.body !== void 0 && init.body != null || inputBody != null) && (request2.method === "GET" || request2.method === "HEAD")) { + throw new TypeError("Request with GET/HEAD method cannot have body."); + } + let initBody = null; + if (init.body !== void 0 && init.body != null) { + const [extractedBody, contentType] = extractBody( + init.body, + request2.keepalive + ); + initBody = extractedBody; + if (contentType && !this[kHeaders].has("content-type")) { + this[kHeaders].append("content-type", contentType); + } + } + const inputOrInitBody = initBody != null ? initBody : inputBody; + if (inputOrInitBody != null && inputOrInitBody.source == null) { + if (request2.mode !== "same-origin" && request2.mode !== "cors") { + throw new TypeError( + 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' + ); + } + request2.useCORSPreflightFlag = true; + } + let finalBody = inputOrInitBody; + if (initBody == null && inputBody != null) { + if (util2.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + throw new TypeError( + "Cannot construct a Request with a Request object that has already been used." + ); + } + if (!TransformStream) { + TransformStream = require("stream/web").TransformStream; + } + const identityTransform = new TransformStream(); + inputBody.stream.pipeThrough(identityTransform); + finalBody = { + source: inputBody.source, + length: inputBody.length, + stream: identityTransform.readable + }; + } + this[kState].body = finalBody; + } + get [Symbol.toStringTag]() { + return this.constructor.name; + } + get method() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].method; + } + get url() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].url.toString(); + } + get headers() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kHeaders]; + } + get destination() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].destination; + } + get referrer() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + if (this[kState].referrer === "no-referrer") { + return ""; + } + if (this[kState].referrer === "client") { + return "about:client"; + } + return this[kState].referrer.toString(); + } + get referrerPolicy() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].referrerPolicy; + } + get mode() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].mode; + } + get credentials() { + return this[kState].credentials; + } + get cache() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].cache; + } + get redirect() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].redirect; + } + get integrity() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].integrity; + } + get keepalive() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].keepalive; + } + get isReloadNavigation() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].reloadNavigation; + } + get isHistoryNavigation() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kState].historyNavigation; + } + get signal() { + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + return this[kSignal]; + } + clone() { + var _a3; + if (!(this instanceof Request)) { + throw new TypeError("Illegal invocation"); + } + if (this.bodyUsed || ((_a3 = this.body) == null ? void 0 : _a3.locked)) { + throw new TypeError("unusable"); + } + const clonedRequest = cloneRequest(this[kState]); + const clonedRequestObject = new Request(kInit); + clonedRequestObject[kState] = clonedRequest; + clonedRequestObject[kRealm] = this[kRealm]; + clonedRequestObject[kHeaders] = new Headers(); + clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList; + clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]; + clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]; + const ac = new AbortController(); + if (this.signal.aborted) { + ac.abort(this.signal.reason); + } else { + this.signal.addEventListener( + "abort", + () => { + ac.abort(this.signal.reason); + }, + { once: true } + ); + } + clonedRequestObject[kSignal] = ac.signal; + return clonedRequestObject; + } + }; + __name(Request, "Request"); + mixinBody(Request); + function makeRequest(init) { + const request2 = { + method: "GET", + localURLsOnly: false, + unsafeRequest: false, + body: null, + client: null, + reservedClient: null, + replacesClientId: "", + window: "client", + keepalive: false, + serviceWorkers: "all", + initiator: "", + destination: "", + priority: null, + origin: "client", + policyContainer: "client", + referrer: "client", + referrerPolicy: "", + mode: "no-cors", + useCORSPreflightFlag: false, + credentials: "same-origin", + useCredentials: false, + cache: "default", + redirect: "follow", + integrity: "", + cryptoGraphicsNonceMetadata: "", + parserMetadata: "", + reloadNavigation: false, + historyNavigation: false, + userActivation: false, + taintedOrigin: false, + redirectCount: 0, + responseTainting: "basic", + preventNoCacheCacheControlHeaderModification: false, + done: false, + timingAllowFailed: false, + ...init, + headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList() + }; + request2.url = request2.urlList[0]; + return request2; + } + __name(makeRequest, "makeRequest"); + function cloneRequest(request2) { + const newRequest = makeRequest({ ...request2, body: null }); + if (request2.body != null) { + newRequest.body = cloneBody(request2.body); + } + return newRequest; + } + __name(cloneRequest, "cloneRequest"); + Object.defineProperties(Request.prototype, { + method: kEnumerableProperty, + url: kEnumerableProperty, + headers: kEnumerableProperty, + redirect: kEnumerableProperty, + clone: kEnumerableProperty, + signal: kEnumerableProperty + }); + webidl.converters.Request = webidl.interfaceConverter( + Request + ); + webidl.converters.RequestInfo = function(V) { + if (typeof V === "string") { + return webidl.converters.USVString(V); + } + if (V instanceof Request) { + return webidl.converters.Request(V); + } + return webidl.converters.USVString(V); + }; + webidl.converters.AbortSignal = webidl.interfaceConverter( + AbortSignal + ); + webidl.converters.RequestInit = webidl.dictionaryConverter([ + { + key: "method", + converter: webidl.converters.ByteString + }, + { + key: "headers", + converter: webidl.converters.HeadersInit + }, + { + key: "body", + converter: webidl.nullableConverter( + webidl.converters.BodyInit + ) + }, + { + key: "referrer", + converter: webidl.converters.USVString + }, + { + key: "referrerPolicy", + converter: webidl.converters.DOMString, + allowedValues: [ + "", + "no-referrer", + "no-referrer-when-downgrade", + "same-origin", + "origin", + "strict-origin", + "origin-when-cross-origin", + "strict-origin-when-cross-origin", + "unsafe-url" + ] + }, + { + key: "mode", + converter: webidl.converters.DOMString, + allowedValues: [ + "same-origin", + "cors", + "no-cors", + "navigate", + "websocket" + ] + }, + { + key: "credentials", + converter: webidl.converters.DOMString, + allowedValues: [ + "omit", + "same-origin", + "include" + ] + }, + { + key: "cache", + converter: webidl.converters.DOMString, + allowedValues: [ + "default", + "no-store", + "reload", + "no-cache", + "force-cache", + "only-if-cached" + ] + }, + { + key: "redirect", + converter: webidl.converters.DOMString, + allowedValues: [ + "follow", + "error", + "manual" + ] + }, + { + key: "integrity", + converter: webidl.converters.DOMString + }, + { + key: "keepalive", + converter: webidl.converters.boolean + }, + { + key: "signal", + converter: webidl.nullableConverter( + (signal) => webidl.converters.AbortSignal( + signal, + { strict: false } + ) + ) + }, + { + key: "window", + converter: webidl.converters.any + } + ]); + module2.exports = { Request, makeRequest }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/dataURL.js +var require_dataURL = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/dataURL.js"(exports, module2) { + var assert = require("assert"); + var { atob: atob2 } = require("buffer"); + var encoder = new TextEncoder(); + function dataURLProcessor(dataURL) { + assert(dataURL.protocol === "data:"); + let input = URLSerializer(dataURL, true); + input = input.slice(5); + const position = { position: 0 }; + let mimeType = collectASequenceOfCodePoints( + (char) => char !== ",", + input, + position + ); + const mimeTypeLength = mimeType.length; + mimeType = mimeType.replace(/^(\u0020)+|(\u0020)+$/g, ""); + if (position.position >= input.length) { + return "failure"; + } + position.position++; + const encodedBody = input.slice(mimeTypeLength + 1); + let body = stringPercentDecode(encodedBody); + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + const stringBody = decodeURIComponent(new TextDecoder("utf-8").decode(body)); + body = forgivingBase64(stringBody); + if (body === "failure") { + return "failure"; + } + mimeType = mimeType.slice(0, -6); + mimeType = mimeType.replace(/(\u0020)+$/, ""); + mimeType = mimeType.slice(0, -1); + } + if (mimeType.startsWith(";")) { + mimeType = "text/plain" + mimeType; + } + let mimeTypeRecord = parseMIMEType(mimeType); + if (mimeTypeRecord === "failure") { + mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII"); + } + return { mimeType: mimeTypeRecord, body }; + } + __name(dataURLProcessor, "dataURLProcessor"); + function URLSerializer(url, excludeFragment = false) { + let output = url.protocol; + if (url.host.length > 0) { + output += "//"; + if (url.username.length > 0 || url.password.length > 0) { + output += url.username; + if (url.password.length > 0) { + output += ":" + url.password; + } + output += "@"; + } + output += decodeURIComponent(url.host); + if (url.port.length > 0) { + output += ":" + url.port; + } + } + if (url.host.length === 0 && url.pathname.length > 1 && url.href.slice(url.protocol.length + 1)[0] === ".") { + output += "/."; + } + output += url.pathname; + if (url.search.length > 0) { + output += url.search; + } + if (excludeFragment === false && url.hash.length > 0) { + output += url.hash; + } + return output; + } + __name(URLSerializer, "URLSerializer"); + function collectASequenceOfCodePoints(condition, input, position) { + let result = ""; + while (position.position < input.length && condition(input[position.position])) { + result += input[position.position]; + position.position++; + } + return result; + } + __name(collectASequenceOfCodePoints, "collectASequenceOfCodePoints"); + function stringPercentDecode(input) { + const bytes = encoder.encode(input); + return percentDecode(bytes); + } + __name(stringPercentDecode, "stringPercentDecode"); + function percentDecode(input) { + const output = []; + for (let i = 0; i < input.length; i++) { + const byte = input[i]; + if (byte !== 37) { + output.push(byte); + } else if (byte === 37 && !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))) { + output.push(37); + } else { + const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]); + const bytePoint = Number.parseInt(nextTwoBytes, 16); + output.push(bytePoint); + i += 2; + } + } + return Uint8Array.from(output); + } + __name(percentDecode, "percentDecode"); + function parseMIMEType(input) { + input = input.trim(); + const position = { position: 0 }; + const type = collectASequenceOfCodePoints( + (char) => char !== "/", + input, + position + ); + if (type.length === 0 || !/^[!#$%&'*+-.^_|~A-z0-9]+$/.test(type)) { + return "failure"; + } + if (position.position > input.length) { + return "failure"; + } + position.position++; + let subtype = collectASequenceOfCodePoints( + (char) => char !== ";", + input, + position + ); + subtype = subtype.trim(); + if (subtype.length === 0 || !/^[!#$%&'*+-.^_|~A-z0-9]+$/.test(subtype)) { + return "failure"; + } + const mimeType = { + type: type.toLowerCase(), + subtype: subtype.toLowerCase(), + parameters: /* @__PURE__ */ new Map() + }; + while (position.position < input.length) { + position.position++; + collectASequenceOfCodePoints( + (char) => /(\u000A|\u000D|\u0009|\u0020)/.test(char), + input, + position + ); + let parameterName = collectASequenceOfCodePoints( + (char) => char !== ";" && char !== "=", + input, + position + ); + parameterName = parameterName.toLowerCase(); + if (position.position < input.length) { + if (input[position.position] === ";") { + continue; + } + position.position++; + } + if (position.position > input.length) { + break; + } + let parameterValue = null; + if (input[position.position] === '"') { + parameterValue = collectAnHTTPQuotedString(input, position); + collectASequenceOfCodePoints( + (char) => char !== ";", + input, + position + ); + } else { + parameterValue = collectASequenceOfCodePoints( + (char) => char !== ";", + input, + position + ); + parameterValue = parameterValue.trim(); + if (parameterValue.length === 0) { + continue; + } + } + if (parameterName.length !== 0 && /^[!#$%&'*+-.^_|~A-z0-9]+$/.test(parameterName) && !/^(\u0009|\x{0020}-\x{007E}|\x{0080}-\x{00FF})+$/.test(parameterValue) && !mimeType.parameters.has(parameterName)) { + mimeType.parameters.set(parameterName, parameterValue); + } + } + return mimeType; + } + __name(parseMIMEType, "parseMIMEType"); + function forgivingBase64(data) { + data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, ""); + if (data.length % 4 === 0) { + data = data.replace(/=?=$/, ""); + } + if (data.length % 4 === 1) { + return "failure"; + } + if (/[^+/0-9A-Za-z]/.test(data)) { + return "failure"; + } + const binary = atob2(data); + const bytes = new Uint8Array(binary.length); + for (let byte = 0; byte < binary.length; byte++) { + bytes[byte] = binary.charCodeAt(byte); + } + return bytes; + } + __name(forgivingBase64, "forgivingBase64"); + function collectAnHTTPQuotedString(input, position, extractValue) { + const positionStart = position.position; + let value = ""; + assert(input[position.position] === '"'); + position.position++; + while (true) { + value += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== "\\", + input, + position + ); + if (position.position >= input.length) { + break; + } + const quoteOrBackslash = input[position.position]; + position.position++; + if (quoteOrBackslash === "\\") { + if (position.position >= input.length) { + value += "\\"; + break; + } + value += input[position.position]; + position.position++; + } else { + assert(quoteOrBackslash === '"'); + break; + } + } + if (extractValue) { + return value; + } + return input.slice(positionStart, position.position); + } + __name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString"); + module2.exports = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString + }; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/index.js +var require_fetch = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/lib/fetch/index.js"(exports, module2) { + "use strict"; + var { + Response, + makeNetworkError, + makeAppropriateNetworkError, + filterResponse, + makeResponse + } = require_response(); + var { Headers } = require_headers(); + var { Request, makeRequest } = require_request2(); + var zlib = require("zlib"); + var { + bytesMatch, + makePolicyContainer, + clonePolicyContainer, + requestBadPort, + TAOCheck, + appendRequestOriginHeader, + responseLocationURL, + requestCurrentURL, + setRequestReferrerPolicyOnRedirect, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + createOpaqueTimingInfo, + appendFetchMetadata, + corsCheck, + crossOriginResourcePolicyCheck, + determineRequestsReferrer, + coarsenedSharedCurrentTime, + createDeferredPromise, + isBlobLike, + sameOrigin, + isCancelled, + isAborted, + isErrorLike, + fullyReadBody + } = require_util3(); + var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); + var assert = require("assert"); + var { safelyExtractBody, extractBody } = require_body(); + var { + redirectStatus, + nullBodyStatus, + safeMethods, + requestBodyHeader, + subresource, + DOMException + } = require_constants(); + var { kHeadersList } = require_symbols(); + var EE = require("events"); + var { Readable, pipeline } = require("stream"); + var { isErrored, isReadable } = require_util2(); + var { dataURLProcessor } = require_dataURL(); + var { TransformStream } = require("stream/web"); + var resolveObjectURL; + var ReadableStream; + var nodeVersion = process.versions.node.split("."); + var nodeMajor = Number(nodeVersion[0]); + var nodeMinor = Number(nodeVersion[1]); + var Fetch = class extends EE { + constructor(dispatcher) { + super(); + this.dispatcher = dispatcher; + this.connection = null; + this.dump = false; + this.state = "ongoing"; + } + terminate(reason) { + var _a3; + if (this.state !== "ongoing") { + return; + } + this.state = "terminated"; + (_a3 = this.connection) == null ? void 0 : _a3.destroy(reason); + this.emit("terminated", reason); + } + abort() { + var _a3; + if (this.state !== "ongoing") { + return; + } + const reason = new DOMException("The operation was aborted.", "AbortError"); + this.state = "aborted"; + (_a3 = this.connection) == null ? void 0 : _a3.destroy(reason); + this.emit("terminated", reason); + } + }; + __name(Fetch, "Fetch"); + async function fetch2(input, init = {}) { + var _a3; + if (arguments.length < 1) { + throw new TypeError( + `Failed to execute 'fetch' on 'Window': 1 argument required, but only ${arguments.length} present.` + ); + } + const p = createDeferredPromise(); + let requestObject; + try { + requestObject = new Request(input, init); + } catch (e) { + p.reject(e); + return p.promise; + } + const request2 = requestObject[kState]; + if (requestObject.signal.aborted) { + abortFetch(p, request2, null); + return p.promise; + } + const globalObject = request2.client.globalObject; + if (((_a3 = globalObject == null ? void 0 : globalObject.constructor) == null ? void 0 : _a3.name) === "ServiceWorkerGlobalScope") { + request2.serviceWorkers = "none"; + } + let responseObject = null; + const relevantRealm = null; + let locallyAborted = false; + let controller = null; + requestObject.signal.addEventListener( + "abort", + () => { + locallyAborted = true; + abortFetch(p, request2, responseObject); + if (controller != null) { + controller.abort(); + } + }, + { once: true } + ); + const handleFetchDone = /* @__PURE__ */ __name((response) => finalizeAndReportTiming(response, "fetch"), "handleFetchDone"); + const processResponse = /* @__PURE__ */ __name((response) => { + if (locallyAborted) { + return; + } + if (response.aborted) { + abortFetch(p, request2, responseObject); + return; + } + if (response.type === "error") { + p.reject( + Object.assign(new TypeError("fetch failed"), { cause: response.error }) + ); + return; + } + responseObject = new Response(); + responseObject[kState] = response; + responseObject[kRealm] = relevantRealm; + responseObject[kHeaders][kHeadersList] = response.headersList; + responseObject[kHeaders][kGuard] = "immutable"; + responseObject[kHeaders][kRealm] = relevantRealm; + p.resolve(responseObject); + }, "processResponse"); + controller = fetching({ + request: request2, + processResponseEndOfBody: handleFetchDone, + processResponse, + dispatcher: this + }); + return p.promise; + } + __name(fetch2, "fetch"); + function finalizeAndReportTiming(response, initiatorType = "other") { + var _a3; + if (response.type === "error" && response.aborted) { + return; + } + if (!((_a3 = response.urlList) == null ? void 0 : _a3.length)) { + return; + } + const originalURL = response.urlList[0]; + let timingInfo = response.timingInfo; + let cacheState = response.cacheState; + if (!/^https?:/.test(originalURL.protocol)) { + return; + } + if (timingInfo === null) { + return; + } + if (!timingInfo.timingAllowPassed) { + timingInfo = createOpaqueTimingInfo({ + startTime: timingInfo.startTime + }); + cacheState = ""; + } + response.timingInfo.endTime = coarsenedSharedCurrentTime(); + response.timingInfo = timingInfo; + markResourceTiming( + timingInfo, + originalURL, + initiatorType, + globalThis, + cacheState + ); + } + __name(finalizeAndReportTiming, "finalizeAndReportTiming"); + function markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState) { + if (nodeMajor >= 18 && nodeMinor >= 2) { + performance.markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState); + } + } + __name(markResourceTiming, "markResourceTiming"); + function abortFetch(p, request2, responseObject) { + var _a3, _b2; + const error2 = new DOMException("The operation was aborted.", "AbortError"); + p.reject(error2); + if (request2.body != null && isReadable((_a3 = request2.body) == null ? void 0 : _a3.stream)) { + request2.body.stream.cancel(error2).catch((err) => { + if (err.code === "ERR_INVALID_STATE") { + return; + } + throw err; + }); + } + if (responseObject == null) { + return; + } + const response = responseObject[kState]; + if (response.body != null && isReadable((_b2 = response.body) == null ? void 0 : _b2.stream)) { + response.body.stream.cancel(error2).catch((err) => { + if (err.code === "ERR_INVALID_STATE") { + return; + } + throw err; + }); + } + } + __name(abortFetch, "abortFetch"); + function fetching({ + request: request2, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseEndOfBody, + processResponseConsumeBody, + useParallelQueue = false, + dispatcher + }) { + var _a3, _b2, _c, _d; + let taskDestination = null; + let crossOriginIsolatedCapability = false; + if (request2.client != null) { + taskDestination = request2.client.globalObject; + crossOriginIsolatedCapability = request2.client.crossOriginIsolatedCapability; + } + const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability); + const timingInfo = createOpaqueTimingInfo({ + startTime: currenTime + }); + const fetchParams = { + controller: new Fetch(dispatcher), + request: request2, + timingInfo, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseConsumeBody, + processResponseEndOfBody, + taskDestination, + crossOriginIsolatedCapability + }; + assert(!request2.body || request2.body.stream); + if (request2.window === "client") { + request2.window = ((_c = (_b2 = (_a3 = request2.client) == null ? void 0 : _a3.globalObject) == null ? void 0 : _b2.constructor) == null ? void 0 : _c.name) === "Window" ? request2.client : "no-window"; + } + if (request2.origin === "client") { + request2.origin = (_d = request2.client) == null ? void 0 : _d.origin; + } + if (request2.policyContainer === "client") { + if (request2.client != null) { + request2.policyContainer = clonePolicyContainer( + request2.client.policyContainer + ); + } else { + request2.policyContainer = makePolicyContainer(); + } + } + if (!request2.headersList.has("accept")) { + const value = "*/*"; + request2.headersList.append("accept", value); + } + if (!request2.headersList.has("accept-language")) { + request2.headersList.append("accept-language", "*"); + } + if (request2.priority === null) { + } + if (subresource.includes(request2.destination)) { + } + mainFetch(fetchParams).catch((err) => { + fetchParams.controller.terminate(err); + }); + return fetchParams.controller; + } + __name(fetching, "fetching"); + async function mainFetch(fetchParams, recursive = false) { + const request2 = fetchParams.request; + let response = null; + if (request2.localURLsOnly && !/^(about|blob|data):/.test(requestCurrentURL(request2).protocol)) { + response = makeNetworkError("local URLs only"); + } + tryUpgradeRequestToAPotentiallyTrustworthyURL(request2); + if (requestBadPort(request2) === "blocked") { + response = makeNetworkError("bad port"); + } + if (request2.referrerPolicy === "") { + request2.referrerPolicy = request2.policyContainer.referrerPolicy; + } + if (request2.referrer !== "no-referrer") { + request2.referrer = determineRequestsReferrer(request2); + } + if (response === null) { + response = await (async () => { + const currentURL = requestCurrentURL(request2); + if (sameOrigin(currentURL, request2.url) && request2.responseTainting === "basic" || currentURL.protocol === "data:" || (request2.mode === "navigate" || request2.mode === "websocket")) { + request2.responseTainting = "basic"; + return await schemeFetch(fetchParams); + } + if (request2.mode === "same-origin") { + return makeNetworkError('request mode cannot be "same-origin"'); + } + if (request2.mode === "no-cors") { + if (request2.redirect !== "follow") { + return makeNetworkError( + 'redirect mode cannot be "follow" for "no-cors" request' + ); + } + request2.responseTainting = "opaque"; + return await schemeFetch(fetchParams); + } + if (!/^https?:/.test(requestCurrentURL(request2).protocol)) { + return makeNetworkError("URL scheme must be a HTTP(S) scheme"); + } + request2.responseTainting = "cors"; + return await httpFetch(fetchParams); + })(); + } + if (recursive) { + return response; + } + if (response.status !== 0 && !response.internalResponse) { + if (request2.responseTainting === "cors") { + } + if (request2.responseTainting === "basic") { + response = filterResponse(response, "basic"); + } else if (request2.responseTainting === "cors") { + response = filterResponse(response, "cors"); + } else if (request2.responseTainting === "opaque") { + response = filterResponse(response, "opaque"); + } else { + assert(false); + } + } + let internalResponse = response.status === 0 ? response : response.internalResponse; + if (internalResponse.urlList.length === 0) { + internalResponse.urlList.push(...request2.urlList); + } + if (!request2.timingAllowFailed) { + response.timingAllowPassed = true; + } + if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request2.headers.has("range")) { + response = internalResponse = makeNetworkError(); + } + if (response.status !== 0 && (request2.method === "HEAD" || request2.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { + internalResponse.body = null; + fetchParams.controller.dump = true; + } + if (request2.integrity) { + const processBodyError = /* @__PURE__ */ __name((reason) => fetchFinale(fetchParams, makeNetworkError(reason)), "processBodyError"); + if (request2.responseTainting === "opaque" || response.body == null) { + processBodyError(response.error); + return; + } + const processBody = /* @__PURE__ */ __name((bytes) => { + if (!bytesMatch(bytes, request2.integrity)) { + processBodyError("integrity mismatch"); + return; + } + response.body = safelyExtractBody(bytes)[0]; + fetchFinale(fetchParams, response); + }, "processBody"); + await fullyReadBody(response.body, processBody, processBodyError); + } else { + fetchFinale(fetchParams, response); + } + } + __name(mainFetch, "mainFetch"); + async function schemeFetch(fetchParams) { + const { request: request2 } = fetchParams; + const { + protocol: scheme, + pathname: path7 + } = requestCurrentURL(request2); + switch (scheme) { + case "about:": { + if (path7 === "blank") { + const resp = makeResponse({ + statusText: "OK", + headersList: [ + ["content-type", "text/html;charset=utf-8"] + ] + }); + resp.urlList = [new URL("about:blank")]; + return resp; + } + return makeNetworkError("invalid path called"); + } + case "blob:": { + resolveObjectURL = resolveObjectURL || require("buffer").resolveObjectURL; + const currentURL = requestCurrentURL(request2); + if (currentURL.search.length !== 0) { + return makeNetworkError("NetworkError when attempting to fetch resource."); + } + const blob = resolveObjectURL(currentURL.toString()); + if (request2.method !== "GET" || !isBlobLike(blob)) { + return makeNetworkError("invalid method"); + } + const response = makeResponse({ statusText: "OK", urlList: [currentURL] }); + response.headersList.set("content-length", `${blob.size}`); + response.headersList.set("content-type", blob.type); + response.body = extractBody(blob)[0]; + return response; + } + case "data:": { + const currentURL = requestCurrentURL(request2); + const dataURLStruct = dataURLProcessor(currentURL); + if (dataURLStruct === "failure") { + return makeNetworkError("failed to fetch the data URL"); + } + const { mimeType } = dataURLStruct; + let contentType = `${mimeType.type}/${mimeType.subtype}`; + const contentTypeParams = []; + if (mimeType.parameters.size > 0) { + contentType += ";"; + } + for (const [key, value] of mimeType.parameters) { + if (value.length > 0) { + contentTypeParams.push(`${key}=${value}`); + } else { + contentTypeParams.push(key); + } + } + contentType += contentTypeParams.join(","); + return makeResponse({ + statusText: "OK", + headersList: [ + ["content-type", contentType] + ], + body: extractBody(dataURLStruct.body)[0] + }); + } + case "file:": { + return makeNetworkError("not implemented... yet..."); + } + case "http:": + case "https:": { + return await httpFetch(fetchParams).catch((err) => makeNetworkError(err)); + } + default: { + return makeNetworkError("unknown scheme"); + } + } + } + __name(schemeFetch, "schemeFetch"); + function finalizeResponse(fetchParams, response) { + fetchParams.request.done = true; + if (fetchParams.processResponseDone != null) { + queueMicrotask(() => fetchParams.processResponseDone(response)); + } + } + __name(finalizeResponse, "finalizeResponse"); + async function fetchFinale(fetchParams, response) { + if (response.type === "error") { + response.urlList = [fetchParams.request.urlList[0]]; + response.timingInfo = createOpaqueTimingInfo({ + startTime: fetchParams.timingInfo.startTime + }); + } + const processResponseEndOfBody = /* @__PURE__ */ __name(() => { + fetchParams.request.done = true; + if (fetchParams.processResponseEndOfBody != null) { + queueMicrotask(() => fetchParams.processResponseEndOfBody(response)); + } + }, "processResponseEndOfBody"); + if (fetchParams.processResponse != null) { + queueMicrotask(() => fetchParams.processResponse(response)); + } + if (response.body == null) { + processResponseEndOfBody(); + } else { + const identityTransformAlgorithm = /* @__PURE__ */ __name((chunk, controller) => { + controller.enqueue(chunk); + }, "identityTransformAlgorithm"); + const transformStream = new TransformStream({ + start() { + }, + transform: identityTransformAlgorithm, + flush: processResponseEndOfBody + }); + response.body = { stream: response.body.stream.pipeThrough(transformStream) }; + } + if (fetchParams.processResponseConsumeBody != null) { + const processBody = /* @__PURE__ */ __name((nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes), "processBody"); + const processBodyError = /* @__PURE__ */ __name((failure) => fetchParams.processResponseConsumeBody(response, failure), "processBodyError"); + if (response.body == null) { + queueMicrotask(() => processBody(null)); + } else { + await fullyReadBody(response.body, processBody, processBodyError); + } + } + } + __name(fetchFinale, "fetchFinale"); + async function httpFetch(fetchParams) { + const request2 = fetchParams.request; + let response = null; + let actualResponse = null; + const timingInfo = fetchParams.timingInfo; + if (request2.serviceWorkers === "all") { + } + if (response === null) { + if (request2.redirect === "follow") { + request2.serviceWorkers = "none"; + } + actualResponse = response = await httpNetworkOrCacheFetch(fetchParams); + if (request2.responseTainting === "cors" && corsCheck(request2, response) === "failure") { + return makeNetworkError("cors failure"); + } + if (TAOCheck(request2, response) === "failure") { + request2.timingAllowFailed = true; + } + } + if ((request2.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck( + request2.origin, + request2.client, + request2.destination, + actualResponse + ) === "blocked") { + return makeNetworkError("blocked"); + } + if (redirectStatus.includes(actualResponse.status)) { + fetchParams.controller.connection.destroy(); + if (request2.redirect === "error") { + response = makeNetworkError("unexpected redirect"); + } else if (request2.redirect === "manual") { + response = actualResponse; + } else if (request2.redirect === "follow") { + response = await httpRedirectFetch(fetchParams, response); + } else { + assert(false); + } + } + response.timingInfo = timingInfo; + return response; + } + __name(httpFetch, "httpFetch"); + async function httpRedirectFetch(fetchParams, response) { + const request2 = fetchParams.request; + const actualResponse = response.internalResponse ? response.internalResponse : response; + let locationURL; + try { + locationURL = responseLocationURL( + actualResponse, + requestCurrentURL(request2).hash + ); + if (locationURL == null) { + return response; + } + } catch (err) { + return makeNetworkError(err); + } + if (!/^https?:/.test(locationURL.protocol)) { + return makeNetworkError("URL scheme must be a HTTP(S) scheme"); + } + if (request2.redirectCount === 20) { + return makeNetworkError("redirect count exceeded"); + } + request2.redirectCount += 1; + if (request2.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request2, locationURL)) { + return makeNetworkError('cross origin not allowed for request mode "cors"'); + } + if (request2.responseTainting === "cors" && (locationURL.username || locationURL.password)) { + return makeNetworkError( + 'URL cannot contain credentials for request mode "cors"' + ); + } + if (actualResponse.status !== 303 && request2.body != null && request2.body.source == null) { + return makeNetworkError(); + } + if ([301, 302].includes(actualResponse.status) && request2.method === "POST" || actualResponse.status === 303 && !["GET", "HEAD"].includes(request2.method)) { + request2.method = "GET"; + request2.body = null; + for (const headerName of requestBodyHeader) { + request2.headersList.delete(headerName); + } + } + if (request2.body != null) { + assert(request2.body.source); + request2.body = safelyExtractBody(request2.body.source)[0]; + } + const timingInfo = fetchParams.timingInfo; + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); + if (timingInfo.redirectStartTime === 0) { + timingInfo.redirectStartTime = timingInfo.startTime; + } + request2.urlList.push(locationURL); + setRequestReferrerPolicyOnRedirect(request2, actualResponse); + return mainFetch(fetchParams, true); + } + __name(httpRedirectFetch, "httpRedirectFetch"); + async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) { + const request2 = fetchParams.request; + let httpFetchParams = null; + let httpRequest = null; + let response = null; + const httpCache = null; + const revalidatingFlag = false; + if (request2.window === "no-window" && request2.redirect === "error") { + httpFetchParams = fetchParams; + httpRequest = request2; + } else { + httpRequest = makeRequest(request2); + httpFetchParams = { ...fetchParams }; + httpFetchParams.request = httpRequest; + } + const includeCredentials = request2.credentials === "include" || request2.credentials === "same-origin" && request2.responseTainting === "basic"; + const contentLength = httpRequest.body ? httpRequest.body.length : null; + let contentLengthHeaderValue = null; + if (httpRequest.body == null && ["POST", "PUT"].includes(httpRequest.method)) { + contentLengthHeaderValue = "0"; + } + if (contentLength != null) { + contentLengthHeaderValue = String(contentLength); + } + if (contentLengthHeaderValue != null) { + httpRequest.headersList.append("content-length", contentLengthHeaderValue); + } + if (contentLength != null && httpRequest.keepalive) { + } + if (httpRequest.referrer instanceof URL) { + httpRequest.headersList.append("referer", httpRequest.referrer.href); + } + appendRequestOriginHeader(httpRequest); + appendFetchMetadata(httpRequest); + if (!httpRequest.headersList.has("user-agent")) { + httpRequest.headersList.append("user-agent", "undici"); + } + if (httpRequest.cache === "default" && (httpRequest.headersList.has("if-modified-since") || httpRequest.headersList.has("if-none-match") || httpRequest.headersList.has("if-unmodified-since") || httpRequest.headersList.has("if-match") || httpRequest.headersList.has("if-range"))) { + httpRequest.cache = "no-store"; + } + if (httpRequest.cache === "no-cache" && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.has("cache-control")) { + httpRequest.headersList.append("cache-control", "max-age=0"); + } + if (httpRequest.cache === "no-store" || httpRequest.cache === "reload") { + if (!httpRequest.headersList.has("pragma")) { + httpRequest.headersList.append("pragma", "no-cache"); + } + if (!httpRequest.headersList.has("cache-control")) { + httpRequest.headersList.append("cache-control", "no-cache"); + } + } + if (httpRequest.headersList.has("range")) { + httpRequest.headersList.append("accept-encoding", "identity"); + } + if (!httpRequest.headersList.has("accept-encoding")) { + if (/^https:/.test(requestCurrentURL(httpRequest).protocol)) { + httpRequest.headersList.append("accept-encoding", "br, gzip, deflate"); + } else { + httpRequest.headersList.append("accept-encoding", "gzip, deflate"); + } + } + if (includeCredentials) { + } + if (httpCache == null) { + httpRequest.cache = "no-store"; + } + if (httpRequest.mode !== "no-store" && httpRequest.mode !== "reload") { + } + if (response == null) { + if (httpRequest.mode === "only-if-cached") { + return makeNetworkError("only if cached"); + } + const forwardResponse = await httpNetworkFetch( + httpFetchParams, + includeCredentials, + isNewConnectionFetch + ); + if (!safeMethods.includes(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) { + } + if (revalidatingFlag && forwardResponse.status === 304) { + } + if (response == null) { + response = forwardResponse; + } + } + response.urlList = [...httpRequest.urlList]; + if (httpRequest.headersList.has("range")) { + response.rangeRequested = true; + } + response.requestIncludesCredentials = includeCredentials; + if (response.status === 407) { + if (request2.window === "no-window") { + return makeNetworkError(); + } + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams); + } + return makeNetworkError("proxy authentication required"); + } + if (response.status === 421 && !isNewConnectionFetch && (request2.body == null || request2.body.source != null)) { + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams); + } + fetchParams.controller.connection.destroy(); + response = await httpNetworkOrCacheFetch( + fetchParams, + isAuthenticationFetch, + true + ); + } + if (isAuthenticationFetch) { + } + return response; + } + __name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch"); + async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { + assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); + fetchParams.controller.connection = { + abort: null, + destroyed: false, + destroy(err) { + var _a3; + if (!this.destroyed) { + this.destroyed = true; + (_a3 = this.abort) == null ? void 0 : _a3.call(this, err != null ? err : new DOMException("The operation was aborted.", "AbortError")); + } + } + }; + const request2 = fetchParams.request; + let response = null; + const timingInfo = fetchParams.timingInfo; + const httpCache = null; + if (httpCache == null) { + request2.cache = "no-store"; + } + const newConnection = forceNewConnection ? "yes" : "no"; + if (request2.mode === "websocket") { + } else { + } + let requestBody = null; + if (request2.body == null && fetchParams.processRequestEndOfBody) { + queueMicrotask(() => fetchParams.processRequestEndOfBody()); + } else if (request2.body != null) { + const processBodyChunk = /* @__PURE__ */ __name(async function* (bytes) { + var _a3; + if (isCancelled(fetchParams)) { + return; + } + yield bytes; + (_a3 = fetchParams.processRequestBodyChunkLength) == null ? void 0 : _a3.call(fetchParams, bytes.byteLength); + }, "processBodyChunk"); + const processEndOfBody = /* @__PURE__ */ __name(() => { + if (isCancelled(fetchParams)) { + return; + } + if (fetchParams.processRequestEndOfBody) { + fetchParams.processRequestEndOfBody(); + } + }, "processEndOfBody"); + const processBodyError = /* @__PURE__ */ __name((e) => { + if (isCancelled(fetchParams)) { + return; + } + if (e.name === "AbortError") { + fetchParams.controller.abort(); + } else { + fetchParams.controller.terminate(e); + } + }, "processBodyError"); + requestBody = async function* () { + try { + for await (const bytes of request2.body.stream) { + yield* processBodyChunk(bytes); + } + processEndOfBody(); + } catch (err) { + processBodyError(err); + } + }(); + } + try { + const { body, status, statusText, headersList } = await dispatch({ body: requestBody }); + const iterator = body[Symbol.asyncIterator](); + fetchParams.controller.next = () => iterator.next(); + response = makeResponse({ status, statusText, headersList }); + } catch (err) { + if (err.name === "AbortError") { + fetchParams.controller.connection.destroy(); + return makeAppropriateNetworkError(fetchParams); + } + return makeNetworkError(err); + } + const pullAlgorithm = /* @__PURE__ */ __name(() => { + fetchParams.controller.resume(); + }, "pullAlgorithm"); + const cancelAlgorithm = /* @__PURE__ */ __name(() => { + fetchParams.controller.abort(); + }, "cancelAlgorithm"); + if (!ReadableStream) { + ReadableStream = require("stream/web").ReadableStream; + } + const stream2 = new ReadableStream( + { + async start(controller) { + fetchParams.controller.controller = controller; + }, + async pull(controller) { + await pullAlgorithm(controller); + }, + async cancel(reason) { + await cancelAlgorithm(reason); + } + }, + { highWaterMark: 0 } + ); + response.body = { stream: stream2 }; + fetchParams.controller.on("terminated", onAborted); + fetchParams.controller.resume = async () => { + var _a3; + while (true) { + let bytes; + try { + const { done, value } = await fetchParams.controller.next(); + if (isAborted(fetchParams)) { + break; + } + bytes = done ? void 0 : value; + } catch (err) { + if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { + bytes = void 0; + } else { + bytes = err; + } + } + if (bytes === void 0) { + try { + fetchParams.controller.controller.close(); + } catch (err) { + if (!/Controller is already closed/.test(err)) { + throw err; + } + } + finalizeResponse(fetchParams, response); + return; + } + timingInfo.decodedBodySize += (_a3 = bytes == null ? void 0 : bytes.byteLength) != null ? _a3 : 0; + if (isErrorLike(bytes)) { + fetchParams.controller.terminate(bytes); + return; + } + fetchParams.controller.controller.enqueue(new Uint8Array(bytes)); + if (isErrored(stream2)) { + fetchParams.controller.terminate(); + return; + } + if (!fetchParams.controller.controller.desiredSize) { + return; + } + } + }; + function onAborted(reason) { + if (isAborted(fetchParams)) { + response.aborted = true; + if (isReadable(stream2)) { + fetchParams.controller.controller.error( + new DOMException("The operation was aborted.", "AbortError") + ); + } + } else { + if (isReadable(stream2)) { + fetchParams.controller.controller.error(new TypeError("terminated", { + cause: isErrorLike(reason) ? reason : void 0 + })); + } + } + fetchParams.controller.connection.destroy(); + } + __name(onAborted, "onAborted"); + return response; + async function dispatch({ body }) { + const url = requestCurrentURL(request2); + return new Promise((resolve, reject) => fetchParams.controller.dispatcher.dispatch( + { + path: url.pathname + url.search, + origin: url.origin, + method: request2.method, + body: fetchParams.controller.dispatcher.isMockActive ? request2.body && request2.body.source : body, + headers: [...request2.headersList].flat(), + maxRedirections: 0, + bodyTimeout: 3e5, + headersTimeout: 3e5 + }, + { + body: null, + abort: null, + onConnect(abort) { + const { connection } = fetchParams.controller; + if (connection.destroyed) { + abort(new DOMException("The operation was aborted.", "AbortError")); + } else { + fetchParams.controller.on("terminated", abort); + this.abort = connection.abort = abort; + } + }, + onHeaders(status, headersList, resume, statusText) { + if (status < 200) { + return; + } + let codings = []; + let location = ""; + const headers = new Headers(); + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); + if (key.toLowerCase() === "content-encoding") { + codings = val.split(",").map((x) => x.trim()); + } else if (key.toLowerCase() === "location") { + location = val; + } + headers.append(key, val); + } + this.body = new Readable({ read: resume }); + const decoders = []; + if (request2.method !== "HEAD" && request2.method !== "CONNECT" && !nullBodyStatus.includes(status) && !(request2.redirect === "follow" && location)) { + for (const coding of codings) { + if (/(x-)?gzip/.test(coding)) { + decoders.push(zlib.createGunzip()); + } else if (/(x-)?deflate/.test(coding)) { + decoders.push(zlib.createInflate()); + } else if (coding === "br") { + decoders.push(zlib.createBrotliDecompress()); + } else { + decoders.length = 0; + break; + } + } + } + resolve({ + status, + statusText, + headersList: headers[kHeadersList], + body: decoders.length ? pipeline(this.body, ...decoders, () => { + }) : this.body.on("error", () => { + }) + }); + return true; + }, + onData(chunk) { + if (fetchParams.controller.dump) { + return; + } + const bytes = chunk; + timingInfo.encodedBodySize += bytes.byteLength; + return this.body.push(bytes); + }, + onComplete() { + if (this.abort) { + fetchParams.controller.off("terminated", this.abort); + } + fetchParams.controller.ended = true; + this.body.push(null); + }, + onError(error2) { + var _a3; + if (this.abort) { + fetchParams.controller.off("terminated", this.abort); + } + (_a3 = this.body) == null ? void 0 : _a3.destroy(error2); + fetchParams.controller.terminate(error2); + reject(error2); + } + } + )); + } + __name(dispatch, "dispatch"); + } + __name(httpNetworkFetch, "httpNetworkFetch"); + module2.exports = fetch2; + } +}); + +// ../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/index.js +var require_undici = __commonJS({ + "../../node_modules/.pnpm/undici@5.10.0/node_modules/undici/index.js"(exports, module2) { + "use strict"; + var Client = require_client(); + var Dispatcher = require_dispatcher(); + var errors = require_errors(); + var Pool = require_pool(); + var BalancedPool = require_balanced_pool(); + var Agent = require_agent(); + var util2 = require_util2(); + var { InvalidArgumentError } = errors; + var api = require_api(); + var buildConnector = require_connect(); + var MockClient = require_mock_client(); + var MockAgent = require_mock_agent(); + var MockPool = require_mock_pool(); + var mockErrors = require_mock_errors(); + var ProxyAgent = require_proxy_agent(); + var { getGlobalDispatcher, setGlobalDispatcher } = require_global(); + var nodeVersion = process.versions.node.split("."); + var nodeMajor = Number(nodeVersion[0]); + var nodeMinor = Number(nodeVersion[1]); + Object.assign(Dispatcher.prototype, api); + module2.exports.Dispatcher = Dispatcher; + module2.exports.Client = Client; + module2.exports.Pool = Pool; + module2.exports.BalancedPool = BalancedPool; + module2.exports.Agent = Agent; + module2.exports.ProxyAgent = ProxyAgent; + module2.exports.buildConnector = buildConnector; + module2.exports.errors = errors; + function makeDispatcher(fn) { + return (url, opts, handler) => { + if (typeof opts === "function") { + handler = opts; + opts = null; + } + if (!url || typeof url !== "string" && typeof url !== "object" && !(url instanceof URL)) { + throw new InvalidArgumentError("invalid url"); + } + if (opts != null && typeof opts !== "object") { + throw new InvalidArgumentError("invalid opts"); + } + if (opts && opts.path != null) { + if (typeof opts.path !== "string") { + throw new InvalidArgumentError("invalid opts.path"); + } + let path7 = opts.path; + if (!opts.path.startsWith("/")) { + path7 = `/${path7}`; + } + url = new URL(util2.parseOrigin(url).origin + path7); + } else { + if (!opts) { + opts = typeof url === "object" ? url : {}; + } + url = util2.parseURL(url); + } + const { agent, dispatcher = getGlobalDispatcher() } = opts; + if (agent) { + throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?"); + } + return fn.call(dispatcher, { + ...opts, + origin: url.origin, + path: url.search ? `${url.pathname}${url.search}` : url.pathname, + method: opts.method || (opts.body ? "PUT" : "GET") + }, handler); + }; + } + __name(makeDispatcher, "makeDispatcher"); + module2.exports.setGlobalDispatcher = setGlobalDispatcher; + module2.exports.getGlobalDispatcher = getGlobalDispatcher; + if (nodeMajor > 16 || nodeMajor === 16 && nodeMinor >= 8) { + let fetchImpl = null; + module2.exports.fetch = /* @__PURE__ */ __name(async function fetch2(resource) { + if (!fetchImpl) { + fetchImpl = require_fetch(); + } + const dispatcher = arguments[1] && arguments[1].dispatcher || getGlobalDispatcher(); + return fetchImpl.apply(dispatcher, arguments); + }, "fetch"); + module2.exports.Headers = require_headers().Headers; + module2.exports.Response = require_response().Response; + module2.exports.Request = require_request2().Request; + module2.exports.FormData = require_formdata().FormData; + module2.exports.File = require_file().File; + } + module2.exports.request = makeDispatcher(api.request); + module2.exports.stream = makeDispatcher(api.stream); + module2.exports.pipeline = makeDispatcher(api.pipeline); + module2.exports.connect = makeDispatcher(api.connect); + module2.exports.upgrade = makeDispatcher(api.upgrade); + module2.exports.MockClient = MockClient; + module2.exports.MockPool = MockPool; + module2.exports.MockAgent = MockAgent; + module2.exports.mockErrors = mockErrors; + } +}); + +// ../../node_modules/.pnpm/dotenv@16.0.1/node_modules/dotenv/lib/main.js +var require_main2 = __commonJS({ + "../../node_modules/.pnpm/dotenv@16.0.1/node_modules/dotenv/lib/main.js"(exports, module2) { + var fs11 = require("fs"); + var path7 = require("path"); + var os3 = require("os"); + var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg; + function parse2(src) { + const obj = {}; + let lines = src.toString(); + lines = lines.replace(/\r\n?/mg, "\n"); + let match; + while ((match = LINE.exec(lines)) != null) { + const key = match[1]; + let value = match[2] || ""; + value = value.trim(); + const maybeQuote = value[0]; + value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"); + if (maybeQuote === '"') { + value = value.replace(/\\n/g, "\n"); + value = value.replace(/\\r/g, "\r"); + } + obj[key] = value; + } + return obj; + } + __name(parse2, "parse"); + function _log(message) { + console.log(`[dotenv][DEBUG] ${message}`); + } + __name(_log, "_log"); + function _resolveHome(envPath) { + return envPath[0] === "~" ? path7.join(os3.homedir(), envPath.slice(1)) : envPath; + } + __name(_resolveHome, "_resolveHome"); + function config2(options) { + let dotenvPath = path7.resolve(process.cwd(), ".env"); + let encoding = "utf8"; + const debug13 = Boolean(options && options.debug); + const override = Boolean(options && options.override); + if (options) { + if (options.path != null) { + dotenvPath = _resolveHome(options.path); + } + if (options.encoding != null) { + encoding = options.encoding; + } + } + try { + const parsed = DotenvModule.parse(fs11.readFileSync(dotenvPath, { encoding })); + Object.keys(parsed).forEach(function(key) { + if (!Object.prototype.hasOwnProperty.call(process.env, key)) { + process.env[key] = parsed[key]; + } else { + if (override === true) { + process.env[key] = parsed[key]; + } + if (debug13) { + if (override === true) { + _log(`"${key}" is already defined in \`process.env\` and WAS overwritten`); + } else { + _log(`"${key}" is already defined in \`process.env\` and was NOT overwritten`); + } + } + } + }); + return { parsed }; + } catch (e) { + if (debug13) { + _log(`Failed to load ${dotenvPath} ${e.message}`); + } + return { error: e }; + } + } + __name(config2, "config"); + var DotenvModule = { + config: config2, + parse: parse2 + }; + module2.exports.config = DotenvModule.config; + module2.exports.parse = DotenvModule.parse; + module2.exports = DotenvModule; + } +}); + +// ../../node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.js +var require_arg = __commonJS({ + "../../node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.js"(exports, module2) { + var flagSymbol = Symbol("arg flag"); + var ArgError = class extends Error { + constructor(msg, code) { + super(msg); + this.name = "ArgError"; + this.code = code; + Object.setPrototypeOf(this, ArgError.prototype); + } + }; + __name(ArgError, "ArgError"); + function arg2(opts, { + argv = process.argv.slice(2), + permissive = false, + stopAtPositional = false + } = {}) { + if (!opts) { + throw new ArgError( + "argument specification object is required", + "ARG_CONFIG_NO_SPEC" + ); + } + const result = { _: [] }; + const aliases = {}; + const handlers = {}; + for (const key of Object.keys(opts)) { + if (!key) { + throw new ArgError( + "argument key cannot be an empty string", + "ARG_CONFIG_EMPTY_KEY" + ); + } + if (key[0] !== "-") { + throw new ArgError( + `argument key must start with '-' but found: '${key}'`, + "ARG_CONFIG_NONOPT_KEY" + ); + } + if (key.length === 1) { + throw new ArgError( + `argument key must have a name; singular '-' keys are not allowed: ${key}`, + "ARG_CONFIG_NONAME_KEY" + ); + } + if (typeof opts[key] === "string") { + aliases[key] = opts[key]; + continue; + } + let type = opts[key]; + let isFlag = false; + if (Array.isArray(type) && type.length === 1 && typeof type[0] === "function") { + const [fn] = type; + type = /* @__PURE__ */ __name((value, name, prev = []) => { + prev.push(fn(value, name, prev[prev.length - 1])); + return prev; + }, "type"); + isFlag = fn === Boolean || fn[flagSymbol] === true; + } else if (typeof type === "function") { + isFlag = type === Boolean || type[flagSymbol] === true; + } else { + throw new ArgError( + `type missing or not a function or valid array type: ${key}`, + "ARG_CONFIG_VAD_TYPE" + ); + } + if (key[1] !== "-" && key.length > 2) { + throw new ArgError( + `short argument keys (with a single hyphen) must have only one character: ${key}`, + "ARG_CONFIG_SHORTOPT_TOOLONG" + ); + } + handlers[key] = [type, isFlag]; + } + for (let i = 0, len = argv.length; i < len; i++) { + const wholeArg = argv[i]; + if (stopAtPositional && result._.length > 0) { + result._ = result._.concat(argv.slice(i)); + break; + } + if (wholeArg === "--") { + result._ = result._.concat(argv.slice(i + 1)); + break; + } + if (wholeArg.length > 1 && wholeArg[0] === "-") { + const separatedArguments = wholeArg[1] === "-" || wholeArg.length === 2 ? [wholeArg] : wholeArg.slice(1).split("").map((a) => `-${a}`); + for (let j = 0; j < separatedArguments.length; j++) { + const arg3 = separatedArguments[j]; + const [originalArgName, argStr] = arg3[1] === "-" ? arg3.split(/=(.*)/, 2) : [arg3, void 0]; + let argName = originalArgName; + while (argName in aliases) { + argName = aliases[argName]; + } + if (!(argName in handlers)) { + if (permissive) { + result._.push(arg3); + continue; + } else { + throw new ArgError( + `unknown or unexpected option: ${originalArgName}`, + "ARG_UNKNOWN_OPTION" + ); + } + } + const [type, isFlag] = handlers[argName]; + if (!isFlag && j + 1 < separatedArguments.length) { + throw new ArgError( + `option requires argument (but was followed by another short argument): ${originalArgName}`, + "ARG_MISSING_REQUIRED_SHORTARG" + ); + } + if (isFlag) { + result[argName] = type(true, argName, result[argName]); + } else if (argStr === void 0) { + if (argv.length < i + 2 || argv[i + 1].length > 1 && argv[i + 1][0] === "-" && !(argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && (type === Number || typeof BigInt !== "undefined" && type === BigInt))) { + const extended = originalArgName === argName ? "" : ` (alias for ${argName})`; + throw new ArgError( + `option requires argument: ${originalArgName}${extended}`, + "ARG_MISSING_REQUIRED_LONGARG" + ); + } + result[argName] = type(argv[i + 1], argName, result[argName]); + ++i; + } else { + result[argName] = type(argStr, argName, result[argName]); + } + } + } else { + result._.push(wholeArg); + } + } + return result; + } + __name(arg2, "arg"); + arg2.flag = (fn) => { + fn[flagSymbol] = true; + return fn; + }; + arg2.COUNT = arg2.flag((v, name, existingCount) => (existingCount || 0) + 1); + arg2.ArgError = ArgError; + module2.exports = arg2; + } +}); + +// ../../node_modules/.pnpm/min-indent@1.0.1/node_modules/min-indent/index.js +var require_min_indent = __commonJS({ + "../../node_modules/.pnpm/min-indent@1.0.1/node_modules/min-indent/index.js"(exports, module2) { + "use strict"; + module2.exports = (string) => { + const match = string.match(/^[ \t]*(?=\S)/gm); + if (!match) { + return 0; + } + return match.reduce((r, a) => Math.min(r, a.length), Infinity); + }; + } +}); + +// ../../node_modules/.pnpm/strip-indent@3.0.0/node_modules/strip-indent/index.js +var require_strip_indent = __commonJS({ + "../../node_modules/.pnpm/strip-indent@3.0.0/node_modules/strip-indent/index.js"(exports, module2) { + "use strict"; + var minIndent = require_min_indent(); + module2.exports = (string) => { + const indent4 = minIndent(string); + if (indent4 === 0) { + return string; + } + const regex = new RegExp(`^[ \\t]{${indent4}}`, "gm"); + return string.replace(regex, ""); + }; + } +}); + +// ../../node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js +var require_pluralize = __commonJS({ + "../../node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js"(exports, module2) { + (function(root, pluralize2) { + if (typeof require === "function" && typeof exports === "object" && typeof module2 === "object") { + module2.exports = pluralize2(); + } else if (typeof define === "function" && false) { + define(function() { + return pluralize2(); + }); + } else { + root.pluralize = pluralize2(); + } + })(exports, function() { + var pluralRules = []; + var singularRules = []; + var uncountables = {}; + var irregularPlurals = {}; + var irregularSingles = {}; + function sanitizeRule(rule) { + if (typeof rule === "string") { + return new RegExp("^" + rule + "$", "i"); + } + return rule; + } + __name(sanitizeRule, "sanitizeRule"); + function restoreCase(word, token) { + if (word === token) + return token; + if (word === word.toLowerCase()) + return token.toLowerCase(); + if (word === word.toUpperCase()) + return token.toUpperCase(); + if (word[0] === word[0].toUpperCase()) { + return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase(); + } + return token.toLowerCase(); + } + __name(restoreCase, "restoreCase"); + function interpolate(str, args) { + return str.replace(/\$(\d{1,2})/g, function(match, index) { + return args[index] || ""; + }); + } + __name(interpolate, "interpolate"); + function replace(word, rule) { + return word.replace(rule[0], function(match, index) { + var result = interpolate(rule[1], arguments); + if (match === "") { + return restoreCase(word[index - 1], result); + } + return restoreCase(match, result); + }); + } + __name(replace, "replace"); + function sanitizeWord(token, word, rules) { + if (!token.length || uncountables.hasOwnProperty(token)) { + return word; + } + var len = rules.length; + while (len--) { + var rule = rules[len]; + if (rule[0].test(word)) + return replace(word, rule); + } + return word; + } + __name(sanitizeWord, "sanitizeWord"); + function replaceWord(replaceMap, keepMap, rules) { + return function(word) { + var token = word.toLowerCase(); + if (keepMap.hasOwnProperty(token)) { + return restoreCase(word, token); + } + if (replaceMap.hasOwnProperty(token)) { + return restoreCase(word, replaceMap[token]); + } + return sanitizeWord(token, word, rules); + }; + } + __name(replaceWord, "replaceWord"); + function checkWord(replaceMap, keepMap, rules, bool) { + return function(word) { + var token = word.toLowerCase(); + if (keepMap.hasOwnProperty(token)) + return true; + if (replaceMap.hasOwnProperty(token)) + return false; + return sanitizeWord(token, token, rules) === token; + }; + } + __name(checkWord, "checkWord"); + function pluralize2(word, count2, inclusive) { + var pluralized = count2 === 1 ? pluralize2.singular(word) : pluralize2.plural(word); + return (inclusive ? count2 + " " : "") + pluralized; + } + __name(pluralize2, "pluralize"); + pluralize2.plural = replaceWord( + irregularSingles, + irregularPlurals, + pluralRules + ); + pluralize2.isPlural = checkWord( + irregularSingles, + irregularPlurals, + pluralRules + ); + pluralize2.singular = replaceWord( + irregularPlurals, + irregularSingles, + singularRules + ); + pluralize2.isSingular = checkWord( + irregularPlurals, + irregularSingles, + singularRules + ); + pluralize2.addPluralRule = function(rule, replacement) { + pluralRules.push([sanitizeRule(rule), replacement]); + }; + pluralize2.addSingularRule = function(rule, replacement) { + singularRules.push([sanitizeRule(rule), replacement]); + }; + pluralize2.addUncountableRule = function(word) { + if (typeof word === "string") { + uncountables[word.toLowerCase()] = true; + return; + } + pluralize2.addPluralRule(word, "$0"); + pluralize2.addSingularRule(word, "$0"); + }; + pluralize2.addIrregularRule = function(single, plural) { + plural = plural.toLowerCase(); + single = single.toLowerCase(); + irregularSingles[single] = plural; + irregularPlurals[plural] = single; + }; + [ + ["I", "we"], + ["me", "us"], + ["he", "they"], + ["she", "they"], + ["them", "them"], + ["myself", "ourselves"], + ["yourself", "yourselves"], + ["itself", "themselves"], + ["herself", "themselves"], + ["himself", "themselves"], + ["themself", "themselves"], + ["is", "are"], + ["was", "were"], + ["has", "have"], + ["this", "these"], + ["that", "those"], + ["echo", "echoes"], + ["dingo", "dingoes"], + ["volcano", "volcanoes"], + ["tornado", "tornadoes"], + ["torpedo", "torpedoes"], + ["genus", "genera"], + ["viscus", "viscera"], + ["stigma", "stigmata"], + ["stoma", "stomata"], + ["dogma", "dogmata"], + ["lemma", "lemmata"], + ["schema", "schemata"], + ["anathema", "anathemata"], + ["ox", "oxen"], + ["axe", "axes"], + ["die", "dice"], + ["yes", "yeses"], + ["foot", "feet"], + ["eave", "eaves"], + ["goose", "geese"], + ["tooth", "teeth"], + ["quiz", "quizzes"], + ["human", "humans"], + ["proof", "proofs"], + ["carve", "carves"], + ["valve", "valves"], + ["looey", "looies"], + ["thief", "thieves"], + ["groove", "grooves"], + ["pickaxe", "pickaxes"], + ["passerby", "passersby"] + ].forEach(function(rule) { + return pluralize2.addIrregularRule(rule[0], rule[1]); + }); + [ + [/s?$/i, "s"], + [/[^\u0000-\u007F]$/i, "$0"], + [/([^aeiou]ese)$/i, "$1"], + [/(ax|test)is$/i, "$1es"], + [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"], + [/(e[mn]u)s?$/i, "$1s"], + [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"], + [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"], + [/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"], + [/(seraph|cherub)(?:im)?$/i, "$1im"], + [/(her|at|gr)o$/i, "$1oes"], + [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"], + [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"], + [/sis$/i, "ses"], + [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"], + [/([^aeiouy]|qu)y$/i, "$1ies"], + [/([^ch][ieo][ln])ey$/i, "$1ies"], + [/(x|ch|ss|sh|zz)$/i, "$1es"], + [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"], + [/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"], + [/(pe)(?:rson|ople)$/i, "$1ople"], + [/(child)(?:ren)?$/i, "$1ren"], + [/eaux$/i, "$0"], + [/m[ae]n$/i, "men"], + ["thou", "you"] + ].forEach(function(rule) { + return pluralize2.addPluralRule(rule[0], rule[1]); + }); + [ + [/s$/i, ""], + [/(ss)$/i, "$1"], + [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"], + [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"], + [/ies$/i, "y"], + [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"], + [/\b(mon|smil)ies$/i, "$1ey"], + [/\b((?:tit)?m|l)ice$/i, "$1ouse"], + [/(seraph|cherub)im$/i, "$1"], + [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"], + [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"], + [/(movie|twelve|abuse|e[mn]u)s$/i, "$1"], + [/(test)(?:is|es)$/i, "$1is"], + [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"], + [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"], + [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"], + [/(alumn|alg|vertebr)ae$/i, "$1a"], + [/(cod|mur|sil|vert|ind)ices$/i, "$1ex"], + [/(matr|append)ices$/i, "$1ix"], + [/(pe)(rson|ople)$/i, "$1rson"], + [/(child)ren$/i, "$1"], + [/(eau)x?$/i, "$1"], + [/men$/i, "man"] + ].forEach(function(rule) { + return pluralize2.addSingularRule(rule[0], rule[1]); + }); + [ + "adulthood", + "advice", + "agenda", + "aid", + "aircraft", + "alcohol", + "ammo", + "analytics", + "anime", + "athletics", + "audio", + "bison", + "blood", + "bream", + "buffalo", + "butter", + "carp", + "cash", + "chassis", + "chess", + "clothing", + "cod", + "commerce", + "cooperation", + "corps", + "debris", + "diabetes", + "digestion", + "elk", + "energy", + "equipment", + "excretion", + "expertise", + "firmware", + "flounder", + "fun", + "gallows", + "garbage", + "graffiti", + "hardware", + "headquarters", + "health", + "herpes", + "highjinks", + "homework", + "housework", + "information", + "jeans", + "justice", + "kudos", + "labour", + "literature", + "machinery", + "mackerel", + "mail", + "media", + "mews", + "moose", + "music", + "mud", + "manga", + "news", + "only", + "personnel", + "pike", + "plankton", + "pliers", + "police", + "pollution", + "premises", + "rain", + "research", + "rice", + "salmon", + "scissors", + "series", + "sewage", + "shambles", + "shrimp", + "software", + "species", + "staff", + "swine", + "tennis", + "traffic", + "transportation", + "trout", + "tuna", + "wealth", + "welfare", + "whiting", + "wildebeest", + "wildlife", + "you", + /pok[eé]mon$/i, + /[^aeiou]ese$/i, + /deer$/i, + /fish$/i, + /measles$/i, + /o[iu]s$/i, + /pox$/i, + /sheep$/i + ].forEach(pluralize2.addUncountableRule); + return pluralize2; + }); + } +}); + +// ../../node_modules/.pnpm/is-regexp@2.1.0/node_modules/is-regexp/index.js +var require_is_regexp = __commonJS({ + "../../node_modules/.pnpm/is-regexp@2.1.0/node_modules/is-regexp/index.js"(exports, module2) { + "use strict"; + module2.exports = (input) => Object.prototype.toString.call(input) === "[object RegExp]"; + } +}); + +// ../../node_modules/.pnpm/is-obj@2.0.0/node_modules/is-obj/index.js +var require_is_obj = __commonJS({ + "../../node_modules/.pnpm/is-obj@2.0.0/node_modules/is-obj/index.js"(exports, module2) { + "use strict"; + module2.exports = (value) => { + const type = typeof value; + return value !== null && (type === "object" || type === "function"); + }; + } +}); + +// ../../node_modules/.pnpm/get-own-enumerable-property-symbols@3.0.2/node_modules/get-own-enumerable-property-symbols/lib/index.js +var require_lib = __commonJS({ + "../../node_modules/.pnpm/get-own-enumerable-property-symbols@3.0.2/node_modules/get-own-enumerable-property-symbols/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = (object) => Object.getOwnPropertySymbols(object).filter((keySymbol) => Object.prototype.propertyIsEnumerable.call(object, keySymbol)); + } +}); + +// package.json +var require_package2 = __commonJS({ + "package.json"(exports, module2) { + module2.exports = { + name: "@prisma/client", + version: "4.3.1", + description: "Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports MySQL, PostgreSQL, MariaDB, SQLite databases.", + keywords: [ + "orm", + "prisma2", + "prisma", + "client", + "query", + "database", + "sql", + "postgres", + "postgresql", + "mysql", + "sqlite", + "mariadb", + "mssql", + "typescript", + "query-builder" + ], + main: "index.js", + browser: "index-browser.js", + types: "index.d.ts", + license: "Apache-2.0", + engines: { + node: ">=14.17" + }, + homepage: "https://www.prisma.io", + repository: { + type: "git", + url: "https://github.com/prisma/prisma.git", + directory: "packages/client" + }, + author: "Tim Suchanek ", + bugs: "https://github.com/prisma/prisma/issues", + scripts: { + dev: "DEV=true node -r esbuild-register helpers/build.ts", + build: "node -r esbuild-register helpers/build.ts", + test: "jest --verbose", + "test:functional": "node -r esbuild-register helpers/functional-test/run-tests.ts", + "test:memory": "node -r esbuild-register helpers/memory-tests.ts", + "test:functional:code": "node -r esbuild-register helpers/functional-test/run-tests.ts --no-types", + "test:functional:types": "node -r esbuild-register helpers/functional-test/run-tests.ts --types-only", + "test-notypes": "jest --verbose --testPathIgnorePatterns src/__tests__/types/types.test.ts", + generate: "node scripts/postinstall.js", + postinstall: "node scripts/postinstall.js", + prepublishOnly: "pnpm run build", + "new-test": "NODE_OPTIONS='-r ts-node/register' yo ./helpers/generator-test/index.ts" + }, + files: [ + "README.md", + "runtime", + "scripts", + "generator-build", + "edge.js", + "edge.d.ts", + "index.js", + "index.d.ts", + "index-browser.js" + ], + devDependencies: { + "@faker-js/faker": "7.4.0", + "@jest/test-sequencer": "28.1.3", + "@microsoft/api-extractor": "7.29.5", + "@opentelemetry/api": "1.1.0", + "@opentelemetry/context-async-hooks": "1.5.0", + "@opentelemetry/instrumentation": "0.31.0", + "@opentelemetry/resources": "1.5.0", + "@opentelemetry/sdk-trace-base": "1.5.0", + "@opentelemetry/semantic-conventions": "1.5.0", + "@prisma/debug": "workspace:4.3.1", + "@prisma/engine-core": "workspace:4.3.1", + "@prisma/engines": "workspace:4.3.1", + "@prisma/fetch-engine": "workspace:4.3.1", + "@prisma/generator-helper": "workspace:4.3.1", + "@prisma/get-platform": "workspace:4.3.1", + "@prisma/instrumentation": "workspace:4.3.1", + "@prisma/internals": "workspace:4.3.1", + "@prisma/migrate": "workspace:4.3.1", + "@swc-node/register": "1.5.1", + "@swc/core": "1.2.242", + "@swc/jest": "0.2.22", + "@timsuchanek/copy": "1.4.5", + "@types/debug": "4.1.7", + "@types/jest": "28.1.7", + "@types/js-levenshtein": "1.1.1", + "@types/mssql": "8.1.1", + "@types/node": "14.18.26", + "@types/pg": "8.6.5", + "@types/yeoman-generator": "5.2.11", + arg: "5.0.2", + benchmark: "2.1.4", + chalk: "4.1.2", + cuid: "2.1.8", + "decimal.js": "10.4.0", + esbuild: "0.15.5", + execa: "5.1.1", + "expect-type": "0.13.0", + "flat-map-polyfill": "0.3.8", + "fs-extra": "10.1.0", + "fs-monkey": "1.0.3", + "get-own-enumerable-property-symbols": "3.0.2", + globby: "11.1.0", + "indent-string": "4.0.0", + "is-obj": "2.0.0", + "is-regexp": "2.1.0", + jest: "28.1.3", + "jest-junit": "14.0.0", + "jest-snapshot": "28.1.3", + "js-levenshtein": "1.1.6", + klona: "2.0.5", + "lz-string": "1.4.4", + "make-dir": "3.1.0", + mariadb: "3.0.1", + memfs: "3.4.7", + mssql: "9.0.1", + pg: "8.8.0", + "pkg-up": "3.1.0", + pluralize: "8.0.0", + "replace-string": "3.1.0", + resolve: "1.22.1", + rimraf: "3.0.2", + "simple-statistics": "7.7.6", + "sort-keys": "4.2.0", + "source-map-support": "0.5.21", + "sql-template-tag": "5.0.3", + "stacktrace-parser": "0.1.10", + "strip-ansi": "6.0.1", + "strip-indent": "3.0.0", + "ts-jest": "28.0.8", + "ts-node": "10.9.1", + tsd: "0.21.0", + typescript: "4.8.2", + "yeoman-generator": "5.7.0", + yo: "4.3.0" + }, + peerDependencies: { + prisma: "*" + }, + peerDependenciesMeta: { + prisma: { + optional: true + } + }, + dependencies: { + "@prisma/engines-version": "4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b" + }, + sideEffects: false + }; + } +}); + +// src/runtime/index.ts +var runtime_exports = {}; +__export(runtime_exports, { + DMMF: () => DMMF, + DMMFClass: () => DMMFHelper, + Debug: () => Debug, + Decimal: () => decimal_default, + Engine: () => Engine, + MetricsClient: () => MetricsClient, + NotFoundError: () => NotFoundError2, + PrismaClientInitializationError: () => PrismaClientInitializationError, + PrismaClientKnownRequestError: () => PrismaClientKnownRequestError, + PrismaClientRustPanicError: () => PrismaClientRustPanicError, + PrismaClientUnknownRequestError: () => PrismaClientUnknownRequestError, + PrismaClientValidationError: () => PrismaClientValidationError, + Sql: () => Sql, + decompressFromBase64: () => decompressFromBase642, + empty: () => empty, + findSync: () => findSync, + getPrismaClient: () => getPrismaClient, + join: () => join, + makeDocument: () => makeDocument, + makeStrictEnum: () => makeStrictEnum, + objectEnumValues: () => objectEnumValues, + raw: () => raw, + sqltag: () => sql, + transformDocument: () => transformDocument, + unpack: () => unpack, + warnEnvConflicts: () => warnEnvConflicts +}); +module.exports = __toCommonJS(runtime_exports); +var lzString = __toESM(require_lz_string()); + +// src/runtime/core/metrics/MetricsClient.ts +var MetricsClient = class { + constructor(engine) { + this._engine = engine; + } + prometheus(options) { + return this._engine.metrics({ format: "prometheus", ...options }); + } + json(options) { + return this._engine.metrics({ format: "json", ...options }); + } +}; +__name(MetricsClient, "MetricsClient"); + +// src/runtime/utils/applyMixins.ts +function applyMixins(derivedCtor, constructors) { + var _a3; + for (const baseCtor of constructors) { + for (const name of Object.getOwnPropertyNames(baseCtor.prototype)) { + Object.defineProperty( + derivedCtor.prototype, + name, + (_a3 = Object.getOwnPropertyDescriptor(baseCtor.prototype, name)) != null ? _a3 : /* @__PURE__ */ Object.create(null) + ); + } + } +} +__name(applyMixins, "applyMixins"); + +// src/runtime/utils/common.ts +var import_chalk = __toESM(require_source()); + +// ../../node_modules/.pnpm/decimal.js@10.4.0/node_modules/decimal.js/decimal.mjs +var EXP_LIMIT = 9e15; +var MAX_DIGITS = 1e9; +var NUMERALS = "0123456789abcdef"; +var LN10 = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058"; +var PI = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789"; +var DEFAULTS = { + precision: 20, + rounding: 4, + modulo: 1, + toExpNeg: -7, + toExpPos: 21, + minE: -EXP_LIMIT, + maxE: EXP_LIMIT, + crypto: false +}; +var inexact; +var quadrant; +var external = true; +var decimalError = "[DecimalError] "; +var invalidArgument = decimalError + "Invalid argument: "; +var precisionLimitExceeded = decimalError + "Precision limit exceeded"; +var cryptoUnavailable = decimalError + "crypto unavailable"; +var tag = "[object Decimal]"; +var mathfloor = Math.floor; +var mathpow = Math.pow; +var isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i; +var isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i; +var isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i; +var isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; +var BASE = 1e7; +var LOG_BASE = 7; +var MAX_SAFE_INTEGER = 9007199254740991; +var LN10_PRECISION = LN10.length - 1; +var PI_PRECISION = PI.length - 1; +var P = { toStringTag: tag }; +P.absoluteValue = P.abs = function() { + var x = new this.constructor(this); + if (x.s < 0) + x.s = 1; + return finalise(x); +}; +P.ceil = function() { + return finalise(new this.constructor(this), this.e + 1, 2); +}; +P.clampedTo = P.clamp = function(min2, max2) { + var k, x = this, Ctor = x.constructor; + min2 = new Ctor(min2); + max2 = new Ctor(max2); + if (!min2.s || !max2.s) + return new Ctor(NaN); + if (min2.gt(max2)) + throw Error(invalidArgument + max2); + k = x.cmp(min2); + return k < 0 ? min2 : x.cmp(max2) > 0 ? max2 : new Ctor(x); +}; +P.comparedTo = P.cmp = function(y) { + var i, j, xdL, ydL, x = this, xd = x.d, yd = (y = new x.constructor(y)).d, xs = x.s, ys = y.s; + if (!xd || !yd) { + return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1; + } + if (!xd[0] || !yd[0]) + return xd[0] ? xs : yd[0] ? -ys : 0; + if (xs !== ys) + return xs; + if (x.e !== y.e) + return x.e > y.e ^ xs < 0 ? 1 : -1; + xdL = xd.length; + ydL = yd.length; + for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) { + if (xd[i] !== yd[i]) + return xd[i] > yd[i] ^ xs < 0 ? 1 : -1; + } + return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1; +}; +P.cosine = P.cos = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.d) + return new Ctor(NaN); + if (!x.d[0]) + return new Ctor(1); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + x = cosine(Ctor, toLessThanHalfPi(Ctor, x)); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true); +}; +P.cubeRoot = P.cbrt = function() { + var e, m, n, r, rep, s, sd, t, t3, t3plusx, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + external = false; + s = x.s * mathpow(x.s * x, 1 / 3); + if (!s || Math.abs(s) == 1 / 0) { + n = digitsToString(x.d); + e = x.e; + if (s = (e - n.length + 1) % 3) + n += s == 1 || s == -2 ? "0" : "00"; + s = mathpow(n, 1 / 3); + e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)); + if (s == 1 / 0) { + n = "5e" + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf("e") + 1) + e; + } + r = new Ctor(n); + r.s = x.s; + } else { + r = new Ctor(s.toString()); + } + sd = (e = Ctor.precision) + 3; + for (; ; ) { + t = r; + t3 = t.times(t).times(t); + t3plusx = t3.plus(x); + r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1); + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + if (n == "9999" || !rep && n == "4999") { + if (!rep) { + finalise(t, e + 1, 0); + if (t.times(t).times(t).eq(x)) { + r = t; + break; + } + } + sd += 4; + rep = 1; + } else { + if (!+n || !+n.slice(1) && n.charAt(0) == "5") { + finalise(r, e + 1, 1); + m = !r.times(r).times(r).eq(x); + } + break; + } + } + } + external = true; + return finalise(r, e, Ctor.rounding, m); +}; +P.decimalPlaces = P.dp = function() { + var w, d = this.d, n = NaN; + if (d) { + w = d.length - 1; + n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE; + w = d[w]; + if (w) + for (; w % 10 == 0; w /= 10) + n--; + if (n < 0) + n = 0; + } + return n; +}; +P.dividedBy = P.div = function(y) { + return divide(this, new this.constructor(y)); +}; +P.dividedToIntegerBy = P.divToInt = function(y) { + var x = this, Ctor = x.constructor; + return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding); +}; +P.equals = P.eq = function(y) { + return this.cmp(y) === 0; +}; +P.floor = function() { + return finalise(new this.constructor(this), this.e + 1, 3); +}; +P.greaterThan = P.gt = function(y) { + return this.cmp(y) > 0; +}; +P.greaterThanOrEqualTo = P.gte = function(y) { + var k = this.cmp(y); + return k == 1 || k === 0; +}; +P.hyperbolicCosine = P.cosh = function() { + var k, n, pr, rm, len, x = this, Ctor = x.constructor, one = new Ctor(1); + if (!x.isFinite()) + return new Ctor(x.s ? 1 / 0 : NaN); + if (x.isZero()) + return one; + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + if (len < 32) { + k = Math.ceil(len / 3); + n = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + n = "2.3283064365386962890625e-10"; + } + x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true); + var cosh2_x, i = k, d8 = new Ctor(8); + for (; i--; ) { + cosh2_x = x.times(x); + x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8)))); + } + return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true); +}; +P.hyperbolicSine = P.sinh = function() { + var k, pr, rm, len, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + 4; + Ctor.rounding = 1; + len = x.d.length; + if (len < 3) { + x = taylorSeries(Ctor, 2, x, x, true); + } else { + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x, true); + var sinh2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); + for (; k--; ) { + sinh2_x = x.times(x); + x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20)))); + } + } + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(x, pr, rm, true); +}; +P.hyperbolicTangent = P.tanh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(x.s); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 7; + Ctor.rounding = 1; + return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm); +}; +P.inverseCosine = P.acos = function() { + var halfPi, x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding; + if (k !== -1) { + return k === 0 ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN); + } + if (x.isZero()) + return getPi(Ctor, pr + 4, rm).times(0.5); + Ctor.precision = pr + 6; + Ctor.rounding = 1; + x = x.asin(); + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + Ctor.precision = pr; + Ctor.rounding = rm; + return halfPi.minus(x); +}; +P.inverseHyperbolicCosine = P.acosh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (x.lte(1)) + return new Ctor(x.eq(1) ? 0 : NaN); + if (!x.isFinite()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4; + Ctor.rounding = 1; + external = false; + x = x.times(x).minus(1).sqrt().plus(x); + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + return x.ln(); +}; +P.inverseHyperbolicSine = P.asinh = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite() || x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6; + Ctor.rounding = 1; + external = false; + x = x.times(x).plus(1).sqrt().plus(x); + external = true; + Ctor.precision = pr; + Ctor.rounding = rm; + return x.ln(); +}; +P.inverseHyperbolicTangent = P.atanh = function() { + var pr, rm, wpr, xsd, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.e >= 0) + return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN); + pr = Ctor.precision; + rm = Ctor.rounding; + xsd = x.sd(); + if (Math.max(xsd, pr) < 2 * -x.e - 1) + return finalise(new Ctor(x), pr, rm, true); + Ctor.precision = wpr = xsd - x.e; + x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1); + Ctor.precision = pr + 4; + Ctor.rounding = 1; + x = x.ln(); + Ctor.precision = pr; + Ctor.rounding = rm; + return x.times(0.5); +}; +P.inverseSine = P.asin = function() { + var halfPi, k, pr, rm, x = this, Ctor = x.constructor; + if (x.isZero()) + return new Ctor(x); + k = x.abs().cmp(1); + pr = Ctor.precision; + rm = Ctor.rounding; + if (k !== -1) { + if (k === 0) { + halfPi = getPi(Ctor, pr + 4, rm).times(0.5); + halfPi.s = x.s; + return halfPi; + } + return new Ctor(NaN); + } + Ctor.precision = pr + 6; + Ctor.rounding = 1; + x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan(); + Ctor.precision = pr; + Ctor.rounding = rm; + return x.times(2); +}; +P.inverseTangent = P.atan = function() { + var i, j, k, n, px, t, r, wpr, x2, x = this, Ctor = x.constructor, pr = Ctor.precision, rm = Ctor.rounding; + if (!x.isFinite()) { + if (!x.s) + return new Ctor(NaN); + if (pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.5); + r.s = x.s; + return r; + } + } else if (x.isZero()) { + return new Ctor(x); + } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) { + r = getPi(Ctor, pr + 4, rm).times(0.25); + r.s = x.s; + return r; + } + Ctor.precision = wpr = pr + 10; + Ctor.rounding = 1; + k = Math.min(28, wpr / LOG_BASE + 2 | 0); + for (i = k; i; --i) + x = x.div(x.times(x).plus(1).sqrt().plus(1)); + external = false; + j = Math.ceil(wpr / LOG_BASE); + n = 1; + x2 = x.times(x); + r = new Ctor(x); + px = x; + for (; i !== -1; ) { + px = px.times(x2); + t = r.minus(px.div(n += 2)); + px = px.times(x2); + r = t.plus(px.div(n += 2)); + if (r.d[j] !== void 0) + for (i = j; r.d[i] === t.d[i] && i--; ) + ; + } + if (k) + r = r.times(2 << k - 1); + external = true; + return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true); +}; +P.isFinite = function() { + return !!this.d; +}; +P.isInteger = P.isInt = function() { + return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2; +}; +P.isNaN = function() { + return !this.s; +}; +P.isNegative = P.isNeg = function() { + return this.s < 0; +}; +P.isPositive = P.isPos = function() { + return this.s > 0; +}; +P.isZero = function() { + return !!this.d && this.d[0] === 0; +}; +P.lessThan = P.lt = function(y) { + return this.cmp(y) < 0; +}; +P.lessThanOrEqualTo = P.lte = function(y) { + return this.cmp(y) < 1; +}; +P.logarithm = P.log = function(base) { + var isBase10, d, denominator, k, inf, num, sd, r, arg2 = this, Ctor = arg2.constructor, pr = Ctor.precision, rm = Ctor.rounding, guard = 5; + if (base == null) { + base = new Ctor(10); + isBase10 = true; + } else { + base = new Ctor(base); + d = base.d; + if (base.s < 0 || !d || !d[0] || base.eq(1)) + return new Ctor(NaN); + isBase10 = base.eq(10); + } + d = arg2.d; + if (arg2.s < 0 || !d || !d[0] || arg2.eq(1)) { + return new Ctor(d && !d[0] ? -1 / 0 : arg2.s != 1 ? NaN : d ? 0 : 1 / 0); + } + if (isBase10) { + if (d.length > 1) { + inf = true; + } else { + for (k = d[0]; k % 10 === 0; ) + k /= 10; + inf = k !== 1; + } + } + external = false; + sd = pr + guard; + num = naturalLogarithm(arg2, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + r = divide(num, denominator, sd, 1); + if (checkRoundingDigits(r.d, k = pr, rm)) { + do { + sd += 10; + num = naturalLogarithm(arg2, sd); + denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd); + r = divide(num, denominator, sd, 1); + if (!inf) { + if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + break; + } + } while (checkRoundingDigits(r.d, k += 10, rm)); + } + external = true; + return finalise(r, pr, rm); +}; +P.minus = P.sub = function(y) { + var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.d) { + if (!x.s || !y.s) + y = new Ctor(NaN); + else if (x.d) + y.s = -y.s; + else + y = new Ctor(y.d || x.s !== y.s ? x : NaN); + return y; + } + if (x.s != y.s) { + y.s = -y.s; + return x.plus(y); + } + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + if (!xd[0] || !yd[0]) { + if (yd[0]) + y.s = -y.s; + else if (xd[0]) + y = new Ctor(x); + else + return new Ctor(rm === 3 ? -0 : 0); + return external ? finalise(y, pr, rm) : y; + } + e = mathfloor(y.e / LOG_BASE); + xe = mathfloor(x.e / LOG_BASE); + xd = xd.slice(); + k = xe - e; + if (k) { + xLTy = k < 0; + if (xLTy) { + d = xd; + k = -k; + len = yd.length; + } else { + d = yd; + e = xe; + len = xd.length; + } + i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2; + if (k > i) { + k = i; + d.length = 1; + } + d.reverse(); + for (i = k; i--; ) + d.push(0); + d.reverse(); + } else { + i = xd.length; + len = yd.length; + xLTy = i < len; + if (xLTy) + len = i; + for (i = 0; i < len; i++) { + if (xd[i] != yd[i]) { + xLTy = xd[i] < yd[i]; + break; + } + } + k = 0; + } + if (xLTy) { + d = xd; + xd = yd; + yd = d; + y.s = -y.s; + } + len = xd.length; + for (i = yd.length - len; i > 0; --i) + xd[len++] = 0; + for (i = yd.length; i > k; ) { + if (xd[--i] < yd[i]) { + for (j = i; j && xd[--j] === 0; ) + xd[j] = BASE - 1; + --xd[j]; + xd[i] += BASE; + } + xd[i] -= yd[i]; + } + for (; xd[--len] === 0; ) + xd.pop(); + for (; xd[0] === 0; xd.shift()) + --e; + if (!xd[0]) + return new Ctor(rm === 3 ? -0 : 0); + y.d = xd; + y.e = getBase10Exponent(xd, e); + return external ? finalise(y, pr, rm) : y; +}; +P.modulo = P.mod = function(y) { + var q, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.s || y.d && !y.d[0]) + return new Ctor(NaN); + if (!y.d || x.d && !x.d[0]) { + return finalise(new Ctor(x), Ctor.precision, Ctor.rounding); + } + external = false; + if (Ctor.modulo == 9) { + q = divide(x, y.abs(), 0, 3, 1); + q.s *= y.s; + } else { + q = divide(x, y, 0, Ctor.modulo, 1); + } + q = q.times(y); + external = true; + return x.minus(q); +}; +P.naturalExponential = P.exp = function() { + return naturalExponential(this); +}; +P.naturalLogarithm = P.ln = function() { + return naturalLogarithm(this); +}; +P.negated = P.neg = function() { + var x = new this.constructor(this); + x.s = -x.s; + return finalise(x); +}; +P.plus = P.add = function(y) { + var carry, d, e, i, k, len, pr, rm, xd, yd, x = this, Ctor = x.constructor; + y = new Ctor(y); + if (!x.d || !y.d) { + if (!x.s || !y.s) + y = new Ctor(NaN); + else if (!x.d) + y = new Ctor(y.d || x.s === y.s ? x : NaN); + return y; + } + if (x.s != y.s) { + y.s = -y.s; + return x.minus(y); + } + xd = x.d; + yd = y.d; + pr = Ctor.precision; + rm = Ctor.rounding; + if (!xd[0] || !yd[0]) { + if (!yd[0]) + y = new Ctor(x); + return external ? finalise(y, pr, rm) : y; + } + k = mathfloor(x.e / LOG_BASE); + e = mathfloor(y.e / LOG_BASE); + xd = xd.slice(); + i = k - e; + if (i) { + if (i < 0) { + d = xd; + i = -i; + len = yd.length; + } else { + d = yd; + e = k; + len = xd.length; + } + k = Math.ceil(pr / LOG_BASE); + len = k > len ? k + 1 : len + 1; + if (i > len) { + i = len; + d.length = 1; + } + d.reverse(); + for (; i--; ) + d.push(0); + d.reverse(); + } + len = xd.length; + i = yd.length; + if (len - i < 0) { + i = len; + d = yd; + yd = xd; + xd = d; + } + for (carry = 0; i; ) { + carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0; + xd[i] %= BASE; + } + if (carry) { + xd.unshift(carry); + ++e; + } + for (len = xd.length; xd[--len] == 0; ) + xd.pop(); + y.d = xd; + y.e = getBase10Exponent(xd, e); + return external ? finalise(y, pr, rm) : y; +}; +P.precision = P.sd = function(z) { + var k, x = this; + if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) + throw Error(invalidArgument + z); + if (x.d) { + k = getPrecision(x.d); + if (z && x.e + 1 > k) + k = x.e + 1; + } else { + k = NaN; + } + return k; +}; +P.round = function() { + var x = this, Ctor = x.constructor; + return finalise(new Ctor(x), x.e + 1, Ctor.rounding); +}; +P.sine = P.sin = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE; + Ctor.rounding = 1; + x = sine(Ctor, toLessThanHalfPi(Ctor, x)); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true); +}; +P.squareRoot = P.sqrt = function() { + var m, n, sd, r, rep, t, x = this, d = x.d, e = x.e, s = x.s, Ctor = x.constructor; + if (s !== 1 || !d || !d[0]) { + return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0); + } + external = false; + s = Math.sqrt(+x); + if (s == 0 || s == 1 / 0) { + n = digitsToString(d); + if ((n.length + e) % 2 == 0) + n += "0"; + s = Math.sqrt(n); + e = mathfloor((e + 1) / 2) - (e < 0 || e % 2); + if (s == 1 / 0) { + n = "5e" + e; + } else { + n = s.toExponential(); + n = n.slice(0, n.indexOf("e") + 1) + e; + } + r = new Ctor(n); + } else { + r = new Ctor(s.toString()); + } + sd = (e = Ctor.precision) + 3; + for (; ; ) { + t = r; + r = t.plus(divide(x, t, sd + 2, 1)).times(0.5); + if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) { + n = n.slice(sd - 3, sd + 1); + if (n == "9999" || !rep && n == "4999") { + if (!rep) { + finalise(t, e + 1, 0); + if (t.times(t).eq(x)) { + r = t; + break; + } + } + sd += 4; + rep = 1; + } else { + if (!+n || !+n.slice(1) && n.charAt(0) == "5") { + finalise(r, e + 1, 1); + m = !r.times(r).eq(x); + } + break; + } + } + } + external = true; + return finalise(r, e, Ctor.rounding, m); +}; +P.tangent = P.tan = function() { + var pr, rm, x = this, Ctor = x.constructor; + if (!x.isFinite()) + return new Ctor(NaN); + if (x.isZero()) + return new Ctor(x); + pr = Ctor.precision; + rm = Ctor.rounding; + Ctor.precision = pr + 10; + Ctor.rounding = 1; + x = x.sin(); + x.s = 1; + x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0); + Ctor.precision = pr; + Ctor.rounding = rm; + return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true); +}; +P.times = P.mul = function(y) { + var carry, e, i, k, r, rL, t, xdL, ydL, x = this, Ctor = x.constructor, xd = x.d, yd = (y = new Ctor(y)).d; + y.s *= x.s; + if (!xd || !xd[0] || !yd || !yd[0]) { + return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd ? NaN : !xd || !yd ? y.s / 0 : y.s * 0); + } + e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE); + xdL = xd.length; + ydL = yd.length; + if (xdL < ydL) { + r = xd; + xd = yd; + yd = r; + rL = xdL; + xdL = ydL; + ydL = rL; + } + r = []; + rL = xdL + ydL; + for (i = rL; i--; ) + r.push(0); + for (i = ydL; --i >= 0; ) { + carry = 0; + for (k = xdL + i; k > i; ) { + t = r[k] + yd[i] * xd[k - i - 1] + carry; + r[k--] = t % BASE | 0; + carry = t / BASE | 0; + } + r[k] = (r[k] + carry) % BASE | 0; + } + for (; !r[--rL]; ) + r.pop(); + if (carry) + ++e; + else + r.shift(); + y.d = r; + y.e = getBase10Exponent(r, e); + return external ? finalise(y, Ctor.precision, Ctor.rounding) : y; +}; +P.toBinary = function(sd, rm) { + return toStringBinary(this, 2, sd, rm); +}; +P.toDecimalPlaces = P.toDP = function(dp, rm) { + var x = this, Ctor = x.constructor; + x = new Ctor(x); + if (dp === void 0) + return x; + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + return finalise(x, dp + x.e + 1, rm); +}; +P.toExponential = function(dp, rm) { + var str, x = this, Ctor = x.constructor; + if (dp === void 0) { + str = finiteToString(x, true); + } else { + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + x = finalise(new Ctor(x), dp + 1, rm); + str = finiteToString(x, true, dp + 1); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toFixed = function(dp, rm) { + var str, y, x = this, Ctor = x.constructor; + if (dp === void 0) { + str = finiteToString(x); + } else { + checkInt32(dp, 0, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + y = finalise(new Ctor(x), dp + x.e + 1, rm); + str = finiteToString(y, false, dp + y.e + 1); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toFraction = function(maxD) { + var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r, x = this, xd = x.d, Ctor = x.constructor; + if (!xd) + return new Ctor(x); + n1 = d0 = new Ctor(1); + d1 = n0 = new Ctor(0); + d = new Ctor(d1); + e = d.e = getPrecision(xd) - x.e - 1; + k = e % LOG_BASE; + d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k); + if (maxD == null) { + maxD = e > 0 ? d : n1; + } else { + n = new Ctor(maxD); + if (!n.isInt() || n.lt(n1)) + throw Error(invalidArgument + n); + maxD = n.gt(d) ? e > 0 ? d : n1 : n; + } + external = false; + n = new Ctor(digitsToString(xd)); + pr = Ctor.precision; + Ctor.precision = e = xd.length * LOG_BASE * 2; + for (; ; ) { + q = divide(n, d, 0, 1, 1); + d2 = d0.plus(q.times(d1)); + if (d2.cmp(maxD) == 1) + break; + d0 = d1; + d1 = d2; + d2 = n1; + n1 = n0.plus(q.times(d2)); + n0 = d2; + d2 = d; + d = n.minus(q.times(d2)); + n = d2; + } + d2 = divide(maxD.minus(d0), d1, 0, 1, 1); + n0 = n0.plus(d2.times(n1)); + d0 = d0.plus(d2.times(d1)); + n0.s = n1.s = x.s; + r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; + Ctor.precision = pr; + external = true; + return r; +}; +P.toHexadecimal = P.toHex = function(sd, rm) { + return toStringBinary(this, 16, sd, rm); +}; +P.toNearest = function(y, rm) { + var x = this, Ctor = x.constructor; + x = new Ctor(x); + if (y == null) { + if (!x.d) + return x; + y = new Ctor(1); + rm = Ctor.rounding; + } else { + y = new Ctor(y); + if (rm === void 0) { + rm = Ctor.rounding; + } else { + checkInt32(rm, 0, 8); + } + if (!x.d) + return y.s ? x : y; + if (!y.d) { + if (y.s) + y.s = x.s; + return y; + } + } + if (y.d[0]) { + external = false; + x = divide(x, y, 0, rm, 1).times(y); + external = true; + finalise(x); + } else { + y.s = x.s; + x = y; + } + return x; +}; +P.toNumber = function() { + return +this; +}; +P.toOctal = function(sd, rm) { + return toStringBinary(this, 8, sd, rm); +}; +P.toPower = P.pow = function(y) { + var e, k, pr, r, rm, s, x = this, Ctor = x.constructor, yn = +(y = new Ctor(y)); + if (!x.d || !y.d || !x.d[0] || !y.d[0]) + return new Ctor(mathpow(+x, yn)); + x = new Ctor(x); + if (x.eq(1)) + return x; + pr = Ctor.precision; + rm = Ctor.rounding; + if (y.eq(1)) + return finalise(x, pr, rm); + e = mathfloor(y.e / LOG_BASE); + if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) { + r = intPow(Ctor, x, k, pr); + return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm); + } + s = x.s; + if (s < 0) { + if (e < y.d.length - 1) + return new Ctor(NaN); + if ((y.d[e] & 1) == 0) + s = 1; + if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) { + x.s = s; + return x; + } + } + k = mathpow(+x, yn); + e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log("0." + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + "").e; + if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) + return new Ctor(e > 0 ? s / 0 : 0); + external = false; + Ctor.rounding = x.s = 1; + k = Math.min(12, (e + "").length); + r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr); + if (r.d) { + r = finalise(r, pr + 5, 1); + if (checkRoundingDigits(r.d, pr, rm)) { + e = pr + 10; + r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1); + if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) { + r = finalise(r, pr + 1, 0); + } + } + } + r.s = s; + external = true; + Ctor.rounding = rm; + return finalise(r, pr, rm); +}; +P.toPrecision = function(sd, rm) { + var str, x = this, Ctor = x.constructor; + if (sd === void 0) { + str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + } else { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + x = finalise(new Ctor(x), sd, rm); + str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd); + } + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.toSignificantDigits = P.toSD = function(sd, rm) { + var x = this, Ctor = x.constructor; + if (sd === void 0) { + sd = Ctor.precision; + rm = Ctor.rounding; + } else { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + } + return finalise(new Ctor(x), sd, rm); +}; +P.toString = function() { + var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + return x.isNeg() && !x.isZero() ? "-" + str : str; +}; +P.truncated = P.trunc = function() { + return finalise(new this.constructor(this), this.e + 1, 1); +}; +P.valueOf = P.toJSON = function() { + var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos); + return x.isNeg() ? "-" + str : str; +}; +function digitsToString(d) { + var i, k, ws, indexOfLastWord = d.length - 1, str = "", w = d[0]; + if (indexOfLastWord > 0) { + str += w; + for (i = 1; i < indexOfLastWord; i++) { + ws = d[i] + ""; + k = LOG_BASE - ws.length; + if (k) + str += getZeroString(k); + str += ws; + } + w = d[i]; + ws = w + ""; + k = LOG_BASE - ws.length; + if (k) + str += getZeroString(k); + } else if (w === 0) { + return "0"; + } + for (; w % 10 === 0; ) + w /= 10; + return str + w; +} +__name(digitsToString, "digitsToString"); +function checkInt32(i, min2, max2) { + if (i !== ~~i || i < min2 || i > max2) { + throw Error(invalidArgument + i); + } +} +__name(checkInt32, "checkInt32"); +function checkRoundingDigits(d, i, rm, repeating) { + var di, k, r, rd; + for (k = d[0]; k >= 10; k /= 10) + --i; + if (--i < 0) { + i += LOG_BASE; + di = 0; + } else { + di = Math.ceil((i + 1) / LOG_BASE); + i %= LOG_BASE; + } + k = mathpow(10, LOG_BASE - i); + rd = d[di] % k | 0; + if (repeating == null) { + if (i < 3) { + if (i == 0) + rd = rd / 100 | 0; + else if (i == 1) + rd = rd / 10 | 0; + r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 5e4 || rd == 0; + } else { + r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0; + } + } else { + if (i < 4) { + if (i == 0) + rd = rd / 1e3 | 0; + else if (i == 1) + rd = rd / 100 | 0; + else if (i == 2) + rd = rd / 10 | 0; + r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999; + } else { + r = ((repeating || rm < 4) && rd + 1 == k || !repeating && rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 1e3 | 0) == mathpow(10, i - 3) - 1; + } + } + return r; +} +__name(checkRoundingDigits, "checkRoundingDigits"); +function convertBase(str, baseIn, baseOut) { + var j, arr = [0], arrL, i = 0, strL = str.length; + for (; i < strL; ) { + for (arrL = arr.length; arrL--; ) + arr[arrL] *= baseIn; + arr[0] += NUMERALS.indexOf(str.charAt(i++)); + for (j = 0; j < arr.length; j++) { + if (arr[j] > baseOut - 1) { + if (arr[j + 1] === void 0) + arr[j + 1] = 0; + arr[j + 1] += arr[j] / baseOut | 0; + arr[j] %= baseOut; + } + } + } + return arr.reverse(); +} +__name(convertBase, "convertBase"); +function cosine(Ctor, x) { + var k, len, y; + if (x.isZero()) + return x; + len = x.d.length; + if (len < 32) { + k = Math.ceil(len / 3); + y = (1 / tinyPow(4, k)).toString(); + } else { + k = 16; + y = "2.3283064365386962890625e-10"; + } + Ctor.precision += k; + x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1)); + for (var i = k; i--; ) { + var cos2x = x.times(x); + x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1); + } + Ctor.precision -= k; + return x; +} +__name(cosine, "cosine"); +var divide = function() { + function multiplyInteger(x, k, base) { + var temp, carry = 0, i = x.length; + for (x = x.slice(); i--; ) { + temp = x[i] * k + carry; + x[i] = temp % base | 0; + carry = temp / base | 0; + } + if (carry) + x.unshift(carry); + return x; + } + __name(multiplyInteger, "multiplyInteger"); + function compare(a, b, aL, bL) { + var i, r; + if (aL != bL) { + r = aL > bL ? 1 : -1; + } else { + for (i = r = 0; i < aL; i++) { + if (a[i] != b[i]) { + r = a[i] > b[i] ? 1 : -1; + break; + } + } + } + return r; + } + __name(compare, "compare"); + function subtract(a, b, aL, base) { + var i = 0; + for (; aL--; ) { + a[aL] -= i; + i = a[aL] < b[aL] ? 1 : 0; + a[aL] = i * base + a[aL] - b[aL]; + } + for (; !a[0] && a.length > 1; ) + a.shift(); + } + __name(subtract, "subtract"); + return function(x, y, pr, rm, dp, base) { + var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz, Ctor = x.constructor, sign2 = x.s == y.s ? 1 : -1, xd = x.d, yd = y.d; + if (!xd || !xd[0] || !yd || !yd[0]) { + return new Ctor( + !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN : xd && xd[0] == 0 || !yd ? sign2 * 0 : sign2 / 0 + ); + } + if (base) { + logBase = 1; + e = x.e - y.e; + } else { + base = BASE; + logBase = LOG_BASE; + e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase); + } + yL = yd.length; + xL = xd.length; + q = new Ctor(sign2); + qd = q.d = []; + for (i = 0; yd[i] == (xd[i] || 0); i++) + ; + if (yd[i] > (xd[i] || 0)) + e--; + if (pr == null) { + sd = pr = Ctor.precision; + rm = Ctor.rounding; + } else if (dp) { + sd = pr + (x.e - y.e) + 1; + } else { + sd = pr; + } + if (sd < 0) { + qd.push(1); + more = true; + } else { + sd = sd / logBase + 2 | 0; + i = 0; + if (yL == 1) { + k = 0; + yd = yd[0]; + sd++; + for (; (i < xL || k) && sd--; i++) { + t = k * base + (xd[i] || 0); + qd[i] = t / yd | 0; + k = t % yd | 0; + } + more = k || i < xL; + } else { + k = base / (yd[0] + 1) | 0; + if (k > 1) { + yd = multiplyInteger(yd, k, base); + xd = multiplyInteger(xd, k, base); + yL = yd.length; + xL = xd.length; + } + xi = yL; + rem = xd.slice(0, yL); + remL = rem.length; + for (; remL < yL; ) + rem[remL++] = 0; + yz = yd.slice(); + yz.unshift(0); + yd0 = yd[0]; + if (yd[1] >= base / 2) + ++yd0; + do { + k = 0; + cmp = compare(yd, rem, yL, remL); + if (cmp < 0) { + rem0 = rem[0]; + if (yL != remL) + rem0 = rem0 * base + (rem[1] || 0); + k = rem0 / yd0 | 0; + if (k > 1) { + if (k >= base) + k = base - 1; + prod = multiplyInteger(yd, k, base); + prodL = prod.length; + remL = rem.length; + cmp = compare(prod, rem, prodL, remL); + if (cmp == 1) { + k--; + subtract(prod, yL < prodL ? yz : yd, prodL, base); + } + } else { + if (k == 0) + cmp = k = 1; + prod = yd.slice(); + } + prodL = prod.length; + if (prodL < remL) + prod.unshift(0); + subtract(rem, prod, remL, base); + if (cmp == -1) { + remL = rem.length; + cmp = compare(yd, rem, yL, remL); + if (cmp < 1) { + k++; + subtract(rem, yL < remL ? yz : yd, remL, base); + } + } + remL = rem.length; + } else if (cmp === 0) { + k++; + rem = [0]; + } + qd[i++] = k; + if (cmp && rem[0]) { + rem[remL++] = xd[xi] || 0; + } else { + rem = [xd[xi]]; + remL = 1; + } + } while ((xi++ < xL || rem[0] !== void 0) && sd--); + more = rem[0] !== void 0; + } + if (!qd[0]) + qd.shift(); + } + if (logBase == 1) { + q.e = e; + inexact = more; + } else { + for (i = 1, k = qd[0]; k >= 10; k /= 10) + i++; + q.e = i + e * logBase - 1; + finalise(q, dp ? pr + q.e + 1 : pr, rm, more); + } + return q; + }; +}(); +function finalise(x, sd, rm, isTruncated) { + var digits, i, j, k, rd, roundUp, w, xd, xdi, Ctor = x.constructor; + out: + if (sd != null) { + xd = x.d; + if (!xd) + return x; + for (digits = 1, k = xd[0]; k >= 10; k /= 10) + digits++; + i = sd - digits; + if (i < 0) { + i += LOG_BASE; + j = sd; + w = xd[xdi = 0]; + rd = w / mathpow(10, digits - j - 1) % 10 | 0; + } else { + xdi = Math.ceil((i + 1) / LOG_BASE); + k = xd.length; + if (xdi >= k) { + if (isTruncated) { + for (; k++ <= xdi; ) + xd.push(0); + w = rd = 0; + digits = 1; + i %= LOG_BASE; + j = i - LOG_BASE + 1; + } else { + break out; + } + } else { + w = k = xd[xdi]; + for (digits = 1; k >= 10; k /= 10) + digits++; + i %= LOG_BASE; + j = i - LOG_BASE + digits; + rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0; + } + } + isTruncated = isTruncated || sd < 0 || xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1)); + roundUp = rm < 4 ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && (i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7)); + if (sd < 1 || !xd[0]) { + xd.length = 0; + if (roundUp) { + sd -= x.e + 1; + xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE); + x.e = -sd || 0; + } else { + xd[0] = x.e = 0; + } + return x; + } + if (i == 0) { + xd.length = xdi; + k = 1; + xdi--; + } else { + xd.length = xdi + 1; + k = mathpow(10, LOG_BASE - i); + xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0; + } + if (roundUp) { + for (; ; ) { + if (xdi == 0) { + for (i = 1, j = xd[0]; j >= 10; j /= 10) + i++; + j = xd[0] += k; + for (k = 1; j >= 10; j /= 10) + k++; + if (i != k) { + x.e++; + if (xd[0] == BASE) + xd[0] = 1; + } + break; + } else { + xd[xdi] += k; + if (xd[xdi] != BASE) + break; + xd[xdi--] = 0; + k = 1; + } + } + } + for (i = xd.length; xd[--i] === 0; ) + xd.pop(); + } + if (external) { + if (x.e > Ctor.maxE) { + x.d = null; + x.e = NaN; + } else if (x.e < Ctor.minE) { + x.e = 0; + x.d = [0]; + } + } + return x; +} +__name(finalise, "finalise"); +function finiteToString(x, isExp, sd) { + if (!x.isFinite()) + return nonFiniteToString(x); + var k, e = x.e, str = digitsToString(x.d), len = str.length; + if (isExp) { + if (sd && (k = sd - len) > 0) { + str = str.charAt(0) + "." + str.slice(1) + getZeroString(k); + } else if (len > 1) { + str = str.charAt(0) + "." + str.slice(1); + } + str = str + (x.e < 0 ? "e" : "e+") + x.e; + } else if (e < 0) { + str = "0." + getZeroString(-e - 1) + str; + if (sd && (k = sd - len) > 0) + str += getZeroString(k); + } else if (e >= len) { + str += getZeroString(e + 1 - len); + if (sd && (k = sd - e - 1) > 0) + str = str + "." + getZeroString(k); + } else { + if ((k = e + 1) < len) + str = str.slice(0, k) + "." + str.slice(k); + if (sd && (k = sd - len) > 0) { + if (e + 1 === len) + str += "."; + str += getZeroString(k); + } + } + return str; +} +__name(finiteToString, "finiteToString"); +function getBase10Exponent(digits, e) { + var w = digits[0]; + for (e *= LOG_BASE; w >= 10; w /= 10) + e++; + return e; +} +__name(getBase10Exponent, "getBase10Exponent"); +function getLn10(Ctor, sd, pr) { + if (sd > LN10_PRECISION) { + external = true; + if (pr) + Ctor.precision = pr; + throw Error(precisionLimitExceeded); + } + return finalise(new Ctor(LN10), sd, 1, true); +} +__name(getLn10, "getLn10"); +function getPi(Ctor, sd, rm) { + if (sd > PI_PRECISION) + throw Error(precisionLimitExceeded); + return finalise(new Ctor(PI), sd, rm, true); +} +__name(getPi, "getPi"); +function getPrecision(digits) { + var w = digits.length - 1, len = w * LOG_BASE + 1; + w = digits[w]; + if (w) { + for (; w % 10 == 0; w /= 10) + len--; + for (w = digits[0]; w >= 10; w /= 10) + len++; + } + return len; +} +__name(getPrecision, "getPrecision"); +function getZeroString(k) { + var zs = ""; + for (; k--; ) + zs += "0"; + return zs; +} +__name(getZeroString, "getZeroString"); +function intPow(Ctor, x, n, pr) { + var isTruncated, r = new Ctor(1), k = Math.ceil(pr / LOG_BASE + 4); + external = false; + for (; ; ) { + if (n % 2) { + r = r.times(x); + if (truncate(r.d, k)) + isTruncated = true; + } + n = mathfloor(n / 2); + if (n === 0) { + n = r.d.length - 1; + if (isTruncated && r.d[n] === 0) + ++r.d[n]; + break; + } + x = x.times(x); + truncate(x.d, k); + } + external = true; + return r; +} +__name(intPow, "intPow"); +function isOdd(n) { + return n.d[n.d.length - 1] & 1; +} +__name(isOdd, "isOdd"); +function maxOrMin(Ctor, args, ltgt) { + var y, x = new Ctor(args[0]), i = 0; + for (; ++i < args.length; ) { + y = new Ctor(args[i]); + if (!y.s) { + x = y; + break; + } else if (x[ltgt](y)) { + x = y; + } + } + return x; +} +__name(maxOrMin, "maxOrMin"); +function naturalExponential(x, sd) { + var denominator, guard, j, pow2, sum3, t, wpr, rep = 0, i = 0, k = 0, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; + if (!x.d || !x.d[0] || x.e > 17) { + return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : 0 / 0); + } + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + t = new Ctor(0.03125); + while (x.e > -2) { + x = x.times(t); + k += 5; + } + guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0; + wpr += guard; + denominator = pow2 = sum3 = new Ctor(1); + Ctor.precision = wpr; + for (; ; ) { + pow2 = finalise(pow2.times(x), wpr, 1); + denominator = denominator.times(++i); + t = sum3.plus(divide(pow2, denominator, wpr, 1)); + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum3.d).slice(0, wpr)) { + j = k; + while (j--) + sum3 = finalise(sum3.times(sum3), wpr, 1); + if (sd == null) { + if (rep < 3 && checkRoundingDigits(sum3.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += 10; + denominator = pow2 = t = new Ctor(1); + i = 0; + rep++; + } else { + return finalise(sum3, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum3; + } + } + sum3 = t; + } +} +__name(naturalExponential, "naturalExponential"); +function naturalLogarithm(y, sd) { + var c, c0, denominator, e, numerator, rep, sum3, t, wpr, x1, x2, n = 1, guard = 10, x = y, xd = x.d, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; + if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) { + return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x); + } + if (sd == null) { + external = false; + wpr = pr; + } else { + wpr = sd; + } + Ctor.precision = wpr += guard; + c = digitsToString(xd); + c0 = c.charAt(0); + if (Math.abs(e = x.e) < 15e14) { + while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) { + x = x.times(y); + c = digitsToString(x.d); + c0 = c.charAt(0); + n++; + } + e = x.e; + if (c0 > 1) { + x = new Ctor("0." + c); + e++; + } else { + x = new Ctor(c0 + "." + c.slice(1)); + } + } else { + t = getLn10(Ctor, wpr + 2, pr).times(e + ""); + x = naturalLogarithm(new Ctor(c0 + "." + c.slice(1)), wpr - guard).plus(t); + Ctor.precision = pr; + return sd == null ? finalise(x, pr, rm, external = true) : x; + } + x1 = x; + sum3 = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = 3; + for (; ; ) { + numerator = finalise(numerator.times(x2), wpr, 1); + t = sum3.plus(divide(numerator, new Ctor(denominator), wpr, 1)); + if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum3.d).slice(0, wpr)) { + sum3 = sum3.times(2); + if (e !== 0) + sum3 = sum3.plus(getLn10(Ctor, wpr + 2, pr).times(e + "")); + sum3 = divide(sum3, new Ctor(n), wpr, 1); + if (sd == null) { + if (checkRoundingDigits(sum3.d, wpr - guard, rm, rep)) { + Ctor.precision = wpr += guard; + t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1); + x2 = finalise(x.times(x), wpr, 1); + denominator = rep = 1; + } else { + return finalise(sum3, Ctor.precision = pr, rm, external = true); + } + } else { + Ctor.precision = pr; + return sum3; + } + } + sum3 = t; + denominator += 2; + } +} +__name(naturalLogarithm, "naturalLogarithm"); +function nonFiniteToString(x) { + return String(x.s * x.s / 0); +} +__name(nonFiniteToString, "nonFiniteToString"); +function parseDecimal(x, str) { + var e, i, len; + if ((e = str.indexOf(".")) > -1) + str = str.replace(".", ""); + if ((i = str.search(/e/i)) > 0) { + if (e < 0) + e = i; + e += +str.slice(i + 1); + str = str.substring(0, i); + } else if (e < 0) { + e = str.length; + } + for (i = 0; str.charCodeAt(i) === 48; i++) + ; + for (len = str.length; str.charCodeAt(len - 1) === 48; --len) + ; + str = str.slice(i, len); + if (str) { + len -= i; + x.e = e = e - i - 1; + x.d = []; + i = (e + 1) % LOG_BASE; + if (e < 0) + i += LOG_BASE; + if (i < len) { + if (i) + x.d.push(+str.slice(0, i)); + for (len -= LOG_BASE; i < len; ) + x.d.push(+str.slice(i, i += LOG_BASE)); + str = str.slice(i); + i = LOG_BASE - str.length; + } else { + i -= len; + } + for (; i--; ) + str += "0"; + x.d.push(+str); + if (external) { + if (x.e > x.constructor.maxE) { + x.d = null; + x.e = NaN; + } else if (x.e < x.constructor.minE) { + x.e = 0; + x.d = [0]; + } + } + } else { + x.e = 0; + x.d = [0]; + } + return x; +} +__name(parseDecimal, "parseDecimal"); +function parseOther(x, str) { + var base, Ctor, divisor, i, isFloat, len, p, xd, xe; + if (str.indexOf("_") > -1) { + str = str.replace(/(\d)_(?=\d)/g, "$1"); + if (isDecimal.test(str)) + return parseDecimal(x, str); + } else if (str === "Infinity" || str === "NaN") { + if (!+str) + x.s = NaN; + x.e = NaN; + x.d = null; + return x; + } + if (isHex.test(str)) { + base = 16; + str = str.toLowerCase(); + } else if (isBinary.test(str)) { + base = 2; + } else if (isOctal.test(str)) { + base = 8; + } else { + throw Error(invalidArgument + str); + } + i = str.search(/p/i); + if (i > 0) { + p = +str.slice(i + 1); + str = str.substring(2, i); + } else { + str = str.slice(2); + } + i = str.indexOf("."); + isFloat = i >= 0; + Ctor = x.constructor; + if (isFloat) { + str = str.replace(".", ""); + len = str.length; + i = len - i; + divisor = intPow(Ctor, new Ctor(base), i, i * 2); + } + xd = convertBase(str, base, BASE); + xe = xd.length - 1; + for (i = xe; xd[i] === 0; --i) + xd.pop(); + if (i < 0) + return new Ctor(x.s * 0); + x.e = getBase10Exponent(xd, xe); + x.d = xd; + external = false; + if (isFloat) + x = divide(x, divisor, len * 4); + if (p) + x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p)); + external = true; + return x; +} +__name(parseOther, "parseOther"); +function sine(Ctor, x) { + var k, len = x.d.length; + if (len < 3) { + return x.isZero() ? x : taylorSeries(Ctor, 2, x, x); + } + k = 1.4 * Math.sqrt(len); + k = k > 16 ? 16 : k | 0; + x = x.times(1 / tinyPow(5, k)); + x = taylorSeries(Ctor, 2, x, x); + var sin2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20); + for (; k--; ) { + sin2_x = x.times(x); + x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20)))); + } + return x; +} +__name(sine, "sine"); +function taylorSeries(Ctor, n, x, y, isHyperbolic) { + var j, t, u, x2, i = 1, pr = Ctor.precision, k = Math.ceil(pr / LOG_BASE); + external = false; + x2 = x.times(x); + u = new Ctor(y); + for (; ; ) { + t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1); + u = isHyperbolic ? y.plus(t) : y.minus(t); + y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1); + t = u.plus(y); + if (t.d[k] !== void 0) { + for (j = k; t.d[j] === u.d[j] && j--; ) + ; + if (j == -1) + break; + } + j = u; + u = y; + y = t; + t = j; + i++; + } + external = true; + t.d.length = k + 1; + return t; +} +__name(taylorSeries, "taylorSeries"); +function tinyPow(b, e) { + var n = b; + while (--e) + n *= b; + return n; +} +__name(tinyPow, "tinyPow"); +function toLessThanHalfPi(Ctor, x) { + var t, isNeg = x.s < 0, pi = getPi(Ctor, Ctor.precision, 1), halfPi = pi.times(0.5); + x = x.abs(); + if (x.lte(halfPi)) { + quadrant = isNeg ? 4 : 1; + return x; + } + t = x.divToInt(pi); + if (t.isZero()) { + quadrant = isNeg ? 3 : 2; + } else { + x = x.minus(t.times(pi)); + if (x.lte(halfPi)) { + quadrant = isOdd(t) ? isNeg ? 2 : 3 : isNeg ? 4 : 1; + return x; + } + quadrant = isOdd(t) ? isNeg ? 1 : 4 : isNeg ? 3 : 2; + } + return x.minus(pi).abs(); +} +__name(toLessThanHalfPi, "toLessThanHalfPi"); +function toStringBinary(x, baseOut, sd, rm) { + var base, e, i, k, len, roundUp, str, xd, y, Ctor = x.constructor, isExp = sd !== void 0; + if (isExp) { + checkInt32(sd, 1, MAX_DIGITS); + if (rm === void 0) + rm = Ctor.rounding; + else + checkInt32(rm, 0, 8); + } else { + sd = Ctor.precision; + rm = Ctor.rounding; + } + if (!x.isFinite()) { + str = nonFiniteToString(x); + } else { + str = finiteToString(x); + i = str.indexOf("."); + if (isExp) { + base = 2; + if (baseOut == 16) { + sd = sd * 4 - 3; + } else if (baseOut == 8) { + sd = sd * 3 - 2; + } + } else { + base = baseOut; + } + if (i >= 0) { + str = str.replace(".", ""); + y = new Ctor(1); + y.e = str.length - i; + y.d = convertBase(finiteToString(y), 10, base); + y.e = y.d.length; + } + xd = convertBase(str, 10, base); + e = len = xd.length; + for (; xd[--len] == 0; ) + xd.pop(); + if (!xd[0]) { + str = isExp ? "0p+0" : "0"; + } else { + if (i < 0) { + e--; + } else { + x = new Ctor(x); + x.d = xd; + x.e = e; + x = divide(x, y, sd, rm, 0, base); + xd = x.d; + e = x.e; + roundUp = inexact; + } + i = xd[sd]; + k = base / 2; + roundUp = roundUp || xd[sd + 1] !== void 0; + roundUp = rm < 4 ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 || rm === (x.s < 0 ? 8 : 7)); + xd.length = sd; + if (roundUp) { + for (; ++xd[--sd] > base - 1; ) { + xd[sd] = 0; + if (!sd) { + ++e; + xd.unshift(1); + } + } + } + for (len = xd.length; !xd[len - 1]; --len) + ; + for (i = 0, str = ""; i < len; i++) + str += NUMERALS.charAt(xd[i]); + if (isExp) { + if (len > 1) { + if (baseOut == 16 || baseOut == 8) { + i = baseOut == 16 ? 4 : 3; + for (--len; len % i; len++) + str += "0"; + xd = convertBase(str, base, baseOut); + for (len = xd.length; !xd[len - 1]; --len) + ; + for (i = 1, str = "1."; i < len; i++) + str += NUMERALS.charAt(xd[i]); + } else { + str = str.charAt(0) + "." + str.slice(1); + } + } + str = str + (e < 0 ? "p" : "p+") + e; + } else if (e < 0) { + for (; ++e; ) + str = "0" + str; + str = "0." + str; + } else { + if (++e > len) + for (e -= len; e--; ) + str += "0"; + else if (e < len) + str = str.slice(0, e) + "." + str.slice(e); + } + } + str = (baseOut == 16 ? "0x" : baseOut == 2 ? "0b" : baseOut == 8 ? "0o" : "") + str; + } + return x.s < 0 ? "-" + str : str; +} +__name(toStringBinary, "toStringBinary"); +function truncate(arr, len) { + if (arr.length > len) { + arr.length = len; + return true; + } +} +__name(truncate, "truncate"); +function abs(x) { + return new this(x).abs(); +} +__name(abs, "abs"); +function acos(x) { + return new this(x).acos(); +} +__name(acos, "acos"); +function acosh(x) { + return new this(x).acosh(); +} +__name(acosh, "acosh"); +function add(x, y) { + return new this(x).plus(y); +} +__name(add, "add"); +function asin(x) { + return new this(x).asin(); +} +__name(asin, "asin"); +function asinh(x) { + return new this(x).asinh(); +} +__name(asinh, "asinh"); +function atan(x) { + return new this(x).atan(); +} +__name(atan, "atan"); +function atanh(x) { + return new this(x).atanh(); +} +__name(atanh, "atanh"); +function atan2(y, x) { + y = new this(y); + x = new this(x); + var r, pr = this.precision, rm = this.rounding, wpr = pr + 4; + if (!y.s || !x.s) { + r = new this(NaN); + } else if (!y.d && !x.d) { + r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75); + r.s = y.s; + } else if (!x.d || y.isZero()) { + r = x.s < 0 ? getPi(this, pr, rm) : new this(0); + r.s = y.s; + } else if (!y.d || x.isZero()) { + r = getPi(this, wpr, 1).times(0.5); + r.s = y.s; + } else if (x.s < 0) { + this.precision = wpr; + this.rounding = 1; + r = this.atan(divide(y, x, wpr, 1)); + x = getPi(this, wpr, 1); + this.precision = pr; + this.rounding = rm; + r = y.s < 0 ? r.minus(x) : r.plus(x); + } else { + r = this.atan(divide(y, x, wpr, 1)); + } + return r; +} +__name(atan2, "atan2"); +function cbrt(x) { + return new this(x).cbrt(); +} +__name(cbrt, "cbrt"); +function ceil(x) { + return finalise(x = new this(x), x.e + 1, 2); +} +__name(ceil, "ceil"); +function clamp(x, min2, max2) { + return new this(x).clamp(min2, max2); +} +__name(clamp, "clamp"); +function config(obj) { + if (!obj || typeof obj !== "object") + throw Error(decimalError + "Object expected"); + var i, p, v, useDefaults = obj.defaults === true, ps = [ + "precision", + 1, + MAX_DIGITS, + "rounding", + 0, + 8, + "toExpNeg", + -EXP_LIMIT, + 0, + "toExpPos", + 0, + EXP_LIMIT, + "maxE", + 0, + EXP_LIMIT, + "minE", + -EXP_LIMIT, + 0, + "modulo", + 0, + 9 + ]; + for (i = 0; i < ps.length; i += 3) { + if (p = ps[i], useDefaults) + this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) + this[p] = v; + else + throw Error(invalidArgument + p + ": " + v); + } + } + if (p = "crypto", useDefaults) + this[p] = DEFAULTS[p]; + if ((v = obj[p]) !== void 0) { + if (v === true || v === false || v === 0 || v === 1) { + if (v) { + if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) { + this[p] = true; + } else { + throw Error(cryptoUnavailable); + } + } else { + this[p] = false; + } + } else { + throw Error(invalidArgument + p + ": " + v); + } + } + return this; +} +__name(config, "config"); +function cos(x) { + return new this(x).cos(); +} +__name(cos, "cos"); +function cosh(x) { + return new this(x).cosh(); +} +__name(cosh, "cosh"); +function clone(obj) { + var i, p, ps; + function Decimal2(v) { + var e, i2, t, x = this; + if (!(x instanceof Decimal2)) + return new Decimal2(v); + x.constructor = Decimal2; + if (isDecimalInstance(v)) { + x.s = v.s; + if (external) { + if (!v.d || v.e > Decimal2.maxE) { + x.e = NaN; + x.d = null; + } else if (v.e < Decimal2.minE) { + x.e = 0; + x.d = [0]; + } else { + x.e = v.e; + x.d = v.d.slice(); + } + } else { + x.e = v.e; + x.d = v.d ? v.d.slice() : v.d; + } + return; + } + t = typeof v; + if (t === "number") { + if (v === 0) { + x.s = 1 / v < 0 ? -1 : 1; + x.e = 0; + x.d = [0]; + return; + } + if (v < 0) { + v = -v; + x.s = -1; + } else { + x.s = 1; + } + if (v === ~~v && v < 1e7) { + for (e = 0, i2 = v; i2 >= 10; i2 /= 10) + e++; + if (external) { + if (e > Decimal2.maxE) { + x.e = NaN; + x.d = null; + } else if (e < Decimal2.minE) { + x.e = 0; + x.d = [0]; + } else { + x.e = e; + x.d = [v]; + } + } else { + x.e = e; + x.d = [v]; + } + return; + } else if (v * 0 !== 0) { + if (!v) + x.s = NaN; + x.e = NaN; + x.d = null; + return; + } + return parseDecimal(x, v.toString()); + } else if (t !== "string") { + throw Error(invalidArgument + v); + } + if ((i2 = v.charCodeAt(0)) === 45) { + v = v.slice(1); + x.s = -1; + } else { + if (i2 === 43) + v = v.slice(1); + x.s = 1; + } + return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v); + } + __name(Decimal2, "Decimal"); + Decimal2.prototype = P; + Decimal2.ROUND_UP = 0; + Decimal2.ROUND_DOWN = 1; + Decimal2.ROUND_CEIL = 2; + Decimal2.ROUND_FLOOR = 3; + Decimal2.ROUND_HALF_UP = 4; + Decimal2.ROUND_HALF_DOWN = 5; + Decimal2.ROUND_HALF_EVEN = 6; + Decimal2.ROUND_HALF_CEIL = 7; + Decimal2.ROUND_HALF_FLOOR = 8; + Decimal2.EUCLID = 9; + Decimal2.config = Decimal2.set = config; + Decimal2.clone = clone; + Decimal2.isDecimal = isDecimalInstance; + Decimal2.abs = abs; + Decimal2.acos = acos; + Decimal2.acosh = acosh; + Decimal2.add = add; + Decimal2.asin = asin; + Decimal2.asinh = asinh; + Decimal2.atan = atan; + Decimal2.atanh = atanh; + Decimal2.atan2 = atan2; + Decimal2.cbrt = cbrt; + Decimal2.ceil = ceil; + Decimal2.clamp = clamp; + Decimal2.cos = cos; + Decimal2.cosh = cosh; + Decimal2.div = div; + Decimal2.exp = exp; + Decimal2.floor = floor; + Decimal2.hypot = hypot; + Decimal2.ln = ln; + Decimal2.log = log; + Decimal2.log10 = log10; + Decimal2.log2 = log2; + Decimal2.max = max; + Decimal2.min = min; + Decimal2.mod = mod; + Decimal2.mul = mul; + Decimal2.pow = pow; + Decimal2.random = random; + Decimal2.round = round; + Decimal2.sign = sign; + Decimal2.sin = sin; + Decimal2.sinh = sinh; + Decimal2.sqrt = sqrt; + Decimal2.sub = sub; + Decimal2.sum = sum; + Decimal2.tan = tan; + Decimal2.tanh = tanh; + Decimal2.trunc = trunc; + if (obj === void 0) + obj = {}; + if (obj) { + if (obj.defaults !== true) { + ps = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"]; + for (i = 0; i < ps.length; ) + if (!obj.hasOwnProperty(p = ps[i++])) + obj[p] = this[p]; + } + } + Decimal2.config(obj); + return Decimal2; +} +__name(clone, "clone"); +function div(x, y) { + return new this(x).div(y); +} +__name(div, "div"); +function exp(x) { + return new this(x).exp(); +} +__name(exp, "exp"); +function floor(x) { + return finalise(x = new this(x), x.e + 1, 3); +} +__name(floor, "floor"); +function hypot() { + var i, n, t = new this(0); + external = false; + for (i = 0; i < arguments.length; ) { + n = new this(arguments[i++]); + if (!n.d) { + if (n.s) { + external = true; + return new this(1 / 0); + } + t = n; + } else if (t.d) { + t = t.plus(n.times(n)); + } + } + external = true; + return t.sqrt(); +} +__name(hypot, "hypot"); +function isDecimalInstance(obj) { + return obj instanceof Decimal || obj && obj.toStringTag === tag || false; +} +__name(isDecimalInstance, "isDecimalInstance"); +function ln(x) { + return new this(x).ln(); +} +__name(ln, "ln"); +function log(x, y) { + return new this(x).log(y); +} +__name(log, "log"); +function log2(x) { + return new this(x).log(2); +} +__name(log2, "log2"); +function log10(x) { + return new this(x).log(10); +} +__name(log10, "log10"); +function max() { + return maxOrMin(this, arguments, "lt"); +} +__name(max, "max"); +function min() { + return maxOrMin(this, arguments, "gt"); +} +__name(min, "min"); +function mod(x, y) { + return new this(x).mod(y); +} +__name(mod, "mod"); +function mul(x, y) { + return new this(x).mul(y); +} +__name(mul, "mul"); +function pow(x, y) { + return new this(x).pow(y); +} +__name(pow, "pow"); +function random(sd) { + var d, e, k, n, i = 0, r = new this(1), rd = []; + if (sd === void 0) + sd = this.precision; + else + checkInt32(sd, 1, MAX_DIGITS); + k = Math.ceil(sd / LOG_BASE); + if (!this.crypto) { + for (; i < k; ) + rd[i++] = Math.random() * 1e7 | 0; + } else if (crypto.getRandomValues) { + d = crypto.getRandomValues(new Uint32Array(k)); + for (; i < k; ) { + n = d[i]; + if (n >= 429e7) { + d[i] = crypto.getRandomValues(new Uint32Array(1))[0]; + } else { + rd[i++] = n % 1e7; + } + } + } else if (crypto.randomBytes) { + d = crypto.randomBytes(k *= 4); + for (; i < k; ) { + n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 127) << 24); + if (n >= 214e7) { + crypto.randomBytes(4).copy(d, i); + } else { + rd.push(n % 1e7); + i += 4; + } + } + i = k / 4; + } else { + throw Error(cryptoUnavailable); + } + k = rd[--i]; + sd %= LOG_BASE; + if (k && sd) { + n = mathpow(10, LOG_BASE - sd); + rd[i] = (k / n | 0) * n; + } + for (; rd[i] === 0; i--) + rd.pop(); + if (i < 0) { + e = 0; + rd = [0]; + } else { + e = -1; + for (; rd[0] === 0; e -= LOG_BASE) + rd.shift(); + for (k = 1, n = rd[0]; n >= 10; n /= 10) + k++; + if (k < LOG_BASE) + e -= LOG_BASE - k; + } + r.e = e; + r.d = rd; + return r; +} +__name(random, "random"); +function round(x) { + return finalise(x = new this(x), x.e + 1, this.rounding); +} +__name(round, "round"); +function sign(x) { + x = new this(x); + return x.d ? x.d[0] ? x.s : 0 * x.s : x.s || NaN; +} +__name(sign, "sign"); +function sin(x) { + return new this(x).sin(); +} +__name(sin, "sin"); +function sinh(x) { + return new this(x).sinh(); +} +__name(sinh, "sinh"); +function sqrt(x) { + return new this(x).sqrt(); +} +__name(sqrt, "sqrt"); +function sub(x, y) { + return new this(x).sub(y); +} +__name(sub, "sub"); +function sum() { + var i = 0, args = arguments, x = new this(args[i]); + external = false; + for (; x.s && ++i < args.length; ) + x = x.plus(args[i]); + external = true; + return finalise(x, this.precision, this.rounding); +} +__name(sum, "sum"); +function tan(x) { + return new this(x).tan(); +} +__name(tan, "tan"); +function tanh(x) { + return new this(x).tanh(); +} +__name(tanh, "tanh"); +function trunc(x) { + return finalise(x = new this(x), x.e + 1, 1); +} +__name(trunc, "trunc"); +P[Symbol.for("nodejs.util.inspect.custom")] = P.toString; +P[Symbol.toStringTag] = "Decimal"; +var Decimal = P.constructor = clone(DEFAULTS); +LN10 = new Decimal(LN10); +PI = new Decimal(PI); +var decimal_default = Decimal; + +// src/runtime/utils/common.ts +var import_indent_string = __toESM(require_indent_string()); +var import_js_levenshtein = __toESM(require_js_levenshtein()); + +// src/runtime/core/model/FieldRef.ts +var FieldRefImpl = class { + constructor(modelName, name, fieldType, isList) { + this.modelName = modelName; + this.name = name; + this.typeName = fieldType; + this.isList = isList; + } + _toGraphQLInputType() { + const prefix = this.isList ? `List${this.typeName}` : this.typeName; + return `${prefix}FieldRefInput<${this.modelName}>`; + } +}; +__name(FieldRefImpl, "FieldRefImpl"); + +// src/runtime/object-enums.ts +var objectEnumNames = ["JsonNullValueInput", "NullableJsonNullValueInput", "JsonNullValueFilter"]; +var secret = Symbol(); +var representations = /* @__PURE__ */ new WeakMap(); +var ObjectEnumValue = class { + constructor(arg2) { + if (arg2 === secret) { + representations.set(this, `Prisma.${this._getName()}`); + } else { + representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`); + } + } + _getName() { + return this.constructor.name; + } + toString() { + return representations.get(this); + } +}; +__name(ObjectEnumValue, "ObjectEnumValue"); +var NullTypesEnumValue = class extends ObjectEnumValue { + _getNamespace() { + return "NullTypes"; + } +}; +__name(NullTypesEnumValue, "NullTypesEnumValue"); +var DbNull = class extends NullTypesEnumValue { +}; +__name(DbNull, "DbNull"); +var JsonNull = class extends NullTypesEnumValue { +}; +__name(JsonNull, "JsonNull"); +var AnyNull = class extends NullTypesEnumValue { +}; +__name(AnyNull, "AnyNull"); +var objectEnumValues = { + classes: { + DbNull, + JsonNull, + AnyNull + }, + instances: { + DbNull: new DbNull(secret), + JsonNull: new JsonNull(secret), + AnyNull: new AnyNull(secret) + } +}; + +// src/runtime/utils/decimalJsLike.ts +function isDecimalJsLike(value) { + if (Decimal.isDecimal(value)) { + return true; + } + return value !== null && typeof value === "object" && typeof value.s === "number" && typeof value.e === "number" && Array.isArray(value.d); +} +__name(isDecimalJsLike, "isDecimalJsLike"); +function stringifyDecimalJsLike(value) { + if (Decimal.isDecimal(value)) { + return String(value); + } + const tmpDecimal = new Decimal(0); + tmpDecimal.d = value.d; + tmpDecimal.e = value.e; + tmpDecimal.s = value.s; + return String(tmpDecimal); +} +__name(stringifyDecimalJsLike, "stringifyDecimalJsLike"); + +// src/runtime/utils/common.ts +var keyBy = /* @__PURE__ */ __name((collection, prop) => { + const acc = {}; + for (const obj of collection) { + const key = obj[prop]; + acc[key] = obj; + } + return acc; +}, "keyBy"); +var ScalarTypeTable = { + String: true, + Int: true, + Float: true, + Boolean: true, + Long: true, + DateTime: true, + ID: true, + UUID: true, + Json: true, + Bytes: true, + Decimal: true, + BigInt: true +}; +var JSTypeToGraphQLType = { + string: "String", + boolean: "Boolean", + object: "Json", + symbol: "Symbol" +}; +function stringifyGraphQLType(type) { + if (typeof type === "string") { + return type; + } + return type.name; +} +__name(stringifyGraphQLType, "stringifyGraphQLType"); +function wrapWithList(str, isList) { + if (isList) { + return `List<${str}>`; + } + return str; +} +__name(wrapWithList, "wrapWithList"); +var RFC_3339_REGEX = /^(\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60))(\.\d{1,})?(([Z])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$/; +var UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; +function getGraphQLType(value, inputType) { + const potentialType = inputType == null ? void 0 : inputType.type; + if (value === null) { + return "null"; + } + if (Object.prototype.toString.call(value) === "[object BigInt]") { + return "BigInt"; + } + if (decimal_default.isDecimal(value)) { + return "Decimal"; + } + if (potentialType === "Decimal" && isDecimalJsLike(value)) { + return "Decimal"; + } + if (Buffer.isBuffer(value)) { + return "Bytes"; + } + if (isValidEnumValue(value, inputType)) { + return potentialType.name; + } + if (value instanceof ObjectEnumValue) { + return value._getName(); + } + if (value instanceof FieldRefImpl) { + return value._toGraphQLInputType(); + } + if (Array.isArray(value)) { + let scalarTypes = value.reduce((acc, val) => { + const type = getGraphQLType(val, inputType); + if (!acc.includes(type)) { + acc.push(type); + } + return acc; + }, []); + if (scalarTypes.includes("Float") && scalarTypes.includes("Int")) { + scalarTypes = ["Float"]; + } + return `List<${scalarTypes.join(" | ")}>`; + } + const jsType = typeof value; + if (jsType === "number") { + if (Math.trunc(value) === value) { + return "Int"; + } else { + return "Float"; + } + } + if (Object.prototype.toString.call(value) === "[object Date]") { + return "DateTime"; + } + if (jsType === "string") { + if (UUID_REGEX.test(value)) { + return "UUID"; + } + const date = new Date(value); + if (date.toString() === "Invalid Date") { + return "String"; + } + if (RFC_3339_REGEX.test(value)) { + return "DateTime"; + } + } + return JSTypeToGraphQLType[jsType]; +} +__name(getGraphQLType, "getGraphQLType"); +function isValidEnumValue(value, inputType) { + var _a3; + const enumType = inputType == null ? void 0 : inputType.type; + if (!isSchemaEnum(enumType)) { + return false; + } + if ((inputType == null ? void 0 : inputType.namespace) === "prisma" && objectEnumNames.includes(enumType.name)) { + const name = (_a3 = value == null ? void 0 : value.constructor) == null ? void 0 : _a3.name; + return typeof name === "string" && objectEnumValues.instances[name] === value && enumType.values.includes(name); + } + return typeof value === "string" && enumType.values.includes(value); +} +__name(isValidEnumValue, "isValidEnumValue"); +function getSuggestion(str, possibilities) { + const bestMatch = possibilities.reduce( + (acc, curr) => { + const distance = (0, import_js_levenshtein.default)(str, curr); + if (distance < acc.distance) { + return { + distance, + str: curr + }; + } + return acc; + }, + { + distance: Math.min(Math.floor(str.length) * 1.1, ...possibilities.map((p) => p.length * 3)), + str: null + } + ); + return bestMatch.str; +} +__name(getSuggestion, "getSuggestion"); +function stringifyInputType(input, greenKeys = false) { + if (typeof input === "string") { + return input; + } + if (input.values) { + return `enum ${input.name} { +${(0, import_indent_string.default)(input.values.join(", "), 2)} +}`; + } else { + const body = (0, import_indent_string.default)( + input.fields.map((arg2) => { + const key = `${arg2.name}`; + const str = `${greenKeys ? import_chalk.default.green(key) : key}${arg2.isRequired ? "" : "?"}: ${import_chalk.default.white( + arg2.inputTypes.map((argType) => { + return wrapWithList( + argIsInputType(argType.type) ? argType.type.name : stringifyGraphQLType(argType.type), + argType.isList + ); + }).join(" | ") + )}`; + if (!arg2.isRequired) { + return import_chalk.default.dim(str); + } + return str; + }).join("\n"), + 2 + ); + return `${import_chalk.default.dim("type")} ${import_chalk.default.bold.dim(input.name)} ${import_chalk.default.dim("{")} +${body} +${import_chalk.default.dim("}")}`; + } +} +__name(stringifyInputType, "stringifyInputType"); +function argIsInputType(arg2) { + if (typeof arg2 === "string") { + return false; + } + return true; +} +__name(argIsInputType, "argIsInputType"); +function getInputTypeName(input) { + if (typeof input === "string") { + if (input === "Null") { + return "null"; + } + return input; + } + return input.name; +} +__name(getInputTypeName, "getInputTypeName"); +function getOutputTypeName(input) { + if (typeof input === "string") { + return input; + } + return input.name; +} +__name(getOutputTypeName, "getOutputTypeName"); +function inputTypeToJson(input, isRequired, nameOnly = false) { + if (typeof input === "string") { + if (input === "Null") { + return "null"; + } + return input; + } + if (input.values) { + return input.values.join(" | "); + } + const inputType = input; + const showDeepType = isRequired && inputType.fields.every( + (arg2) => { + var _a3; + return arg2.inputTypes[0].location === "inputObjectTypes" || ((_a3 = arg2.inputTypes[1]) == null ? void 0 : _a3.location) === "inputObjectTypes"; + } + ); + if (nameOnly) { + return getInputTypeName(input); + } + return inputType.fields.reduce((acc, curr) => { + let str = ""; + if (!showDeepType && !curr.isRequired) { + str = curr.inputTypes.map((argType) => getInputTypeName(argType.type)).join(" | "); + } else { + str = curr.inputTypes.map((argInputType) => inputTypeToJson(argInputType.type, curr.isRequired, true)).join(" | "); + } + acc[curr.name + (curr.isRequired ? "" : "?")] = str; + return acc; + }, {}); +} +__name(inputTypeToJson, "inputTypeToJson"); +function unionBy(arr1, arr2, iteratee) { + const map = {}; + for (const element of arr1) { + map[iteratee(element)] = element; + } + for (const element of arr2) { + const key = iteratee(element); + if (!map[key]) { + map[key] = element; + } + } + return Object.values(map); +} +__name(unionBy, "unionBy"); +function lowerCase(name) { + return name.substring(0, 1).toLowerCase() + name.substring(1); +} +__name(lowerCase, "lowerCase"); +function isGroupByOutputName(type) { + return type.endsWith("GroupByOutputType"); +} +__name(isGroupByOutputName, "isGroupByOutputName"); +function isSchemaEnum(type) { + return typeof type === "object" && type !== null && typeof type.name === "string" && Array.isArray(type.values); +} +__name(isSchemaEnum, "isSchemaEnum"); + +// src/runtime/dmmf.ts +var DMMFDatamodelHelper = class { + constructor({ datamodel }) { + this.datamodel = datamodel; + this.datamodelEnumMap = this.getDatamodelEnumMap(); + this.modelMap = this.getModelMap(); + this.typeMap = this.getTypeMap(); + this.typeAndModelMap = this.getTypeModelMap(); + } + getDatamodelEnumMap() { + return keyBy(this.datamodel.enums, "name"); + } + getModelMap() { + return { ...keyBy(this.datamodel.models, "name") }; + } + getTypeMap() { + return { ...keyBy(this.datamodel.types, "name") }; + } + getTypeModelMap() { + return { ...this.getTypeMap(), ...this.getModelMap() }; + } +}; +__name(DMMFDatamodelHelper, "DMMFDatamodelHelper"); +var DMMFMappingsHelper = class { + constructor({ mappings }) { + this.mappings = mappings; + this.mappingsMap = this.getMappingsMap(); + } + getMappingsMap() { + return keyBy(this.mappings.modelOperations, "model"); + } +}; +__name(DMMFMappingsHelper, "DMMFMappingsHelper"); +var DMMFSchemaHelper = class { + constructor({ schema }) { + this.outputTypeToMergedOutputType = /* @__PURE__ */ __name((outputType) => { + return { + ...outputType, + fields: outputType.fields + }; + }, "outputTypeToMergedOutputType"); + this.schema = schema; + this.enumMap = this.getEnumMap(); + this.queryType = this.getQueryType(); + this.mutationType = this.getMutationType(); + this.outputTypes = this.getOutputTypes(); + this.outputTypeMap = this.getMergedOutputTypeMap(); + this.resolveOutputTypes(); + this.inputObjectTypes = this.schema.inputObjectTypes; + this.inputTypeMap = this.getInputTypeMap(); + this.resolveInputTypes(); + this.resolveFieldArgumentTypes(); + this.queryType = this.outputTypeMap.Query; + this.mutationType = this.outputTypeMap.Mutation; + this.rootFieldMap = this.getRootFieldMap(); + } + get [Symbol.toStringTag]() { + return "DMMFClass"; + } + resolveOutputTypes() { + for (const type of this.outputTypes.model) { + for (const field of type.fields) { + if (typeof field.outputType.type === "string" && !ScalarTypeTable[field.outputType.type]) { + field.outputType.type = this.outputTypeMap[field.outputType.type] || this.outputTypeMap[field.outputType.type] || this.enumMap[field.outputType.type] || field.outputType.type; + } + } + type.fieldMap = keyBy(type.fields, "name"); + } + for (const type of this.outputTypes.prisma) { + for (const field of type.fields) { + if (typeof field.outputType.type === "string" && !ScalarTypeTable[field.outputType.type]) { + field.outputType.type = this.outputTypeMap[field.outputType.type] || this.outputTypeMap[field.outputType.type] || this.enumMap[field.outputType.type] || field.outputType.type; + } + } + type.fieldMap = keyBy(type.fields, "name"); + } + } + resolveInputTypes() { + const inputTypes = this.inputObjectTypes.prisma; + if (this.inputObjectTypes.model) { + inputTypes.push(...this.inputObjectTypes.model); + } + for (const type of inputTypes) { + for (const field of type.fields) { + for (const fieldInputType of field.inputTypes) { + const fieldType = fieldInputType.type; + if (typeof fieldType === "string" && !ScalarTypeTable[fieldType] && (this.inputTypeMap[fieldType] || this.enumMap[fieldType])) { + fieldInputType.type = this.inputTypeMap[fieldType] || this.enumMap[fieldType] || fieldType; + } + } + } + type.fieldMap = keyBy(type.fields, "name"); + } + } + resolveFieldArgumentTypes() { + for (const type of this.outputTypes.prisma) { + for (const field of type.fields) { + for (const arg2 of field.args) { + for (const argInputType of arg2.inputTypes) { + const argType = argInputType.type; + if (typeof argType === "string" && !ScalarTypeTable[argType]) { + argInputType.type = this.inputTypeMap[argType] || this.enumMap[argType] || argType; + } + } + } + } + } + for (const type of this.outputTypes.model) { + for (const field of type.fields) { + for (const arg2 of field.args) { + for (const argInputType of arg2.inputTypes) { + const argType = argInputType.type; + if (typeof argType === "string" && !ScalarTypeTable[argType]) { + argInputType.type = this.inputTypeMap[argType] || this.enumMap[argType] || argInputType.type; + } + } + } + } + } + } + getQueryType() { + return this.schema.outputObjectTypes.prisma.find((t) => t.name === "Query"); + } + getMutationType() { + return this.schema.outputObjectTypes.prisma.find((t) => t.name === "Mutation"); + } + getOutputTypes() { + return { + model: this.schema.outputObjectTypes.model.map(this.outputTypeToMergedOutputType), + prisma: this.schema.outputObjectTypes.prisma.map(this.outputTypeToMergedOutputType) + }; + } + getEnumMap() { + return { + ...keyBy(this.schema.enumTypes.prisma, "name"), + ...this.schema.enumTypes.model ? keyBy(this.schema.enumTypes.model, "name") : void 0 + }; + } + hasEnumInNamespace(enumName, namespace) { + var _a3; + return ((_a3 = this.schema.enumTypes[namespace]) == null ? void 0 : _a3.find((schemaEnum) => schemaEnum.name === enumName)) !== void 0; + } + getMergedOutputTypeMap() { + return { + ...keyBy(this.outputTypes.model, "name"), + ...keyBy(this.outputTypes.prisma, "name") + }; + } + getInputTypeMap() { + return { + ...this.schema.inputObjectTypes.model ? keyBy(this.schema.inputObjectTypes.model, "name") : void 0, + ...keyBy(this.schema.inputObjectTypes.prisma, "name") + }; + } + getRootFieldMap() { + return { ...keyBy(this.queryType.fields, "name"), ...keyBy(this.mutationType.fields, "name") }; + } +}; +__name(DMMFSchemaHelper, "DMMFSchemaHelper"); +var BaseDMMFHelper = class { + constructor(dmmf) { + return Object.assign(this, new DMMFDatamodelHelper(dmmf), new DMMFMappingsHelper(dmmf)); + } +}; +__name(BaseDMMFHelper, "BaseDMMFHelper"); +applyMixins(BaseDMMFHelper, [DMMFDatamodelHelper, DMMFMappingsHelper]); +var DMMFHelper = class { + constructor(dmmf) { + return Object.assign(this, new BaseDMMFHelper(dmmf), new DMMFSchemaHelper(dmmf)); + } +}; +__name(DMMFHelper, "DMMFHelper"); +applyMixins(DMMFHelper, [BaseDMMFHelper, DMMFSchemaHelper]); + +// ../generator-helper/src/dmmf.ts +var DMMF; +((DMMF2) => { + let ModelAction; + ((ModelAction2) => { + ModelAction2["findUnique"] = "findUnique"; + ModelAction2["findFirst"] = "findFirst"; + ModelAction2["findMany"] = "findMany"; + ModelAction2["create"] = "create"; + ModelAction2["createMany"] = "createMany"; + ModelAction2["update"] = "update"; + ModelAction2["updateMany"] = "updateMany"; + ModelAction2["upsert"] = "upsert"; + ModelAction2["delete"] = "delete"; + ModelAction2["deleteMany"] = "deleteMany"; + ModelAction2["groupBy"] = "groupBy"; + ModelAction2["count"] = "count"; + ModelAction2["aggregate"] = "aggregate"; + ModelAction2["findRaw"] = "findRaw"; + ModelAction2["aggregateRaw"] = "aggregateRaw"; + })(ModelAction = DMMF2.ModelAction || (DMMF2.ModelAction = {})); +})(DMMF || (DMMF = {})); + +// ../debug/src/index.ts +var import_debug = __toESM(require_src()); +var MAX_LOGS = 100; +var debugArgsHistory = []; +var _a, _b; +if (typeof process !== "undefined" && typeof ((_a = process.stderr) == null ? void 0 : _a.write) !== "function") { + import_debug.default.log = (_b = console.debug) != null ? _b : console.log; +} +function debugCall(namespace) { + const debugNamespace = (0, import_debug.default)(namespace); + const call = Object.assign((...args) => { + debugNamespace.log = call.log; + if (args.length !== 0) { + debugArgsHistory.push([namespace, ...args]); + } + if (debugArgsHistory.length > MAX_LOGS) { + debugArgsHistory.shift(); + } + return debugNamespace("", ...args); + }, debugNamespace); + return call; +} +__name(debugCall, "debugCall"); +var Debug = Object.assign(debugCall, import_debug.default); +function getLogs(numChars = 7500) { + const output = debugArgsHistory.map( + (c) => c.map((item) => { + if (typeof item === "string") { + return item; + } + return JSON.stringify(item); + }).join(" ") + ).join("\n"); + if (output.length < numChars) { + return output; + } + return output.slice(-numChars); +} +__name(getLogs, "getLogs"); +var src_default = Debug; + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js +var _globalThis = typeof globalThis === "object" ? globalThis : global; + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/version.js +var VERSION = "1.1.0"; + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/internal/semver.js +var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; +function _makeCompatibilityCheck(ownVersion) { + var acceptedVersions = /* @__PURE__ */ new Set([ownVersion]); + var rejectedVersions = /* @__PURE__ */ new Set(); + var myVersionMatch = ownVersion.match(re); + if (!myVersionMatch) { + return function() { + return false; + }; + } + var ownVersionParsed = { + major: +myVersionMatch[1], + minor: +myVersionMatch[2], + patch: +myVersionMatch[3], + prerelease: myVersionMatch[4] + }; + if (ownVersionParsed.prerelease != null) { + return /* @__PURE__ */ __name(function isExactmatch(globalVersion) { + return globalVersion === ownVersion; + }, "isExactmatch"); + } + function _reject(v) { + rejectedVersions.add(v); + return false; + } + __name(_reject, "_reject"); + function _accept(v) { + acceptedVersions.add(v); + return true; + } + __name(_accept, "_accept"); + return /* @__PURE__ */ __name(function isCompatible2(globalVersion) { + if (acceptedVersions.has(globalVersion)) { + return true; + } + if (rejectedVersions.has(globalVersion)) { + return false; + } + var globalVersionMatch = globalVersion.match(re); + if (!globalVersionMatch) { + return _reject(globalVersion); + } + var globalVersionParsed = { + major: +globalVersionMatch[1], + minor: +globalVersionMatch[2], + patch: +globalVersionMatch[3], + prerelease: globalVersionMatch[4] + }; + if (globalVersionParsed.prerelease != null) { + return _reject(globalVersion); + } + if (ownVersionParsed.major !== globalVersionParsed.major) { + return _reject(globalVersion); + } + if (ownVersionParsed.major === 0) { + if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) { + return _accept(globalVersion); + } + return _reject(globalVersion); + } + if (ownVersionParsed.minor <= globalVersionParsed.minor) { + return _accept(globalVersion); + } + return _reject(globalVersion); + }, "isCompatible"); +} +__name(_makeCompatibilityCheck, "_makeCompatibilityCheck"); +var isCompatible = _makeCompatibilityCheck(VERSION); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js +var major = VERSION.split(".")[0]; +var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major); +var _global = _globalThis; +function registerGlobal(type, instance, diag3, allowOverride) { + var _a3; + if (allowOverride === void 0) { + allowOverride = false; + } + var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a3 !== void 0 ? _a3 : { + version: VERSION + }; + if (!allowOverride && api[type]) { + var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type); + diag3.error(err.stack || err.message); + return false; + } + if (api.version !== VERSION) { + var err = new Error("@opentelemetry/api: All API registration versions must match"); + diag3.error(err.stack || err.message); + return false; + } + api[type] = instance; + diag3.debug("@opentelemetry/api: Registered a global for " + type + " v" + VERSION + "."); + return true; +} +__name(registerGlobal, "registerGlobal"); +function getGlobal(type) { + var _a3, _b2; + var globalVersion = (_a3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a3 === void 0 ? void 0 : _a3.version; + if (!globalVersion || !isCompatible(globalVersion)) { + return; + } + return (_b2 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b2 === void 0 ? void 0 : _b2[type]; +} +__name(getGlobal, "getGlobal"); +function unregisterGlobal(type, diag3) { + diag3.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION + "."); + var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; + if (api) { + delete api[type]; + } +} +__name(unregisterGlobal, "unregisterGlobal"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js +var DiagComponentLogger = function() { + function DiagComponentLogger2(props) { + this._namespace = props.namespace || "DiagComponentLogger"; + } + __name(DiagComponentLogger2, "DiagComponentLogger"); + DiagComponentLogger2.prototype.debug = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return logProxy("debug", this._namespace, args); + }; + DiagComponentLogger2.prototype.error = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return logProxy("error", this._namespace, args); + }; + DiagComponentLogger2.prototype.info = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return logProxy("info", this._namespace, args); + }; + DiagComponentLogger2.prototype.warn = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return logProxy("warn", this._namespace, args); + }; + DiagComponentLogger2.prototype.verbose = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return logProxy("verbose", this._namespace, args); + }; + return DiagComponentLogger2; +}(); +function logProxy(funcName, namespace, args) { + var logger2 = getGlobal("diag"); + if (!logger2) { + return; + } + args.unshift(namespace); + return logger2[funcName].apply(logger2, args); +} +__name(logProxy, "logProxy"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/diag/types.js +var DiagLogLevel; +(function(DiagLogLevel2) { + DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE"; + DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR"; + DiagLogLevel2[DiagLogLevel2["WARN"] = 50] = "WARN"; + DiagLogLevel2[DiagLogLevel2["INFO"] = 60] = "INFO"; + DiagLogLevel2[DiagLogLevel2["DEBUG"] = 70] = "DEBUG"; + DiagLogLevel2[DiagLogLevel2["VERBOSE"] = 80] = "VERBOSE"; + DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL"; +})(DiagLogLevel || (DiagLogLevel = {})); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js +function createLogLevelDiagLogger(maxLevel, logger2) { + if (maxLevel < DiagLogLevel.NONE) { + maxLevel = DiagLogLevel.NONE; + } else if (maxLevel > DiagLogLevel.ALL) { + maxLevel = DiagLogLevel.ALL; + } + logger2 = logger2 || {}; + function _filterFunc(funcName, theLevel) { + var theFunc = logger2[funcName]; + if (typeof theFunc === "function" && maxLevel >= theLevel) { + return theFunc.bind(logger2); + } + return function() { + }; + } + __name(_filterFunc, "_filterFunc"); + return { + error: _filterFunc("error", DiagLogLevel.ERROR), + warn: _filterFunc("warn", DiagLogLevel.WARN), + info: _filterFunc("info", DiagLogLevel.INFO), + debug: _filterFunc("debug", DiagLogLevel.DEBUG), + verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE) + }; +} +__name(createLogLevelDiagLogger, "createLogLevelDiagLogger"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/api/diag.js +var API_NAME = "diag"; +var DiagAPI = function() { + function DiagAPI2() { + function _logProxy(funcName) { + return function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var logger2 = getGlobal("diag"); + if (!logger2) + return; + return logger2[funcName].apply(logger2, args); + }; + } + __name(_logProxy, "_logProxy"); + var self2 = this; + self2.setLogger = function(logger2, logLevel) { + var _a3, _b2; + if (logLevel === void 0) { + logLevel = DiagLogLevel.INFO; + } + if (logger2 === self2) { + var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); + self2.error((_a3 = err.stack) !== null && _a3 !== void 0 ? _a3 : err.message); + return false; + } + var oldLogger = getGlobal("diag"); + var newLogger = createLogLevelDiagLogger(logLevel, logger2); + if (oldLogger) { + var stack = (_b2 = new Error().stack) !== null && _b2 !== void 0 ? _b2 : ""; + oldLogger.warn("Current logger will be overwritten from " + stack); + newLogger.warn("Current logger will overwrite one already registered from " + stack); + } + return registerGlobal("diag", newLogger, self2, true); + }; + self2.disable = function() { + unregisterGlobal(API_NAME, self2); + }; + self2.createComponentLogger = function(options) { + return new DiagComponentLogger(options); + }; + self2.verbose = _logProxy("verbose"); + self2.debug = _logProxy("debug"); + self2.info = _logProxy("info"); + self2.warn = _logProxy("warn"); + self2.error = _logProxy("error"); + } + __name(DiagAPI2, "DiagAPI"); + DiagAPI2.instance = function() { + if (!this._instance) { + this._instance = new DiagAPI2(); + } + return this._instance; + }; + return DiagAPI2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js +var BaggageImpl = function() { + function BaggageImpl2(entries) { + this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map(); + } + __name(BaggageImpl2, "BaggageImpl"); + BaggageImpl2.prototype.getEntry = function(key) { + var entry = this._entries.get(key); + if (!entry) { + return void 0; + } + return Object.assign({}, entry); + }; + BaggageImpl2.prototype.getAllEntries = function() { + return Array.from(this._entries.entries()).map(function(_a3) { + var k = _a3[0], v = _a3[1]; + return [k, v]; + }); + }; + BaggageImpl2.prototype.setEntry = function(key, entry) { + var newBaggage = new BaggageImpl2(this._entries); + newBaggage._entries.set(key, entry); + return newBaggage; + }; + BaggageImpl2.prototype.removeEntry = function(key) { + var newBaggage = new BaggageImpl2(this._entries); + newBaggage._entries.delete(key); + return newBaggage; + }; + BaggageImpl2.prototype.removeEntries = function() { + var keys2 = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys2[_i] = arguments[_i]; + } + var newBaggage = new BaggageImpl2(this._entries); + for (var _a3 = 0, keys_1 = keys2; _a3 < keys_1.length; _a3++) { + var key = keys_1[_a3]; + newBaggage._entries.delete(key); + } + return newBaggage; + }; + BaggageImpl2.prototype.clear = function() { + return new BaggageImpl2(); + }; + return BaggageImpl2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js +var baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/baggage/utils.js +var diag = DiagAPI.instance(); +function createBaggage(entries) { + if (entries === void 0) { + entries = {}; + } + return new BaggageImpl(new Map(Object.entries(entries))); +} +__name(createBaggage, "createBaggage"); +function baggageEntryMetadataFromString(str) { + if (typeof str !== "string") { + diag.error("Cannot create baggage metadata from unknown type: " + typeof str); + str = ""; + } + return { + __TYPE__: baggageEntryMetadataSymbol, + toString: function() { + return str; + } + }; +} +__name(baggageEntryMetadataFromString, "baggageEntryMetadataFromString"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js +var consoleMap = [ + { n: "error", c: "error" }, + { n: "warn", c: "warn" }, + { n: "info", c: "info" }, + { n: "debug", c: "debug" }, + { n: "verbose", c: "trace" } +]; +var DiagConsoleLogger = function() { + function DiagConsoleLogger2() { + function _consoleFunc(funcName) { + return function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (console) { + var theFunc = console[funcName]; + if (typeof theFunc !== "function") { + theFunc = console.log; + } + if (typeof theFunc === "function") { + return theFunc.apply(console, args); + } + } + }; + } + __name(_consoleFunc, "_consoleFunc"); + for (var i = 0; i < consoleMap.length; i++) { + this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); + } + } + __name(DiagConsoleLogger2, "DiagConsoleLogger"); + return DiagConsoleLogger2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js +var defaultTextMapGetter = { + get: function(carrier, key) { + if (carrier == null) { + return void 0; + } + return carrier[key]; + }, + keys: function(carrier) { + if (carrier == null) { + return []; + } + return Object.keys(carrier); + } +}; +var defaultTextMapSetter = { + set: function(carrier, key, value) { + if (carrier == null) { + return; + } + carrier[key] = value; + } +}; + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/context/context.js +function createContextKey(description) { + return Symbol.for(description); +} +__name(createContextKey, "createContextKey"); +var BaseContext = function() { + function BaseContext2(parentContext) { + var self2 = this; + self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map(); + self2.getValue = function(key) { + return self2._currentContext.get(key); + }; + self2.setValue = function(key, value) { + var context3 = new BaseContext2(self2._currentContext); + context3._currentContext.set(key, value); + return context3; + }; + self2.deleteValue = function(key) { + var context3 = new BaseContext2(self2._currentContext); + context3._currentContext.delete(key); + return context3; + }; + } + __name(BaseContext2, "BaseContext"); + return BaseContext2; +}(); +var ROOT_CONTEXT = new BaseContext(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js +var __spreadArray = function(to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; +}; +var NoopContextManager = function() { + function NoopContextManager2() { + } + __name(NoopContextManager2, "NoopContextManager"); + NoopContextManager2.prototype.active = function() { + return ROOT_CONTEXT; + }; + NoopContextManager2.prototype.with = function(_context, fn, thisArg) { + var args = []; + for (var _i = 3; _i < arguments.length; _i++) { + args[_i - 3] = arguments[_i]; + } + return fn.call.apply(fn, __spreadArray([thisArg], args)); + }; + NoopContextManager2.prototype.bind = function(_context, target) { + return target; + }; + NoopContextManager2.prototype.enable = function() { + return this; + }; + NoopContextManager2.prototype.disable = function() { + return this; + }; + return NoopContextManager2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/api/context.js +var __spreadArray2 = function(to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; +}; +var API_NAME2 = "context"; +var NOOP_CONTEXT_MANAGER = new NoopContextManager(); +var ContextAPI = function() { + function ContextAPI2() { + } + __name(ContextAPI2, "ContextAPI"); + ContextAPI2.getInstance = function() { + if (!this._instance) { + this._instance = new ContextAPI2(); + } + return this._instance; + }; + ContextAPI2.prototype.setGlobalContextManager = function(contextManager) { + return registerGlobal(API_NAME2, contextManager, DiagAPI.instance()); + }; + ContextAPI2.prototype.active = function() { + return this._getContextManager().active(); + }; + ContextAPI2.prototype.with = function(context3, fn, thisArg) { + var _a3; + var args = []; + for (var _i = 3; _i < arguments.length; _i++) { + args[_i - 3] = arguments[_i]; + } + return (_a3 = this._getContextManager()).with.apply(_a3, __spreadArray2([context3, fn, thisArg], args)); + }; + ContextAPI2.prototype.bind = function(context3, target) { + return this._getContextManager().bind(context3, target); + }; + ContextAPI2.prototype._getContextManager = function() { + return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER; + }; + ContextAPI2.prototype.disable = function() { + this._getContextManager().disable(); + unregisterGlobal(API_NAME2, DiagAPI.instance()); + }; + return ContextAPI2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js +var TraceFlags; +(function(TraceFlags2) { + TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE"; + TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED"; +})(TraceFlags || (TraceFlags = {})); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js +var INVALID_SPANID = "0000000000000000"; +var INVALID_TRACEID = "00000000000000000000000000000000"; +var INVALID_SPAN_CONTEXT = { + traceId: INVALID_TRACEID, + spanId: INVALID_SPANID, + traceFlags: TraceFlags.NONE +}; + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js +var NonRecordingSpan = function() { + function NonRecordingSpan2(_spanContext) { + if (_spanContext === void 0) { + _spanContext = INVALID_SPAN_CONTEXT; + } + this._spanContext = _spanContext; + } + __name(NonRecordingSpan2, "NonRecordingSpan"); + NonRecordingSpan2.prototype.spanContext = function() { + return this._spanContext; + }; + NonRecordingSpan2.prototype.setAttribute = function(_key, _value) { + return this; + }; + NonRecordingSpan2.prototype.setAttributes = function(_attributes) { + return this; + }; + NonRecordingSpan2.prototype.addEvent = function(_name, _attributes) { + return this; + }; + NonRecordingSpan2.prototype.setStatus = function(_status) { + return this; + }; + NonRecordingSpan2.prototype.updateName = function(_name) { + return this; + }; + NonRecordingSpan2.prototype.end = function(_endTime) { + }; + NonRecordingSpan2.prototype.isRecording = function() { + return false; + }; + NonRecordingSpan2.prototype.recordException = function(_exception, _time) { + }; + return NonRecordingSpan2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js +var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN"); +function getSpan(context3) { + return context3.getValue(SPAN_KEY) || void 0; +} +__name(getSpan, "getSpan"); +function setSpan(context3, span) { + return context3.setValue(SPAN_KEY, span); +} +__name(setSpan, "setSpan"); +function deleteSpan(context3) { + return context3.deleteValue(SPAN_KEY); +} +__name(deleteSpan, "deleteSpan"); +function setSpanContext(context3, spanContext) { + return setSpan(context3, new NonRecordingSpan(spanContext)); +} +__name(setSpanContext, "setSpanContext"); +function getSpanContext(context3) { + var _a3; + return (_a3 = getSpan(context3)) === null || _a3 === void 0 ? void 0 : _a3.spanContext(); +} +__name(getSpanContext, "getSpanContext"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js +var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; +var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; +function isValidTraceId(traceId) { + return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID; +} +__name(isValidTraceId, "isValidTraceId"); +function isValidSpanId(spanId) { + return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID; +} +__name(isValidSpanId, "isValidSpanId"); +function isSpanContextValid(spanContext) { + return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId); +} +__name(isSpanContextValid, "isSpanContextValid"); +function wrapSpanContext(spanContext) { + return new NonRecordingSpan(spanContext); +} +__name(wrapSpanContext, "wrapSpanContext"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js +var context = ContextAPI.getInstance(); +var NoopTracer = function() { + function NoopTracer2() { + } + __name(NoopTracer2, "NoopTracer"); + NoopTracer2.prototype.startSpan = function(name, options, context3) { + var root = Boolean(options === null || options === void 0 ? void 0 : options.root); + if (root) { + return new NonRecordingSpan(); + } + var parentFromContext = context3 && getSpanContext(context3); + if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) { + return new NonRecordingSpan(parentFromContext); + } else { + return new NonRecordingSpan(); + } + }; + NoopTracer2.prototype.startActiveSpan = function(name, arg2, arg3, arg4) { + var opts; + var ctx; + var fn; + if (arguments.length < 2) { + return; + } else if (arguments.length === 2) { + fn = arg2; + } else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + var parentContext = ctx !== null && ctx !== void 0 ? ctx : context.active(); + var span = this.startSpan(name, opts, parentContext); + var contextWithSpanSet = setSpan(parentContext, span); + return context.with(contextWithSpanSet, fn, void 0, span); + }; + return NoopTracer2; +}(); +function isSpanContext(spanContext) { + return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number"; +} +__name(isSpanContext, "isSpanContext"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js +var NOOP_TRACER = new NoopTracer(); +var ProxyTracer = function() { + function ProxyTracer2(_provider, name, version, options) { + this._provider = _provider; + this.name = name; + this.version = version; + this.options = options; + } + __name(ProxyTracer2, "ProxyTracer"); + ProxyTracer2.prototype.startSpan = function(name, options, context3) { + return this._getTracer().startSpan(name, options, context3); + }; + ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) { + var tracer = this._getTracer(); + return Reflect.apply(tracer.startActiveSpan, tracer, arguments); + }; + ProxyTracer2.prototype._getTracer = function() { + if (this._delegate) { + return this._delegate; + } + var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); + if (!tracer) { + return NOOP_TRACER; + } + this._delegate = tracer; + return this._delegate; + }; + return ProxyTracer2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js +var NoopTracerProvider = function() { + function NoopTracerProvider2() { + } + __name(NoopTracerProvider2, "NoopTracerProvider"); + NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) { + return new NoopTracer(); + }; + return NoopTracerProvider2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js +var NOOP_TRACER_PROVIDER = new NoopTracerProvider(); +var ProxyTracerProvider = function() { + function ProxyTracerProvider2() { + } + __name(ProxyTracerProvider2, "ProxyTracerProvider"); + ProxyTracerProvider2.prototype.getTracer = function(name, version, options) { + var _a3; + return (_a3 = this.getDelegateTracer(name, version, options)) !== null && _a3 !== void 0 ? _a3 : new ProxyTracer(this, name, version, options); + }; + ProxyTracerProvider2.prototype.getDelegate = function() { + var _a3; + return (_a3 = this._delegate) !== null && _a3 !== void 0 ? _a3 : NOOP_TRACER_PROVIDER; + }; + ProxyTracerProvider2.prototype.setDelegate = function(delegate) { + this._delegate = delegate; + }; + ProxyTracerProvider2.prototype.getDelegateTracer = function(name, version, options) { + var _a3; + return (_a3 = this._delegate) === null || _a3 === void 0 ? void 0 : _a3.getTracer(name, version, options); + }; + return ProxyTracerProvider2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js +var SamplingDecision; +(function(SamplingDecision3) { + SamplingDecision3[SamplingDecision3["NOT_RECORD"] = 0] = "NOT_RECORD"; + SamplingDecision3[SamplingDecision3["RECORD"] = 1] = "RECORD"; + SamplingDecision3[SamplingDecision3["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; +})(SamplingDecision || (SamplingDecision = {})); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js +var SpanKind; +(function(SpanKind2) { + SpanKind2[SpanKind2["INTERNAL"] = 0] = "INTERNAL"; + SpanKind2[SpanKind2["SERVER"] = 1] = "SERVER"; + SpanKind2[SpanKind2["CLIENT"] = 2] = "CLIENT"; + SpanKind2[SpanKind2["PRODUCER"] = 3] = "PRODUCER"; + SpanKind2[SpanKind2["CONSUMER"] = 4] = "CONSUMER"; +})(SpanKind || (SpanKind = {})); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/status.js +var SpanStatusCode; +(function(SpanStatusCode2) { + SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET"; + SpanStatusCode2[SpanStatusCode2["OK"] = 1] = "OK"; + SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR"; +})(SpanStatusCode || (SpanStatusCode = {})); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js +var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; +var VALID_KEY = "[a-z]" + VALID_KEY_CHAR_RANGE + "{0,255}"; +var VALID_VENDOR_KEY = "[a-z0-9]" + VALID_KEY_CHAR_RANGE + "{0,240}@[a-z]" + VALID_KEY_CHAR_RANGE + "{0,13}"; +var VALID_KEY_REGEX = new RegExp("^(?:" + VALID_KEY + "|" + VALID_VENDOR_KEY + ")$"); +var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; +var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +__name(validateKey, "validateKey"); +function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); +} +__name(validateValue, "validateValue"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js +var MAX_TRACE_STATE_ITEMS = 32; +var MAX_TRACE_STATE_LEN = 512; +var LIST_MEMBERS_SEPARATOR = ","; +var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; +var TraceStateImpl = function() { + function TraceStateImpl2(rawTraceState) { + this._internalState = /* @__PURE__ */ new Map(); + if (rawTraceState) + this._parse(rawTraceState); + } + __name(TraceStateImpl2, "TraceStateImpl"); + TraceStateImpl2.prototype.set = function(key, value) { + var traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + }; + TraceStateImpl2.prototype.unset = function(key) { + var traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + }; + TraceStateImpl2.prototype.get = function(key) { + return this._internalState.get(key); + }; + TraceStateImpl2.prototype.serialize = function() { + var _this = this; + return this._keys().reduce(function(agg, key) { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + _this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR); + }; + TraceStateImpl2.prototype._parse = function(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce(function(agg, part) { + var listMember = part.trim(); + var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + var key = listMember.slice(0, i); + var value = listMember.slice(i + 1, part.length); + if (validateKey(key) && validateValue(value)) { + agg.set(key, value); + } else { + } + } + return agg; + }, /* @__PURE__ */ new Map()); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); + } + }; + TraceStateImpl2.prototype._keys = function() { + return Array.from(this._internalState.keys()).reverse(); + }; + TraceStateImpl2.prototype._clone = function() { + var traceState = new TraceStateImpl2(); + traceState._internalState = new Map(this._internalState); + return traceState; + }; + return TraceStateImpl2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/api/trace.js +var API_NAME3 = "trace"; +var TraceAPI = function() { + function TraceAPI2() { + this._proxyTracerProvider = new ProxyTracerProvider(); + this.wrapSpanContext = wrapSpanContext; + this.isSpanContextValid = isSpanContextValid; + this.deleteSpan = deleteSpan; + this.getSpan = getSpan; + this.getSpanContext = getSpanContext; + this.setSpan = setSpan; + this.setSpanContext = setSpanContext; + } + __name(TraceAPI2, "TraceAPI"); + TraceAPI2.getInstance = function() { + if (!this._instance) { + this._instance = new TraceAPI2(); + } + return this._instance; + }; + TraceAPI2.prototype.setGlobalTracerProvider = function(provider) { + var success = registerGlobal(API_NAME3, this._proxyTracerProvider, DiagAPI.instance()); + if (success) { + this._proxyTracerProvider.setDelegate(provider); + } + return success; + }; + TraceAPI2.prototype.getTracerProvider = function() { + return getGlobal(API_NAME3) || this._proxyTracerProvider; + }; + TraceAPI2.prototype.getTracer = function(name, version) { + return this.getTracerProvider().getTracer(name, version); + }; + TraceAPI2.prototype.disable = function() { + unregisterGlobal(API_NAME3, DiagAPI.instance()); + this._proxyTracerProvider = new ProxyTracerProvider(); + }; + return TraceAPI2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js +var NoopTextMapPropagator = function() { + function NoopTextMapPropagator2() { + } + __name(NoopTextMapPropagator2, "NoopTextMapPropagator"); + NoopTextMapPropagator2.prototype.inject = function(_context, _carrier) { + }; + NoopTextMapPropagator2.prototype.extract = function(context3, _carrier) { + return context3; + }; + NoopTextMapPropagator2.prototype.fields = function() { + return []; + }; + return NoopTextMapPropagator2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js +var BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key"); +function getBaggage(context3) { + return context3.getValue(BAGGAGE_KEY) || void 0; +} +__name(getBaggage, "getBaggage"); +function setBaggage(context3, baggage) { + return context3.setValue(BAGGAGE_KEY, baggage); +} +__name(setBaggage, "setBaggage"); +function deleteBaggage(context3) { + return context3.deleteValue(BAGGAGE_KEY); +} +__name(deleteBaggage, "deleteBaggage"); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/api/propagation.js +var API_NAME4 = "propagation"; +var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator(); +var PropagationAPI = function() { + function PropagationAPI2() { + this.createBaggage = createBaggage; + this.getBaggage = getBaggage; + this.setBaggage = setBaggage; + this.deleteBaggage = deleteBaggage; + } + __name(PropagationAPI2, "PropagationAPI"); + PropagationAPI2.getInstance = function() { + if (!this._instance) { + this._instance = new PropagationAPI2(); + } + return this._instance; + }; + PropagationAPI2.prototype.setGlobalPropagator = function(propagator) { + return registerGlobal(API_NAME4, propagator, DiagAPI.instance()); + }; + PropagationAPI2.prototype.inject = function(context3, carrier, setter) { + if (setter === void 0) { + setter = defaultTextMapSetter; + } + return this._getGlobalPropagator().inject(context3, carrier, setter); + }; + PropagationAPI2.prototype.extract = function(context3, carrier, getter) { + if (getter === void 0) { + getter = defaultTextMapGetter; + } + return this._getGlobalPropagator().extract(context3, carrier, getter); + }; + PropagationAPI2.prototype.fields = function() { + return this._getGlobalPropagator().fields(); + }; + PropagationAPI2.prototype.disable = function() { + unregisterGlobal(API_NAME4, DiagAPI.instance()); + }; + PropagationAPI2.prototype._getGlobalPropagator = function() { + return getGlobal(API_NAME4) || NOOP_TEXT_MAP_PROPAGATOR; + }; + return PropagationAPI2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+api@1.1.0/node_modules/@opentelemetry/api/build/esm/index.js +var context2 = ContextAPI.getInstance(); +var trace = TraceAPI.getInstance(); +var propagation = PropagationAPI.getInstance(); +var diag2 = DiagAPI.instance(); + +// ../engines/src/index.ts +var import_engines_version = __toESM(require_engines_version()); + +// ../get-platform/src/getNodeAPIName.ts +var NODE_API_QUERY_ENGINE_URL_BASE = "libquery_engine"; +function getNodeAPIName(platform3, type) { + const isUrl = type === "url"; + if (platform3.includes("windows")) { + return isUrl ? `query_engine.dll.node` : `query_engine-${platform3}.dll.node`; + } else if (platform3.includes("darwin")) { + return isUrl ? `${NODE_API_QUERY_ENGINE_URL_BASE}.dylib.node` : `${NODE_API_QUERY_ENGINE_URL_BASE}-${platform3}.dylib.node`; + } else { + return isUrl ? `${NODE_API_QUERY_ENGINE_URL_BASE}.so.node` : `${NODE_API_QUERY_ENGINE_URL_BASE}-${platform3}.so.node`; + } +} +__name(getNodeAPIName, "getNodeAPIName"); + +// ../get-platform/src/getPlatform.ts +var import_child_process = require("child_process"); +var import_fs = __toESM(require("fs")); +var import_os = __toESM(require("os")); +var import_util = require("util"); +var readFile = (0, import_util.promisify)(import_fs.default.readFile); +var exists = (0, import_util.promisify)(import_fs.default.exists); +async function getos() { + const platform3 = import_os.default.platform(); + const arch2 = process.arch; + if (platform3 === "freebsd") { + const version = await gracefulExec(`freebsd-version`); + if (version && version.trim().length > 0) { + const regex = /^(\d+)\.?/; + const match = regex.exec(version); + if (match) { + return { + platform: "freebsd", + distro: `freebsd${match[1]}`, + arch: arch2 + }; + } + } + } + if (platform3 !== "linux") { + return { + platform: platform3, + arch: arch2 + }; + } + return { + platform: "linux", + libssl: await getOpenSSLVersion(), + distro: await resolveDistro(), + arch: arch2 + }; +} +__name(getos, "getos"); +function parseDistro(input) { + const idRegex = /^ID="?([^"\n]*)"?$/im; + const idLikeRegex = /^ID_LIKE="?([^"\n]*)"?$/im; + const idMatch = idRegex.exec(input); + const id = idMatch && idMatch[1] && idMatch[1].toLowerCase() || ""; + const idLikeMatch = idLikeRegex.exec(input); + const idLike = idLikeMatch && idLikeMatch[1] && idLikeMatch[1].toLowerCase() || ""; + if (id === "raspbian") { + return "arm"; + } + if (id === "nixos") { + return "nixos"; + } + if (idLike.includes("centos") || idLike.includes("fedora") || idLike.includes("rhel") || id === "fedora") { + return "rhel"; + } + if (idLike.includes("debian") || idLike.includes("ubuntu") || id === "debian") { + return "debian"; + } + return; +} +__name(parseDistro, "parseDistro"); +async function resolveDistro() { + const osReleaseFile = "/etc/os-release"; + const alpineReleaseFile = "/etc/alpine-release"; + if (await exists(alpineReleaseFile)) { + return "musl"; + } else if (await exists(osReleaseFile)) { + return parseDistro(await readFile(osReleaseFile, "utf-8")); + } else { + return; + } +} +__name(resolveDistro, "resolveDistro"); +function parseOpenSSLVersion(input) { + const match = /^OpenSSL\s(\d+\.\d+)\.\d+/.exec(input); + if (match) { + return match[1] + ".x"; + } + return; +} +__name(parseOpenSSLVersion, "parseOpenSSLVersion"); +async function getOpenSSLVersion() { + const [version, ls] = await Promise.all([ + gracefulExec(`openssl version -v`), + gracefulExec(` + ls -l /lib64 | grep ssl; + ls -l /usr/lib64 | grep ssl; + `) + ]); + if (version) { + const v = parseOpenSSLVersion(version); + if (v) { + return v; + } + } + if (ls) { + const match = /libssl\.so\.(\d+\.\d+)\.\d+/.exec(ls); + if (match) { + return match[1] + ".x"; + } + } + return void 0; +} +__name(getOpenSSLVersion, "getOpenSSLVersion"); +async function gracefulExec(cmd) { + return new Promise((resolve) => { + try { + (0, import_child_process.exec)(cmd, (err, stdout) => { + resolve(String(stdout)); + }); + } catch (e) { + resolve(void 0); + return void 0; + } + return void 0; + }); +} +__name(gracefulExec, "gracefulExec"); +async function getPlatform() { + const { platform: platform3, libssl, distro, arch: arch2 } = await getos(); + if (platform3 === "darwin" && arch2 === "arm64") { + return "darwin-arm64"; + } + if (platform3 === "darwin") { + return "darwin"; + } + if (platform3 === "win32") { + return "windows"; + } + if (platform3 === "freebsd") { + return distro; + } + if (platform3 === "openbsd") { + return "openbsd"; + } + if (platform3 === "netbsd") { + return "netbsd"; + } + if (platform3 === "linux" && arch2 === "arm64") { + return `linux-arm64-openssl-${libssl}`; + } + if (platform3 === "linux" && arch2 === "arm") { + return `linux-arm-openssl-${libssl}`; + } + if (platform3 === "linux" && distro === "nixos") { + return "linux-nixos"; + } + if (platform3 === "linux" && distro === "musl") { + return "linux-musl"; + } + if (platform3 === "linux" && distro && libssl) { + return distro + "-openssl-" + libssl; + } + if (libssl) { + return "debian-openssl-" + libssl; + } + if (distro) { + return distro + "-openssl-1.1.x"; + } + return "debian-openssl-1.1.x"; +} +__name(getPlatform, "getPlatform"); + +// ../get-platform/src/isNodeAPISupported.ts +var import_fs2 = __toESM(require("fs")); +async function isNodeAPISupported() { + const customLibraryPath = process.env.PRISMA_QUERY_ENGINE_LIBRARY; + const customLibraryExists = customLibraryPath && import_fs2.default.existsSync(customLibraryPath); + const os3 = await getos(); + if (!customLibraryExists && (os3.arch === "x32" || os3.arch === "ia32")) { + throw new Error( + `The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set \`engineType = "binary"\` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)` + ); + } +} +__name(isNodeAPISupported, "isNodeAPISupported"); + +// ../get-platform/src/platforms.ts +var platforms = [ + "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-nixos", + "windows", + "freebsd11", + "freebsd12", + "freebsd13", + "openbsd", + "netbsd", + "arm" +]; + +// ../engines/src/index.ts +var import_path = __toESM(require("path")); +var import_engines_version2 = __toESM(require_engines_version()); +var debug2 = src_default("prisma:engines"); +function getEnginesPath() { + return import_path.default.join(__dirname, "../"); +} +__name(getEnginesPath, "getEnginesPath"); +var DEFAULT_CLI_QUERY_ENGINE_BINARY_TYPE = "libquery-engine" /* libqueryEngine */; +import_path.default.join(__dirname, "../query-engine-darwin"); +import_path.default.join(__dirname, "../introspection-engine-darwin"); +import_path.default.join(__dirname, "../prisma-fmt-darwin"); +import_path.default.join(__dirname, "../query-engine-darwin-arm64"); +import_path.default.join(__dirname, "../introspection-engine-darwin-arm64"); +import_path.default.join(__dirname, "../prisma-fmt-darwin-arm64"); +import_path.default.join(__dirname, "../query-engine-debian-openssl-1.0.x"); +import_path.default.join(__dirname, "../introspection-engine-debian-openssl-1.0.x"); +import_path.default.join(__dirname, "../prisma-fmt-debian-openssl-1.0.x"); +import_path.default.join(__dirname, "../query-engine-debian-openssl-1.1.x"); +import_path.default.join(__dirname, "../introspection-engine-debian-openssl-1.1.x"); +import_path.default.join(__dirname, "../prisma-fmt-debian-openssl-1.1.x"); +import_path.default.join(__dirname, "../query-engine-debian-openssl-3.0.x"); +import_path.default.join(__dirname, "../introspection-engine-debian-openssl-3.0.x"); +import_path.default.join(__dirname, "../prisma-fmt-debian-openssl-3.0.x"); +import_path.default.join(__dirname, "../query-engine-rhel-openssl-1.0.x"); +import_path.default.join(__dirname, "../introspection-engine-rhel-openssl-1.0.x"); +import_path.default.join(__dirname, "../prisma-fmt-rhel-openssl-1.0.x"); +import_path.default.join(__dirname, "../query-engine-rhel-openssl-1.1.x"); +import_path.default.join(__dirname, "../introspection-engine-rhel-openssl-1.1.x"); +import_path.default.join(__dirname, "../prisma-fmt-rhel-openssl-1.1.x"); +import_path.default.join(__dirname, "../query-engine-rhel-openssl-3.0.x"); +import_path.default.join(__dirname, "../introspection-engine-rhel-openssl-3.0.x"); +import_path.default.join(__dirname, "../prisma-fmt-rhel-openssl-3.0.x"); +import_path.default.join(__dirname, "../libquery_engine-darwin.dylib.node"); +import_path.default.join(__dirname, "../libquery_engine-darwin-arm64.dylib.node"); +import_path.default.join(__dirname, "../libquery_engine-debian-openssl-1.0.x.so.node"); +import_path.default.join(__dirname, "../libquery_engine-debian-openssl-1.1.x.so.node"); +import_path.default.join(__dirname, "../libquery_engine-debian-openssl-3.0.x.so.node"); +import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-1.0.x.so.node"); +import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-1.1.x.so.node"); +import_path.default.join(__dirname, "../libquery_engine-linux-arm64-openssl-3.0.x.so.node"); +import_path.default.join(__dirname, "../libquery_engine-linux-musl.so.node"); +import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-1.0.x.so.node"); +import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-1.1.x.so.node"); +import_path.default.join(__dirname, "../libquery_engine-rhel-openssl-3.0.x.so.node"); +import_path.default.join(__dirname, "../query_engine-windows.dll.node"); + +// ../engine-core/src/binary/BinaryEngine.ts +var import_chalk3 = __toESM(require_source()); +var import_child_process2 = require("child_process"); +var import_events = __toESM(require("events")); +var import_execa = __toESM(require_execa()); +var import_fs4 = __toESM(require("fs")); +var import_net = __toESM(require("net")); +var import_p_retry = __toESM(require_p_retry()); +var import_path2 = __toESM(require("path")); +var import_url = require("url"); +var import_util4 = require("util"); + +// ../engine-core/src/common/Engine.ts +var Engine = class { +}; +__name(Engine, "Engine"); + +// ../engine-core/src/common/errors/PrismaClientInitializationError.ts +var PrismaClientInitializationError = class extends Error { + constructor(message, clientVersion2, errorCode) { + super(message); + this.clientVersion = clientVersion2; + this.errorCode = errorCode; + Error.captureStackTrace(PrismaClientInitializationError); + } + get [Symbol.toStringTag]() { + return "PrismaClientInitializationError"; + } +}; +__name(PrismaClientInitializationError, "PrismaClientInitializationError"); + +// ../engine-core/src/common/errors/PrismaClientKnownRequestError.ts +var PrismaClientKnownRequestError = class extends Error { + constructor(message, code, clientVersion2, meta) { + super(message); + this.code = code; + this.clientVersion = clientVersion2; + this.meta = meta; + } + get [Symbol.toStringTag]() { + return "PrismaClientKnownRequestError"; + } +}; +__name(PrismaClientKnownRequestError, "PrismaClientKnownRequestError"); + +// ../engine-core/src/common/errors/utils/log.ts +function getMessage(log4) { + if (typeof log4 === "string") { + return log4; + } else if (isRustError(log4)) { + return getBacktraceFromRustError(log4); + } else if (isRustLog(log4)) { + return getBacktraceFromLog(log4); + } + return JSON.stringify(log4); +} +__name(getMessage, "getMessage"); +function getBacktraceFromLog(log4) { + var _a3, _b2, _c, _d, _e, _f, _g; + if ((_a3 = log4.fields) == null ? void 0 : _a3.message) { + let str = (_b2 = log4.fields) == null ? void 0 : _b2.message; + if ((_c = log4.fields) == null ? void 0 : _c.file) { + str += ` in ${log4.fields.file}`; + if ((_d = log4.fields) == null ? void 0 : _d.line) { + str += `:${log4.fields.line}`; + } + if ((_e = log4.fields) == null ? void 0 : _e.column) { + str += `:${log4.fields.column}`; + } + } + if ((_f = log4.fields) == null ? void 0 : _f.reason) { + str += ` +${(_g = log4.fields) == null ? void 0 : _g.reason}`; + } + return str; + } + return "Unknown error"; +} +__name(getBacktraceFromLog, "getBacktraceFromLog"); +function getBacktraceFromRustError(err) { + let str = ""; + if (err.is_panic) { + str += `PANIC`; + } + if (err.backtrace) { + str += ` in ${err.backtrace}`; + } + if (err.message) { + str += ` +${err.message}`; + } + return str; +} +__name(getBacktraceFromRustError, "getBacktraceFromRustError"); +function isRustLog(e) { + return e.timestamp && typeof e.level === "string" && typeof e.target === "string"; +} +__name(isRustLog, "isRustLog"); +function isRustErrorLog(e) { + var _a3, _b2; + return isRustLog(e) && (e.level === "error" || ((_b2 = (_a3 = e.fields) == null ? void 0 : _a3.message) == null ? void 0 : _b2.includes("fatal error"))); +} +__name(isRustErrorLog, "isRustErrorLog"); +function isRustError(e) { + return typeof e.is_panic !== "undefined"; +} +__name(isRustError, "isRustError"); +function convertLog(rustLog) { + const isQuery = isQueryLog(rustLog.fields); + const level = isQuery ? "query" : rustLog.level.toLowerCase(); + return { + ...rustLog, + level, + timestamp: new Date(rustLog.timestamp) + }; +} +__name(convertLog, "convertLog"); +function isQueryLog(fields) { + return Boolean(fields.query); +} +__name(isQueryLog, "isQueryLog"); + +// ../engine-core/src/common/errors/PrismaClientRustError.ts +var PrismaClientRustError = class extends Error { + constructor({ clientVersion: clientVersion2, log: log4, error: error2 }) { + var __super = (...args) => { + super(...args); + }; + if (log4) { + const backtrace = getBacktraceFromLog(log4); + __super(backtrace != null ? backtrace : "Unknown error"); + } else if (error2) { + const backtrace = getBacktraceFromRustError(error2); + __super(backtrace); + } else { + __super(`Unknown error`); + } + this.clientVersion = clientVersion2; + } + get [Symbol.toStringTag]() { + return "PrismaClientRustPanicError"; + } +}; +__name(PrismaClientRustError, "PrismaClientRustError"); + +// ../engine-core/src/common/errors/PrismaClientRustPanicError.ts +var PrismaClientRustPanicError = class extends Error { + constructor(message, clientVersion2) { + super(message); + this.clientVersion = clientVersion2; + } + get [Symbol.toStringTag]() { + return "PrismaClientRustPanicError"; + } +}; +__name(PrismaClientRustPanicError, "PrismaClientRustPanicError"); + +// ../engine-core/src/common/errors/PrismaClientUnknownRequestError.ts +var PrismaClientUnknownRequestError = class extends Error { + constructor(message, clientVersion2) { + super(message); + this.clientVersion = clientVersion2; + } + get [Symbol.toStringTag]() { + return "PrismaClientUnknownRequestError"; + } +}; +__name(PrismaClientUnknownRequestError, "PrismaClientUnknownRequestError"); + +// ../engine-core/src/common/errors/utils/getErrorMessageWithLink.ts +var import_chalk2 = __toESM(require_source()); +var import_strip_ansi = __toESM(require_strip_ansi()); + +// ../engine-core/src/common/utils/util.ts +var import_fs3 = __toESM(require("fs")); +var import_new_github_issue_url = __toESM(require_new_github_issue_url()); +var debug3 = src_default("plusX"); +function plusX(file) { + const s = import_fs3.default.statSync(file); + const newMode = s.mode | 64 | 8 | 1; + if (s.mode === newMode) { + debug3(`Execution permissions of ${file} are fine`); + return; + } + const base8 = newMode.toString(8).slice(-3); + debug3(`Have to call plusX on ${file}`); + import_fs3.default.chmodSync(file, base8); +} +__name(plusX, "plusX"); +function transformPlatformToEnvValue(platform3) { + return { fromEnvVar: null, value: platform3 }; +} +__name(transformPlatformToEnvValue, "transformPlatformToEnvValue"); +function fixBinaryTargets(binaryTargets, platform3) { + binaryTargets = binaryTargets || []; + if (!binaryTargets.find((object) => object.value === "native")) { + return [transformPlatformToEnvValue("native"), ...binaryTargets]; + } + return [...binaryTargets, transformPlatformToEnvValue(platform3)]; +} +__name(fixBinaryTargets, "fixBinaryTargets"); +function getGithubIssueUrl({ + title, + user = "prisma", + repo = "prisma", + template = "bug_report.md", + body +}) { + return (0, import_new_github_issue_url.default)({ + user, + repo, + template, + title, + body + }); +} +__name(getGithubIssueUrl, "getGithubIssueUrl"); + +// ../engine-core/src/common/errors/utils/maskQuery.ts +function maskQuery(query2) { + if (!query2) { + return ""; + } + return query2.replace(/".*"/g, '"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g, (substr) => { + return `${substr[0]}5`; + }); +} +__name(maskQuery, "maskQuery"); + +// ../engine-core/src/common/errors/utils/normalizeLogs.ts +function normalizeLogs(logs) { + return logs.split("\n").map((l) => { + return l.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("\n"); +} +__name(normalizeLogs, "normalizeLogs"); + +// ../engine-core/src/common/errors/utils/getErrorMessageWithLink.ts +function getErrorMessageWithLink({ + version, + platform: platform3, + title, + description, + engineVersion, + database, + query: query2 +}) { + var _a3, _b2; + const gotLogs = getLogs(6e3 - ((_a3 = query2 == null ? void 0 : query2.length) != null ? _a3 : 0)); + const logs = normalizeLogs((0, import_strip_ansi.default)(gotLogs)); + const moreInfo = description ? `# Description +\`\`\` +${description} +\`\`\`` : ""; + const body = (0, import_strip_ansi.default)( + `Hi Prisma Team! My Prisma Client just crashed. This is the report: +## Versions + +| Name | Version | +|-----------------|--------------------| +| Node | ${(_b2 = process.version) == null ? void 0 : _b2.padEnd(19)}| +| OS | ${platform3 == null ? void 0 : platform3.padEnd(19)}| +| Prisma Client | ${version == null ? void 0 : version.padEnd(19)}| +| Query Engine | ${engineVersion == null ? void 0 : engineVersion.padEnd(19)}| +| Database | ${database == null ? void 0 : database.padEnd(19)}| + +${moreInfo} + +## Logs +\`\`\` +${logs} +\`\`\` + +## Client Snippet +\`\`\`ts +// PLEASE FILL YOUR CODE SNIPPET HERE +\`\`\` + +## Schema +\`\`\`prisma +// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE +\`\`\` + +## Prisma Engine Query +\`\`\` +${query2 ? maskQuery(query2) : ""} +\`\`\` +` + ); + const url = getGithubIssueUrl({ title, body }); + return `${title} + +This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. + +${import_chalk2.default.underline(url)} + +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. +`; +} +__name(getErrorMessageWithLink, "getErrorMessageWithLink"); + +// ../engine-core/src/common/errors/utils/prismaGraphQLToJSError.ts +function prismaGraphQLToJSError(error2, clientVersion2) { + if (error2.user_facing_error.error_code) { + return new PrismaClientKnownRequestError( + error2.user_facing_error.message, + error2.user_facing_error.error_code, + clientVersion2, + error2.user_facing_error.meta + ); + } + return new PrismaClientUnknownRequestError(error2.error, clientVersion2); +} +__name(prismaGraphQLToJSError, "prismaGraphQLToJSError"); + +// ../engine-core/src/common/utils/printGeneratorConfig.ts +var import_indent_string2 = __toESM(require_indent_string()); +function printGeneratorConfig(config2) { + return String(new GeneratorConfigClass(config2)); +} +__name(printGeneratorConfig, "printGeneratorConfig"); +var GeneratorConfigClass = class { + constructor(config2) { + this.config = config2; + } + toString() { + const { config: config2 } = this; + const provider = config2.provider.fromEnvVar ? `env("${config2.provider.fromEnvVar}")` : config2.provider.value; + const obj = JSON.parse( + JSON.stringify({ + provider, + binaryTargets: getOriginalBinaryTargetsValue(config2.binaryTargets) + }) + ); + return `generator ${config2.name} { +${(0, import_indent_string2.default)(printDatamodelObject(obj), 2)} +}`; + } +}; +__name(GeneratorConfigClass, "GeneratorConfigClass"); +function getOriginalBinaryTargetsValue(binaryTargets) { + let value; + if (binaryTargets.length > 0) { + const binaryTargetsFromEnvVar = binaryTargets.find((object) => object.fromEnvVar !== null); + if (binaryTargetsFromEnvVar) { + value = `env("${binaryTargetsFromEnvVar.fromEnvVar}")`; + } else { + value = binaryTargets.map((object) => object.value); + } + } else { + value = void 0; + } + return value; +} +__name(getOriginalBinaryTargetsValue, "getOriginalBinaryTargetsValue"); +function printDatamodelObject(obj) { + const maxLength = Object.keys(obj).reduce((max2, curr) => Math.max(max2, curr.length), 0); + return Object.entries(obj).map(([key, value]) => `${key.padEnd(maxLength)} = ${niceStringify(value)}`).join("\n"); +} +__name(printDatamodelObject, "printDatamodelObject"); +function niceStringify(value) { + return JSON.parse( + JSON.stringify(value, (_, value2) => { + if (Array.isArray(value2)) { + return `[${value2.map((element) => JSON.stringify(element)).join(", ")}]`; + } + return JSON.stringify(value2); + }) + ); +} +__name(niceStringify, "niceStringify"); + +// ../engine-core/src/tools/byline.ts +var import_stream = __toESM(require("stream")); +var import_util3 = __toESM(require("util")); +function byline(readStream, options) { + return createStream(readStream, options); +} +__name(byline, "byline"); +function createStream(readStream, options) { + if (readStream) { + return createLineStream(readStream, options); + } else { + return new LineStream(options); + } +} +__name(createStream, "createStream"); +function createLineStream(readStream, options) { + if (!readStream) { + throw new Error("expected readStream"); + } + if (!readStream.readable) { + throw new Error("readStream must be readable"); + } + const ls = new LineStream(options); + readStream.pipe(ls); + return ls; +} +__name(createLineStream, "createLineStream"); +function LineStream(options) { + import_stream.default.Transform.call(this, options); + options = options || {}; + this._readableState.objectMode = true; + this._lineBuffer = []; + this._keepEmptyLines = options.keepEmptyLines || false; + this._lastChunkEndedWithCR = false; + this.on("pipe", function(src) { + if (!this.encoding) { + if (src instanceof import_stream.default.Readable) { + this.encoding = src._readableState.encoding; + } + } + }); +} +__name(LineStream, "LineStream"); +import_util3.default.inherits(LineStream, import_stream.default.Transform); +LineStream.prototype._transform = function(chunk, encoding, done) { + encoding = encoding || "utf8"; + if (Buffer.isBuffer(chunk)) { + if (encoding == "buffer") { + chunk = chunk.toString(); + encoding = "utf8"; + } else { + chunk = chunk.toString(encoding); + } + } + this._chunkEncoding = encoding; + const lines = chunk.split(/\r\n|\r|\n/g); + if (this._lastChunkEndedWithCR && chunk[0] == "\n") { + lines.shift(); + } + if (this._lineBuffer.length > 0) { + this._lineBuffer[this._lineBuffer.length - 1] += lines[0]; + lines.shift(); + } + this._lastChunkEndedWithCR = chunk[chunk.length - 1] == "\r"; + this._lineBuffer = this._lineBuffer.concat(lines); + this._pushBuffer(encoding, 1, done); +}; +LineStream.prototype._pushBuffer = function(encoding, keep, done) { + while (this._lineBuffer.length > keep) { + const line = this._lineBuffer.shift(); + if (this._keepEmptyLines || line.length > 0) { + if (!this.push(this._reencode(line, encoding))) { + const self2 = this; + setImmediate(function() { + self2._pushBuffer(encoding, keep, done); + }); + return; + } + } + } + done(); +}; +LineStream.prototype._flush = function(done) { + this._pushBuffer(this._chunkEncoding, 0, done); +}; +LineStream.prototype._reencode = function(line, chunkEncoding) { + if (this.encoding && this.encoding != chunkEncoding) { + return Buffer.from(line, chunkEncoding).toString(this.encoding); + } else if (this.encoding) { + return line; + } else { + return Buffer.from(line, chunkEncoding); + } +}; + +// ../engine-core/src/tools/omit.ts +function omit(obj, keys2) { + return Object.keys(obj).filter((key) => !keys2.includes(key)).reduce((result, key) => { + result[key] = obj[key]; + return result; + }, {}); +} +__name(omit, "omit"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js +var SUPPRESS_TRACING_KEY = createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); +function suppressTracing(context3) { + return context3.setValue(SUPPRESS_TRACING_KEY, true); +} +__name(suppressTracing, "suppressTracing"); +function isTracingSuppressed(context3) { + return context3.getValue(SUPPRESS_TRACING_KEY) === true; +} +__name(isTracingSuppressed, "isTracingSuppressed"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/baggage/constants.js +var BAGGAGE_KEY_PAIR_SEPARATOR = "="; +var BAGGAGE_PROPERTIES_SEPARATOR = ";"; +var BAGGAGE_ITEMS_SEPARATOR = ","; +var BAGGAGE_HEADER = "baggage"; +var BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; +var BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; +var BAGGAGE_MAX_TOTAL_LENGTH = 8192; + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/baggage/utils.js +var __read = function(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) + return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) + ar.push(r.value); + } catch (error2) { + e = { error: error2 }; + } finally { + try { + if (r && !r.done && (m = i["return"])) + m.call(i); + } finally { + if (e) + throw e.error; + } + } + return ar; +}; +function serializeKeyPairs(keyPairs) { + return keyPairs.reduce(function(hValue, current) { + var value = "" + hValue + (hValue !== "" ? BAGGAGE_ITEMS_SEPARATOR : "") + current; + return value.length > BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); +} +__name(serializeKeyPairs, "serializeKeyPairs"); +function getKeyPairs(baggage) { + return baggage.getAllEntries().map(function(_a3) { + var _b2 = __read(_a3, 2), key = _b2[0], value = _b2[1]; + var entry = encodeURIComponent(key) + "=" + encodeURIComponent(value.value); + if (value.metadata !== void 0) { + entry += BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); +} +__name(getKeyPairs, "getKeyPairs"); +function parsePairKeyValue(entry) { + var valueProps = entry.split(BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + var keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + var keyPair = keyPairPart.split(BAGGAGE_KEY_PAIR_SEPARATOR); + if (keyPair.length !== 2) + return; + var key = decodeURIComponent(keyPair[0].trim()); + var value = decodeURIComponent(keyPair[1].trim()); + var metadata; + if (valueProps.length > 0) { + metadata = baggageEntryMetadataFromString(valueProps.join(BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; +} +__name(parsePairKeyValue, "parsePairKeyValue"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/baggage/propagation/W3CBaggagePropagator.js +var W3CBaggagePropagator = function() { + function W3CBaggagePropagator2() { + } + __name(W3CBaggagePropagator2, "W3CBaggagePropagator"); + W3CBaggagePropagator2.prototype.inject = function(context3, carrier, setter) { + var baggage = propagation.getBaggage(context3); + if (!baggage || isTracingSuppressed(context3)) + return; + var keyPairs = getKeyPairs(baggage).filter(function(pair) { + return pair.length <= BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, BAGGAGE_MAX_NAME_VALUE_PAIRS); + var headerValue = serializeKeyPairs(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, BAGGAGE_HEADER, headerValue); + } + }; + W3CBaggagePropagator2.prototype.extract = function(context3, carrier, getter) { + var headerValue = getter.get(carrier, BAGGAGE_HEADER); + var baggageString = Array.isArray(headerValue) ? headerValue.join(BAGGAGE_ITEMS_SEPARATOR) : headerValue; + if (!baggageString) + return context3; + var baggage = {}; + if (baggageString.length === 0) { + return context3; + } + var pairs = baggageString.split(BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach(function(entry) { + var keyPair = parsePairKeyValue(entry); + if (keyPair) { + var baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context3; + } + return propagation.setBaggage(context3, propagation.createBaggage(baggage)); + }; + W3CBaggagePropagator2.prototype.fields = function() { + return [BAGGAGE_HEADER]; + }; + return W3CBaggagePropagator2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/common/attributes.js +var __values = function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) + return m.call(o); + if (o && typeof o.length === "number") + return { + next: function() { + if (o && i >= o.length) + o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __read2 = function(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) + return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) + ar.push(r.value); + } catch (error2) { + e = { error: error2 }; + } finally { + try { + if (r && !r.done && (m = i["return"])) + m.call(i); + } finally { + if (e) + throw e.error; + } + } + return ar; +}; +function sanitizeAttributes(attributes) { + var e_1, _a3; + var out = {}; + if (typeof attributes !== "object" || attributes == null) { + return out; + } + try { + for (var _b2 = __values(Object.entries(attributes)), _c = _b2.next(); !_c.done; _c = _b2.next()) { + var _d = __read2(_c.value, 2), key = _d[0], val = _d[1]; + if (!isAttributeKey(key)) { + diag2.warn("Invalid attribute key: " + key); + continue; + } + if (!isAttributeValue(val)) { + diag2.warn("Invalid attribute value set for key: " + key); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } else { + out[key] = val; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_c && !_c.done && (_a3 = _b2.return)) + _a3.call(_b2); + } finally { + if (e_1) + throw e_1.error; + } + } + return out; +} +__name(sanitizeAttributes, "sanitizeAttributes"); +function isAttributeKey(key) { + return typeof key === "string" && key.length > 0; +} +__name(isAttributeKey, "isAttributeKey"); +function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); +} +__name(isAttributeValue, "isAttributeValue"); +function isHomogeneousAttributeValueArray(arr) { + var e_2, _a3; + var type; + try { + for (var arr_1 = __values(arr), arr_1_1 = arr_1.next(); !arr_1_1.done; arr_1_1 = arr_1.next()) { + var element = arr_1_1.value; + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + } catch (e_2_1) { + e_2 = { error: e_2_1 }; + } finally { + try { + if (arr_1_1 && !arr_1_1.done && (_a3 = arr_1.return)) + _a3.call(arr_1); + } finally { + if (e_2) + throw e_2.error; + } + } + return true; +} +__name(isHomogeneousAttributeValueArray, "isHomogeneousAttributeValueArray"); +function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case "number": + case "boolean": + case "string": + return true; + } + return false; +} +__name(isValidPrimitiveAttributeValue, "isValidPrimitiveAttributeValue"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js +function loggingErrorHandler() { + return function(ex) { + diag2.error(stringifyException(ex)); + }; +} +__name(loggingErrorHandler, "loggingErrorHandler"); +function stringifyException(ex) { + if (typeof ex === "string") { + return ex; + } else { + return JSON.stringify(flattenException(ex)); + } +} +__name(stringifyException, "stringifyException"); +function flattenException(ex) { + var result = {}; + var current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach(function(propertyName) { + if (result[propertyName]) + return; + var value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; +} +__name(flattenException, "flattenException"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js +var delegateHandler = loggingErrorHandler(); +function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch (_a3) { + } +} +__name(globalErrorHandler, "globalErrorHandler"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/node/environment.js +var os2 = __toESM(require("os")); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/utils/sampling.js +var TracesSamplerValues; +(function(TracesSamplerValues2) { + TracesSamplerValues2["AlwaysOff"] = "always_off"; + TracesSamplerValues2["AlwaysOn"] = "always_on"; + TracesSamplerValues2["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues2["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues2["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues2["TraceIdRatio"] = "traceidratio"; +})(TracesSamplerValues || (TracesSamplerValues = {})); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/browser/globalThis.js +var _globalThis2 = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {}; + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/utils/environment.js +var DEFAULT_LIST_SEPARATOR = ","; +var ENVIRONMENT_NUMBERS_KEYS = [ + "OTEL_BSP_EXPORT_TIMEOUT", + "OTEL_BSP_MAX_EXPORT_BATCH_SIZE", + "OTEL_BSP_MAX_QUEUE_SIZE", + "OTEL_BSP_SCHEDULE_DELAY", + "OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT", + "OTEL_ATTRIBUTE_COUNT_LIMIT", + "OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT", + "OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT", + "OTEL_SPAN_EVENT_COUNT_LIMIT", + "OTEL_SPAN_LINK_COUNT_LIMIT", + "OTEL_EXPORTER_OTLP_TIMEOUT", + "OTEL_EXPORTER_OTLP_TRACES_TIMEOUT", + "OTEL_EXPORTER_OTLP_METRICS_TIMEOUT", + "OTEL_EXPORTER_JAEGER_AGENT_PORT" +]; +function isEnvVarANumber(key) { + return ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1; +} +__name(isEnvVarANumber, "isEnvVarANumber"); +var ENVIRONMENT_LISTS_KEYS = [ + "OTEL_NO_PATCH_MODULES", + "OTEL_PROPAGATORS" +]; +function isEnvVarAList(key) { + return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; +} +__name(isEnvVarAList, "isEnvVarAList"); +var DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; +var DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; +var DEFAULT_ENVIRONMENT = { + CONTAINER_NAME: "", + ECS_CONTAINER_METADATA_URI_V4: "", + ECS_CONTAINER_METADATA_URI: "", + HOSTNAME: "", + KUBERNETES_SERVICE_HOST: "", + NAMESPACE: "", + OTEL_BSP_EXPORT_TIMEOUT: 3e4, + OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, + OTEL_BSP_MAX_QUEUE_SIZE: 2048, + OTEL_BSP_SCHEDULE_DELAY: 5e3, + OTEL_EXPORTER_JAEGER_AGENT_HOST: "", + OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, + OTEL_EXPORTER_JAEGER_ENDPOINT: "", + OTEL_EXPORTER_JAEGER_PASSWORD: "", + OTEL_EXPORTER_JAEGER_USER: "", + OTEL_EXPORTER_OTLP_ENDPOINT: "", + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "", + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: "", + OTEL_EXPORTER_OTLP_HEADERS: "", + OTEL_EXPORTER_OTLP_TRACES_HEADERS: "", + OTEL_EXPORTER_OTLP_METRICS_HEADERS: "", + OTEL_EXPORTER_OTLP_TIMEOUT: 1e4, + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 1e4, + OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 1e4, + OTEL_EXPORTER_ZIPKIN_ENDPOINT: "http://localhost:9411/api/v2/spans", + OTEL_LOG_LEVEL: DiagLogLevel.INFO, + OTEL_NO_PATCH_MODULES: [], + OTEL_PROPAGATORS: ["tracecontext", "baggage"], + OTEL_RESOURCE_ATTRIBUTES: "", + OTEL_SERVICE_NAME: "", + OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_ATTRIBUTE_COUNT_LIMIT: DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, + OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: DEFAULT_ATTRIBUTE_COUNT_LIMIT, + OTEL_SPAN_EVENT_COUNT_LIMIT: 128, + OTEL_SPAN_LINK_COUNT_LIMIT: 128, + OTEL_TRACES_EXPORTER: "none", + OTEL_TRACES_SAMPLER: TracesSamplerValues.ParentBasedAlwaysOn, + OTEL_TRACES_SAMPLER_ARG: "", + OTEL_EXPORTER_OTLP_INSECURE: "", + OTEL_EXPORTER_OTLP_TRACES_INSECURE: "", + OTEL_EXPORTER_OTLP_METRICS_INSECURE: "", + OTEL_EXPORTER_OTLP_CERTIFICATE: "", + OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: "", + OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: "", + OTEL_EXPORTER_OTLP_COMPRESSION: "", + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: "", + OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: "", + OTEL_EXPORTER_OTLP_CLIENT_KEY: "", + OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: "", + OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: "", + OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: "", + OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: "", + OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: "" +}; +function parseNumber(name, environment, values, min2, max2) { + if (min2 === void 0) { + min2 = -Infinity; + } + if (max2 === void 0) { + max2 = Infinity; + } + if (typeof values[name] !== "undefined") { + var value = Number(values[name]); + if (!isNaN(value)) { + if (value < min2) { + environment[name] = min2; + } else if (value > max2) { + environment[name] = max2; + } else { + environment[name] = value; + } + } + } +} +__name(parseNumber, "parseNumber"); +function parseStringList(name, output, input, separator) { + if (separator === void 0) { + separator = DEFAULT_LIST_SEPARATOR; + } + var givenValue = input[name]; + if (typeof givenValue === "string") { + output[name] = givenValue.split(separator).map(function(v) { + return v.trim(); + }); + } +} +__name(parseStringList, "parseStringList"); +var logLevelMap = { + ALL: DiagLogLevel.ALL, + VERBOSE: DiagLogLevel.VERBOSE, + DEBUG: DiagLogLevel.DEBUG, + INFO: DiagLogLevel.INFO, + WARN: DiagLogLevel.WARN, + ERROR: DiagLogLevel.ERROR, + NONE: DiagLogLevel.NONE +}; +function setLogLevelFromEnv(key, environment, values) { + var value = values[key]; + if (typeof value === "string") { + var theLevel = logLevelMap[value.toUpperCase()]; + if (theLevel != null) { + environment[key] = theLevel; + } + } +} +__name(setLogLevelFromEnv, "setLogLevelFromEnv"); +function parseEnvironment(values) { + var environment = {}; + for (var env2 in DEFAULT_ENVIRONMENT) { + var key = env2; + switch (key) { + case "OTEL_LOG_LEVEL": + setLogLevelFromEnv(key, environment, values); + break; + default: + if (isEnvVarANumber(key)) { + parseNumber(key, environment, values); + } else if (isEnvVarAList(key)) { + parseStringList(key, environment, values); + } else { + var value = values[key]; + if (typeof value !== "undefined" && value !== null) { + environment[key] = String(value); + } + } + } + } + return environment; +} +__name(parseEnvironment, "parseEnvironment"); +function getEnvWithoutDefaults() { + return typeof process !== "undefined" ? parseEnvironment(process.env) : parseEnvironment(_globalThis2); +} +__name(getEnvWithoutDefaults, "getEnvWithoutDefaults"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/node/environment.js +function getEnv() { + var processEnv = parseEnvironment(process.env); + return Object.assign({ + HOSTNAME: os2.hostname() + }, DEFAULT_ENVIRONMENT, processEnv); +} +__name(getEnv, "getEnv"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.js +var _globalThis3 = typeof globalThis === "object" ? globalThis : global; + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/node/hex-to-base64.js +var buf8 = Buffer.alloc(8); +var buf16 = Buffer.alloc(16); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/node/RandomIdGenerator.js +var SPAN_ID_BYTES = 8; +var TRACE_ID_BYTES = 16; +var RandomIdGenerator = function() { + function RandomIdGenerator3() { + this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); + this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } + __name(RandomIdGenerator3, "RandomIdGenerator"); + return RandomIdGenerator3; +}(); +var SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); +function getIdGenerator(bytes) { + return /* @__PURE__ */ __name(function generateId() { + for (var i = 0; i < bytes / 4; i++) { + SHARED_BUFFER.writeUInt32BE(Math.random() * Math.pow(2, 32) >>> 0, i * 4); + } + for (var i = 0; i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString("hex", 0, bytes); + }, "generateId"); +} +__name(getIdGenerator, "getIdGenerator"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/node/performance.js +var import_perf_hooks = require("perf_hooks"); +var otperformance = import_perf_hooks.performance; + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/version.js +var VERSION2 = "1.6.0"; + +// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.6.0/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js +var SemanticAttributes = { + AWS_LAMBDA_INVOKED_ARN: "aws.lambda.invoked_arn", + DB_SYSTEM: "db.system", + DB_CONNECTION_STRING: "db.connection_string", + DB_USER: "db.user", + DB_JDBC_DRIVER_CLASSNAME: "db.jdbc.driver_classname", + DB_NAME: "db.name", + DB_STATEMENT: "db.statement", + DB_OPERATION: "db.operation", + DB_MSSQL_INSTANCE_NAME: "db.mssql.instance_name", + DB_CASSANDRA_KEYSPACE: "db.cassandra.keyspace", + DB_CASSANDRA_PAGE_SIZE: "db.cassandra.page_size", + DB_CASSANDRA_CONSISTENCY_LEVEL: "db.cassandra.consistency_level", + DB_CASSANDRA_TABLE: "db.cassandra.table", + DB_CASSANDRA_IDEMPOTENCE: "db.cassandra.idempotence", + DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: "db.cassandra.speculative_execution_count", + DB_CASSANDRA_COORDINATOR_ID: "db.cassandra.coordinator.id", + DB_CASSANDRA_COORDINATOR_DC: "db.cassandra.coordinator.dc", + DB_HBASE_NAMESPACE: "db.hbase.namespace", + DB_REDIS_DATABASE_INDEX: "db.redis.database_index", + DB_MONGODB_COLLECTION: "db.mongodb.collection", + DB_SQL_TABLE: "db.sql.table", + EXCEPTION_TYPE: "exception.type", + EXCEPTION_MESSAGE: "exception.message", + EXCEPTION_STACKTRACE: "exception.stacktrace", + EXCEPTION_ESCAPED: "exception.escaped", + FAAS_TRIGGER: "faas.trigger", + FAAS_EXECUTION: "faas.execution", + FAAS_DOCUMENT_COLLECTION: "faas.document.collection", + FAAS_DOCUMENT_OPERATION: "faas.document.operation", + FAAS_DOCUMENT_TIME: "faas.document.time", + FAAS_DOCUMENT_NAME: "faas.document.name", + FAAS_TIME: "faas.time", + FAAS_CRON: "faas.cron", + FAAS_COLDSTART: "faas.coldstart", + FAAS_INVOKED_NAME: "faas.invoked_name", + FAAS_INVOKED_PROVIDER: "faas.invoked_provider", + FAAS_INVOKED_REGION: "faas.invoked_region", + NET_TRANSPORT: "net.transport", + NET_PEER_IP: "net.peer.ip", + NET_PEER_PORT: "net.peer.port", + NET_PEER_NAME: "net.peer.name", + NET_HOST_IP: "net.host.ip", + NET_HOST_PORT: "net.host.port", + NET_HOST_NAME: "net.host.name", + NET_HOST_CONNECTION_TYPE: "net.host.connection.type", + NET_HOST_CONNECTION_SUBTYPE: "net.host.connection.subtype", + NET_HOST_CARRIER_NAME: "net.host.carrier.name", + NET_HOST_CARRIER_MCC: "net.host.carrier.mcc", + NET_HOST_CARRIER_MNC: "net.host.carrier.mnc", + NET_HOST_CARRIER_ICC: "net.host.carrier.icc", + PEER_SERVICE: "peer.service", + ENDUSER_ID: "enduser.id", + ENDUSER_ROLE: "enduser.role", + ENDUSER_SCOPE: "enduser.scope", + THREAD_ID: "thread.id", + THREAD_NAME: "thread.name", + CODE_FUNCTION: "code.function", + CODE_NAMESPACE: "code.namespace", + CODE_FILEPATH: "code.filepath", + CODE_LINENO: "code.lineno", + HTTP_METHOD: "http.method", + HTTP_URL: "http.url", + HTTP_TARGET: "http.target", + HTTP_HOST: "http.host", + HTTP_SCHEME: "http.scheme", + HTTP_STATUS_CODE: "http.status_code", + HTTP_FLAVOR: "http.flavor", + HTTP_USER_AGENT: "http.user_agent", + HTTP_REQUEST_CONTENT_LENGTH: "http.request_content_length", + HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: "http.request_content_length_uncompressed", + HTTP_RESPONSE_CONTENT_LENGTH: "http.response_content_length", + HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: "http.response_content_length_uncompressed", + HTTP_SERVER_NAME: "http.server_name", + HTTP_ROUTE: "http.route", + HTTP_CLIENT_IP: "http.client_ip", + AWS_DYNAMODB_TABLE_NAMES: "aws.dynamodb.table_names", + AWS_DYNAMODB_CONSUMED_CAPACITY: "aws.dynamodb.consumed_capacity", + AWS_DYNAMODB_ITEM_COLLECTION_METRICS: "aws.dynamodb.item_collection_metrics", + AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: "aws.dynamodb.provisioned_read_capacity", + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: "aws.dynamodb.provisioned_write_capacity", + AWS_DYNAMODB_CONSISTENT_READ: "aws.dynamodb.consistent_read", + AWS_DYNAMODB_PROJECTION: "aws.dynamodb.projection", + AWS_DYNAMODB_LIMIT: "aws.dynamodb.limit", + AWS_DYNAMODB_ATTRIBUTES_TO_GET: "aws.dynamodb.attributes_to_get", + AWS_DYNAMODB_INDEX_NAME: "aws.dynamodb.index_name", + AWS_DYNAMODB_SELECT: "aws.dynamodb.select", + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: "aws.dynamodb.global_secondary_indexes", + AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: "aws.dynamodb.local_secondary_indexes", + AWS_DYNAMODB_EXCLUSIVE_START_TABLE: "aws.dynamodb.exclusive_start_table", + AWS_DYNAMODB_TABLE_COUNT: "aws.dynamodb.table_count", + AWS_DYNAMODB_SCAN_FORWARD: "aws.dynamodb.scan_forward", + AWS_DYNAMODB_SEGMENT: "aws.dynamodb.segment", + AWS_DYNAMODB_TOTAL_SEGMENTS: "aws.dynamodb.total_segments", + AWS_DYNAMODB_COUNT: "aws.dynamodb.count", + AWS_DYNAMODB_SCANNED_COUNT: "aws.dynamodb.scanned_count", + AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: "aws.dynamodb.attribute_definitions", + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: "aws.dynamodb.global_secondary_index_updates", + MESSAGING_SYSTEM: "messaging.system", + MESSAGING_DESTINATION: "messaging.destination", + MESSAGING_DESTINATION_KIND: "messaging.destination_kind", + MESSAGING_TEMP_DESTINATION: "messaging.temp_destination", + MESSAGING_PROTOCOL: "messaging.protocol", + MESSAGING_PROTOCOL_VERSION: "messaging.protocol_version", + MESSAGING_URL: "messaging.url", + MESSAGING_MESSAGE_ID: "messaging.message_id", + MESSAGING_CONVERSATION_ID: "messaging.conversation_id", + MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: "messaging.message_payload_size_bytes", + MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: "messaging.message_payload_compressed_size_bytes", + MESSAGING_OPERATION: "messaging.operation", + MESSAGING_CONSUMER_ID: "messaging.consumer_id", + MESSAGING_RABBITMQ_ROUTING_KEY: "messaging.rabbitmq.routing_key", + MESSAGING_KAFKA_MESSAGE_KEY: "messaging.kafka.message_key", + MESSAGING_KAFKA_CONSUMER_GROUP: "messaging.kafka.consumer_group", + MESSAGING_KAFKA_CLIENT_ID: "messaging.kafka.client_id", + MESSAGING_KAFKA_PARTITION: "messaging.kafka.partition", + MESSAGING_KAFKA_TOMBSTONE: "messaging.kafka.tombstone", + RPC_SYSTEM: "rpc.system", + RPC_SERVICE: "rpc.service", + RPC_METHOD: "rpc.method", + RPC_GRPC_STATUS_CODE: "rpc.grpc.status_code", + RPC_JSONRPC_VERSION: "rpc.jsonrpc.version", + RPC_JSONRPC_REQUEST_ID: "rpc.jsonrpc.request_id", + RPC_JSONRPC_ERROR_CODE: "rpc.jsonrpc.error_code", + RPC_JSONRPC_ERROR_MESSAGE: "rpc.jsonrpc.error_message", + MESSAGE_TYPE: "message.type", + MESSAGE_ID: "message.id", + MESSAGE_COMPRESSED_SIZE: "message.compressed_size", + MESSAGE_UNCOMPRESSED_SIZE: "message.uncompressed_size" +}; + +// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.6.0/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js +var SemanticResourceAttributes = { + CLOUD_PROVIDER: "cloud.provider", + CLOUD_ACCOUNT_ID: "cloud.account.id", + CLOUD_REGION: "cloud.region", + CLOUD_AVAILABILITY_ZONE: "cloud.availability_zone", + CLOUD_PLATFORM: "cloud.platform", + AWS_ECS_CONTAINER_ARN: "aws.ecs.container.arn", + AWS_ECS_CLUSTER_ARN: "aws.ecs.cluster.arn", + AWS_ECS_LAUNCHTYPE: "aws.ecs.launchtype", + AWS_ECS_TASK_ARN: "aws.ecs.task.arn", + AWS_ECS_TASK_FAMILY: "aws.ecs.task.family", + AWS_ECS_TASK_REVISION: "aws.ecs.task.revision", + AWS_EKS_CLUSTER_ARN: "aws.eks.cluster.arn", + AWS_LOG_GROUP_NAMES: "aws.log.group.names", + AWS_LOG_GROUP_ARNS: "aws.log.group.arns", + AWS_LOG_STREAM_NAMES: "aws.log.stream.names", + AWS_LOG_STREAM_ARNS: "aws.log.stream.arns", + CONTAINER_NAME: "container.name", + CONTAINER_ID: "container.id", + CONTAINER_RUNTIME: "container.runtime", + CONTAINER_IMAGE_NAME: "container.image.name", + CONTAINER_IMAGE_TAG: "container.image.tag", + DEPLOYMENT_ENVIRONMENT: "deployment.environment", + DEVICE_ID: "device.id", + DEVICE_MODEL_IDENTIFIER: "device.model.identifier", + DEVICE_MODEL_NAME: "device.model.name", + FAAS_NAME: "faas.name", + FAAS_ID: "faas.id", + FAAS_VERSION: "faas.version", + FAAS_INSTANCE: "faas.instance", + FAAS_MAX_MEMORY: "faas.max_memory", + HOST_ID: "host.id", + HOST_NAME: "host.name", + HOST_TYPE: "host.type", + HOST_ARCH: "host.arch", + HOST_IMAGE_NAME: "host.image.name", + HOST_IMAGE_ID: "host.image.id", + HOST_IMAGE_VERSION: "host.image.version", + K8S_CLUSTER_NAME: "k8s.cluster.name", + K8S_NODE_NAME: "k8s.node.name", + K8S_NODE_UID: "k8s.node.uid", + K8S_NAMESPACE_NAME: "k8s.namespace.name", + K8S_POD_UID: "k8s.pod.uid", + K8S_POD_NAME: "k8s.pod.name", + K8S_CONTAINER_NAME: "k8s.container.name", + K8S_REPLICASET_UID: "k8s.replicaset.uid", + K8S_REPLICASET_NAME: "k8s.replicaset.name", + K8S_DEPLOYMENT_UID: "k8s.deployment.uid", + K8S_DEPLOYMENT_NAME: "k8s.deployment.name", + K8S_STATEFULSET_UID: "k8s.statefulset.uid", + K8S_STATEFULSET_NAME: "k8s.statefulset.name", + K8S_DAEMONSET_UID: "k8s.daemonset.uid", + K8S_DAEMONSET_NAME: "k8s.daemonset.name", + K8S_JOB_UID: "k8s.job.uid", + K8S_JOB_NAME: "k8s.job.name", + K8S_CRONJOB_UID: "k8s.cronjob.uid", + K8S_CRONJOB_NAME: "k8s.cronjob.name", + OS_TYPE: "os.type", + OS_DESCRIPTION: "os.description", + OS_NAME: "os.name", + OS_VERSION: "os.version", + PROCESS_PID: "process.pid", + PROCESS_EXECUTABLE_NAME: "process.executable.name", + PROCESS_EXECUTABLE_PATH: "process.executable.path", + PROCESS_COMMAND: "process.command", + PROCESS_COMMAND_LINE: "process.command_line", + PROCESS_COMMAND_ARGS: "process.command_args", + PROCESS_OWNER: "process.owner", + PROCESS_RUNTIME_NAME: "process.runtime.name", + PROCESS_RUNTIME_VERSION: "process.runtime.version", + PROCESS_RUNTIME_DESCRIPTION: "process.runtime.description", + SERVICE_NAME: "service.name", + SERVICE_NAMESPACE: "service.namespace", + SERVICE_INSTANCE_ID: "service.instance.id", + SERVICE_VERSION: "service.version", + TELEMETRY_SDK_NAME: "telemetry.sdk.name", + TELEMETRY_SDK_LANGUAGE: "telemetry.sdk.language", + TELEMETRY_SDK_VERSION: "telemetry.sdk.version", + TELEMETRY_AUTO_VERSION: "telemetry.auto.version", + WEBENGINE_NAME: "webengine.name", + WEBENGINE_VERSION: "webengine.version", + WEBENGINE_DESCRIPTION: "webengine.description" +}; +var TelemetrySdkLanguageValues = { + CPP: "cpp", + DOTNET: "dotnet", + ERLANG: "erlang", + GO: "go", + JAVA: "java", + NODEJS: "nodejs", + PHP: "php", + PYTHON: "python", + RUBY: "ruby", + WEBJS: "webjs" +}; + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/node/sdk-info.js +var _a2; +var SDK_INFO = (_a2 = {}, _a2[SemanticResourceAttributes.TELEMETRY_SDK_NAME] = "opentelemetry", _a2[SemanticResourceAttributes.PROCESS_RUNTIME_NAME] = "node", _a2[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE] = TelemetrySdkLanguageValues.NODEJS, _a2[SemanticResourceAttributes.TELEMETRY_SDK_VERSION] = VERSION2, _a2); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/platform/node/timer-util.js +function unrefTimer(timer) { + timer.unref(); +} +__name(unrefTimer, "unrefTimer"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/common/time.js +var NANOSECOND_DIGITS = 9; +var SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); +function numberToHrtime(epochMillis) { + var epochSeconds = epochMillis / 1e3; + var seconds = Math.trunc(epochSeconds); + var nanos = Number((epochSeconds - seconds).toFixed(NANOSECOND_DIGITS)) * SECOND_TO_NANOSECONDS; + return [seconds, nanos]; +} +__name(numberToHrtime, "numberToHrtime"); +function getTimeOrigin() { + var timeOrigin = otperformance.timeOrigin; + if (typeof timeOrigin !== "number") { + var perf = otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; +} +__name(getTimeOrigin, "getTimeOrigin"); +function hrTime(performanceNow) { + var timeOrigin = numberToHrtime(getTimeOrigin()); + var now = numberToHrtime(typeof performanceNow === "number" ? performanceNow : otperformance.now()); + var seconds = timeOrigin[0] + now[0]; + var nanos = timeOrigin[1] + now[1]; + if (nanos > SECOND_TO_NANOSECONDS) { + nanos -= SECOND_TO_NANOSECONDS; + seconds += 1; + } + return [seconds, nanos]; +} +__name(hrTime, "hrTime"); +function timeInputToHrTime(time) { + if (isTimeInputHrTime(time)) { + return time; + } else if (typeof time === "number") { + if (time < getTimeOrigin()) { + return hrTime(time); + } else { + return numberToHrtime(time); + } + } else if (time instanceof Date) { + return numberToHrtime(time.getTime()); + } else { + throw TypeError("Invalid input type"); + } +} +__name(timeInputToHrTime, "timeInputToHrTime"); +function hrTimeDuration(startTime, endTime) { + var seconds = endTime[0] - startTime[0]; + var nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; +} +__name(hrTimeDuration, "hrTimeDuration"); +function hrTimeToMicroseconds(time) { + return Math.round(time[0] * 1e6 + time[1] / 1e3); +} +__name(hrTimeToMicroseconds, "hrTimeToMicroseconds"); +function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; +} +__name(isTimeInputHrTime, "isTimeInputHrTime"); +function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; +} +__name(isTimeInput, "isTimeInput"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/ExportResult.js +var ExportResultCode; +(function(ExportResultCode2) { + ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED"; +})(ExportResultCode || (ExportResultCode = {})); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/propagation/composite.js +var __values2 = function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) + return m.call(o); + if (o && typeof o.length === "number") + return { + next: function() { + if (o && i >= o.length) + o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var CompositePropagator = function() { + function CompositePropagator2(config2) { + if (config2 === void 0) { + config2 = {}; + } + var _a3; + this._propagators = (_a3 = config2.propagators) !== null && _a3 !== void 0 ? _a3 : []; + this._fields = Array.from(new Set(this._propagators.map(function(p) { + return typeof p.fields === "function" ? p.fields() : []; + }).reduce(function(x, y) { + return x.concat(y); + }, []))); + } + __name(CompositePropagator2, "CompositePropagator"); + CompositePropagator2.prototype.inject = function(context3, carrier, setter) { + var e_1, _a3; + try { + for (var _b2 = __values2(this._propagators), _c = _b2.next(); !_c.done; _c = _b2.next()) { + var propagator = _c.value; + try { + propagator.inject(context3, carrier, setter); + } catch (err) { + diag2.warn("Failed to inject with " + propagator.constructor.name + ". Err: " + err.message); + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_c && !_c.done && (_a3 = _b2.return)) + _a3.call(_b2); + } finally { + if (e_1) + throw e_1.error; + } + } + }; + CompositePropagator2.prototype.extract = function(context3, carrier, getter) { + return this._propagators.reduce(function(ctx, propagator) { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + diag2.warn("Failed to inject with " + propagator.constructor.name + ". Err: " + err.message); + } + return ctx; + }, context3); + }; + CompositePropagator2.prototype.fields = function() { + return this._fields.slice(); + }; + return CompositePropagator2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/internal/validators.js +var VALID_KEY_CHAR_RANGE2 = "[_0-9a-z-*/]"; +var VALID_KEY2 = "[a-z]" + VALID_KEY_CHAR_RANGE2 + "{0,255}"; +var VALID_VENDOR_KEY2 = "[a-z0-9]" + VALID_KEY_CHAR_RANGE2 + "{0,240}@[a-z]" + VALID_KEY_CHAR_RANGE2 + "{0,13}"; +var VALID_KEY_REGEX2 = new RegExp("^(?:" + VALID_KEY2 + "|" + VALID_VENDOR_KEY2 + ")$"); +var VALID_VALUE_BASE_REGEX2 = /^[ -~]{0,255}[!-~]$/; +var INVALID_VALUE_COMMA_EQUAL_REGEX2 = /,|=/; +function validateKey2(key) { + return VALID_KEY_REGEX2.test(key); +} +__name(validateKey2, "validateKey"); +function validateValue2(value) { + return VALID_VALUE_BASE_REGEX2.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX2.test(value); +} +__name(validateValue2, "validateValue"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/trace/TraceState.js +var MAX_TRACE_STATE_ITEMS2 = 32; +var MAX_TRACE_STATE_LEN2 = 512; +var LIST_MEMBERS_SEPARATOR2 = ","; +var LIST_MEMBER_KEY_VALUE_SPLITTER2 = "="; +var TraceState = function() { + function TraceState2(rawTraceState) { + this._internalState = /* @__PURE__ */ new Map(); + if (rawTraceState) + this._parse(rawTraceState); + } + __name(TraceState2, "TraceState"); + TraceState2.prototype.set = function(key, value) { + var traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + }; + TraceState2.prototype.unset = function(key) { + var traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + }; + TraceState2.prototype.get = function(key) { + return this._internalState.get(key); + }; + TraceState2.prototype.serialize = function() { + var _this = this; + return this._keys().reduce(function(agg, key) { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER2 + _this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR2); + }; + TraceState2.prototype._parse = function(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN2) + return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR2).reverse().reduce(function(agg, part) { + var listMember = part.trim(); + var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER2); + if (i !== -1) { + var key = listMember.slice(0, i); + var value = listMember.slice(i + 1, part.length); + if (validateKey2(key) && validateValue2(value)) { + agg.set(key, value); + } else { + } + } + return agg; + }, /* @__PURE__ */ new Map()); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS2) { + this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS2)); + } + }; + TraceState2.prototype._keys = function() { + return Array.from(this._internalState.keys()).reverse(); + }; + TraceState2.prototype._clone = function() { + var traceState = new TraceState2(); + traceState._internalState = new Map(this._internalState); + return traceState; + }; + return TraceState2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/trace/W3CTraceContextPropagator.js +var TRACE_PARENT_HEADER = "traceparent"; +var TRACE_STATE_HEADER = "tracestate"; +var VERSION3 = "00"; +var VERSION_PART = "(?!ff)[\\da-f]{2}"; +var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; +var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; +var FLAGS_PART = "[\\da-f]{2}"; +var TRACE_PARENT_REGEX = new RegExp("^\\s?(" + VERSION_PART + ")-(" + TRACE_ID_PART + ")-(" + PARENT_ID_PART + ")-(" + FLAGS_PART + ")(-.*)?\\s?$"); +function parseTraceParent(traceParent) { + var match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + if (match[1] === "00" && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; +} +__name(parseTraceParent, "parseTraceParent"); +var W3CTraceContextPropagator = function() { + function W3CTraceContextPropagator2() { + } + __name(W3CTraceContextPropagator2, "W3CTraceContextPropagator"); + W3CTraceContextPropagator2.prototype.inject = function(context3, carrier, setter) { + var spanContext = trace.getSpanContext(context3); + if (!spanContext || isTracingSuppressed(context3) || !isSpanContextValid(spanContext)) + return; + var traceParent = VERSION3 + "-" + spanContext.traceId + "-" + spanContext.spanId + "-0" + Number(spanContext.traceFlags || TraceFlags.NONE).toString(16); + setter.set(carrier, TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + }; + W3CTraceContextPropagator2.prototype.extract = function(context3, carrier, getter) { + var traceParentHeader = getter.get(carrier, TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context3; + var traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") + return context3; + var spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context3; + spanContext.isRemote = true; + var traceStateHeader = getter.get(carrier, TRACE_STATE_HEADER); + if (traceStateHeader) { + var state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState(typeof state === "string" ? state : void 0); + } + return trace.setSpanContext(context3, spanContext); + }; + W3CTraceContextPropagator2.prototype.fields = function() { + return [TRACE_PARENT_HEADER, TRACE_STATE_HEADER]; + }; + return W3CTraceContextPropagator2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/trace/rpc-metadata.js +var RPC_METADATA_KEY = createContextKey("OpenTelemetry SDK Context Key RPC_METADATA"); +var RPCType; +(function(RPCType2) { + RPCType2["HTTP"] = "http"; +})(RPCType || (RPCType = {})); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/trace/sampler/AlwaysOffSampler.js +var AlwaysOffSampler = function() { + function AlwaysOffSampler3() { + } + __name(AlwaysOffSampler3, "AlwaysOffSampler"); + AlwaysOffSampler3.prototype.shouldSample = function() { + return { + decision: SamplingDecision.NOT_RECORD + }; + }; + AlwaysOffSampler3.prototype.toString = function() { + return "AlwaysOffSampler"; + }; + return AlwaysOffSampler3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/trace/sampler/AlwaysOnSampler.js +var AlwaysOnSampler = function() { + function AlwaysOnSampler3() { + } + __name(AlwaysOnSampler3, "AlwaysOnSampler"); + AlwaysOnSampler3.prototype.shouldSample = function() { + return { + decision: SamplingDecision.RECORD_AND_SAMPLED + }; + }; + AlwaysOnSampler3.prototype.toString = function() { + return "AlwaysOnSampler"; + }; + return AlwaysOnSampler3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/trace/sampler/ParentBasedSampler.js +var ParentBasedSampler = function() { + function ParentBasedSampler3(config2) { + var _a3, _b2, _c, _d; + this._root = config2.root; + if (!this._root) { + globalErrorHandler(new Error("ParentBasedSampler must have a root sampler configured")); + this._root = new AlwaysOnSampler(); + } + this._remoteParentSampled = (_a3 = config2.remoteParentSampled) !== null && _a3 !== void 0 ? _a3 : new AlwaysOnSampler(); + this._remoteParentNotSampled = (_b2 = config2.remoteParentNotSampled) !== null && _b2 !== void 0 ? _b2 : new AlwaysOffSampler(); + this._localParentSampled = (_c = config2.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler(); + this._localParentNotSampled = (_d = config2.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler(); + } + __name(ParentBasedSampler3, "ParentBasedSampler"); + ParentBasedSampler3.prototype.shouldSample = function(context3, traceId, spanName, spanKind, attributes, links) { + var parentContext = trace.getSpanContext(context3); + if (!parentContext || !isSpanContextValid(parentContext)) { + return this._root.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + }; + ParentBasedSampler3.prototype.toString = function() { + return "ParentBased{root=" + this._root.toString() + ", remoteParentSampled=" + this._remoteParentSampled.toString() + ", remoteParentNotSampled=" + this._remoteParentNotSampled.toString() + ", localParentSampled=" + this._localParentSampled.toString() + ", localParentNotSampled=" + this._localParentNotSampled.toString() + "}"; + }; + return ParentBasedSampler3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/trace/sampler/TraceIdRatioBasedSampler.js +var TraceIdRatioBasedSampler = function() { + function TraceIdRatioBasedSampler3(_ratio) { + if (_ratio === void 0) { + _ratio = 0; + } + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 4294967295); + } + __name(TraceIdRatioBasedSampler3, "TraceIdRatioBasedSampler"); + TraceIdRatioBasedSampler3.prototype.shouldSample = function(context3, traceId) { + return { + decision: isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound ? SamplingDecision.RECORD_AND_SAMPLED : SamplingDecision.NOT_RECORD + }; + }; + TraceIdRatioBasedSampler3.prototype.toString = function() { + return "TraceIdRatioBased{" + this._ratio + "}"; + }; + TraceIdRatioBasedSampler3.prototype._normalize = function(ratio) { + if (typeof ratio !== "number" || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + }; + TraceIdRatioBasedSampler3.prototype._accumulate = function(traceId) { + var accumulation = 0; + for (var i = 0; i < traceId.length / 8; i++) { + var pos = i * 8; + var part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + }; + return TraceIdRatioBasedSampler3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/utils/lodash.merge.js +var objectTag = "[object Object]"; +var nullTag = "[object Null]"; +var undefinedTag = "[object Undefined]"; +var funcProto = Function.prototype; +var funcToString = funcProto.toString; +var objectCtorString = funcToString.call(Object); +var getPrototype = overArg(Object.getPrototypeOf, Object); +var objectProto = Object.prototype; +var hasOwnProperty = objectProto.hasOwnProperty; +var symToStringTag = Symbol ? Symbol.toStringTag : void 0; +var nativeObjectToString = objectProto.toString; +function overArg(func, transform) { + return function(arg2) { + return func(transform(arg2)); + }; +} +__name(overArg, "overArg"); +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; +} +__name(isPlainObject, "isPlainObject"); +function isObjectLike(value) { + return value != null && typeof value == "object"; +} +__name(isObjectLike, "isObjectLike"); +function baseGetTag(value) { + if (value == null) { + return value === void 0 ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); +} +__name(baseGetTag, "baseGetTag"); +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), tag2 = value[symToStringTag]; + var unmasked = false; + try { + value[symToStringTag] = void 0; + unmasked = true; + } catch (e) { + } + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag2; + } else { + delete value[symToStringTag]; + } + } + return result; +} +__name(getRawTag, "getRawTag"); +function objectToString(value) { + return nativeObjectToString.call(value); +} +__name(objectToString, "objectToString"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/utils/merge.js +var MAX_LEVEL = 20; +function merge() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var result = args.shift(); + var objects = /* @__PURE__ */ new WeakMap(); + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; +} +__name(merge, "merge"); +function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; +} +__name(takeValue, "takeValue"); +function mergeTwoObjects(one, two, level, objects) { + if (level === void 0) { + level = 0; + } + var result; + if (level > MAX_LEVEL) { + return void 0; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (var i = 0, j = two.length; i < j; i++) { + result.push(takeValue(two[i])); + } + } else if (isObject(two)) { + var keys2 = Object.keys(two); + for (var i = 0, j = keys2.length; i < j; i++) { + var key = keys2[i]; + result[key] = takeValue(two[key]); + } + } + } else if (isObject(one)) { + if (isObject(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + var keys2 = Object.keys(two); + for (var i = 0, j = keys2.length; i < j; i++) { + var key = keys2[i]; + var twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") { + delete result[key]; + } else { + result[key] = twoValue; + } + } else { + var obj1 = result[key]; + var obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) { + delete result[key]; + } else { + if (isObject(obj1) && isObject(obj2)) { + var arr1 = objects.get(obj1) || []; + var arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else { + result = two; + } + } + return result; +} +__name(mergeTwoObjects, "mergeTwoObjects"); +function wasObjectReferenced(obj, key, objects) { + var arr = objects.get(obj[key]) || []; + for (var i = 0, j = arr.length; i < j; i++) { + var info2 = arr[i]; + if (info2.key === key && info2.obj === obj) { + return true; + } + } + return false; +} +__name(wasObjectReferenced, "wasObjectReferenced"); +function isArray(value) { + return Array.isArray(value); +} +__name(isArray, "isArray"); +function isFunction(value) { + return typeof value === "function"; +} +__name(isFunction, "isFunction"); +function isObject(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; +} +__name(isObject, "isObject"); +function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; +} +__name(isPrimitive, "isPrimitive"); +function shouldMerge(one, two) { + if (!isPlainObject(one) || !isPlainObject(two)) { + return false; + } + return true; +} +__name(shouldMerge, "shouldMerge"); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/utils/promise.js +var Deferred = function() { + function Deferred2() { + var _this = this; + this._promise = new Promise(function(resolve, reject) { + _this._resolve = resolve; + _this._reject = reject; + }); + } + __name(Deferred2, "Deferred"); + Object.defineProperty(Deferred2.prototype, "promise", { + get: function() { + return this._promise; + }, + enumerable: false, + configurable: true + }); + Deferred2.prototype.resolve = function(val) { + this._resolve(val); + }; + Deferred2.prototype.reject = function(err) { + this._reject(err); + }; + return Deferred2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+core@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/core/build/esm/utils/callback.js +var __read3 = function(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) + return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) + ar.push(r.value); + } catch (error2) { + e = { error: error2 }; + } finally { + try { + if (r && !r.done && (m = i["return"])) + m.call(i); + } finally { + if (e) + throw e.error; + } + } + return ar; +}; +var __spreadArray3 = function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +var BindOnceFuture = function() { + function BindOnceFuture2(_callback, _that) { + this._callback = _callback; + this._that = _that; + this._isCalled = false; + this._deferred = new Deferred(); + } + __name(BindOnceFuture2, "BindOnceFuture"); + Object.defineProperty(BindOnceFuture2.prototype, "isCalled", { + get: function() { + return this._isCalled; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BindOnceFuture2.prototype, "promise", { + get: function() { + return this._deferred.promise; + }, + enumerable: false, + configurable: true + }); + BindOnceFuture2.prototype.call = function() { + var _a3; + var _this = this; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve((_a3 = this._callback).call.apply(_a3, __spreadArray3([this._that], __read3(args), false))).then(function(val) { + return _this._deferred.resolve(val); + }, function(err) { + return _this._deferred.reject(err); + }); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + }; + return BindOnceFuture2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/enums.js +var ExceptionEventName = "exception"; + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js +var __values3 = function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) + return m.call(o); + if (o && typeof o.length === "number") + return { + next: function() { + if (o && i >= o.length) + o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __read4 = function(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) + return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) + ar.push(r.value); + } catch (error2) { + e = { error: error2 }; + } finally { + try { + if (r && !r.done && (m = i["return"])) + m.call(i); + } finally { + if (e) + throw e.error; + } + } + return ar; +}; +var Span = function() { + function Span3(parentTracer, context3, spanName, spanContext, kind, parentSpanId, links, startTime) { + if (links === void 0) { + links = []; + } + if (startTime === void 0) { + startTime = hrTime(); + } + this.attributes = {}; + this.links = []; + this.events = []; + this.status = { + code: SpanStatusCode.UNSET + }; + this.endTime = [0, 0]; + this._ended = false; + this._duration = [-1, -1]; + this.name = spanName; + this._spanContext = spanContext; + this.parentSpanId = parentSpanId; + this.kind = kind; + this.links = links; + this.startTime = timeInputToHrTime(startTime); + this.resource = parentTracer.resource; + this.instrumentationLibrary = parentTracer.instrumentationLibrary; + this._spanLimits = parentTracer.getSpanLimits(); + this._spanProcessor = parentTracer.getActiveSpanProcessor(); + this._spanProcessor.onStart(this, context3); + this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit || 0; + } + __name(Span3, "Span"); + Span3.prototype.spanContext = function() { + return this._spanContext; + }; + Span3.prototype.setAttribute = function(key, value) { + if (value == null || this._isSpanEnded()) + return this; + if (key.length === 0) { + diag2.warn("Invalid attribute key: " + key); + return this; + } + if (!isAttributeValue(value)) { + diag2.warn("Invalid attribute value set for key: " + key); + return this; + } + if (Object.keys(this.attributes).length >= this._spanLimits.attributeCountLimit && !Object.prototype.hasOwnProperty.call(this.attributes, key)) { + return this; + } + this.attributes[key] = this._truncateToSize(value); + return this; + }; + Span3.prototype.setAttributes = function(attributes) { + var e_1, _a3; + try { + for (var _b2 = __values3(Object.entries(attributes)), _c = _b2.next(); !_c.done; _c = _b2.next()) { + var _d = __read4(_c.value, 2), k = _d[0], v = _d[1]; + this.setAttribute(k, v); + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_c && !_c.done && (_a3 = _b2.return)) + _a3.call(_b2); + } finally { + if (e_1) + throw e_1.error; + } + } + return this; + }; + Span3.prototype.addEvent = function(name, attributesOrStartTime, startTime) { + if (this._isSpanEnded()) + return this; + if (this._spanLimits.eventCountLimit === 0) { + diag2.warn("No events allowed."); + return this; + } + if (this.events.length >= this._spanLimits.eventCountLimit) { + diag2.warn("Dropping extra events."); + this.events.shift(); + } + if (isTimeInput(attributesOrStartTime)) { + if (typeof startTime === "undefined") { + startTime = attributesOrStartTime; + } + attributesOrStartTime = void 0; + } + if (typeof startTime === "undefined") { + startTime = hrTime(); + } + var attributes = sanitizeAttributes(attributesOrStartTime); + this.events.push({ + name, + attributes, + time: timeInputToHrTime(startTime) + }); + return this; + }; + Span3.prototype.setStatus = function(status) { + if (this._isSpanEnded()) + return this; + this.status = status; + return this; + }; + Span3.prototype.updateName = function(name) { + if (this._isSpanEnded()) + return this; + this.name = name; + return this; + }; + Span3.prototype.end = function(endTime) { + if (endTime === void 0) { + endTime = hrTime(); + } + if (this._isSpanEnded()) { + diag2.error("You can only call end() on a span once."); + return; + } + this._ended = true; + this.endTime = timeInputToHrTime(endTime); + this._duration = hrTimeDuration(this.startTime, this.endTime); + if (this._duration[0] < 0) { + diag2.warn("Inconsistent start and end time, startTime > endTime", this.startTime, this.endTime); + } + this._spanProcessor.onEnd(this); + }; + Span3.prototype.isRecording = function() { + return this._ended === false; + }; + Span3.prototype.recordException = function(exception, time) { + if (time === void 0) { + time = hrTime(); + } + var attributes = {}; + if (typeof exception === "string") { + attributes[SemanticAttributes.EXCEPTION_MESSAGE] = exception; + } else if (exception) { + if (exception.code) { + attributes[SemanticAttributes.EXCEPTION_TYPE] = exception.code.toString(); + } else if (exception.name) { + attributes[SemanticAttributes.EXCEPTION_TYPE] = exception.name; + } + if (exception.message) { + attributes[SemanticAttributes.EXCEPTION_MESSAGE] = exception.message; + } + if (exception.stack) { + attributes[SemanticAttributes.EXCEPTION_STACKTRACE] = exception.stack; + } + } + if (attributes[SemanticAttributes.EXCEPTION_TYPE] || attributes[SemanticAttributes.EXCEPTION_MESSAGE]) { + this.addEvent(ExceptionEventName, attributes, time); + } else { + diag2.warn("Failed to record an exception " + exception); + } + }; + Object.defineProperty(Span3.prototype, "duration", { + get: function() { + return this._duration; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Span3.prototype, "ended", { + get: function() { + return this._ended; + }, + enumerable: false, + configurable: true + }); + Span3.prototype._isSpanEnded = function() { + if (this._ended) { + diag2.warn("Can not execute the operation on ended Span {traceId: " + this._spanContext.traceId + ", spanId: " + this._spanContext.spanId + "}"); + } + return this._ended; + }; + Span3.prototype._truncateToLimitUtil = function(value, limit) { + if (value.length <= limit) { + return value; + } + return value.substr(0, limit); + }; + Span3.prototype._truncateToSize = function(value) { + var _this = this; + var limit = this._attributeValueLengthLimit; + if (limit <= 0) { + diag2.warn("Attribute value limit must be positive, got " + limit); + return value; + } + if (typeof value === "string") { + return this._truncateToLimitUtil(value, limit); + } + if (Array.isArray(value)) { + return value.map(function(val) { + return typeof val === "string" ? _this._truncateToLimitUtil(val, limit) : val; + }); + } + return value; + }; + return Span3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Sampler.js +var SamplingDecision2; +(function(SamplingDecision3) { + SamplingDecision3[SamplingDecision3["NOT_RECORD"] = 0] = "NOT_RECORD"; + SamplingDecision3[SamplingDecision3["RECORD"] = 1] = "RECORD"; + SamplingDecision3[SamplingDecision3["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; +})(SamplingDecision2 || (SamplingDecision2 = {})); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOffSampler.js +var AlwaysOffSampler2 = function() { + function AlwaysOffSampler3() { + } + __name(AlwaysOffSampler3, "AlwaysOffSampler"); + AlwaysOffSampler3.prototype.shouldSample = function() { + return { + decision: SamplingDecision2.NOT_RECORD + }; + }; + AlwaysOffSampler3.prototype.toString = function() { + return "AlwaysOffSampler"; + }; + return AlwaysOffSampler3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOnSampler.js +var AlwaysOnSampler2 = function() { + function AlwaysOnSampler3() { + } + __name(AlwaysOnSampler3, "AlwaysOnSampler"); + AlwaysOnSampler3.prototype.shouldSample = function() { + return { + decision: SamplingDecision2.RECORD_AND_SAMPLED + }; + }; + AlwaysOnSampler3.prototype.toString = function() { + return "AlwaysOnSampler"; + }; + return AlwaysOnSampler3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/ParentBasedSampler.js +var ParentBasedSampler2 = function() { + function ParentBasedSampler3(config2) { + var _a3, _b2, _c, _d; + this._root = config2.root; + if (!this._root) { + globalErrorHandler(new Error("ParentBasedSampler must have a root sampler configured")); + this._root = new AlwaysOnSampler2(); + } + this._remoteParentSampled = (_a3 = config2.remoteParentSampled) !== null && _a3 !== void 0 ? _a3 : new AlwaysOnSampler2(); + this._remoteParentNotSampled = (_b2 = config2.remoteParentNotSampled) !== null && _b2 !== void 0 ? _b2 : new AlwaysOffSampler2(); + this._localParentSampled = (_c = config2.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler2(); + this._localParentNotSampled = (_d = config2.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler2(); + } + __name(ParentBasedSampler3, "ParentBasedSampler"); + ParentBasedSampler3.prototype.shouldSample = function(context3, traceId, spanName, spanKind, attributes, links) { + var parentContext = trace.getSpanContext(context3); + if (!parentContext || !isSpanContextValid(parentContext)) { + return this._root.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context3, traceId, spanName, spanKind, attributes, links); + }; + ParentBasedSampler3.prototype.toString = function() { + return "ParentBased{root=" + this._root.toString() + ", remoteParentSampled=" + this._remoteParentSampled.toString() + ", remoteParentNotSampled=" + this._remoteParentNotSampled.toString() + ", localParentSampled=" + this._localParentSampled.toString() + ", localParentNotSampled=" + this._localParentNotSampled.toString() + "}"; + }; + return ParentBasedSampler3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/TraceIdRatioBasedSampler.js +var TraceIdRatioBasedSampler2 = function() { + function TraceIdRatioBasedSampler3(_ratio) { + if (_ratio === void 0) { + _ratio = 0; + } + this._ratio = _ratio; + this._ratio = this._normalize(_ratio); + this._upperBound = Math.floor(this._ratio * 4294967295); + } + __name(TraceIdRatioBasedSampler3, "TraceIdRatioBasedSampler"); + TraceIdRatioBasedSampler3.prototype.shouldSample = function(context3, traceId) { + return { + decision: isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound ? SamplingDecision2.RECORD_AND_SAMPLED : SamplingDecision2.NOT_RECORD + }; + }; + TraceIdRatioBasedSampler3.prototype.toString = function() { + return "TraceIdRatioBased{" + this._ratio + "}"; + }; + TraceIdRatioBasedSampler3.prototype._normalize = function(ratio) { + if (typeof ratio !== "number" || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + }; + TraceIdRatioBasedSampler3.prototype._accumulate = function(traceId) { + var accumulation = 0; + for (var i = 0; i < traceId.length / 8; i++) { + var pos = i * 8; + var part = parseInt(traceId.slice(pos, pos + 8), 16); + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + }; + return TraceIdRatioBasedSampler3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/config.js +var env = getEnv(); +var FALLBACK_OTEL_TRACES_SAMPLER = TracesSamplerValues.AlwaysOn; +var DEFAULT_RATIO = 1; +function loadDefaultConfig() { + return { + sampler: buildSamplerFromEnv(env), + forceFlushTimeoutMillis: 3e4, + generalLimits: { + attributeValueLengthLimit: getEnv().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: getEnv().OTEL_ATTRIBUTE_COUNT_LIMIT + }, + spanLimits: { + attributeValueLengthLimit: getEnv().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: getEnv().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, + linkCountLimit: getEnv().OTEL_SPAN_LINK_COUNT_LIMIT, + eventCountLimit: getEnv().OTEL_SPAN_EVENT_COUNT_LIMIT + } + }; +} +__name(loadDefaultConfig, "loadDefaultConfig"); +function buildSamplerFromEnv(environment) { + if (environment === void 0) { + environment = getEnv(); + } + switch (environment.OTEL_TRACES_SAMPLER) { + case TracesSamplerValues.AlwaysOn: + return new AlwaysOnSampler2(); + case TracesSamplerValues.AlwaysOff: + return new AlwaysOffSampler2(); + case TracesSamplerValues.ParentBasedAlwaysOn: + return new ParentBasedSampler2({ + root: new AlwaysOnSampler2() + }); + case TracesSamplerValues.ParentBasedAlwaysOff: + return new ParentBasedSampler2({ + root: new AlwaysOffSampler2() + }); + case TracesSamplerValues.TraceIdRatio: + return new TraceIdRatioBasedSampler2(getSamplerProbabilityFromEnv(environment)); + case TracesSamplerValues.ParentBasedTraceIdRatio: + return new ParentBasedSampler2({ + root: new TraceIdRatioBasedSampler2(getSamplerProbabilityFromEnv(environment)) + }); + default: + diag2.error('OTEL_TRACES_SAMPLER value "' + environment.OTEL_TRACES_SAMPLER + " invalid, defaulting to " + FALLBACK_OTEL_TRACES_SAMPLER + '".'); + return new AlwaysOnSampler2(); + } +} +__name(buildSamplerFromEnv, "buildSamplerFromEnv"); +function getSamplerProbabilityFromEnv(environment) { + if (environment.OTEL_TRACES_SAMPLER_ARG === void 0 || environment.OTEL_TRACES_SAMPLER_ARG === "") { + diag2.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to " + DEFAULT_RATIO + "."); + return DEFAULT_RATIO; + } + var probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); + if (isNaN(probability)) { + diag2.error("OTEL_TRACES_SAMPLER_ARG=" + environment.OTEL_TRACES_SAMPLER_ARG + " was given, but it is invalid, defaulting to " + DEFAULT_RATIO + "."); + return DEFAULT_RATIO; + } + if (probability < 0 || probability > 1) { + diag2.error("OTEL_TRACES_SAMPLER_ARG=" + environment.OTEL_TRACES_SAMPLER_ARG + " was given, but it is out of range ([0..1]), defaulting to " + DEFAULT_RATIO + "."); + return DEFAULT_RATIO; + } + return probability; +} +__name(getSamplerProbabilityFromEnv, "getSamplerProbabilityFromEnv"); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/utility.js +function mergeConfig(userConfig) { + var perInstanceDefaults = { + sampler: buildSamplerFromEnv() + }; + var DEFAULT_CONFIG = loadDefaultConfig(); + var target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig); + target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); + target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); + return target; +} +__name(mergeConfig, "mergeConfig"); +function reconfigureLimits(userConfig) { + var _a3, _b2, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + var spanLimits = Object.assign({}, userConfig.spanLimits); + var parsedEnvConfig = getEnvWithoutDefaults(); + spanLimits.attributeCountLimit = (_f = (_e = (_d = (_b2 = (_a3 = userConfig.spanLimits) === null || _a3 === void 0 ? void 0 : _a3.attributeCountLimit) !== null && _b2 !== void 0 ? _b2 : (_c = userConfig.generalLimits) === null || _c === void 0 ? void 0 : _c.attributeCountLimit) !== null && _d !== void 0 ? _d : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT) !== null && _e !== void 0 ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _f !== void 0 ? _f : DEFAULT_ATTRIBUTE_COUNT_LIMIT; + spanLimits.attributeValueLengthLimit = (_m = (_l = (_k = (_h = (_g = userConfig.spanLimits) === null || _g === void 0 ? void 0 : _g.attributeValueLengthLimit) !== null && _h !== void 0 ? _h : (_j = userConfig.generalLimits) === null || _j === void 0 ? void 0 : _j.attributeValueLengthLimit) !== null && _k !== void 0 ? _k : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _l !== void 0 ? _l : parsedEnvConfig.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _m !== void 0 ? _m : DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; + return Object.assign({}, userConfig, { spanLimits }); +} +__name(reconfigureLimits, "reconfigureLimits"); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/BatchSpanProcessorBase.js +var BatchSpanProcessorBase = function() { + function BatchSpanProcessorBase2(_exporter, config2) { + this._exporter = _exporter; + this._finishedSpans = []; + var env2 = getEnv(); + this._maxExportBatchSize = typeof (config2 === null || config2 === void 0 ? void 0 : config2.maxExportBatchSize) === "number" ? config2.maxExportBatchSize : env2.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; + this._maxQueueSize = typeof (config2 === null || config2 === void 0 ? void 0 : config2.maxQueueSize) === "number" ? config2.maxQueueSize : env2.OTEL_BSP_MAX_QUEUE_SIZE; + this._scheduledDelayMillis = typeof (config2 === null || config2 === void 0 ? void 0 : config2.scheduledDelayMillis) === "number" ? config2.scheduledDelayMillis : env2.OTEL_BSP_SCHEDULE_DELAY; + this._exportTimeoutMillis = typeof (config2 === null || config2 === void 0 ? void 0 : config2.exportTimeoutMillis) === "number" ? config2.exportTimeoutMillis : env2.OTEL_BSP_EXPORT_TIMEOUT; + this._shutdownOnce = new BindOnceFuture(this._shutdown, this); + } + __name(BatchSpanProcessorBase2, "BatchSpanProcessorBase"); + BatchSpanProcessorBase2.prototype.forceFlush = function() { + if (this._shutdownOnce.isCalled) { + return this._shutdownOnce.promise; + } + return this._flushAll(); + }; + BatchSpanProcessorBase2.prototype.onStart = function(_span, _parentContext) { + }; + BatchSpanProcessorBase2.prototype.onEnd = function(span) { + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) { + return; + } + this._addToBuffer(span); + }; + BatchSpanProcessorBase2.prototype.shutdown = function() { + return this._shutdownOnce.call(); + }; + BatchSpanProcessorBase2.prototype._shutdown = function() { + var _this = this; + return Promise.resolve().then(function() { + return _this.onShutdown(); + }).then(function() { + return _this._flushAll(); + }).then(function() { + return _this._exporter.shutdown(); + }); + }; + BatchSpanProcessorBase2.prototype._addToBuffer = function(span) { + if (this._finishedSpans.length >= this._maxQueueSize) { + return; + } + this._finishedSpans.push(span); + this._maybeStartTimer(); + }; + BatchSpanProcessorBase2.prototype._flushAll = function() { + var _this = this; + return new Promise(function(resolve, reject) { + var promises = []; + var count2 = Math.ceil(_this._finishedSpans.length / _this._maxExportBatchSize); + for (var i = 0, j = count2; i < j; i++) { + promises.push(_this._flushOneBatch()); + } + Promise.all(promises).then(function() { + resolve(); + }).catch(reject); + }); + }; + BatchSpanProcessorBase2.prototype._flushOneBatch = function() { + var _this = this; + this._clearTimer(); + if (this._finishedSpans.length === 0) { + return Promise.resolve(); + } + return new Promise(function(resolve, reject) { + var timer = setTimeout(function() { + reject(new Error("Timeout")); + }, _this._exportTimeoutMillis); + context2.with(suppressTracing(context2.active()), function() { + _this._exporter.export(_this._finishedSpans.splice(0, _this._maxExportBatchSize), function(result) { + var _a3; + clearTimeout(timer); + if (result.code === ExportResultCode.SUCCESS) { + resolve(); + } else { + reject((_a3 = result.error) !== null && _a3 !== void 0 ? _a3 : new Error("BatchSpanProcessor: span export failed")); + } + }); + }); + }); + }; + BatchSpanProcessorBase2.prototype._maybeStartTimer = function() { + var _this = this; + if (this._timer !== void 0) + return; + this._timer = setTimeout(function() { + _this._flushOneBatch().then(function() { + if (_this._finishedSpans.length > 0) { + _this._clearTimer(); + _this._maybeStartTimer(); + } + }).catch(function(e) { + globalErrorHandler(e); + }); + }, this._scheduledDelayMillis); + unrefTimer(this._timer); + }; + BatchSpanProcessorBase2.prototype._clearTimer = function() { + if (this._timer !== void 0) { + clearTimeout(this._timer); + this._timer = void 0; + } + }; + return BatchSpanProcessorBase2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/export/BatchSpanProcessor.js +var __extends = function() { + var extendStatics = /* @__PURE__ */ __name(function(d, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { + d2.__proto__ = b2; + } || function(d2, b2) { + for (var p in b2) + if (Object.prototype.hasOwnProperty.call(b2, p)) + d2[p] = b2[p]; + }; + return extendStatics(d, b); + }, "extendStatics"); + return function(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { + this.constructor = d; + } + __name(__, "__"); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +}(); +var BatchSpanProcessor = function(_super) { + __extends(BatchSpanProcessor2, _super); + function BatchSpanProcessor2() { + return _super !== null && _super.apply(this, arguments) || this; + } + __name(BatchSpanProcessor2, "BatchSpanProcessor"); + BatchSpanProcessor2.prototype.onShutdown = function() { + }; + return BatchSpanProcessor2; +}(BatchSpanProcessorBase); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/RandomIdGenerator.js +var SPAN_ID_BYTES2 = 8; +var TRACE_ID_BYTES2 = 16; +var RandomIdGenerator2 = function() { + function RandomIdGenerator3() { + this.generateTraceId = getIdGenerator2(TRACE_ID_BYTES2); + this.generateSpanId = getIdGenerator2(SPAN_ID_BYTES2); + } + __name(RandomIdGenerator3, "RandomIdGenerator"); + return RandomIdGenerator3; +}(); +var SHARED_BUFFER2 = Buffer.allocUnsafe(TRACE_ID_BYTES2); +function getIdGenerator2(bytes) { + return /* @__PURE__ */ __name(function generateId() { + for (var i = 0; i < bytes / 4; i++) { + SHARED_BUFFER2.writeUInt32BE(Math.random() * Math.pow(2, 32) >>> 0, i * 4); + } + for (var i = 0; i < bytes; i++) { + if (SHARED_BUFFER2[i] > 0) { + break; + } else if (i === bytes - 1) { + SHARED_BUFFER2[bytes - 1] = 1; + } + } + return SHARED_BUFFER2.toString("hex", 0, bytes); + }, "generateId"); +} +__name(getIdGenerator2, "getIdGenerator"); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js +var Tracer = function() { + function Tracer3(instrumentationLibrary, config2, _tracerProvider) { + this._tracerProvider = _tracerProvider; + var localConfig = mergeConfig(config2); + this._sampler = localConfig.sampler; + this._generalLimits = localConfig.generalLimits; + this._spanLimits = localConfig.spanLimits; + this._idGenerator = config2.idGenerator || new RandomIdGenerator2(); + this.resource = _tracerProvider.resource; + this.instrumentationLibrary = instrumentationLibrary; + } + __name(Tracer3, "Tracer"); + Tracer3.prototype.startSpan = function(name, options, context3) { + var _a3, _b2; + if (options === void 0) { + options = {}; + } + if (context3 === void 0) { + context3 = context2.active(); + } + if (isTracingSuppressed(context3)) { + diag2.debug("Instrumentation suppressed, returning Noop Span"); + return trace.wrapSpanContext(INVALID_SPAN_CONTEXT); + } + if (options.root) { + context3 = trace.deleteSpan(context3); + } + var parentSpanContext = trace.getSpanContext(context3); + var spanId = this._idGenerator.generateSpanId(); + var traceId; + var traceState; + var parentSpanId; + if (!parentSpanContext || !trace.isSpanContextValid(parentSpanContext)) { + traceId = this._idGenerator.generateTraceId(); + } else { + traceId = parentSpanContext.traceId; + traceState = parentSpanContext.traceState; + parentSpanId = parentSpanContext.spanId; + } + var spanKind = (_a3 = options.kind) !== null && _a3 !== void 0 ? _a3 : SpanKind.INTERNAL; + var links = ((_b2 = options.links) !== null && _b2 !== void 0 ? _b2 : []).map(function(link) { + return { + context: link.context, + attributes: sanitizeAttributes(link.attributes) + }; + }); + var attributes = sanitizeAttributes(options.attributes); + var samplingResult = this._sampler.shouldSample(context3, traceId, name, spanKind, attributes, links); + var traceFlags = samplingResult.decision === SamplingDecision.RECORD_AND_SAMPLED ? TraceFlags.SAMPLED : TraceFlags.NONE; + var spanContext = { traceId, spanId, traceFlags, traceState }; + if (samplingResult.decision === SamplingDecision.NOT_RECORD) { + diag2.debug("Recording is off, propagating context in a non-recording span"); + return trace.wrapSpanContext(spanContext); + } + var span = new Span(this, context3, name, spanContext, spanKind, parentSpanId, links, options.startTime); + var initAttributes = sanitizeAttributes(Object.assign(attributes, samplingResult.attributes)); + span.setAttributes(initAttributes); + return span; + }; + Tracer3.prototype.startActiveSpan = function(name, arg2, arg3, arg4) { + var opts; + var ctx; + var fn; + if (arguments.length < 2) { + return; + } else if (arguments.length === 2) { + fn = arg2; + } else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + var parentContext = ctx !== null && ctx !== void 0 ? ctx : context2.active(); + var span = this.startSpan(name, opts, parentContext); + var contextWithSpanSet = trace.setSpan(parentContext, span); + return context2.with(contextWithSpanSet, fn, void 0, span); + }; + Tracer3.prototype.getGeneralLimits = function() { + return this._generalLimits; + }; + Tracer3.prototype.getSpanLimits = function() { + return this._spanLimits; + }; + Tracer3.prototype.getActiveSpanProcessor = function() { + return this._tracerProvider.getActiveSpanProcessor(); + }; + return Tracer3; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+resources@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js +function defaultServiceName() { + return "unknown_service:" + process.argv0; +} +__name(defaultServiceName, "defaultServiceName"); + +// ../../node_modules/.pnpm/@opentelemetry+resources@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/resources/build/esm/platform/node/HostDetector.js +var import_os2 = require("os"); +var __awaiter = function(thisArg, _arguments, P3, generator) { + function adopt(value) { + return value instanceof P3 ? value : new P3(function(resolve) { + resolve(value); + }); + } + __name(adopt, "adopt"); + return new (P3 || (P3 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + __name(fulfilled, "fulfilled"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + __name(rejected, "rejected"); + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + __name(step, "step"); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) + throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + __name(verb, "verb"); + function step(op) { + if (f) + throw new TypeError("Generator is already executing."); + while (_) + try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) + return t; + if (y = 0, t) + op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) + _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + __name(step, "step"); +}; +var HostDetector = function() { + function HostDetector2() { + } + __name(HostDetector2, "HostDetector"); + HostDetector2.prototype.detect = function(_config) { + return __awaiter(this, void 0, void 0, function() { + var attributes; + var _a3; + return __generator(this, function(_b2) { + attributes = (_a3 = {}, _a3[SemanticResourceAttributes.HOST_NAME] = (0, import_os2.hostname)(), _a3[SemanticResourceAttributes.HOST_ARCH] = this._normalizeArch((0, import_os2.arch)()), _a3); + return [2, new Resource(attributes)]; + }); + }); + }; + HostDetector2.prototype._normalizeArch = function(nodeArchString) { + switch (nodeArchString) { + case "arm": + return "arm32"; + case "ppc": + return "ppc32"; + case "x64": + return "amd64"; + default: + return nodeArchString; + } + }; + return HostDetector2; +}(); +var hostDetector = new HostDetector(); + +// ../../node_modules/.pnpm/@opentelemetry+resources@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/resources/build/esm/platform/node/OSDetector.js +var import_os3 = require("os"); +var __awaiter2 = function(thisArg, _arguments, P3, generator) { + function adopt(value) { + return value instanceof P3 ? value : new P3(function(resolve) { + resolve(value); + }); + } + __name(adopt, "adopt"); + return new (P3 || (P3 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + __name(fulfilled, "fulfilled"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + __name(rejected, "rejected"); + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + __name(step, "step"); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator2 = function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) + throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + __name(verb, "verb"); + function step(op) { + if (f) + throw new TypeError("Generator is already executing."); + while (_) + try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) + return t; + if (y = 0, t) + op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) + _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + __name(step, "step"); +}; +var OSDetector = function() { + function OSDetector2() { + } + __name(OSDetector2, "OSDetector"); + OSDetector2.prototype.detect = function(_config) { + return __awaiter2(this, void 0, void 0, function() { + var attributes; + var _a3; + return __generator2(this, function(_b2) { + attributes = (_a3 = {}, _a3[SemanticResourceAttributes.OS_TYPE] = this._normalizeType((0, import_os3.platform)()), _a3[SemanticResourceAttributes.OS_VERSION] = (0, import_os3.release)(), _a3); + return [2, new Resource(attributes)]; + }); + }); + }; + OSDetector2.prototype._normalizeType = function(nodePlatform) { + switch (nodePlatform) { + case "sunos": + return "solaris"; + case "win32": + return "windows"; + default: + return nodePlatform; + } + }; + return OSDetector2; +}(); +var osDetector = new OSDetector(); + +// ../../node_modules/.pnpm/@opentelemetry+resources@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/resources/build/esm/Resource.js +var Resource = function() { + function Resource2(attributes) { + this.attributes = attributes; + } + __name(Resource2, "Resource"); + Resource2.empty = function() { + return Resource2.EMPTY; + }; + Resource2.default = function() { + var _a3; + return new Resource2((_a3 = {}, _a3[SemanticResourceAttributes.SERVICE_NAME] = defaultServiceName(), _a3[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE] = SDK_INFO[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE], _a3[SemanticResourceAttributes.TELEMETRY_SDK_NAME] = SDK_INFO[SemanticResourceAttributes.TELEMETRY_SDK_NAME], _a3[SemanticResourceAttributes.TELEMETRY_SDK_VERSION] = SDK_INFO[SemanticResourceAttributes.TELEMETRY_SDK_VERSION], _a3)); + }; + Resource2.prototype.merge = function(other) { + if (!other || !Object.keys(other.attributes).length) + return this; + var mergedAttributes = Object.assign({}, this.attributes, other.attributes); + return new Resource2(mergedAttributes); + }; + Resource2.EMPTY = new Resource2({}); + return Resource2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+resources@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/resources/build/esm/detectors/BrowserDetector.js +var __assign = function() { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter3 = function(thisArg, _arguments, P3, generator) { + function adopt(value) { + return value instanceof P3 ? value : new P3(function(resolve) { + resolve(value); + }); + } + __name(adopt, "adopt"); + return new (P3 || (P3 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + __name(fulfilled, "fulfilled"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + __name(rejected, "rejected"); + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + __name(step, "step"); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator3 = function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) + throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + __name(verb, "verb"); + function step(op) { + if (f) + throw new TypeError("Generator is already executing."); + while (_) + try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) + return t; + if (y = 0, t) + op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) + _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + __name(step, "step"); +}; +var BrowserDetector = function() { + function BrowserDetector2() { + } + __name(BrowserDetector2, "BrowserDetector"); + BrowserDetector2.prototype.detect = function(config2) { + return __awaiter3(this, void 0, void 0, function() { + var isBrowser, browserResource; + var _a3; + return __generator3(this, function(_b2) { + isBrowser = typeof navigator !== "undefined"; + if (!isBrowser) { + return [2, Resource.empty()]; + } + browserResource = (_a3 = {}, _a3[SemanticResourceAttributes.PROCESS_RUNTIME_NAME] = "browser", _a3[SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION] = "Web Browser", _a3[SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] = navigator.userAgent, _a3); + return [2, this._getResourceAttributes(browserResource, config2)]; + }); + }); + }; + BrowserDetector2.prototype._getResourceAttributes = function(browserResource, _config) { + if (browserResource[SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === "") { + diag2.debug("BrowserDetector failed: Unable to find required browser resources. "); + return Resource.empty(); + } else { + return new Resource(__assign({}, browserResource)); + } + }; + return BrowserDetector2; +}(); +var browserDetector = new BrowserDetector(); + +// ../../node_modules/.pnpm/@opentelemetry+resources@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/resources/build/esm/detectors/EnvDetector.js +var __awaiter4 = function(thisArg, _arguments, P3, generator) { + function adopt(value) { + return value instanceof P3 ? value : new P3(function(resolve) { + resolve(value); + }); + } + __name(adopt, "adopt"); + return new (P3 || (P3 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + __name(fulfilled, "fulfilled"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + __name(rejected, "rejected"); + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + __name(step, "step"); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator4 = function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) + throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + __name(verb, "verb"); + function step(op) { + if (f) + throw new TypeError("Generator is already executing."); + while (_) + try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) + return t; + if (y = 0, t) + op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) + _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + __name(step, "step"); +}; +var __values4 = function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) + return m.call(o); + if (o && typeof o.length === "number") + return { + next: function() { + if (o && i >= o.length) + o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __read5 = function(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) + return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) + ar.push(r.value); + } catch (error2) { + e = { error: error2 }; + } finally { + try { + if (r && !r.done && (m = i["return"])) + m.call(i); + } finally { + if (e) + throw e.error; + } + } + return ar; +}; +var EnvDetector = function() { + function EnvDetector2() { + this._MAX_LENGTH = 255; + this._COMMA_SEPARATOR = ","; + this._LABEL_KEY_VALUE_SPLITTER = "="; + this._ERROR_MESSAGE_INVALID_CHARS = "should be a ASCII string with a length greater than 0 and not exceed " + this._MAX_LENGTH + " characters."; + this._ERROR_MESSAGE_INVALID_VALUE = "should be a ASCII string with a length not exceed " + this._MAX_LENGTH + " characters."; + } + __name(EnvDetector2, "EnvDetector"); + EnvDetector2.prototype.detect = function(_config) { + return __awaiter4(this, void 0, void 0, function() { + var attributes, env2, rawAttributes, serviceName, parsedAttributes; + return __generator4(this, function(_a3) { + attributes = {}; + env2 = getEnv(); + rawAttributes = env2.OTEL_RESOURCE_ATTRIBUTES; + serviceName = env2.OTEL_SERVICE_NAME; + if (rawAttributes) { + try { + parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } catch (e) { + diag2.debug("EnvDetector failed: " + e.message); + } + } + if (serviceName) { + attributes[SemanticResourceAttributes.SERVICE_NAME] = serviceName; + } + return [2, new Resource(attributes)]; + }); + }); + }; + EnvDetector2.prototype._parseResourceAttributes = function(rawEnvAttributes) { + var e_1, _a3; + if (!rawEnvAttributes) + return {}; + var attributes = {}; + var rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); + try { + for (var rawAttributes_1 = __values4(rawAttributes), rawAttributes_1_1 = rawAttributes_1.next(); !rawAttributes_1_1.done; rawAttributes_1_1 = rawAttributes_1.next()) { + var rawAttribute = rawAttributes_1_1.value; + var keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); + if (keyValuePair.length !== 2) { + continue; + } + var _b2 = __read5(keyValuePair, 2), key = _b2[0], value = _b2[1]; + key = key.trim(); + value = value.trim().split('^"|"$').join(""); + if (!this._isValidAndNotEmpty(key)) { + throw new Error("Attribute key " + this._ERROR_MESSAGE_INVALID_CHARS); + } + if (!this._isValid(value)) { + throw new Error("Attribute value " + this._ERROR_MESSAGE_INVALID_VALUE); + } + attributes[key] = value; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (rawAttributes_1_1 && !rawAttributes_1_1.done && (_a3 = rawAttributes_1.return)) + _a3.call(rawAttributes_1); + } finally { + if (e_1) + throw e_1.error; + } + } + return attributes; + }; + EnvDetector2.prototype._isValid = function(name) { + return name.length <= this._MAX_LENGTH && this._isPrintableString(name); + }; + EnvDetector2.prototype._isPrintableString = function(str) { + for (var i = 0; i < str.length; i++) { + var ch = str.charAt(i); + if (ch <= " " || ch >= "~") { + return false; + } + } + return true; + }; + EnvDetector2.prototype._isValidAndNotEmpty = function(str) { + return str.length > 0 && this._isValid(str); + }; + return EnvDetector2; +}(); +var envDetector = new EnvDetector(); + +// ../../node_modules/.pnpm/@opentelemetry+resources@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/resources/build/esm/detectors/ProcessDetector.js +var __assign2 = function() { + __assign2 = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign2.apply(this, arguments); +}; +var __awaiter5 = function(thisArg, _arguments, P3, generator) { + function adopt(value) { + return value instanceof P3 ? value : new P3(function(resolve) { + resolve(value); + }); + } + __name(adopt, "adopt"); + return new (P3 || (P3 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + __name(fulfilled, "fulfilled"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + __name(rejected, "rejected"); + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + __name(step, "step"); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator5 = function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) + throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + __name(verb, "verb"); + function step(op) { + if (f) + throw new TypeError("Generator is already executing."); + while (_) + try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) + return t; + if (y = 0, t) + op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) + _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + __name(step, "step"); +}; +var ProcessDetector = function() { + function ProcessDetector2() { + } + __name(ProcessDetector2, "ProcessDetector"); + ProcessDetector2.prototype.detect = function(config2) { + return __awaiter5(this, void 0, void 0, function() { + var processResource; + var _a3; + return __generator5(this, function(_b2) { + if (typeof process !== "object") { + return [2, Resource.empty()]; + } + processResource = (_a3 = {}, _a3[SemanticResourceAttributes.PROCESS_PID] = process.pid, _a3[SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME] = process.title || "", _a3[SemanticResourceAttributes.PROCESS_COMMAND] = process.argv[1] || "", _a3[SemanticResourceAttributes.PROCESS_COMMAND_LINE] = process.argv.join(" ") || "", _a3[SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] = process.versions.node, _a3[SemanticResourceAttributes.PROCESS_RUNTIME_NAME] = "nodejs", _a3[SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION] = "Node.js", _a3); + return [2, this._getResourceAttributes(processResource, config2)]; + }); + }); + }; + ProcessDetector2.prototype._getResourceAttributes = function(processResource, _config) { + if (processResource[SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME] === "" || processResource[SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH] === "" || processResource[SemanticResourceAttributes.PROCESS_COMMAND] === "" || processResource[SemanticResourceAttributes.PROCESS_COMMAND_LINE] === "" || processResource[SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === "") { + diag2.debug("ProcessDetector failed: Unable to find required process resources. "); + return Resource.empty(); + } else { + return new Resource(__assign2({}, processResource)); + } + }; + return ProcessDetector2; +}(); +var processDetector = new ProcessDetector(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/MultiSpanProcessor.js +var __values5 = function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) + return m.call(o); + if (o && typeof o.length === "number") + return { + next: function() { + if (o && i >= o.length) + o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var MultiSpanProcessor = function() { + function MultiSpanProcessor2(_spanProcessors) { + this._spanProcessors = _spanProcessors; + } + __name(MultiSpanProcessor2, "MultiSpanProcessor"); + MultiSpanProcessor2.prototype.forceFlush = function() { + var e_1, _a3; + var promises = []; + try { + for (var _b2 = __values5(this._spanProcessors), _c = _b2.next(); !_c.done; _c = _b2.next()) { + var spanProcessor = _c.value; + promises.push(spanProcessor.forceFlush()); + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (_c && !_c.done && (_a3 = _b2.return)) + _a3.call(_b2); + } finally { + if (e_1) + throw e_1.error; + } + } + return new Promise(function(resolve) { + Promise.all(promises).then(function() { + resolve(); + }).catch(function(error2) { + globalErrorHandler(error2 || new Error("MultiSpanProcessor: forceFlush failed")); + resolve(); + }); + }); + }; + MultiSpanProcessor2.prototype.onStart = function(span, context3) { + var e_2, _a3; + try { + for (var _b2 = __values5(this._spanProcessors), _c = _b2.next(); !_c.done; _c = _b2.next()) { + var spanProcessor = _c.value; + spanProcessor.onStart(span, context3); + } + } catch (e_2_1) { + e_2 = { error: e_2_1 }; + } finally { + try { + if (_c && !_c.done && (_a3 = _b2.return)) + _a3.call(_b2); + } finally { + if (e_2) + throw e_2.error; + } + } + }; + MultiSpanProcessor2.prototype.onEnd = function(span) { + var e_3, _a3; + try { + for (var _b2 = __values5(this._spanProcessors), _c = _b2.next(); !_c.done; _c = _b2.next()) { + var spanProcessor = _c.value; + spanProcessor.onEnd(span); + } + } catch (e_3_1) { + e_3 = { error: e_3_1 }; + } finally { + try { + if (_c && !_c.done && (_a3 = _b2.return)) + _a3.call(_b2); + } finally { + if (e_3) + throw e_3.error; + } + } + }; + MultiSpanProcessor2.prototype.shutdown = function() { + var e_4, _a3; + var promises = []; + try { + for (var _b2 = __values5(this._spanProcessors), _c = _b2.next(); !_c.done; _c = _b2.next()) { + var spanProcessor = _c.value; + promises.push(spanProcessor.shutdown()); + } + } catch (e_4_1) { + e_4 = { error: e_4_1 }; + } finally { + try { + if (_c && !_c.done && (_a3 = _b2.return)) + _a3.call(_b2); + } finally { + if (e_4) + throw e_4.error; + } + } + return new Promise(function(resolve, reject) { + Promise.all(promises).then(function() { + resolve(); + }, reject); + }); + }; + return MultiSpanProcessor2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/NoopSpanProcessor.js +var NoopSpanProcessor = function() { + function NoopSpanProcessor2() { + } + __name(NoopSpanProcessor2, "NoopSpanProcessor"); + NoopSpanProcessor2.prototype.onStart = function(_span, _context) { + }; + NoopSpanProcessor2.prototype.onEnd = function(_span) { + }; + NoopSpanProcessor2.prototype.shutdown = function() { + return Promise.resolve(); + }; + NoopSpanProcessor2.prototype.forceFlush = function() { + return Promise.resolve(); + }; + return NoopSpanProcessor2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/BasicTracerProvider.js +var ForceFlushState; +(function(ForceFlushState2) { + ForceFlushState2[ForceFlushState2["resolved"] = 0] = "resolved"; + ForceFlushState2[ForceFlushState2["timeout"] = 1] = "timeout"; + ForceFlushState2[ForceFlushState2["error"] = 2] = "error"; + ForceFlushState2[ForceFlushState2["unresolved"] = 3] = "unresolved"; +})(ForceFlushState || (ForceFlushState = {})); +var BasicTracerProvider = function() { + function BasicTracerProvider2(config2) { + if (config2 === void 0) { + config2 = {}; + } + var _a3; + this._registeredSpanProcessors = []; + this._tracers = /* @__PURE__ */ new Map(); + var mergedConfig = merge({}, loadDefaultConfig(), reconfigureLimits(config2)); + this.resource = (_a3 = mergedConfig.resource) !== null && _a3 !== void 0 ? _a3 : Resource.empty(); + this.resource = Resource.default().merge(this.resource); + this._config = Object.assign({}, mergedConfig, { + resource: this.resource + }); + var defaultExporter = this._buildExporterFromEnv(); + if (defaultExporter !== void 0) { + var batchProcessor = new BatchSpanProcessor(defaultExporter); + this.activeSpanProcessor = batchProcessor; + } else { + this.activeSpanProcessor = new NoopSpanProcessor(); + } + } + __name(BasicTracerProvider2, "BasicTracerProvider"); + BasicTracerProvider2.prototype.getTracer = function(name, version, options) { + var key = name + "@" + (version || "") + ":" + ((options === null || options === void 0 ? void 0 : options.schemaUrl) || ""); + if (!this._tracers.has(key)) { + this._tracers.set(key, new Tracer({ name, version, schemaUrl: options === null || options === void 0 ? void 0 : options.schemaUrl }, this._config, this)); + } + return this._tracers.get(key); + }; + BasicTracerProvider2.prototype.addSpanProcessor = function(spanProcessor) { + if (this._registeredSpanProcessors.length === 0) { + this.activeSpanProcessor.shutdown().catch(function(err) { + return diag2.error("Error while trying to shutdown current span processor", err); + }); + } + this._registeredSpanProcessors.push(spanProcessor); + this.activeSpanProcessor = new MultiSpanProcessor(this._registeredSpanProcessors); + }; + BasicTracerProvider2.prototype.getActiveSpanProcessor = function() { + return this.activeSpanProcessor; + }; + BasicTracerProvider2.prototype.register = function(config2) { + if (config2 === void 0) { + config2 = {}; + } + trace.setGlobalTracerProvider(this); + if (config2.propagator === void 0) { + config2.propagator = this._buildPropagatorFromEnv(); + } + if (config2.contextManager) { + context2.setGlobalContextManager(config2.contextManager); + } + if (config2.propagator) { + propagation.setGlobalPropagator(config2.propagator); + } + }; + BasicTracerProvider2.prototype.forceFlush = function() { + var timeout = this._config.forceFlushTimeoutMillis; + var promises = this._registeredSpanProcessors.map(function(spanProcessor) { + return new Promise(function(resolve) { + var state; + var timeoutInterval = setTimeout(function() { + resolve(new Error("Span processor did not completed within timeout period of " + timeout + " ms")); + state = ForceFlushState.timeout; + }, timeout); + spanProcessor.forceFlush().then(function() { + clearTimeout(timeoutInterval); + if (state !== ForceFlushState.timeout) { + state = ForceFlushState.resolved; + resolve(state); + } + }).catch(function(error2) { + clearTimeout(timeoutInterval); + state = ForceFlushState.error; + resolve(error2); + }); + }); + }); + return new Promise(function(resolve, reject) { + Promise.all(promises).then(function(results) { + var errors = results.filter(function(result) { + return result !== ForceFlushState.resolved; + }); + if (errors.length > 0) { + reject(errors); + } else { + resolve(); + } + }).catch(function(error2) { + return reject([error2]); + }); + }); + }; + BasicTracerProvider2.prototype.shutdown = function() { + return this.activeSpanProcessor.shutdown(); + }; + BasicTracerProvider2.prototype._getPropagator = function(name) { + var _a3; + return (_a3 = this.constructor._registeredPropagators.get(name)) === null || _a3 === void 0 ? void 0 : _a3(); + }; + BasicTracerProvider2.prototype._getSpanExporter = function(name) { + var _a3; + return (_a3 = this.constructor._registeredExporters.get(name)) === null || _a3 === void 0 ? void 0 : _a3(); + }; + BasicTracerProvider2.prototype._buildPropagatorFromEnv = function() { + var _this = this; + var uniquePropagatorNames = Array.from(new Set(getEnv().OTEL_PROPAGATORS)); + var propagators = uniquePropagatorNames.map(function(name) { + var propagator = _this._getPropagator(name); + if (!propagator) { + diag2.warn('Propagator "' + name + '" requested through environment variable is unavailable.'); + } + return propagator; + }); + var validPropagators = propagators.reduce(function(list, item) { + if (item) { + list.push(item); + } + return list; + }, []); + if (validPropagators.length === 0) { + return; + } else if (uniquePropagatorNames.length === 1) { + return validPropagators[0]; + } else { + return new CompositePropagator({ + propagators: validPropagators + }); + } + }; + BasicTracerProvider2.prototype._buildExporterFromEnv = function() { + var exporterName = getEnv().OTEL_TRACES_EXPORTER; + if (exporterName === "none") + return; + var exporter = this._getSpanExporter(exporterName); + if (!exporter) { + diag2.error('Exporter "' + exporterName + '" requested through environment variable is unavailable.'); + } + return exporter; + }; + BasicTracerProvider2._registeredPropagators = /* @__PURE__ */ new Map([ + ["tracecontext", function() { + return new W3CTraceContextPropagator(); + }], + ["baggage", function() { + return new W3CBaggagePropagator(); + }] + ]); + BasicTracerProvider2._registeredExporters = /* @__PURE__ */ new Map(); + return BasicTracerProvider2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/ConsoleSpanExporter.js +var __values6 = function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) + return m.call(o); + if (o && typeof o.length === "number") + return { + next: function() { + if (o && i >= o.length) + o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var ConsoleSpanExporter = function() { + function ConsoleSpanExporter2() { + } + __name(ConsoleSpanExporter2, "ConsoleSpanExporter"); + ConsoleSpanExporter2.prototype.export = function(spans, resultCallback) { + return this._sendSpans(spans, resultCallback); + }; + ConsoleSpanExporter2.prototype.shutdown = function() { + this._sendSpans([]); + return Promise.resolve(); + }; + ConsoleSpanExporter2.prototype._exportInfo = function(span) { + return { + traceId: span.spanContext().traceId, + parentId: span.parentSpanId, + name: span.name, + id: span.spanContext().spanId, + kind: span.kind, + timestamp: hrTimeToMicroseconds(span.startTime), + duration: hrTimeToMicroseconds(span.duration), + attributes: span.attributes, + status: span.status, + events: span.events, + links: span.links + }; + }; + ConsoleSpanExporter2.prototype._sendSpans = function(spans, done) { + var e_1, _a3; + try { + for (var spans_1 = __values6(spans), spans_1_1 = spans_1.next(); !spans_1_1.done; spans_1_1 = spans_1.next()) { + var span = spans_1_1.value; + console.dir(this._exportInfo(span), { depth: 3 }); + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (spans_1_1 && !spans_1_1.done && (_a3 = spans_1.return)) + _a3.call(spans_1); + } finally { + if (e_1) + throw e_1.error; + } + } + if (done) { + return done({ code: ExportResultCode.SUCCESS }); + } + }; + return ConsoleSpanExporter2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/InMemorySpanExporter.js +var __read6 = function(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) + return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) + ar.push(r.value); + } catch (error2) { + e = { error: error2 }; + } finally { + try { + if (r && !r.done && (m = i["return"])) + m.call(i); + } finally { + if (e) + throw e.error; + } + } + return ar; +}; +var __spreadArray4 = function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +var InMemorySpanExporter = function() { + function InMemorySpanExporter2() { + this._finishedSpans = []; + this._stopped = false; + } + __name(InMemorySpanExporter2, "InMemorySpanExporter"); + InMemorySpanExporter2.prototype.export = function(spans, resultCallback) { + var _a3; + if (this._stopped) + return resultCallback({ + code: ExportResultCode.FAILED, + error: new Error("Exporter has been stopped") + }); + (_a3 = this._finishedSpans).push.apply(_a3, __spreadArray4([], __read6(spans), false)); + setTimeout(function() { + return resultCallback({ code: ExportResultCode.SUCCESS }); + }, 0); + }; + InMemorySpanExporter2.prototype.shutdown = function() { + this._stopped = true; + this._finishedSpans = []; + return Promise.resolve(); + }; + InMemorySpanExporter2.prototype.reset = function() { + this._finishedSpans = []; + }; + InMemorySpanExporter2.prototype.getFinishedSpans = function() { + return this._finishedSpans; + }; + return InMemorySpanExporter2; +}(); + +// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.6.0_@opentelemetry+api@1.1.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/SimpleSpanProcessor.js +var SimpleSpanProcessor = function() { + function SimpleSpanProcessor2(_exporter) { + this._exporter = _exporter; + this._shutdownOnce = new BindOnceFuture(this._shutdown, this); + } + __name(SimpleSpanProcessor2, "SimpleSpanProcessor"); + SimpleSpanProcessor2.prototype.forceFlush = function() { + return Promise.resolve(); + }; + SimpleSpanProcessor2.prototype.onStart = function(_span, _parentContext) { + }; + SimpleSpanProcessor2.prototype.onEnd = function(span) { + var _this = this; + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) { + return; + } + context2.with(suppressTracing(context2.active()), function() { + _this._exporter.export([span], function(result) { + var _a3; + if (result.code !== ExportResultCode.SUCCESS) { + globalErrorHandler((_a3 = result.error) !== null && _a3 !== void 0 ? _a3 : new Error("SimpleSpanProcessor: span export failed (status " + result + ")")); + } + }); + }); + }; + SimpleSpanProcessor2.prototype.shutdown = function() { + return this._shutdownOnce.call(); + }; + SimpleSpanProcessor2.prototype._shutdown = function() { + return this._exporter.shutdown(); + }; + return SimpleSpanProcessor2; +}(); + +// ../engine-core/src/tracing/createSpan.ts +async function createSpan(engineSpanEvent) { + await new Promise((res) => setTimeout(res, 0)); + const tracer = trace.getTracer("prisma"); + engineSpanEvent.spans.forEach((engineSpan) => { + var _a3; + const spanContext = { + traceId: engineSpan.trace_id, + spanId: engineSpan.span_id, + traceFlags: TraceFlags.SAMPLED + }; + const links = (_a3 = engineSpan.links) == null ? void 0 : _a3.map((link) => { + return { + context: { + traceId: link.trace_id, + spanId: link.span_id, + traceFlags: TraceFlags.SAMPLED + } + }; + }); + const span = new Span( + tracer, + ROOT_CONTEXT, + engineSpan.name, + spanContext, + SpanKind.INTERNAL, + engineSpan.parent_span_id, + links, + engineSpan.start_time + ); + if (engineSpan.attributes) { + span.setAttributes(engineSpan.attributes); + } + span.end(engineSpan.end_time); + }); +} +__name(createSpan, "createSpan"); + +// ../engine-core/src/tracing/getTraceParent.ts +function getTraceParent({ + context: context3, + tracingConfig +}) { + const span = trace.getSpanContext(context3 != null ? context3 : context2.active()); + if ((tracingConfig == null ? void 0 : tracingConfig.enabled) && (span == null ? void 0 : span.traceFlags) === 1) { + return `00-${span.traceId}-${span.spanId}-01`; + } else { + return `00-00-00-00`; + } +} +__name(getTraceParent, "getTraceParent"); + +// ../engine-core/src/tracing/getTracingConfig.ts +function getTracingConfig(previewFeatures) { + const hasTracingPreviewFeatureFlagEnabled = previewFeatures.includes("tracing"); + return { + get enabled() { + return Boolean(globalThis.PRISMA_INSTRUMENTATION && hasTracingPreviewFeatureFlagEnabled); + }, + get middleware() { + return Boolean(globalThis.PRISMA_INSTRUMENTATION && globalThis.PRISMA_INSTRUMENTATION.middleware); + } + }; +} +__name(getTracingConfig, "getTracingConfig"); + +// ../engine-core/src/tracing/runInChildSpan.ts +async function runInChildSpan(options, cb) { + var _a3; + if (options.enabled === false) + return cb(); + const tracer = trace.getTracer("prisma"); + const context3 = (_a3 = options.context) != null ? _a3 : context2.active(); + if (options.active === false) { + const span = tracer.startSpan(`prisma:client:${options.name}`, options, context3); + try { + return await cb(span, context3); + } finally { + span.end(); + } + } + return tracer.startActiveSpan(`prisma:client:${options.name}`, options, context3, async (span) => { + try { + return await cb(span, context2.active()); + } finally { + span.end(); + } + }); +} +__name(runInChildSpan, "runInChildSpan"); + +// ../engine-core/src/binary/Connection.ts +var import_get_stream = __toESM(require_get_stream()); +var undici = /* @__PURE__ */ __name(() => require_undici(), "undici"); +function assertHasPool(pool) { + if (pool === void 0) { + throw new Error("Connection has not been opened"); + } +} +__name(assertHasPool, "assertHasPool"); +var Connection = class { + constructor() { + } + static async onHttpError(response, handler) { + const _response = await response; + if (_response.statusCode >= 400) { + return handler(_response); + } + return _response; + } + open(url, options) { + if (this._pool) + return; + this._pool = new (undici()).Pool(url, { + connections: 1e3, + keepAliveMaxTimeout: 6e5, + headersTimeout: 0, + bodyTimeout: 0, + ...options + }); + } + async raw(method, endpoint, headers, body, parseResponse = true) { + assertHasPool(this._pool); + const response = await this._pool.request({ + path: endpoint, + method, + headers: { + "Content-Type": "application/json", + ...headers + }, + body + }); + const bodyString = await (0, import_get_stream.default)(response.body); + return { + statusCode: response.statusCode, + headers: response.headers, + data: parseResponse ? JSON.parse(bodyString) : bodyString + }; + } + post(endpoint, body, headers, parseResponse) { + return this.raw("POST", endpoint, headers, body, parseResponse); + } + get(path7, headers) { + return this.raw("GET", path7, headers); + } + close() { + if (this._pool) { + this._pool.close(() => { + }); + } + this._pool = void 0; + } +}; +__name(Connection, "Connection"); + +// ../engine-core/src/binary/BinaryEngine.ts +var debug4 = src_default("prisma:engine"); +var exists2 = (0, import_util4.promisify)(import_fs4.default.exists); +var logger = /* @__PURE__ */ __name((...args) => { +}, "logger"); +var knownPlatforms = [...platforms, "native"]; +var engines = []; +var socketPaths = []; +var MAX_STARTS = process.env.PRISMA_CLIENT_NO_RETRY ? 1 : 2; +var MAX_REQUEST_RETRIES = process.env.PRISMA_CLIENT_NO_RETRY ? 1 : 2; +var BinaryEngine = class extends Engine { + constructor({ + cwd, + datamodelPath, + prismaPath, + generator, + datasources, + showColors, + logLevel, + logQueries, + env: env2, + flags, + clientVersion: clientVersion2, + previewFeatures, + engineEndpoint, + enableDebugLogs, + allowTriggerPanic, + dirname: dirname2, + activeProvider, + tracingConfig + }) { + var _a3; + super(); + this.startCount = 0; + this.previewFeatures = []; + this.stderrLogs = ""; + this.handleRequestError = /* @__PURE__ */ __name(async (error2, graceful = false) => { + var _a3, _b2; + debug4({ error: error2 }); + if (this.startPromise) { + await this.startPromise; + } + this.throwAsyncErrorIfExists(); + if ((_a3 = this.currentRequestPromise) == null ? void 0 : _a3.isCanceled) { + this.throwAsyncErrorIfExists(); + } else if (error2.code === "ECONNRESET" || error2.code === "ECONNREFUSED" || error2.code === "UND_ERR_CLOSED" || error2.code === "UND_ERR_SOCKET" || error2.code === "UND_ERR_DESTROYED" || error2.code === "UND_ERR_ABORTED" || error2.message.toLowerCase().includes("client is destroyed") || error2.message.toLowerCase().includes("other side closed") || error2.message.toLowerCase().includes("the client is closed")) { + if (this.globalKillSignalReceived && !((_b2 = this.child) == null ? void 0 : _b2.connected)) { + throw new PrismaClientUnknownRequestError( + `The Node.js process already received a ${this.globalKillSignalReceived} signal, therefore the Prisma query engine exited +and your request can't be processed. +You probably have some open handle that prevents your process from exiting. +It could be an open http server or stream that didn't close yet. +We recommend using the \`wtfnode\` package to debug open handles.`, + this.clientVersion + ); + } + this.throwAsyncErrorIfExists(); + if (this.startCount > MAX_STARTS) { + for (let i = 0; i < 5; i++) { + await new Promise((r) => setTimeout(r, 50)); + this.throwAsyncErrorIfExists(true); + } + throw new Error(`Query engine is trying to restart, but can't. +Please look into the logs or turn on the env var DEBUG=* to debug the constantly restarting query engine.`); + } + } + if (!graceful) { + this.throwAsyncErrorIfExists(true); + throw error2; + } + return false; + }, "handleRequestError"); + this.dirname = dirname2; + this.env = env2; + this.cwd = this.resolveCwd(cwd); + this.enableDebugLogs = enableDebugLogs != null ? enableDebugLogs : false; + this.allowTriggerPanic = allowTriggerPanic != null ? allowTriggerPanic : false; + this.datamodelPath = datamodelPath; + this.prismaPath = (_a3 = process.env.PRISMA_QUERY_ENGINE_BINARY) != null ? _a3 : prismaPath; + this.generator = generator; + this.datasources = datasources; + this.tracingConfig = tracingConfig; + this.logEmitter = new import_events.default(); + this.logEmitter.on("error", () => { + }); + this.showColors = showColors != null ? showColors : false; + this.logLevel = logLevel; + this.logQueries = logQueries != null ? logQueries : false; + this.clientVersion = clientVersion2; + this.flags = flags != null ? flags : []; + this.previewFeatures = previewFeatures != null ? previewFeatures : []; + this.activeProvider = activeProvider; + this.connection = new Connection(); + initHooks(); + const removedFlags = [ + "middlewares", + "aggregateApi", + "distinct", + "aggregations", + "insensitiveFilters", + "atomicNumberOperations", + "transactionApi", + "transaction", + "connectOrCreate", + "uncheckedScalarInputs", + "nativeTypes", + "createMany", + "groupBy", + "referentialActions", + "microsoftSqlServer" + ]; + const removedFlagsUsed = this.previewFeatures.filter((e) => removedFlags.includes(e)); + if (removedFlagsUsed.length > 0 && !process.env.PRISMA_HIDE_PREVIEW_FLAG_WARNINGS) { + console.log( + `${import_chalk3.default.blueBright("info")} The preview flags \`${removedFlagsUsed.join( + "`, `" + )}\` were removed, you can now safely remove them from your schema.prisma.` + ); + } + this.previewFeatures = this.previewFeatures.filter((e) => !removedFlags.includes(e)); + this.engineEndpoint = engineEndpoint; + if (engineEndpoint) { + const url = new import_url.URL(engineEndpoint); + this.port = Number(url.port); + } + if (this.platform) { + if (!knownPlatforms.includes(this.platform) && !import_fs4.default.existsSync(this.platform)) { + throw new PrismaClientInitializationError( + `Unknown ${import_chalk3.default.red("PRISMA_QUERY_ENGINE_BINARY")} ${import_chalk3.default.redBright.bold( + this.platform + )}. Possible binaryTargets: ${import_chalk3.default.greenBright( + knownPlatforms.join(", ") + )} or a path to the query engine binary. +You may have to run ${import_chalk3.default.greenBright("prisma generate")} for your changes to take effect.`, + this.clientVersion + ); + } + } else { + void this.getPlatform(); + } + if (this.enableDebugLogs) { + src_default.enable("*"); + } + engines.push(this); + this.checkForTooManyEngines(); + } + setError(err) { + var _a3; + if (isRustError(err)) { + this.lastRustError = err; + this.logEmitter.emit( + "error", + new PrismaClientRustError({ + clientVersion: this.clientVersion, + error: err + }) + ); + if (err.is_panic) { + this.handlePanic(); + } + } else if (isRustErrorLog(err)) { + this.lastErrorLog = err; + this.logEmitter.emit( + "error", + new PrismaClientRustError({ + clientVersion: this.clientVersion, + log: err + }) + ); + if (((_a3 = err.fields) == null ? void 0 : _a3.message) === "PANIC") { + this.handlePanic(); + } + } else { + this.logEmitter.emit("error", err); + } + } + checkForTooManyEngines() { + if (engines.length >= 10) { + const runningEngines = engines.filter((e) => e.child); + if (runningEngines.length === 10) { + console.warn( + `${import_chalk3.default.yellow("warn(prisma-client)")} There are already 10 instances of Prisma Client actively running.` + ); + } + } + } + resolveCwd(cwd) { + if (cwd && import_fs4.default.existsSync(cwd) && import_fs4.default.lstatSync(cwd).isDirectory()) { + return cwd; + } + return process.cwd(); + } + on(event, listener) { + if (event === "beforeExit") { + this.beforeExitListener = listener; + } else { + this.logEmitter.on(event, listener); + } + } + async emitExit() { + if (this.beforeExitListener) { + try { + await this.beforeExitListener(); + } catch (e) { + console.error(e); + } + } + } + async getPlatform() { + if (this.platformPromise) { + return this.platformPromise; + } + this.platformPromise = getPlatform(); + return this.platformPromise; + } + getQueryEnginePath(platform3, prefix = __dirname) { + let queryEnginePath = import_path2.default.join(prefix, `query-engine-${platform3}`); + if (platform3 === "windows") { + queryEnginePath = `${queryEnginePath}.exe`; + } + return queryEnginePath; + } + handlePanic() { + var _a3; + if (this.child) { + this.stopPromise = killProcessAndWait(this.child); + } + if ((_a3 = this.currentRequestPromise) == null ? void 0 : _a3.cancel) { + this.currentRequestPromise.cancel(); + } + } + async resolvePrismaPath() { + var _a3, _b2, _c; + const searchedLocations = []; + let enginePath; + if (this.prismaPath) { + return { prismaPath: this.prismaPath, searchedLocations }; + } + const platform = await this.getPlatform(); + if (this.platform && this.platform !== platform) { + this.incorrectlyPinnedBinaryTarget = this.platform; + } + this.platform = this.platform || platform; + if (__filename.includes("BinaryEngine")) { + enginePath = this.getQueryEnginePath(this.platform, getEnginesPath()); + return { prismaPath: enginePath, searchedLocations }; + } + const searchLocations = [ + eval(`require('path').join(__dirname, '../../../.prisma/client')`), + (_c = (_b2 = (_a3 = this.generator) == null ? void 0 : _a3.output) == null ? void 0 : _b2.value) != null ? _c : eval("__dirname"), + import_path2.default.join(eval("__dirname"), ".."), + import_path2.default.dirname(this.datamodelPath), + this.cwd, + "/tmp/prisma-engines" + ]; + if (this.dirname) { + searchLocations.push(this.dirname); + } + for (const location of searchLocations) { + searchedLocations.push(location); + debug4(`Search for Query Engine in ${location}`); + enginePath = this.getQueryEnginePath(this.platform, location); + if (import_fs4.default.existsSync(enginePath)) { + return { prismaPath: enginePath, searchedLocations }; + } + } + enginePath = this.getQueryEnginePath(this.platform); + return { prismaPath: enginePath != null ? enginePath : "", searchedLocations }; + } + async getPrismaPath() { + const { prismaPath, searchedLocations: searchedLocations2 } = await this.resolvePrismaPath(); + const platform3 = await this.getPlatform(); + if (!await exists2(prismaPath)) { + const pinnedStr = this.incorrectlyPinnedBinaryTarget ? ` +You incorrectly pinned it to ${import_chalk3.default.redBright.bold(`${this.incorrectlyPinnedBinaryTarget}`)} +` : ""; + let errorText = `Query engine binary for current platform "${import_chalk3.default.bold( + platform3 + )}" could not be found.${pinnedStr} +This probably happens, because you built Prisma Client on a different platform. +(Prisma Client looked in "${import_chalk3.default.underline(prismaPath)}") + +Searched Locations: + +${searchedLocations2.map((f) => { + let msg = ` ${f}`; + if (process.env.DEBUG === "node-engine-search-locations" && import_fs4.default.existsSync(f)) { + const dir = import_fs4.default.readdirSync(f); + msg += dir.map((d) => ` ${d}`).join("\n"); + } + return msg; + }).join("\n" + (process.env.DEBUG === "node-engine-search-locations" ? "\n" : ""))} +`; + if (this.generator) { + if (this.generator.binaryTargets.find((object) => object.value === this.platform) || this.generator.binaryTargets.find((object) => object.value === "native")) { + errorText += ` +You already added the platform${this.generator.binaryTargets.length > 1 ? "s" : ""} ${this.generator.binaryTargets.map((t) => `"${import_chalk3.default.bold(t.value)}"`).join(", ")} to the "${import_chalk3.default.underline("generator")}" block +in the "schema.prisma" file as described in https://pris.ly/d/client-generator, +but something went wrong. That's suboptimal. + +Please create an issue at https://github.com/prisma/prisma/issues/new`; + errorText += ``; + } else { + errorText += ` + +To solve this problem, add the platform "${this.platform}" to the "${import_chalk3.default.underline( + "binaryTargets" + )}" attribute in the "${import_chalk3.default.underline("generator")}" block in the "schema.prisma" file: +${import_chalk3.default.greenBright(this.getFixedGenerator())} + +Then run "${import_chalk3.default.greenBright("prisma generate")}" for your changes to take effect. +Read more about deploying Prisma Client: https://pris.ly/d/client-generator`; + } + } else { + errorText += ` + +Read more about deploying Prisma Client: https://pris.ly/d/client-generator +`; + } + throw new PrismaClientInitializationError(errorText, this.clientVersion); + } + if (this.incorrectlyPinnedBinaryTarget) { + console.error(`${import_chalk3.default.yellow("Warning:")} You pinned the platform ${import_chalk3.default.bold( + this.incorrectlyPinnedBinaryTarget + )}, but Prisma Client detects ${import_chalk3.default.bold(await this.getPlatform())}. +This means you should very likely pin the platform ${import_chalk3.default.greenBright(await this.getPlatform())} instead. +${import_chalk3.default.dim("In case we're mistaken, please report this to us \u{1F64F}.")}`); + } + if (process.platform !== "win32") { + plusX(prismaPath); + } + return prismaPath; + } + getFixedGenerator() { + const fixedGenerator = { + ...this.generator, + binaryTargets: fixBinaryTargets(this.generator.binaryTargets, this.platform) + }; + return printGeneratorConfig(fixedGenerator); + } + printDatasources() { + if (this.datasources) { + return JSON.stringify(this.datasources); + } + return "[]"; + } + async start() { + if (this.stopPromise) { + await this.stopPromise; + } + const startFn = /* @__PURE__ */ __name(async () => { + if (!this.startPromise) { + this.startCount++; + this.startPromise = this.internalStart(); + } + await this.startPromise; + if (!this.child && !this.engineEndpoint) { + throw new PrismaClientUnknownRequestError( + `Can't perform request, as the Engine has already been stopped`, + this.clientVersion + ); + } + }, "startFn"); + const spanOptions = { + name: "connect", + enabled: this.tracingConfig.enabled && !this.startPromise + }; + return runInChildSpan(spanOptions, startFn); + } + getEngineEnvVars() { + var _a3, _b2; + const env2 = { + PRISMA_DML_PATH: this.datamodelPath + }; + if (this.logQueries || this.logLevel === "info") { + if (this.logQueries) { + env2.LOG_QUERIES = "true"; + } + } + if (this.datasources) { + env2.OVERWRITE_DATASOURCES = this.printDatasources(); + } + if (!process.env.NO_COLOR && this.showColors) { + env2.CLICOLOR_FORCE = "1"; + } + return { + ...this.env, + ...process.env, + ...env2, + RUST_BACKTRACE: (_a3 = process.env.RUST_BACKTRACE) != null ? _a3 : "1", + RUST_LOG: (_b2 = process.env.RUST_LOG) != null ? _b2 : "info" + }; + } + internalStart() { + return new Promise(async (resolve, reject) => { + var _a3, _b2, _c; + await new Promise((r) => process.nextTick(r)); + if (this.stopPromise) { + await this.stopPromise; + } + if (this.engineEndpoint) { + try { + this.connection.open(this.engineEndpoint); + await (0, import_p_retry.default)(() => this.connection.get("/status"), { + retries: 10 + }); + } catch (e) { + return reject(e); + } + return resolve(); + } + try { + if (((_a3 = this.child) == null ? void 0 : _a3.connected) || this.child && !((_b2 = this.child) == null ? void 0 : _b2.killed)) { + debug4(`There is a child that still runs and we want to start again`); + } + this.lastRustError = void 0; + this.lastErrorLog = void 0; + this.lastPanic = void 0; + logger("startin & resettin"); + this.globalKillSignalReceived = void 0; + debug4({ cwd: this.cwd }); + const prismaPath = await this.getPrismaPath(); + const additionalFlag = this.allowTriggerPanic ? ["--debug"] : []; + const flags = [ + "--enable-raw-queries", + "--enable-metrics", + "--enable-open-telemetry", + ...this.flags, + ...additionalFlag + ]; + this.port = await this.getFreePort(); + flags.push("--port", String(this.port)); + debug4({ flags }); + const env2 = this.getEngineEnvVars(); + this.child = (0, import_child_process2.spawn)(prismaPath, flags, { + env: env2, + cwd: this.cwd, + windowsHide: true, + stdio: ["ignore", "pipe", "pipe"] + }); + byline(this.child.stderr).on("data", (msg) => { + const data = String(msg); + debug4("stderr", data); + try { + const json = JSON.parse(data); + if (typeof json.is_panic !== "undefined") { + debug4(json); + this.setError(json); + if (this.engineStartDeferred) { + const err = new PrismaClientInitializationError(json.message, this.clientVersion, json.error_code); + this.engineStartDeferred.reject(err); + } + } + } catch (e) { + if (!data.includes("Printing to stderr") && !data.includes("Listening on ")) { + this.stderrLogs += "\n" + data; + } + } + }); + byline(this.child.stdout).on("data", (msg) => { + var _a4, _b3; + const data = String(msg); + try { + const json = JSON.parse(data); + debug4("stdout", getMessage(json)); + if (this.engineStartDeferred && json.level === "INFO" && json.target === "query_engine::server" && ((_b3 = (_a4 = json.fields) == null ? void 0 : _a4.message) == null ? void 0 : _b3.startsWith("Started query engine http server"))) { + this.connection.open(`http://127.0.0.1:${this.port}`); + this.engineStartDeferred.resolve(); + this.engineStartDeferred = void 0; + } + if (typeof json.is_panic === "undefined") { + if (json.span === true) { + if (this.tracingConfig.enabled === true) { + void createSpan(json); + } + return; + } + const log4 = convertLog(json); + const logIsRustErrorLog = isRustErrorLog(log4); + if (logIsRustErrorLog) { + this.setError(log4); + } else { + this.logEmitter.emit(log4.level, log4); + } + } else { + this.setError(json); + } + } catch (e) { + debug4(e, data); + } + }); + this.child.on("exit", (code) => { + var _a4; + logger("removing startPromise"); + this.startPromise = void 0; + if (this.engineStopDeferred) { + this.engineStopDeferred.resolve(code); + return; + } + this.connection.close(); + if (code !== 0 && this.engineStartDeferred && this.startCount === 1) { + let err; + let msg = this.stderrLogs; + if (this.lastRustError) { + msg = getMessage(this.lastRustError); + } else if (this.lastErrorLog) { + msg = getMessage(this.lastErrorLog); + } + if (code !== null) { + err = new PrismaClientInitializationError( + `Query engine exited with code ${code} +` + msg, + this.clientVersion + ); + } else if ((_a4 = this.child) == null ? void 0 : _a4.signalCode) { + err = new PrismaClientInitializationError( + `Query engine process killed with signal ${this.child.signalCode} for unknown reason. +Make sure that the engine binary at ${prismaPath} is not corrupt. +` + msg, + this.clientVersion + ); + } else { + err = new PrismaClientInitializationError(msg, this.clientVersion); + } + this.engineStartDeferred.reject(err); + } + if (!this.child) { + return; + } + if (this.lastRustError) { + return; + } + if (code === 126) { + this.setError({ + timestamp: new Date(), + target: "exit", + level: "error", + fields: { + message: `Couldn't start query engine as it's not executable on this operating system. +You very likely have the wrong "binaryTarget" defined in the schema.prisma file.` + } + }); + } + }); + this.child.on("error", (err) => { + this.setError({ + message: err.message, + backtrace: "Could not start query engine", + is_panic: false + }); + reject(err); + }); + this.child.on("close", (code, signal) => { + var _a4; + this.connection.close(); + if (code === null && signal === "SIGABRT" && this.child) { + const error2 = new PrismaClientRustPanicError( + this.getErrorMessageWithLink("Panic in Query Engine with SIGABRT signal"), + this.clientVersion + ); + this.logEmitter.emit("error", error2); + } else if (code === 255 && signal === null && ((_a4 = this.lastErrorLog) == null ? void 0 : _a4.fields.message) === "PANIC" && !this.lastPanic) { + const error2 = new PrismaClientRustPanicError( + this.getErrorMessageWithLink( + `${this.lastErrorLog.fields.message}: ${this.lastErrorLog.fields.reason} in ${this.lastErrorLog.fields.file}:${this.lastErrorLog.fields.line}:${this.lastErrorLog.fields.column}` + ), + this.clientVersion + ); + this.setError(error2); + } + }); + if (this.lastRustError) { + return reject(new PrismaClientInitializationError(getMessage(this.lastRustError), this.clientVersion)); + } + if (this.lastErrorLog) { + return reject(new PrismaClientInitializationError(getMessage(this.lastErrorLog), this.clientVersion)); + } + try { + await new Promise((resolve2, reject2) => { + this.engineStartDeferred = { resolve: resolve2, reject: reject2 }; + }); + } catch (err) { + (_c = this.child) == null ? void 0 : _c.kill(); + throw err; + } + void (async () => { + try { + const engineVersion = await this.version(true); + debug4(`Client Version: ${this.clientVersion}`); + debug4(`Engine Version: ${engineVersion}`); + debug4(`Active provider: ${this.activeProvider}`); + } catch (e) { + debug4(e); + } + })(); + this.stopPromise = void 0; + resolve(); + } catch (e) { + reject(e); + } + }); + } + async stop() { + const stopFn = /* @__PURE__ */ __name(async () => { + if (!this.stopPromise) { + this.stopPromise = this._stop(); + } + return this.stopPromise; + }, "stopFn"); + const spanOptions = { + name: "disconnect", + enabled: this.tracingConfig.enabled + }; + return runInChildSpan(spanOptions, stopFn); + } + async _stop() { + var _a3; + if (this.startPromise) { + await this.startPromise; + } + await new Promise((resolve) => process.nextTick(resolve)); + if (this.currentRequestPromise) { + try { + await this.currentRequestPromise; + } catch (e) { + } + } + this.getConfigPromise = void 0; + let stopChildPromise; + if (this.child) { + debug4(`Stopping Prisma engine4`); + if (this.startPromise) { + debug4(`Waiting for start promise`); + await this.startPromise; + } + debug4(`Done waiting for start promise`); + stopChildPromise = new Promise((resolve, reject) => { + this.engineStopDeferred = { resolve, reject }; + }); + this.connection.close(); + (_a3 = this.child) == null ? void 0 : _a3.kill(); + this.child = void 0; + } + if (stopChildPromise) { + await stopChildPromise; + } + await new Promise((r) => process.nextTick(r)); + this.startPromise = void 0; + this.engineStopDeferred = void 0; + } + kill(signal) { + var _a3; + this.getConfigPromise = void 0; + this.globalKillSignalReceived = signal; + (_a3 = this.child) == null ? void 0 : _a3.kill(); + this.connection.close(); + } + getFreePort() { + return new Promise((resolve, reject) => { + const server = import_net.default.createServer((s) => s.end("")); + server.unref(); + server.on("error", reject); + server.listen(0, () => { + const address = server.address(); + const port = typeof address === "string" ? parseInt(address.split(":").slice(-1)[0], 10) : address.port; + server.close((e) => { + if (e) { + reject(e); + } + resolve(port); + }); + }); + }); + } + async getConfig() { + if (!this.getConfigPromise) { + this.getConfigPromise = this._getConfig(); + } + return this.getConfigPromise; + } + async _getConfig() { + const prismaPath = await this.getPrismaPath(); + const env2 = await this.getEngineEnvVars(); + const result = await (0, import_execa.default)(prismaPath, ["cli", "get-config"], { + env: omit(env2, ["PORT"]), + cwd: this.cwd + }); + return JSON.parse(result.stdout); + } + async getDmmf() { + if (!this.getDmmfPromise) { + this.getDmmfPromise = this._getDmmf(); + } + return this.getDmmfPromise; + } + async _getDmmf() { + const prismaPath = await this.getPrismaPath(); + const env2 = await this.getEngineEnvVars(); + const result = await (0, import_execa.default)(prismaPath, ["--enable-raw-queries", "cli", "dmmf"], { + env: omit(env2, ["PORT"]), + cwd: this.cwd + }); + return JSON.parse(result.stdout); + } + async version(forceRun = false) { + if (this.versionPromise && !forceRun) { + return this.versionPromise; + } + this.versionPromise = this.internalVersion(); + return this.versionPromise; + } + async internalVersion() { + const prismaPath = await this.getPrismaPath(); + const result = await (0, import_execa.default)(prismaPath, ["--version"]); + this.lastVersion = result.stdout; + return this.lastVersion; + } + async request(query2, headers = {}, numTry = 1) { + await this.start(); + this.currentRequestPromise = this.connection.post("/", stringifyQuery(query2), runtimeHeadersToHttpHeaders(headers)); + this.lastQuery = query2; + try { + const { data, headers: headers2 } = await this.currentRequestPromise; + if (data.errors) { + if (data.errors.length === 1) { + throw prismaGraphQLToJSError(data.errors[0], this.clientVersion); + } + throw new PrismaClientUnknownRequestError(JSON.stringify(data.errors), this.clientVersion); + } + const elapsed = parseInt(headers2["x-elapsed"]) / 1e3; + if (this.startCount > 0) { + this.startCount = 0; + } + this.currentRequestPromise = void 0; + return { data, elapsed }; + } catch (e) { + logger("req - e", e); + if (e instanceof PrismaClientKnownRequestError) { + throw e; + } + await this.handleRequestError(e, numTry <= MAX_REQUEST_RETRIES); + if (numTry <= MAX_REQUEST_RETRIES) { + logger("trying a retry now"); + return this.request(query2, headers, numTry + 1); + } + } + return null; + } + async requestBatch(queries, headers = {}, transaction = false, numTry = 1) { + await this.start(); + const request2 = { + batch: queries.map((query2) => ({ query: query2, variables: {} })), + transaction + }; + this.lastQuery = JSON.stringify(request2); + this.currentRequestPromise = this.connection.post("/", this.lastQuery, runtimeHeadersToHttpHeaders(headers)); + return this.currentRequestPromise.then(({ data, headers: headers2 }) => { + const elapsed = parseInt(headers2["x-elapsed"]) / 1e3; + const { batchResult, errors } = data; + if (Array.isArray(batchResult)) { + return batchResult.map((result) => { + if (result.errors) { + throw prismaGraphQLToJSError(data.errors[0], this.clientVersion); + } + return { + data: result, + elapsed + }; + }); + } else { + throw prismaGraphQLToJSError(data.errors[0], this.clientVersion); + } + }).catch(async (e) => { + const isError2 = await this.handleRequestError(e, numTry < 3); + if (!isError2) { + if (numTry <= MAX_REQUEST_RETRIES) { + return this.requestBatch(queries, headers, transaction, numTry + 1); + } + } + throw isError2; + }); + } + async transaction(action, headers, arg2) { + var _a3, _b2; + await this.start(); + if (action === "start") { + const jsonOptions = JSON.stringify({ + max_wait: (_a3 = arg2 == null ? void 0 : arg2.maxWait) != null ? _a3 : 2e3, + timeout: (_b2 = arg2 == null ? void 0 : arg2.timeout) != null ? _b2 : 5e3, + isolation_level: arg2 == null ? void 0 : arg2.isolationLevel + }); + const result = await Connection.onHttpError( + this.connection.post("/transaction/start", jsonOptions, runtimeHeadersToHttpHeaders(headers)), + transactionHttpErrorHandler + ); + return result.data; + } else if (action === "commit") { + await Connection.onHttpError(this.connection.post(`/transaction/${arg2.id}/commit`), transactionHttpErrorHandler); + } else if (action === "rollback") { + await Connection.onHttpError(this.connection.post(`/transaction/${arg2.id}/rollback`), transactionHttpErrorHandler); + } + return void 0; + } + get hasMaxRestarts() { + return this.startCount >= MAX_STARTS; + } + throwAsyncErrorIfExists(forceThrow = false) { + var _a3, _b2; + logger("throwAsyncErrorIfExists", this.startCount, this.hasMaxRestarts); + if (this.lastRustError) { + const err = new PrismaClientRustPanicError( + this.getErrorMessageWithLink(getMessage(this.lastRustError)), + this.clientVersion + ); + if (this.lastRustError.is_panic) { + this.lastPanic = err; + } + if (this.hasMaxRestarts || forceThrow) { + throw err; + } + } + if (this.lastErrorLog && isRustErrorLog(this.lastErrorLog)) { + const err = new PrismaClientUnknownRequestError( + this.getErrorMessageWithLink(getMessage(this.lastErrorLog)), + this.clientVersion + ); + if (((_b2 = (_a3 = this.lastErrorLog) == null ? void 0 : _a3.fields) == null ? void 0 : _b2.message) === "PANIC") { + this.lastPanic = err; + } + if (this.hasMaxRestarts || forceThrow) { + throw err; + } + } + } + getErrorMessageWithLink(title) { + return getErrorMessageWithLink({ + platform: this.platform, + title, + version: this.clientVersion, + engineVersion: this.lastVersion, + database: this.lastActiveProvider, + query: this.lastQuery + }); + } + async metrics({ format: format2, globalLabels }) { + await this.start(); + const parseResponse = format2 === "json"; + const response = await this.connection.post( + `/metrics?format=${encodeURIComponent(format2)}`, + JSON.stringify(globalLabels), + null, + parseResponse + ); + return response.data; + } +}; +__name(BinaryEngine, "BinaryEngine"); +function stringifyQuery(q) { + return `{"variables":{},"query":${JSON.stringify(q)}}`; +} +__name(stringifyQuery, "stringifyQuery"); +function hookProcess(handler, exit = false) { + process.once(handler, async () => { + for (const engine of engines) { + await engine.emitExit(); + engine.kill(handler); + } + engines.splice(0, engines.length); + if (socketPaths.length > 0) { + for (const socketPath of socketPaths) { + try { + import_fs4.default.unlinkSync(socketPath); + } catch (e) { + } + } + } + if (exit && process.listenerCount(handler) === 0) { + process.exit(); + } + }); +} +__name(hookProcess, "hookProcess"); +var hooksInitialized = false; +function initHooks() { + if (!hooksInitialized) { + hookProcess("beforeExit"); + hookProcess("exit"); + hookProcess("SIGINT", true); + hookProcess("SIGUSR2", true); + hookProcess("SIGTERM", true); + hooksInitialized = true; + } +} +__name(initHooks, "initHooks"); +function transactionHttpErrorHandler(result) { + throw result.data; +} +__name(transactionHttpErrorHandler, "transactionHttpErrorHandler"); +function runtimeHeadersToHttpHeaders(headers) { + return Object.keys(headers).reduce((acc, runtimeHeaderKey) => { + let httpHeaderKey = runtimeHeaderKey; + if (runtimeHeaderKey === "transactionId") { + httpHeaderKey = "X-transaction-id"; + } + acc[httpHeaderKey] = headers[runtimeHeaderKey]; + return acc; + }, {}); +} +__name(runtimeHeadersToHttpHeaders, "runtimeHeadersToHttpHeaders"); +function killProcessAndWait(childProcess) { + return new Promise((resolve) => { + childProcess.once("exit", resolve); + childProcess.kill(); + }); +} +__name(killProcessAndWait, "killProcessAndWait"); + +// ../engine-core/src/data-proxy/DataProxyEngine.ts +var import_events2 = __toESM(require("events")); + +// ../engine-core/src/common/errors/PrismaClientError.ts +var PrismaClientError = class extends Error { + constructor(message, info2) { + super(message); + this.clientVersion = info2.clientVersion; + this.cause = info2.cause; + } + get [Symbol.toStringTag]() { + return this.name; + } +}; +__name(PrismaClientError, "PrismaClientError"); + +// ../engine-core/src/data-proxy/errors/DataProxyError.ts +var DataProxyError = class extends PrismaClientError { + constructor(message, info2) { + var _a3; + super(message, info2); + this.isRetryable = (_a3 = info2.isRetryable) != null ? _a3 : true; + } +}; +__name(DataProxyError, "DataProxyError"); + +// ../engine-core/src/data-proxy/errors/utils/setRetryable.ts +function setRetryable(info2, retryable) { + return { + ...info2, + isRetryable: retryable + }; +} +__name(setRetryable, "setRetryable"); + +// ../engine-core/src/data-proxy/errors/ForcedRetryError.ts +var ForcedRetryError = class extends DataProxyError { + constructor(info2) { + super("This request must be retried", setRetryable(info2, true)); + this.name = "ForcedRetryError"; + this.code = "P5001"; + } +}; +__name(ForcedRetryError, "ForcedRetryError"); + +// ../engine-core/src/data-proxy/errors/InvalidDatasourceError.ts +var InvalidDatasourceError = class extends DataProxyError { + constructor(message, info2) { + super(message, setRetryable(info2, false)); + this.name = "InvalidDatasourceError"; + this.code = "P5002"; + } +}; +__name(InvalidDatasourceError, "InvalidDatasourceError"); + +// ../engine-core/src/data-proxy/errors/NotImplementedYetError.ts +var NotImplementedYetError = class extends DataProxyError { + constructor(message, info2) { + super(message, setRetryable(info2, false)); + this.name = "NotImplementedYetError"; + this.code = "P5004"; + } +}; +__name(NotImplementedYetError, "NotImplementedYetError"); + +// ../engine-core/src/data-proxy/errors/DataProxyAPIError.ts +var DataProxyAPIError = class extends DataProxyError { + constructor(message, info2) { + var _a3; + super(message, info2); + this.response = info2.response; + const requestId = (_a3 = this.response.headers) == null ? void 0 : _a3["Prisma-Request-Id"]; + if (requestId) { + const messageSuffix = `(The request id was: ${requestId})`; + this.message = this.message + " " + messageSuffix; + } + } +}; +__name(DataProxyAPIError, "DataProxyAPIError"); + +// ../engine-core/src/data-proxy/errors/SchemaMissingError.ts +var SchemaMissingError = class extends DataProxyAPIError { + constructor(info2) { + super("Schema needs to be uploaded", setRetryable(info2, true)); + this.name = "SchemaMissingError"; + this.code = "P5005"; + } +}; +__name(SchemaMissingError, "SchemaMissingError"); + +// ../engine-core/src/data-proxy/errors/BadRequestError.ts +var BAD_REQUEST_DEFAULT_MESSAGE = "This request could not be understood by the server"; +var BadRequestError = class extends DataProxyAPIError { + constructor(info2, message, code) { + super(message || BAD_REQUEST_DEFAULT_MESSAGE, setRetryable(info2, false)); + this.name = "BadRequestError"; + this.code = "P5000"; + if (code) + this.code = code; + } +}; +__name(BadRequestError, "BadRequestError"); + +// ../engine-core/src/data-proxy/errors/GatewayTimeoutError.ts +var GatewayTimeoutError = class extends DataProxyAPIError { + constructor(info2) { + super("Request timed out", setRetryable(info2, false)); + this.name = "GatewayTimeoutError"; + this.code = "P5009"; + } +}; +__name(GatewayTimeoutError, "GatewayTimeoutError"); + +// ../engine-core/src/data-proxy/errors/NotFoundError.ts +var NotFoundError = class extends DataProxyAPIError { + constructor(info2) { + super("Requested resource does not exist", setRetryable(info2, false)); + this.name = "NotFoundError"; + this.code = "P5003"; + } +}; +__name(NotFoundError, "NotFoundError"); + +// ../engine-core/src/data-proxy/errors/ServerError.ts +var SERVER_ERROR_DEFAULT_MESSAGE = "Unknown server error"; +var ServerError = class extends DataProxyAPIError { + constructor(info2, message, logs) { + super(message || SERVER_ERROR_DEFAULT_MESSAGE, setRetryable(info2, true)); + this.name = "ServerError"; + this.code = "P5006"; + this.logs = logs; + } +}; +__name(ServerError, "ServerError"); + +// ../engine-core/src/data-proxy/errors/UnauthorizedError.ts +var UnauthorizedError = class extends DataProxyAPIError { + constructor(info2) { + super("Unauthorized, check your connection string", setRetryable(info2, false)); + this.name = "UnauthorizedError"; + this.code = "P5007"; + } +}; +__name(UnauthorizedError, "UnauthorizedError"); + +// ../engine-core/src/data-proxy/errors/UsageExceededError.ts +var UsageExceededError = class extends DataProxyAPIError { + constructor(info2) { + super("Usage exceeded, retry again later", setRetryable(info2, true)); + this.name = "UsageExceededError"; + this.code = "P5008"; + } +}; +__name(UsageExceededError, "UsageExceededError"); + +// ../engine-core/src/data-proxy/errors/utils/responseToError.ts +async function responseToError(response, clientVersion2) { + var _a3, _b2, _c, _d, _e; + if (response.ok) + return void 0; + const info2 = { clientVersion: clientVersion2, response }; + if (response.status === 400) { + let knownError; + try { + const body = await response.json(); + knownError = (_b2 = (_a3 = body == null ? void 0 : body.EngineNotStarted) == null ? void 0 : _a3.reason) == null ? void 0 : _b2.KnownEngineStartupError; + } catch (_) { + } + if (knownError) { + throw new BadRequestError(info2, knownError.msg, knownError.error_code); + } + } + if (response.status === 401) { + throw new UnauthorizedError(info2); + } + if (response.status === 404) { + try { + const body = await response.json(); + const isSchemaMissing = ((_c = body == null ? void 0 : body.EngineNotStarted) == null ? void 0 : _c.reason) === "SchemaMissing"; + return isSchemaMissing ? new SchemaMissingError(info2) : new NotFoundError(info2); + } catch (err) { + return new NotFoundError(info2); + } + } + if (response.status === 429) { + throw new UsageExceededError(info2); + } + if (response.status === 504) { + throw new GatewayTimeoutError(info2); + } + if (response.status >= 500) { + let body; + try { + body = await response.json(); + } catch (err) { + throw new ServerError(info2); + } + if (typeof ((_d = body == null ? void 0 : body.EngineNotStarted) == null ? void 0 : _d.reason) === "string") { + throw new ServerError(info2, body.EngineNotStarted.reason); + } else if (typeof ((_e = body == null ? void 0 : body.EngineNotStarted) == null ? void 0 : _e.reason) === "object") { + const keys2 = Object.keys(body.EngineNotStarted.reason); + if (keys2.length > 0) { + const reason = body.EngineNotStarted.reason; + const content = reason[keys2[0]]; + throw new ServerError(info2, keys2[0], content.logs); + } + } + throw new ServerError(info2); + } + if (response.status >= 400) { + throw new BadRequestError(info2); + } + return void 0; +} +__name(responseToError, "responseToError"); + +// ../engine-core/src/data-proxy/utils/backOff.ts +var BACKOFF_INTERVAL = 50; +function backOff(n) { + const baseDelay = Math.pow(2, n) * BACKOFF_INTERVAL; + const jitter = Math.ceil(Math.random() * baseDelay) - Math.ceil(baseDelay / 2); + const total = baseDelay + jitter; + return new Promise((done) => setTimeout(() => done(total), total)); +} +__name(backOff, "backOff"); + +// ../engines/package.json +var devDependencies = { + "@prisma/debug": "workspace:4.3.1", + "@prisma/engines-version": "4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b", + "@prisma/fetch-engine": "workspace:4.3.1", + "@prisma/get-platform": "workspace:4.3.1", + "@swc/core": "1.2.242", + "@swc/jest": "0.2.22", + "@types/jest": "28.1.7", + "@types/node": "16.11.56", + execa: "5.1.1", + jest: "28.1.3", + typescript: "4.8.2" +}; + +// ../engine-core/src/data-proxy/errors/NetworkError.ts +var RequestError = class extends DataProxyError { + constructor(message, info2) { + super(`Cannot fetch data from service: +${message}`, setRetryable(info2, true)); + this.name = "RequestError"; + this.code = "P5010"; + } +}; +__name(RequestError, "RequestError"); + +// ../engine-core/src/data-proxy/utils/getJSRuntimeName.ts +function getJSRuntimeName() { + if (typeof self === "undefined") { + return "node"; + } + return "browser"; +} +__name(getJSRuntimeName, "getJSRuntimeName"); + +// ../engine-core/src/data-proxy/utils/request.ts +async function request(url, options) { + var _a3; + const clientVersion2 = options.clientVersion; + const jsRuntimeName = getJSRuntimeName(); + try { + if (jsRuntimeName === "browser") { + return await fetch(url, options); + } else { + return await nodeFetch(url, options); + } + } catch (e) { + const message = (_a3 = e.message) != null ? _a3 : "Unknown error"; + throw new RequestError(message, { clientVersion: clientVersion2 }); + } +} +__name(request, "request"); +function buildHeaders(options) { + return { + ...options.headers, + "Content-Type": "application/json" + }; +} +__name(buildHeaders, "buildHeaders"); +function buildOptions(options) { + return { + method: options.method, + headers: buildHeaders(options) + }; +} +__name(buildOptions, "buildOptions"); +function buildResponse(incomingData, response) { + return { + text: () => Buffer.concat(incomingData).toString(), + json: () => JSON.parse(Buffer.concat(incomingData).toString()), + ok: response.statusCode >= 200 && response.statusCode <= 299, + status: response.statusCode, + url: response.url, + headers: response.headers + }; +} +__name(buildResponse, "buildResponse"); +async function nodeFetch(url, options = {}) { + const https = include("https"); + const httpsOptions = buildOptions(options); + const incomingData = []; + const { origin } = new URL(url); + return new Promise((resolve, reject) => { + var _a3; + const request2 = https.request(url, httpsOptions, (response) => { + const { statusCode, headers: { location } } = response; + if (statusCode >= 301 && statusCode <= 399 && location) { + if (location.startsWith("http") === false) { + resolve(nodeFetch(`${origin}${location}`, options)); + } else { + resolve(nodeFetch(location, options)); + } + } + response.on("data", (chunk) => incomingData.push(chunk)); + response.on("end", () => resolve(buildResponse(incomingData, response))); + response.on("error", reject); + }); + request2.on("error", reject); + request2.end((_a3 = options.body) != null ? _a3 : ""); + }); +} +__name(nodeFetch, "nodeFetch"); +var include = typeof require !== "undefined" ? require : () => { +}; + +// ../engine-core/src/data-proxy/utils/getClientVersion.ts +var semverRegex = /^[1-9][0-9]*\.[0-9]+\.[0-9]+$/; +var debug5 = src_default("prisma:client:dataproxyEngine"); +async function _getClientVersion(config2) { + var _a3, _b2, _c; + const engineVersion = devDependencies["@prisma/engines-version"]; + const clientVersion2 = (_a3 = config2.clientVersion) != null ? _a3 : "unknown"; + if (process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION) { + return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION; + } + const [version, suffix] = (_b2 = clientVersion2 == null ? void 0 : clientVersion2.split("-")) != null ? _b2 : []; + if (suffix === void 0 && semverRegex.test(version)) { + return version; + } + if (suffix !== void 0 || clientVersion2 === "0.0.0") { + const [version2] = (_c = engineVersion.split("-")) != null ? _c : []; + const [major2, minor, patch] = version2.split("."); + const pkgURL = prismaPkgURL(`<=${major2}.${minor}.${patch}`); + const res = await request(pkgURL, { clientVersion: clientVersion2 }); + const bodyAsText = await res.text(); + debug5("length of body fetched from unpkg.com", bodyAsText.length); + let bodyAsJson; + try { + bodyAsJson = JSON.parse(bodyAsText); + } catch (e) { + console.error("JSON.parse error: body fetched from unpkg.com: ", bodyAsText); + throw e; + } + return bodyAsJson["version"]; + } + throw new NotImplementedYetError("Only `major.minor.patch` versions are supported by Prisma Data Proxy.", { + clientVersion: clientVersion2 + }); +} +__name(_getClientVersion, "_getClientVersion"); +async function getClientVersion(config2) { + const version = await _getClientVersion(config2); + debug5("version", version); + return version; +} +__name(getClientVersion, "getClientVersion"); +function prismaPkgURL(version) { + return encodeURI(`https://unpkg.com/prisma@${version}/package.json`); +} +__name(prismaPkgURL, "prismaPkgURL"); + +// ../engine-core/src/data-proxy/DataProxyEngine.ts +var MAX_RETRIES = 10; +var P2 = Promise.resolve(); +var debug6 = src_default("prisma:client:dataproxyEngine"); +var DataProxyEngine = class extends Engine { + constructor(config2) { + var _a3, _b2, _c, _d; + super(); + this.config = config2; + this.env = { ...this.config.env, ...process.env }; + this.inlineSchema = (_a3 = config2.inlineSchema) != null ? _a3 : ""; + this.inlineDatasources = (_b2 = config2.inlineDatasources) != null ? _b2 : {}; + this.inlineSchemaHash = (_c = config2.inlineSchemaHash) != null ? _c : ""; + this.clientVersion = (_d = config2.clientVersion) != null ? _d : "unknown"; + this.logEmitter = new import_events2.default(); + this.logEmitter.on("error", () => { + }); + const [host, apiKey] = this.extractHostAndApiKey(); + this.remoteClientVersion = P2.then(() => getClientVersion(this.config)); + this.headers = { Authorization: `Bearer ${apiKey}` }; + this.host = host; + debug6("host", this.host); + } + version() { + return "unknown"; + } + async start() { + } + async stop() { + } + on(event, listener) { + if (event === "beforeExit") { + throw new NotImplementedYetError("beforeExit event is not yet supported", { + clientVersion: this.clientVersion + }); + } else { + this.logEmitter.on(event, listener); + } + } + async url(s) { + return `https://${this.host}/${await this.remoteClientVersion}/${this.inlineSchemaHash}/${s}`; + } + async getConfig() { + return Promise.resolve({ + datasources: [ + { + activeProvider: this.config.activeProvider + } + ] + }); + } + getDmmf() { + throw new NotImplementedYetError("getDmmf is not yet supported", { + clientVersion: this.clientVersion + }); + } + async uploadSchema() { + const response = await request(await this.url("schema"), { + method: "PUT", + headers: this.headers, + body: this.inlineSchema, + clientVersion: this.clientVersion + }); + if (!response.ok) { + debug6("schema response status", response.status); + } + const err = await responseToError(response, this.clientVersion); + if (err) { + this.logEmitter.emit("warn", { message: `Error while uploading schema: ${err.message}` }); + throw err; + } else { + this.logEmitter.emit("info", { + message: `Schema (re)uploaded (hash: ${this.inlineSchemaHash})` + }); + } + } + request(query2, headers, attempt = 0) { + this.logEmitter.emit("query", { query: query2 }); + return this.requestInternal({ query: query2, variables: {} }, headers, attempt); + } + async requestBatch(queries, headers, isTransaction = false, attempt = 0) { + this.logEmitter.emit("query", { + query: `Batch${isTransaction ? " in transaction" : ""} (${queries.length}): +${queries.join("\n")}` + }); + const body = { + batch: queries.map((query2) => ({ query: query2, variables: {} })), + transaction: isTransaction + }; + const { batchResult } = await this.requestInternal(body, headers, attempt); + return batchResult; + } + async requestInternal(body, headers, attempt) { + var _a3; + try { + this.logEmitter.emit("info", { + message: `Calling ${await this.url("graphql")} (n=${attempt})` + }); + const response = await request(await this.url("graphql"), { + method: "POST", + headers: { ...headers, ...this.headers }, + body: JSON.stringify(body), + clientVersion: this.clientVersion + }); + if (!response.ok) { + debug6("graphql response status", response.status); + } + const e = await responseToError(response, this.clientVersion); + if (e instanceof SchemaMissingError) { + await this.uploadSchema(); + throw new ForcedRetryError({ + clientVersion: this.clientVersion, + cause: e + }); + } + if (e) + throw e; + const data = await response.json(); + if (data.errors) { + if (data.errors.length === 1) { + throw prismaGraphQLToJSError(data.errors[0], this.config.clientVersion); + } + } + return data; + } catch (e) { + this.logEmitter.emit("error", { + message: `Error while querying: ${(_a3 = e.message) != null ? _a3 : "(unknown)"}` + }); + if (!(e instanceof DataProxyError)) + throw e; + if (!e.isRetryable) + throw e; + if (attempt >= MAX_RETRIES) { + if (e instanceof ForcedRetryError) { + throw e.cause; + } else { + throw e; + } + } + this.logEmitter.emit("warn", { message: "This request can be retried" }); + const delay = await backOff(attempt); + this.logEmitter.emit("warn", { message: `Retrying after ${delay}ms` }); + return this.requestInternal(body, headers, attempt + 1); + } + } + transaction() { + throw new NotImplementedYetError("Interactive transactions are not yet supported", { + clientVersion: this.clientVersion + }); + } + extractHostAndApiKey() { + const datasources = this.mergeOverriddenDatasources(); + const mainDatasourceName = Object.keys(datasources)[0]; + const mainDatasource = datasources[mainDatasourceName]; + const dataProxyURL = this.resolveDatasourceURL(mainDatasourceName, mainDatasource); + let url; + try { + url = new URL(dataProxyURL); + } catch (e) { + throw new InvalidDatasourceError("Could not parse URL of the datasource", { + clientVersion: this.clientVersion + }); + } + const { protocol, host, searchParams } = url; + if (protocol !== "prisma:") { + throw new InvalidDatasourceError("Datasource URL must use prisma:// protocol when --data-proxy is used", { + clientVersion: this.clientVersion + }); + } + const apiKey = searchParams.get("api_key"); + if (apiKey === null || apiKey.length < 1) { + throw new InvalidDatasourceError("No valid API key found in the datasource URL", { + clientVersion: this.clientVersion + }); + } + return [host, apiKey]; + } + mergeOverriddenDatasources() { + if (this.config.datasources === void 0) { + return this.inlineDatasources; + } + const finalDatasources = { ...this.inlineDatasources }; + for (const override of this.config.datasources) { + if (!this.inlineDatasources[override.name]) { + throw new Error(`Unknown datasource: ${override.name}`); + } + finalDatasources[override.name] = { + url: { + fromEnvVar: null, + value: override.url + } + }; + } + return finalDatasources; + } + resolveDatasourceURL(name, datasource) { + if (datasource.url.value) { + return datasource.url.value; + } + if (datasource.url.fromEnvVar) { + const envVar = datasource.url.fromEnvVar; + const loadedEnvURL = this.env[envVar]; + if (loadedEnvURL === void 0) { + throw new InvalidDatasourceError( + `Datasource "${name}" references an environment variable "${envVar}" that is not set`, + { + clientVersion: this.clientVersion + } + ); + } + return loadedEnvURL; + } + throw new InvalidDatasourceError( + `Datasource "${name}" specification is invalid: both value and fromEnvVar are null`, + { + clientVersion: this.clientVersion + } + ); + } + metrics(options) { + throw new NotImplementedYetError("Metric are not yet supported for Data Proxy", { + clientVersion: this.clientVersion + }); + } +}; +__name(DataProxyEngine, "DataProxyEngine"); + +// ../engine-core/src/library/LibraryEngine.ts +var import_chalk5 = __toESM(require_source()); +var import_events3 = __toESM(require("events")); +var import_fs6 = __toESM(require("fs")); + +// ../engine-core/src/library/DefaultLibraryLoader.ts +var import_chalk4 = __toESM(require_source()); +var import_fs5 = __toESM(require("fs")); +var import_path3 = __toESM(require("path")); +var debug7 = src_default("prisma:client:libraryEngine:loader"); +var DefaultLibraryLoader = class { + constructor(config2) { + this.libQueryEnginePath = null; + this.platform = null; + this.config = config2; + } + async loadLibrary() { + if (!this.libQueryEnginePath) { + this.libQueryEnginePath = await this.getLibQueryEnginePath(); + } + debug7(`loadEngine using ${this.libQueryEnginePath}`); + try { + return eval("require")(this.libQueryEnginePath); + } catch (e) { + if (import_fs5.default.existsSync(this.libQueryEnginePath)) { + if (this.libQueryEnginePath.endsWith(".node")) { + throw new PrismaClientInitializationError( + `Unable to load Node-API Library from ${import_chalk4.default.dim(this.libQueryEnginePath)}, Library may be corrupt`, + this.config.clientVersion + ); + } else { + throw new PrismaClientInitializationError( + `Expected an Node-API Library but received ${import_chalk4.default.dim(this.libQueryEnginePath)}`, + this.config.clientVersion + ); + } + } else { + throw new PrismaClientInitializationError( + `Unable to load Node-API Library from ${import_chalk4.default.dim(this.libQueryEnginePath)}, It does not exist`, + this.config.clientVersion + ); + } + } + } + async getLibQueryEnginePath() { + var _a3, _b2, _c, _d; + const libPath = (_a3 = process.env.PRISMA_QUERY_ENGINE_LIBRARY) != null ? _a3 : this.config.prismaPath; + if (libPath && import_fs5.default.existsSync(libPath) && libPath.endsWith(".node")) { + return libPath; + } + this.platform = (_b2 = this.platform) != null ? _b2 : await getPlatform(); + const { enginePath: enginePath2, searchedLocations: searchedLocations2 } = await this.resolveEnginePath(); + if (!import_fs5.default.existsSync(enginePath2)) { + const incorrectPinnedPlatformErrorStr = this.platform ? ` +You incorrectly pinned it to ${import_chalk4.default.redBright.bold(`${this.platform}`)} +` : ""; + let errorText = `Query engine library for current platform "${import_chalk4.default.bold( + this.platform + )}" could not be found.${incorrectPinnedPlatformErrorStr} +This probably happens, because you built Prisma Client on a different platform. +(Prisma Client looked in "${import_chalk4.default.underline(enginePath2)}") + +Searched Locations: + +${searchedLocations2.map((f) => { + let msg = ` ${f}`; + if (process.env.DEBUG === "node-engine-search-locations" && import_fs5.default.existsSync(f)) { + const dir = import_fs5.default.readdirSync(f); + msg += dir.map((d) => ` ${d}`).join("\n"); + } + return msg; + }).join("\n" + (process.env.DEBUG === "node-engine-search-locations" ? "\n" : ""))} +`; + if (this.config.generator) { + this.platform = (_c = this.platform) != null ? _c : await getPlatform(); + if (this.config.generator.binaryTargets.find((object) => object.value === this.platform) || this.config.generator.binaryTargets.find((object) => object.value === "native")) { + errorText += ` +You already added the platform${this.config.generator.binaryTargets.length > 1 ? "s" : ""} ${this.config.generator.binaryTargets.map((t) => `"${import_chalk4.default.bold(t.value)}"`).join(", ")} to the "${import_chalk4.default.underline("generator")}" block +in the "schema.prisma" file as described in https://pris.ly/d/client-generator, +but something went wrong. That's suboptimal. + +Please create an issue at https://github.com/prisma/prisma/issues/new`; + errorText += ``; + } else { + errorText += ` + +To solve this problem, add the platform "${this.platform}" to the "${import_chalk4.default.underline( + "binaryTargets" + )}" attribute in the "${import_chalk4.default.underline("generator")}" block in the "schema.prisma" file: +${import_chalk4.default.greenBright(this.getFixedGenerator())} + +Then run "${import_chalk4.default.greenBright("prisma generate")}" for your changes to take effect. +Read more about deploying Prisma Client: https://pris.ly/d/client-generator`; + } + } else { + errorText += ` + +Read more about deploying Prisma Client: https://pris.ly/d/client-generator +`; + } + throw new PrismaClientInitializationError(errorText, this.config.clientVersion); + } + this.platform = (_d = this.platform) != null ? _d : await getPlatform(); + return enginePath2; + } + async resolveEnginePath() { + var _a3, _b2, _c, _d; + const searchedLocations = []; + let enginePath; + if (this.libQueryEnginePath) { + return { enginePath: this.libQueryEnginePath, searchedLocations }; + } + this.platform = (_a3 = this.platform) != null ? _a3 : await getPlatform(); + if (__filename.includes("DefaultLibraryLoader")) { + enginePath = import_path3.default.join(getEnginesPath(), getNodeAPIName(this.platform, "fs")); + return { enginePath, searchedLocations }; + } + const dirname = eval("__dirname"); + const searchLocations = [ + import_path3.default.resolve(dirname, "../../../.prisma/client"), + (_d = (_c = (_b2 = this.config.generator) == null ? void 0 : _b2.output) == null ? void 0 : _c.value) != null ? _d : dirname, + import_path3.default.resolve(dirname, ".."), + import_path3.default.dirname(this.config.datamodelPath), + this.config.cwd, + "/tmp/prisma-engines" + ]; + if (this.config.dirname) { + searchLocations.push(this.config.dirname); + } + for (const location of searchLocations) { + searchedLocations.push(location); + debug7(`Searching for Query Engine Library in ${location}`); + enginePath = import_path3.default.join(location, getNodeAPIName(this.platform, "fs")); + if (import_fs5.default.existsSync(enginePath)) { + return { enginePath, searchedLocations }; + } + } + enginePath = import_path3.default.join(__dirname, getNodeAPIName(this.platform, "fs")); + return { enginePath: enginePath != null ? enginePath : "", searchedLocations }; + } + getFixedGenerator() { + const fixedGenerator = { + ...this.config.generator, + binaryTargets: fixBinaryTargets(this.config.generator.binaryTargets, this.platform) + }; + return printGeneratorConfig(fixedGenerator); + } +}; +__name(DefaultLibraryLoader, "DefaultLibraryLoader"); + +// ../engine-core/src/library/ExitHooks.ts +var debug8 = src_default("prisma:client:libraryEngine:exitHooks"); +var ExitHooks = class { + constructor() { + this.nextOwnerId = 1; + this.ownerToIdMap = /* @__PURE__ */ new WeakMap(); + this.idToListenerMap = /* @__PURE__ */ new Map(); + this.areHooksInstalled = false; + } + install() { + if (this.areHooksInstalled) { + return; + } + this.installHook("beforeExit"); + this.installHook("exit"); + this.installHook("SIGINT", true); + this.installHook("SIGUSR2", true); + this.installHook("SIGTERM", true); + this.areHooksInstalled = true; + } + setListener(owner, listener) { + if (listener) { + let id = this.ownerToIdMap.get(owner); + if (!id) { + id = this.nextOwnerId++; + this.ownerToIdMap.set(owner, id); + } + this.idToListenerMap.set(id, listener); + } else { + const id = this.ownerToIdMap.get(owner); + if (id !== void 0) { + this.ownerToIdMap.delete(owner); + this.idToListenerMap.delete(id); + } + } + } + getListener(owner) { + const id = this.ownerToIdMap.get(owner); + if (id === void 0) { + return void 0; + } + return this.idToListenerMap.get(id); + } + installHook(event, shouldExit = false) { + process.once(event, async (code) => { + debug8(`exit event received: ${event}`); + for (const listener of this.idToListenerMap.values()) { + await listener(); + } + this.idToListenerMap.clear(); + if (shouldExit && process.listenerCount(event) === 0) { + process.exit(code); + } + }); + } +}; +__name(ExitHooks, "ExitHooks"); + +// ../engine-core/src/library/LibraryEngine.ts +var debug9 = src_default("prisma:client:libraryEngine"); +function isQueryEvent(event) { + return event["item_type"] === "query" && "query" in event; +} +__name(isQueryEvent, "isQueryEvent"); +function isPanicEvent(event) { + if ("level" in event) { + return event.level === "error" && event["message"] === "PANIC"; + } else { + return false; + } +} +__name(isPanicEvent, "isPanicEvent"); +var knownPlatforms2 = [...platforms, "native"]; +var engineInstanceCount = 0; +var exitHooks = new ExitHooks(); +var LibraryEngine = class extends Engine { + constructor(config2, loader = new DefaultLibraryLoader(config2)) { + var _a3, _b2; + super(); + this.datamodel = import_fs6.default.readFileSync(config2.datamodelPath, "utf-8"); + this.config = config2; + this.libraryStarted = false; + this.logQueries = (_a3 = config2.logQueries) != null ? _a3 : false; + this.logLevel = (_b2 = config2.logLevel) != null ? _b2 : "error"; + this.libraryLoader = loader; + this.logEmitter = new import_events3.default(); + this.logEmitter.on("error", (e) => { + }); + this.datasourceOverrides = config2.datasources ? this.convertDatasources(config2.datasources) : {}; + if (config2.enableDebugLogs) { + this.logLevel = "debug"; + } + this.libraryInstantiationPromise = this.instantiateLibrary(); + exitHooks.install(); + this.checkForTooManyEngines(); + } + get beforeExitListener() { + return exitHooks.getListener(this); + } + set beforeExitListener(listener) { + exitHooks.setListener(this, listener); + } + checkForTooManyEngines() { + if (engineInstanceCount === 10) { + console.warn( + `${import_chalk5.default.yellow("warn(prisma-client)")} There are already 10 instances of Prisma Client actively running.` + ); + } + } + async transaction(action, headers, arg2) { + var _a3, _b2, _c, _d, _e; + await this.start(); + const headerStr = JSON.stringify(headers); + let result; + if (action === "start") { + const jsonOptions = JSON.stringify({ + max_wait: (_a3 = arg2 == null ? void 0 : arg2.maxWait) != null ? _a3 : 2e3, + timeout: (_b2 = arg2 == null ? void 0 : arg2.timeout) != null ? _b2 : 5e3, + isolation_level: arg2 == null ? void 0 : arg2.isolationLevel + }); + result = await ((_c = this.engine) == null ? void 0 : _c.startTransaction(jsonOptions, headerStr)); + } else if (action === "commit") { + result = await ((_d = this.engine) == null ? void 0 : _d.commitTransaction(arg2.id, headerStr)); + } else if (action === "rollback") { + result = await ((_e = this.engine) == null ? void 0 : _e.rollbackTransaction(arg2.id, headerStr)); + } + const response = this.parseEngineResponse(result); + if (response.error_code) + throw response; + return response; + } + async instantiateLibrary() { + debug9("internalSetup"); + if (this.libraryInstantiationPromise) { + return this.libraryInstantiationPromise; + } + await isNodeAPISupported(); + this.platform = await this.getPlatform(); + await this.loadEngine(); + this.version(); + } + async getPlatform() { + if (this.platform) + return this.platform; + const platform3 = await getPlatform(); + if (!knownPlatforms2.includes(platform3)) { + throw new PrismaClientInitializationError( + `Unknown ${import_chalk5.default.red("PRISMA_QUERY_ENGINE_LIBRARY")} ${import_chalk5.default.redBright.bold( + platform3 + )}. Possible binaryTargets: ${import_chalk5.default.greenBright( + knownPlatforms2.join(", ") + )} or a path to the query engine library. +You may have to run ${import_chalk5.default.greenBright("prisma generate")} for your changes to take effect.`, + this.config.clientVersion + ); + } + return platform3; + } + parseEngineResponse(response) { + if (!response) { + throw new PrismaClientUnknownRequestError(`Response from the Engine was empty`, this.config.clientVersion); + } + try { + const config2 = JSON.parse(response); + return config2; + } catch (err) { + throw new PrismaClientUnknownRequestError(`Unable to JSON.parse response from engine`, this.config.clientVersion); + } + } + convertDatasources(datasources) { + const obj = /* @__PURE__ */ Object.create(null); + for (const { name, url } of datasources) { + obj[name] = url; + } + return obj; + } + async loadEngine() { + var _a3; + if (!this.engine) { + if (!this.QueryEngineConstructor) { + this.library = await this.libraryLoader.loadLibrary(); + this.QueryEngineConstructor = this.library.QueryEngine; + } + try { + const weakThis = new WeakRef(this); + this.engine = new this.QueryEngineConstructor( + { + datamodel: this.datamodel, + env: process.env, + logQueries: (_a3 = this.config.logQueries) != null ? _a3 : false, + ignoreEnvVarErrors: false, + datasourceOverrides: this.datasourceOverrides, + logLevel: this.logLevel, + configDir: this.config.cwd + }, + (log4) => { + var _a4; + (_a4 = weakThis.deref()) == null ? void 0 : _a4.logger(log4); + } + ); + engineInstanceCount++; + } catch (_e) { + const e = _e; + const error2 = this.parseInitError(e.message); + if (typeof error2 === "string") { + throw e; + } else { + throw new PrismaClientInitializationError(error2.message, this.config.clientVersion, error2.error_code); + } + } + } + } + logger(log4) { + var _a3; + const event = this.parseEngineResponse(log4); + if (!event) + return; + if ("span" in event) { + if (this.config.tracingConfig.enabled === true) { + void createSpan(event); + } + return; + } + event.level = (_a3 = event == null ? void 0 : event.level.toLowerCase()) != null ? _a3 : "unknown"; + if (isQueryEvent(event)) { + this.logEmitter.emit("query", { + timestamp: new Date(), + query: event.query, + params: event.params, + duration: Number(event.duration_ms), + target: event.module_path + }); + } else if (isPanicEvent(event)) { + this.loggerRustPanic = new PrismaClientRustPanicError( + this.getErrorMessageWithLink( + `${event.message}: ${event.reason} in ${event.file}:${event.line}:${event.column}` + ), + this.config.clientVersion + ); + this.logEmitter.emit("error", this.loggerRustPanic); + } else { + this.logEmitter.emit(event.level, { + timestamp: new Date(), + message: event.message, + target: event.module_path + }); + } + } + getErrorMessageWithLink(title) { + var _a3; + return getErrorMessageWithLink({ + platform: this.platform, + title, + version: this.config.clientVersion, + engineVersion: (_a3 = this.versionInfo) == null ? void 0 : _a3.commit, + database: this.config.activeProvider, + query: this.lastQuery + }); + } + parseInitError(str) { + try { + const error2 = JSON.parse(str); + return error2; + } catch (e) { + } + return str; + } + parseRequestError(str) { + try { + const error2 = JSON.parse(str); + return error2; + } catch (e) { + } + return str; + } + on(event, listener) { + if (event === "beforeExit") { + this.beforeExitListener = listener; + } else { + this.logEmitter.on(event, listener); + } + } + async start() { + await this.libraryInstantiationPromise; + await this.libraryStoppingPromise; + if (this.libraryStartingPromise) { + debug9(`library already starting, this.libraryStarted: ${this.libraryStarted}`); + return this.libraryStartingPromise; + } + if (this.libraryStarted) { + return; + } + const startFn = /* @__PURE__ */ __name(async () => { + var _a3; + debug9("library starting"); + try { + const headers = { + traceparent: getTraceParent({ tracingConfig: this.config.tracingConfig }) + }; + await ((_a3 = this.engine) == null ? void 0 : _a3.connect(JSON.stringify(headers))); + this.libraryStarted = true; + debug9("library started"); + } catch (err) { + const error2 = this.parseInitError(err.message); + if (typeof error2 === "string") { + throw err; + } else { + throw new PrismaClientInitializationError(error2.message, this.config.clientVersion, error2.error_code); + } + } finally { + this.libraryStartingPromise = void 0; + } + }, "startFn"); + const spanConfig = { + name: "connect", + enabled: this.config.tracingConfig.enabled + }; + this.libraryStartingPromise = runInChildSpan(spanConfig, startFn); + return this.libraryStartingPromise; + } + async stop() { + await this.libraryStartingPromise; + await this.executingQueryPromise; + if (this.libraryStoppingPromise) { + debug9("library is already stopping"); + return this.libraryStoppingPromise; + } + if (!this.libraryStarted) { + return; + } + const stopFn = /* @__PURE__ */ __name(async () => { + var _a3; + await new Promise((r) => setTimeout(r, 5)); + debug9("library stopping"); + const headers = { + traceparent: getTraceParent({ tracingConfig: this.config.tracingConfig }) + }; + await ((_a3 = this.engine) == null ? void 0 : _a3.disconnect(JSON.stringify(headers))); + this.libraryStarted = false; + this.libraryStoppingPromise = void 0; + debug9("library stopped"); + }, "stopFn"); + const spanConfig = { + name: "disconnect", + enabled: this.config.tracingConfig.enabled + }; + this.libraryStoppingPromise = runInChildSpan(spanConfig, stopFn); + return this.libraryStoppingPromise; + } + async getConfig() { + await this.libraryInstantiationPromise; + return this.library.getConfig({ + datamodel: this.datamodel, + datasourceOverrides: this.datasourceOverrides, + ignoreEnvVarErrors: true, + env: process.env + }); + } + async getDmmf() { + await this.libraryInstantiationPromise; + return JSON.parse(await this.library.dmmf(this.datamodel)); + } + version() { + var _a3, _b2, _c; + this.versionInfo = (_a3 = this.library) == null ? void 0 : _a3.version(); + return (_c = (_b2 = this.versionInfo) == null ? void 0 : _b2.version) != null ? _c : "unknown"; + } + debugPanic(message) { + var _a3; + return (_a3 = this.library) == null ? void 0 : _a3.debugPanic(message); + } + async request(query2, headers = {}, numTry = 1) { + var _a3, _b2; + debug9(`sending request, this.libraryStarted: ${this.libraryStarted}`); + const request2 = { query: query2, variables: {} }; + const headerStr = JSON.stringify(headers); + const queryStr = JSON.stringify(request2); + try { + await this.start(); + this.executingQueryPromise = (_a3 = this.engine) == null ? void 0 : _a3.query(queryStr, headerStr, headers.transactionId); + this.lastQuery = queryStr; + const data = this.parseEngineResponse(await this.executingQueryPromise); + if (data.errors) { + if (data.errors.length === 1) { + throw this.buildQueryError(data.errors[0]); + } + throw new PrismaClientUnknownRequestError(JSON.stringify(data.errors), this.config.clientVersion); + } else if (this.loggerRustPanic) { + throw this.loggerRustPanic; + } + return { data, elapsed: 0 }; + } catch (e) { + if (e instanceof PrismaClientInitializationError) { + throw e; + } + if (e.code === "GenericFailure" && ((_b2 = e.message) == null ? void 0 : _b2.startsWith("PANIC:"))) { + throw new PrismaClientRustPanicError(this.getErrorMessageWithLink(e.message), this.config.clientVersion); + } + const error2 = this.parseRequestError(e.message); + if (typeof error2 === "string") { + throw e; + } else { + throw new PrismaClientUnknownRequestError(`${error2.message} +${error2.backtrace}`, this.config.clientVersion); + } + } + } + async requestBatch(queries, headers = {}, transaction = false, numTry = 1) { + debug9("requestBatch"); + const request2 = { + batch: queries.map((query2) => ({ query: query2, variables: {} })), + transaction + }; + await this.start(); + this.lastQuery = JSON.stringify(request2); + this.executingQueryPromise = this.engine.query(this.lastQuery, JSON.stringify(headers), headers.transactionId); + const result = await this.executingQueryPromise; + const data = this.parseEngineResponse(result); + if (data.errors) { + if (data.errors.length === 1) { + throw this.buildQueryError(data.errors[0]); + } + throw new PrismaClientUnknownRequestError(JSON.stringify(data.errors), this.config.clientVersion); + } + const { batchResult, errors } = data; + if (Array.isArray(batchResult)) { + return batchResult.map((result2) => { + var _a3; + if (result2.errors) { + return (_a3 = this.loggerRustPanic) != null ? _a3 : this.buildQueryError(data.errors[0]); + } + return { + data: result2, + elapsed: 0 + }; + }); + } else { + if (errors && errors.length === 1) { + throw new Error(errors[0].error); + } + throw new Error(JSON.stringify(data)); + } + } + buildQueryError(error2) { + if (error2.user_facing_error.is_panic) { + return new PrismaClientRustPanicError( + this.getErrorMessageWithLink(error2.user_facing_error.message), + this.config.clientVersion + ); + } + return prismaGraphQLToJSError(error2, this.config.clientVersion); + } + async metrics(options) { + await this.start(); + const responseString = await this.engine.metrics(JSON.stringify(options)); + if (options.format === "prometheus") { + return responseString; + } + return this.parseEngineResponse(responseString); + } +}; +__name(LibraryEngine, "LibraryEngine"); + +// ../internals/src/utils/tryLoadEnvs.ts +var import_chalk6 = __toESM(require_source()); +var import_dotenv = __toESM(require_main2()); +var import_fs7 = __toESM(require("fs")); +var import_path4 = __toESM(require("path")); + +// ../internals/src/dotenvExpand.ts +function dotenvExpand(config2) { + const environment = config2.ignoreProcessEnv ? {} : process.env; + const interpolate = /* @__PURE__ */ __name((envValue) => { + const matches = envValue.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g) || []; + return matches.reduce(function(newEnv, match) { + const parts = /(.?)\${([a-zA-Z0-9_]+)?}/g.exec(match); + if (!parts) { + return newEnv; + } + const prefix = parts[1]; + let value, replacePart; + if (prefix === "\\") { + replacePart = parts[0]; + value = replacePart.replace("\\$", "$"); + } else { + const key = parts[2]; + replacePart = parts[0].substring(prefix.length); + value = Object.hasOwnProperty.call(environment, key) ? environment[key] : config2.parsed[key] || ""; + value = interpolate(value); + } + return newEnv.replace(replacePart, value); + }, envValue); + }, "interpolate"); + for (const configKey in config2.parsed) { + const value = Object.hasOwnProperty.call(environment, configKey) ? environment[configKey] : config2.parsed[configKey]; + config2.parsed[configKey] = interpolate(value); + } + for (const processKey in config2.parsed) { + environment[processKey] = config2.parsed[processKey]; + } + return config2; +} +__name(dotenvExpand, "dotenvExpand"); + +// ../internals/src/utils/tryLoadEnvs.ts +var debug10 = src_default("prisma:tryLoadEnv"); +function tryLoadEnvs({ + rootEnvPath, + schemaEnvPath +}, opts = { + conflictCheck: "none" +}) { + var _a3, _b2; + const rootEnvInfo = loadEnv(rootEnvPath); + if (opts.conflictCheck !== "none") { + checkForConflicts(rootEnvInfo, schemaEnvPath, opts.conflictCheck); + } + let schemaEnvInfo = null; + if (!pathsEqual(rootEnvInfo == null ? void 0 : rootEnvInfo.path, schemaEnvPath)) { + schemaEnvInfo = loadEnv(schemaEnvPath); + } + if (!rootEnvInfo && !schemaEnvInfo) { + debug10("No Environment variables loaded"); + } + if (schemaEnvInfo == null ? void 0 : schemaEnvInfo.dotenvResult.error) { + return console.error(import_chalk6.default.redBright.bold("Schema Env Error: ") + schemaEnvInfo.dotenvResult.error); + } + const messages = [rootEnvInfo == null ? void 0 : rootEnvInfo.message, schemaEnvInfo == null ? void 0 : schemaEnvInfo.message].filter(Boolean); + return { + message: messages.join("\n"), + parsed: { + ...(_a3 = rootEnvInfo == null ? void 0 : rootEnvInfo.dotenvResult) == null ? void 0 : _a3.parsed, + ...(_b2 = schemaEnvInfo == null ? void 0 : schemaEnvInfo.dotenvResult) == null ? void 0 : _b2.parsed + } + }; +} +__name(tryLoadEnvs, "tryLoadEnvs"); +function checkForConflicts(rootEnvInfo, envPath, type) { + const parsedRootEnv = rootEnvInfo == null ? void 0 : rootEnvInfo.dotenvResult.parsed; + const areNotTheSame = !pathsEqual(rootEnvInfo == null ? void 0 : rootEnvInfo.path, envPath); + if (parsedRootEnv && envPath && areNotTheSame && import_fs7.default.existsSync(envPath)) { + const envConfig = import_dotenv.default.parse(import_fs7.default.readFileSync(envPath)); + const conflicts = []; + for (const k in envConfig) { + if (parsedRootEnv[k] === envConfig[k]) { + conflicts.push(k); + } + } + if (conflicts.length > 0) { + const relativeRootEnvPath = import_path4.default.relative(process.cwd(), rootEnvInfo.path); + const relativeEnvPath = import_path4.default.relative(process.cwd(), envPath); + if (type === "error") { + const message = `There is a conflict between env var${conflicts.length > 1 ? "s" : ""} in ${import_chalk6.default.underline( + relativeRootEnvPath + )} and ${import_chalk6.default.underline(relativeEnvPath)} +Conflicting env vars: +${conflicts.map((conflict) => ` ${import_chalk6.default.bold(conflict)}`).join("\n")} + +We suggest to move the contents of ${import_chalk6.default.underline(relativeEnvPath)} to ${import_chalk6.default.underline( + relativeRootEnvPath + )} to consolidate your env vars. +`; + throw new Error(message); + } else if (type === "warn") { + const message = `Conflict for env var${conflicts.length > 1 ? "s" : ""} ${conflicts.map((c) => import_chalk6.default.bold(c)).join(", ")} in ${import_chalk6.default.underline(relativeRootEnvPath)} and ${import_chalk6.default.underline(relativeEnvPath)} +Env vars from ${import_chalk6.default.underline(relativeEnvPath)} overwrite the ones from ${import_chalk6.default.underline(relativeRootEnvPath)} + `; + console.warn(`${import_chalk6.default.yellow("warn(prisma)")} ${message}`); + } + } + } +} +__name(checkForConflicts, "checkForConflicts"); +function loadEnv(envPath) { + if (exists3(envPath)) { + debug10(`Environment variables loaded from ${envPath}`); + return { + dotenvResult: dotenvExpand( + import_dotenv.default.config({ + path: envPath, + debug: process.env.DOTENV_CONFIG_DEBUG ? true : void 0 + }) + ), + message: import_chalk6.default.dim(`Environment variables loaded from ${import_path4.default.relative(process.cwd(), envPath)}`), + path: envPath + }; + } else { + debug10(`Environment variables not found at ${envPath}`); + } + return null; +} +__name(loadEnv, "loadEnv"); +function pathsEqual(path1, path22) { + return path1 && path22 && import_path4.default.resolve(path1) === import_path4.default.resolve(path22); +} +__name(pathsEqual, "pathsEqual"); +function exists3(p) { + return Boolean(p && import_fs7.default.existsSync(p)); +} +__name(exists3, "exists"); + +// ../internals/src/client/getClientEngineType.ts +var DEFAULT_CLIENT_ENGINE_TYPE = "library" /* Library */; +function getClientEngineType(generatorConfig) { + const engineTypeFromEnvVar = getEngineTypeFromEnvVar(); + if (engineTypeFromEnvVar) + return engineTypeFromEnvVar; + if ((generatorConfig == null ? void 0 : generatorConfig.config.engineType) === "library" /* Library */) { + return "library" /* Library */; + } else if ((generatorConfig == null ? void 0 : generatorConfig.config.engineType) === "binary" /* Binary */) { + return "binary" /* Binary */; + } else { + return DEFAULT_CLIENT_ENGINE_TYPE; + } +} +__name(getClientEngineType, "getClientEngineType"); +function getEngineTypeFromEnvVar() { + const engineType = process.env.PRISMA_CLIENT_ENGINE_TYPE; + if (engineType === "library" /* Library */) { + return "library" /* Library */; + } else if (engineType === "binary" /* Binary */) { + return "binary" /* Binary */; + } else { + return void 0; + } +} +__name(getEngineTypeFromEnvVar, "getEngineTypeFromEnvVar"); + +// ../internals/src/cli/utils.ts +var import_arg = __toESM(require_arg()); +var import_strip_indent = __toESM(require_strip_indent()); +function isError(result) { + return result instanceof Error; +} +__name(isError, "isError"); + +// ../internals/src/logger.ts +var logger_exports = {}; +__export(logger_exports, { + error: () => error, + info: () => info, + log: () => log3, + query: () => query, + should: () => should, + tags: () => tags, + warn: () => warn +}); +var import_chalk7 = __toESM(require_source()); +var tags = { + error: import_chalk7.default.red("prisma:error"), + warn: import_chalk7.default.yellow("prisma:warn"), + info: import_chalk7.default.cyan("prisma:info"), + query: import_chalk7.default.blue("prisma:query") +}; +var should = { + warn: !process.env.PRISMA_DISABLE_WARNINGS +}; +function log3(...data) { + console.log(...data); +} +__name(log3, "log"); +function warn(message, ...optionalParams) { + if (should.warn) { + console.warn(`${tags.warn} ${message}`, ...optionalParams); + } +} +__name(warn, "warn"); +function info(message, ...optionalParams) { + console.info(`${tags.info} ${message}`, ...optionalParams); +} +__name(info, "info"); +function error(message, ...optionalParams) { + console.error(`${tags.error} ${message}`, ...optionalParams); +} +__name(error, "error"); +function query(message, ...optionalParams) { + console.log(`${tags.query} ${message}`, ...optionalParams); +} +__name(query, "query"); + +// ../internals/src/utils/assertNever.ts +function assertNever(arg2, errorMessage) { + throw new Error(errorMessage); +} +__name(assertNever, "assertNever"); + +// ../internals/src/utils/callOnce.ts +function callOnce(fn) { + let result; + return (...args) => result != null ? result : result = fn(...args); +} +__name(callOnce, "callOnce"); + +// ../internals/src/utils/keyBy.ts +var keyBy2 = /* @__PURE__ */ __name((collection, iteratee) => { + return collection.reduce((acc, curr) => { + acc[iteratee(curr)] = curr; + return acc; + }, {}); +}, "keyBy"); + +// ../internals/src/warnOnce.ts +var alreadyWarned = /* @__PURE__ */ new Set(); +var warnOnce = /* @__PURE__ */ __name((key, message, ...args) => { + if (!alreadyWarned.has(key)) { + alreadyWarned.add(key); + warn(message, ...args); + } +}, "warnOnce"); + +// src/runtime/getPrismaClient.ts +var import_async_hooks = require("async_hooks"); +var import_fs9 = __toESM(require("fs")); +var import_path5 = __toESM(require("path")); + +// ../../node_modules/.pnpm/sql-template-tag@5.0.3/node_modules/sql-template-tag/dist/index.js +var Sql = class { + constructor(rawStrings, rawValues) { + if (rawStrings.length - 1 !== rawValues.length) { + if (rawStrings.length === 0) { + throw new TypeError("Expected at least 1 string"); + } + throw new TypeError(`Expected ${rawStrings.length} strings to have ${rawStrings.length - 1} values`); + } + const valuesLength = rawValues.reduce((len, value) => len + (value instanceof Sql ? value.values.length : 1), 0); + this.values = new Array(valuesLength); + this.strings = new Array(valuesLength + 1); + this.strings[0] = rawStrings[0]; + let i = 0, pos = 0; + while (i < rawValues.length) { + const child = rawValues[i++]; + const rawString = rawStrings[i]; + if (child instanceof Sql) { + this.strings[pos] += child.strings[0]; + let childIndex = 0; + while (childIndex < child.values.length) { + this.values[pos++] = child.values[childIndex++]; + this.strings[pos] = child.strings[childIndex]; + } + this.strings[pos] += rawString; + } else { + this.values[pos++] = child; + this.strings[pos] = rawString; + } + } + } + get text() { + let i = 1, value = this.strings[0]; + while (i < this.strings.length) + value += `$${i}${this.strings[i++]}`; + return value; + } + get sql() { + let i = 1, value = this.strings[0]; + while (i < this.strings.length) + value += `?${this.strings[i++]}`; + return value; + } + inspect() { + return { + text: this.text, + sql: this.sql, + values: this.values + }; + } +}; +__name(Sql, "Sql"); +function join(values, separator = ",", prefix = "", suffix = "") { + if (values.length === 0) { + throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array"); + } + return new Sql([prefix, ...Array(values.length - 1).fill(separator), suffix], values); +} +__name(join, "join"); +function raw(value) { + return new Sql([value], []); +} +__name(raw, "raw"); +var empty = raw(""); +function sql(strings, ...values) { + return new Sql(strings, values); +} +__name(sql, "sql"); + +// src/runtime/externalToInternalDmmf.ts +var import_pluralize = __toESM(require_pluralize()); +function externalToInternalDmmf(document2) { + return { + ...document2, + mappings: getMappings(document2.mappings, document2.datamodel) + }; +} +__name(externalToInternalDmmf, "externalToInternalDmmf"); +function getMappings(mappings, datamodel) { + const modelOperations = mappings.modelOperations.filter((mapping) => { + const model = datamodel.models.find((m) => m.name === mapping.model); + if (!model) { + throw new Error(`Mapping without model ${mapping.model}`); + } + return model.fields.some((f) => f.kind !== "object"); + }).map((mapping) => ({ + model: mapping.model, + plural: (0, import_pluralize.default)(lowerCase(mapping.model)), + findUnique: mapping.findUnique || mapping.findSingle, + findFirst: mapping.findFirst, + findMany: mapping.findMany, + create: mapping.createOne || mapping.createSingle || mapping.create, + createMany: mapping.createMany, + delete: mapping.deleteOne || mapping.deleteSingle || mapping.delete, + update: mapping.updateOne || mapping.updateSingle || mapping.update, + deleteMany: mapping.deleteMany, + updateMany: mapping.updateMany, + upsert: mapping.upsertOne || mapping.upsertSingle || mapping.upsert, + aggregate: mapping.aggregate, + groupBy: mapping.groupBy, + findRaw: mapping.findRaw, + aggregateRaw: mapping.aggregateRaw + })); + return { + modelOperations, + otherOperations: mappings.otherOperations + }; +} +__name(getMappings, "getMappings"); + +// src/generation/getDMMF.ts +function getPrismaClientDMMF(dmmf) { + return externalToInternalDmmf(dmmf); +} +__name(getPrismaClientDMMF, "getPrismaClientDMMF"); + +// src/runtime/clientActions.ts +var clientOnlyActions = { + findUniqueOrThrow: { + wrappedAction: DMMF.ModelAction.findUnique + }, + findFirstOrThrow: { + wrappedAction: DMMF.ModelAction.findFirst + } +}; +function getDmmfActionName(name) { + if (isClientOnlyAction(name)) { + return clientOnlyActions[name].wrappedAction; + } + return name; +} +__name(getDmmfActionName, "getDmmfActionName"); +function isClientOnlyAction(action) { + return Object.prototype.hasOwnProperty.call(clientOnlyActions, action); +} +__name(isClientOnlyAction, "isClientOnlyAction"); +var allClientModelActions = Object.keys(DMMF.ModelAction).concat( + Object.keys(clientOnlyActions) +); + +// ../../node_modules/.pnpm/stacktrace-parser@0.1.10/node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js +var UNKNOWN_FUNCTION = ""; +function parse(stackString) { + var lines = stackString.split("\n"); + return lines.reduce(function(stack, line) { + var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line); + if (parseResult) { + stack.push(parseResult); + } + return stack; + }, []); +} +__name(parse, "parse"); +var chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; +var chromeEvalRe = /\((\S*)(?::(\d+))(?::(\d+))\)/; +function parseChrome(line) { + var parts = chromeRe.exec(line); + if (!parts) { + return null; + } + var isNative = parts[2] && parts[2].indexOf("native") === 0; + var isEval = parts[2] && parts[2].indexOf("eval") === 0; + var submatch = chromeEvalRe.exec(parts[2]); + if (isEval && submatch != null) { + parts[2] = submatch[1]; + parts[3] = submatch[2]; + parts[4] = submatch[3]; + } + return { + file: !isNative ? parts[2] : null, + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: isNative ? [parts[2]] : [], + lineNumber: parts[3] ? +parts[3] : null, + column: parts[4] ? +parts[4] : null + }; +} +__name(parseChrome, "parseChrome"); +var winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; +function parseWinjs(line) { + var parts = winjsRe.exec(line); + if (!parts) { + return null; + } + return { + file: parts[2], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[3], + column: parts[4] ? +parts[4] : null + }; +} +__name(parseWinjs, "parseWinjs"); +var geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i; +var geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; +function parseGecko(line) { + var parts = geckoRe.exec(line); + if (!parts) { + return null; + } + var isEval = parts[3] && parts[3].indexOf(" > eval") > -1; + var submatch = geckoEvalRe.exec(parts[3]); + if (isEval && submatch != null) { + parts[3] = submatch[1]; + parts[4] = submatch[2]; + parts[5] = null; + } + return { + file: parts[3], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: parts[2] ? parts[2].split(",") : [], + lineNumber: parts[4] ? +parts[4] : null, + column: parts[5] ? +parts[5] : null + }; +} +__name(parseGecko, "parseGecko"); +var javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i; +function parseJSC(line) { + var parts = javaScriptCoreRe.exec(line); + if (!parts) { + return null; + } + return { + file: parts[3], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[4], + column: parts[5] ? +parts[5] : null + }; +} +__name(parseJSC, "parseJSC"); +var nodeRe = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i; +function parseNode(line) { + var parts = nodeRe.exec(line); + if (!parts) { + return null; + } + return { + file: parts[2], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[3], + column: parts[4] ? +parts[4] : null + }; +} +__name(parseNode, "parseNode"); + +// src/runtime/utils/CallSite.ts +var DisabledCallSite = class { + getLocation() { + return null; + } +}; +__name(DisabledCallSite, "DisabledCallSite"); +var EnabledCallSite = class { + constructor() { + this._error = new Error(); + } + getLocation() { + const stack = this._error.stack; + if (!stack) { + return null; + } + const stackFrames = parse(stack); + const frame = stackFrames.find((t) => { + return t.file && t.file !== "" && !t.file.includes("@prisma") && !t.file.includes("getPrismaClient") && !t.file.startsWith("internal/") && !t.methodName.includes("new ") && !t.methodName.includes("getCallSite") && !t.methodName.includes("Proxy.") && t.methodName.split(".").length < 4; + }); + if (!frame || !frame.file) { + return null; + } + return { + fileName: frame.file, + lineNumber: frame.lineNumber, + columnNumber: frame.column + }; + } +}; +__name(EnabledCallSite, "EnabledCallSite"); +function getCallSite(errorFormat) { + if (errorFormat === "minimal") { + return new DisabledCallSite(); + } + return new EnabledCallSite(); +} +__name(getCallSite, "getCallSite"); + +// src/runtime/core/request/createPrismaPromise.ts +function createPrismaPromise(callback) { + let promise; + const _callback = /* @__PURE__ */ __name((txId, lock) => { + try { + return promise != null ? promise : promise = callback(txId, lock); + } catch (error2) { + return Promise.reject(error2); + } + }, "_callback"); + return { + then(onFulfilled, onRejected, txId) { + return _callback(txId, void 0).then(onFulfilled, onRejected, txId); + }, + catch(onRejected, txId) { + return _callback(txId, void 0).catch(onRejected, txId); + }, + finally(onFinally, txId) { + return _callback(txId, void 0).finally(onFinally, txId); + }, + requestTransaction(txId, lock) { + const promise2 = _callback(txId, lock); + if (promise2.requestTransaction) { + return promise2.requestTransaction(txId, lock); + } + return promise2; + }, + [Symbol.toStringTag]: "PrismaPromise" + }; +} +__name(createPrismaPromise, "createPrismaPromise"); + +// src/runtime/core/model/aggregates/utils/aggregateMap.ts +var aggregateMap = { + _avg: true, + _count: true, + _sum: true, + _min: true, + _max: true +}; + +// src/runtime/core/model/aggregates/aggregate.ts +function desugarUserArgs(userArgs) { + const _userArgs = desugarCountInUserArgs(userArgs); + const userArgsEntries = Object.entries(_userArgs); + return userArgsEntries.reduce( + (aggregateArgs, [key, value]) => { + if (aggregateMap[key] !== void 0) { + aggregateArgs["select"][key] = { select: value }; + } else { + aggregateArgs[key] = value; + } + return aggregateArgs; + }, + { select: {} } + ); +} +__name(desugarUserArgs, "desugarUserArgs"); +function desugarCountInUserArgs(userArgs) { + if (typeof userArgs["_count"] === "boolean") { + return { ...userArgs, _count: { _all: userArgs["_count"] } }; + } + return userArgs; +} +__name(desugarCountInUserArgs, "desugarCountInUserArgs"); +function createUnpacker(userArgs) { + return (data) => { + if (typeof userArgs["_count"] === "boolean") { + data["_count"] = data["_count"]["_all"]; + } + return data; + }; +} +__name(createUnpacker, "createUnpacker"); +function aggregate(client, userArgs, modelAction) { + const aggregateArgs = desugarUserArgs(userArgs != null ? userArgs : {}); + const aggregateUnpacker = createUnpacker(userArgs != null ? userArgs : {}); + return modelAction({ + action: "aggregate", + unpacker: aggregateUnpacker + })(aggregateArgs); +} +__name(aggregate, "aggregate"); + +// src/runtime/core/model/aggregates/count.ts +function count(client, userArgs, modelAction) { + const { select, ..._userArgs } = userArgs != null ? userArgs : {}; + if (typeof select === "object") { + return aggregate( + client, + { ..._userArgs, _count: select }, + (p) => modelAction({ ...p, action: "count", unpacker: (data) => { + var _a3; + return (_a3 = p.unpacker) == null ? void 0 : _a3.call(p, data)["_count"]; + } }) + ); + } else { + return aggregate( + client, + { ..._userArgs, _count: { _all: true } }, + (p) => modelAction({ ...p, action: "count", unpacker: (data) => { + var _a3; + return (_a3 = p.unpacker) == null ? void 0 : _a3.call(p, data)["_count"]["_all"]; + } }) + ); + } +} +__name(count, "count"); + +// src/runtime/core/model/aggregates/groupBy.ts +function desugarUserArgs2(userArgs) { + const _userArgs = desugarUserArgs(userArgs); + if (Array.isArray(userArgs["by"])) { + for (const key of userArgs["by"]) { + if (typeof key === "string") { + _userArgs["select"][key] = true; + } + } + } + return _userArgs; +} +__name(desugarUserArgs2, "desugarUserArgs"); +function createUnpacker2(userArgs) { + return (data) => { + if (typeof userArgs["_count"] === "boolean") { + data.forEach((row) => { + row["_count"] = row["_count"]["_all"]; + }); + } + return data; + }; +} +__name(createUnpacker2, "createUnpacker"); +function groupBy(client, userArgs, modelAction) { + const groupByArgs = desugarUserArgs2(userArgs != null ? userArgs : {}); + const groupByUnpacker = createUnpacker2(userArgs != null ? userArgs : {}); + return modelAction({ + action: "groupBy", + unpacker: groupByUnpacker + })(groupByArgs); +} +__name(groupBy, "groupBy"); + +// src/runtime/core/model/applyAggregates.ts +function applyAggregates(client, action, modelAction) { + if (action === "aggregate") + return (userArgs) => aggregate(client, userArgs, modelAction); + if (action === "count") + return (userArgs) => count(client, userArgs, modelAction); + if (action === "groupBy") + return (userArgs) => groupBy(client, userArgs, modelAction); + return void 0; +} +__name(applyAggregates, "applyAggregates"); + +// src/runtime/query.ts +var import_chalk11 = __toESM(require_source()); +var import_indent_string4 = __toESM(require_indent_string()); +var import_strip_ansi3 = __toESM(require_strip_ansi()); + +// src/runtime/utils/createErrorMessageWithContext.ts +var import_chalk9 = __toESM(require_source()); +var import_indent_string3 = __toESM(require_indent_string()); + +// src/runtime/utils/SourceFileSlice.ts +var import_fs8 = __toESM(require("fs")); + +// src/runtime/highlight/theme.ts +var import_chalk8 = __toESM(require_source()); +var orange = import_chalk8.default.rgb(246, 145, 95); +var darkBrightBlue = import_chalk8.default.rgb(107, 139, 140); +var blue = import_chalk8.default.cyan; +var brightBlue = import_chalk8.default.rgb(127, 155, 155); +var identity = /* @__PURE__ */ __name((str) => str, "identity"); +var theme = { + keyword: blue, + entity: blue, + value: brightBlue, + punctuation: darkBrightBlue, + directive: blue, + function: blue, + variable: brightBlue, + string: import_chalk8.default.greenBright, + boolean: orange, + number: import_chalk8.default.cyan, + comment: import_chalk8.default.grey +}; + +// src/runtime/highlight/prism.ts +var _self = {}; +var uniqueId = 0; +var Prism = { + manual: _self.Prism && _self.Prism.manual, + disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, + util: { + encode: function(tokens) { + if (tokens instanceof Token) { + const anyTokens = tokens; + return new Token(anyTokens.type, Prism.util.encode(anyTokens.content), anyTokens.alias); + } else if (Array.isArray(tokens)) { + return tokens.map(Prism.util.encode); + } else { + return tokens.replace(/&/g, "&").replace(/ text.length) { + return; + } + if (str instanceof Token) { + continue; + } + if (greedy && i != strarr.length - 1) { + pattern.lastIndex = pos; + var match = pattern.exec(text); + if (!match) { + break; + } + var from = match.index + (lookbehind ? match[1].length : 0), to = match.index + match[0].length, k = i, p = pos; + for (let len = strarr.length; k < len && (p < to || !strarr[k].type && !strarr[k - 1].greedy); ++k) { + p += strarr[k].length; + if (from >= p) { + ++i; + pos = p; + } + } + if (strarr[i] instanceof Token) { + continue; + } + delNum = k - i; + str = text.slice(pos, p); + match.index -= pos; + } else { + pattern.lastIndex = 0; + var match = pattern.exec(str), delNum = 1; + } + if (!match) { + if (oneshot) { + break; + } + continue; + } + if (lookbehind) { + lookbehindLength = match[1] ? match[1].length : 0; + } + var from = match.index + lookbehindLength, match = match[0].slice(lookbehindLength), to = from + match.length, before = str.slice(0, from), after = str.slice(to); + const args = [i, delNum]; + if (before) { + ++i; + pos += before.length; + args.push(before); + } + const wrapped = new Token(token, inside ? Prism.tokenize(match, inside) : match, alias, match, greedy); + args.push(wrapped); + if (after) { + args.push(after); + } + Array.prototype.splice.apply(strarr, args); + if (delNum != 1) + Prism.matchGrammar(text, strarr, grammar, i, pos, true, token); + if (oneshot) + break; + } + } + } + }, + tokenize: function(text, grammar) { + const strarr = [text]; + const rest = grammar.rest; + if (rest) { + for (const token in rest) { + grammar[token] = rest[token]; + } + delete grammar.rest; + } + Prism.matchGrammar(text, strarr, grammar, 0, 0, false); + return strarr; + }, + hooks: { + all: {}, + add: function(name, callback) { + const hooks = Prism.hooks.all; + hooks[name] = hooks[name] || []; + hooks[name].push(callback); + }, + run: function(name, env2) { + const callbacks = Prism.hooks.all[name]; + if (!callbacks || !callbacks.length) { + return; + } + for (var i = 0, callback; callback = callbacks[i++]; ) { + callback(env2); + } + } + }, + Token +}; +Prism.languages.clike = { + comment: [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true + } + ], + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + "class-name": { + pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i, + lookbehind: true, + 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: /[{}[\];(),.:]/ +}; +Prism.languages.javascript = Prism.languages.extend("clike", { + "class-name": [ + Prism.languages.clike["class-name"], + { + pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/, + lookbehind: true + } + ], + keyword: [ + { + pattern: /((?:^|})\s*)(?:catch|finally)\b/, + lookbehind: true + }, + { + 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: true + } + ], + 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}/ +}); +Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/; +Prism.languages.insertBefore("javascript", "keyword", { + regex: { + pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/, + lookbehind: true, + greedy: true + }, + "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: true, + inside: Prism.languages.javascript + }, + { + pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i, + inside: Prism.languages.javascript + }, + { + pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/, + lookbehind: true, + inside: Prism.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: true, + inside: Prism.languages.javascript + } + ], + constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ +}); +if (Prism.languages.markup) { + Prism.languages.markup.tag.addInlined("script", "javascript"); +} +Prism.languages.js = Prism.languages.javascript; +Prism.languages.typescript = Prism.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/ +}); +Prism.languages.ts = Prism.languages.typescript; +function Token(type, content, alias, matchedStr, greedy) { + this.type = type; + this.content = content; + this.alias = alias; + this.length = (matchedStr || "").length | 0; + this.greedy = !!greedy; +} +__name(Token, "Token"); +Token.stringify = function(o, language) { + if (typeof o == "string") { + return o; + } + if (Array.isArray(o)) { + return o.map(function(element) { + return Token.stringify(element, language); + }).join(""); + } + return getColorForSyntaxKind(o.type)(o.content); +}; +function getColorForSyntaxKind(syntaxKind) { + return theme[syntaxKind] || identity; +} +__name(getColorForSyntaxKind, "getColorForSyntaxKind"); + +// src/runtime/highlight/highlight.ts +function highlightTS(str) { + return highlight(str, Prism.languages.javascript); +} +__name(highlightTS, "highlightTS"); +function highlight(str, grammar) { + const tokens = Prism.tokenize(str, grammar); + return tokens.map((t) => Token.stringify(t)).join(""); +} +__name(highlight, "highlight"); + +// src/runtime/utils/dedent.ts +var import_strip_indent2 = __toESM(require_strip_indent()); +function dedent2(str) { + return (0, import_strip_indent2.default)(str); +} +__name(dedent2, "dedent"); + +// src/runtime/utils/SourceFileSlice.ts +var SourceFileSlice = class { + static read(filePath) { + let content; + try { + content = import_fs8.default.readFileSync(filePath, "utf-8"); + } catch (e) { + return null; + } + return SourceFileSlice.fromContent(content); + } + static fromContent(content) { + const lines = content.split(/\r?\n/); + return new SourceFileSlice(1, lines); + } + constructor(firstLine, lines) { + this.firstLineNumber = firstLine; + this.lines = lines; + } + get lastLineNumber() { + return this.firstLineNumber + this.lines.length - 1; + } + mapLineAt(lineNumber, mapFn) { + if (lineNumber < this.firstLineNumber || lineNumber > this.lines.length + this.firstLineNumber) { + return this; + } + const idx = lineNumber - this.firstLineNumber; + const newLines = [...this.lines]; + newLines[idx] = mapFn(newLines[idx]); + return new SourceFileSlice(this.firstLineNumber, newLines); + } + mapLines(mapFn) { + return new SourceFileSlice( + this.firstLineNumber, + this.lines.map((line, i) => mapFn(line, this.firstLineNumber + i)) + ); + } + lineAt(lineNumber) { + return this.lines[lineNumber - this.firstLineNumber]; + } + prependSymbolAt(atLine, str) { + return this.mapLines((line, lineNumber) => { + if (lineNumber === atLine) { + return `${str} ${line}`; + } + return ` ${line}`; + }); + } + slice(fromLine, toLine) { + const slicedLines = this.lines.slice(fromLine - 1, toLine).join("\n"); + return new SourceFileSlice(fromLine, dedent2(slicedLines).split("\n")); + } + highlight() { + const highlighted = highlightTS(this.toString()); + return new SourceFileSlice(this.firstLineNumber, highlighted.split("\n")); + } + toString() { + return this.lines.join("\n"); + } +}; +__name(SourceFileSlice, "SourceFileSlice"); + +// src/runtime/utils/createErrorMessageWithContext.ts +var colorsEnabled = { + red: (str) => import_chalk9.default.red(str), + gray: (str) => import_chalk9.default.gray(str), + dim: (str) => import_chalk9.default.dim(str), + bold: (str) => import_chalk9.default.bold(str), + underline: (str) => import_chalk9.default.underline(str), + highlightSource: (source) => source.highlight() +}; +var colorsDisabled = { + red: (str) => str, + gray: (str) => str, + dim: (str) => str, + bold: (str) => str, + underline: (str) => str, + highlightSource: (source) => source +}; +function getTemplateParameters({ callsite, message, originalMethod, isPanic, callArguments }, colors) { + var _a3; + const templateParameters = { + functionName: `prisma.${originalMethod}()`, + message, + isPanic: isPanic != null ? isPanic : false, + callArguments + }; + if (!callsite || typeof window !== "undefined") { + return templateParameters; + } + if (process.env.NODE_ENV === "production") { + return templateParameters; + } + const callLocation = callsite.getLocation(); + if (!callLocation || !callLocation.lineNumber || !callLocation.columnNumber) { + return templateParameters; + } + const contextFirstLine = Math.max(1, callLocation.lineNumber - 3); + let source = (_a3 = SourceFileSlice.read(callLocation.fileName)) == null ? void 0 : _a3.slice(contextFirstLine, callLocation.lineNumber); + if (source) { + const invocationLine = source.lineAt(callLocation.lineNumber); + const invocationLineIndent = getIndent(invocationLine); + const invocationCallCode = findPrismaActionCall(invocationLine); + if (!invocationCallCode) { + return templateParameters; + } + templateParameters.functionName = `${invocationCallCode.code})`; + templateParameters.location = callLocation; + if (!isPanic) { + source = source.mapLineAt(callLocation.lineNumber, (line) => line.slice(0, invocationCallCode.openingBraceIndex)); + } + source = colors.highlightSource(source); + const numberColumnWidth = String(source.lastLineNumber).length; + templateParameters.contextLines = source.mapLines((line, lineNumber) => colors.gray(String(lineNumber).padStart(numberColumnWidth)) + " " + line).mapLines((line) => colors.dim(line)).prependSymbolAt(callLocation.lineNumber, colors.bold(colors.red("\u2192"))); + if (callArguments) { + let indentValue = invocationLineIndent + numberColumnWidth + 1; + indentValue += 2; + templateParameters.callArguments = (0, import_indent_string3.default)(callArguments, indentValue).slice(indentValue); + } + } + return templateParameters; +} +__name(getTemplateParameters, "getTemplateParameters"); +function findPrismaActionCall(str) { + const allActions = allClientModelActions.join("|"); + const regexp = new RegExp(String.raw`\S+(${allActions})\(`); + const match = regexp.exec(str); + if (match) { + return { + code: match[0], + openingBraceIndex: match.index + match[0].length + }; + } + return null; +} +__name(findPrismaActionCall, "findPrismaActionCall"); +function getIndent(line) { + let spaceCount = 0; + for (let i = 0; i < line.length; i++) { + if (line.charAt(i) !== " ") { + return spaceCount; + } + spaceCount++; + } + return spaceCount; +} +__name(getIndent, "getIndent"); +function stringifyErrorMessage({ functionName, location, message, isPanic, contextLines, callArguments }, colors) { + const lines = [""]; + const introSuffix = location ? " in" : ":"; + if (isPanic) { + lines.push(colors.red(`Oops, an unknown error occured! This is ${colors.bold("on us")}, you did nothing wrong.`)); + lines.push(colors.red(`It occured in the ${colors.bold(`\`${functionName}\``)} invocation${introSuffix}`)); + } else { + lines.push(colors.red(`Invalid ${colors.bold(`\`${functionName}\``)} invocation${introSuffix}`)); + } + if (location) { + lines.push(colors.underline(stringifyLocationInFile(location))); + } + if (contextLines) { + lines.push(""); + const contextLineParts = [contextLines.toString()]; + if (callArguments) { + contextLineParts.push(callArguments); + contextLineParts.push(colors.dim(")")); + } + lines.push(contextLineParts.join("")); + if (callArguments) { + lines.push(""); + } + } else { + lines.push(""); + if (callArguments) { + lines.push(callArguments); + } + lines.push(""); + } + lines.push(message); + return lines.join("\n"); +} +__name(stringifyErrorMessage, "stringifyErrorMessage"); +function stringifyLocationInFile(location) { + const parts = [location.fileName]; + if (location.lineNumber) { + parts.push(String(location.lineNumber)); + } + if (location.columnNumber) { + parts.push(String(location.columnNumber)); + } + return parts.join(":"); +} +__name(stringifyLocationInFile, "stringifyLocationInFile"); +function createErrorMessageWithContext(args) { + const colors = args.showColors ? colorsEnabled : colorsDisabled; + const templateParameters = getTemplateParameters(args, colors); + return stringifyErrorMessage(templateParameters, colors); +} +__name(createErrorMessageWithContext, "createErrorMessageWithContext"); + +// src/runtime/utils/deep-extend.ts +function isSpecificValue(val) { + return val instanceof Buffer || val instanceof Date || val instanceof RegExp ? true : false; +} +__name(isSpecificValue, "isSpecificValue"); +function cloneSpecificValue(val) { + if (val instanceof Buffer) { + const x = Buffer.alloc ? Buffer.alloc(val.length) : new Buffer(val.length); + val.copy(x); + return x; + } else if (val instanceof Date) { + return new Date(val.getTime()); + } else if (val instanceof RegExp) { + return new RegExp(val); + } else { + throw new Error("Unexpected situation"); + } +} +__name(cloneSpecificValue, "cloneSpecificValue"); +function deepCloneArray(arr) { + const clone2 = []; + arr.forEach(function(item, index) { + if (typeof item === "object" && item !== null) { + if (Array.isArray(item)) { + clone2[index] = deepCloneArray(item); + } else if (isSpecificValue(item)) { + clone2[index] = cloneSpecificValue(item); + } else { + clone2[index] = deepExtend({}, item); + } + } else { + clone2[index] = item; + } + }); + return clone2; +} +__name(deepCloneArray, "deepCloneArray"); +function safeGetProperty(object, property) { + return property === "__proto__" ? void 0 : object[property]; +} +__name(safeGetProperty, "safeGetProperty"); +var deepExtend = /* @__PURE__ */ __name(function(target, ...args) { + if (!target || typeof target !== "object") { + return false; + } + if (args.length === 0) { + return target; + } + let val, src; + for (const obj of args) { + if (typeof obj !== "object" || obj === null || Array.isArray(obj)) { + continue; + } + for (const key of Object.keys(obj)) { + src = safeGetProperty(target, key); + val = safeGetProperty(obj, key); + if (val === target) { + continue; + } else if (typeof val !== "object" || val === null) { + target[key] = val; + continue; + } else if (Array.isArray(val)) { + target[key] = deepCloneArray(val); + continue; + } else if (isSpecificValue(val)) { + target[key] = cloneSpecificValue(val); + continue; + } else if (typeof src !== "object" || src === null || Array.isArray(src)) { + target[key] = deepExtend({}, val); + continue; + } else { + target[key] = deepExtend(src, val); + continue; + } + } + } + return target; +}, "deepExtend"); + +// src/runtime/utils/deep-set.ts +var keys = /* @__PURE__ */ __name((ks) => Array.isArray(ks) ? ks : ks.split("."), "keys"); +var deepGet = /* @__PURE__ */ __name((o, kp) => keys(kp).reduce((o2, k) => o2 && o2[k], o), "deepGet"); +var deepSet = /* @__PURE__ */ __name((o, kp, v) => keys(kp).reduceRight((v2, k, i, ks) => Object.assign({}, deepGet(o, ks.slice(0, i)), { [k]: v2 }), v), "deepSet"); + +// src/runtime/utils/filterObject.ts +function filterObject(obj, cb) { + if (!obj || typeof obj !== "object" || typeof obj.hasOwnProperty !== "function") { + return obj; + } + const newObj = {}; + for (const key in obj) { + const value = obj[key]; + if (Object.hasOwnProperty.call(obj, key) && cb(key, value)) { + newObj[key] = value; + } + } + return newObj; +} +__name(filterObject, "filterObject"); + +// src/runtime/utils/flatMap.ts +function flatten(array) { + return Array.prototype.concat.apply([], array); +} +__name(flatten, "flatten"); +function flatMap(array, callbackFn, thisArg) { + return flatten(array.map(callbackFn, thisArg)); +} +__name(flatMap, "flatMap"); + +// src/runtime/utils/isObject.ts +var notReallyObjects = { + "[object Date]": true, + "[object Uint8Array]": true, + "[object Decimal]": true +}; +function isObject2(value) { + if (!value) { + return false; + } + return typeof value === "object" && !notReallyObjects[Object.prototype.toString.call(value)]; +} +__name(isObject2, "isObject"); + +// src/runtime/utils/omit.ts +function omit2(object, path7) { + const result = {}; + const paths = Array.isArray(path7) ? path7 : [path7]; + for (const key in object) { + if (Object.hasOwnProperty.call(object, key) && !paths.includes(key)) { + result[key] = object[key]; + } + } + return result; +} +__name(omit2, "omit"); + +// src/runtime/utils/printJsonErrors.ts +var import_chalk10 = __toESM(require_source()); +var import_strip_ansi2 = __toESM(require_strip_ansi()); + +// src/runtime/utils/stringifyObject.ts +var isRegexp = require_is_regexp(); +var isObj = require_is_obj(); +var getOwnEnumPropSymbols = require_lib().default; +var stringifyObject = /* @__PURE__ */ __name((input, options, pad) => { + const seen = []; + return (/* @__PURE__ */ __name(function stringifyObject2(input2, options2 = {}, pad2 = "", path7 = []) { + options2.indent = options2.indent || " "; + let tokens; + if (options2.inlineCharacterLimit === void 0) { + tokens = { + newLine: "\n", + newLineOrSpace: "\n", + pad: pad2, + indent: pad2 + options2.indent + }; + } else { + tokens = { + newLine: "@@__STRINGIFY_OBJECT_NEW_LINE__@@", + newLineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@", + pad: "@@__STRINGIFY_OBJECT_PAD__@@", + indent: "@@__STRINGIFY_OBJECT_INDENT__@@" + }; + } + const expandWhiteSpace = /* @__PURE__ */ __name((string) => { + if (options2.inlineCharacterLimit === void 0) { + return string; + } + const oneLined = string.replace(new RegExp(tokens.newLine, "g"), "").replace(new RegExp(tokens.newLineOrSpace, "g"), " ").replace(new RegExp(tokens.pad + "|" + tokens.indent, "g"), ""); + if (oneLined.length <= options2.inlineCharacterLimit) { + return oneLined; + } + return string.replace(new RegExp(tokens.newLine + "|" + tokens.newLineOrSpace, "g"), "\n").replace(new RegExp(tokens.pad, "g"), pad2).replace(new RegExp(tokens.indent, "g"), pad2 + options2.indent); + }, "expandWhiteSpace"); + if (seen.indexOf(input2) !== -1) { + return '"[Circular]"'; + } + if (Buffer.isBuffer(input2)) { + return `Buffer(${Buffer.length})`; + } + if (input2 === null || input2 === void 0 || typeof input2 === "number" || typeof input2 === "boolean" || typeof input2 === "function" || typeof input2 === "symbol" || input2 instanceof ObjectEnumValue || isRegexp(input2)) { + return String(input2); + } + if (input2 instanceof Date) { + return `new Date('${input2.toISOString()}')`; + } + if (input2 instanceof FieldRefImpl) { + return `prisma.${lowerCase(input2.modelName)}.fields.${input2.name}`; + } + if (Array.isArray(input2)) { + if (input2.length === 0) { + return "[]"; + } + seen.push(input2); + const ret = "[" + tokens.newLine + input2.map((el, i) => { + const eol = input2.length - 1 === i ? tokens.newLine : "," + tokens.newLineOrSpace; + let value = stringifyObject2(el, options2, pad2 + options2.indent, [...path7, i]); + if (options2.transformValue) { + value = options2.transformValue(input2, i, value); + } + return tokens.indent + value + eol; + }).join("") + tokens.pad + "]"; + seen.pop(); + return expandWhiteSpace(ret); + } + if (isObj(input2)) { + let objKeys = Object.keys(input2).concat(getOwnEnumPropSymbols(input2)); + if (options2.filter) { + objKeys = objKeys.filter((el) => options2.filter(input2, el)); + } + if (objKeys.length === 0) { + return "{}"; + } + seen.push(input2); + const ret = "{" + tokens.newLine + objKeys.map((el, i) => { + const eol = objKeys.length - 1 === i ? tokens.newLine : "," + tokens.newLineOrSpace; + const isSymbol = typeof el === "symbol"; + const isClassic = !isSymbol && /^[a-z$_][a-z$_0-9]*$/i.test(el); + const key = isSymbol || isClassic ? el : stringifyObject2(el, options2, void 0, [...path7, el]); + let value = stringifyObject2(input2[el], options2, pad2 + options2.indent, [...path7, el]); + if (options2.transformValue) { + value = options2.transformValue(input2, el, value); + } + let line = tokens.indent + String(key) + ": " + value + eol; + if (options2.transformLine) { + line = options2.transformLine({ + obj: input2, + indent: tokens.indent, + key, + stringifiedValue: value, + value: input2[el], + eol, + originalLine: line, + path: path7.concat(key) + }); + } + return line; + }).join("") + tokens.pad + "}"; + seen.pop(); + return expandWhiteSpace(ret); + } + input2 = String(input2).replace(/[\r\n]/g, (x) => x === "\n" ? "\\n" : "\\r"); + if (options2.singleQuotes === false) { + input2 = input2.replace(/"/g, '\\"'); + return `"${input2}"`; + } + input2 = input2.replace(/\\?'/g, "\\'"); + return `'${input2}'`; + }, "stringifyObject"))(input, options, pad); +}, "stringifyObject"); +var stringifyObject_default = stringifyObject; + +// src/runtime/utils/printJsonErrors.ts +var DIM_TOKEN = "@@__DIM_POINTER__@@"; +function printJsonWithErrors({ ast, keyPaths, valuePaths, missingItems }) { + let obj = ast; + for (const { path: path7, type } of missingItems) { + obj = deepSet(obj, path7, type); + } + return stringifyObject_default(obj, { + indent: " ", + transformLine: ({ indent: indent4, key, value, stringifiedValue, eol, path: path7 }) => { + const dottedPath = path7.join("."); + const keyError = keyPaths.includes(dottedPath); + const valueError = valuePaths.includes(dottedPath); + const missingItem = missingItems.find((item) => item.path === dottedPath); + let valueStr = stringifiedValue; + if (missingItem) { + if (typeof value === "string") { + valueStr = valueStr.slice(1, valueStr.length - 1); + } + const isRequiredStr = missingItem.isRequired ? "" : "?"; + const prefix = missingItem.isRequired ? "+" : "?"; + const color = missingItem.isRequired ? import_chalk10.default.greenBright : import_chalk10.default.green; + let output = color(prefixLines(key + isRequiredStr + ": " + valueStr + eol, indent4, prefix)); + if (!missingItem.isRequired) { + output = import_chalk10.default.dim(output); + } + return output; + } else { + const isOnMissingItemPath = missingItems.some((item) => dottedPath.startsWith(item.path)); + const isOptional = key[key.length - 2] === "?"; + if (isOptional) { + key = key.slice(1, key.length - 1); + } + if (isOptional && typeof value === "object" && value !== null) { + valueStr = valueStr.split("\n").map((line, index, arr) => index === arr.length - 1 ? line + DIM_TOKEN : line).join("\n"); + } + if (isOnMissingItemPath && typeof value === "string") { + valueStr = valueStr.slice(1, valueStr.length - 1); + if (!isOptional) { + valueStr = import_chalk10.default.bold(valueStr); + } + } + if ((typeof value !== "object" || value === null) && !valueError && !isOnMissingItemPath) { + valueStr = import_chalk10.default.dim(valueStr); + } + const keyStr = keyError ? import_chalk10.default.redBright(key) : key; + valueStr = valueError ? import_chalk10.default.redBright(valueStr) : valueStr; + let output = indent4 + keyStr + ": " + valueStr + (isOnMissingItemPath ? eol : import_chalk10.default.dim(eol)); + if (keyError || valueError) { + const lines = output.split("\n"); + const keyLength = String(key).length; + const keyScribbles = keyError ? import_chalk10.default.redBright("~".repeat(keyLength)) : " ".repeat(keyLength); + const valueLength = valueError ? getValueLength(indent4, key, value, stringifiedValue) : 0; + const hideValueScribbles = valueError && isRenderedAsObject(value); + const valueScribbles = valueError ? " " + import_chalk10.default.redBright("~".repeat(valueLength)) : ""; + if (keyScribbles && keyScribbles.length > 0 && !hideValueScribbles) { + lines.splice(1, 0, indent4 + keyScribbles + valueScribbles); + } + if (keyScribbles && keyScribbles.length > 0 && hideValueScribbles) { + lines.splice(lines.length - 1, 0, indent4.slice(0, indent4.length - 2) + valueScribbles); + } + output = lines.join("\n"); + } + return output; + } + } + }); +} +__name(printJsonWithErrors, "printJsonWithErrors"); +function getValueLength(indent4, key, value, stringifiedValue) { + if (value === null) { + return 4; + } + if (typeof value === "string") { + return value.length + 2; + } + if (isRenderedAsObject(value)) { + return Math.abs(getLongestLine(`${key}: ${(0, import_strip_ansi2.default)(stringifiedValue)}`) - indent4.length); + } + return String(value).length; +} +__name(getValueLength, "getValueLength"); +function isRenderedAsObject(value) { + return typeof value === "object" && value !== null && !(value instanceof ObjectEnumValue); +} +__name(isRenderedAsObject, "isRenderedAsObject"); +function getLongestLine(str) { + return str.split("\n").reduce((max2, curr) => curr.length > max2 ? curr.length : max2, 0); +} +__name(getLongestLine, "getLongestLine"); +function prefixLines(str, indent4, prefix) { + return str.split("\n").map( + (line, index, arr) => index === 0 ? prefix + indent4.slice(1) + line : index < arr.length - 1 ? prefix + line.slice(1) : line + ).map((line) => { + return (0, import_strip_ansi2.default)(line).includes(DIM_TOKEN) ? import_chalk10.default.dim(line.replace(DIM_TOKEN, "")) : line.includes("?") ? import_chalk10.default.dim(line) : line; + }).join("\n"); +} +__name(prefixLines, "prefixLines"); + +// src/runtime/query.ts +var tab = 2; +var Document = class { + constructor(type, children) { + this.type = type; + this.children = children; + this.printFieldError = /* @__PURE__ */ __name(({ error: error2 }, missingItems, minimal) => { + if (error2.type === "emptySelect") { + const additional = minimal ? "" : ` Available options are listed in ${import_chalk11.default.greenBright.dim("green")}.`; + return `The ${import_chalk11.default.redBright("`select`")} statement for type ${import_chalk11.default.bold( + getOutputTypeName(error2.field.outputType.type) + )} must not be empty.${additional}`; + } + if (error2.type === "emptyInclude") { + if (missingItems.length === 0) { + return `${import_chalk11.default.bold( + getOutputTypeName(error2.field.outputType.type) + )} does not have any relation and therefore can't have an ${import_chalk11.default.redBright("`include`")} statement.`; + } + const additional = minimal ? "" : ` Available options are listed in ${import_chalk11.default.greenBright.dim("green")}.`; + return `The ${import_chalk11.default.redBright("`include`")} statement for type ${import_chalk11.default.bold( + getOutputTypeName(error2.field.outputType.type) + )} must not be empty.${additional}`; + } + if (error2.type === "noTrueSelect") { + return `The ${import_chalk11.default.redBright("`select`")} statement for type ${import_chalk11.default.bold( + getOutputTypeName(error2.field.outputType.type) + )} needs ${import_chalk11.default.bold("at least one truthy value")}.`; + } + if (error2.type === "includeAndSelect") { + return `Please ${import_chalk11.default.bold("either")} use ${import_chalk11.default.greenBright("`include`")} or ${import_chalk11.default.greenBright( + "`select`" + )}, but ${import_chalk11.default.redBright("not both")} at the same time.`; + } + if (error2.type === "invalidFieldName") { + const statement = error2.isInclude ? "include" : "select"; + const wording = error2.isIncludeScalar ? "Invalid scalar" : "Unknown"; + const additional = minimal ? "" : error2.isInclude && missingItems.length === 0 ? ` +This model has no relations, so you can't use ${import_chalk11.default.redBright("include")} with it.` : ` Available options are listed in ${import_chalk11.default.greenBright.dim("green")}.`; + let str = `${wording} field ${import_chalk11.default.redBright(`\`${error2.providedName}\``)} for ${import_chalk11.default.bold( + statement + )} statement on model ${import_chalk11.default.bold.white(error2.modelName)}.${additional}`; + if (error2.didYouMean) { + str += ` Did you mean ${import_chalk11.default.greenBright(`\`${error2.didYouMean}\``)}?`; + } + if (error2.isIncludeScalar) { + str += ` +Note, that ${import_chalk11.default.bold("include")} statements only accept relation fields.`; + } + return str; + } + if (error2.type === "invalidFieldType") { + const str = `Invalid value ${import_chalk11.default.redBright( + `${stringifyObject_default(error2.providedValue)}` + )} of type ${import_chalk11.default.redBright(getGraphQLType(error2.providedValue, void 0))} for field ${import_chalk11.default.bold( + `${error2.fieldName}` + )} on model ${import_chalk11.default.bold.white(error2.modelName)}. Expected either ${import_chalk11.default.greenBright( + "true" + )} or ${import_chalk11.default.greenBright("false")}.`; + return str; + } + return void 0; + }, "printFieldError"); + this.printArgError = /* @__PURE__ */ __name(({ error: error2, path: path7, id }, hasMissingItems, minimal) => { + if (error2.type === "invalidName") { + let str = `Unknown arg ${import_chalk11.default.redBright(`\`${error2.providedName}\``)} in ${import_chalk11.default.bold( + path7.join(".") + )} for type ${import_chalk11.default.bold(error2.outputType ? error2.outputType.name : getInputTypeName(error2.originalType))}.`; + if (error2.didYouMeanField) { + str += ` +\u2192 Did you forget to wrap it with \`${import_chalk11.default.greenBright("select")}\`? ${import_chalk11.default.dim( + "e.g. " + import_chalk11.default.greenBright(`{ select: { ${error2.providedName}: ${error2.providedValue} } }`) + )}`; + } else if (error2.didYouMeanArg) { + str += ` Did you mean \`${import_chalk11.default.greenBright(error2.didYouMeanArg)}\`?`; + if (!hasMissingItems && !minimal) { + str += ` ${import_chalk11.default.dim("Available args:")} +` + stringifyInputType(error2.originalType, true); + } + } else { + if (error2.originalType.fields.length === 0) { + str += ` The field ${import_chalk11.default.bold(error2.originalType.name)} has no arguments.`; + } else if (!hasMissingItems && !minimal) { + str += ` Available args: + +` + stringifyInputType(error2.originalType, true); + } + } + return str; + } + if (error2.type === "invalidType") { + let valueStr = stringifyObject_default(error2.providedValue, { indent: " " }); + const multilineValue = valueStr.split("\n").length > 1; + if (multilineValue) { + valueStr = ` +${valueStr} +`; + } + if (error2.requiredType.bestFittingType.location === "enumTypes") { + return `Argument ${import_chalk11.default.bold(error2.argName)}: Provided value ${import_chalk11.default.redBright(valueStr)}${multilineValue ? "" : " "}of type ${import_chalk11.default.redBright(getGraphQLType(error2.providedValue))} on ${import_chalk11.default.bold( + `prisma.${this.children[0].name}` + )} is not a ${import_chalk11.default.greenBright( + wrapWithList( + stringifyGraphQLType(error2.requiredType.bestFittingType.type), + error2.requiredType.bestFittingType.isList + ) + )}. +\u2192 Possible values: ${error2.requiredType.bestFittingType.type.values.map((v) => import_chalk11.default.greenBright(`${stringifyGraphQLType(error2.requiredType.bestFittingType.type)}.${v}`)).join(", ")}`; + } + let typeStr = "."; + if (isInputArgType(error2.requiredType.bestFittingType.type)) { + typeStr = ":\n" + stringifyInputType(error2.requiredType.bestFittingType.type); + } + let expected = `${error2.requiredType.inputType.map( + (t) => import_chalk11.default.greenBright(wrapWithList(stringifyGraphQLType(t.type), error2.requiredType.bestFittingType.isList)) + ).join(" or ")}${typeStr}`; + const inputType = error2.requiredType.inputType.length === 2 && error2.requiredType.inputType.find((t) => isInputArgType(t.type)) || null; + if (inputType) { + expected += ` +` + stringifyInputType(inputType.type, true); + } + return `Argument ${import_chalk11.default.bold(error2.argName)}: Got invalid value ${import_chalk11.default.redBright(valueStr)}${multilineValue ? "" : " "}on ${import_chalk11.default.bold(`prisma.${this.children[0].name}`)}. Provided ${import_chalk11.default.redBright( + getGraphQLType(error2.providedValue) + )}, expected ${expected}`; + } + if (error2.type === "invalidNullArg") { + const forStr = path7.length === 1 && path7[0] === error2.name ? "" : ` for ${import_chalk11.default.bold(`${path7.join(".")}`)}`; + const undefinedTip = ` Please use ${import_chalk11.default.bold.greenBright("undefined")} instead.`; + return `Argument ${import_chalk11.default.greenBright(error2.name)}${forStr} must not be ${import_chalk11.default.bold("null")}.${undefinedTip}`; + } + if (error2.type === "missingArg") { + const forStr = path7.length === 1 && path7[0] === error2.missingName ? "" : ` for ${import_chalk11.default.bold(`${path7.join(".")}`)}`; + return `Argument ${import_chalk11.default.greenBright(error2.missingName)}${forStr} is missing.`; + } + if (error2.type === "atLeastOne") { + const additional = minimal ? "" : ` Available args are listed in ${import_chalk11.default.dim.green("green")}.`; + return `Argument ${import_chalk11.default.bold(path7.join("."))} of type ${import_chalk11.default.bold( + error2.inputType.name + )} needs ${import_chalk11.default.greenBright("at least one")} argument.${additional}`; + } + if (error2.type === "atMostOne") { + const additional = minimal ? "" : ` Please choose one. ${import_chalk11.default.dim("Available args:")} +${stringifyInputType(error2.inputType, true)}`; + return `Argument ${import_chalk11.default.bold(path7.join("."))} of type ${import_chalk11.default.bold( + error2.inputType.name + )} needs ${import_chalk11.default.greenBright("exactly one")} argument, but you provided ${error2.providedKeys.map((key) => import_chalk11.default.redBright(key)).join(" and ")}.${additional}`; + } + return void 0; + }, "printArgError"); + this.type = type; + this.children = children; + } + get [Symbol.toStringTag]() { + return "Document"; + } + toString() { + return `${this.type} { +${(0, import_indent_string4.default)(this.children.map(String).join("\n"), tab)} +}`; + } + validate(select, isTopLevelQuery = false, originalMethod, errorFormat, validationCallsite) { + var _a3; + if (!select) { + select = {}; + } + const invalidChildren = this.children.filter((child) => child.hasInvalidChild || child.hasInvalidArg); + if (invalidChildren.length === 0) { + return; + } + const fieldErrors = []; + const argErrors = []; + const prefix = select && select.select ? "select" : select.include ? "include" : void 0; + for (const child of invalidChildren) { + const errors = child.collectErrors(prefix); + fieldErrors.push( + ...errors.fieldErrors.map((e) => ({ + ...e, + path: isTopLevelQuery ? e.path : e.path.slice(1) + })) + ); + argErrors.push( + ...errors.argErrors.map((e) => ({ + ...e, + path: isTopLevelQuery ? e.path : e.path.slice(1) + })) + ); + } + const topLevelQueryName = this.children[0].name; + const queryName = isTopLevelQuery ? this.type : topLevelQueryName; + const keyPaths = []; + const valuePaths = []; + const missingItems = []; + for (const fieldError of fieldErrors) { + const path7 = this.normalizePath(fieldError.path, select).join("."); + if (fieldError.error.type === "invalidFieldName") { + keyPaths.push(path7); + const fieldType = fieldError.error.outputType; + const { isInclude } = fieldError.error; + fieldType.fields.filter((field) => isInclude ? field.outputType.location === "outputObjectTypes" : true).forEach((field) => { + const splittedPath = path7.split("."); + missingItems.push({ + path: `${splittedPath.slice(0, splittedPath.length - 1).join(".")}.${field.name}`, + type: "true", + isRequired: false + }); + }); + } else if (fieldError.error.type === "includeAndSelect") { + keyPaths.push("select"); + keyPaths.push("include"); + } else { + valuePaths.push(path7); + } + if (fieldError.error.type === "emptySelect" || fieldError.error.type === "noTrueSelect" || fieldError.error.type === "emptyInclude") { + const selectPathArray = this.normalizePath(fieldError.path, select); + const selectPath = selectPathArray.slice(0, selectPathArray.length - 1).join("."); + const fieldType = fieldError.error.field.outputType.type; + (_a3 = fieldType.fields) == null ? void 0 : _a3.filter( + (field) => fieldError.error.type === "emptyInclude" ? field.outputType.location === "outputObjectTypes" : true + ).forEach((field) => { + missingItems.push({ + path: `${selectPath}.${field.name}`, + type: "true", + isRequired: false + }); + }); + } + } + for (const argError of argErrors) { + const path7 = this.normalizePath(argError.path, select).join("."); + if (argError.error.type === "invalidName") { + keyPaths.push(path7); + } else if (argError.error.type !== "missingArg" && argError.error.type !== "atLeastOne") { + valuePaths.push(path7); + } else if (argError.error.type === "missingArg") { + const type = argError.error.missingArg.inputTypes.length === 1 ? argError.error.missingArg.inputTypes[0].type : argError.error.missingArg.inputTypes.map((t) => { + const inputTypeName = getInputTypeName(t.type); + if (inputTypeName === "Null") { + return "null"; + } + if (t.isList) { + return inputTypeName + "[]"; + } + return inputTypeName; + }).join(" | "); + missingItems.push({ + path: path7, + type: inputTypeToJson(type, true, path7.split("where.").length === 2), + isRequired: argError.error.missingArg.isRequired + }); + } + } + const renderErrorStr = /* @__PURE__ */ __name((callsite) => { + const hasRequiredMissingArgsErrors = argErrors.some( + (e) => e.error.type === "missingArg" && e.error.missingArg.isRequired + ); + const hasOptionalMissingArgsErrors = Boolean( + argErrors.find((e) => e.error.type === "missingArg" && !e.error.missingArg.isRequired) + ); + const hasMissingArgsErrors = hasOptionalMissingArgsErrors || hasRequiredMissingArgsErrors; + let missingArgsLegend = ""; + if (hasRequiredMissingArgsErrors) { + missingArgsLegend += ` +${import_chalk11.default.dim("Note: Lines with ")}${import_chalk11.default.reset.greenBright("+")} ${import_chalk11.default.dim( + "are required" + )}`; + } + if (hasOptionalMissingArgsErrors) { + if (missingArgsLegend.length === 0) { + missingArgsLegend = "\n"; + } + if (hasRequiredMissingArgsErrors) { + missingArgsLegend += import_chalk11.default.dim(`, lines with ${import_chalk11.default.green("?")} are optional`); + } else { + missingArgsLegend += import_chalk11.default.dim(`Note: Lines with ${import_chalk11.default.green("?")} are optional`); + } + missingArgsLegend += import_chalk11.default.dim("."); + } + const relevantArgErrors = argErrors.filter((e) => e.error.type !== "missingArg" || e.error.missingArg.isRequired); + let errorMessages = relevantArgErrors.map((e) => this.printArgError(e, hasMissingArgsErrors, errorFormat === "minimal")).join("\n"); + errorMessages += ` +${fieldErrors.map((e) => this.printFieldError(e, missingItems, errorFormat === "minimal")).join("\n")}`; + if (errorFormat === "minimal") { + return (0, import_strip_ansi3.default)(errorMessages); + } + let printJsonArgs = { + ast: isTopLevelQuery ? { [topLevelQueryName]: select } : select, + keyPaths, + valuePaths, + missingItems + }; + if (originalMethod == null ? void 0 : originalMethod.endsWith("aggregate")) { + printJsonArgs = transformAggregatePrintJsonArgs(printJsonArgs); + } + const errorStr = createErrorMessageWithContext({ + callsite, + originalMethod: originalMethod || queryName, + showColors: errorFormat && errorFormat === "pretty", + callArguments: printJsonWithErrors(printJsonArgs), + message: `${errorMessages}${missingArgsLegend} +` + }); + if (process.env.NO_COLOR || errorFormat === "colorless") { + return (0, import_strip_ansi3.default)(errorStr); + } + return errorStr; + }, "renderErrorStr"); + const error2 = new PrismaClientValidationError(renderErrorStr(validationCallsite)); + if (process.env.NODE_ENV !== "production") { + Object.defineProperty(error2, "render", { + get: () => renderErrorStr, + enumerable: false + }); + } + throw error2; + } + normalizePath(inputPath, select) { + const path7 = inputPath.slice(); + const newPath = []; + let key; + let pointer = select; + while ((key = path7.shift()) !== void 0) { + if (!Array.isArray(pointer) && key === 0) { + continue; + } + if (key === "select") { + if (!pointer[key]) { + pointer = pointer.include; + } else { + pointer = pointer[key]; + } + } else if (pointer && pointer[key]) { + pointer = pointer[key]; + } + newPath.push(key); + } + return newPath; + } +}; +__name(Document, "Document"); +var PrismaClientValidationError = class extends Error { + get [Symbol.toStringTag]() { + return "PrismaClientValidationError"; + } +}; +__name(PrismaClientValidationError, "PrismaClientValidationError"); +var PrismaClientConstructorValidationError = class extends Error { + constructor(message) { + super(message + ` +Read more at https://pris.ly/d/client-constructor`); + } + get [Symbol.toStringTag]() { + return "PrismaClientConstructorValidationError"; + } +}; +__name(PrismaClientConstructorValidationError, "PrismaClientConstructorValidationError"); +var Field = class { + constructor({ name, args, children, error: error2, schemaField }) { + this.name = name; + this.args = args; + this.children = children; + this.error = error2; + this.schemaField = schemaField; + this.hasInvalidChild = children ? children.some((child) => Boolean(child.error || child.hasInvalidArg || child.hasInvalidChild)) : false; + this.hasInvalidArg = args ? args.hasInvalidArg : false; + } + get [Symbol.toStringTag]() { + return "Field"; + } + toString() { + let str = this.name; + if (this.error) { + return str + " # INVALID_FIELD"; + } + if (this.args && this.args.args && this.args.args.length > 0) { + if (this.args.args.length === 1) { + str += `(${this.args.toString()})`; + } else { + str += `( +${(0, import_indent_string4.default)(this.args.toString(), tab)} +)`; + } + } + if (this.children) { + str += ` { +${(0, import_indent_string4.default)(this.children.map(String).join("\n"), tab)} +}`; + } + return str; + } + collectErrors(prefix = "select") { + const fieldErrors = []; + const argErrors = []; + if (this.error) { + fieldErrors.push({ + path: [this.name], + error: this.error + }); + } + if (this.children) { + for (const child of this.children) { + const errors = child.collectErrors(prefix); + fieldErrors.push( + ...errors.fieldErrors.map((e) => ({ + ...e, + path: [this.name, prefix, ...e.path] + })) + ); + argErrors.push( + ...errors.argErrors.map((e) => ({ + ...e, + path: [this.name, prefix, ...e.path] + })) + ); + } + } + if (this.args) { + argErrors.push(...this.args.collectErrors().map((e) => ({ ...e, path: [this.name, ...e.path] }))); + } + return { + fieldErrors, + argErrors + }; + } +}; +__name(Field, "Field"); +var Args = class { + constructor(args = []) { + this.args = args; + this.hasInvalidArg = args ? args.some((arg2) => Boolean(arg2.hasError)) : false; + } + get [Symbol.toStringTag]() { + return "Args"; + } + toString() { + if (this.args.length === 0) { + return ""; + } + return `${this.args.map((arg2) => arg2.toString()).filter((a) => a).join("\n")}`; + } + collectErrors() { + if (!this.hasInvalidArg) { + return []; + } + return flatMap(this.args, (arg2) => arg2.collectErrors()); + } +}; +__name(Args, "Args"); +function stringify(value, inputType) { + if (Buffer.isBuffer(value)) { + return JSON.stringify(value.toString("base64")); + } + if (value instanceof FieldRefImpl) { + return `{ _ref: ${JSON.stringify(value.name)}}`; + } + if (Object.prototype.toString.call(value) === "[object BigInt]") { + return value.toString(); + } + if (typeof (inputType == null ? void 0 : inputType.type) === "string" && inputType.type === "Json") { + if (value === null) { + return "null"; + } + if (value && value.values && value.__prismaRawParamaters__) { + return JSON.stringify(value.values); + } + if ((inputType == null ? void 0 : inputType.isList) && Array.isArray(value)) { + return JSON.stringify(value.map((o) => JSON.stringify(o))); + } + return JSON.stringify(JSON.stringify(value)); + } + if (value === void 0) { + return null; + } + if (value === null) { + return "null"; + } + if (decimal_default.isDecimal(value) || (inputType == null ? void 0 : inputType.type) === "Decimal" && isDecimalJsLike(value)) { + return stringifyDecimalJsLike(value); + } + if ((inputType == null ? void 0 : inputType.location) === "enumTypes" && typeof value === "string") { + if (Array.isArray(value)) { + return `[${value.join(", ")}]`; + } + return value; + } + return JSON.stringify(value, null, 2); +} +__name(stringify, "stringify"); +var Arg2 = class { + constructor({ key, value, isEnum = false, error: error2, schemaArg, inputType }) { + this.inputType = inputType; + this.key = key; + this.value = value instanceof ObjectEnumValue ? value._getName() : value; + this.isEnum = isEnum; + this.error = error2; + this.schemaArg = schemaArg; + this.isNullable = (schemaArg == null ? void 0 : schemaArg.inputTypes.reduce((isNullable) => isNullable && schemaArg.isNullable, true)) || false; + this.hasError = Boolean(error2) || (value instanceof Args ? value.hasInvalidArg : false) || Array.isArray(value) && value.some((v) => v instanceof Args ? v.hasInvalidArg : false); + } + get [Symbol.toStringTag]() { + return "Arg"; + } + _toString(value, key) { + var _a3; + if (typeof value === "undefined") { + return void 0; + } + if (value instanceof Args) { + return `${key}: { +${(0, import_indent_string4.default)(value.toString(), 2)} +}`; + } + if (Array.isArray(value)) { + if (((_a3 = this.inputType) == null ? void 0 : _a3.type) === "Json") { + return `${key}: ${stringify(value, this.inputType)}`; + } + const isScalar = !value.some((v) => typeof v === "object"); + return `${key}: [${isScalar ? "" : "\n"}${(0, import_indent_string4.default)( + value.map((nestedValue) => { + if (nestedValue instanceof Args) { + return `{ +${(0, import_indent_string4.default)(nestedValue.toString(), tab)} +}`; + } + return stringify(nestedValue, this.inputType); + }).join(`,${isScalar ? " " : "\n"}`), + isScalar ? 0 : tab + )}${isScalar ? "" : "\n"}]`; + } + return `${key}: ${stringify(value, this.inputType)}`; + } + toString() { + return this._toString(this.value, this.key); + } + collectErrors() { + var _a3; + if (!this.hasError) { + return []; + } + const errors = []; + if (this.error) { + const id = typeof ((_a3 = this.inputType) == null ? void 0 : _a3.type) === "object" ? `${this.inputType.type.name}${this.inputType.isList ? "[]" : ""}` : void 0; + errors.push({ + error: this.error, + path: [this.key], + id + }); + } + if (Array.isArray(this.value)) { + errors.push( + ...flatMap(this.value, (val, index) => { + if (!(val == null ? void 0 : val.collectErrors)) { + return []; + } + return val.collectErrors().map((e) => { + return { ...e, path: [this.key, index, ...e.path] }; + }); + }) + ); + } + if (this.value instanceof Args) { + errors.push(...this.value.collectErrors().map((e) => ({ ...e, path: [this.key, ...e.path] }))); + } + return errors; + } +}; +__name(Arg2, "Arg"); +function makeDocument({ dmmf, rootTypeName, rootField, select, modelName }) { + if (!select) { + select = {}; + } + const rootType = rootTypeName === "query" ? dmmf.queryType : dmmf.mutationType; + const fakeRootField = { + args: [], + outputType: { + isList: false, + type: rootType, + location: "outputObjectTypes" + }, + name: rootTypeName + }; + const context3 = { + modelName + }; + const children = selectionToFields(dmmf, { [rootField]: select }, fakeRootField, [rootTypeName], context3); + return new Document(rootTypeName, children); +} +__name(makeDocument, "makeDocument"); +function transformDocument(document2) { + return document2; +} +__name(transformDocument, "transformDocument"); +function selectionToFields(dmmf, selection, schemaField, path7, context3) { + const outputType = schemaField.outputType.type; + return Object.entries(selection).reduce((acc, [name, value]) => { + const field = outputType.fieldMap ? outputType.fieldMap[name] : outputType.fields.find((f) => f.name === name); + if (!field) { + acc.push( + new Field({ + name, + children: [], + error: { + type: "invalidFieldName", + modelName: outputType.name, + providedName: name, + didYouMean: getSuggestion( + name, + outputType.fields.map((f) => f.name) + ), + outputType + } + }) + ); + return acc; + } + if (field.outputType.location === "scalar" && field.args.length === 0 && typeof value !== "boolean") { + acc.push( + new Field({ + name, + children: [], + error: { + type: "invalidFieldType", + modelName: outputType.name, + fieldName: name, + providedValue: value + } + }) + ); + return acc; + } + if (value === false) { + return acc; + } + const transformedField = { + name: field.name, + fields: field.args, + constraints: { + minNumFields: null, + maxNumFields: null + } + }; + const argsWithoutIncludeAndSelect = typeof value === "object" ? omit2(value, ["include", "select"]) : void 0; + const args = argsWithoutIncludeAndSelect ? objectToArgs( + argsWithoutIncludeAndSelect, + transformedField, + context3, + [], + typeof field === "string" ? void 0 : field.outputType.type + ) : void 0; + const isRelation = field.outputType.location === "outputObjectTypes"; + if (value) { + if (value.select && value.include) { + acc.push( + new Field({ + name, + children: [ + new Field({ + name: "include", + args: new Args(), + error: { + type: "includeAndSelect", + field + } + }) + ] + }) + ); + } else if (value.include) { + const keys2 = Object.keys(value.include); + if (keys2.length === 0) { + acc.push( + new Field({ + name, + children: [ + new Field({ + name: "include", + args: new Args(), + error: { + type: "emptyInclude", + field + } + }) + ] + }) + ); + return acc; + } + if (field.outputType.location === "outputObjectTypes") { + const fieldOutputType = field.outputType.type; + const allowedKeys = fieldOutputType.fields.filter((f) => f.outputType.location === "outputObjectTypes").map((f) => f.name); + const invalidKeys = keys2.filter((key) => !allowedKeys.includes(key)); + if (invalidKeys.length > 0) { + acc.push( + ...invalidKeys.map( + (invalidKey) => new Field({ + name: invalidKey, + children: [ + new Field({ + name: invalidKey, + args: new Args(), + error: { + type: "invalidFieldName", + modelName: fieldOutputType.name, + outputType: fieldOutputType, + providedName: invalidKey, + didYouMean: getSuggestion(invalidKey, allowedKeys) || void 0, + isInclude: true, + isIncludeScalar: fieldOutputType.fields.some((f) => f.name === invalidKey) + } + }) + ] + }) + ) + ); + return acc; + } + } + } else if (value.select) { + const values = Object.values(value.select); + if (values.length === 0) { + acc.push( + new Field({ + name, + children: [ + new Field({ + name: "select", + args: new Args(), + error: { + type: "emptySelect", + field + } + }) + ] + }) + ); + return acc; + } + const truthyValues = values.filter((v) => v); + if (truthyValues.length === 0) { + acc.push( + new Field({ + name, + children: [ + new Field({ + name: "select", + args: new Args(), + error: { + type: "noTrueSelect", + field + } + }) + ] + }) + ); + return acc; + } + } + } + const defaultSelection = isRelation ? getDefaultSelection(dmmf, field.outputType.type) : null; + let select = defaultSelection; + if (value) { + if (value.select) { + select = value.select; + } else if (value.include) { + select = deepExtend(defaultSelection, value.include); + } else if (value.by && Array.isArray(value.by) && field.outputType.namespace === "prisma" && field.outputType.location === "outputObjectTypes" && isGroupByOutputName(field.outputType.type.name)) { + select = byToSelect(value.by); + } + } + const children = select !== false && isRelation ? selectionToFields(dmmf, select, field, [...path7, name], context3) : void 0; + acc.push(new Field({ name, args, children, schemaField: field })); + return acc; + }, []); +} +__name(selectionToFields, "selectionToFields"); +function byToSelect(by) { + const obj = /* @__PURE__ */ Object.create(null); + for (const b of by) { + obj[b] = true; + } + return obj; +} +__name(byToSelect, "byToSelect"); +function getDefaultSelection(dmmf, outputType) { + const acc = /* @__PURE__ */ Object.create(null); + for (const f of outputType.fields) { + if (dmmf.typeMap[f.outputType.type.name] !== void 0) { + acc[f.name] = true; + } + if (f.outputType.location === "scalar" || f.outputType.location === "enumTypes") { + acc[f.name] = true; + } + } + return acc; +} +__name(getDefaultSelection, "getDefaultSelection"); +function getInvalidTypeArg(key, value, arg2, bestFittingType) { + const arrg = new Arg2({ + key, + value, + isEnum: bestFittingType.location === "enumTypes", + inputType: bestFittingType, + error: { + type: "invalidType", + providedValue: value, + argName: key, + requiredType: { + inputType: arg2.inputTypes, + bestFittingType + } + } + }); + return arrg; +} +__name(getInvalidTypeArg, "getInvalidTypeArg"); +function hasCorrectScalarType(value, inputType, context3) { + const { isList } = inputType; + const expectedType = getExpectedType(inputType, context3); + const graphQLType = getGraphQLType(value, inputType); + if (graphQLType === expectedType) { + return true; + } + if (isList && graphQLType === "List<>") { + return true; + } + if (expectedType === "Json" && graphQLType !== "Symbol" && !(value instanceof ObjectEnumValue) && !(value instanceof FieldRefImpl)) { + return true; + } + if (graphQLType === "Int" && expectedType === "BigInt") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if ((graphQLType === "Int" || graphQLType === "Float") && expectedType === "Decimal") { + return true; + } + if (isValidDecimalListInput(graphQLType, value) && expectedType === "List") { + return true; + } + if (graphQLType === "DateTime" && expectedType === "String") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if (graphQLType === "UUID" && expectedType === "String") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if (graphQLType === "String" && expectedType === "ID") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if (expectedType === "List" && (graphQLType === "List" || graphQLType === "List")) { + return true; + } + if (graphQLType === "Int" && expectedType === "Float") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if (graphQLType === "Int" && expectedType === "Long") { + return true; + } + if (graphQLType === "List" && expectedType === "List") { + return true; + } + if (graphQLType === "String" && expectedType === "Decimal" && isDecimalString(value)) { + return true; + } + if (value === null) { + return true; + } + return false; +} +__name(hasCorrectScalarType, "hasCorrectScalarType"); +function getExpectedType(inputType, context3, isList = inputType.isList) { + let type = stringifyGraphQLType(inputType.type); + if (inputType.location === "fieldRefTypes" && context3.modelName) { + type += `<${context3.modelName}>`; + } + return wrapWithList(type, isList); +} +__name(getExpectedType, "getExpectedType"); +var cleanObject = /* @__PURE__ */ __name((obj) => filterObject(obj, (k, v) => v !== void 0), "cleanObject"); +function isValidDecimalListInput(graphQLType, value) { + return graphQLType === "List" || graphQLType === "List" || graphQLType === "List" && value.every(isDecimalString); +} +__name(isValidDecimalListInput, "isValidDecimalListInput"); +function isDecimalString(value) { + return /^\-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i.test(value); +} +__name(isDecimalString, "isDecimalString"); +function valueToArg(key, value, arg2, context3) { + let maybeArg = null; + const argsWithErrors = []; + for (const inputType of arg2.inputTypes) { + maybeArg = tryInferArgs(key, value, arg2, inputType, context3); + if ((maybeArg == null ? void 0 : maybeArg.collectErrors().length) === 0) { + return maybeArg; + } + if (maybeArg && (maybeArg == null ? void 0 : maybeArg.collectErrors())) { + const argErrors = maybeArg == null ? void 0 : maybeArg.collectErrors(); + if (argErrors && argErrors.length > 0) { + argsWithErrors.push({ arg: maybeArg, errors: argErrors }); + } + } + } + if ((maybeArg == null ? void 0 : maybeArg.hasError) && argsWithErrors.length > 0) { + const argsWithScores = argsWithErrors.map(({ arg: arg3, errors }) => { + const errorScores = errors.map((e) => { + let score = 1; + if (e.error.type === "invalidType") { + score = 2 * Math.exp(getDepth(e.error.providedValue)) + 1; + } + score += Math.log(e.path.length); + if (e.error.type === "missingArg") { + if (arg3.inputType && isInputArgType(arg3.inputType.type) && arg3.inputType.type.name.includes("Unchecked")) { + score *= 2; + } + } + if (e.error.type === "invalidName") { + if (isInputArgType(e.error.originalType)) { + if (e.error.originalType.name.includes("Unchecked")) { + score *= 2; + } + } + } + return score; + }); + return { + score: errors.length + sum2(errorScores), + arg: arg3, + errors + }; + }); + argsWithScores.sort((a, b) => a.score < b.score ? -1 : 1); + return argsWithScores[0].arg; + } + return maybeArg; +} +__name(valueToArg, "valueToArg"); +function getDepth(object) { + let level = 1; + if (!object || typeof object !== "object") { + return level; + } + for (const key in object) { + if (!Object.prototype.hasOwnProperty.call(object, key)) { + continue; + } + if (typeof object[key] === "object") { + const depth = getDepth(object[key]) + 1; + level = Math.max(depth, level); + } + } + return level; +} +__name(getDepth, "getDepth"); +function sum2(n) { + return n.reduce((acc, curr) => acc + curr, 0); +} +__name(sum2, "sum"); +function tryInferArgs(key, value, arg2, inputType, context3) { + var _a3, _b2, _c, _d; + if (typeof value === "undefined") { + if (!arg2.isRequired) { + return null; + } + return new Arg2({ + key, + value, + isEnum: inputType.location === "enumTypes", + inputType, + error: { + type: "missingArg", + missingName: key, + missingArg: arg2, + atLeastOne: false, + atMostOne: false + } + }); + } + const { isNullable, isRequired } = arg2; + if (value === null && !isNullable && !isRequired) { + const isAtLeastOne = isInputArgType(inputType.type) ? inputType.type.constraints.minNumFields !== null && inputType.type.constraints.minNumFields > 0 : false; + if (!isAtLeastOne) { + return new Arg2({ + key, + value, + isEnum: inputType.location === "enumTypes", + inputType, + error: { + type: "invalidNullArg", + name: key, + invalidType: arg2.inputTypes, + atLeastOne: false, + atMostOne: false + } + }); + } + } + if (!inputType.isList) { + if (isInputArgType(inputType.type)) { + if (typeof value !== "object" || Array.isArray(value) || inputType.location === "inputObjectTypes" && !isObject2(value)) { + return getInvalidTypeArg(key, value, arg2, inputType); + } else { + const val = cleanObject(value); + let error2; + const keys2 = Object.keys(val || {}); + const numKeys = keys2.length; + if (numKeys === 0 && typeof inputType.type.constraints.minNumFields === "number" && inputType.type.constraints.minNumFields > 0) { + error2 = { + type: "atLeastOne", + key, + inputType: inputType.type + }; + } else if (numKeys > 1 && typeof inputType.type.constraints.maxNumFields === "number" && inputType.type.constraints.maxNumFields < 2) { + error2 = { + type: "atMostOne", + key, + inputType: inputType.type, + providedKeys: keys2 + }; + } + return new Arg2({ + key, + value: val === null ? null : objectToArgs(val, inputType.type, context3, arg2.inputTypes), + isEnum: inputType.location === "enumTypes", + error: error2, + inputType, + schemaArg: arg2 + }); + } + } else { + return scalarToArg(key, value, arg2, inputType, context3); + } + } + if (!Array.isArray(value) && inputType.isList) { + if (key !== "updateMany") { + value = [value]; + } + } + if (inputType.location === "enumTypes" || inputType.location === "scalar") { + return scalarToArg(key, value, arg2, inputType, context3); + } + const argInputType = inputType.type; + const hasAtLeastOneError = typeof ((_a3 = argInputType.constraints) == null ? void 0 : _a3.minNumFields) === "number" && ((_b2 = argInputType.constraints) == null ? void 0 : _b2.minNumFields) > 0 ? Array.isArray(value) && value.some((v) => !v || Object.keys(cleanObject(v)).length === 0) : false; + let err = hasAtLeastOneError ? { + inputType: argInputType, + key, + type: "atLeastOne" + } : void 0; + if (!err) { + const hasOneOfError = typeof ((_c = argInputType.constraints) == null ? void 0 : _c.maxNumFields) === "number" && ((_d = argInputType.constraints) == null ? void 0 : _d.maxNumFields) < 2 ? Array.isArray(value) && value.find((v) => !v || Object.keys(cleanObject(v)).length !== 1) : false; + if (hasOneOfError) { + err = { + inputType: argInputType, + key, + type: "atMostOne", + providedKeys: Object.keys(hasOneOfError) + }; + } + } + if (!Array.isArray(value)) { + for (const nestedArgInputType of arg2.inputTypes) { + const args = objectToArgs(value, nestedArgInputType.type, context3); + if (args.collectErrors().length === 0) { + return new Arg2({ + key, + value: args, + isEnum: false, + schemaArg: arg2, + inputType: nestedArgInputType + }); + } + } + } + return new Arg2({ + key, + value: value.map((v) => { + if (inputType.isList && typeof v !== "object") { + return v; + } + if (typeof v !== "object" || !value) { + return getInvalidTypeArg(key, v, arg2, inputType); + } + return objectToArgs(v, argInputType, context3); + }), + isEnum: false, + inputType, + schemaArg: arg2, + error: err + }); +} +__name(tryInferArgs, "tryInferArgs"); +function isInputArgType(argType) { + if (typeof argType === "string") { + return false; + } + if (Object.hasOwnProperty.call(argType, "values")) { + return false; + } + return true; +} +__name(isInputArgType, "isInputArgType"); +function scalarToArg(key, value, arg2, inputType, context3) { + if (hasCorrectScalarType(value, inputType, context3)) { + return new Arg2({ + key, + value, + isEnum: inputType.location === "enumTypes", + schemaArg: arg2, + inputType + }); + } + return getInvalidTypeArg(key, value, arg2, inputType); +} +__name(scalarToArg, "scalarToArg"); +function objectToArgs(initialObj, inputType, context3, possibilities, outputType) { + var _a3; + if ((_a3 = inputType.meta) == null ? void 0 : _a3.source) { + context3 = { modelName: inputType.meta.source }; + } + const obj = cleanObject(initialObj); + const { fields: args, fieldMap } = inputType; + const requiredArgs = args.map((arg2) => [arg2.name, void 0]); + const objEntries = Object.entries(obj || {}); + const entries = unionBy(objEntries, requiredArgs, (a) => a[0]); + const argsList = entries.reduce((acc, [argName, value]) => { + const schemaArg = fieldMap ? fieldMap[argName] : args.find((a) => a.name === argName); + if (!schemaArg) { + const didYouMeanField = typeof value === "boolean" && outputType && outputType.fields.some((f) => f.name === argName) ? argName : null; + acc.push( + new Arg2({ + key: argName, + value, + error: { + type: "invalidName", + providedName: argName, + providedValue: value, + didYouMeanField, + didYouMeanArg: !didYouMeanField && getSuggestion(argName, [...args.map((a) => a.name), "select"]) || void 0, + originalType: inputType, + possibilities, + outputType + } + }) + ); + return acc; + } + const arg2 = valueToArg(argName, value, schemaArg, context3); + if (arg2) { + acc.push(arg2); + } + return acc; + }, []); + if (typeof inputType.constraints.minNumFields === "number" && objEntries.length < inputType.constraints.minNumFields || argsList.find((arg2) => { + var _a4, _b2; + return ((_a4 = arg2.error) == null ? void 0 : _a4.type) === "missingArg" || ((_b2 = arg2.error) == null ? void 0 : _b2.type) === "atLeastOne"; + })) { + const optionalMissingArgs = inputType.fields.filter( + (field) => !field.isRequired && obj && (typeof obj[field.name] === "undefined" || obj[field.name] === null) + ); + argsList.push( + ...optionalMissingArgs.map((arg2) => { + const argInputType = arg2.inputTypes[0]; + return new Arg2({ + key: arg2.name, + value: void 0, + isEnum: argInputType.location === "enumTypes", + error: { + type: "missingArg", + missingName: arg2.name, + missingArg: arg2, + atLeastOne: Boolean(inputType.constraints.minNumFields) || false, + atMostOne: inputType.constraints.maxNumFields === 1 || false + }, + inputType: argInputType + }); + }) + ); + } + return new Args(argsList); +} +__name(objectToArgs, "objectToArgs"); +function unpack({ document: document2, path: path7, data }) { + const result = deepGet(data, path7); + if (result === "undefined") { + return null; + } + if (typeof result !== "object") { + return result; + } + const field = getField(document2, path7); + return mapScalars({ field, data: result }); +} +__name(unpack, "unpack"); +function mapScalars({ field, data }) { + var _a3; + if (!data || typeof data !== "object" || !field.children || !field.schemaField) { + return data; + } + const deserializers = { + DateTime: (value) => new Date(value), + Json: (value) => JSON.parse(value), + Bytes: (value) => Buffer.from(value, "base64"), + Decimal: (value) => { + return new decimal_default(value); + }, + BigInt: (value) => BigInt(value) + }; + for (const child of field.children) { + const outputType = (_a3 = child.schemaField) == null ? void 0 : _a3.outputType.type; + if (outputType && typeof outputType === "string") { + const deserializer = deserializers[outputType]; + if (deserializer) { + if (Array.isArray(data)) { + for (const entry of data) { + if (typeof entry[child.name] !== "undefined" && entry[child.name] !== null) { + if (Array.isArray(entry[child.name])) { + entry[child.name] = entry[child.name].map(deserializer); + } else { + entry[child.name] = deserializer(entry[child.name]); + } + } + } + } else { + if (typeof data[child.name] !== "undefined" && data[child.name] !== null) { + if (Array.isArray(data[child.name])) { + data[child.name] = data[child.name].map(deserializer); + } else { + data[child.name] = deserializer(data[child.name]); + } + } + } + } + } + if (child.schemaField && child.schemaField.outputType.location === "outputObjectTypes") { + if (Array.isArray(data)) { + for (const entry of data) { + mapScalars({ field: child, data: entry[child.name] }); + } + } else { + mapScalars({ field: child, data: data[child.name] }); + } + } + } + return data; +} +__name(mapScalars, "mapScalars"); +function getField(document2, path7) { + const todo = path7.slice(); + const firstElement = todo.shift(); + let pointer = document2.children.find((c) => c.name === firstElement); + if (!pointer) { + throw new Error(`Could not find field ${firstElement} in document ${document2}`); + } + while (todo.length > 0) { + const key = todo.shift(); + if (!pointer.children) { + throw new Error(`Can't get children for field ${pointer} with child ${key}`); + } + const child = pointer.children.find((c) => c.name === key); + if (!child) { + throw new Error(`Can't find child ${key} of field ${pointer}`); + } + pointer = child; + } + return pointer; +} +__name(getField, "getField"); +function removeSelectFromPath(path7) { + return path7.split(".").filter((p) => p !== "select").join("."); +} +__name(removeSelectFromPath, "removeSelectFromPath"); +function removeSelectFromObject(obj) { + const type = Object.prototype.toString.call(obj); + if (type === "[object Object]") { + const copy = {}; + for (const key in obj) { + if (key === "select") { + for (const subKey in obj["select"]) { + copy[subKey] = removeSelectFromObject(obj["select"][subKey]); + } + } else { + copy[key] = removeSelectFromObject(obj[key]); + } + } + return copy; + } + return obj; +} +__name(removeSelectFromObject, "removeSelectFromObject"); +function transformAggregatePrintJsonArgs({ + ast, + keyPaths, + missingItems, + valuePaths +}) { + const newKeyPaths = keyPaths.map(removeSelectFromPath); + const newValuePaths = valuePaths.map(removeSelectFromPath); + const newMissingItems = missingItems.map((item) => ({ + path: removeSelectFromPath(item.path), + isRequired: item.isRequired, + type: item.type + })); + const newAst = removeSelectFromObject(ast); + return { + ast: newAst, + keyPaths: newKeyPaths, + missingItems: newMissingItems, + valuePaths: newValuePaths + }; +} +__name(transformAggregatePrintJsonArgs, "transformAggregatePrintJsonArgs"); + +// src/runtime/utils/rejectOnNotFound.ts +var NotFoundError2 = class extends Error { + constructor(message) { + super(message); + this.name = "NotFoundError"; + } +}; +__name(NotFoundError2, "NotFoundError"); +function getRejectOnNotFound(action, modelName, args, clientInstance) { + let rejectOnNotFound; + if (args && typeof args === "object" && "rejectOnNotFound" in args && args["rejectOnNotFound"] !== void 0) { + rejectOnNotFound = args["rejectOnNotFound"]; + delete args["rejectOnNotFound"]; + } else if (typeof clientInstance === "boolean") { + rejectOnNotFound = clientInstance; + } else if (clientInstance && typeof clientInstance === "object" && action in clientInstance) { + const rejectPerOperation = clientInstance[action]; + if (rejectPerOperation && typeof rejectPerOperation === "object") { + if (modelName in rejectPerOperation) { + return rejectPerOperation[modelName]; + } + return void 0; + } + rejectOnNotFound = getRejectOnNotFound(action, modelName, args, rejectPerOperation); + } else if (typeof clientInstance === "function") { + rejectOnNotFound = clientInstance; + } else { + rejectOnNotFound = false; + } + return rejectOnNotFound; +} +__name(getRejectOnNotFound, "getRejectOnNotFound"); +var REGEX = /(findUnique|findFirst)/; +function throwIfNotFound(data, clientMethod, typeName, rejectOnNotFound) { + if (rejectOnNotFound && !data && REGEX.exec(clientMethod)) { + if (typeof rejectOnNotFound === "boolean" && rejectOnNotFound) { + throw new NotFoundError2(`No ${typeName} found`); + } else if (typeof rejectOnNotFound === "function") { + throw rejectOnNotFound(new NotFoundError2(`No ${typeName} found`)); + } else if (isError(rejectOnNotFound)) { + throw rejectOnNotFound; + } + throw new NotFoundError2(`No ${typeName} found`); + } +} +__name(throwIfNotFound, "throwIfNotFound"); + +// src/runtime/core/model/applyClientOnlyWrapper.ts +function wrapRequest(prop, dmmfModelName, requestCallback) { + if (prop === "findFirstOrThrow" || prop === "findUniqueOrThrow") { + return applyOrThrowWrapper(dmmfModelName, requestCallback); + } + assertNever(prop, "Unknown wrapper name"); +} +__name(wrapRequest, "wrapRequest"); +function applyOrThrowWrapper(dmmfModelName, requestCallback) { + return async (requestParams) => { + if ("rejectOnNotFound" in requestParams.args) { + const message = createErrorMessageWithContext({ + originalMethod: requestParams.clientMethod, + callsite: requestParams.callsite, + message: "'rejectOnNotFound' option is not supported" + }); + throw new PrismaClientValidationError(message); + } + const result = await requestCallback(requestParams); + if (result === null || result === void 0) { + throw new NotFoundError2(`No ${dmmfModelName} found`); + } + return result; + }; +} +__name(applyOrThrowWrapper, "applyOrThrowWrapper"); + +// src/runtime/core/model/utils/defaultProxyHandlers.ts +var defaultPropertyDescriptor = { + enumerable: true, + configurable: true, + writable: true +}; +function defaultProxyHandlers(ownKeys) { + const _ownKeys = new Set(ownKeys); + return { + getOwnPropertyDescriptor: () => defaultPropertyDescriptor, + has: (target, prop) => _ownKeys.has(prop), + set: (target, prop, value) => { + return _ownKeys.add(prop) && Reflect.set(target, prop, value); + }, + ownKeys: () => [..._ownKeys] + }; +} +__name(defaultProxyHandlers, "defaultProxyHandlers"); + +// src/runtime/core/model/applyFieldsProxy.ts +function applyFieldsProxy(model) { + const scalarFieldsList = model.fields.filter((field) => !field.relationName); + const scalarFields = keyBy2(scalarFieldsList, (field) => field.name); + return new Proxy( + {}, + { + get(target, prop) { + if (prop in target || typeof prop === "symbol") { + return target[prop]; + } + const dmmfField = scalarFields[prop]; + if (dmmfField) { + return new FieldRefImpl(model.name, prop, dmmfField.type, dmmfField.isList); + } + return void 0; + }, + ...defaultProxyHandlers(Object.keys(scalarFields)) + } + ); +} +__name(applyFieldsProxy, "applyFieldsProxy"); + +// src/runtime/core/model/applyFluent.ts +function getNextDataPath(fluentPropName, prevDataPath) { + if (fluentPropName === void 0 || prevDataPath === void 0) + return []; + return [...prevDataPath, "select", fluentPropName]; +} +__name(getNextDataPath, "getNextDataPath"); +function getNextUserArgs(callArgs, prevArgs, nextDataPath) { + if (prevArgs === void 0) + return callArgs != null ? callArgs : {}; + return deepSet(prevArgs, nextDataPath, callArgs || true); +} +__name(getNextUserArgs, "getNextUserArgs"); +function applyFluent(client, dmmfModelName, modelAction, fluentPropName, prevDataPath, prevUserArgs) { + const dmmfModel = client._baseDmmf.modelMap[dmmfModelName]; + const dmmfModelFieldMap = dmmfModel.fields.reduce( + (acc, field) => ({ ...acc, [field.name]: field }), + {} + ); + return (userArgs) => { + const callsite = getCallSite(client._errorFormat); + const nextDataPath = getNextDataPath(fluentPropName, prevDataPath); + const nextUserArgs = getNextUserArgs(userArgs, prevUserArgs, nextDataPath); + const prismaPromise = modelAction({ dataPath: nextDataPath, callsite })(nextUserArgs); + const ownKeys = getOwnKeys(client, dmmfModelName); + return new Proxy(prismaPromise, { + get(target, prop) { + if (!ownKeys.includes(prop)) + return target[prop]; + const dmmfModelName2 = dmmfModelFieldMap[prop].type; + const modelArgs = [dmmfModelName2, modelAction, prop]; + const dataArgs = [nextDataPath, nextUserArgs]; + return applyFluent(client, ...modelArgs, ...dataArgs); + }, + ...defaultProxyHandlers([...ownKeys, ...Object.getOwnPropertyNames(prismaPromise)]) + }); + }; +} +__name(applyFluent, "applyFluent"); +function getOwnKeys(client, dmmfModelName) { + return client._baseDmmf.modelMap[dmmfModelName].fields.filter((field) => field.kind === "object").map((field) => field.name); +} +__name(getOwnKeys, "getOwnKeys"); + +// src/runtime/core/model/utils/dmmfToJSModelName.ts +function dmmfToJSModelName(name) { + return name.replace(/^./, (str) => str.toLowerCase()); +} +__name(dmmfToJSModelName, "dmmfToJSModelName"); + +// src/runtime/core/model/applyModel.ts +var fluentProps = ["findUnique", "findFirst", "create", "update", "upsert", "delete"]; +var aggregateProps = ["aggregate", "count", "groupBy"]; +function applyModel(client, dmmfModelName) { + var _a3; + const jsModelName = dmmfToJSModelName(dmmfModelName); + const model = client._baseDmmf.modelMap[dmmfModelName]; + const fieldsProxyEnabled = (_a3 = client._engineConfig.previewFeatures) == null ? void 0 : _a3.includes("fieldReference"); + const ownKeys = getOwnKeys2(client, dmmfModelName); + const baseObject = {}; + let fieldsProxy; + return new Proxy(baseObject, { + get(target, prop) { + if (prop in target || typeof prop === "symbol") + return target[prop]; + if (prop === "fields" && fieldsProxyEnabled) { + return fieldsProxy != null ? fieldsProxy : fieldsProxy = applyFieldsProxy(model); + } + if (!isValidActionName(client, dmmfModelName, prop)) + return void 0; + const dmmfActionName = getDmmfActionName(prop); + let requestFn = /* @__PURE__ */ __name((params) => client._request(params), "requestFn"); + if (isClientOnlyAction(prop)) { + requestFn = wrapRequest(prop, dmmfModelName, requestFn); + } + const action = /* @__PURE__ */ __name((paramOverrides) => (userArgs) => { + const callSite = getCallSite(client._errorFormat); + return createPrismaPromise((txId, lock) => { + const data = { args: userArgs, dataPath: [] }; + const action2 = { action: dmmfActionName, model: dmmfModelName }; + const method = { clientMethod: `${jsModelName}.${prop}`, jsModelName }; + const tx = { runInTransaction: !!txId, transactionId: txId, lock }; + const trace2 = { callsite: callSite }; + const params = { ...data, ...action2, ...method, ...tx, ...trace2 }; + return requestFn({ ...params, ...paramOverrides }); + }); + }, "action"); + if (fluentProps.includes(dmmfActionName)) { + return applyFluent(client, dmmfModelName, action); + } + if (isValidAggregateName(prop)) { + return applyAggregates(client, prop, action); + } + return action({}); + }, + ...defaultProxyHandlers(ownKeys) + }); +} +__name(applyModel, "applyModel"); +function getOwnKeys2(client, dmmfModelName) { + return [...Object.keys(client._baseDmmf.mappingsMap[dmmfModelName]), "count"].filter( + (key) => !["model", "plural"].includes(key) + ); +} +__name(getOwnKeys2, "getOwnKeys"); +function isValidActionName(client, dmmfModelName, action) { + if (isClientOnlyAction(action)) { + return isValidActionName(client, dmmfModelName, clientOnlyActions[action].wrappedAction); + } + return getOwnKeys2(client, dmmfModelName).includes(action); +} +__name(isValidActionName, "isValidActionName"); +function isValidAggregateName(action) { + return aggregateProps.includes(action); +} +__name(isValidAggregateName, "isValidAggregateName"); + +// src/runtime/core/model/utils/jsToDMMFModelName.ts +function jsToDMMFModelName(name) { + return name.replace(/^./, (str) => str.toUpperCase()); +} +__name(jsToDMMFModelName, "jsToDMMFModelName"); + +// src/runtime/core/model/applyModels.ts +function applyModels(client) { + const modelCache = {}; + const ownKeys = getOwnKeys3(client); + return new Proxy(client, { + get(target, prop) { + if (prop in target || typeof prop === "symbol") + return target[prop]; + const dmmfModelName = jsToDMMFModelName(prop); + if (modelCache[dmmfModelName] !== void 0) { + return modelCache[dmmfModelName]; + } + if (client._baseDmmf.modelMap[dmmfModelName] !== void 0) { + return modelCache[dmmfModelName] = applyModel(client, dmmfModelName); + } + if (client._baseDmmf.modelMap[prop] !== void 0) { + return modelCache[dmmfModelName] = applyModel(client, prop); + } + }, + ...defaultProxyHandlers(ownKeys) + }); +} +__name(applyModels, "applyModels"); +function getOwnKeys3(client) { + return [...Object.keys(client._baseDmmf.modelMap).map(dmmfToJSModelName), ...Object.keys(client)]; +} +__name(getOwnKeys3, "getOwnKeys"); + +// src/runtime/core/transaction/utils/createLockCountPromise.ts +function getLockCountPromise(knock, cb = () => { +}) { + let resolve; + const lock = new Promise((res) => resolve = res); + return { + then(onFulfilled) { + if (--knock === 0) + resolve(cb()); + return onFulfilled == null ? void 0 : onFulfilled(lock); + } + }; +} +__name(getLockCountPromise, "getLockCountPromise"); + +// src/runtime/getLogLevel.ts +function getLogLevel(log4) { + if (typeof log4 === "string") { + return log4; + } + return log4.reduce((acc, curr) => { + const currentLevel = typeof curr === "string" ? curr : curr.level; + if (currentLevel === "query") { + return acc; + } + if (!acc) { + return currentLevel; + } + if (curr === "info" || acc === "info") { + return "info"; + } + return currentLevel; + }, void 0); +} +__name(getLogLevel, "getLogLevel"); + +// src/runtime/mergeBy.ts +function mergeBy(arr1, arr2, cb) { + const groupedArr1 = groupBy2(arr1, cb); + const groupedArr2 = groupBy2(arr2, cb); + const result = Object.values(groupedArr2).map((value) => value[value.length - 1]); + const arr2Keys = Object.keys(groupedArr2); + Object.entries(groupedArr1).forEach(([key, value]) => { + if (!arr2Keys.includes(key)) { + result.push(value[value.length - 1]); + } + }); + return result; +} +__name(mergeBy, "mergeBy"); +var groupBy2 = /* @__PURE__ */ __name((arr, cb) => { + return arr.reduce((acc, curr) => { + const key = cb(curr); + if (!acc[key]) { + acc[key] = []; + } + acc[key].push(curr); + return acc; + }, {}); +}, "groupBy"); + +// src/runtime/MiddlewareHandler.ts +var MiddlewareHandler = class { + constructor() { + this._middlewares = []; + } + use(middleware) { + this._middlewares.push(middleware); + } + get(id) { + return this._middlewares[id]; + } + has(id) { + return !!this._middlewares[id]; + } + length() { + return this._middlewares.length; + } +}; +__name(MiddlewareHandler, "MiddlewareHandler"); +var Middlewares = class { + constructor() { + this.query = new MiddlewareHandler(); + this.engine = new MiddlewareHandler(); + } +}; +__name(Middlewares, "Middlewares"); + +// src/runtime/RequestHandler.ts +var import_strip_ansi4 = __toESM(require_strip_ansi()); + +// src/runtime/DataLoader.ts +var DataLoader = class { + constructor(options) { + this.options = options; + this.tickActive = false; + this.batches = {}; + } + request(request2) { + const hash = this.options.batchBy(request2); + if (!hash) { + return this.options.singleLoader(request2); + } + if (!this.batches[hash]) { + this.batches[hash] = []; + if (!this.tickActive) { + this.tickActive = true; + process.nextTick(() => { + this.dispatchBatches(); + this.tickActive = false; + }); + } + } + return new Promise((resolve, reject) => { + this.batches[hash].push({ + request: request2, + resolve, + reject + }); + }); + } + dispatchBatches() { + for (const key in this.batches) { + const batch = this.batches[key]; + delete this.batches[key]; + if (batch.length === 1) { + this.options.singleLoader(batch[0].request).then((result) => { + if (result instanceof Error) { + batch[0].reject(result); + } else { + batch[0].resolve(result); + } + }).catch((e) => { + batch[0].reject(e); + }); + } else { + this.options.batchLoader(batch.map((j) => j.request)).then((results) => { + if (results instanceof Error) { + for (let i = 0; i < batch.length; i++) { + batch[i].reject(results); + } + } else { + for (let i = 0; i < batch.length; i++) { + const value = results[i]; + if (value instanceof Error) { + batch[i].reject(value); + } else { + batch[i].resolve(value); + } + } + } + }).catch((e) => { + for (let i = 0; i < batch.length; i++) { + batch[i].reject(e); + } + }); + } + } + } + get [Symbol.toStringTag]() { + return "DataLoader"; + } +}; +__name(DataLoader, "DataLoader"); + +// src/runtime/RequestHandler.ts +var debug11 = src_default("prisma:client:request_handler"); +function getRequestInfo(request2) { + var _a3; + const txId = request2.transactionId; + const inTx = request2.runInTransaction; + const headers = (_a3 = request2.headers) != null ? _a3 : {}; + const traceparent = getTraceParent({ tracingConfig: request2.tracingConfig }); + const _inTx = typeof txId === "number" && inTx ? true : void 0; + const _txId = typeof txId === "string" && inTx ? txId : void 0; + if (_txId !== void 0) + headers.transactionId = _txId; + if (traceparent !== void 0) + headers.traceparent = traceparent; + return { inTx: _inTx, headers }; +} +__name(getRequestInfo, "getRequestInfo"); +var RequestHandler = class { + constructor(client, hooks) { + this.client = client; + this.hooks = hooks; + this.dataloader = new DataLoader({ + batchLoader: (requests) => { + const info2 = getRequestInfo(requests[0]); + const queries = requests.map((r) => String(r.document)); + const traceparent = getTraceParent({ context: requests[0].otelParentCtx, tracingConfig: client._tracingConfig }); + if (traceparent) + info2.headers.traceparent = traceparent; + return this.client._engine.requestBatch(queries, info2.headers, info2.inTx); + }, + singleLoader: (request2) => { + const info2 = getRequestInfo(request2); + const query2 = String(request2.document); + return this.client._engine.request(query2, info2.headers); + }, + batchBy: (request2) => { + if (request2.transactionId) { + return `transaction-${request2.transactionId}`; + } + return batchFindUniqueBy(request2); + } + }); + } + async request({ + document: document2, + dataPath = [], + rootField, + typeName, + isList, + callsite, + rejectOnNotFound, + clientMethod, + runInTransaction, + engineHook, + args, + headers, + transactionId, + unpacker, + otelParentCtx, + otelChildCtx + }) { + if (this.hooks && this.hooks.beforeRequest) { + const query2 = String(document2); + this.hooks.beforeRequest({ + query: query2, + path: dataPath, + rootField, + typeName, + document: document2, + isList, + clientMethod, + args + }); + } + try { + let data, elapsed; + if (engineHook) { + const result = await engineHook( + { + document: document2, + runInTransaction + }, + (params) => this.dataloader.request({ ...params, tracingConfig: this.client._tracingConfig }) + ); + data = result.data; + elapsed = result.elapsed; + } else { + const result = await this.dataloader.request({ + document: document2, + runInTransaction, + headers, + transactionId, + otelParentCtx, + otelChildCtx, + tracingConfig: this.client._tracingConfig + }); + data = result == null ? void 0 : result.data; + elapsed = result == null ? void 0 : result.elapsed; + } + const unpackResult = this.unpack(document2, data, dataPath, rootField, unpacker); + throwIfNotFound(unpackResult, clientMethod, typeName, rejectOnNotFound); + if (process.env.PRISMA_CLIENT_GET_TIME) { + return { data: unpackResult, elapsed }; + } + return unpackResult; + } catch (error2) { + this.handleRequestError({ error: error2, clientMethod, callsite }); + } + } + handleRequestError({ error: error2, clientMethod, callsite }) { + debug11(error2); + let message = error2.message; + if (callsite) { + message = createErrorMessageWithContext({ + callsite, + originalMethod: clientMethod, + isPanic: error2.isPanic, + showColors: this.client._errorFormat === "pretty", + message + }); + } + message = this.sanitizeMessage(message); + if (error2.code) { + throw new PrismaClientKnownRequestError(message, error2.code, this.client._clientVersion, error2.meta); + } else if (error2.isPanic) { + throw new PrismaClientRustPanicError(message, this.client._clientVersion); + } else if (error2 instanceof PrismaClientUnknownRequestError) { + throw new PrismaClientUnknownRequestError(message, this.client._clientVersion); + } else if (error2 instanceof PrismaClientInitializationError) { + throw new PrismaClientInitializationError(message, this.client._clientVersion); + } else if (error2 instanceof PrismaClientRustPanicError) { + throw new PrismaClientRustPanicError(message, this.client._clientVersion); + } + error2.clientVersion = this.client._clientVersion; + throw error2; + } + sanitizeMessage(message) { + if (this.client._errorFormat && this.client._errorFormat !== "pretty") { + return (0, import_strip_ansi4.default)(message); + } + return message; + } + unpack(document2, data, path7, rootField, unpacker) { + if (data == null ? void 0 : data.data) { + data = data.data; + } + if (unpacker) { + data[rootField] = unpacker(data[rootField]); + } + const getPath = []; + if (rootField) { + getPath.push(rootField); + } + getPath.push(...path7.filter((p) => p !== "select" && p !== "include")); + return unpack({ document: document2, data, path: getPath }); + } + get [Symbol.toStringTag]() { + return "RequestHandler"; + } +}; +__name(RequestHandler, "RequestHandler"); +function batchFindUniqueBy(request2) { + var _a3; + if (!request2.document.children[0].name.startsWith("findUnique")) { + return void 0; + } + const args = (_a3 = request2.document.children[0].args) == null ? void 0 : _a3.args.map((a) => { + if (a.value instanceof Args) { + return `${a.key}-${a.value.args.map((a2) => a2.key).join(",")}`; + } + return a.key; + }).join(","); + const selectionSet = request2.document.children[0].children.join(","); + return `${request2.document.children[0].name}|${args}|${selectionSet}`; +} +__name(batchFindUniqueBy, "batchFindUniqueBy"); + +// src/runtime/utils/clientVersion.ts +var clientVersion = require_package2().version; + +// src/runtime/utils/deserializeRawResults.ts +function deserializeRawResults(rows) { + return rows.map((row) => { + const mappedRow = {}; + for (const key of Object.keys(row)) { + mappedRow[key] = deserializeValue(row[key]); + } + return mappedRow; + }); +} +__name(deserializeRawResults, "deserializeRawResults"); +function deserializeValue({ prisma__type: type, prisma__value: value }) { + switch (type) { + case "bigint": + return BigInt(value); + case "bytes": + return Buffer.from(value, "base64"); + case "decimal": + return new decimal_default(value); + case "datetime": + case "date": + return new Date(value); + case "time": + return new Date(`1970-01-01T${value}Z`); + case "array": + return value.map(deserializeValue); + default: + return value; + } +} +__name(deserializeValue, "deserializeValue"); + +// src/runtime/utils/mssqlPreparedStatement.ts +var mssqlPreparedStatement = /* @__PURE__ */ __name((template) => { + return template.reduce((acc, str, idx) => `${acc}@P${idx}${str}`); +}, "mssqlPreparedStatement"); + +// src/runtime/utils/serializeRawParameters.ts +function serializeRawParameters(parameters) { + try { + return serializeRawParametersInternal(parameters, "fast"); + } catch (error2) { + return serializeRawParametersInternal(parameters, "slow"); + } +} +__name(serializeRawParameters, "serializeRawParameters"); +function serializeRawParametersInternal(parameters, objectSerialization) { + return JSON.stringify(parameters.map((parameter) => encodeParameter(parameter, objectSerialization))); +} +__name(serializeRawParametersInternal, "serializeRawParametersInternal"); +function encodeParameter(parameter, objectSerialization) { + if (typeof parameter === "bigint") { + return { + prisma__type: "bigint", + prisma__value: parameter.toString() + }; + } + if (isDate(parameter)) { + return { + prisma__type: "date", + prisma__value: parameter.toJSON() + }; + } + if (decimal_default.isDecimal(parameter)) { + return { + prisma__type: "decimal", + prisma__value: parameter.toJSON() + }; + } + if (Buffer.isBuffer(parameter)) { + return { + prisma__type: "bytes", + prisma__value: parameter.toString("base64") + }; + } + if (isArrayBufferLike(parameter) || ArrayBuffer.isView(parameter)) { + return { + prisma__type: "bytes", + prisma__value: Buffer.from(parameter).toString("base64") + }; + } + if (typeof parameter === "object" && objectSerialization === "slow") { + return preprocessObject(parameter); + } + return parameter; +} +__name(encodeParameter, "encodeParameter"); +function isDate(value) { + if (value instanceof Date) { + return true; + } + return Object.prototype.toString.call(value) === "[object Date]" && typeof value.toJSON === "function"; +} +__name(isDate, "isDate"); +function isArrayBufferLike(value) { + if (value instanceof ArrayBuffer || value instanceof SharedArrayBuffer) { + return true; + } + if (typeof value === "object" && value !== null) { + return value[Symbol.toStringTag] === "ArrayBuffer" || value[Symbol.toStringTag] === "SharedArrayBuffer"; + } + return false; +} +__name(isArrayBufferLike, "isArrayBufferLike"); +function preprocessObject(obj) { + if (typeof obj !== "object" || obj === null) { + return obj; + } + if (typeof obj.toJSON === "function") { + return obj.toJSON(); + } + if (Array.isArray(obj)) { + return obj.map(preprocessValueInObject); + } + const result = {}; + for (const key of Object.keys(obj)) { + result[key] = preprocessValueInObject(obj[key]); + } + return result; +} +__name(preprocessObject, "preprocessObject"); +function preprocessValueInObject(value) { + if (typeof value === "bigint") { + return value.toString(); + } + return preprocessObject(value); +} +__name(preprocessValueInObject, "preprocessValueInObject"); + +// src/runtime/utils/validatePrismaClientOptions.ts +var import_js_levenshtein2 = __toESM(require_js_levenshtein()); +var knownProperties = ["datasources", "errorFormat", "log", "__internal", "rejectOnNotFound"]; +var errorFormats = ["pretty", "colorless", "minimal"]; +var logLevels = ["info", "query", "warn", "error"]; +var validators = { + datasources: (options, datasourceNames) => { + if (!options) { + return; + } + if (typeof options !== "object" || Array.isArray(options)) { + throw new PrismaClientConstructorValidationError( + `Invalid value ${JSON.stringify(options)} for "datasources" provided to PrismaClient constructor` + ); + } + for (const [key, value] of Object.entries(options)) { + if (!datasourceNames.includes(key)) { + const didYouMean = getDidYouMean(key, datasourceNames) || `Available datasources: ${datasourceNames.join(", ")}`; + throw new PrismaClientConstructorValidationError( + `Unknown datasource ${key} provided to PrismaClient constructor.${didYouMean}` + ); + } + if (typeof value !== "object" || Array.isArray(value)) { + throw new PrismaClientConstructorValidationError( + `Invalid value ${JSON.stringify(options)} for datasource "${key}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }` + ); + } + if (value && typeof value === "object") { + for (const [key1, value1] of Object.entries(value)) { + if (key1 !== "url") { + throw new PrismaClientConstructorValidationError( + `Invalid value ${JSON.stringify(options)} for datasource "${key}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }` + ); + } + if (typeof value1 !== "string") { + throw new PrismaClientConstructorValidationError( + `Invalid value ${JSON.stringify(value1)} for datasource "${key}" provided to PrismaClient constructor. +It should have this form: { url: "CONNECTION_STRING" }` + ); + } + } + } + } + }, + errorFormat: (options) => { + if (!options) { + return; + } + if (typeof options !== "string") { + throw new PrismaClientConstructorValidationError( + `Invalid value ${JSON.stringify(options)} for "errorFormat" provided to PrismaClient constructor.` + ); + } + if (!errorFormats.includes(options)) { + const didYouMean = getDidYouMean(options, errorFormats); + throw new PrismaClientConstructorValidationError( + `Invalid errorFormat ${options} provided to PrismaClient constructor.${didYouMean}` + ); + } + }, + log: (options) => { + if (!options) { + return; + } + if (!Array.isArray(options)) { + throw new PrismaClientConstructorValidationError( + `Invalid value ${JSON.stringify(options)} for "log" provided to PrismaClient constructor.` + ); + } + function validateLogLevel(level) { + if (typeof level === "string") { + if (!logLevels.includes(level)) { + const didYouMean = getDidYouMean(level, logLevels); + throw new PrismaClientConstructorValidationError( + `Invalid log level "${level}" provided to PrismaClient constructor.${didYouMean}` + ); + } + } + } + __name(validateLogLevel, "validateLogLevel"); + for (const option of options) { + validateLogLevel(option); + const logValidators = { + level: validateLogLevel, + emit: (value) => { + const emits = ["stdout", "event"]; + if (!emits.includes(value)) { + const didYouMean = getDidYouMean(value, emits); + throw new PrismaClientConstructorValidationError( + `Invalid value ${JSON.stringify( + value + )} for "emit" in logLevel provided to PrismaClient constructor.${didYouMean}` + ); + } + } + }; + if (option && typeof option === "object") { + for (const [key, value] of Object.entries(option)) { + if (logValidators[key]) { + logValidators[key](value); + } else { + throw new PrismaClientConstructorValidationError( + `Invalid property ${key} for "log" provided to PrismaClient constructor` + ); + } + } + } + } + }, + __internal: (value) => { + if (!value) { + return; + } + const knownKeys = ["debug", "hooks", "engine", "measurePerformance"]; + if (typeof value !== "object") { + throw new PrismaClientConstructorValidationError( + `Invalid value ${JSON.stringify(value)} for "__internal" to PrismaClient constructor` + ); + } + for (const [key] of Object.entries(value)) { + if (!knownKeys.includes(key)) { + const didYouMean = getDidYouMean(key, knownKeys); + throw new PrismaClientConstructorValidationError( + `Invalid property ${JSON.stringify(key)} for "__internal" provided to PrismaClient constructor.${didYouMean}` + ); + } + } + }, + rejectOnNotFound: (value) => { + if (!value) { + return; + } + if (isError(value) || typeof value === "boolean" || typeof value === "object" || typeof value === "function") { + return value; + } + throw new PrismaClientConstructorValidationError( + `Invalid rejectOnNotFound expected a boolean/Error/{[modelName: Error | boolean]} but received ${JSON.stringify( + value + )}` + ); + } +}; +function validatePrismaClientOptions(options, datasourceNames) { + for (const [key, value] of Object.entries(options)) { + if (!knownProperties.includes(key)) { + const didYouMean = getDidYouMean(key, knownProperties); + throw new PrismaClientConstructorValidationError( + `Unknown property ${key} provided to PrismaClient constructor.${didYouMean}` + ); + } + validators[key](value, datasourceNames); + } +} +__name(validatePrismaClientOptions, "validatePrismaClientOptions"); +function getDidYouMean(str, options) { + if (options.length === 0) { + return ""; + } + if (typeof str !== "string") { + return ""; + } + const alternative = getAlternative(str, options); + if (!alternative) { + return ""; + } + return ` Did you mean "${alternative}"?`; +} +__name(getDidYouMean, "getDidYouMean"); +function getAlternative(str, options) { + if (options.length === 0) { + return null; + } + const optionsWithDistances = options.map((value) => ({ + value, + distance: (0, import_js_levenshtein2.default)(str, value) + })); + optionsWithDistances.sort((a, b) => { + return a.distance < b.distance ? -1 : 1; + }); + const bestAlternative = optionsWithDistances[0]; + if (bestAlternative.distance < 3) { + return bestAlternative.value; + } + return null; +} +__name(getAlternative, "getAlternative"); + +// src/runtime/getPrismaClient.ts +var debug12 = src_default("prisma:client"); +var ALTER_RE = /^(\s*alter\s)/i; +typeof globalThis === "object" ? globalThis.NODE_CLIENT = true : 0; +function isReadonlyArray(arg2) { + return Array.isArray(arg2); +} +__name(isReadonlyArray, "isReadonlyArray"); +function checkAlter(query2, values, invalidCall) { + if (values.length > 0 && ALTER_RE.exec(query2)) { + throw new Error(`Running ALTER using ${invalidCall} 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 +`); + } +} +__name(checkAlter, "checkAlter"); +var actionOperationMap = { + findUnique: "query", + findFirst: "query", + findMany: "query", + count: "query", + create: "mutation", + createMany: "mutation", + update: "mutation", + updateMany: "mutation", + upsert: "mutation", + delete: "mutation", + deleteMany: "mutation", + executeRaw: "mutation", + queryRaw: "mutation", + aggregate: "query", + groupBy: "query", + runCommandRaw: "mutation", + findRaw: "query", + aggregateRaw: "query" +}; +var TX_ID = Symbol.for("prisma.client.transaction.id"); +function getPrismaClient(config2) { + class PrismaClient { + constructor(optionsArg) { + this._middlewares = new Middlewares(); + this._transactionId = 1; + this._getDmmf = callOnce(async (params) => { + try { + const dmmf = await this._engine.getDmmf(); + return new DMMFHelper(getPrismaClientDMMF(dmmf)); + } catch (error2) { + this._fetcher.handleRequestError({ ...params, error: error2 }); + } + }); + var _a3, _b2, _c, _d, _e, _f, _g, _h, _i; + if (optionsArg) { + validatePrismaClientOptions(optionsArg, config2.datasourceNames); + } + this._previewFeatures = (_b2 = (_a3 = config2.generator) == null ? void 0 : _a3.previewFeatures) != null ? _b2 : []; + this._rejectOnNotFound = optionsArg == null ? void 0 : optionsArg.rejectOnNotFound; + this._clientVersion = (_c = config2.clientVersion) != null ? _c : clientVersion; + this._activeProvider = config2.activeProvider; + this._dataProxy = config2.dataProxy; + this._tracingConfig = getTracingConfig(this._previewFeatures); + this._clientEngineType = getClientEngineType(config2.generator); + const envPaths = { + rootEnvPath: config2.relativeEnvPaths.rootEnvPath && import_path5.default.resolve(config2.dirname, config2.relativeEnvPaths.rootEnvPath), + schemaEnvPath: config2.relativeEnvPaths.schemaEnvPath && import_path5.default.resolve(config2.dirname, config2.relativeEnvPaths.schemaEnvPath) + }; + const loadedEnv = tryLoadEnvs(envPaths, { conflictCheck: "none" }); + try { + const options = optionsArg != null ? optionsArg : {}; + const internal = (_d = options.__internal) != null ? _d : {}; + const useDebug = internal.debug === true; + if (useDebug) { + src_default.enable("prisma:client"); + } + if (internal.hooks) { + this._hooks = internal.hooks; + } + let cwd = import_path5.default.resolve(config2.dirname, config2.relativePath); + if (!import_fs9.default.existsSync(cwd)) { + cwd = config2.dirname; + } + debug12("dirname", config2.dirname); + debug12("relativePath", config2.relativePath); + debug12("cwd", cwd); + const thedatasources = options.datasources || {}; + const inputDatasources = Object.entries(thedatasources).filter(([_, source]) => { + return source && source.url; + }).map(([name, { url }]) => ({ + name, + url + })); + const datasources = mergeBy([], inputDatasources, (source) => source.name); + const engineConfig = internal.engine || {}; + if (options.errorFormat) { + this._errorFormat = options.errorFormat; + } else if (process.env.NODE_ENV === "production") { + this._errorFormat = "minimal"; + } else if (process.env.NO_COLOR) { + this._errorFormat = "colorless"; + } else { + this._errorFormat = "colorless"; + } + this._baseDmmf = new BaseDMMFHelper(config2.document); + if (this._dataProxy) { + const rawDmmf = config2.document; + this._dmmf = new DMMFHelper(rawDmmf); + } + this._engineConfig = { + cwd, + dirname: config2.dirname, + enableDebugLogs: useDebug, + allowTriggerPanic: engineConfig.allowTriggerPanic, + datamodelPath: import_path5.default.join(config2.dirname, (_e = config2.filename) != null ? _e : "schema.prisma"), + prismaPath: (_f = engineConfig.binaryPath) != null ? _f : void 0, + engineEndpoint: engineConfig.endpoint, + datasources, + generator: config2.generator, + showColors: this._errorFormat === "pretty", + logLevel: options.log && getLogLevel(options.log), + logQueries: options.log && Boolean( + typeof options.log === "string" ? options.log === "query" : options.log.find((o) => typeof o === "string" ? o === "query" : o.level === "query") + ), + env: (_i = (_h = loadedEnv == null ? void 0 : loadedEnv.parsed) != null ? _h : (_g = config2.injectableEdgeEnv) == null ? void 0 : _g.parsed) != null ? _i : {}, + flags: [], + clientVersion: config2.clientVersion, + previewFeatures: this._previewFeatures, + activeProvider: config2.activeProvider, + inlineSchema: config2.inlineSchema, + inlineDatasources: config2.inlineDatasources, + inlineSchemaHash: config2.inlineSchemaHash, + tracingConfig: this._tracingConfig + }; + debug12("clientVersion", config2.clientVersion); + debug12("clientEngineType", this._dataProxy ? "dataproxy" : this._clientEngineType); + if (this._dataProxy) { + const runtime = true ? "Node.js" : "edge"; + debug12(`using Data Proxy with ${runtime} runtime`); + } + this._engine = this.getEngine(); + void this._getActiveProvider(); + this._fetcher = new RequestHandler(this, this._hooks); + if (options.log) { + for (const log4 of options.log) { + const level = typeof log4 === "string" ? log4 : log4.emit === "stdout" ? log4.level : null; + if (level) { + this.$on(level, (event) => { + var _a4; + logger_exports.log(`${(_a4 = logger_exports.tags[level]) != null ? _a4 : ""}`, event.message || event.query); + }); + } + } + } + this._metrics = new MetricsClient(this._engine); + } catch (e) { + e.clientVersion = this._clientVersion; + throw e; + } + return applyModels(this); + } + get [Symbol.toStringTag]() { + return "PrismaClient"; + } + getEngine() { + if (this._dataProxy === true) { + return new DataProxyEngine(this._engineConfig); + } else if (this._clientEngineType === "library" /* Library */) { + return new LibraryEngine(this._engineConfig); + } else if (this._clientEngineType === "binary" /* Binary */) { + return new BinaryEngine(this._engineConfig); + } + throw new PrismaClientValidationError("Invalid client engine type, please use `library` or `binary`"); + } + $use(arg0, arg1) { + if (typeof arg0 === "function") { + this._middlewares.query.use(arg0); + } else if (arg0 === "all") { + this._middlewares.query.use(arg1); + } else if (arg0 === "engine") { + this._middlewares.engine.use(arg1); + } else { + throw new Error(`Invalid middleware ${arg0}`); + } + } + $on(eventType, callback) { + if (eventType === "beforeExit") { + this._engine.on("beforeExit", callback); + } else { + this._engine.on(eventType, (event) => { + var _a3, _b2, _c, _d; + const fields = event.fields; + if (eventType === "query") { + return callback({ + timestamp: event.timestamp, + query: (_a3 = fields == null ? void 0 : fields.query) != null ? _a3 : event.query, + params: (_b2 = fields == null ? void 0 : fields.params) != null ? _b2 : event.params, + duration: (_c = fields == null ? void 0 : fields.duration_ms) != null ? _c : event.duration, + target: event.target + }); + } else { + return callback({ + timestamp: event.timestamp, + message: (_d = fields == null ? void 0 : fields.message) != null ? _d : event.message, + target: event.target + }); + } + }); + } + } + $connect() { + try { + return this._engine.start(); + } catch (e) { + e.clientVersion = this._clientVersion; + throw e; + } + } + async _runDisconnect() { + await this._engine.stop(); + delete this._connectionPromise; + this._engine = this.getEngine(); + delete this._disconnectionPromise; + delete this._getConfigPromise; + } + async $disconnect() { + try { + await this._engine.stop(); + } catch (e) { + e.clientVersion = this._clientVersion; + throw e; + } finally { + if (!this._dataProxy) { + this._dmmf = void 0; + } + } + } + async _getActiveProvider() { + try { + const configResult = await this._engine.getConfig(); + this._activeProvider = configResult.datasources[0].activeProvider; + } catch (e) { + } + } + $executeRawInternal(txId, lock, query2, ...values) { + let queryString = ""; + let parameters = void 0; + if (typeof query2 === "string") { + queryString = query2; + parameters = { + values: serializeRawParameters(values || []), + __prismaRawParamaters__: true + }; + checkAlter(queryString, values, "prisma.$executeRawUnsafe(, [...values])"); + } else if (isReadonlyArray(query2)) { + switch (this._activeProvider) { + case "sqlite": + case "mysql": { + const queryInstance = new Sql(query2, values); + queryString = queryInstance.sql; + parameters = { + values: serializeRawParameters(queryInstance.values), + __prismaRawParamaters__: true + }; + break; + } + case "cockroachdb": + case "postgresql": { + const queryInstance = new Sql(query2, values); + queryString = queryInstance.text; + checkAlter(queryString, queryInstance.values, "prisma.$executeRaw``"); + parameters = { + values: serializeRawParameters(queryInstance.values), + __prismaRawParamaters__: true + }; + break; + } + case "sqlserver": { + queryString = mssqlPreparedStatement(query2); + parameters = { + values: serializeRawParameters(values), + __prismaRawParamaters__: true + }; + break; + } + default: { + throw new Error(`The ${this._activeProvider} provider does not support $executeRaw`); + } + } + } else { + switch (this._activeProvider) { + case "sqlite": + case "mysql": + queryString = query2.sql; + break; + case "cockroachdb": + case "postgresql": + queryString = query2.text; + checkAlter(queryString, query2.values, "prisma.$executeRaw(sql``)"); + break; + case "sqlserver": + queryString = mssqlPreparedStatement(query2.strings); + break; + default: + throw new Error(`The ${this._activeProvider} provider does not support $executeRaw`); + } + parameters = { + values: serializeRawParameters(query2.values), + __prismaRawParamaters__: true + }; + } + if (parameters == null ? void 0 : parameters.values) { + debug12(`prisma.$executeRaw(${queryString}, ${parameters.values})`); + } else { + debug12(`prisma.$executeRaw(${queryString})`); + } + const args = { query: queryString, parameters }; + debug12(`Prisma Client call:`); + return this._request({ + args, + clientMethod: "$executeRaw", + dataPath: [], + action: "executeRaw", + callsite: getCallSite(this._errorFormat), + runInTransaction: !!txId, + transactionId: txId, + lock + }); + } + $executeRaw(query2, ...values) { + return createPrismaPromise((txId, lock) => { + if (query2.raw !== void 0 || query2.sql !== void 0) { + return this.$executeRawInternal(txId, lock, query2, ...values); + } + throw new PrismaClientValidationError(`\`$executeRaw\` is a tag function, please use it like the following: +\`\`\` +const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\` +\`\`\` + +Or read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw +`); + }); + } + $executeRawUnsafe(query2, ...values) { + return createPrismaPromise((txId, lock) => { + return this.$executeRawInternal(txId, lock, query2, ...values); + }); + } + $runCommandRaw(command) { + if (config2.activeProvider !== "mongodb") { + throw new PrismaClientValidationError( + `The ${config2.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.` + ); + } + return createPrismaPromise((txId, lock) => { + return this._request({ + args: { command }, + clientMethod: "$runCommandRaw", + dataPath: [], + action: "runCommandRaw", + callsite: getCallSite(this._errorFormat), + runInTransaction: !!txId, + transactionId: txId, + lock + }); + }); + } + $queryRawInternal(txId, lock, query2, ...values) { + let queryString = ""; + let parameters = void 0; + if (typeof query2 === "string") { + queryString = query2; + parameters = { + values: serializeRawParameters(values || []), + __prismaRawParamaters__: true + }; + } else if (isReadonlyArray(query2)) { + switch (this._activeProvider) { + case "sqlite": + case "mysql": { + const queryInstance = new Sql(query2, values); + queryString = queryInstance.sql; + parameters = { + values: serializeRawParameters(queryInstance.values), + __prismaRawParamaters__: true + }; + break; + } + case "cockroachdb": + case "postgresql": { + const queryInstance = new Sql(query2, values); + queryString = queryInstance.text; + parameters = { + values: serializeRawParameters(queryInstance.values), + __prismaRawParamaters__: true + }; + break; + } + case "sqlserver": { + const queryInstance = new Sql(query2, values); + queryString = mssqlPreparedStatement(queryInstance.strings); + parameters = { + values: serializeRawParameters(queryInstance.values), + __prismaRawParamaters__: true + }; + break; + } + default: { + throw new Error(`The ${this._activeProvider} provider does not support $queryRaw`); + } + } + } else { + switch (this._activeProvider) { + case "sqlite": + case "mysql": + queryString = query2.sql; + break; + case "cockroachdb": + case "postgresql": + queryString = query2.text; + break; + case "sqlserver": + queryString = mssqlPreparedStatement(query2.strings); + break; + default: { + throw new Error(`The ${this._activeProvider} provider does not support $queryRaw`); + } + } + parameters = { + values: serializeRawParameters(query2.values), + __prismaRawParamaters__: true + }; + } + if (parameters == null ? void 0 : parameters.values) { + debug12(`prisma.queryRaw(${queryString}, ${parameters.values})`); + } else { + debug12(`prisma.queryRaw(${queryString})`); + } + const args = { query: queryString, parameters }; + debug12(`Prisma Client call:`); + return this._request({ + args, + clientMethod: "$queryRaw", + dataPath: [], + action: "queryRaw", + callsite: getCallSite(this._errorFormat), + runInTransaction: !!txId, + transactionId: txId, + lock + }).then(deserializeRawResults); + } + $queryRaw(query2, ...values) { + return createPrismaPromise((txId, lock) => { + if (query2.raw !== void 0 || query2.sql !== void 0) { + return this.$queryRawInternal(txId, lock, query2, ...values); + } + throw new PrismaClientValidationError(`\`$queryRaw\` is a tag function, please use it like the following: +\`\`\` +const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\` +\`\`\` + +Or read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw +`); + }); + } + $queryRawUnsafe(query2, ...values) { + return createPrismaPromise((txId, lock) => { + return this.$queryRawInternal(txId, lock, query2, ...values); + }); + } + __internal_triggerPanic(fatal) { + if (!this._engineConfig.allowTriggerPanic) { + throw new Error(`In order to use .__internal_triggerPanic(), please enable it like so: +new PrismaClient({ + __internal: { + engine: { + allowTriggerPanic: true + } + } +})`); + } + const headers = fatal ? { "X-DEBUG-FATAL": "1" } : { "X-DEBUG-NON-FATAL": "1" }; + return this._request({ + action: "queryRaw", + args: { + query: "SELECT 1", + parameters: void 0 + }, + clientMethod: "queryRaw", + dataPath: [], + runInTransaction: false, + headers, + callsite: getCallSite(this._errorFormat) + }); + } + _transactionWithArray(promises) { + const txId = this._transactionId++; + const lock = getLockCountPromise(promises.length); + const requests = promises.map((request2) => { + var _a3; + if ((request2 == null ? void 0 : request2[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.` + ); + } + return (_a3 = request2.requestTransaction) == null ? void 0 : _a3.call(request2, txId, lock); + }); + return Promise.all(requests); + } + async _transactionWithCallback({ + callback, + options + }) { + const headers = { traceparent: getTraceParent({ tracingConfig: this._tracingConfig }) }; + const info2 = await this._engine.transaction("start", headers, options); + let result; + try { + result = await callback(transactionProxy(this, info2.id)); + await this._engine.transaction("commit", headers, info2); + } catch (e) { + await this._engine.transaction("rollback", headers, info2).catch(() => { + }); + e.clientVersion = this._clientVersion; + throw e; + } + return result; + } + $transaction(input, options) { + let callback; + if (typeof input === "function" && this._hasPreviewFlag("interactiveTransactions")) { + callback = /* @__PURE__ */ __name(() => this._transactionWithCallback({ callback: input, options }), "callback"); + } else { + callback = /* @__PURE__ */ __name(() => this._transactionWithArray(input), "callback"); + } + const spanOptions = { + name: "transaction", + enabled: this._tracingConfig.enabled, + attributes: { method: "$transaction" } + }; + return runInChildSpan(spanOptions, callback); + } + async _request(internalParams) { + internalParams.otelParentCtx = context2.active(); + try { + const params = { + args: internalParams.args, + dataPath: internalParams.dataPath, + runInTransaction: internalParams.runInTransaction, + action: internalParams.action, + model: internalParams.model + }; + const spanOptions = { + middleware: { + name: "middleware", + enabled: this._tracingConfig.middleware, + attributes: { method: "$use" }, + active: false + }, + operation: { + name: "operation", + enabled: this._tracingConfig.enabled, + attributes: { + method: params.action, + model: params.model, + name: `${params.model}.${params.action}` + } + } + }; + let index = -1; + const consumer = /* @__PURE__ */ __name((changedParams) => { + const nextMiddleware = this._middlewares.query.get(++index); + if (nextMiddleware) { + return runInChildSpan(spanOptions.middleware, async (span) => { + return nextMiddleware(changedParams, (p) => (span == null ? void 0 : span.end(), consumer(p))); + }); + } + return this._executeRequest({ ...internalParams, ...changedParams }); + }, "consumer"); + return await runInChildSpan(spanOptions.operation, () => { + if (true) { + const asyncRes = new import_async_hooks.AsyncResource("prisma-client-request"); + return asyncRes.runInAsyncScope(() => consumer(params)); + } + return consumer(params); + }); + } catch (e) { + e.clientVersion = this._clientVersion; + throw e; + } + } + async _executeRequest({ + args, + clientMethod, + jsModelName, + dataPath, + callsite, + runInTransaction, + action, + model, + headers, + transactionId, + lock, + unpacker, + otelParentCtx + }) { + var _a3, _b2; + if (this._dmmf === void 0) { + this._dmmf = await this._getDmmf({ clientMethod, callsite }); + } + let rootField; + const operation = actionOperationMap[action]; + if (action === "executeRaw" || action === "queryRaw" || action === "runCommandRaw") { + rootField = action; + } + let mapping; + if (model !== void 0) { + mapping = (_a3 = this._dmmf) == null ? void 0 : _a3.mappingsMap[model]; + if (mapping === void 0) { + throw new Error(`Could not find mapping for model ${model}`); + } + rootField = mapping[action === "count" ? "aggregate" : action]; + } + if (operation !== "query" && operation !== "mutation") { + throw new Error(`Invalid operation ${operation} for action ${action}`); + } + const field = (_b2 = this._dmmf) == null ? void 0 : _b2.rootFieldMap[rootField]; + if (field === void 0) { + throw new Error( + `Could not find rootField ${rootField} for action ${action} for model ${model} on rootType ${operation}` + ); + } + const { isList } = field.outputType; + const typeName = getOutputTypeName(field.outputType.type); + const rejectOnNotFound = getRejectOnNotFound(action, typeName, args, this._rejectOnNotFound); + warnAboutRejectOnNotFound(rejectOnNotFound, jsModelName, action); + const serializationFn = /* @__PURE__ */ __name(() => { + const document3 = makeDocument({ + dmmf: this._dmmf, + rootField, + rootTypeName: operation, + select: args, + modelName: model + }); + document3.validate(args, false, clientMethod, this._errorFormat, callsite); + return transformDocument(document3); + }, "serializationFn"); + const spanOptions = { + name: "serialize", + enabled: this._tracingConfig.enabled + }; + const document2 = await runInChildSpan(spanOptions, serializationFn); + if (src_default.enabled("prisma:client")) { + const query2 = String(document2); + debug12(`Prisma Client call:`); + debug12( + `prisma.${clientMethod}(${printJsonWithErrors({ + ast: args, + keyPaths: [], + valuePaths: [], + missingItems: [] + })})` + ); + debug12(`Generated request:`); + debug12(query2 + "\n"); + } + await lock; + return this._fetcher.request({ + document: document2, + clientMethod, + typeName, + dataPath, + rejectOnNotFound, + isList, + rootField, + callsite, + args, + engineHook: this._middlewares.engine.get(0), + runInTransaction, + headers, + transactionId, + unpacker, + otelParentCtx, + otelChildCtx: context2.active() + }); + } + get $metrics() { + if (!this._hasPreviewFlag("metrics")) { + throw new PrismaClientValidationError( + "`metrics` preview feature must be enabled in order to access metrics API" + ); + } + return this._metrics; + } + _hasPreviewFlag(feature) { + var _a3; + return !!((_a3 = this._engineConfig.previewFeatures) == null ? void 0 : _a3.includes(feature)); + } + } + __name(PrismaClient, "PrismaClient"); + return PrismaClient; +} +__name(getPrismaClient, "getPrismaClient"); +var forbidden = ["$connect", "$disconnect", "$on", "$transaction", "$use"]; +function transactionProxy(thing, txId) { + if (typeof thing !== "object") + return thing; + return new Proxy(thing, { + get: (target, prop) => { + if (forbidden.includes(prop)) + return void 0; + if (prop === TX_ID) + return txId; + if (typeof target[prop] === "function") { + return (...args) => { + if (prop === "then") + return target[prop](args[0], args[1], txId); + if (prop === "catch") + return target[prop](args[0], txId); + if (prop === "finally") + return target[prop](args[0], txId); + return transactionProxy(target[prop](...args), txId); + }; + } + return transactionProxy(target[prop], txId); + } + }); +} +__name(transactionProxy, "transactionProxy"); +var rejectOnNotFoundReplacements = { + findUnique: "findUniqueOrThrow", + findFirst: "findFirstOrThrow" +}; +function warnAboutRejectOnNotFound(rejectOnNotFound, model, action) { + if (rejectOnNotFound) { + const replacementAction = rejectOnNotFoundReplacements[action]; + const replacementCall = model ? `prisma.${model}.${replacementAction}` : `prisma.${replacementAction}`; + const key = `rejectOnNotFound.${model != null ? model : ""}.${action}`; + warnOnce( + key, + `\`rejectOnNotFound\` option is deprecated and will be removed in Prisma 5. Please use \`${replacementCall}\` method instead` + ); + } +} +__name(warnAboutRejectOnNotFound, "warnAboutRejectOnNotFound"); + +// src/runtime/strictEnum.ts +var allowList = /* @__PURE__ */ new Set([ + "toJSON", + "asymmetricMatch", + Symbol.iterator, + Symbol.toStringTag, + Symbol.isConcatSpreadable, + Symbol.toPrimitive +]); +function makeStrictEnum(definition) { + return new Proxy(definition, { + get(target, property) { + if (property in target) { + return target[property]; + } + if (allowList.has(property)) { + return void 0; + } + throw new TypeError(`Invalid enum value: ${String(property)}`); + } + }); +} +__name(makeStrictEnum, "makeStrictEnum"); + +// src/runtime/utils/find.ts +var import_fs10 = __toESM(require("fs")); +var import_path6 = __toESM(require("path")); +var import_util7 = require("util"); +var readdirAsync = (0, import_util7.promisify)(import_fs10.default.readdir); +var realpathAsync = (0, import_util7.promisify)(import_fs10.default.realpath); +var statAsync = (0, import_util7.promisify)(import_fs10.default.stat); +var readdirSync = import_fs10.default.readdirSync; +var realpathSync = import_fs10.default.realpathSync; +var statSync = import_fs10.default.statSync; +function direntToType(dirent) { + return dirent.isFile() ? "f" : dirent.isDirectory() ? "d" : dirent.isSymbolicLink() ? "l" : void 0; +} +__name(direntToType, "direntToType"); +function isMatched(string, regexs) { + for (const regex of regexs) { + if (typeof regex === "string") { + if (string.includes(regex)) { + return true; + } + } else if (regex.exec(string)) { + return true; + } + } + return false; +} +__name(isMatched, "isMatched"); +function findSync(root, match, types = ["f", "d", "l"], deep = [], limit = Infinity, handler = () => true, found = [], seen = {}) { + try { + const realRoot = realpathSync(root); + if (seen[realRoot]) { + return found; + } + if (limit - found.length <= 0) { + return found; + } + if (direntToType(statSync(realRoot)) !== "d") { + return found; + } + const items = readdirSync(root, { withFileTypes: true }); + seen[realRoot] = true; + for (const item of items) { + const itemName = item.name; + const itemType = direntToType(item); + const itemPath = import_path6.default.join(root, item.name); + if (itemType && types.includes(itemType)) { + if (isMatched(itemPath, match)) { + const value = handler(root, itemName, itemType); + if (typeof value === "string") { + found.push(value); + } else if (value === true) { + found.push(itemPath); + } + } + } + if (deep.includes(itemType)) { + findSync(itemPath, match, types, deep, limit, handler, found, seen); + } + } + } catch (e) { + } + return found; +} +__name(findSync, "findSync"); + +// src/runtime/warnEnvConflicts.ts +function warnEnvConflicts(envPaths) { + tryLoadEnvs(envPaths, { conflictCheck: "warn" }); +} +__name(warnEnvConflicts, "warnEnvConflicts"); + +// src/runtime/index.ts +var decompressFromBase642 = lzString.decompressFromBase64; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + DMMF, + DMMFClass, + Debug, + Decimal, + Engine, + MetricsClient, + NotFoundError, + PrismaClientInitializationError, + PrismaClientKnownRequestError, + PrismaClientRustPanicError, + PrismaClientUnknownRequestError, + PrismaClientValidationError, + Sql, + decompressFromBase64, + empty, + findSync, + getPrismaClient, + join, + makeDocument, + makeStrictEnum, + objectEnumValues, + raw, + sqltag, + transformDocument, + unpack, + warnEnvConflicts +}); +/*! + * decimal.js v10.4.0 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */ +/*! + * @description Recursive object extending + * @author Viacheslav Lotsmanov + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Viacheslav Lotsmanov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +/*! formdata-polyfill. MIT License. Jimmy Wärting */ diff --git a/samples/todo/.zenstack/.prisma/schema.prisma b/samples/todo/.zenstack/.prisma/schema.prisma new file mode 100644 index 000000000..5f373fdc6 --- /dev/null +++ b/samples/todo/.zenstack/.prisma/schema.prisma @@ -0,0 +1,110 @@ +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +generator client { + provider = "prisma-client-js" + output = "./.prisma" +} + +enum SpaceUserRole { + USER + ADMIN +} + +model Space { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + name String + slug String @unique + members SpaceUser[] + todoLists TodoList[] +} + +model SpaceUser { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + spaceId String + space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) + userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + role SpaceUserRole +} + +model User { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + email String @unique + emailVerified DateTime? + password String + accounts Account[] + sessions Session[] + name String? + todoList TodoList[] + spaces SpaceUser[] + image String? + Todo Todo[] +} + +model Account { + id String @id @default(cuid()) + userId String + type String + provider String + providerAccountId String + refresh_token String? + access_token String? + expires_at Int? + token_type String? + scope String? + id_token String? + session_state String? + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + + @@unique([provider, providerAccountId]) +} + +model Session { + id String @id @default(cuid()) + sessionToken String @unique + userId String + expires DateTime + user User @relation(fields: [userId], references: [id], onDelete: Cascade) +} + +model VerificationToken { + identifier String + token String @unique + expires DateTime + + @@unique([identifier, token]) +} + +model TodoList { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + spaceId String + space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) + ownerId String + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + title String + private Boolean @default(false) + todos Todo[] +} + +model Todo { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + ownerId String + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + todoListId String + todoList TodoList @relation(fields: [todoListId], references: [id], onDelete: Cascade) + title String + completedAt DateTime? +} diff --git a/samples/todo/.zenstack/auth/authorize.ts b/samples/todo/.zenstack/auth/authorize.ts new file mode 100644 index 000000000..4bc2659b1 --- /dev/null +++ b/samples/todo/.zenstack/auth/authorize.ts @@ -0,0 +1,69 @@ +import { ZenStackClient } from '../client'; +import { hash, compare } from 'bcryptjs'; + +async function hashPassword(password: string) { + const hashedPassword = await hash(password, 12); + return hashedPassword; +} + +async function verifyPassword(password: string, hashedPassword: string) { + const isValid = await compare(password, hashedPassword); + return isValid; +} + +export function Authorize(client: ZenStackClient) { + return async ( + credentials: Record<'email' | 'password', string> | undefined + ) => { + try { + let maybeUser = await client.prisma.user.findFirst({ + where: { + email: credentials!.email, + }, + select: { + id: true, + email: true, + password: true, + name: true, + }, + }); + + if (!maybeUser) { + if (!credentials!.password || !credentials!.email) { + throw new Error('Invalid Credentials'); + } + + maybeUser = await client.prisma.user.create({ + data: { + email: credentials!.email, + password: await hashPassword(credentials!.password), + }, + select: { + id: true, + email: true, + password: true, + name: true, + }, + }); + } else { + const isValid = await verifyPassword( + credentials!.password, + maybeUser.password + ); + + if (!isValid) { + throw new Error('Invalid Credentials'); + } + } + + return { + id: maybeUser.id, + email: maybeUser.email, + name: maybeUser.name, + }; + } catch (error) { + console.log(error); + throw error; + } + }; +} diff --git a/samples/todo/.zenstack/auth/index.ts b/samples/todo/.zenstack/auth/index.ts new file mode 100644 index 000000000..efa511364 --- /dev/null +++ b/samples/todo/.zenstack/auth/index.ts @@ -0,0 +1,2 @@ +export * from './next-auth-adapter'; +export * from './authorize'; diff --git a/samples/todo/.zenstack/auth/next-auth-adapter.ts b/samples/todo/.zenstack/auth/next-auth-adapter.ts new file mode 100644 index 000000000..9f6b68e6f --- /dev/null +++ b/samples/todo/.zenstack/auth/next-auth-adapter.ts @@ -0,0 +1,58 @@ +import { ZenStackClient } from '../client'; +import { Adapter } from 'next-auth/adapters'; +import { Prisma } from '@zenstack/.prisma'; + +export function NextAuthAdapter(client: ZenStackClient): Adapter { + const p = client.prisma; + return { + createUser: (data) => p.user.create({ data }), + getUser: (id) => p.user.findUnique({ where: { id } }), + getUserByEmail: (email) => p.user.findUnique({ where: { email } }), + async getUserByAccount(provider_providerAccountId) { + const account = await p.account.findUnique({ + where: { provider_providerAccountId }, + select: { user: true }, + }); + return account?.user ?? null; + }, + updateUser: (data) => p.user.update({ where: { id: data.id }, data }), + deleteUser: (id) => p.user.delete({ where: { id } }), + linkAccount: (data) => p.account.create({ data }) as any, + unlinkAccount: (provider_providerAccountId) => + p.account.delete({ where: { provider_providerAccountId } }) as any, + async getSessionAndUser(sessionToken) { + const userAndSession = await p.session.findUnique({ + where: { sessionToken }, + include: { user: true }, + }); + if (!userAndSession) return null; + const { user, ...session } = userAndSession; + return { user, session }; + }, + createSession: (data) => p.session.create({ data }), + updateSession: (data) => + p.session.update({ + data, + where: { sessionToken: data.sessionToken }, + }), + deleteSession: (sessionToken) => + p.session.delete({ where: { sessionToken } }), + createVerificationToken: (data) => p.verificationToken.create({ data }), + async useVerificationToken(identifier_token) { + try { + return await p.verificationToken.delete({ + where: { identifier_token }, + }); + } catch (error) { + // If token already used/deleted, just return null + // https://www.prisma.io/docs/reference/api-reference/error-reference#p2025 + if ( + (error as Prisma.PrismaClientKnownRequestError).code === + 'P2025' + ) + return null; + throw error; + } + }, + }; +} diff --git a/samples/todo/.zenstack/client.ts b/samples/todo/.zenstack/client.ts new file mode 100644 index 000000000..7b4f36ea7 --- /dev/null +++ b/samples/todo/.zenstack/client.ts @@ -0,0 +1,22 @@ +import { PrismaClient } from './.prisma'; + +export class ZenStackClient { + readonly prisma: PrismaClient; + + constructor() { + this.prisma = new PrismaClient(); + this.prisma.todoList.findMany({ + select: { + title: true, + }, + where: { + title: { + contains: 'hello', + }, + }, + }); + } +} + +const client = new ZenStackClient(); +export default client; diff --git a/samples/todo/.zenstack/functions/index.ts b/samples/todo/.zenstack/functions/index.ts new file mode 100644 index 000000000..a516f1442 --- /dev/null +++ b/samples/todo/.zenstack/functions/index.ts @@ -0,0 +1 @@ +export * from './invite-user'; diff --git a/samples/todo/.zenstack/functions/invite-user.ts b/samples/todo/.zenstack/functions/invite-user.ts new file mode 100644 index 000000000..b88c4e97c --- /dev/null +++ b/samples/todo/.zenstack/functions/invite-user.ts @@ -0,0 +1,20 @@ +import { SpaceUserRole } from '../.prisma'; + +export async function inviteUser( + spaceId: string, + userId: string, + role: SpaceUserRole +) { + const r = await fetch('/api/zen/function/invite-user', { + method: 'POST', + headers: { + 'content-type': 'application/json', + }, + body: JSON.stringify({ + spaceId, + userId, + role, + }), + }); + return r.json(); +} diff --git a/samples/todo/.zenstack/hooks/index.ts b/samples/todo/.zenstack/hooks/index.ts new file mode 100644 index 000000000..0e0a6ea34 --- /dev/null +++ b/samples/todo/.zenstack/hooks/index.ts @@ -0,0 +1,3 @@ +export * from './user'; +export * from './todo'; +export * from './todo-list'; diff --git a/samples/todo/.zenstack/hooks/request.ts b/samples/todo/.zenstack/hooks/request.ts new file mode 100644 index 000000000..b10a4a866 --- /dev/null +++ b/samples/todo/.zenstack/hooks/request.ts @@ -0,0 +1,62 @@ +import useSWR from 'swr'; +import type { ScopedMutator } from 'swr/dist/types'; + +const fetcher = async (url: string, options?: RequestInit) => { + const res = await fetch(url, options); + if (!res.ok) { + const error: Error & { info?: any; status?: number } = new Error( + 'An error occurred while fetching the data.' + ); + // Attach extra info to the error object. + error.info = await res.json(); + error.status = res.status; + throw error; + } + return res.json(); +}; + +export function swr(url: string) { + return useSWR(url, fetcher); +} + +export async function post( + url: string, + data: Data, + mutate: ScopedMutator +) { + const r: Result = await fetcher(url, { + method: 'POST', + headers: { + 'content-type': 'application/json', + }, + body: JSON.stringify(data), + }); + mutate(url); + return r; +} + +export async function put( + url: string, + data: Data, + mutate: ScopedMutator +) { + const r: Result = await fetcher(url, { + method: 'PUT', + headers: { + 'content-type': 'application/json', + }, + body: JSON.stringify(data), + }); + mutate(url, r); + return r; +} + +export async function del(url: string, mutate: ScopedMutator) { + const r: Result = await fetcher(url, { + method: 'DELETE', + }); + const path = url.split('/'); + path.pop(); + mutate(path.join('/')); + return r; +} diff --git a/samples/todo/.zenstack/hooks/todo-list.ts b/samples/todo/.zenstack/hooks/todo-list.ts new file mode 100644 index 000000000..3091d22a5 --- /dev/null +++ b/samples/todo/.zenstack/hooks/todo-list.ts @@ -0,0 +1,70 @@ +import { useSWRConfig } from 'swr'; +import { + TodoListCreateArgs, + TodoListCreateResult, + TodoListDeleteArgs, + TodoListFindArgs, + TodoListFindArgsInput, + TodoListFindResult, + TodoListGetArgs, + TodoListGetArgsInput, + TodoListUpdateArgs, + TodoListUpdateResult, +} from '../types'; +import { put, del as _del, post, swr } from './request'; + +const base = '/api/zen/data/todoList'; + +export function useTodoList() { + const { mutate } = useSWRConfig(); + + async function create( + data: TodoListCreateArgs + ) { + return post>( + base, + data, + mutate + ); + } + + function find(args?: TodoListFindArgs) { + let endpoint = base; + if (args) { + endpoint += `?q=${encodeURIComponent(JSON.stringify(args))}`; + } + return swr>(endpoint); + } + + function get( + id: string, + args?: TodoListGetArgs + ) { + let endpoint = `${base}/${id}`; + if (args) { + endpoint += `?q=${encodeURIComponent(JSON.stringify(args))}`; + } + return swr>(endpoint); + } + + async function update( + id: string, + data: TodoListUpdateArgs + ) { + return put>( + `${base}/batch`, + data, + mutate + ); + } + + async function del(id: string, args?: TodoListDeleteArgs) { + let url = `${base}/${id}`; + if (args) { + url += `?q=${encodeURIComponent(JSON.stringify(args))}`; + } + return _del(url, mutate); + } + + return { create, find, get, update, del }; +} diff --git a/samples/todo/.zenstack/hooks/todo.ts b/samples/todo/.zenstack/hooks/todo.ts new file mode 100644 index 000000000..9771fef54 --- /dev/null +++ b/samples/todo/.zenstack/hooks/todo.ts @@ -0,0 +1,3 @@ +import type { Prisma as P, Todo as _Todo } from '../.prisma'; + +export type Todo = _Todo; diff --git a/samples/todo/.zenstack/hooks/user.ts b/samples/todo/.zenstack/hooks/user.ts new file mode 100644 index 000000000..1913d3d84 --- /dev/null +++ b/samples/todo/.zenstack/hooks/user.ts @@ -0,0 +1,8 @@ +export type User = { + id: string; + createdAt: Date; + updatedAt: Date; + email: string; + name?: string; + image?: string; +}; diff --git a/samples/todo/.zenstack/index.ts b/samples/todo/.zenstack/index.ts new file mode 100644 index 000000000..d10d65e75 --- /dev/null +++ b/samples/todo/.zenstack/index.ts @@ -0,0 +1,2 @@ +export { default as client } from './client'; +export * from './auth'; diff --git a/samples/todo/.zenstack/migrations/20220926071545_initial/migration.sql b/samples/todo/.zenstack/migrations/20220926071545_initial/migration.sql new file mode 100644 index 000000000..074353660 --- /dev/null +++ b/samples/todo/.zenstack/migrations/20220926071545_initial/migration.sql @@ -0,0 +1,142 @@ +-- CreateEnum +CREATE TYPE "SpaceUserRole" AS ENUM ('USER', 'ADMIN'); + +-- CreateTable +CREATE TABLE "Space" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "name" TEXT NOT NULL, + "slug" TEXT NOT NULL, + + CONSTRAINT "Space_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "SpaceUser" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "spaceId" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "role" "SpaceUserRole" NOT NULL, + + CONSTRAINT "SpaceUser_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "email" TEXT NOT NULL, + "emailVerified" TIMESTAMP(3), + "password" TEXT NOT NULL, + "name" TEXT, + "image" TEXT, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Account" ( + "id" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "type" TEXT NOT NULL, + "provider" TEXT NOT NULL, + "providerAccountId" TEXT NOT NULL, + "refresh_token" TEXT, + "access_token" TEXT, + "expires_at" INTEGER, + "token_type" TEXT, + "scope" TEXT, + "id_token" TEXT, + "session_state" TEXT, + + CONSTRAINT "Account_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Session" ( + "id" TEXT NOT NULL, + "sessionToken" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "expires" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Session_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "VerificationToken" ( + "identifier" TEXT NOT NULL, + "token" TEXT NOT NULL, + "expires" TIMESTAMP(3) NOT NULL +); + +-- CreateTable +CREATE TABLE "TodoList" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "spaceId" TEXT NOT NULL, + "ownerId" TEXT NOT NULL, + "title" TEXT NOT NULL, + "private" BOOLEAN NOT NULL DEFAULT false, + + CONSTRAINT "TodoList_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Todo" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "ownerId" TEXT NOT NULL, + "todoListId" TEXT NOT NULL, + "title" TEXT NOT NULL, + "completedAt" TIMESTAMP(3), + + CONSTRAINT "Todo_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Space_slug_key" ON "Space"("slug"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token"); + +-- AddForeignKey +ALTER TABLE "SpaceUser" ADD CONSTRAINT "SpaceUser_spaceId_fkey" FOREIGN KEY ("spaceId") REFERENCES "Space"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SpaceUser" ADD CONSTRAINT "SpaceUser_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "TodoList" ADD CONSTRAINT "TodoList_spaceId_fkey" FOREIGN KEY ("spaceId") REFERENCES "Space"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "TodoList" ADD CONSTRAINT "TodoList_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Todo" ADD CONSTRAINT "Todo_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Todo" ADD CONSTRAINT "Todo_todoListId_fkey" FOREIGN KEY ("todoListId") REFERENCES "TodoList"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/samples/todo/.zenstack/migrations/migration_lock.toml b/samples/todo/.zenstack/migrations/migration_lock.toml new file mode 100644 index 000000000..fbffa92c2 --- /dev/null +++ b/samples/todo/.zenstack/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (i.e. Git) +provider = "postgresql" \ No newline at end of file diff --git a/samples/todo/.zenstack/schema.prisma b/samples/todo/.zenstack/schema.prisma new file mode 100644 index 000000000..5f373fdc6 --- /dev/null +++ b/samples/todo/.zenstack/schema.prisma @@ -0,0 +1,110 @@ +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +generator client { + provider = "prisma-client-js" + output = "./.prisma" +} + +enum SpaceUserRole { + USER + ADMIN +} + +model Space { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + name String + slug String @unique + members SpaceUser[] + todoLists TodoList[] +} + +model SpaceUser { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + spaceId String + space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) + userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + role SpaceUserRole +} + +model User { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + email String @unique + emailVerified DateTime? + password String + accounts Account[] + sessions Session[] + name String? + todoList TodoList[] + spaces SpaceUser[] + image String? + Todo Todo[] +} + +model Account { + id String @id @default(cuid()) + userId String + type String + provider String + providerAccountId String + refresh_token String? + access_token String? + expires_at Int? + token_type String? + scope String? + id_token String? + session_state String? + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + + @@unique([provider, providerAccountId]) +} + +model Session { + id String @id @default(cuid()) + sessionToken String @unique + userId String + expires DateTime + user User @relation(fields: [userId], references: [id], onDelete: Cascade) +} + +model VerificationToken { + identifier String + token String @unique + expires DateTime + + @@unique([identifier, token]) +} + +model TodoList { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + spaceId String + space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) + ownerId String + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + title String + private Boolean @default(false) + todos Todo[] +} + +model Todo { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + ownerId String + owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) + todoListId String + todoList TodoList @relation(fields: [todoListId], references: [id], onDelete: Cascade) + title String + completedAt DateTime? +} diff --git a/samples/todo/.zenstack/server/data/index.ts b/samples/todo/.zenstack/server/data/index.ts new file mode 100644 index 000000000..2b497bf58 --- /dev/null +++ b/samples/todo/.zenstack/server/data/index.ts @@ -0,0 +1,19 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import todoListHandler from './todo-list'; +import { RequestionHandlerOptions } from '../index'; + +export default async function ( + req: NextApiRequest, + res: NextApiResponse, + path: string[], + options: RequestionHandlerOptions +) { + const [type, ...rest] = path; + switch (type) { + case 'todoList': + return todoListHandler(req, res, rest, options); + + default: + res.status(404).json({ error: 'Unknown type: ' + type }); + } +} diff --git a/samples/todo/.zenstack/server/data/todo-list.ts b/samples/todo/.zenstack/server/data/todo-list.ts new file mode 100644 index 000000000..e77b08c81 --- /dev/null +++ b/samples/todo/.zenstack/server/data/todo-list.ts @@ -0,0 +1,137 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import { + TodoListCreateArgs, + TodoListFindArgsInput, + TodoListUpdateArgs, +} from '../../types'; +import client from '../../client'; +import { requireUser, unauthorized } from './utils'; +import { RequestionHandlerOptions } from '..'; + +async function handleGet( + req: NextApiRequest, + res: NextApiResponse, + path: string[], + options: RequestionHandlerOptions +) { + const user = await requireUser(req, res, options); + if (!user) { + return; + } + + const condition = req.query.q + ? (JSON.parse(req.query.q as string) as TodoListFindArgsInput) + : null; + + const args: TodoListFindArgsInput = { + ...condition, + where: { + AND: [ + condition?.where ? condition.where : {}, + { + OR: [ + { + ownerId: user.id, + }, + { + space: { + members: { + some: { + userId: user.id, + }, + }, + }, + }, + ], + }, + ], + }, + }; + + const r = await client.prisma.todoList.findMany(args); + res.status(200).send(r); +} + +async function handlePost( + req: NextApiRequest, + res: NextApiResponse, + path: string[], + options: RequestionHandlerOptions +) { + const user = await requireUser(req, res, options); + if (!user) { + return; + } + + const body = req.body as TodoListCreateArgs; + if (body.data.ownerId && body.data.ownerId !== user.id) { + return unauthorized(res); + } + + const r = await client.prisma.todoList.create(body); + + res.status(200).send(r); +} + +async function handlePut( + req: NextApiRequest, + res: NextApiResponse, + path: string[], + options: RequestionHandlerOptions +) { + const user = await requireUser(req, res, options); + if (!user) { + return; + } + + const body = req.body as TodoListUpdateArgs; + if (body.data.ownerId && body.data.ownerId !== user.id) { + return unauthorized(res); + } + + const r = await client.prisma.todoList.update({ + where: { id: path[0] }, + ...body, + }); + + res.status(200).send(r); +} + +async function handleDelete( + req: NextApiRequest, + res: NextApiResponse, + path: string[], + options: RequestionHandlerOptions +) { + const user = await requireUser(req, res, options); + if (!user) { + return; + } + + const r = await client.prisma.todoList.delete({ + where: { id: path[0] }, + }); + + res.status(200).send(r); +} + +export default async function ( + req: NextApiRequest, + res: NextApiResponse, + path: string[], + options: RequestionHandlerOptions +) { + switch (req.method) { + case 'GET': + return handleGet(req, res, path, options); + + case 'POST': + return handlePost(req, res, path, options); + + case 'PUT': + return handlePut(req, res, path, options); + + case 'DELETE': + return handleDelete(req, res, path, options); + } +} diff --git a/samples/todo/.zenstack/server/data/utils.ts b/samples/todo/.zenstack/server/data/utils.ts new file mode 100644 index 000000000..bb52c1bec --- /dev/null +++ b/samples/todo/.zenstack/server/data/utils.ts @@ -0,0 +1,20 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import { RequestionHandlerOptions } from '..'; + +export async function requireUser( + req: NextApiRequest, + res: NextApiResponse, + options: RequestionHandlerOptions +) { + const user = await options.getServerUser(req, res); + if (!user || !user.id) { + res.status(401).json({ message: 'User not logged in' }); + return undefined; + } else { + return user; + } +} + +export function unauthorized(res: NextApiResponse) { + res.status(403).json({ message: 'Unauthorized' }); +} diff --git a/samples/todo/.zenstack/server/function/index.ts b/samples/todo/.zenstack/server/function/index.ts new file mode 100644 index 000000000..08795a056 --- /dev/null +++ b/samples/todo/.zenstack/server/function/index.ts @@ -0,0 +1,19 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import { RequestionHandlerOptions } from '..'; +import inviteUserHandler from './invite-user'; + +export default async function ( + req: NextApiRequest, + res: NextApiResponse, + path: string[], + options: RequestionHandlerOptions +) { + const [type, ...rest] = path; + switch (type) { + case 'invite-user': + return inviteUserHandler(req, res, rest, options); + + default: + res.status(404).json({ error: 'Unknown function: ' + type }); + } +} diff --git a/samples/todo/.zenstack/server/function/invite-user.ts b/samples/todo/.zenstack/server/function/invite-user.ts new file mode 100644 index 000000000..390a221da --- /dev/null +++ b/samples/todo/.zenstack/server/function/invite-user.ts @@ -0,0 +1,30 @@ +import { SpaceUserRole } from '@zenstack/.prisma'; +import { NextApiRequest, NextApiResponse } from 'next'; +import handler from 'functions/invite-user'; +import zenstack from '@zenstack/client'; +import { RequestionHandlerOptions } from '..'; +import { requireUser } from '../data/utils'; + +export default async function ( + req: NextApiRequest, + res: NextApiResponse, + path: string[], + options: RequestionHandlerOptions +) { + console.log('Handling function invite-user'); + const body: { spaceId: string; userId: string; role: SpaceUserRole } = + req.body; + + const user = await requireUser(req, res, options); + if (!user) { + return; + } + + const r = await handler( + { db: zenstack.prisma, user }, + body.spaceId, + body.userId, + body.role + ); + res.status(200).send(r); +} diff --git a/samples/todo/.zenstack/server/index.ts b/samples/todo/.zenstack/server/index.ts new file mode 100644 index 000000000..2f84b2af3 --- /dev/null +++ b/samples/todo/.zenstack/server/index.ts @@ -0,0 +1,29 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import dataHandler from './data'; +import functionHandler from './function'; + +export type RequestionHandlerOptions = { + getServerUser: ( + req: NextApiRequest, + res: NextApiResponse + ) => Promise<{ id: string } | undefined>; +}; + +export function RequestHandler(options: RequestionHandlerOptions) { + return async (req: NextApiRequest, res: NextApiResponse) => { + console.log('ZenStack request:', req.query.path); + + const [route, ...rest] = req.query.path as string[]; + + switch (route) { + case 'data': + return dataHandler(req, res, rest, options); + + case 'function': + return functionHandler(req, res, rest, options); + + default: + res.status(404).json({ error: 'Unknown route: ' + route }); + } + }; +} diff --git a/samples/todo/.zenstack/types.ts b/samples/todo/.zenstack/types.ts new file mode 100644 index 000000000..9bbbbf323 --- /dev/null +++ b/samples/todo/.zenstack/types.ts @@ -0,0 +1,53 @@ +import type { + Prisma as P, + PrismaClient, + TodoList as _TodoList, +} from './.prisma'; + +export type TodoList = _TodoList; + +export type TodoListCreateArgs = P.TodoListCreateArgs; +export type TodoListCreateResult = P.CheckSelect< + T, + TodoList, + P.TodoListGetPayload +>; + +export type TodoListFindArgsInput = P.TodoListFindManyArgs; +export type TodoListFindArgs = P.SelectSubset< + T, + TodoListFindArgsInput +>; +export type TodoListFindResult = P.CheckSelect< + T, + Array, + Array> +>; + +export type TodoListGetArgsInput = Pick< + TodoListFindArgsInput, + 'select' | 'include' +>; +export type TodoListGetArgs = P.SelectSubset< + T, + TodoListGetArgsInput +>; + +export type TodoListUpdateArgs = P.TodoListUpdateArgs; +export type TodoListUpdateResult = P.CheckSelect< + T, + TodoList, + P.TodoListGetPayload +>; + +export type TodoListDeleteArgs = P.TodoListDeleteArgs; +export type TodoListDeleteResult = P.CheckSelect< + T, + TodoList, + P.TodoListGetPayload +>; + +export type FunctionContext = { + db: PrismaClient; + user?: { id: string } | null; +}; diff --git a/samples/todo/README.md b/samples/todo/README.md new file mode 100644 index 000000000..c87e0421d --- /dev/null +++ b/samples/todo/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/samples/todo/components/AccessDenied.tsx b/samples/todo/components/AccessDenied.tsx new file mode 100644 index 000000000..bb865f61c --- /dev/null +++ b/samples/todo/components/AccessDenied.tsx @@ -0,0 +1,20 @@ +import { signIn } from 'next-auth/react'; + +export default function AccessDenied() { + return ( + <> +

Access Denied

+

+ { + e.preventDefault(); + signIn(); + }} + > + You must be signed in to view this page + +

+ + ); +} diff --git a/samples/todo/components/LoginButton.tsx b/samples/todo/components/LoginButton.tsx new file mode 100644 index 000000000..f70de7283 --- /dev/null +++ b/samples/todo/components/LoginButton.tsx @@ -0,0 +1,22 @@ +import { useSession, signIn, signOut } from 'next-auth/react'; + +export default function Component() { + const { data: session } = useSession(); + if (session) { + return ( + <> +
Signed in as {session.user?.email}
+ + + ); + } + return ( + <> + + + ); +} diff --git a/samples/todo/functions/invite-user.ts b/samples/todo/functions/invite-user.ts new file mode 100644 index 000000000..7f4e79f14 --- /dev/null +++ b/samples/todo/functions/invite-user.ts @@ -0,0 +1,21 @@ +import { SpaceUserRole } from '@zenstack/.prisma'; +import { FunctionContext } from '@zenstack/types'; + +async function func( + context: FunctionContext, + spaceId: string, + userId: string, + role: SpaceUserRole +) { + const r = await context.db.spaceUser.create({ + data: { + userId, + spaceId, + role, + }, + }); + // send email + return r; +} + +export default func; diff --git a/samples/todo/next.config.js b/samples/todo/next.config.js new file mode 100644 index 000000000..ae887958d --- /dev/null +++ b/samples/todo/next.config.js @@ -0,0 +1,7 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + reactStrictMode: true, + swcMinify: true, +} + +module.exports = nextConfig diff --git a/samples/todo/package.json b/samples/todo/package.json new file mode 100644 index 000000000..0cc619fb8 --- /dev/null +++ b/samples/todo/package.json @@ -0,0 +1,37 @@ +{ + "name": "todo", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint", + "db-gen": "prisma generate --schema .zenstack/schema.prisma", + "db-push": "prisma db push --schema .zenstack/schema.prisma", + "db-migrate": "prisma migrate dev --schema .zenstack/schema.prisma", + "db-reset": "prisma migrate reset --schema .zenstack/schema.prisma" + }, + "dependencies": { + "@prisma/client": "^4.3.1", + "daisyui": "^2.31.0", + "next": "12.3.1", + "next-auth": "^4.10.3", + "react": "18.2.0", + "react-dom": "18.2.0", + "swr": "^1.3.0" + }, + "devDependencies": { + "@types/bcryptjs": "^2.4.2", + "@types/node": "^14.17.3", + "@types/react": "18.0.21", + "@types/react-dom": "18.0.6", + "autoprefixer": "^10.4.12", + "eslint": "^7.19.0", + "eslint-config-next": "12.3.1", + "postcss": "^8.4.16", + "prisma": "^4.3.1", + "tailwindcss": "^3.1.8", + "typescript": "^4.6.2" + } +} diff --git a/samples/todo/pages/_app.tsx b/samples/todo/pages/_app.tsx new file mode 100644 index 000000000..505acdf46 --- /dev/null +++ b/samples/todo/pages/_app.tsx @@ -0,0 +1,13 @@ +import '../styles/globals.css'; +import type { AppProps } from 'next/app'; +import { SessionProvider } from 'next-auth/react'; + +function MyApp({ Component, pageProps: { session, ...pageProps } }: AppProps) { + return ( + + + + ); +} + +export default MyApp; diff --git a/samples/todo/pages/api/auth/[...nextauth].ts b/samples/todo/pages/api/auth/[...nextauth].ts new file mode 100644 index 000000000..70334e68f --- /dev/null +++ b/samples/todo/pages/api/auth/[...nextauth].ts @@ -0,0 +1,51 @@ +import NextAuth, { NextAuthOptions } from 'next-auth'; +import CredentialsProvider from 'next-auth/providers/credentials'; +import GoogleProvider from 'next-auth/providers/google'; +import { Authorize, NextAuthAdapter as Adapter } from '@zenstack/auth'; +import { client } from '@zenstack'; + +export const authOptions: NextAuthOptions = { + // Configure one or more authentication providers + + adapter: Adapter(client), + + session: { + strategy: 'jwt', + }, + + providers: [ + GoogleProvider({ + clientId: process.env.GOOGLE_ID!, + clientSecret: process.env.GOOGLE_SECRET!, + }), + CredentialsProvider({ + credentials: { + email: { + label: 'Email Address', + type: 'email', + placeholder: 'john.doe@example.com', + }, + password: { + label: 'Password', + type: 'password', + placeholder: 'Your super secure password', + }, + }, + authorize: Authorize(client), + }), + ], + + callbacks: { + async session({ session, token }) { + return { + ...session, + user: { + ...session.user, + id: token.sub!, + }, + }; + }, + }, +}; + +export default NextAuth(authOptions); diff --git a/samples/todo/pages/api/hello.ts b/samples/todo/pages/api/hello.ts new file mode 100644 index 000000000..f8bcc7e5c --- /dev/null +++ b/samples/todo/pages/api/hello.ts @@ -0,0 +1,13 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import type { NextApiRequest, NextApiResponse } from 'next' + +type Data = { + name: string +} + +export default function handler( + req: NextApiRequest, + res: NextApiResponse +) { + res.status(200).json({ name: 'John Doe' }) +} diff --git a/samples/todo/pages/api/zen/[...path].ts b/samples/todo/pages/api/zen/[...path].ts new file mode 100644 index 000000000..6930e427f --- /dev/null +++ b/samples/todo/pages/api/zen/[...path].ts @@ -0,0 +1,12 @@ +import { RequestHandler, RequestionHandlerOptions } from '@zenstack/server'; +import { NextApiRequest, NextApiResponse } from 'next'; +import { authOptions } from '@api/auth/[...nextauth]'; +import { unstable_getServerSession } from 'next-auth'; + +const options: RequestionHandlerOptions = { + async getServerUser(req: NextApiRequest, res: NextApiResponse) { + const session = await unstable_getServerSession(req, res, authOptions); + return session?.user; + }, +}; +export default RequestHandler(options); diff --git a/samples/todo/pages/index.tsx b/samples/todo/pages/index.tsx new file mode 100644 index 000000000..f8122b198 --- /dev/null +++ b/samples/todo/pages/index.tsx @@ -0,0 +1,106 @@ +import type { NextPage } from 'next'; +import LoginButton from '../components/LoginButton'; +import { useSession } from 'next-auth/react'; +import { useTodoList } from '@zenstack/hooks'; +import { inviteUser } from '@zenstack/functions'; +import { SpaceUserRole, TodoList } from '@zenstack/.prisma'; + +const Home: NextPage = () => { + const { data: session } = useSession(); + const { + create: createTodoList, + find: findTodoList, + del: deleteTodoList, + } = useTodoList(); + const { data: todoLists } = findTodoList(); + + async function onCreateTodoList() { + await createTodoList({ + data: { + title: 'My Todo List', + ownerId: session!.user.id, + spaceId: 'f0c9fc5c-e6e5-4146-a540-214f6ac5701c', + }, + }); + } + + async function onCreateFilledTodoList() { + await createTodoList({ + data: { + title: 'My Todo List', + ownerId: session!.user.id, + spaceId: 'f0c9fc5c-e6e5-4146-a540-214f6ac5701c', + todos: { + create: [ + { title: 'First Todo', ownerId: session!.user.id }, + ], + }, + }, + }); + } + + async function onDeleteTodoList(todoList: TodoList) { + await deleteTodoList(todoList.id); + } + + async function onInviteUser() { + await inviteUser( + 'f0c9fc5c-e6e5-4146-a540-214f6ac5701c', + 'dadd2e5b-d278-4695-8f6a-e6389bc109c0', + SpaceUserRole.ADMIN + ); + } + + function renderTodoLists() { + return ( + <> +
    + {todoLists?.map((todoList) => ( +
  • +

    {todoList.title}

    + +
  • + ))} +
+ + ); + } + + return ( +
+

Wonderful Todo

+
+ +
+ + {session && ( + <> + + + + + + +

Todo Lists

+ {renderTodoLists()} + + )} +
+ ); +}; + +export default Home; diff --git a/samples/todo/postcss.config.js b/samples/todo/postcss.config.js new file mode 100644 index 000000000..33ad091d2 --- /dev/null +++ b/samples/todo/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/samples/todo/public/favicon.ico b/samples/todo/public/favicon.ico new file mode 100644 index 000000000..718d6fea4 Binary files /dev/null and b/samples/todo/public/favicon.ico differ diff --git a/samples/todo/public/vercel.svg b/samples/todo/public/vercel.svg new file mode 100644 index 000000000..fbf0e25a6 --- /dev/null +++ b/samples/todo/public/vercel.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/samples/todo/schema.zmodel b/samples/todo/schema.zmodel new file mode 100644 index 000000000..c21e8f5c4 --- /dev/null +++ b/samples/todo/schema.zmodel @@ -0,0 +1,150 @@ +/* + * A sample model for a collaborative Todo app + */ + +// Datasource +datasource db { + provider = 'postgresql' + url = env('DATABASE_URL') +} + +enum SpaceUserRole { + USER + ADMIN +} + +// Fragments are used to define fields shared across data models +fragment CommonFields { + id String @id + createdAt DateTime @createdAt + updatedAt DateTime @updatedAt +} + +model Space { + ...CommonFields + + // @length is a field validation rule, enforced at create/update time + name String @length(1, 100) + + // @unique denotes single field unique index + slug String @unique @length(1, 20) + + members SpaceUser[] + todoLists TodoList[] + + // auth() is a built-in function which returns current user identity + // @@allow and @@deny are for defining access policies: + // - a request is denied if any @@deny rule evaluates to true + // - a request is denied if there isn't any @@allow rule evaluating to true + // + // Policies are enforced at db query/update/delete time + + // require login + @@deny('all', auth() == null) + + // everyone can create a space + @@allow('create', true) + + // any user in the space can read the space + // $this denotes current entity + // 'userInSpace' is a helper function defined subsequently + @@allow('read', userInSpace(auth(), $this)) + + // space admin can update and delete + @@allow('update,delete', userIsSpaceAdmin(auth(), $this)) +} + +// SpaceUser is a 'join table' which models many-to-many relationship between +// Space and User +model SpaceUser { + ...CommonFields + + // @cascade indicates cascading deletion from Space + space Space @cascade + user User @cascade + role SpaceUserRole + + // multi-field unique index + @@unique([user, space]) + + // require login + @@deny('all', auth() == null) + + // space admin can create/update/delete + @@allow('create,update,delete', userIsSpaceAdmin(auth(), space)) + + // user can read entries for spaces which he's a member of + @@allow('read', userInSpace(auth(), space)) +} + +model User { + ...CommonFields + + // @email is another validation rule + email String @unique @email + + name String? @length(1, 100) + todoList TodoList[] + spaces SpaceUser[] + + // @url is another validation rule + image String? @url + + // can be created by anyone, even not logged in + @@allow('create', true) + + // can be read by users sharing any space + @@allow('read', userInAnySpace(auth(), spaces)) + + // can only be updated and deleted by himeself + @@allow('update,delete', auth() == $this) +} + +model TodoList { + ...CommonFields + space Space @cascade + owner User + title String @length(1, 20) + private Boolean @default(false) + todos Todo[] + + // require login + @@deny('all', auth() == null) + + // can be read by owner or space members (only if not private) + @@allow('read', owner == auth() || (userInSpace(auth(), space) && !private)) + + // can be created/updated/deleted by owner + @@allow('create,update,delete', owner == auth() && userInSpace(auth(), space)) +} + +model Todo { + ...CommonFields + owner User + todoList TodoList @cascade + title String + completedAt DateTime? + + // require login + @@deny('all', auth() == null) + + // owner has full access, also space members have full access (if the parent TodoList is not private) + @@allow('all', todoList.owner == auth() || (userInSpace(auth(), todoList.space) && !todoList.private)) +} + +// Functions are for reusing policy rules, and are inlined during code generation + +// if the user is in the space +function userInSpace(user, space) { + some(space.members, $.user == user) +} + +// if the user is the admin of the space +function userIsSpaceAdmin(user, space) { + some(space.members, $.user == user && $.role == ADMIN) +} + +// if the user is a member of any of the given spaces +function userInAnySpace(user, spaces) { + some(spaces, $.user == user) +} \ No newline at end of file diff --git a/samples/todo/styles/globals.css b/samples/todo/styles/globals.css new file mode 100644 index 000000000..b5c61c956 --- /dev/null +++ b/samples/todo/styles/globals.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/samples/todo/tailwind.config.js b/samples/todo/tailwind.config.js new file mode 100644 index 000000000..89705bc79 --- /dev/null +++ b/samples/todo/tailwind.config.js @@ -0,0 +1,11 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + './pages/**/*.{js,ts,jsx,tsx}', + './components/**/*.{js,ts,jsx,tsx}', + ], + theme: { + extend: {}, + }, + plugins: [require('daisyui')], +}; diff --git a/samples/todo/tsconfig.json b/samples/todo/tsconfig.json new file mode 100644 index 000000000..854c3c712 --- /dev/null +++ b/samples/todo/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "baseUrl": ".", + "paths": { + "@api/*": ["pages/api/*"], + "@lib/*": ["lib/*"], + "@components/*": ["lib/components/*"], + "@components": ["lib/components/index"], + "@zenstack/*": [".zenstack/*"], + "@zenstack": [".zenstack/index"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/samples/todo/types/next-auth.d.ts b/samples/todo/types/next-auth.d.ts new file mode 100644 index 000000000..3fdf4e165 --- /dev/null +++ b/samples/todo/types/next-auth.d.ts @@ -0,0 +1,14 @@ +import { Session } from 'next-auth'; +import { JWT } from 'next-auth/jwt'; + +/** Example on how to extend the built-in session types */ +declare module 'next-auth' { + interface Session { + user: { id: string; name: string; email: string }; + } +} + +/** Example on how to extend the built-in types for JWT */ +declare module 'next-auth/jwt' { + interface JWT {} +} diff --git a/samples/todo/types/next.d.ts b/samples/todo/types/next.d.ts new file mode 100644 index 000000000..777c0a0be --- /dev/null +++ b/samples/todo/types/next.d.ts @@ -0,0 +1,16 @@ +import type { NextComponentType, NextPageContext } from 'next'; +import type { Session } from 'next-auth'; +import type { Router } from 'next/router'; + +declare module 'next/app' { + type AppProps

> = { + Component: NextComponentType; + router: Router; + __N_SSG?: boolean; + __N_SSP?: boolean; + pageProps: P & { + /** Initial session passed in from `getServerSideProps` or `getInitialProps` */ + session?: Session; + }; + }; +}